66# Translators:
77# ww song <[email protected] >, 201888# Shengjing Zhu <[email protected] >, 20199- # Meng Du <[email protected] >, 2019109# Freesand Leo <[email protected] >, 20191110# ppcfish <[email protected] >, 201911+ # Meng Du <[email protected] >, 20191212#
1313#, fuzzy
1414msgid ""
@@ -17,7 +17,7 @@ msgstr ""
1717"Report-Msgid-Bugs-To : \n "
1818"POT-Creation-Date : 2019-01-01 10:14+0900\n "
1919"PO-Revision-Date : 2017-02-16 17:42+0000\n "
20- "Last-Translator : ppcfish <ppcfish @gmail.com>, 2019\n "
20+ "Last-Translator : Meng Du <alphanow @gmail.com>, 2019\n "
2121"Language-Team : Chinese (China) (https://www.transifex.com/python-doc/teams/5390/zh_CN/)\n "
2222"MIME-Version : 1.0\n "
2323"Content-Type : text/plain; charset=UTF-8\n "
@@ -762,6 +762,7 @@ msgid ""
762762"be found either, because the value of the object found in that hash bin "
763763"would be different."
764764msgstr ""
765+ "字典的哈希表实现使用从键值计算的哈希值来查找键。如果键是可变对象,则其值可能会发生变化,因此其哈希值也会发生变化。但是,由于无论谁更改键对象都无法判断它是否被用作字典键值,因此无法在字典中修改条目。然后,当你尝试在字典中查找相同的对象时,将无法找到它,因为其哈希值不同。如果你尝试查找旧值,也不会找到它,因为在该哈希表中找到的对象的值会有所不同。"
765766
766767#: ../../faq/design.rst:519
767768msgid ""
@@ -770,16 +771,18 @@ msgid ""
770771" as the list ``L``. Tuples are immutable and can therefore be used as "
771772"dictionary keys."
772773msgstr ""
774+ "如果你想要一个用列表索引的字典,只需先将列表转换为元组;用函数 ``tuple(L)`` 创建一个元组,其条目与列表 ``L`` 相同。 "
775+ "元组是不可变的,因此可以用作字典键。"
773776
774777#: ../../faq/design.rst:523
775778msgid "Some unacceptable solutions that have been proposed:"
776- msgstr ""
779+ msgstr "已经提出的一些不可接受的解决方案: "
777780
778781#: ../../faq/design.rst:525
779782msgid ""
780783"Hash lists by their address (object ID). This doesn't work because if you "
781784"construct a new list with the same value it won't be found; e.g.::"
782- msgstr ""
785+ msgstr "哈希按其地址(对象ID)列出。这不起作用,因为如果你构造一个具有相同值的新列表,它将无法找到;例如:: "
783786
784787#: ../../faq/design.rst:531
785788msgid ""
@@ -788,6 +791,8 @@ msgid ""
788791"words, dictionary keys should be compared using ``==``, not using "
789792":keyword:`is`."
790793msgstr ""
794+ "会引发一个 :exc:`KeyError` 异常,因为第二行中使用的 ``[1, 2]`` 的 id 与第一行中的 id 不同。换句话说,应该使用 "
795+ "``==`` 来比较字典键,而不是使用 :keyword:`is` 。"
791796
792797#: ../../faq/design.rst:535
793798msgid ""
0 commit comments