@@ -1707,6 +1707,8 @@ msgid ""
17071707"sequence. Items in the sequence are not copied; they are referenced "
17081708"multiple times, as explained for ``s * n`` under :ref:`typesseq-common`."
17091709msgstr ""
1710+ "*n* 值为一个整数,或是一个实现了 :meth:`~object.__index__` 的对象。 *n* 值为零或负数将清空序列。 "
1711+ "序列中的项不会被拷贝;它们会被多次引用,正如 :ref:`typesseq-common` 中有关 ``s * n`` 的说明。"
17101712
17111713#: ../../library/stdtypes.rst:1136
17121714msgid "Lists"
@@ -1721,24 +1723,24 @@ msgstr "列表是可变序列,通常用于存放同类项目的集合(其中
17211723
17221724#: ../../library/stdtypes.rst:1146
17231725msgid "Lists may be constructed in several ways:"
1724- msgstr ""
1726+ msgstr "可以用多种方式构建列表: "
17251727
17261728#: ../../library/stdtypes.rst:1148
17271729msgid "Using a pair of square brackets to denote the empty list: ``[]``"
1728- msgstr ""
1730+ msgstr "使用一对方括号来表示空列表: ``[]`` "
17291731
17301732#: ../../library/stdtypes.rst:1149
17311733msgid ""
17321734"Using square brackets, separating items with commas: ``[a]``, ``[a, b, c]``"
1733- msgstr ""
1735+ msgstr "使用方括号,其中的项以逗号分隔: ``[a]``, ``[a, b, c]`` "
17341736
17351737#: ../../library/stdtypes.rst:1150
17361738msgid "Using a list comprehension: ``[x for x in iterable]``"
1737- msgstr ""
1739+ msgstr "使用列表推导式: ``[x for x in iterable]`` "
17381740
17391741#: ../../library/stdtypes.rst:1151
17401742msgid "Using the type constructor: ``list()`` or ``list(iterable)``"
1741- msgstr ""
1743+ msgstr "使用类型的构造器: ``list()`` 或 ``list(iterable)`` "
17421744
17431745#: ../../library/stdtypes.rst:1153
17441746msgid ""
@@ -1750,19 +1752,25 @@ msgid ""
17501752"returns ``[1, 2, 3]``. If no argument is given, the constructor creates a "
17511753"new empty list, ``[]``."
17521754msgstr ""
1755+ "构造器将构造一个列表,其中的项与 *iterable* 中的项具有相同的的值与顺序。 *iterable* 可以是序列、支持迭代的容器或其它可迭代对象。"
1756+ " 如果 *iterable* 已经是一个列表,将创建并返回其副本,类似于 ``iterable[:]``。 例如,``list('abc')`` 返回 "
1757+ "``['a', 'b', 'c']`` 而 ``list( (1, 2, 3) )`` 返回 ``[1, 2, 3]``。 "
1758+ "如果没有给出参数,构造器将创建一个空列表 ``[]``。"
17531759
17541760#: ../../library/stdtypes.rst:1162
17551761msgid ""
17561762"Many other operations also produce lists, including the :func:`sorted` "
17571763"built-in."
1758- msgstr ""
1764+ msgstr "其它许多操作也会产生列表,包括 :func:`sorted` 内置函数。 "
17591765
17601766#: ../../library/stdtypes.rst:1165
17611767msgid ""
17621768"Lists implement all of the :ref:`common <typesseq-common>` and :ref:`mutable"
17631769" <typesseq-mutable>` sequence operations. Lists also provide the following "
17641770"additional method:"
17651771msgstr ""
1772+ "列表实现了所有 :ref:`一般 <typesseq-common>` 和 :ref:`可变 <typesseq-mutable>` 序列的操作。 "
1773+ "列表还额外提供了以下方法:"
17661774
17671775#: ../../library/stdtypes.rst:1171
17681776msgid ""
@@ -1771,12 +1779,15 @@ msgid ""
17711779"the entire sort operation will fail (and the list will likely be left in a "
17721780"partially modified state)."
17731781msgstr ""
1782+ "此方法会对列表进行原地排序,只使用 ``<`` 来进行各项间比较。 异常不会被屏蔽 —— "
1783+ "如果有任何比较操作失败,整个排序操作将失败(而列表可能会处于被部分修改的状态)。"
17741784
17751785#: ../../library/stdtypes.rst:1176
17761786msgid ""
17771787":meth:`sort` accepts two arguments that can only be passed by keyword (:ref"
17781788":`keyword-only arguments <keyword-only_parameter>`):"
17791789msgstr ""
1790+ ":meth:`sort` 接受两个仅限以关键字形式传入的参数 (:ref:`仅限关键字参数 <keyword-only_parameter>`):"
17801791
17811792#: ../../library/stdtypes.rst:1179
17821793msgid ""
@@ -1786,12 +1797,14 @@ msgid ""
17861797"for the entire sorting process. The default value of ``None`` means that "
17871798"list items are sorted directly without calculating a separate key value."
17881799msgstr ""
1800+ "*key* 指定带有一个参数的函数,用于从每个列表元素中提取比较键 (例如 ``key=str.lower``)。 "
1801+ "对应于列表中每一项的键会被计算一次,然后在整个排序过程中使用。 默认值 ``None`` 表示直接对列表项排序而不计算一个单独的键值。"
17891802
17901803#: ../../library/stdtypes.rst:1186
17911804msgid ""
17921805"The :func:`functools.cmp_to_key` utility is available to convert a 2.x style"
17931806" *cmp* function to a *key* function."
1794- msgstr ""
1807+ msgstr "可以使用 :func:`functools.cmp_to_key` 将 2.x 风格的 *cmp* 函数转换为 *key* 函数。 "
17951808
17961809#: ../../library/stdtypes.rst:1189
17971810msgid ""
0 commit comments