@@ -1417,6 +1417,9 @@ msgid ""
14171417"*j* is omitted or ``None``, use ``len(s)``. If *i* is greater than or equal"
14181418" to *j*, the slice is empty."
14191419msgstr ""
1420+ "*s* 从 *i* 到 *j* 的切片被定义为所有满足 ``i <= k < j`` 的索引号 *k* 的项组成的序列。 如果 *i* 或 *j* 大于"
1421+ " ``len(s)``,则使用 ``len(s)``。 如果 *i* 被省略或为 ``None``,则使用 ``0``。 如果 *j* 被省略或为 "
1422+ "``None``,则使用 ``len(s)``。 如果 *i* 大于等于 *j*,则切片为空。"
14201423
14211424#: ../../library/stdtypes.rst:949
14221425msgid ""
@@ -1430,6 +1433,11 @@ msgid ""
14301433"(which end depends on the sign of *k*). Note, *k* cannot be zero. If *k* is"
14311434" ``None``, it is treated like ``1``."
14321435msgstr ""
1436+ "*s* 从 *i* 到 *j* 步长为 *k* 的切片被定义为所有满足 ``0 <= n < (j-i)/k`` 的索引号 ``x = i + "
1437+ "n*k`` 的项组成的序列。 换句话说,索引号为 ``i``, ``i+k``, ``i+2*k``, ``i+3*k``,以此类推,当达到 *j* "
1438+ "时停止 (但一定不包括 *j*)。 当 *k* 为正值时,*i* 和 *j* 会被减至不大于 ``len(s)``。 当 *k* 为负值时,*i* 和 "
1439+ "*j* 会被减至不大于 ``len(s) - 1``。 如果 *i* 或 *j* 被省略或为 ``None``,它们会成为“终止”值 "
1440+ "(是哪一端的终止值则取决于 *k* 的符号)。 请注意,*k* 不可为零。 如果 *k* 为 ``None``,则当作 ``1`` 处理。"
14331441
14341442#: ../../library/stdtypes.rst:960
14351443msgid ""
@@ -1438,13 +1446,17 @@ msgid ""
14381446"quadratic runtime cost in the total sequence length. To get a linear "
14391447"runtime cost, you must switch to one of the alternatives below:"
14401448msgstr ""
1449+ "拼接不可变序列总是会生成新的对象。 这意味着通过重复拼接来构建序列的运行时开销将会基于序列总长度的乘方。 "
1450+ "想要获得线性的运行时开销,你必须改用下列替代方案之一:"
14411451
14421452#: ../../library/stdtypes.rst:965
14431453msgid ""
14441454"if concatenating :class:`str` objects, you can build a list and use "
14451455":meth:`str.join` at the end or else write to an :class:`io.StringIO` "
14461456"instance and retrieve its value when complete"
14471457msgstr ""
1458+ "如果拼接 :class:`str` 对象,你可以构建一个列表并在最后使用 :meth:`str.join` 或是写入一个 "
1459+ ":class:`io.StringIO` 实例并在结束时获取它的值"
14481460
14491461#: ../../library/stdtypes.rst:969
14501462msgid ""
@@ -1453,22 +1465,25 @@ msgid ""
14531465"concatenation with a :class:`bytearray` object. :class:`bytearray` objects "
14541466"are mutable and have an efficient overallocation mechanism"
14551467msgstr ""
1468+ "如果拼接 :class:`bytes` 对象,你可以类似地使用 :meth:`bytes.join` 或 "
1469+ ":class:`io.BytesIO`,或者你也可以使用 :class:`bytearray` 对象进行原地拼接。 :class:`bytearray`"
1470+ " 对象是可变的,并且具有高效的重分配机制"
14561471
14571472#: ../../library/stdtypes.rst:974
14581473msgid ""
14591474"if concatenating :class:`tuple` objects, extend a :class:`list` instead"
1460- msgstr ""
1475+ msgstr "如果拼接 :class:`tuple` 对象,请改为扩展 :class:`list` 类 "
14611476
14621477#: ../../library/stdtypes.rst:976
14631478msgid "for other types, investigate the relevant class documentation"
1464- msgstr ""
1479+ msgstr "对于其它类型,请查看相应的文档 "
14651480
14661481#: ../../library/stdtypes.rst:980
14671482msgid ""
14681483"Some sequence types (such as :class:`range`) only support item sequences "
14691484"that follow specific patterns, and hence don't support sequence "
14701485"concatenation or repetition."
1471- msgstr ""
1486+ msgstr "某些序列类型 (例如 :class:`range`) 仅支持遵循特定模式的项序列,因此并不支持序列拼接或重复。 "
14721487
14731488#: ../../library/stdtypes.rst:985
14741489msgid ""
0 commit comments