11111212# eric R <[email protected] >, 20211313# jaystone776 <[email protected] >, 202114- # Freesand Leo <[email protected] >, 20221514# Alpha Du <[email protected] >, 202215+ # Freesand Leo <[email protected] >, 20221616#
1717#, fuzzy
1818msgid ""
@@ -21,7 +21,7 @@ msgstr ""
2121"Report-Msgid-Bugs-To : \n "
2222"POT-Creation-Date : 2022-06-16 06:28+0000\n "
2323"PO-Revision-Date : 2021-06-28 01:49+0000\n "
24- "Last-Translator : Alpha Du <alphanow@gmail .com>, 2022\n "
24+ "Last-Translator : Freesand Leo <yuqinju@163 .com>, 2022\n "
2525"Language-Team : Chinese (China) (https://www.transifex.com/python-doc/teams/5390/zh_CN/)\n "
2626"MIME-Version : 1.0\n "
2727"Content-Type : text/plain; charset=UTF-8\n "
@@ -1022,12 +1022,14 @@ msgid ""
10221022":term:`generic class <generic type>` will generally return a "
10231023":ref:`GenericAlias <types-genericalias>` object."
10241024msgstr ""
1025+ "对一个 :ref:`容器类 <sequence-types>` 的实例执行抽取操作通常将会从该容器中选取一个元素。 而对一个 :term:`泛型类 "
1026+ "<generic type>` 执行抽取操作通常将会返回一个 :ref:`GenericAlias <types-genericalias>` 对象。"
10251027
10261028#: ../../reference/expressions.rst:834
10271029msgid ""
10281030"When an object is subscripted, the interpreter will evaluate the primary and"
10291031" the expression list."
1030- msgstr ""
1032+ msgstr "当一个对象被抽取时,解释器将对原型和表达式列表进行求值。 "
10311033
10321034#: ../../reference/expressions.rst:837
10331035msgid ""
@@ -1039,19 +1041,25 @@ msgid ""
10391041"``__class_getitem__`` is called instead of ``__getitem__``, see "
10401042":ref:`classgetitem-versus-getitem`."
10411043msgstr ""
1044+ "原型必须可被求值为一个支持抽取操作的对象。 一个对象可通过同时定义 :meth:`~object.__getitem__` 和 "
1045+ ":meth:`~object.__class_getitem__` 或其中之一来支持抽取操作。 "
1046+ "当原型被抽取时,表达式列表的求值结果将被传给以上方法中的一个。 对于在何时会调用 ``__class_getitem__`` 而不是 "
1047+ "``__getitem__`` 的更多细节,请参阅 :ref:`classgetitem-versus-getitem`。"
10421048
10431049#: ../../reference/expressions.rst:844
10441050msgid ""
10451051"If the expression list contains at least one comma, it will evaluate to a "
10461052":class:`tuple` containing the items of the expression list. Otherwise, the "
10471053"expression list will evaluate to the value of the list's sole member."
10481054msgstr ""
1055+ "如果表达式列表包含至少一个逗号,它将被求值为包含该表达式列表中所有条目的 :class:`tuple`。 "
1056+ "在其他情况下,表达式列表将被求值为列表中唯一成员的值。"
10491057
10501058#: ../../reference/expressions.rst:848
10511059msgid ""
10521060"For built-in objects, there are two types of objects that support "
10531061"subscription via :meth:`~object.__getitem__`:"
1054- msgstr ""
1062+ msgstr "对于内置对象,有两种类型的对象支持通过 :meth:`~object.__getitem__` 执行抽取操作: "
10551063
10561064#: ../../reference/expressions.rst:851
10571065msgid ""
@@ -1060,6 +1068,8 @@ msgid ""
10601068" subscription selects the value in the mapping that corresponds to that key."
10611069" An example of a builtin mapping class is the :class:`dict` class."
10621070msgstr ""
1071+ "映射。 如果原型是一个 :term:`mapping`,则表达式列表必须求值为一个以该映射的某个键为值的对象,而抽取操作会在映射中选取该键所对应的值。 "
1072+ "内置映射类的一个例子是 :class:`dict` 类。"
10631073
10641074#: ../../reference/expressions.rst:855
10651075msgid ""
@@ -1068,6 +1078,8 @@ msgid ""
10681078"following section). Examples of builtin sequence classes include the "
10691079":class:`str`, :class:`list` and :class:`tuple` classes."
10701080msgstr ""
1081+ "序列。 如果原型是一个 :term:`sequence`,则表达式列表必须求值为一个 :class:`int` 或一个 :class:`slice` "
1082+ "(如下面的小节所讨论的)。 内置序列类的例子包括 :class:`str`, :class:`list` 和 :class:`tuple` 等类。"
10711083
10721084#: ../../reference/expressions.rst:860
10731085msgid ""
@@ -1082,13 +1094,19 @@ msgid ""
10821094"object's :meth:`__getitem__` method, subclasses overriding this method will "
10831095"need to explicitly add that support."
10841096msgstr ""
1097+ "正式语法规则并未在 :term:`序列 <sequence>` 中设置负索引号的特殊保留条款。 "
1098+ "不过,内置序列都提供了通过给索引号加上序列长度来解读负索引号的 :meth:`~object.__getitem__` "
1099+ "方法,因此举例来说,``x[-1]`` 将选取 ``x`` 的最后一项。 "
1100+ "结果值必须为一个小于序列中条目数的非负整数,抽取操作会选取索引号为该值的条目(从零开始计数)。 由于对负索引号和切片的支持位于对象的 "
1101+ ":meth:`__getitem__` 方法中,因而重载此方法的子类将需要显式地添加这种支持。"
10851102
10861103#: ../../reference/expressions.rst:874
10871104msgid ""
10881105"A :class:`string <str>` is a special kind of sequence whose items are "
10891106"*characters*. A character is not a separate data type but a string of "
10901107"exactly one character."
10911108msgstr ""
1109+ ":class:`字符串 <str>` 是一种特殊的序列,其中的项是 *字符*。 字符并不是一种单独的数据类型而是长度恰好为一个字符的字符串。"
10921110
10931111#: ../../reference/expressions.rst:882
10941112msgid "Slicings"
0 commit comments