@@ -349,7 +349,7 @@ msgstr "如果不一定需要前缀“0b”,还可以使用如下的方法。"
349349#: ../../library/functions.rst:101 ../../library/functions.rst:678
350350#: ../../library/functions.rst:935
351351msgid "See also :func:`format` for more information."
352- msgstr "见 :func:`format` 查看更多信息 。"
352+ msgstr "另见 :func:`format` 获取更多信息 。"
353353
354354#: ../../library/functions.rst:106
355355msgid ""
@@ -361,9 +361,9 @@ msgid ""
361361"``True`` (see :ref:`bltin-boolean-values`)."
362362msgstr ""
363363"返回一个布尔值,``True`` 或者 ``False``。 *x* 使用标准的 :ref:`真值测试过程 <truth>` 来转换。如果 *x* "
364- "是假的或者被省略,返回 ``False``;其他情况返回 ``True``。:class:`bool` 类 :class:`int` 的子类(见 "
365- ":ref:`typesnumeric`)。其他类不能继承 :class:`bool` 类。它只有 ``False`` 和 ``True`` 两个实例(见 "
366- " :ref:`bltin-boolean-values`)。"
364+ "是假的或者被省略,返回 ``False``;其他情况返回 ``True``。:class:`bool` 类是 :class:`int` 的子类(参见 "
365+ ":ref:`typesnumeric`)。其他类不能继承 :class:`bool` 类。它只有 ``False`` 和 ``True`` "
366+ "两个实例(参见 :ref:`bltin-boolean-values`)。"
367367
368368#: ../../library/functions.rst:120
369369msgid ""
@@ -372,41 +372,46 @@ msgid ""
372372"methods of mutable sequences, described in :ref:`typesseq-mutable`, as well "
373373"as most methods that the :class:`bytes` type has, see :ref:`bytes-methods`."
374374msgstr ""
375+ "返回一个新的 bytes 数组。 :class:`bytearray` 类是一个可变序列,包含范围为 0 <= x < 256 "
376+ "的整数。它有可变序列大部分常见的方法,见 :ref:`typesseq-mutable` 的描述;同时有 :class:`bytes` "
377+ "类型的大部分方法,参见 :ref:`bytes-methods`。"
375378
376379#: ../../library/functions.rst:125
377380msgid ""
378381"The optional *source* parameter can be used to initialize the array in a few"
379382" different ways:"
380- msgstr ""
383+ msgstr "可选参数 *source* 可以用不同的方式来初始化数组: "
381384
382385#: ../../library/functions.rst:128
383386msgid ""
384387"If it is a *string*, you must also give the *encoding* (and optionally, "
385388"*errors*) parameters; :func:`bytearray` then converts the string to bytes "
386389"using :meth:`str.encode`."
387390msgstr ""
391+ "如果是一个 *string*,您必须提供 *encoding* 参数(*errors* 参数仍是可选的);:func:`bytearray` 会使用 "
392+ ":meth:`str.encode` 方法来讲 string 转变成 bytes。"
388393
389394#: ../../library/functions.rst:132
390395msgid ""
391396"If it is an *integer*, the array will have that size and will be initialized"
392397" with null bytes."
393- msgstr ""
398+ msgstr "如果是一个 *integer*,会初始化大小为该数字的数组,并使用 null 字节填充。 "
394399
395400#: ../../library/functions.rst:135
396401msgid ""
397402"If it is an object conforming to the *buffer* interface, a read-only buffer "
398403"of the object will be used to initialize the bytes array."
399- msgstr ""
404+ msgstr "如果是一个符合 *buffer* 接口的对象,该对象的只读 buffer 会用来初始化字节数组。 "
400405
401406#: ../../library/functions.rst:138
402407msgid ""
403408"If it is an *iterable*, it must be an iterable of integers in the range ``0 "
404409"<= x < 256``, which are used as the initial contents of the array."
405- msgstr ""
410+ msgstr "如果是一个 *iterable* 可迭代对象,它的元素必须是范围是``0 <= x < 256`` 的整数,它会被用作数组的初始内容。 "
406411
407412#: ../../library/functions.rst:141
408413msgid "Without an argument, an array of size 0 is created."
409- msgstr "如果没有参数,则创建大小为0 的数组。"
414+ msgstr "如果没有参数,则创建大小为 0 的数组。"
410415
411416#: ../../library/functions.rst:143
412417msgid "See also :ref:`binaryseq` and :ref:`typebytearray`."
@@ -419,11 +424,13 @@ msgid ""
419424":class:`bytearray` -- it has the same non-mutating methods and the same "
420425"indexing and slicing behavior."
421426msgstr ""
427+ "返回一个新的“bytes”对象, 是一个不可变序列,包含范围为 ``0 <= x < 256`` 的整数。:class:`bytes` 是 "
428+ ":class:`bytearray` 的不可变版本 - 它有其中不改变序列的方法和相同的索引、切片操作。"
422429
423430#: ../../library/functions.rst:155
424431msgid ""
425432"Accordingly, constructor arguments are interpreted as for :func:`bytearray`."
426- msgstr ""
433+ msgstr "因此,构造函数的参数和 :func:`bytearray` 相同。 "
427434
428435#: ../../library/functions.rst:157
429436msgid "Bytes objects can also be created with literals, see :ref:`strings`."
@@ -441,12 +448,15 @@ msgid ""
441448"that classes are callable (calling a class returns a new instance); "
442449"instances are callable if their class has a :meth:`__call__` method."
443450msgstr ""
451+ "如果参数 *object* 是可调用的,返回 :const:`True`,否则返回 :const:`False`。如果返回的是 "
452+ ":const:`True`,调用仍可能会失败;但如果返回 :const:`False`,则调用 *object* "
453+ "肯定会失败。注意类是可调用的(调用类会返回一个新的实例)。如果实例的类有 :meth:`__call__` 方法,则它是可调用。"
444454
445455#: ../../library/functions.rst:170
446456msgid ""
447457"This function was first removed in Python 3.0 and then brought back in "
448458"Python 3.2."
449- msgstr ""
459+ msgstr "这个函数一开始在 Python 3.0 被移除了,但在 Python 3.2 被重新加入。 "
450460
451461#: ../../library/functions.rst:177
452462msgid ""
@@ -455,29 +465,34 @@ msgid ""
455465"``chr(8364)`` returns the string ``'€'``. This is the inverse of "
456466":func:`ord`."
457467msgstr ""
468+ "返回 Unicode 码位为整数 *i* 的字符的字符串格式。例如,``chr(97)`` 返回字符串 ``'a'``,``chr(8364)`` "
469+ "返回字符串 ``'€'``。这是 :func:`ord` 的逆函数。"
458470
459471#: ../../library/functions.rst:181
460472msgid ""
461473"The valid range for the argument is from 0 through 1,114,111 (0x10FFFF in "
462474"base 16). :exc:`ValueError` will be raised if *i* is outside that range."
463475msgstr ""
476+ "参数的合法范围是 0 到 1,114,111(16 进制表示是 0x10FFFF)。如果 *i* 超过这个范围,会触发 "
477+ ":exc:`ValueError` 错误。"
464478
465479#: ../../library/functions.rst:187
466480msgid "Transform a method into a class method."
467- msgstr ""
481+ msgstr "把一个方法封装成类方法。 "
468482
469483#: ../../library/functions.rst:189
470484msgid ""
471485"A class method receives the class as implicit first argument, just like an "
472486"instance method receives the instance. To declare a class method, use this "
473487"idiom::"
474- msgstr ""
488+ msgstr "一个类方法把类自己作为第一个参数,就像一个实例方法把实例自己作为第一个参数。请用以下习惯来声明类方法:: "
475489
476490#: ../../library/functions.rst:197
477491msgid ""
478492"The ``@classmethod`` form is a function :term:`decorator` -- see the "
479493"description of function definitions in :ref:`function` for details."
480494msgstr ""
495+ "``@classmethod`` 形式是一个函数 :term:`装饰器` - 参见 :ref:`function` 中关于函数定义的详细介绍。"
481496
482497#: ../../library/functions.rst:200
483498msgid ""
@@ -486,18 +501,20 @@ msgid ""
486501"class method is called for a derived class, the derived class object is "
487502"passed as the implied first argument."
488503msgstr ""
504+ "它可以同时在类(如 ``C.f()``)和实例(如 "
505+ "``C().f()``)上调用。实例除了它的类信息,其他都会被忽略。如果一个类方法在子类上调用,子类会作为第一个参数传入。"
489506
490507#: ../../library/functions.rst:205
491508msgid ""
492509"Class methods are different than C++ or Java static methods. If you want "
493510"those, see :func:`staticmethod` in this section."
494- msgstr ""
511+ msgstr "类方法同 C++ 和 Java 的静态方法是区别的。如果你想要静态方法,请看本节的 :func:`staticmethod`。 "
495512
496513#: ../../library/functions.rst:208
497514msgid ""
498515"For more information on class methods, consult the documentation on the "
499516"standard type hierarchy in :ref:`types`."
500- msgstr ""
517+ msgstr "关于类方法的更多信息,请参考文档 :ref:`types` 中的标准类型的层次。 "
501518
502519#: ../../library/functions.rst:214
503520msgid ""
0 commit comments