diff --git a/c-api/init.po b/c-api/init.po index 1c86953113..67e569c109 100644 --- a/c-api/init.po +++ b/c-api/init.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-03-16 00:18+0000\n" "PO-Revision-Date: 2018-05-23 14:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -579,10 +579,10 @@ msgid "" "example, if the program name is ``'/usr/local/bin/python'``, the prefix is " "``'/usr/local'``. The returned string points into static storage; the caller " "should not modify its value. This corresponds to the :makevar:`prefix` " -"variable in the top-level :file:`Makefile` and the ``--prefix`` argument to " -"the :program:`configure` script at build time. The value is available to " -"Python code as ``sys.prefix``. It is only useful on Unix. See also the next " -"function." +"variable in the top-level :file:`Makefile` and the :option:`--prefix` " +"argument to the :program:`configure` script at build time. The value is " +"available to Python code as ``sys.prefix``. It is only useful on Unix. See " +"also the next function." msgstr "" #: ../../c-api/init.rst:420 diff --git a/c-api/intro.po b/c-api/intro.po index 48b53d27da..b6ae3f073a 100644 --- a/c-api/intro.po +++ b/c-api/intro.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-03-16 00:18+0000\n" "PO-Revision-Date: 2018-05-23 14:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -117,11 +117,11 @@ msgstr "" msgid "" "The header files are typically installed with Python. On Unix, these are " "located in the directories :file:`{prefix}/include/pythonversion/` and :file:" -"`{exec_prefix}/include/pythonversion/`, where :envvar:`prefix` and :envvar:" -"`exec_prefix` are defined by the corresponding parameters to Python's :" -"program:`configure` script and *version* is ``'%d.%d' % sys." -"version_info[:2]``. On Windows, the headers are installed in :file:" -"`{prefix}/include`, where :envvar:`prefix` is the installation directory " +"`{exec_prefix}/include/pythonversion/`, where :option:`prefix <--prefix>` " +"and :option:`exec_prefix <--exec-prefix>` are defined by the corresponding " +"parameters to Python's :program:`configure` script and *version* is ``'%d." +"%d' % sys.version_info[:2]``. On Windows, the headers are installed in :" +"file:`{prefix}/include`, where ``prefix`` is the installation directory " "specified to the installer." msgstr "" @@ -131,8 +131,8 @@ msgid "" "compiler's search path for includes. Do *not* place the parent directories " "on the search path and then use ``#include ``; this will " "break on multi-platform builds since the platform independent headers under :" -"envvar:`prefix` include the platform specific headers from :envvar:" -"`exec_prefix`." +"option:`prefix <--prefix>` include the platform specific headers from :" +"option:`exec_prefix <--exec-prefix>`." msgstr "" #: ../../c-api/intro.rst:95 diff --git a/c-api/object.po b/c-api/object.po index e5fa820beb..c5ff5c5457 100644 --- a/c-api/object.po +++ b/c-api/object.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-15 00:17+0000\n" +"POT-Creation-Date: 2023-03-23 00:15+0000\n" "PO-Revision-Date: 2018-05-23 14:32+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -193,7 +193,20 @@ msgid "" "will always return ``1`` for :const:`Py_EQ` and ``0`` for :const:`Py_NE`." msgstr "" -#: ../../c-api/object.rst:186 +#: ../../c-api/object.rst:184 +msgid "" +"Format *obj* using *format_spec*. This is equivalent to the Python " +"expression ``format(obj, format_spec)``." +msgstr "" + +#: ../../c-api/object.rst:187 +msgid "" +"*format_spec* may be ``NULL``. In this case the call is equivalent to " +"``format(obj)``. Returns the formatted string on success, ``NULL`` on " +"failure." +msgstr "" + +#: ../../c-api/object.rst:195 msgid "" "Compute a string representation of object *o*. Returns the string " "representation on success, ``NULL`` on failure. This is the equivalent of " @@ -201,13 +214,13 @@ msgid "" "function." msgstr "" -#: ../../c-api/object.rst:190 ../../c-api/object.rst:214 +#: ../../c-api/object.rst:199 ../../c-api/object.rst:223 msgid "" "This function now includes a debug assertion to help ensure that it does not " "silently discard an active exception." msgstr "" -#: ../../c-api/object.rst:198 +#: ../../c-api/object.rst:207 msgid "" "As :c:func:`PyObject_Repr`, compute a string representation of object *o*, " "but escape the non-ASCII characters in the string returned by :c:func:" @@ -216,7 +229,7 @@ msgid "" "Called by the :func:`ascii` built-in function." msgstr "" -#: ../../c-api/object.rst:209 +#: ../../c-api/object.rst:218 msgid "" "Compute a string representation of object *o*. Returns the string " "representation on success, ``NULL`` on failure. This is the equivalent of " @@ -224,7 +237,7 @@ msgid "" "function and, therefore, by the :func:`print` function." msgstr "" -#: ../../c-api/object.rst:223 +#: ../../c-api/object.rst:232 msgid "" "Compute a bytes representation of object *o*. ``NULL`` is returned on " "failure and a bytes object on success. This is equivalent to the Python " @@ -233,20 +246,20 @@ msgid "" "bytes object." msgstr "" -#: ../../c-api/object.rst:232 +#: ../../c-api/object.rst:241 msgid "" "Return ``1`` if the class *derived* is identical to or derived from the " "class *cls*, otherwise return ``0``. In case of an error, return ``-1``." msgstr "" -#: ../../c-api/object.rst:235 ../../c-api/object.rst:254 +#: ../../c-api/object.rst:244 ../../c-api/object.rst:263 msgid "" "If *cls* is a tuple, the check will be done against every entry in *cls*. " "The result will be ``1`` when at least one of the checks returns ``1``, " "otherwise it will be ``0``." msgstr "" -#: ../../c-api/object.rst:239 +#: ../../c-api/object.rst:248 msgid "" "If *cls* has a :meth:`~class.__subclasscheck__` method, it will be called to " "determine the subclass status as described in :pep:`3119`. Otherwise, " @@ -254,52 +267,52 @@ msgid "" "e. contained in ``cls.__mro__``." msgstr "" -#: ../../c-api/object.rst:244 +#: ../../c-api/object.rst:253 msgid "" "Normally only class objects, i.e. instances of :class:`type` or a derived " "class, are considered classes. However, objects can override this by having " "a :attr:`__bases__` attribute (which must be a tuple of base classes)." msgstr "" -#: ../../c-api/object.rst:251 +#: ../../c-api/object.rst:260 msgid "" "Return ``1`` if *inst* is an instance of the class *cls* or a subclass of " "*cls*, or ``0`` if not. On error, returns ``-1`` and sets an exception." msgstr "" -#: ../../c-api/object.rst:258 +#: ../../c-api/object.rst:267 msgid "" "If *cls* has a :meth:`~class.__instancecheck__` method, it will be called to " "determine the subclass status as described in :pep:`3119`. Otherwise, " "*inst* is an instance of *cls* if its class is a subclass of *cls*." msgstr "" -#: ../../c-api/object.rst:262 +#: ../../c-api/object.rst:271 msgid "" "An instance *inst* can override what is considered its class by having a :" "attr:`__class__` attribute." msgstr "" -#: ../../c-api/object.rst:265 +#: ../../c-api/object.rst:274 msgid "" "An object *cls* can override if it is considered a class, and what its base " "classes are, by having a :attr:`__bases__` attribute (which must be a tuple " "of base classes)." msgstr "" -#: ../../c-api/object.rst:274 +#: ../../c-api/object.rst:283 msgid "" "Compute and return the hash value of an object *o*. On failure, return " "``-1``. This is the equivalent of the Python expression ``hash(o)``." msgstr "" -#: ../../c-api/object.rst:277 +#: ../../c-api/object.rst:286 msgid "" "The return type is now Py_hash_t. This is a signed integer the same size " "as :c:type:`Py_ssize_t`." msgstr "" -#: ../../c-api/object.rst:284 +#: ../../c-api/object.rst:293 msgid "" "Set a :exc:`TypeError` indicating that ``type(o)`` is not :term:`hashable` " "and return ``-1``. This function receives special treatment when stored in a " @@ -307,21 +320,21 @@ msgid "" "that it is not hashable." msgstr "" -#: ../../c-api/object.rst:292 +#: ../../c-api/object.rst:301 msgid "" "Returns ``1`` if the object *o* is considered to be true, and ``0`` " "otherwise. This is equivalent to the Python expression ``not not o``. On " "failure, return ``-1``." msgstr "" -#: ../../c-api/object.rst:299 +#: ../../c-api/object.rst:308 msgid "" "Returns ``0`` if the object *o* is considered to be true, and ``1`` " "otherwise. This is equivalent to the Python expression ``not o``. On " "failure, return ``-1``." msgstr "" -#: ../../c-api/object.rst:308 +#: ../../c-api/object.rst:317 msgid "" "When *o* is non-``NULL``, returns a type object corresponding to the object " "type of object *o*. On failure, raises :exc:`SystemError` and returns " @@ -332,13 +345,13 @@ msgid "" "incremented reference count is needed." msgstr "" -#: ../../c-api/object.rst:319 +#: ../../c-api/object.rst:328 msgid "" "Return non-zero if the object *o* is of type *type* or a subtype of *type*, " "and ``0`` otherwise. Both parameters must be non-``NULL``." msgstr "" -#: ../../c-api/object.rst:328 +#: ../../c-api/object.rst:337 msgid "" "Return the length of object *o*. If the object *o* provides either the " "sequence and mapping protocols, the sequence length is returned. On error, " @@ -346,7 +359,7 @@ msgid "" "``len(o)``." msgstr "" -#: ../../c-api/object.rst:335 +#: ../../c-api/object.rst:344 msgid "" "Return an estimated length for the object *o*. First try to return its " "actual length, then an estimate using :meth:`~object.__length_hint__`, and " @@ -355,26 +368,26 @@ msgid "" "defaultvalue)``." msgstr "" -#: ../../c-api/object.rst:345 +#: ../../c-api/object.rst:354 msgid "" "Return element of *o* corresponding to the object *key* or ``NULL`` on " "failure. This is the equivalent of the Python expression ``o[key]``." msgstr "" -#: ../../c-api/object.rst:351 +#: ../../c-api/object.rst:360 msgid "" "Map the object *key* to the value *v*. Raise an exception and return ``-1`` " "on failure; return ``0`` on success. This is the equivalent of the Python " "statement ``o[key] = v``. This function *does not* steal a reference to *v*." msgstr "" -#: ../../c-api/object.rst:359 +#: ../../c-api/object.rst:368 msgid "" "Remove the mapping for the object *key* from the object *o*. Return ``-1`` " "on failure. This is equivalent to the Python statement ``del o[key]``." msgstr "" -#: ../../c-api/object.rst:365 +#: ../../c-api/object.rst:374 msgid "" "This is equivalent to the Python expression ``dir(o)``, returning a " "(possibly empty) list of strings appropriate for the object argument, or " @@ -384,7 +397,7 @@ msgid "" "`PyErr_Occurred` will return false." msgstr "" -#: ../../c-api/object.rst:374 +#: ../../c-api/object.rst:383 msgid "" "This is equivalent to the Python expression ``iter(o)``. It returns a new " "iterator for the object argument, or the object itself if the object is " @@ -392,7 +405,7 @@ msgid "" "object cannot be iterated." msgstr "" -#: ../../c-api/object.rst:382 +#: ../../c-api/object.rst:391 msgid "" "This is the equivalent to the Python expression ``aiter(o)``. Takes an :" "class:`AsyncIterable` object and returns an :class:`AsyncIterator` for it. " diff --git a/c-api/weakref.po b/c-api/weakref.po index 6536863d9d..7567ff6d02 100644 --- a/c-api/weakref.po +++ b/c-api/weakref.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-03-26 00:17+0000\n" "PO-Revision-Date: 2017-09-22 18:26+0000\n" "Last-Translator: Leon H.\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -87,3 +87,16 @@ msgstr "" #: ../../c-api/weakref.rst:69 msgid "Similar to :c:func:`PyWeakref_GetObject`, but does no error checking." msgstr "" + +#: ../../c-api/weakref.rst:74 +msgid "" +"This function is called by the :c:member:`~PyTypeObject.tp_dealloc` handler " +"to clear weak references." +msgstr "" + +#: ../../c-api/weakref.rst:77 +msgid "" +"This iterates through the weak references for *object* and calls callbacks " +"for those references which have one. It returns when all callbacks have been " +"attempted." +msgstr "" diff --git a/howto/enum.po b/howto/enum.po index 3cac97121c..e35d5f1dee 100644 --- a/howto/enum.po +++ b/howto/enum.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-12 20:01+0000\n" +"POT-Creation-Date: 2023-04-04 00:15+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -280,10 +280,17 @@ msgid "" msgstr "" #: ../../howto/enum.rst:376 +msgid "" +"It is possible to reload modules -- if a reloaded module contains enums, " +"they will be recreated, and the new members may not compare identical/equal " +"to the original members." +msgstr "" + +#: ../../howto/enum.rst:381 msgid "Allowed members and attributes of enumerations" msgstr "" -#: ../../howto/enum.rst:378 +#: ../../howto/enum.rst:383 msgid "" "Most of the examples above use integers for enumeration values. Using " "integers is short and handy (and provided by default by the `Functional " @@ -292,17 +299,17 @@ msgid "" "*is* important, enumerations can have arbitrary values." msgstr "" -#: ../../howto/enum.rst:384 +#: ../../howto/enum.rst:389 msgid "" "Enumerations are Python classes, and can have methods and special methods as " "usual. If we have this enumeration::" msgstr "" -#: ../../howto/enum.rst:404 +#: ../../howto/enum.rst:409 msgid "Then::" msgstr "" -#: ../../howto/enum.rst:413 +#: ../../howto/enum.rst:418 msgid "" "The rules for what is allowed are as follows: names that start and end with " "a single underscore are reserved by enum and cannot be used; all other " @@ -312,35 +319,35 @@ msgid "" "names listed in :attr:`_ignore_`." msgstr "" -#: ../../howto/enum.rst:420 +#: ../../howto/enum.rst:425 msgid "" "Note: if your enumeration defines :meth:`__new__` and/or :meth:`__init__` " "then any value(s) given to the enum member will be passed into those " "methods. See `Planet`_ for an example." msgstr "" -#: ../../howto/enum.rst:426 +#: ../../howto/enum.rst:431 msgid "Restricted Enum subclassing" msgstr "" -#: ../../howto/enum.rst:428 +#: ../../howto/enum.rst:433 msgid "" "A new :class:`Enum` class must have one base enum class, up to one concrete " "data type, and as many :class:`object`-based mixin classes as needed. The " "order of these base classes is::" msgstr "" -#: ../../howto/enum.rst:435 +#: ../../howto/enum.rst:440 msgid "" "Also, subclassing an enumeration is allowed only if the enumeration does not " "define any members. So this is forbidden::" msgstr "" -#: ../../howto/enum.rst:445 +#: ../../howto/enum.rst:450 msgid "But this is allowed::" msgstr "" -#: ../../howto/enum.rst:456 +#: ../../howto/enum.rst:461 msgid "" "Allowing subclassing of enums that define members would lead to a violation " "of some important invariants of types and instances. On the other hand, it " @@ -348,49 +355,49 @@ msgid "" "enumerations. (See `OrderedEnum`_ for an example.)" msgstr "" -#: ../../howto/enum.rst:463 +#: ../../howto/enum.rst:468 msgid "Pickling" msgstr "" -#: ../../howto/enum.rst:465 +#: ../../howto/enum.rst:470 msgid "Enumerations can be pickled and unpickled::" msgstr "" -#: ../../howto/enum.rst:472 +#: ../../howto/enum.rst:477 msgid "" "The usual restrictions for pickling apply: picklable enums must be defined " "in the top level of a module, since unpickling requires them to be " "importable from that module." msgstr "" -#: ../../howto/enum.rst:478 +#: ../../howto/enum.rst:483 msgid "" "With pickle protocol version 4 it is possible to easily pickle enums nested " "in other classes." msgstr "" -#: ../../howto/enum.rst:481 +#: ../../howto/enum.rst:486 msgid "" "It is possible to modify how enum members are pickled/unpickled by defining :" "meth:`__reduce_ex__` in the enumeration class." msgstr "" -#: ../../howto/enum.rst:486 +#: ../../howto/enum.rst:491 msgid "Functional API" msgstr "" -#: ../../howto/enum.rst:488 +#: ../../howto/enum.rst:493 msgid "" "The :class:`Enum` class is callable, providing the following functional API::" msgstr "" -#: ../../howto/enum.rst:498 +#: ../../howto/enum.rst:503 msgid "" "The semantics of this API resemble :class:`~collections.namedtuple`. The " "first argument of the call to :class:`Enum` is the name of the enumeration." msgstr "" -#: ../../howto/enum.rst:501 +#: ../../howto/enum.rst:506 msgid "" "The second argument is the *source* of enumeration member names. It can be " "a whitespace-separated string of names, a sequence of names, a sequence of 2-" @@ -402,14 +409,14 @@ msgid "" "assignment to :class:`Animal` is equivalent to::" msgstr "" -#: ../../howto/enum.rst:517 +#: ../../howto/enum.rst:522 msgid "" "The reason for defaulting to ``1`` as the starting number and not ``0`` is " "that ``0`` is ``False`` in a boolean sense, but by default enum members all " "evaluate to ``True``." msgstr "" -#: ../../howto/enum.rst:521 +#: ../../howto/enum.rst:526 msgid "" "Pickling enums created with the functional API can be tricky as frame stack " "implementation details are used to try and figure out which module the " @@ -418,14 +425,14 @@ msgid "" "Jython). The solution is to specify the module name explicitly as follows::" msgstr "" -#: ../../howto/enum.rst:531 +#: ../../howto/enum.rst:536 msgid "" "If ``module`` is not supplied, and Enum cannot determine what it is, the new " "Enum members will not be unpicklable; to keep errors closer to the source, " "pickling will be disabled." msgstr "" -#: ../../howto/enum.rst:535 +#: ../../howto/enum.rst:540 msgid "" "The new pickle protocol 4 also, in some circumstances, relies on :attr:" "`~definition.__qualname__` being set to the location where pickle will be " @@ -433,7 +440,7 @@ msgid "" "class SomeData in the global scope::" msgstr "" -#: ../../howto/enum.rst:542 +#: ../../howto/enum.rst:547 msgid "The complete signature is::" msgstr "" @@ -441,7 +448,7 @@ msgstr "" msgid "value" msgstr "" -#: ../../howto/enum.rst:554 +#: ../../howto/enum.rst:559 msgid "What the new enum class will record as its name." msgstr "" @@ -449,21 +456,21 @@ msgstr "" msgid "names" msgstr "" -#: ../../howto/enum.rst:556 +#: ../../howto/enum.rst:561 msgid "" "The enum members. This can be a whitespace- or comma-separated string " "(values will start at 1 unless otherwise specified)::" msgstr "" -#: ../../howto/enum.rst:561 +#: ../../howto/enum.rst:566 msgid "or an iterator of names::" msgstr "" -#: ../../howto/enum.rst:565 +#: ../../howto/enum.rst:570 msgid "or an iterator of (name, value) pairs::" msgstr "" -#: ../../howto/enum.rst:569 +#: ../../howto/enum.rst:574 msgid "or a mapping::" msgstr "" @@ -471,7 +478,7 @@ msgstr "" msgid "module" msgstr "" -#: ../../howto/enum.rst:573 +#: ../../howto/enum.rst:578 msgid "name of module where new enum class can be found." msgstr "" @@ -479,7 +486,7 @@ msgstr "" msgid "qualname" msgstr "" -#: ../../howto/enum.rst:575 +#: ../../howto/enum.rst:580 msgid "where in module new enum class can be found." msgstr "" @@ -487,7 +494,7 @@ msgstr "" msgid "type" msgstr "" -#: ../../howto/enum.rst:577 +#: ../../howto/enum.rst:582 msgid "type to mix in to new enum class." msgstr "" @@ -495,23 +502,23 @@ msgstr "" msgid "start" msgstr "" -#: ../../howto/enum.rst:579 +#: ../../howto/enum.rst:584 msgid "number to start counting at if only names are passed in." msgstr "" -#: ../../howto/enum.rst:581 +#: ../../howto/enum.rst:586 msgid "The *start* parameter was added." msgstr "" -#: ../../howto/enum.rst:586 +#: ../../howto/enum.rst:591 msgid "Derived Enumerations" msgstr "" -#: ../../howto/enum.rst:589 +#: ../../howto/enum.rst:594 msgid "IntEnum" msgstr "" -#: ../../howto/enum.rst:591 +#: ../../howto/enum.rst:596 msgid "" "The first variation of :class:`Enum` that is provided is also a subclass of :" "class:`int`. Members of an :class:`IntEnum` can be compared to integers; by " @@ -519,22 +526,22 @@ msgid "" "each other::" msgstr "" -#: ../../howto/enum.rst:612 +#: ../../howto/enum.rst:617 msgid "" "However, they still can't be compared to standard :class:`Enum` " "enumerations::" msgstr "" -#: ../../howto/enum.rst:625 +#: ../../howto/enum.rst:630 msgid "" ":class:`IntEnum` values behave like integers in other ways you'd expect::" msgstr "" -#: ../../howto/enum.rst:636 +#: ../../howto/enum.rst:641 msgid "StrEnum" msgstr "" -#: ../../howto/enum.rst:638 +#: ../../howto/enum.rst:643 msgid "" "The second variation of :class:`Enum` that is provided is also a subclass " "of :class:`str`. Members of a :class:`StrEnum` can be compared to strings; " @@ -542,11 +549,11 @@ msgid "" "each other." msgstr "" -#: ../../howto/enum.rst:647 +#: ../../howto/enum.rst:652 msgid "IntFlag" msgstr "" -#: ../../howto/enum.rst:649 +#: ../../howto/enum.rst:654 msgid "" "The next variation of :class:`Enum` provided, :class:`IntFlag`, is also " "based on :class:`int`. The difference being :class:`IntFlag` members can be " @@ -556,60 +563,60 @@ msgid "" "is used." msgstr "" -#: ../../howto/enum.rst:657 +#: ../../howto/enum.rst:662 msgid "" "Any operation on an :class:`IntFlag` member besides the bit-wise operations " "will lose the :class:`IntFlag` membership." msgstr "" -#: ../../howto/enum.rst:660 +#: ../../howto/enum.rst:665 msgid "" "Bit-wise operations that result in invalid :class:`IntFlag` values will lose " "the :class:`IntFlag` membership. See :class:`FlagBoundary` for details." msgstr "" -#: ../../howto/enum.rst:667 +#: ../../howto/enum.rst:672 msgid "Sample :class:`IntFlag` class::" msgstr "" -#: ../../howto/enum.rst:683 +#: ../../howto/enum.rst:688 msgid "It is also possible to name the combinations::" msgstr "" -#: ../../howto/enum.rst:699 +#: ../../howto/enum.rst:704 msgid "" "Named combinations are considered aliases. Aliases do not show up during " "iteration, but can be returned from by-value lookups." msgstr "" -#: ../../howto/enum.rst:704 +#: ../../howto/enum.rst:709 msgid "" "Another important difference between :class:`IntFlag` and :class:`Enum` is " "that if no flags are set (the value is 0), its boolean evaluation is :data:" "`False`::" msgstr "" -#: ../../howto/enum.rst:712 +#: ../../howto/enum.rst:717 msgid "" "Because :class:`IntFlag` members are also subclasses of :class:`int` they " "can be combined with them (but may lose :class:`IntFlag` membership::" msgstr "" -#: ../../howto/enum.rst:723 +#: ../../howto/enum.rst:728 msgid "" "The negation operator, ``~``, always returns an :class:`IntFlag` member with " "a positive value::" msgstr "" -#: ../../howto/enum.rst:729 +#: ../../howto/enum.rst:734 msgid ":class:`IntFlag` members can also be iterated over::" msgstr "" -#: ../../howto/enum.rst:738 +#: ../../howto/enum.rst:743 msgid "Flag" msgstr "" -#: ../../howto/enum.rst:740 +#: ../../howto/enum.rst:745 msgid "" "The last variation is :class:`Flag`. Like :class:`IntFlag`, :class:`Flag` " "members can be combined using the bitwise operators (&, \\|, ^, ~). Unlike :" @@ -619,29 +626,29 @@ msgid "" "value and let :class:`Flag` select an appropriate value." msgstr "" -#: ../../howto/enum.rst:749 +#: ../../howto/enum.rst:754 msgid "" "Like :class:`IntFlag`, if a combination of :class:`Flag` members results in " "no flags being set, the boolean evaluation is :data:`False`::" msgstr "" -#: ../../howto/enum.rst:763 +#: ../../howto/enum.rst:768 msgid "" "Individual flags should have values that are powers of two (1, 2, 4, " "8, ...), while combinations of flags will not::" msgstr "" -#: ../../howto/enum.rst:775 +#: ../../howto/enum.rst:780 msgid "" "Giving a name to the \"no flags set\" condition does not change its boolean " "value::" msgstr "" -#: ../../howto/enum.rst:789 +#: ../../howto/enum.rst:794 msgid ":class:`Flag` members can also be iterated over::" msgstr "" -#: ../../howto/enum.rst:799 +#: ../../howto/enum.rst:804 msgid "" "For the majority of new code, :class:`Enum` and :class:`Flag` are strongly " "recommended, since :class:`IntEnum` and :class:`IntFlag` break some semantic " @@ -652,42 +659,42 @@ msgid "" "enumerations, or for interoperability with other systems." msgstr "" -#: ../../howto/enum.rst:809 +#: ../../howto/enum.rst:814 msgid "Others" msgstr "" -#: ../../howto/enum.rst:811 +#: ../../howto/enum.rst:816 msgid "" "While :class:`IntEnum` is part of the :mod:`enum` module, it would be very " "simple to implement independently::" msgstr "" -#: ../../howto/enum.rst:817 +#: ../../howto/enum.rst:822 msgid "" "This demonstrates how similar derived enumerations can be defined; for " "example a :class:`FloatEnum` that mixes in :class:`float` instead of :class:" "`int`." msgstr "" -#: ../../howto/enum.rst:820 +#: ../../howto/enum.rst:825 msgid "Some rules:" msgstr "" -#: ../../howto/enum.rst:822 +#: ../../howto/enum.rst:827 msgid "" "When subclassing :class:`Enum`, mix-in types must appear before :class:" "`Enum` itself in the sequence of bases, as in the :class:`IntEnum` example " "above." msgstr "" -#: ../../howto/enum.rst:825 +#: ../../howto/enum.rst:830 msgid "" "Mix-in types must be subclassable. For example, :class:`bool` and :class:" "`range` are not subclassable and will throw an error during Enum creation if " "used as the mix-in type." msgstr "" -#: ../../howto/enum.rst:828 +#: ../../howto/enum.rst:833 msgid "" "While :class:`Enum` can have members of any type, once you mix in an " "additional type, all the members must have values of that type, e.g. :class:" @@ -695,157 +702,157 @@ msgid "" "methods and don't specify another type." msgstr "" -#: ../../howto/enum.rst:832 +#: ../../howto/enum.rst:837 msgid "" "When another data type is mixed in, the :attr:`value` attribute is *not the " "same* as the enum member itself, although it is equivalent and will compare " "equal." msgstr "" -#: ../../howto/enum.rst:835 +#: ../../howto/enum.rst:840 msgid "" "%-style formatting: ``%s`` and ``%r`` call the :class:`Enum` class's :meth:" "`__str__` and :meth:`__repr__` respectively; other codes (such as ``%i`` or " "``%h`` for IntEnum) treat the enum member as its mixed-in type." msgstr "" -#: ../../howto/enum.rst:838 +#: ../../howto/enum.rst:843 msgid "" ":ref:`Formatted string literals `, :meth:`str.format`, and :func:" "`format` will use the enum's :meth:`__str__` method." msgstr "" -#: ../../howto/enum.rst:843 +#: ../../howto/enum.rst:848 msgid "" "Because :class:`IntEnum`, :class:`IntFlag`, and :class:`StrEnum` are " "designed to be drop-in replacements for existing constants, their :meth:" "`__str__` method has been reset to their data types :meth:`__str__` method." msgstr "" -#: ../../howto/enum.rst:849 +#: ../../howto/enum.rst:854 msgid "When to use :meth:`__new__` vs. :meth:`__init__`" msgstr "" -#: ../../howto/enum.rst:851 +#: ../../howto/enum.rst:856 msgid "" ":meth:`__new__` must be used whenever you want to customize the actual value " "of the :class:`Enum` member. Any other modifications may go in either :meth:" "`__new__` or :meth:`__init__`, with :meth:`__init__` being preferred." msgstr "" -#: ../../howto/enum.rst:855 +#: ../../howto/enum.rst:860 msgid "" "For example, if you want to pass several items to the constructor, but only " "want one of them to be the value::" msgstr "" -#: ../../howto/enum.rst:882 +#: ../../howto/enum.rst:887 msgid "Finer Points" msgstr "" -#: ../../howto/enum.rst:885 +#: ../../howto/enum.rst:890 msgid "Supported ``__dunder__`` names" msgstr "" -#: ../../howto/enum.rst:887 +#: ../../howto/enum.rst:892 msgid "" ":attr:`__members__` is a read-only ordered mapping of ``member_name``:" "``member`` items. It is only available on the class." msgstr "" -#: ../../howto/enum.rst:890 +#: ../../howto/enum.rst:895 msgid "" ":meth:`__new__`, if specified, must create and return the enum members; it " "is also a very good idea to set the member's :attr:`_value_` appropriately. " "Once all the members are created it is no longer used." msgstr "" -#: ../../howto/enum.rst:896 +#: ../../howto/enum.rst:901 msgid "Supported ``_sunder_`` names" msgstr "" -#: ../../howto/enum.rst:898 +#: ../../howto/enum.rst:903 msgid "``_name_`` -- name of the member" msgstr "" -#: ../../howto/enum.rst:899 +#: ../../howto/enum.rst:904 msgid "" "``_value_`` -- value of the member; can be set / modified in ``__new__``" msgstr "" -#: ../../howto/enum.rst:901 +#: ../../howto/enum.rst:906 msgid "" "``_missing_`` -- a lookup function used when a value is not found; may be " "overridden" msgstr "" -#: ../../howto/enum.rst:903 +#: ../../howto/enum.rst:908 msgid "" "``_ignore_`` -- a list of names, either as a :class:`list` or a :class:" "`str`, that will not be transformed into members, and will be removed from " "the final class" msgstr "" -#: ../../howto/enum.rst:906 +#: ../../howto/enum.rst:911 msgid "" "``_order_`` -- used in Python 2/3 code to ensure member order is consistent " "(class attribute, removed during class creation)" msgstr "" -#: ../../howto/enum.rst:908 +#: ../../howto/enum.rst:913 msgid "" "``_generate_next_value_`` -- used by the `Functional API`_ and by :class:" "`auto` to get an appropriate value for an enum member; may be overridden" msgstr "" -#: ../../howto/enum.rst:914 +#: ../../howto/enum.rst:919 msgid "" "For standard :class:`Enum` classes the next value chosen is the last value " "seen incremented by one." msgstr "" -#: ../../howto/enum.rst:917 +#: ../../howto/enum.rst:922 msgid "" "For :class:`Flag` classes the next value chosen will be the next highest " "power-of-two, regardless of the last value seen." msgstr "" -#: ../../howto/enum.rst:920 +#: ../../howto/enum.rst:925 msgid "``_missing_``, ``_order_``, ``_generate_next_value_``" msgstr "" -#: ../../howto/enum.rst:921 +#: ../../howto/enum.rst:926 msgid "``_ignore_``" msgstr "" -#: ../../howto/enum.rst:923 +#: ../../howto/enum.rst:928 msgid "" "To help keep Python 2 / Python 3 code in sync an :attr:`_order_` attribute " "can be provided. It will be checked against the actual order of the " "enumeration and raise an error if the two do not match::" msgstr "" -#: ../../howto/enum.rst:941 +#: ../../howto/enum.rst:946 msgid "" "In Python 2 code the :attr:`_order_` attribute is necessary as definition " "order is lost before it can be recorded." msgstr "" -#: ../../howto/enum.rst:946 +#: ../../howto/enum.rst:951 msgid "_Private__names" msgstr "" -#: ../../howto/enum.rst:948 +#: ../../howto/enum.rst:953 msgid "" ":ref:`Private names ` are not converted to enum " "members, but remain normal attributes." msgstr "" -#: ../../howto/enum.rst:955 +#: ../../howto/enum.rst:960 msgid "``Enum`` member type" msgstr "" -#: ../../howto/enum.rst:957 +#: ../../howto/enum.rst:962 msgid "" "Enum members are instances of their enum class, and are normally accessed as " "``EnumClass.member``. In Python versions ``3.5`` to ``3.10`` you could " @@ -853,22 +860,22 @@ msgid "" "``3.11`` :class:`Enum` returns to not allowing it::" msgstr "" -#: ../../howto/enum.rst:978 +#: ../../howto/enum.rst:983 msgid "Creating members that are mixed with other data types" msgstr "" -#: ../../howto/enum.rst:980 +#: ../../howto/enum.rst:985 msgid "" "When subclassing other data types, such as :class:`int` or :class:`str`, " "with an :class:`Enum`, all values after the ``=`` are passed to that data " "type's constructor. For example::" msgstr "" -#: ../../howto/enum.rst:992 +#: ../../howto/enum.rst:997 msgid "Boolean value of ``Enum`` classes and members" msgstr "" -#: ../../howto/enum.rst:994 +#: ../../howto/enum.rst:999 msgid "" "Enum classes that are mixed with non-:class:`Enum` types (such as :class:" "`int`, :class:`str`, etc.) are evaluated according to the mixed-in type's " @@ -877,137 +884,137 @@ msgid "" "your class::" msgstr "" -#: ../../howto/enum.rst:1003 +#: ../../howto/enum.rst:1008 msgid "Plain :class:`Enum` classes always evaluate as :data:`True`." msgstr "" -#: ../../howto/enum.rst:1007 +#: ../../howto/enum.rst:1012 msgid "``Enum`` classes with methods" msgstr "" -#: ../../howto/enum.rst:1009 +#: ../../howto/enum.rst:1014 msgid "" "If you give your enum subclass extra methods, like the `Planet`_ class " "below, those methods will show up in a :func:`dir` of the member, but not of " "the class::" msgstr "" -#: ../../howto/enum.rst:1020 +#: ../../howto/enum.rst:1025 msgid "Combining members of ``Flag``" msgstr "" -#: ../../howto/enum.rst:1022 +#: ../../howto/enum.rst:1027 msgid "" "Iterating over a combination of :class:`Flag` members will only return the " "members that are comprised of a single bit::" msgstr "" -#: ../../howto/enum.rst:1040 +#: ../../howto/enum.rst:1045 msgid "``Flag`` and ``IntFlag`` minutia" msgstr "" -#: ../../howto/enum.rst:1042 +#: ../../howto/enum.rst:1047 msgid "Using the following snippet for our examples::" msgstr "" -#: ../../howto/enum.rst:1053 +#: ../../howto/enum.rst:1058 msgid "the following are true:" msgstr "" -#: ../../howto/enum.rst:1055 +#: ../../howto/enum.rst:1060 msgid "single-bit flags are canonical" msgstr "" -#: ../../howto/enum.rst:1056 +#: ../../howto/enum.rst:1061 msgid "multi-bit and zero-bit flags are aliases" msgstr "" -#: ../../howto/enum.rst:1057 +#: ../../howto/enum.rst:1062 msgid "only canonical flags are returned during iteration::" msgstr "" -#: ../../howto/enum.rst:1062 +#: ../../howto/enum.rst:1067 msgid "" "negating a flag or flag set returns a new flag/flag set with the " "corresponding positive integer value::" msgstr "" -#: ../../howto/enum.rst:1071 +#: ../../howto/enum.rst:1076 msgid "names of pseudo-flags are constructed from their members' names::" msgstr "" -#: ../../howto/enum.rst:1076 +#: ../../howto/enum.rst:1081 msgid "multi-bit flags, aka aliases, can be returned from operations::" msgstr "" -#: ../../howto/enum.rst:1087 +#: ../../howto/enum.rst:1092 msgid "" "membership / containment checking: zero-valued flags are always considered " "to be contained::" msgstr "" -#: ../../howto/enum.rst:1093 +#: ../../howto/enum.rst:1098 msgid "" "otherwise, only if all bits of one flag are in the other flag will True be " "returned::" msgstr "" -#: ../../howto/enum.rst:1102 +#: ../../howto/enum.rst:1107 msgid "" "There is a new boundary mechanism that controls how out-of-range / invalid " "bits are handled: ``STRICT``, ``CONFORM``, ``EJECT``, and ``KEEP``:" msgstr "" -#: ../../howto/enum.rst:1105 +#: ../../howto/enum.rst:1110 msgid "STRICT --> raises an exception when presented with invalid values" msgstr "" -#: ../../howto/enum.rst:1106 +#: ../../howto/enum.rst:1111 msgid "CONFORM --> discards any invalid bits" msgstr "" -#: ../../howto/enum.rst:1107 +#: ../../howto/enum.rst:1112 msgid "EJECT --> lose Flag status and become a normal int with the given value" msgstr "" -#: ../../howto/enum.rst:1111 +#: ../../howto/enum.rst:1116 msgid "KEEP --> keep the extra bits" msgstr "" -#: ../../howto/enum.rst:1109 +#: ../../howto/enum.rst:1114 msgid "keeps Flag status and extra bits" msgstr "" -#: ../../howto/enum.rst:1110 +#: ../../howto/enum.rst:1115 msgid "extra bits do not show up in iteration" msgstr "" -#: ../../howto/enum.rst:1111 +#: ../../howto/enum.rst:1116 msgid "extra bits do show up in repr() and str()" msgstr "" -#: ../../howto/enum.rst:1113 +#: ../../howto/enum.rst:1118 msgid "" "The default for Flag is ``STRICT``, the default for ``IntFlag`` is " "``EJECT``, and the default for ``_convert_`` is ``KEEP`` (see ``ssl." "Options`` for an example of when ``KEEP`` is needed)." msgstr "" -#: ../../howto/enum.rst:1121 +#: ../../howto/enum.rst:1126 msgid "How are Enums and Flags different?" msgstr "" -#: ../../howto/enum.rst:1123 +#: ../../howto/enum.rst:1128 msgid "" "Enums have a custom metaclass that affects many aspects of both derived :" "class:`Enum` classes and their instances (members)." msgstr "" -#: ../../howto/enum.rst:1128 +#: ../../howto/enum.rst:1133 msgid "Enum Classes" msgstr "" -#: ../../howto/enum.rst:1130 +#: ../../howto/enum.rst:1135 msgid "" "The :class:`EnumType` metaclass is responsible for providing the :meth:" "`__contains__`, :meth:`__dir__`, :meth:`__iter__` and other methods that " @@ -1018,11 +1025,11 @@ msgid "" "`__getnewargs__`, :meth:`__str__` and :meth:`__repr__`)." msgstr "" -#: ../../howto/enum.rst:1139 +#: ../../howto/enum.rst:1144 msgid "Flag Classes" msgstr "" -#: ../../howto/enum.rst:1141 +#: ../../howto/enum.rst:1146 msgid "" "Flags have an expanded view of aliasing: to be canonical, the value of a " "flag needs to be a power-of-two value, and not a duplicate name. So, in " @@ -1031,11 +1038,11 @@ msgid "" "considered an alias." msgstr "" -#: ../../howto/enum.rst:1147 +#: ../../howto/enum.rst:1152 msgid "Enum Members (aka instances)" msgstr "" -#: ../../howto/enum.rst:1149 +#: ../../howto/enum.rst:1154 msgid "" "The most interesting thing about enum members is that they are singletons. :" "class:`EnumType` creates them all while it is creating the enum class " @@ -1044,37 +1051,37 @@ msgid "" "instances." msgstr "" -#: ../../howto/enum.rst:1155 +#: ../../howto/enum.rst:1160 msgid "Flag Members" msgstr "" -#: ../../howto/enum.rst:1157 +#: ../../howto/enum.rst:1162 msgid "" "Flag members can be iterated over just like the :class:`Flag` class, and " "only the canonical members will be returned. For example::" msgstr "" -#: ../../howto/enum.rst:1163 +#: ../../howto/enum.rst:1168 msgid "(Note that ``BLACK``, ``PURPLE``, and ``WHITE`` do not show up.)" msgstr "" -#: ../../howto/enum.rst:1165 +#: ../../howto/enum.rst:1170 msgid "" "Inverting a flag member returns the corresponding positive value, rather " "than a negative value --- for example::" msgstr "" -#: ../../howto/enum.rst:1171 +#: ../../howto/enum.rst:1176 msgid "" "Flag members have a length corresponding to the number of power-of-two " "values they contain. For example::" msgstr "" -#: ../../howto/enum.rst:1181 +#: ../../howto/enum.rst:1186 msgid "Enum Cookbook" msgstr "" -#: ../../howto/enum.rst:1184 +#: ../../howto/enum.rst:1189 msgid "" "While :class:`Enum`, :class:`IntEnum`, :class:`StrEnum`, :class:`Flag`, and :" "class:`IntFlag` are expected to cover the majority of use-cases, they cannot " @@ -1082,149 +1089,149 @@ msgid "" "that can be used directly, or as examples for creating one's own." msgstr "" -#: ../../howto/enum.rst:1191 +#: ../../howto/enum.rst:1196 msgid "Omitting values" msgstr "" -#: ../../howto/enum.rst:1193 +#: ../../howto/enum.rst:1198 msgid "" "In many use-cases, one doesn't care what the actual value of an enumeration " "is. There are several ways to define this type of simple enumeration:" msgstr "" -#: ../../howto/enum.rst:1196 +#: ../../howto/enum.rst:1201 msgid "use instances of :class:`auto` for the value" msgstr "" -#: ../../howto/enum.rst:1197 +#: ../../howto/enum.rst:1202 msgid "use instances of :class:`object` as the value" msgstr "" -#: ../../howto/enum.rst:1198 +#: ../../howto/enum.rst:1203 msgid "use a descriptive string as the value" msgstr "" -#: ../../howto/enum.rst:1199 +#: ../../howto/enum.rst:1204 msgid "" "use a tuple as the value and a custom :meth:`__new__` to replace the tuple " "with an :class:`int` value" msgstr "" -#: ../../howto/enum.rst:1202 +#: ../../howto/enum.rst:1207 msgid "" "Using any of these methods signifies to the user that these values are not " "important, and also enables one to add, remove, or reorder members without " "having to renumber the remaining members." msgstr "" -#: ../../howto/enum.rst:1208 +#: ../../howto/enum.rst:1213 msgid "Using :class:`auto`" msgstr "" -#: ../../howto/enum.rst:1210 +#: ../../howto/enum.rst:1215 msgid "Using :class:`auto` would look like::" msgstr "" -#: ../../howto/enum.rst:1222 +#: ../../howto/enum.rst:1227 msgid "Using :class:`object`" msgstr "" -#: ../../howto/enum.rst:1224 +#: ../../howto/enum.rst:1229 msgid "Using :class:`object` would look like::" msgstr "" -#: ../../howto/enum.rst:1234 +#: ../../howto/enum.rst:1239 msgid "" "This is also a good example of why you might want to write your own :meth:" "`__repr__`::" msgstr "" -#: ../../howto/enum.rst:1250 +#: ../../howto/enum.rst:1255 msgid "Using a descriptive string" msgstr "" -#: ../../howto/enum.rst:1252 +#: ../../howto/enum.rst:1257 msgid "Using a string as the value would look like::" msgstr "" -#: ../../howto/enum.rst:1264 +#: ../../howto/enum.rst:1269 msgid "Using a custom :meth:`__new__`" msgstr "" -#: ../../howto/enum.rst:1266 +#: ../../howto/enum.rst:1271 msgid "Using an auto-numbering :meth:`__new__` would look like::" msgstr "" -#: ../../howto/enum.rst:1283 +#: ../../howto/enum.rst:1288 msgid "" "To make a more general purpose ``AutoNumber``, add ``*args`` to the " "signature::" msgstr "" -#: ../../howto/enum.rst:1293 +#: ../../howto/enum.rst:1298 msgid "" "Then when you inherit from ``AutoNumber`` you can write your own " "``__init__`` to handle any extra arguments::" msgstr "" -#: ../../howto/enum.rst:1312 +#: ../../howto/enum.rst:1317 msgid "" "The :meth:`__new__` method, if defined, is used during creation of the Enum " "members; it is then replaced by Enum's :meth:`__new__` which is used after " "class creation for lookup of existing members." msgstr "" -#: ../../howto/enum.rst:1318 +#: ../../howto/enum.rst:1323 msgid "OrderedEnum" msgstr "" -#: ../../howto/enum.rst:1320 +#: ../../howto/enum.rst:1325 msgid "" "An ordered enumeration that is not based on :class:`IntEnum` and so " "maintains the normal :class:`Enum` invariants (such as not being comparable " "to other enumerations)::" msgstr "" -#: ../../howto/enum.rst:1354 +#: ../../howto/enum.rst:1359 msgid "DuplicateFreeEnum" msgstr "" -#: ../../howto/enum.rst:1356 +#: ../../howto/enum.rst:1361 msgid "" "Raises an error if a duplicate member value is found instead of creating an " "alias::" msgstr "" -#: ../../howto/enum.rst:1381 +#: ../../howto/enum.rst:1386 msgid "" "This is a useful example for subclassing Enum to add or change other " "behaviors as well as disallowing aliases. If the only desired change is " "disallowing aliases, the :func:`unique` decorator can be used instead." msgstr "" -#: ../../howto/enum.rst:1387 +#: ../../howto/enum.rst:1392 msgid "Planet" msgstr "" -#: ../../howto/enum.rst:1389 +#: ../../howto/enum.rst:1394 msgid "" "If :meth:`__new__` or :meth:`__init__` is defined, the value of the enum " "member will be passed to those methods::" msgstr "" -#: ../../howto/enum.rst:1418 +#: ../../howto/enum.rst:1423 msgid "TimePeriod" msgstr "" -#: ../../howto/enum.rst:1420 +#: ../../howto/enum.rst:1425 msgid "An example to show the :attr:`_ignore_` attribute in use::" msgstr "" -#: ../../howto/enum.rst:1439 +#: ../../howto/enum.rst:1444 msgid "Subclassing EnumType" msgstr "" -#: ../../howto/enum.rst:1441 +#: ../../howto/enum.rst:1446 msgid "" "While most enum needs can be met by customizing :class:`Enum` subclasses, " "either with class decorators or custom functions, :class:`EnumType` can be " diff --git a/howto/logging-cookbook.po b/howto/logging-cookbook.po index 4506cc1381..1f76b5a68b 100644 --- a/howto/logging-cookbook.po +++ b/howto/logging-cookbook.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-27 00:17+0000\n" +"POT-Creation-Date: 2023-03-30 00:16+0000\n" "PO-Revision-Date: 2018-05-23 14:36+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -195,17 +195,17 @@ msgid "" "adding a ``filters`` section parallel to ``formatters`` and ``handlers``:" msgstr "" -#: ../../howto/logging-cookbook.rst:350 +#: ../../howto/logging-cookbook.rst:352 msgid "and changing the section on the ``stdout`` handler to add it:" msgstr "" -#: ../../howto/logging-cookbook.rst:362 +#: ../../howto/logging-cookbook.rst:366 msgid "" "A filter is just a function, so we can define the ``filter_maker`` (a " "factory function) as follows:" msgstr "" -#: ../../howto/logging-cookbook.rst:375 +#: ../../howto/logging-cookbook.rst:379 msgid "" "This converts the string argument passed in to a numeric level, and returns " "a function which only returns ``True`` if the level of the passed in record " @@ -216,45 +216,45 @@ msgid "" "you define it in a different module." msgstr "" -#: ../../howto/logging-cookbook.rst:383 +#: ../../howto/logging-cookbook.rst:387 msgid "With the filter added, we can run ``main.py``, which in full is:" msgstr "" -#: ../../howto/logging-cookbook.rst:453 +#: ../../howto/logging-cookbook.rst:457 msgid "And after running it like this:" msgstr "" -#: ../../howto/logging-cookbook.rst:459 +#: ../../howto/logging-cookbook.rst:463 msgid "We can see the results are as expected:" msgstr "" -#: ../../howto/logging-cookbook.rst:485 +#: ../../howto/logging-cookbook.rst:489 msgid "Configuration server example" msgstr "" -#: ../../howto/logging-cookbook.rst:487 +#: ../../howto/logging-cookbook.rst:491 msgid "Here is an example of a module using the logging configuration server::" msgstr "" -#: ../../howto/logging-cookbook.rst:518 +#: ../../howto/logging-cookbook.rst:522 msgid "" "And here is a script that takes a filename and sends that file to the " "server, properly preceded with the binary-encoded length, as the new logging " "configuration::" msgstr "" -#: ../../howto/logging-cookbook.rst:543 +#: ../../howto/logging-cookbook.rst:547 msgid "Dealing with handlers that block" msgstr "" -#: ../../howto/logging-cookbook.rst:547 +#: ../../howto/logging-cookbook.rst:551 msgid "" "Sometimes you have to get your logging handlers to do their work without " "blocking the thread you're logging from. This is common in web applications, " "though of course it also occurs in other scenarios." msgstr "" -#: ../../howto/logging-cookbook.rst:551 +#: ../../howto/logging-cookbook.rst:555 msgid "" "A common culprit which demonstrates sluggish behaviour is the :class:" "`SMTPHandler`: sending emails can take a long time, for a number of reasons " @@ -265,7 +265,7 @@ msgid "" "below the Python layer, and outside your control)." msgstr "" -#: ../../howto/logging-cookbook.rst:559 +#: ../../howto/logging-cookbook.rst:563 msgid "" "One solution is to use a two-part approach. For the first part, attach only " "a :class:`QueueHandler` to those loggers which are accessed from performance-" @@ -279,7 +279,7 @@ msgid "" "developers who will use your code." msgstr "" -#: ../../howto/logging-cookbook.rst:570 +#: ../../howto/logging-cookbook.rst:574 msgid "" "The second part of the solution is :class:`QueueListener`, which has been " "designed as the counterpart to :class:`QueueHandler`. A :class:" @@ -290,7 +290,7 @@ msgid "" "handlers for processing." msgstr "" -#: ../../howto/logging-cookbook.rst:578 +#: ../../howto/logging-cookbook.rst:582 msgid "" "The advantage of having a separate :class:`QueueListener` class is that you " "can use the same instance to service multiple ``QueueHandlers``. This is " @@ -299,15 +299,15 @@ msgid "" "benefit." msgstr "" -#: ../../howto/logging-cookbook.rst:583 +#: ../../howto/logging-cookbook.rst:587 msgid "An example of using these two classes follows (imports omitted)::" msgstr "" -#: ../../howto/logging-cookbook.rst:601 +#: ../../howto/logging-cookbook.rst:605 msgid "which, when run, will produce:" msgstr "" -#: ../../howto/logging-cookbook.rst:607 +#: ../../howto/logging-cookbook.rst:611 msgid "" "Although the earlier discussion wasn't specifically talking about async " "code, but rather about slow logging handlers, it should be noted that when " @@ -318,7 +318,7 @@ msgid "" "code runs only in the ``QueueListener`` thread." msgstr "" -#: ../../howto/logging-cookbook.rst:615 +#: ../../howto/logging-cookbook.rst:619 msgid "" "Prior to Python 3.5, the :class:`QueueListener` always passed every message " "received from the queue to every handler it was initialized with. (This was " @@ -330,30 +330,30 @@ msgid "" "handler if it's appropriate to do so." msgstr "" -#: ../../howto/logging-cookbook.rst:628 +#: ../../howto/logging-cookbook.rst:632 msgid "Sending and receiving logging events across a network" msgstr "" -#: ../../howto/logging-cookbook.rst:630 +#: ../../howto/logging-cookbook.rst:634 msgid "" "Let's say you want to send logging events across a network, and handle them " "at the receiving end. A simple way of doing this is attaching a :class:" "`SocketHandler` instance to the root logger at the sending end::" msgstr "" -#: ../../howto/logging-cookbook.rst:658 +#: ../../howto/logging-cookbook.rst:662 msgid "" "At the receiving end, you can set up a receiver using the :mod:" "`socketserver` module. Here is a basic working example::" msgstr "" -#: ../../howto/logging-cookbook.rst:746 +#: ../../howto/logging-cookbook.rst:750 msgid "" "First run the server, and then the client. On the client side, nothing is " "printed on the console; on the server side, you should see something like:" msgstr "" -#: ../../howto/logging-cookbook.rst:758 +#: ../../howto/logging-cookbook.rst:762 msgid "" "Note that there are some security issues with pickle in some scenarios. If " "these affect you, you can use an alternative serialization scheme by " @@ -362,11 +362,11 @@ msgid "" "use your alternative serialization." msgstr "" -#: ../../howto/logging-cookbook.rst:766 +#: ../../howto/logging-cookbook.rst:770 msgid "Running a logging socket listener in production" msgstr "" -#: ../../howto/logging-cookbook.rst:770 +#: ../../howto/logging-cookbook.rst:774 msgid "" "To run a logging listener in production, you may need to use a process-" "management tool such as `Supervisor `_. `Here is a " @@ -374,79 +374,79 @@ msgid "" "the above functionality using Supervisor. It consists of the following files:" msgstr "" -#: ../../howto/logging-cookbook.rst:777 +#: ../../howto/logging-cookbook.rst:781 msgid "File" msgstr "" -#: ../../howto/logging-cookbook.rst:777 +#: ../../howto/logging-cookbook.rst:781 msgid "Purpose" msgstr "" -#: ../../howto/logging-cookbook.rst:779 +#: ../../howto/logging-cookbook.rst:783 msgid ":file:`prepare.sh`" msgstr "" -#: ../../howto/logging-cookbook.rst:779 +#: ../../howto/logging-cookbook.rst:783 msgid "A Bash script to prepare the environment for testing" msgstr "" -#: ../../howto/logging-cookbook.rst:782 +#: ../../howto/logging-cookbook.rst:786 msgid ":file:`supervisor.conf`" msgstr "" -#: ../../howto/logging-cookbook.rst:782 +#: ../../howto/logging-cookbook.rst:786 msgid "" "The Supervisor configuration file, which has entries for the listener and a " "multi-process web application" msgstr "" -#: ../../howto/logging-cookbook.rst:786 +#: ../../howto/logging-cookbook.rst:790 msgid ":file:`ensure_app.sh`" msgstr "" -#: ../../howto/logging-cookbook.rst:786 +#: ../../howto/logging-cookbook.rst:790 msgid "" "A Bash script to ensure that Supervisor is running with the above " "configuration" msgstr "" -#: ../../howto/logging-cookbook.rst:789 +#: ../../howto/logging-cookbook.rst:793 msgid ":file:`log_listener.py`" msgstr "" -#: ../../howto/logging-cookbook.rst:789 +#: ../../howto/logging-cookbook.rst:793 msgid "" "The socket listener program which receives log events and records them to a " "file" msgstr "" -#: ../../howto/logging-cookbook.rst:792 +#: ../../howto/logging-cookbook.rst:796 msgid ":file:`main.py`" msgstr "" -#: ../../howto/logging-cookbook.rst:792 +#: ../../howto/logging-cookbook.rst:796 msgid "" "A simple web application which performs logging via a socket connected to " "the listener" msgstr "" -#: ../../howto/logging-cookbook.rst:795 +#: ../../howto/logging-cookbook.rst:799 msgid ":file:`webapp.json`" msgstr "" -#: ../../howto/logging-cookbook.rst:795 +#: ../../howto/logging-cookbook.rst:799 msgid "A JSON configuration file for the web application" msgstr "" -#: ../../howto/logging-cookbook.rst:797 +#: ../../howto/logging-cookbook.rst:801 msgid ":file:`client.py`" msgstr "" -#: ../../howto/logging-cookbook.rst:797 +#: ../../howto/logging-cookbook.rst:801 msgid "A Python script to exercise the web application" msgstr "" -#: ../../howto/logging-cookbook.rst:800 +#: ../../howto/logging-cookbook.rst:804 msgid "" "The web application uses `Gunicorn `_, which is a " "popular web application server that starts multiple worker processes to " @@ -455,21 +455,21 @@ msgid "" "the socket listener." msgstr "" -#: ../../howto/logging-cookbook.rst:805 +#: ../../howto/logging-cookbook.rst:809 msgid "To test these files, do the following in a POSIX environment:" msgstr "" -#: ../../howto/logging-cookbook.rst:807 +#: ../../howto/logging-cookbook.rst:811 msgid "" "Download `the Gist `__ as a ZIP archive using the :" "guilabel:`Download ZIP` button." msgstr "" -#: ../../howto/logging-cookbook.rst:810 +#: ../../howto/logging-cookbook.rst:814 msgid "Unzip the above files from the archive into a scratch directory." msgstr "" -#: ../../howto/logging-cookbook.rst:812 +#: ../../howto/logging-cookbook.rst:816 msgid "" "In the scratch directory, run ``bash prepare.sh`` to get things ready. This " "creates a :file:`run` subdirectory to contain Supervisor-related and log " @@ -477,19 +477,19 @@ msgid "" "which ``bottle``, ``gunicorn`` and ``supervisor`` are installed." msgstr "" -#: ../../howto/logging-cookbook.rst:817 +#: ../../howto/logging-cookbook.rst:821 msgid "" "Run ``bash ensure_app.sh`` to ensure that Supervisor is running with the " "above configuration." msgstr "" -#: ../../howto/logging-cookbook.rst:820 +#: ../../howto/logging-cookbook.rst:824 msgid "" "Run ``venv/bin/python client.py`` to exercise the web application, which " "will lead to records being written to the log." msgstr "" -#: ../../howto/logging-cookbook.rst:823 +#: ../../howto/logging-cookbook.rst:827 msgid "" "Inspect the log files in the :file:`run` subdirectory. You should see the " "most recent log lines in files matching the pattern :file:`app.log*`. They " @@ -497,23 +497,23 @@ msgid "" "by different worker processes in a non-deterministic way." msgstr "" -#: ../../howto/logging-cookbook.rst:828 +#: ../../howto/logging-cookbook.rst:832 msgid "" "You can shut down the listener and the web application by running ``venv/bin/" "supervisorctl -c supervisor.conf shutdown``." msgstr "" -#: ../../howto/logging-cookbook.rst:831 +#: ../../howto/logging-cookbook.rst:835 msgid "" "You may need to tweak the configuration files in the unlikely event that the " "configured ports clash with something else in your test environment." msgstr "" -#: ../../howto/logging-cookbook.rst:837 +#: ../../howto/logging-cookbook.rst:841 msgid "Adding contextual information to your logging output" msgstr "" -#: ../../howto/logging-cookbook.rst:839 +#: ../../howto/logging-cookbook.rst:843 msgid "" "Sometimes you want logging output to contain contextual information in " "addition to the parameters passed to the logging call. For example, in a " @@ -529,11 +529,11 @@ msgid "" "`Logger` instances becomes effectively unbounded." msgstr "" -#: ../../howto/logging-cookbook.rst:854 +#: ../../howto/logging-cookbook.rst:858 msgid "Using LoggerAdapters to impart contextual information" msgstr "" -#: ../../howto/logging-cookbook.rst:856 +#: ../../howto/logging-cookbook.rst:860 msgid "" "An easy way in which you can pass contextual information to be output along " "with logging event information is to use the :class:`LoggerAdapter` class. " @@ -544,7 +544,7 @@ msgid "" "types of instances interchangeably." msgstr "" -#: ../../howto/logging-cookbook.rst:864 +#: ../../howto/logging-cookbook.rst:868 msgid "" "When you create an instance of :class:`LoggerAdapter`, you pass it a :class:" "`Logger` instance and a dict-like object which contains your contextual " @@ -555,7 +555,7 @@ msgid "" "of :class:`LoggerAdapter`::" msgstr "" -#: ../../howto/logging-cookbook.rst:880 +#: ../../howto/logging-cookbook.rst:884 msgid "" "The :meth:`~LoggerAdapter.process` method of :class:`LoggerAdapter` is where " "the contextual information is added to the logging output. It's passed the " @@ -568,7 +568,7 @@ msgid "" "be silently overwritten." msgstr "" -#: ../../howto/logging-cookbook.rst:889 +#: ../../howto/logging-cookbook.rst:893 msgid "" "The advantage of using 'extra' is that the values in the dict-like object " "are merged into the :class:`LogRecord` instance's __dict__, allowing you to " @@ -579,21 +579,21 @@ msgid "" "`~LoggerAdapter.process` to do what you need. Here is a simple example::" msgstr "" -#: ../../howto/logging-cookbook.rst:905 +#: ../../howto/logging-cookbook.rst:909 msgid "which you can use like this::" msgstr "" -#: ../../howto/logging-cookbook.rst:910 +#: ../../howto/logging-cookbook.rst:914 msgid "" "Then any events that you log to the adapter will have the value of " "``some_conn_id`` prepended to the log messages." msgstr "" -#: ../../howto/logging-cookbook.rst:914 +#: ../../howto/logging-cookbook.rst:918 msgid "Using objects other than dicts to pass contextual information" msgstr "" -#: ../../howto/logging-cookbook.rst:916 +#: ../../howto/logging-cookbook.rst:920 msgid "" "You don't need to pass an actual dict to a :class:`LoggerAdapter` - you " "could pass an instance of a class which implements ``__getitem__`` and " @@ -602,11 +602,11 @@ msgid "" "would be constant)." msgstr "" -#: ../../howto/logging-cookbook.rst:925 +#: ../../howto/logging-cookbook.rst:929 msgid "Using Filters to impart contextual information" msgstr "" -#: ../../howto/logging-cookbook.rst:927 +#: ../../howto/logging-cookbook.rst:931 msgid "" "You can also add contextual information to log output using a user-defined :" "class:`Filter`. ``Filter`` instances are allowed to modify the " @@ -615,7 +615,7 @@ msgid "" "class:`Formatter`." msgstr "" -#: ../../howto/logging-cookbook.rst:932 +#: ../../howto/logging-cookbook.rst:936 msgid "" "For example in a web application, the request being processed (or at least, " "the interesting parts of it) can be stored in a threadlocal (:class:" @@ -627,15 +627,15 @@ msgid "" "an example script::" msgstr "" -#: ../../howto/logging-cookbook.rst:978 +#: ../../howto/logging-cookbook.rst:982 msgid "which, when run, produces something like:" msgstr "" -#: ../../howto/logging-cookbook.rst:996 +#: ../../howto/logging-cookbook.rst:1000 msgid "Use of ``contextvars``" msgstr "" -#: ../../howto/logging-cookbook.rst:998 +#: ../../howto/logging-cookbook.rst:1002 msgid "" "Since Python 3.7, the :mod:`contextvars` module has provided context-local " "storage which works for both :mod:`threading` and :mod:`asyncio` processing " @@ -645,7 +645,7 @@ msgid "" "attributes handled by web applications." msgstr "" -#: ../../howto/logging-cookbook.rst:1004 +#: ../../howto/logging-cookbook.rst:1008 msgid "" "For the purposes of illustration, say that you have different web " "applications, each independent of the other but running in the same Python " @@ -656,18 +656,18 @@ msgid "" "information such as client IP, HTTP request method and client username?" msgstr "" -#: ../../howto/logging-cookbook.rst:1011 +#: ../../howto/logging-cookbook.rst:1015 msgid "Let's assume that the library can be simulated by the following code:" msgstr "" -#: ../../howto/logging-cookbook.rst:1027 +#: ../../howto/logging-cookbook.rst:1031 msgid "" "We can simulate the multiple web applications by means of two simple " "classes, ``Request`` and ``WebApp``. These simulate how real threaded web " "applications work - each request is handled by a thread:" msgstr "" -#: ../../howto/logging-cookbook.rst:1171 +#: ../../howto/logging-cookbook.rst:1175 msgid "" "If you run the above, you should find that roughly half the requests go " "into :file:`app1.log` and the rest into :file:`app2.log`, and the all the " @@ -678,11 +678,11 @@ msgid "" "illustrated by the following shell output:" msgstr "" -#: ../../howto/logging-cookbook.rst:1218 +#: ../../howto/logging-cookbook.rst:1222 msgid "Imparting contextual information in handlers" msgstr "" -#: ../../howto/logging-cookbook.rst:1220 +#: ../../howto/logging-cookbook.rst:1224 msgid "" "Each :class:`~Handler` has its own chain of filters. If you want to add " "contextual information to a :class:`LogRecord` without leaking it to other " @@ -690,11 +690,11 @@ msgid "" "instead of modifying it in-place, as shown in the following script::" msgstr "" -#: ../../howto/logging-cookbook.rst:1247 +#: ../../howto/logging-cookbook.rst:1251 msgid "Logging to a single file from multiple processes" msgstr "" -#: ../../howto/logging-cookbook.rst:1249 +#: ../../howto/logging-cookbook.rst:1253 msgid "" "Although logging is thread-safe, and logging to a single file from multiple " "threads in a single process *is* supported, logging to a single file from " @@ -710,7 +710,7 @@ msgid "" "you to adapt in your own applications." msgstr "" -#: ../../howto/logging-cookbook.rst:1262 +#: ../../howto/logging-cookbook.rst:1266 msgid "" "You could also write your own handler which uses the :class:" "`~multiprocessing.Lock` class from the :mod:`multiprocessing` module to " @@ -721,7 +721,7 @@ msgid "" "platforms (see https://bugs.python.org/issue3770)." msgstr "" -#: ../../howto/logging-cookbook.rst:1272 +#: ../../howto/logging-cookbook.rst:1276 msgid "" "Alternatively, you can use a ``Queue`` and a :class:`QueueHandler` to send " "all logging events to one of the processes in your multi-process " @@ -736,13 +736,13 @@ msgid "" "requirements::" msgstr "" -#: ../../howto/logging-cookbook.rst:1388 +#: ../../howto/logging-cookbook.rst:1392 msgid "" "A variant of the above script keeps the logging in the main process, in a " "separate thread::" msgstr "" -#: ../../howto/logging-cookbook.rst:1483 +#: ../../howto/logging-cookbook.rst:1487 msgid "" "This variant shows how you can e.g. apply configuration for particular " "loggers - e.g. the ``foo`` logger has a special handler which stores all " @@ -752,34 +752,34 @@ msgid "" "appropriate destinations." msgstr "" -#: ../../howto/logging-cookbook.rst:1490 +#: ../../howto/logging-cookbook.rst:1494 msgid "Using concurrent.futures.ProcessPoolExecutor" msgstr "" -#: ../../howto/logging-cookbook.rst:1492 +#: ../../howto/logging-cookbook.rst:1496 msgid "" "If you want to use :class:`concurrent.futures.ProcessPoolExecutor` to start " "your worker processes, you need to create the queue slightly differently. " "Instead of" msgstr "" -#: ../../howto/logging-cookbook.rst:1500 +#: ../../howto/logging-cookbook.rst:1504 msgid "you should use" msgstr "" -#: ../../howto/logging-cookbook.rst:1506 +#: ../../howto/logging-cookbook.rst:1510 msgid "and you can then replace the worker creation from this::" msgstr "" -#: ../../howto/logging-cookbook.rst:1517 +#: ../../howto/logging-cookbook.rst:1521 msgid "to this (remembering to first import :mod:`concurrent.futures`)::" msgstr "" -#: ../../howto/logging-cookbook.rst:1524 +#: ../../howto/logging-cookbook.rst:1528 msgid "Deploying Web applications using Gunicorn and uWSGI" msgstr "" -#: ../../howto/logging-cookbook.rst:1526 +#: ../../howto/logging-cookbook.rst:1530 msgid "" "When deploying Web applications using `Gunicorn `_ or " "`uWSGI `_ (or similar), " @@ -791,11 +791,11 @@ msgid "" "listener in production`_ for more details." msgstr "" -#: ../../howto/logging-cookbook.rst:1536 +#: ../../howto/logging-cookbook.rst:1540 msgid "Using file rotation" msgstr "" -#: ../../howto/logging-cookbook.rst:1541 +#: ../../howto/logging-cookbook.rst:1545 msgid "" "Sometimes you want to let a log file grow to a certain size, then open a new " "file and log to that. You may want to keep a certain number of these files, " @@ -805,13 +805,13 @@ msgid "" "RotatingFileHandler`::" msgstr "" -#: ../../howto/logging-cookbook.rst:1573 +#: ../../howto/logging-cookbook.rst:1577 msgid "" "The result should be 6 separate files, each with part of the log history for " "the application:" msgstr "" -#: ../../howto/logging-cookbook.rst:1585 +#: ../../howto/logging-cookbook.rst:1589 msgid "" "The most current file is always :file:`logging_rotatingfile_example.out`, " "and each time it reaches the size limit it is renamed with the suffix " @@ -819,17 +819,17 @@ msgid "" "(``.1`` becomes ``.2``, etc.) and the ``.6`` file is erased." msgstr "" -#: ../../howto/logging-cookbook.rst:1590 +#: ../../howto/logging-cookbook.rst:1594 msgid "" "Obviously this example sets the log length much too small as an extreme " "example. You would want to set *maxBytes* to an appropriate value." msgstr "" -#: ../../howto/logging-cookbook.rst:1596 +#: ../../howto/logging-cookbook.rst:1600 msgid "Use of alternative formatting styles" msgstr "" -#: ../../howto/logging-cookbook.rst:1598 +#: ../../howto/logging-cookbook.rst:1602 msgid "" "When logging was added to the Python standard library, the only way of " "formatting messages with variable content was to use the %-formatting " @@ -838,7 +838,7 @@ msgid "" "Python 2.6)." msgstr "" -#: ../../howto/logging-cookbook.rst:1604 +#: ../../howto/logging-cookbook.rst:1608 msgid "" "Logging (as of 3.2) provides improved support for these two additional " "formatting styles. The :class:`Formatter` class been enhanced to take an " @@ -851,14 +851,14 @@ msgid "" "session to show the possibilities:" msgstr "" -#: ../../howto/logging-cookbook.rst:1638 +#: ../../howto/logging-cookbook.rst:1642 msgid "" "Note that the formatting of logging messages for final output to logs is " "completely independent of how an individual logging message is constructed. " "That can still use %-formatting, as shown here::" msgstr "" -#: ../../howto/logging-cookbook.rst:1646 +#: ../../howto/logging-cookbook.rst:1650 msgid "" "Logging calls (``logger.debug()``, ``logger.info()`` etc.) only take " "positional parameters for the actual logging message itself, with keyword " @@ -874,7 +874,7 @@ msgid "" "strings." msgstr "" -#: ../../howto/logging-cookbook.rst:1659 +#: ../../howto/logging-cookbook.rst:1663 msgid "" "There is, however, a way that you can use {}- and $- formatting to construct " "your individual log messages. Recall that for a message you can use an " @@ -883,7 +883,7 @@ msgid "" "the following two classes::" msgstr "" -#: ../../howto/logging-cookbook.rst:1683 +#: ../../howto/logging-cookbook.rst:1687 msgid "" "Either of these can be used in place of a format string, to allow {}- or $-" "formatting to be used to build the actual \"message\" part which appears in " @@ -894,21 +894,21 @@ msgid "" "used as a synonym/alias for :func:`gettext.gettext` or its brethren)." msgstr "" -#: ../../howto/logging-cookbook.rst:1691 +#: ../../howto/logging-cookbook.rst:1695 msgid "" "The above classes are not included in Python, though they're easy enough to " "copy and paste into your own code. They can be used as follows (assuming " "that they're declared in a module called ``wherever``):" msgstr "" -#: ../../howto/logging-cookbook.rst:1713 +#: ../../howto/logging-cookbook.rst:1717 msgid "" "While the above examples use ``print()`` to show how the formatting works, " "you would of course use ``logger.debug()`` or similar to actually log using " "this approach." msgstr "" -#: ../../howto/logging-cookbook.rst:1717 +#: ../../howto/logging-cookbook.rst:1721 msgid "" "One thing to note is that you pay no significant performance penalty with " "this approach: the actual formatting happens not when you make the logging " @@ -919,23 +919,23 @@ msgid "" "sugar for a constructor call to one of the XXXMessage classes." msgstr "" -#: ../../howto/logging-cookbook.rst:1725 +#: ../../howto/logging-cookbook.rst:1729 msgid "" "If you prefer, you can use a :class:`LoggerAdapter` to achieve a similar " "effect to the above, as in the following example::" msgstr "" -#: ../../howto/logging-cookbook.rst:1756 +#: ../../howto/logging-cookbook.rst:1760 msgid "" "The above script should log the message ``Hello, world!`` when run with " "Python 3.2 or later." msgstr "" -#: ../../howto/logging-cookbook.rst:1765 +#: ../../howto/logging-cookbook.rst:1769 msgid "Customizing ``LogRecord``" msgstr "" -#: ../../howto/logging-cookbook.rst:1767 +#: ../../howto/logging-cookbook.rst:1771 msgid "" "Every logging event is represented by a :class:`LogRecord` instance. When an " "event is logged and not filtered out by a logger's level, a :class:" @@ -946,13 +946,13 @@ msgid "" "was done:" msgstr "" -#: ../../howto/logging-cookbook.rst:1774 +#: ../../howto/logging-cookbook.rst:1778 msgid "" ":meth:`Logger.makeRecord`, which is called in the normal process of logging " "an event. This invoked :class:`LogRecord` directly to create an instance." msgstr "" -#: ../../howto/logging-cookbook.rst:1777 +#: ../../howto/logging-cookbook.rst:1781 msgid "" ":func:`makeLogRecord`, which is called with a dictionary containing " "attributes to be added to the LogRecord. This is typically invoked when a " @@ -961,27 +961,27 @@ msgid "" "`~handlers.HTTPHandler`)." msgstr "" -#: ../../howto/logging-cookbook.rst:1783 +#: ../../howto/logging-cookbook.rst:1787 msgid "" "This has usually meant that if you need to do anything special with a :class:" "`LogRecord`, you've had to do one of the following." msgstr "" -#: ../../howto/logging-cookbook.rst:1786 +#: ../../howto/logging-cookbook.rst:1790 msgid "" "Create your own :class:`Logger` subclass, which overrides :meth:`Logger." "makeRecord`, and set it using :func:`~logging.setLoggerClass` before any " "loggers that you care about are instantiated." msgstr "" -#: ../../howto/logging-cookbook.rst:1789 +#: ../../howto/logging-cookbook.rst:1793 msgid "" "Add a :class:`Filter` to a logger or handler, which does the necessary " "special manipulation you need when its :meth:`~Filter.filter` method is " "called." msgstr "" -#: ../../howto/logging-cookbook.rst:1793 +#: ../../howto/logging-cookbook.rst:1797 msgid "" "The first approach would be a little unwieldy in the scenario where (say) " "several different libraries wanted to do different things. Each would " @@ -989,7 +989,7 @@ msgid "" "last would win." msgstr "" -#: ../../howto/logging-cookbook.rst:1798 +#: ../../howto/logging-cookbook.rst:1802 msgid "" "The second approach works reasonably well for many cases, but does not allow " "you to e.g. use a specialized subclass of :class:`LogRecord`. Library " @@ -998,7 +998,7 @@ msgid "" "would do simply by adding new packages or modules and doing ::" msgstr "" -#: ../../howto/logging-cookbook.rst:1806 +#: ../../howto/logging-cookbook.rst:1810 msgid "" "at module level). It's probably one too many things to think about. " "Developers could also add the filter to a :class:`~logging.NullHandler` " @@ -1008,7 +1008,7 @@ msgid "" "developer." msgstr "" -#: ../../howto/logging-cookbook.rst:1812 +#: ../../howto/logging-cookbook.rst:1816 msgid "" "In Python 3.2 and later, :class:`~logging.LogRecord` creation is done " "through a factory, which you can specify. The factory is just a callable you " @@ -1018,7 +1018,7 @@ msgid "" "`LogRecord` is the default setting for the factory." msgstr "" -#: ../../howto/logging-cookbook.rst:1819 +#: ../../howto/logging-cookbook.rst:1823 msgid "" "This approach allows a custom factory to control all aspects of LogRecord " "creation. For example, you could return a subclass, or just add some " @@ -1026,7 +1026,7 @@ msgid "" "this::" msgstr "" -#: ../../howto/logging-cookbook.rst:1832 +#: ../../howto/logging-cookbook.rst:1836 msgid "" "This pattern allows different libraries to chain factories together, and as " "long as they don't overwrite each other's attributes or unintentionally " @@ -1036,70 +1036,70 @@ msgid "" "used when the use of a :class:`Filter` does not provide the desired result." msgstr "" -#: ../../howto/logging-cookbook.rst:1843 +#: ../../howto/logging-cookbook.rst:1847 msgid "Subclassing QueueHandler - a ZeroMQ example" msgstr "" -#: ../../howto/logging-cookbook.rst:1845 +#: ../../howto/logging-cookbook.rst:1849 msgid "" "You can use a :class:`QueueHandler` subclass to send messages to other kinds " "of queues, for example a ZeroMQ 'publish' socket. In the example below,the " "socket is created separately and passed to the handler (as its 'queue')::" msgstr "" -#: ../../howto/logging-cookbook.rst:1864 +#: ../../howto/logging-cookbook.rst:1868 msgid "" "Of course there are other ways of organizing this, for example passing in " "the data needed by the handler to create the socket::" msgstr "" -#: ../../howto/logging-cookbook.rst:1882 +#: ../../howto/logging-cookbook.rst:1886 msgid "Subclassing QueueListener - a ZeroMQ example" msgstr "" -#: ../../howto/logging-cookbook.rst:1884 +#: ../../howto/logging-cookbook.rst:1888 msgid "" "You can also subclass :class:`QueueListener` to get messages from other " "kinds of queues, for example a ZeroMQ 'subscribe' socket. Here's an example::" msgstr "" -#: ../../howto/logging-cookbook.rst:1903 ../../howto/logging-cookbook.rst:3944 +#: ../../howto/logging-cookbook.rst:1907 ../../howto/logging-cookbook.rst:3948 msgid "Module :mod:`logging`" msgstr ":mod:`logging` 模組" -#: ../../howto/logging-cookbook.rst:1903 ../../howto/logging-cookbook.rst:3944 +#: ../../howto/logging-cookbook.rst:1907 ../../howto/logging-cookbook.rst:3948 msgid "API reference for the logging module." msgstr "" -#: ../../howto/logging-cookbook.rst:1906 ../../howto/logging-cookbook.rst:3947 +#: ../../howto/logging-cookbook.rst:1910 ../../howto/logging-cookbook.rst:3951 msgid "Module :mod:`logging.config`" msgstr ":mod:`logging.config` 模組" -#: ../../howto/logging-cookbook.rst:1906 ../../howto/logging-cookbook.rst:3947 +#: ../../howto/logging-cookbook.rst:1910 ../../howto/logging-cookbook.rst:3951 msgid "Configuration API for the logging module." msgstr "" -#: ../../howto/logging-cookbook.rst:1909 ../../howto/logging-cookbook.rst:3950 +#: ../../howto/logging-cookbook.rst:1913 ../../howto/logging-cookbook.rst:3954 msgid "Module :mod:`logging.handlers`" msgstr ":mod:`logging.handlers` 模組" -#: ../../howto/logging-cookbook.rst:1909 ../../howto/logging-cookbook.rst:3950 +#: ../../howto/logging-cookbook.rst:1913 ../../howto/logging-cookbook.rst:3954 msgid "Useful handlers included with the logging module." msgstr "" -#: ../../howto/logging-cookbook.rst:1911 +#: ../../howto/logging-cookbook.rst:1915 msgid ":ref:`A basic logging tutorial `" msgstr "" -#: ../../howto/logging-cookbook.rst:1913 +#: ../../howto/logging-cookbook.rst:1917 msgid ":ref:`A more advanced logging tutorial `" msgstr "" -#: ../../howto/logging-cookbook.rst:1917 +#: ../../howto/logging-cookbook.rst:1921 msgid "An example dictionary-based configuration" msgstr "" -#: ../../howto/logging-cookbook.rst:1919 +#: ../../howto/logging-cookbook.rst:1923 msgid "" "Below is an example of a logging configuration dictionary - it's taken from " "the `documentation on the Django project `_ of the Django documentation." msgstr "" -#: ../../howto/logging-cookbook.rst:1982 +#: ../../howto/logging-cookbook.rst:1986 msgid "Using a rotator and namer to customize log rotation processing" msgstr "" -#: ../../howto/logging-cookbook.rst:1984 +#: ../../howto/logging-cookbook.rst:1988 msgid "" "An example of how you can define a namer and rotator is given in the " "following runnable script, which shows gzip compression of the log file::" msgstr "" -#: ../../howto/logging-cookbook.rst:2015 +#: ../../howto/logging-cookbook.rst:2019 msgid "" "After running this, you will see six new files, five of which are compressed:" msgstr "" -#: ../../howto/logging-cookbook.rst:2028 +#: ../../howto/logging-cookbook.rst:2032 msgid "A more elaborate multiprocessing example" msgstr "" -#: ../../howto/logging-cookbook.rst:2030 +#: ../../howto/logging-cookbook.rst:2034 msgid "" "The following working example shows how logging can be used with " "multiprocessing using configuration files. The configurations are fairly " @@ -1141,7 +1141,7 @@ msgid "" "in a real multiprocessing scenario." msgstr "" -#: ../../howto/logging-cookbook.rst:2035 +#: ../../howto/logging-cookbook.rst:2039 msgid "" "In the example, the main process spawns a listener process and some worker " "processes. Each of the main process, the listener and the workers have three " @@ -1154,17 +1154,17 @@ msgid "" "own scenario." msgstr "" -#: ../../howto/logging-cookbook.rst:2045 +#: ../../howto/logging-cookbook.rst:2049 msgid "" "Here's the script - the docstrings and the comments hopefully explain how it " "works::" msgstr "" -#: ../../howto/logging-cookbook.rst:2257 +#: ../../howto/logging-cookbook.rst:2261 msgid "Inserting a BOM into messages sent to a SysLogHandler" msgstr "" -#: ../../howto/logging-cookbook.rst:2259 +#: ../../howto/logging-cookbook.rst:2263 msgid "" ":rfc:`5424` requires that a Unicode message be sent to a syslog daemon as a " "set of bytes which have the following structure: an optional pure-ASCII " @@ -1173,7 +1173,7 @@ msgid "" "<5424#section-6>`.)" msgstr "" -#: ../../howto/logging-cookbook.rst:2265 +#: ../../howto/logging-cookbook.rst:2269 msgid "" "In Python 3.1, code was added to :class:`~logging.handlers.SysLogHandler` to " "insert a BOM into the message, but unfortunately, it was implemented " @@ -1181,7 +1181,7 @@ msgid "" "hence not allowing any pure-ASCII component to appear before it." msgstr "" -#: ../../howto/logging-cookbook.rst:2271 +#: ../../howto/logging-cookbook.rst:2275 msgid "" "As this behaviour is broken, the incorrect BOM insertion code is being " "removed from Python 3.2.4 and later. However, it is not being replaced, and " @@ -1190,33 +1190,33 @@ msgid "" "encoded using UTF-8, then you need to do the following:" msgstr "" -#: ../../howto/logging-cookbook.rst:2277 +#: ../../howto/logging-cookbook.rst:2281 msgid "" "Attach a :class:`~logging.Formatter` instance to your :class:`~logging." "handlers.SysLogHandler` instance, with a format string such as::" msgstr "" -#: ../../howto/logging-cookbook.rst:2283 +#: ../../howto/logging-cookbook.rst:2287 msgid "" "The Unicode code point U+FEFF, when encoded using UTF-8, will be encoded as " "a UTF-8 BOM -- the byte-string ``b'\\xef\\xbb\\xbf'``." msgstr "" -#: ../../howto/logging-cookbook.rst:2286 +#: ../../howto/logging-cookbook.rst:2290 msgid "" "Replace the ASCII section with whatever placeholders you like, but make sure " "that the data that appears in there after substitution is always ASCII (that " "way, it will remain unchanged after UTF-8 encoding)." msgstr "" -#: ../../howto/logging-cookbook.rst:2290 +#: ../../howto/logging-cookbook.rst:2294 msgid "" "Replace the Unicode section with whatever placeholders you like; if the data " "which appears there after substitution contains characters outside the ASCII " "range, that's fine -- it will be encoded using UTF-8." msgstr "" -#: ../../howto/logging-cookbook.rst:2294 +#: ../../howto/logging-cookbook.rst:2298 msgid "" "The formatted message *will* be encoded using UTF-8 encoding by " "``SysLogHandler``. If you follow the above rules, you should be able to " @@ -1225,11 +1225,11 @@ msgid "" "daemon may complain." msgstr "" -#: ../../howto/logging-cookbook.rst:2301 +#: ../../howto/logging-cookbook.rst:2305 msgid "Implementing structured logging" msgstr "" -#: ../../howto/logging-cookbook.rst:2303 +#: ../../howto/logging-cookbook.rst:2307 msgid "" "Although most logging messages are intended for reading by humans, and thus " "not readily machine-parseable, there might be circumstances where you want " @@ -1241,31 +1241,31 @@ msgid "" "machine-parseable manner::" msgstr "" -#: ../../howto/logging-cookbook.rst:2327 +#: ../../howto/logging-cookbook.rst:2331 msgid "If the above script is run, it prints:" msgstr "" -#: ../../howto/logging-cookbook.rst:2333 ../../howto/logging-cookbook.rst:2375 +#: ../../howto/logging-cookbook.rst:2337 ../../howto/logging-cookbook.rst:2379 msgid "" "Note that the order of items might be different according to the version of " "Python used." msgstr "" -#: ../../howto/logging-cookbook.rst:2336 +#: ../../howto/logging-cookbook.rst:2340 msgid "" "If you need more specialised processing, you can use a custom JSON encoder, " "as in the following complete example::" msgstr "" -#: ../../howto/logging-cookbook.rst:2369 +#: ../../howto/logging-cookbook.rst:2373 msgid "When the above script is run, it prints:" msgstr "" -#: ../../howto/logging-cookbook.rst:2384 +#: ../../howto/logging-cookbook.rst:2388 msgid "Customizing handlers with :func:`dictConfig`" msgstr "" -#: ../../howto/logging-cookbook.rst:2386 +#: ../../howto/logging-cookbook.rst:2390 msgid "" "There are times when you want to customize logging handlers in particular " "ways, and if you use :func:`dictConfig` you may be able to do this without " @@ -1275,24 +1275,24 @@ msgid "" "customize handler creation using a plain function such as::" msgstr "" -#: ../../howto/logging-cookbook.rst:2400 +#: ../../howto/logging-cookbook.rst:2404 msgid "" "You can then specify, in a logging configuration passed to :func:" "`dictConfig`, that a logging handler be created by calling this function::" msgstr "" -#: ../../howto/logging-cookbook.rst:2433 +#: ../../howto/logging-cookbook.rst:2437 msgid "" "In this example I am setting the ownership using the ``pulse`` user and " "group, just for the purposes of illustration. Putting it together into a " "working script, ``chowntest.py``::" msgstr "" -#: ../../howto/logging-cookbook.rst:2480 +#: ../../howto/logging-cookbook.rst:2484 msgid "To run this, you will probably need to run as ``root``:" msgstr "" -#: ../../howto/logging-cookbook.rst:2490 +#: ../../howto/logging-cookbook.rst:2494 msgid "" "Note that this example uses Python 3.3 because that's where :func:`shutil." "chown` makes an appearance. This approach should work with any Python " @@ -1301,17 +1301,17 @@ msgid "" "change using e.g. :func:`os.chown`." msgstr "" -#: ../../howto/logging-cookbook.rst:2496 +#: ../../howto/logging-cookbook.rst:2500 msgid "" "In practice, the handler-creating function may be in a utility module " "somewhere in your project. Instead of the line in the configuration::" msgstr "" -#: ../../howto/logging-cookbook.rst:2501 +#: ../../howto/logging-cookbook.rst:2505 msgid "you could use e.g.::" msgstr "" -#: ../../howto/logging-cookbook.rst:2505 +#: ../../howto/logging-cookbook.rst:2509 msgid "" "where ``project.util`` can be replaced with the actual name of the package " "where the function resides. In the above working script, using ``'ext://" @@ -1319,25 +1319,25 @@ msgid "" "resolved by :func:`dictConfig` from the ``ext://`` specification." msgstr "" -#: ../../howto/logging-cookbook.rst:2510 +#: ../../howto/logging-cookbook.rst:2514 msgid "" "This example hopefully also points the way to how you could implement other " "types of file change - e.g. setting specific POSIX permission bits - in the " "same way, using :func:`os.chmod`." msgstr "" -#: ../../howto/logging-cookbook.rst:2514 +#: ../../howto/logging-cookbook.rst:2518 msgid "" "Of course, the approach could also be extended to types of handler other " "than a :class:`~logging.FileHandler` - for example, one of the rotating file " "handlers, or a different type of handler altogether." msgstr "" -#: ../../howto/logging-cookbook.rst:2524 +#: ../../howto/logging-cookbook.rst:2528 msgid "Using particular formatting styles throughout your application" msgstr "" -#: ../../howto/logging-cookbook.rst:2526 +#: ../../howto/logging-cookbook.rst:2530 msgid "" "In Python 3.2, the :class:`~logging.Formatter` gained a ``style`` keyword " "parameter which, while defaulting to ``%`` for backward compatibility, " @@ -1348,7 +1348,7 @@ msgid "" "is constructed." msgstr "" -#: ../../howto/logging-cookbook.rst:2533 +#: ../../howto/logging-cookbook.rst:2537 msgid "" "Logging calls (:meth:`~Logger.debug`, :meth:`~Logger.info` etc.) only take " "positional parameters for the actual logging message itself, with keyword " @@ -1363,7 +1363,7 @@ msgid "" "calls which are out there in existing code will be using %-format strings." msgstr "" -#: ../../howto/logging-cookbook.rst:2545 +#: ../../howto/logging-cookbook.rst:2549 msgid "" "There have been suggestions to associate format styles with specific " "loggers, but that approach also runs into backward compatibility problems " @@ -1371,7 +1371,7 @@ msgid "" "formatting." msgstr "" -#: ../../howto/logging-cookbook.rst:2549 +#: ../../howto/logging-cookbook.rst:2553 msgid "" "For logging to work interoperably between any third-party libraries and your " "code, decisions about formatting need to be made at the level of the " @@ -1379,11 +1379,11 @@ msgid "" "formatting styles can be accommodated." msgstr "" -#: ../../howto/logging-cookbook.rst:2556 +#: ../../howto/logging-cookbook.rst:2560 msgid "Using LogRecord factories" msgstr "" -#: ../../howto/logging-cookbook.rst:2558 +#: ../../howto/logging-cookbook.rst:2562 msgid "" "In Python 3.2, along with the :class:`~logging.Formatter` changes mentioned " "above, the logging package gained the ability to allow users to set their " @@ -1398,17 +1398,17 @@ msgid "" "implementation does." msgstr "" -#: ../../howto/logging-cookbook.rst:2569 +#: ../../howto/logging-cookbook.rst:2573 msgid "" "Refer to the reference documentation on :func:`setLogRecordFactory` and :" "class:`LogRecord` for more information." msgstr "" -#: ../../howto/logging-cookbook.rst:2574 +#: ../../howto/logging-cookbook.rst:2578 msgid "Using custom message objects" msgstr "" -#: ../../howto/logging-cookbook.rst:2576 +#: ../../howto/logging-cookbook.rst:2580 msgid "" "There is another, perhaps simpler way that you can use {}- and $- formatting " "to construct your individual log messages. You may recall (from :ref:" @@ -1418,7 +1418,7 @@ msgid "" "following two classes::" msgstr "" -#: ../../howto/logging-cookbook.rst:2601 +#: ../../howto/logging-cookbook.rst:2605 msgid "" "Either of these can be used in place of a format string, to allow {}- or $-" "formatting to be used to build the actual \"message\" part which appears in " @@ -1429,17 +1429,17 @@ msgid "" "using ``_`` for localization)." msgstr "" -#: ../../howto/logging-cookbook.rst:2609 +#: ../../howto/logging-cookbook.rst:2613 msgid "" "Examples of this approach are given below. Firstly, formatting with :meth:" "`str.format`::" msgstr "" -#: ../../howto/logging-cookbook.rst:2623 +#: ../../howto/logging-cookbook.rst:2627 msgid "Secondly, formatting with :class:`string.Template`::" msgstr "" -#: ../../howto/logging-cookbook.rst:2630 +#: ../../howto/logging-cookbook.rst:2634 msgid "" "One thing to note is that you pay no significant performance penalty with " "this approach: the actual formatting happens not when you make the logging " @@ -1451,11 +1451,11 @@ msgid "" "above." msgstr "" -#: ../../howto/logging-cookbook.rst:2644 +#: ../../howto/logging-cookbook.rst:2648 msgid "Configuring filters with :func:`dictConfig`" msgstr "" -#: ../../howto/logging-cookbook.rst:2646 +#: ../../howto/logging-cookbook.rst:2650 msgid "" "You *can* configure filters using :func:`~logging.config.dictConfig`, though " "it might not be obvious at first glance how to do it (hence this recipe). " @@ -1470,22 +1470,22 @@ msgid "" "complete example::" msgstr "" -#: ../../howto/logging-cookbook.rst:2699 +#: ../../howto/logging-cookbook.rst:2703 msgid "" "This example shows how you can pass configuration data to the callable which " "constructs the instance, in the form of keyword parameters. When run, the " "above script will print:" msgstr "" -#: ../../howto/logging-cookbook.rst:2707 +#: ../../howto/logging-cookbook.rst:2711 msgid "which shows that the filter is working as configured." msgstr "" -#: ../../howto/logging-cookbook.rst:2709 +#: ../../howto/logging-cookbook.rst:2713 msgid "A couple of extra points to note:" msgstr "" -#: ../../howto/logging-cookbook.rst:2711 +#: ../../howto/logging-cookbook.rst:2715 msgid "" "If you can't refer to the callable directly in the configuration (e.g. if it " "lives in a different module, and you can't import it directly where the " @@ -1495,7 +1495,7 @@ msgid "" "the above example." msgstr "" -#: ../../howto/logging-cookbook.rst:2718 +#: ../../howto/logging-cookbook.rst:2722 msgid "" "As well as for filters, this technique can also be used to configure custom " "handlers and formatters. See :ref:`logging-config-dict-userdef` for more " @@ -1504,11 +1504,11 @@ msgid "" "above." msgstr "" -#: ../../howto/logging-cookbook.rst:2727 +#: ../../howto/logging-cookbook.rst:2731 msgid "Customized exception formatting" msgstr "" -#: ../../howto/logging-cookbook.rst:2729 +#: ../../howto/logging-cookbook.rst:2733 msgid "" "There might be times when you want to do customized exception formatting - " "for argument's sake, let's say you want exactly one line per logged event, " @@ -1516,22 +1516,22 @@ msgid "" "formatter class, as shown in the following example::" msgstr "" -#: ../../howto/logging-cookbook.rst:2770 +#: ../../howto/logging-cookbook.rst:2774 msgid "When run, this produces a file with exactly two lines:" msgstr "" -#: ../../howto/logging-cookbook.rst:2777 +#: ../../howto/logging-cookbook.rst:2781 msgid "" "While the above treatment is simplistic, it points the way to how exception " "information can be formatted to your liking. The :mod:`traceback` module may " "be helpful for more specialized needs." msgstr "" -#: ../../howto/logging-cookbook.rst:2784 +#: ../../howto/logging-cookbook.rst:2788 msgid "Speaking logging messages" msgstr "" -#: ../../howto/logging-cookbook.rst:2786 +#: ../../howto/logging-cookbook.rst:2790 msgid "" "There might be situations when it is desirable to have logging messages " "rendered in an audible rather than a visible format. This is easy to do if " @@ -1548,24 +1548,24 @@ msgid "" "approach, which assumes that the ``espeak`` TTS package is available::" msgstr "" -#: ../../howto/logging-cookbook.rst:2828 +#: ../../howto/logging-cookbook.rst:2832 msgid "" "When run, this script should say \"Hello\" and then \"Goodbye\" in a female " "voice." msgstr "" -#: ../../howto/logging-cookbook.rst:2830 +#: ../../howto/logging-cookbook.rst:2834 msgid "" "The above approach can, of course, be adapted to other TTS systems and even " "other systems altogether which can process messages via external programs " "run from a command line." msgstr "" -#: ../../howto/logging-cookbook.rst:2838 +#: ../../howto/logging-cookbook.rst:2842 msgid "Buffering logging messages and outputting them conditionally" msgstr "" -#: ../../howto/logging-cookbook.rst:2840 +#: ../../howto/logging-cookbook.rst:2844 msgid "" "There might be situations where you want to log messages in a temporary area " "and only output them if a certain condition occurs. For example, you may " @@ -1575,7 +1575,7 @@ msgid "" "debug information to be output as well as the error." msgstr "" -#: ../../howto/logging-cookbook.rst:2847 +#: ../../howto/logging-cookbook.rst:2851 msgid "" "Here is an example which shows how you could do this using a decorator for " "your functions where you want logging to behave this way. It makes use of " @@ -1588,7 +1588,7 @@ msgid "" "subclass of ``MemoryHandler`` if you want custom flushing behavior." msgstr "" -#: ../../howto/logging-cookbook.rst:2857 +#: ../../howto/logging-cookbook.rst:2861 msgid "" "The example script has a simple function, ``foo``, which just cycles through " "all the logging levels, writing to ``sys.stderr`` to say what level it's " @@ -1597,7 +1597,7 @@ msgid "" "levels - otherwise, it only logs at DEBUG, INFO and WARNING levels." msgstr "" -#: ../../howto/logging-cookbook.rst:2863 +#: ../../howto/logging-cookbook.rst:2867 msgid "" "The script just arranges to decorate ``foo`` with a decorator which will do " "the conditional logging that's required. The decorator takes a logger as a " @@ -1609,30 +1609,30 @@ msgid "" "respectively." msgstr "" -#: ../../howto/logging-cookbook.rst:2871 +#: ../../howto/logging-cookbook.rst:2875 msgid "Here's the script::" msgstr "" -#: ../../howto/logging-cookbook.rst:2934 +#: ../../howto/logging-cookbook.rst:2938 msgid "When this script is run, the following output should be observed:" msgstr "" -#: ../../howto/logging-cookbook.rst:2964 +#: ../../howto/logging-cookbook.rst:2968 msgid "" "As you can see, actual logging output only occurs when an event is logged " "whose severity is ERROR or greater, but in that case, any previous events at " "lower severities are also logged." msgstr "" -#: ../../howto/logging-cookbook.rst:2968 +#: ../../howto/logging-cookbook.rst:2972 msgid "You can of course use the conventional means of decoration::" msgstr "" -#: ../../howto/logging-cookbook.rst:2978 +#: ../../howto/logging-cookbook.rst:2982 msgid "Sending logging messages to email, with buffering" msgstr "" -#: ../../howto/logging-cookbook.rst:2980 +#: ../../howto/logging-cookbook.rst:2984 msgid "" "To illustrate how you can send log messages via email, so that a set number " "of messages are sent per email, you can subclass :class:`~logging.handlers." @@ -1643,7 +1643,7 @@ msgid "" "argument to see the required and optional arguments.)" msgstr "" -#: ../../howto/logging-cookbook.rst:3052 +#: ../../howto/logging-cookbook.rst:3056 msgid "" "If you run this script and your SMTP server is correctly set up, you should " "find that it sends eleven emails to the addressee you specify. The first ten " @@ -1651,17 +1651,17 @@ msgid "" "messages. That makes up 102 messages as specified in the script." msgstr "" -#: ../../howto/logging-cookbook.rst:3060 +#: ../../howto/logging-cookbook.rst:3064 msgid "Formatting times using UTC (GMT) via configuration" msgstr "" -#: ../../howto/logging-cookbook.rst:3062 +#: ../../howto/logging-cookbook.rst:3066 msgid "" "Sometimes you want to format times using UTC, which can be done using a " "class such as ``UTCFormatter``, shown below::" msgstr "" -#: ../../howto/logging-cookbook.rst:3071 +#: ../../howto/logging-cookbook.rst:3075 msgid "" "and you can then use the ``UTCFormatter`` in your code instead of :class:" "`~logging.Formatter`. If you want to do that via configuration, you can use " @@ -1669,21 +1669,21 @@ msgid "" "the following complete example::" msgstr "" -#: ../../howto/logging-cookbook.rst:3114 +#: ../../howto/logging-cookbook.rst:3118 msgid "When this script is run, it should print something like:" msgstr "" -#: ../../howto/logging-cookbook.rst:3121 +#: ../../howto/logging-cookbook.rst:3125 msgid "" "showing how the time is formatted both as local time and UTC, one for each " "handler." msgstr "" -#: ../../howto/logging-cookbook.rst:3128 +#: ../../howto/logging-cookbook.rst:3132 msgid "Using a context manager for selective logging" msgstr "" -#: ../../howto/logging-cookbook.rst:3130 +#: ../../howto/logging-cookbook.rst:3134 msgid "" "There are times when it would be useful to temporarily change the logging " "configuration and revert it back after doing something. For this, a context " @@ -1693,7 +1693,7 @@ msgid "" "scope of the context manager::" msgstr "" -#: ../../howto/logging-cookbook.rst:3163 +#: ../../howto/logging-cookbook.rst:3167 msgid "" "If you specify a level value, the logger's level is set to that value in the " "scope of the with block covered by the context manager. If you specify a " @@ -1702,13 +1702,13 @@ msgid "" "block exit - you could do this if you don't need the handler any more." msgstr "" -#: ../../howto/logging-cookbook.rst:3169 +#: ../../howto/logging-cookbook.rst:3173 msgid "" "To illustrate how it works, we can add the following block of code to the " "above::" msgstr "" -#: ../../howto/logging-cookbook.rst:3187 +#: ../../howto/logging-cookbook.rst:3191 msgid "" "We initially set the logger's level to ``INFO``, so message #1 appears and " "message #2 doesn't. We then change the level to ``DEBUG`` temporarily in the " @@ -1721,56 +1721,56 @@ msgid "" "(like message #1) whereas message #7 doesn't (just like message #2)." msgstr "" -#: ../../howto/logging-cookbook.rst:3197 +#: ../../howto/logging-cookbook.rst:3201 msgid "If we run the resulting script, the result is as follows:" msgstr "" -#: ../../howto/logging-cookbook.rst:3208 +#: ../../howto/logging-cookbook.rst:3212 msgid "" "If we run it again, but pipe ``stderr`` to ``/dev/null``, we see the " "following, which is the only message written to ``stdout``:" msgstr "" -#: ../../howto/logging-cookbook.rst:3216 +#: ../../howto/logging-cookbook.rst:3220 msgid "Once again, but piping ``stdout`` to ``/dev/null``, we get:" msgstr "" -#: ../../howto/logging-cookbook.rst:3226 +#: ../../howto/logging-cookbook.rst:3230 msgid "" "In this case, the message #5 printed to ``stdout`` doesn't appear, as " "expected." msgstr "" -#: ../../howto/logging-cookbook.rst:3228 +#: ../../howto/logging-cookbook.rst:3232 msgid "" "Of course, the approach described here can be generalised, for example to " "attach logging filters temporarily. Note that the above code works in Python " "2 as well as Python 3." msgstr "" -#: ../../howto/logging-cookbook.rst:3236 +#: ../../howto/logging-cookbook.rst:3240 msgid "A CLI application starter template" msgstr "" -#: ../../howto/logging-cookbook.rst:3238 +#: ../../howto/logging-cookbook.rst:3242 msgid "Here's an example which shows how you can:" msgstr "" -#: ../../howto/logging-cookbook.rst:3240 +#: ../../howto/logging-cookbook.rst:3244 msgid "Use a logging level based on command-line arguments" msgstr "" -#: ../../howto/logging-cookbook.rst:3241 +#: ../../howto/logging-cookbook.rst:3245 msgid "" "Dispatch to multiple subcommands in separate files, all logging at the same " "level in a consistent way" msgstr "" -#: ../../howto/logging-cookbook.rst:3243 +#: ../../howto/logging-cookbook.rst:3247 msgid "Make use of simple, minimal configuration" msgstr "" -#: ../../howto/logging-cookbook.rst:3245 +#: ../../howto/logging-cookbook.rst:3249 msgid "" "Suppose we have a command-line application whose job is to stop, start or " "restart some services. This could be organised for the purposes of " @@ -1781,53 +1781,53 @@ msgid "" "``logging.INFO``. Here's one way that ``app.py`` could be written::" msgstr "" -#: ../../howto/logging-cookbook.rst:3294 +#: ../../howto/logging-cookbook.rst:3298 msgid "" "And the ``start``, ``stop`` and ``restart`` commands can be implemented in " "separate modules, like so for starting::" msgstr "" -#: ../../howto/logging-cookbook.rst:3307 +#: ../../howto/logging-cookbook.rst:3311 msgid "and thus for stopping::" msgstr "" -#: ../../howto/logging-cookbook.rst:3328 +#: ../../howto/logging-cookbook.rst:3332 msgid "and similarly for restarting::" msgstr "" -#: ../../howto/logging-cookbook.rst:3349 +#: ../../howto/logging-cookbook.rst:3353 msgid "" "If we run this application with the default log level, we get output like " "this:" msgstr "" -#: ../../howto/logging-cookbook.rst:3362 +#: ../../howto/logging-cookbook.rst:3366 msgid "" "The first word is the logging level, and the second word is the module or " "package name of the place where the event was logged." msgstr "" -#: ../../howto/logging-cookbook.rst:3365 +#: ../../howto/logging-cookbook.rst:3369 msgid "" "If we change the logging level, then we can change the information sent to " "the log. For example, if we want more information:" msgstr "" -#: ../../howto/logging-cookbook.rst:3382 +#: ../../howto/logging-cookbook.rst:3386 msgid "And if we want less:" msgstr "" -#: ../../howto/logging-cookbook.rst:3390 +#: ../../howto/logging-cookbook.rst:3394 msgid "" "In this case, the commands don't print anything to the console, since " "nothing at ``WARNING`` level or above is logged by them." msgstr "" -#: ../../howto/logging-cookbook.rst:3396 +#: ../../howto/logging-cookbook.rst:3400 msgid "A Qt GUI for logging" msgstr "" -#: ../../howto/logging-cookbook.rst:3398 +#: ../../howto/logging-cookbook.rst:3402 msgid "" "A question that comes up from time to time is about how to log to a GUI " "application. The `Qt `_ framework is a popular cross-" @@ -1835,7 +1835,7 @@ msgid "" "project/PySide2/>`_ or `PyQt5 `_ libraries." msgstr "" -#: ../../howto/logging-cookbook.rst:3404 +#: ../../howto/logging-cookbook.rst:3408 msgid "" "The following example shows how to log to a Qt GUI. This introduces a simple " "``QtHandler`` class which takes a callable, which should be a slot in the " @@ -1845,14 +1845,14 @@ msgid "" "logging messages at random levels with random short delays in between)." msgstr "" -#: ../../howto/logging-cookbook.rst:3411 +#: ../../howto/logging-cookbook.rst:3415 msgid "" "The worker thread is implemented using Qt's ``QThread`` class rather than " "the :mod:`threading` module, as there are circumstances where one has to use " "``QThread``, which offers better integration with other ``Qt`` components." msgstr "" -#: ../../howto/logging-cookbook.rst:3415 +#: ../../howto/logging-cookbook.rst:3419 msgid "" "The code should work with recent releases of either ``PySide2`` or " "``PyQt5``. You should be able to adapt the approach to earlier versions of " @@ -1860,11 +1860,11 @@ msgid "" "information." msgstr "" -#: ../../howto/logging-cookbook.rst:3629 +#: ../../howto/logging-cookbook.rst:3633 msgid "Logging to syslog with RFC5424 support" msgstr "" -#: ../../howto/logging-cookbook.rst:3631 +#: ../../howto/logging-cookbook.rst:3635 msgid "" "Although :rfc:`5424` dates from 2009, most syslog servers are configured by " "detault to use the older :rfc:`3164`, which hails from 2001. When " @@ -1874,14 +1874,14 @@ msgid "" "handlers.SysLogHandler` functionality has not been updated." msgstr "" -#: ../../howto/logging-cookbook.rst:3638 +#: ../../howto/logging-cookbook.rst:3642 msgid "" "RFC 5424 contains some useful features such as support for structured data, " "and if you need to be able to log to a syslog server with support for it, " "you can do so with a subclassed handler which looks something like this::" msgstr "" -#: ../../howto/logging-cookbook.rst:3704 +#: ../../howto/logging-cookbook.rst:3708 msgid "" "You'll need to be familiar with RFC 5424 to fully understand the above code, " "and it may be that you have slightly different needs (e.g. for how you pass " @@ -1890,11 +1890,11 @@ msgid "" "using something like this::" msgstr "" -#: ../../howto/logging-cookbook.rst:3718 +#: ../../howto/logging-cookbook.rst:3722 msgid "How to treat a logger like an output stream" msgstr "" -#: ../../howto/logging-cookbook.rst:3720 +#: ../../howto/logging-cookbook.rst:3724 msgid "" "Sometimes, you need to interface to a third-party API which expects a file-" "like object to write to, but you want to direct the API's output to a " @@ -1902,17 +1902,17 @@ msgid "" "API. Here's a short script illustrating such a class:" msgstr "" -#: ../../howto/logging-cookbook.rst:3760 +#: ../../howto/logging-cookbook.rst:3764 msgid "When this script is run, it prints" msgstr "" -#: ../../howto/logging-cookbook.rst:3767 +#: ../../howto/logging-cookbook.rst:3771 msgid "" "You could also use ``LoggerWriter`` to redirect ``sys.stdout`` and ``sys." "stderr`` by doing something like this:" msgstr "" -#: ../../howto/logging-cookbook.rst:3777 +#: ../../howto/logging-cookbook.rst:3781 msgid "" "You should do this *after* configuring logging for your needs. In the above " "example, the :func:`~logging.basicConfig` call does this (using the ``sys." @@ -1920,25 +1920,25 @@ msgid "" "Then, you'd get this kind of result:" msgstr "" -#: ../../howto/logging-cookbook.rst:3790 +#: ../../howto/logging-cookbook.rst:3794 msgid "" "Of course, the examples above show output according to the format used by :" "func:`~logging.basicConfig`, but you can use a different formatter when you " "configure logging." msgstr "" -#: ../../howto/logging-cookbook.rst:3794 +#: ../../howto/logging-cookbook.rst:3798 msgid "" "Note that with the above scheme, you are somewhat at the mercy of buffering " "and the sequence of write calls which you are intercepting. For example, " "with the definition of ``LoggerWriter`` above, if you have the snippet" msgstr "" -#: ../../howto/logging-cookbook.rst:3803 +#: ../../howto/logging-cookbook.rst:3807 msgid "then running the script results in" msgstr "" -#: ../../howto/logging-cookbook.rst:3821 +#: ../../howto/logging-cookbook.rst:3825 msgid "" "As you can see, this output isn't ideal. That's because the underlying code " "which writes to ``sys.stderr`` makes mutiple writes, each of which results " @@ -1948,17 +1948,17 @@ msgid "" "``LoggerWriter``:" msgstr "" -#: ../../howto/logging-cookbook.rst:3846 +#: ../../howto/logging-cookbook.rst:3850 msgid "" "This just buffers up stuff until a newline is seen, and then logs complete " "lines. With this approach, you get better output:" msgstr "" -#: ../../howto/logging-cookbook.rst:3862 +#: ../../howto/logging-cookbook.rst:3866 msgid "Patterns to avoid" msgstr "" -#: ../../howto/logging-cookbook.rst:3864 +#: ../../howto/logging-cookbook.rst:3868 msgid "" "Although the preceding sections have described ways of doing things you " "might need to do or deal with, it is worth mentioning some usage patterns " @@ -1966,11 +1966,11 @@ msgid "" "The following sections are in no particular order." msgstr "" -#: ../../howto/logging-cookbook.rst:3870 +#: ../../howto/logging-cookbook.rst:3874 msgid "Opening the same log file multiple times" msgstr "" -#: ../../howto/logging-cookbook.rst:3872 +#: ../../howto/logging-cookbook.rst:3876 msgid "" "On Windows, you will generally not be able to open the same file multiple " "times as this will lead to a \"file is in use by another process\" error. " @@ -1978,32 +1978,32 @@ msgid "" "file multiple times. This could be done accidentally, for example by:" msgstr "" -#: ../../howto/logging-cookbook.rst:3877 +#: ../../howto/logging-cookbook.rst:3881 msgid "" "Adding a file handler more than once which references the same file (e.g. by " "a copy/paste/forget-to-change error)." msgstr "" -#: ../../howto/logging-cookbook.rst:3880 +#: ../../howto/logging-cookbook.rst:3884 msgid "" "Opening two files that look different, as they have different names, but are " "the same because one is a symbolic link to the other." msgstr "" -#: ../../howto/logging-cookbook.rst:3883 +#: ../../howto/logging-cookbook.rst:3887 msgid "" "Forking a process, following which both parent and child have a reference to " "the same file. This might be through use of the :mod:`multiprocessing` " "module, for example." msgstr "" -#: ../../howto/logging-cookbook.rst:3887 +#: ../../howto/logging-cookbook.rst:3891 msgid "" "Opening a file multiple times might *appear* to work most of the time, but " "can lead to a number of problems in practice:" msgstr "" -#: ../../howto/logging-cookbook.rst:3890 +#: ../../howto/logging-cookbook.rst:3894 msgid "" "Logging output can be garbled because multiple threads or processes try to " "write to the same file. Although logging guards against concurrent use of " @@ -2012,7 +2012,7 @@ msgid "" "different handler instances which happen to point to the same file." msgstr "" -#: ../../howto/logging-cookbook.rst:3896 +#: ../../howto/logging-cookbook.rst:3900 msgid "" "An attempt to delete a file (e.g. during file rotation) silently fails, " "because there is another reference pointing to it. This can lead to " @@ -2022,17 +2022,17 @@ msgid "" "being supposedly in place." msgstr "" -#: ../../howto/logging-cookbook.rst:3903 +#: ../../howto/logging-cookbook.rst:3907 msgid "" "Use the techniques outlined in :ref:`multiple-processes` to circumvent such " "issues." msgstr "" -#: ../../howto/logging-cookbook.rst:3907 +#: ../../howto/logging-cookbook.rst:3911 msgid "Using loggers as attributes in a class or passing them as parameters" msgstr "" -#: ../../howto/logging-cookbook.rst:3909 +#: ../../howto/logging-cookbook.rst:3913 msgid "" "While there might be unusual cases where you'll need to do this, in general " "there is no point because loggers are singletons. Code can always access a " @@ -2043,12 +2043,12 @@ msgid "" "module (and not the class) is the unit of software decomposition." msgstr "" -#: ../../howto/logging-cookbook.rst:3918 +#: ../../howto/logging-cookbook.rst:3922 msgid "" "Adding handlers other than :class:`NullHandler` to a logger in a library" msgstr "" -#: ../../howto/logging-cookbook.rst:3920 +#: ../../howto/logging-cookbook.rst:3924 msgid "" "Configuring logging by adding handlers, formatters and filters is the " "responsibility of the application developer, not the library developer. If " @@ -2056,11 +2056,11 @@ msgid "" "your loggers other than a :class:`~logging.NullHandler` instance." msgstr "" -#: ../../howto/logging-cookbook.rst:3926 +#: ../../howto/logging-cookbook.rst:3930 msgid "Creating a lot of loggers" msgstr "" -#: ../../howto/logging-cookbook.rst:3928 +#: ../../howto/logging-cookbook.rst:3932 msgid "" "Loggers are singletons that are never freed during a script execution, and " "so creating lots of loggers will use up memory which can't then be freed. " @@ -2071,14 +2071,14 @@ msgid "" "occasionally slightly more fine-grained than that)." msgstr "" -#: ../../howto/logging-cookbook.rst:3939 +#: ../../howto/logging-cookbook.rst:3943 msgid "Other resources" msgstr "" -#: ../../howto/logging-cookbook.rst:3952 +#: ../../howto/logging-cookbook.rst:3956 msgid ":ref:`Basic Tutorial `" msgstr "" -#: ../../howto/logging-cookbook.rst:3954 +#: ../../howto/logging-cookbook.rst:3958 msgid ":ref:`Advanced Tutorial `" msgstr "" diff --git a/library/asyncio-task.po b/library/asyncio-task.po index 7151fa9e38..a479da1f01 100644 --- a/library/asyncio-task.po +++ b/library/asyncio-task.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-03-15 00:17+0000\n" +"POT-Creation-Date: 2023-03-26 00:17+0000\n" "PO-Revision-Date: 2018-05-23 14:39+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -241,7 +241,7 @@ msgid "" "tasks, gather them in a collection::" msgstr "" -#: ../../library/asyncio-task.rst:286 ../../library/asyncio-task.rst:1006 +#: ../../library/asyncio-task.rst:286 ../../library/asyncio-task.rst:1011 msgid "Added the *name* parameter." msgstr "新增 *name* 參數。" @@ -263,53 +263,56 @@ msgstr "" msgid "" "It is recommended that coroutines use ``try/finally`` blocks to robustly " "perform clean-up logic. In case :exc:`asyncio.CancelledError` is explicitly " -"caught, it should generally be propagated when clean-up is complete. Most " -"code can safely ignore :exc:`asyncio.CancelledError`." +"caught, it should generally be propagated when clean-up is complete. :exc:" +"`asyncio.CancelledError` directly subclasses :exc:`BaseException` so most " +"code will not need to be aware of it." msgstr "" -#: ../../library/asyncio-task.rst:305 +#: ../../library/asyncio-task.rst:306 msgid "" "The asyncio components that enable structured concurrency, like :class:" "`asyncio.TaskGroup` and :func:`asyncio.timeout`, are implemented using " "cancellation internally and might misbehave if a coroutine swallows :exc:" -"`asyncio.CancelledError`. Similarly, user code should not call :meth:" -"`uncancel `." +"`asyncio.CancelledError`. Similarly, user code should not generally call :" +"meth:`uncancel `. However, in cases when suppressing :" +"exc:`asyncio.CancelledError` is truly desired, it is necessary to also call " +"``uncancel()`` to completely remove the cancellation state." msgstr "" -#: ../../library/asyncio-task.rst:314 +#: ../../library/asyncio-task.rst:318 msgid "Task Groups" msgstr "" -#: ../../library/asyncio-task.rst:316 +#: ../../library/asyncio-task.rst:320 msgid "" "Task groups combine a task creation API with a convenient and reliable way " "to wait for all tasks in the group to finish." msgstr "" -#: ../../library/asyncio-task.rst:321 +#: ../../library/asyncio-task.rst:325 msgid "" "An :ref:`asynchronous context manager ` holding a " "group of tasks. Tasks can be added to the group using :meth:`create_task`. " "All tasks are awaited when the context manager exits." msgstr "" -#: ../../library/asyncio-task.rst:330 +#: ../../library/asyncio-task.rst:334 msgid "" "Create a task in this task group. The signature matches that of :func:" "`asyncio.create_task`." msgstr "" -#: ../../library/asyncio-task.rst:333 ../../library/asyncio-task.rst:463 -#: ../../library/asyncio-task.rst:591 ../../library/asyncio-task.rst:655 -#: ../../library/asyncio-task.rst:681 ../../library/asyncio-task.rst:724 -#: ../../library/asyncio-task.rst:817 +#: ../../library/asyncio-task.rst:337 ../../library/asyncio-task.rst:467 +#: ../../library/asyncio-task.rst:595 ../../library/asyncio-task.rst:653 +#: ../../library/asyncio-task.rst:679 ../../library/asyncio-task.rst:722 +#: ../../library/asyncio-task.rst:815 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/asyncio-task.rst:341 +#: ../../library/asyncio-task.rst:345 msgid "" "The ``async with`` statement will wait for all tasks in the group to finish. " "While waiting, new tasks may still be added to the group (for example, by " @@ -318,7 +321,7 @@ msgid "" "block is exited, no new tasks may be added to the group." msgstr "" -#: ../../library/asyncio-task.rst:348 +#: ../../library/asyncio-task.rst:352 msgid "" "The first time any of the tasks belonging to the group fails with an " "exception other than :exc:`asyncio.CancelledError`, the remaining tasks in " @@ -330,7 +333,7 @@ msgid "" "bubble out of the containing ``async with`` statement." msgstr "" -#: ../../library/asyncio-task.rst:358 +#: ../../library/asyncio-task.rst:362 msgid "" "Once all tasks have finished, if any tasks have failed with an exception " "other than :exc:`asyncio.CancelledError`, those exceptions are combined in " @@ -338,7 +341,7 @@ msgid "" "their documentation) which is then raised." msgstr "" -#: ../../library/asyncio-task.rst:365 +#: ../../library/asyncio-task.rst:369 msgid "" "Two base exceptions are treated specially: If any task fails with :exc:" "`KeyboardInterrupt` or :exc:`SystemExit`, the task group still cancels the " @@ -347,7 +350,7 @@ msgid "" "`ExceptionGroup` or :exc:`BaseExceptionGroup`." msgstr "" -#: ../../library/asyncio-task.rst:371 +#: ../../library/asyncio-task.rst:375 msgid "" "If the body of the ``async with`` statement exits with an exception (so :" "meth:`~object.__aexit__` is called with an exception set), this is treated " @@ -359,68 +362,68 @@ msgid "" "`KeyboardInterrupt` and :exc:`SystemExit` as in the previous paragraph." msgstr "" -#: ../../library/asyncio-task.rst:385 +#: ../../library/asyncio-task.rst:389 msgid "Sleeping" msgstr "" -#: ../../library/asyncio-task.rst:389 +#: ../../library/asyncio-task.rst:393 msgid "Block for *delay* seconds." msgstr "" -#: ../../library/asyncio-task.rst:391 +#: ../../library/asyncio-task.rst:395 msgid "" "If *result* is provided, it is returned to the caller when the coroutine " "completes." msgstr "" -#: ../../library/asyncio-task.rst:394 +#: ../../library/asyncio-task.rst:398 msgid "" "``sleep()`` always suspends the current task, allowing other tasks to run." msgstr "" -#: ../../library/asyncio-task.rst:397 +#: ../../library/asyncio-task.rst:401 msgid "" "Setting the delay to 0 provides an optimized path to allow other tasks to " "run. This can be used by long-running functions to avoid blocking the event " "loop for the full duration of the function call." msgstr "" -#: ../../library/asyncio-task.rst:403 +#: ../../library/asyncio-task.rst:407 msgid "" "Example of coroutine displaying the current date every second for 5 seconds::" msgstr "" -#: ../../library/asyncio-task.rst:421 ../../library/asyncio-task.rst:512 -#: ../../library/asyncio-task.rst:566 ../../library/asyncio-task.rst:719 -#: ../../library/asyncio-task.rst:749 ../../library/asyncio-task.rst:801 -#: ../../library/asyncio-task.rst:823 +#: ../../library/asyncio-task.rst:425 ../../library/asyncio-task.rst:516 +#: ../../library/asyncio-task.rst:570 ../../library/asyncio-task.rst:717 +#: ../../library/asyncio-task.rst:747 ../../library/asyncio-task.rst:799 +#: ../../library/asyncio-task.rst:821 msgid "Removed the *loop* parameter." msgstr "移除 *loop* 參數。" -#: ../../library/asyncio-task.rst:426 +#: ../../library/asyncio-task.rst:430 msgid "Running Tasks Concurrently" msgstr "" -#: ../../library/asyncio-task.rst:430 +#: ../../library/asyncio-task.rst:434 msgid "" "Run :ref:`awaitable objects ` in the *aws* sequence " "*concurrently*." msgstr "" -#: ../../library/asyncio-task.rst:433 +#: ../../library/asyncio-task.rst:437 msgid "" "If any awaitable in *aws* is a coroutine, it is automatically scheduled as a " "Task." msgstr "" -#: ../../library/asyncio-task.rst:436 +#: ../../library/asyncio-task.rst:440 msgid "" "If all awaitables are completed successfully, the result is an aggregate " "list of returned values. The order of result values corresponds to the " "order of awaitables in *aws*." msgstr "" -#: ../../library/asyncio-task.rst:440 +#: ../../library/asyncio-task.rst:444 msgid "" "If *return_exceptions* is ``False`` (default), the first raised exception is " "immediately propagated to the task that awaits on ``gather()``. Other " @@ -428,19 +431,19 @@ msgid "" "run." msgstr "" -#: ../../library/asyncio-task.rst:445 +#: ../../library/asyncio-task.rst:449 msgid "" "If *return_exceptions* is ``True``, exceptions are treated the same as " "successful results, and aggregated in the result list." msgstr "" -#: ../../library/asyncio-task.rst:448 +#: ../../library/asyncio-task.rst:452 msgid "" "If ``gather()`` is *cancelled*, all submitted awaitables (that have not " "completed yet) are also *cancelled*." msgstr "" -#: ../../library/asyncio-task.rst:451 +#: ../../library/asyncio-task.rst:455 msgid "" "If any Task or Future from the *aws* sequence is *cancelled*, it is treated " "as if it raised :exc:`CancelledError` -- the ``gather()`` call is **not** " @@ -448,13 +451,13 @@ msgid "" "submitted Task/Future to cause other Tasks/Futures to be cancelled." msgstr "" -#: ../../library/asyncio-task.rst:458 +#: ../../library/asyncio-task.rst:462 msgid "" "A more modern way to create and run tasks concurrently and wait for their " "completion is :class:`asyncio.TaskGroup`." msgstr "" -#: ../../library/asyncio-task.rst:501 +#: ../../library/asyncio-task.rst:505 msgid "" "If *return_exceptions* is False, cancelling gather() after it has been " "marked done won't cancel any submitted awaitables. For instance, gather can " @@ -463,42 +466,42 @@ msgid "" "the awaitables) from gather won't cancel any other awaitables." msgstr "" -#: ../../library/asyncio-task.rst:508 +#: ../../library/asyncio-task.rst:512 msgid "" "If the *gather* itself is cancelled, the cancellation is propagated " "regardless of *return_exceptions*." msgstr "" -#: ../../library/asyncio-task.rst:515 +#: ../../library/asyncio-task.rst:519 msgid "" "Deprecation warning is emitted if no positional arguments are provided or " "not all positional arguments are Future-like objects and there is no running " "event loop." msgstr "" -#: ../../library/asyncio-task.rst:522 +#: ../../library/asyncio-task.rst:526 msgid "Shielding From Cancellation" msgstr "" -#: ../../library/asyncio-task.rst:526 +#: ../../library/asyncio-task.rst:530 msgid "" "Protect an :ref:`awaitable object ` from being :meth:" "`cancelled `." msgstr "" -#: ../../library/asyncio-task.rst:529 ../../library/asyncio-task.rst:701 +#: ../../library/asyncio-task.rst:533 ../../library/asyncio-task.rst:699 msgid "If *aw* is a coroutine it is automatically scheduled as a Task." msgstr "" -#: ../../library/asyncio-task.rst:531 +#: ../../library/asyncio-task.rst:535 msgid "The statement::" msgstr "" -#: ../../library/asyncio-task.rst:536 +#: ../../library/asyncio-task.rst:540 msgid "is equivalent to::" msgstr "" -#: ../../library/asyncio-task.rst:540 +#: ../../library/asyncio-task.rst:544 msgid "" "*except* that if the coroutine containing it is cancelled, the Task running " "in ``something()`` is not cancelled. From the point of view of " @@ -507,20 +510,20 @@ msgid "" "`CancelledError`." msgstr "" -#: ../../library/asyncio-task.rst:546 +#: ../../library/asyncio-task.rst:550 msgid "" "If ``something()`` is cancelled by other means (i.e. from within itself) " "that would also cancel ``shield()``." msgstr "" -#: ../../library/asyncio-task.rst:549 +#: ../../library/asyncio-task.rst:553 msgid "" "If it is desired to completely ignore cancellation (not recommended) the " "``shield()`` function should be combined with a try/except clause, as " "follows::" msgstr "" -#: ../../library/asyncio-task.rst:561 +#: ../../library/asyncio-task.rst:565 msgid "" "Save a reference to tasks passed to this function, to avoid a task " "disappearing mid-execution. The event loop only keeps weak references to " @@ -528,36 +531,36 @@ msgid "" "any time, even before it's done." msgstr "" -#: ../../library/asyncio-task.rst:569 +#: ../../library/asyncio-task.rst:573 msgid "" "Deprecation warning is emitted if *aw* is not Future-like object and there " "is no running event loop." msgstr "" -#: ../../library/asyncio-task.rst:575 +#: ../../library/asyncio-task.rst:579 msgid "Timeouts" msgstr "" -#: ../../library/asyncio-task.rst:579 +#: ../../library/asyncio-task.rst:583 msgid "" "An :ref:`asynchronous context manager ` that can be " "used to limit the amount of time spent waiting on something." msgstr "" -#: ../../library/asyncio-task.rst:583 +#: ../../library/asyncio-task.rst:587 msgid "" "*delay* can either be ``None``, or a float/int number of seconds to wait. If " "*delay* is ``None``, no time limit will be applied; this can be useful if " "the delay is unknown when the context manager is created." msgstr "" -#: ../../library/asyncio-task.rst:588 +#: ../../library/asyncio-task.rst:592 msgid "" "In either case, the context manager can be rescheduled after creation using :" "meth:`Timeout.reschedule`." msgstr "" -#: ../../library/asyncio-task.rst:597 +#: ../../library/asyncio-task.rst:601 msgid "" "If ``long_running_task`` takes more than 10 seconds to complete, the context " "manager will cancel the current task and handle the resulting :exc:`asyncio." @@ -565,7 +568,7 @@ msgid "" "TimeoutError` which can be caught and handled." msgstr "" -#: ../../library/asyncio-task.rst:604 +#: ../../library/asyncio-task.rst:608 msgid "" "The :func:`asyncio.timeout` context manager is what transforms the :exc:" "`asyncio.CancelledError` into an :exc:`asyncio.TimeoutError`, which means " @@ -573,198 +576,192 @@ msgid "" "manager." msgstr "" -#: ../../library/asyncio-task.rst:609 +#: ../../library/asyncio-task.rst:613 msgid "Example of catching :exc:`asyncio.TimeoutError`::" msgstr "" -#: ../../library/asyncio-task.rst:620 +#: ../../library/asyncio-task.rst:624 msgid "" "The context manager produced by :func:`asyncio.timeout` can be rescheduled " "to a different deadline and inspected." msgstr "" -#: ../../library/asyncio-task.rst:625 +#: ../../library/asyncio-task.rst:629 msgid "" -"An :ref:`asynchronous context manager ` that limits " -"time spent inside of it." +"An :ref:`asynchronous context manager ` for " +"cancelling overdue coroutines." msgstr "" #: ../../library/asyncio-task.rst:632 msgid "" -"Return the current deadline, or ``None`` if the current deadline is not set." +"``when`` should be an absolute time at which the context should time out, as " +"measured by the event loop's clock:" msgstr "" #: ../../library/asyncio-task.rst:635 -msgid "" -"The deadline is a float, consistent with the time returned by :meth:`loop." -"time`." -msgstr "" - -#: ../../library/asyncio-task.rst:640 -msgid "Change the time the timeout will trigger." +msgid "If ``when`` is ``None``, the timeout will never trigger." msgstr "" -#: ../../library/asyncio-task.rst:642 +#: ../../library/asyncio-task.rst:636 msgid "" -"If *when* is ``None``, any current deadline will be removed, and the context " -"manager will wait indefinitely." +"If ``when < loop.time()``, the timeout will trigger on the next iteration of " +"the event loop." msgstr "" -#: ../../library/asyncio-task.rst:645 -msgid "If *when* is a float, it is set as the new deadline." +#: ../../library/asyncio-task.rst:641 +msgid "" +"Return the current deadline, or ``None`` if the current deadline is not set." msgstr "" -#: ../../library/asyncio-task.rst:647 -msgid "" -"if *when* is in the past, the timeout will trigger on the next iteration of " -"the event loop." +#: ../../library/asyncio-task.rst:646 +msgid "Reschedule the timeout." msgstr "" -#: ../../library/asyncio-task.rst:652 +#: ../../library/asyncio-task.rst:650 msgid "Return whether the context manager has exceeded its deadline (expired)." msgstr "" -#: ../../library/asyncio-task.rst:672 +#: ../../library/asyncio-task.rst:670 msgid "Timeout context managers can be safely nested." msgstr "" -#: ../../library/asyncio-task.rst:678 +#: ../../library/asyncio-task.rst:676 msgid "" "Similar to :func:`asyncio.timeout`, except *when* is the absolute time to " "stop waiting, or ``None``." msgstr "" -#: ../../library/asyncio-task.rst:698 +#: ../../library/asyncio-task.rst:696 msgid "" "Wait for the *aw* :ref:`awaitable ` to complete with a " "timeout." msgstr "" -#: ../../library/asyncio-task.rst:703 +#: ../../library/asyncio-task.rst:701 msgid "" "*timeout* can either be ``None`` or a float or int number of seconds to wait " "for. If *timeout* is ``None``, block until the future completes." msgstr "" -#: ../../library/asyncio-task.rst:707 +#: ../../library/asyncio-task.rst:705 msgid "" "If a timeout occurs, it cancels the task and raises :exc:`TimeoutError`." msgstr "" -#: ../../library/asyncio-task.rst:710 +#: ../../library/asyncio-task.rst:708 msgid "" "To avoid the task :meth:`cancellation `, wrap it in :func:" "`shield`." msgstr "" -#: ../../library/asyncio-task.rst:713 +#: ../../library/asyncio-task.rst:711 msgid "" "The function will wait until the future is actually cancelled, so the total " "wait time may exceed the *timeout*. If an exception happens during " "cancellation, it is propagated." msgstr "" -#: ../../library/asyncio-task.rst:717 +#: ../../library/asyncio-task.rst:715 msgid "If the wait is cancelled, the future *aw* is also cancelled." msgstr "" -#: ../../library/asyncio-task.rst:744 +#: ../../library/asyncio-task.rst:742 msgid "" "When *aw* is cancelled due to a timeout, ``wait_for`` waits for *aw* to be " "cancelled. Previously, it raised :exc:`TimeoutError` immediately." msgstr "" -#: ../../library/asyncio-task.rst:754 +#: ../../library/asyncio-task.rst:752 msgid "Waiting Primitives" msgstr "" -#: ../../library/asyncio-task.rst:758 +#: ../../library/asyncio-task.rst:756 msgid "" "Run :class:`~asyncio.Future` and :class:`~asyncio.Task` instances in the " "*aws* iterable concurrently and block until the condition specified by " "*return_when*." msgstr "" -#: ../../library/asyncio-task.rst:762 +#: ../../library/asyncio-task.rst:760 msgid "The *aws* iterable must not be empty." msgstr "" -#: ../../library/asyncio-task.rst:764 +#: ../../library/asyncio-task.rst:762 msgid "Returns two sets of Tasks/Futures: ``(done, pending)``." msgstr "" -#: ../../library/asyncio-task.rst:766 +#: ../../library/asyncio-task.rst:764 msgid "Usage::" msgstr "" "用法:\n" "\n" "::" -#: ../../library/asyncio-task.rst:770 +#: ../../library/asyncio-task.rst:768 msgid "" "*timeout* (a float or int), if specified, can be used to control the maximum " "number of seconds to wait before returning." msgstr "" -#: ../../library/asyncio-task.rst:773 +#: ../../library/asyncio-task.rst:771 msgid "" "Note that this function does not raise :exc:`TimeoutError`. Futures or Tasks " "that aren't done when the timeout occurs are simply returned in the second " "set." msgstr "" -#: ../../library/asyncio-task.rst:777 +#: ../../library/asyncio-task.rst:775 msgid "" "*return_when* indicates when this function should return. It must be one of " "the following constants:" msgstr "" -#: ../../library/asyncio-task.rst:783 +#: ../../library/asyncio-task.rst:781 msgid "Constant" msgstr "常數" -#: ../../library/asyncio-task.rst:783 +#: ../../library/asyncio-task.rst:781 msgid "Description" msgstr "描述" -#: ../../library/asyncio-task.rst:785 +#: ../../library/asyncio-task.rst:783 msgid ":const:`FIRST_COMPLETED`" msgstr ":const:`FIRST_COMPLETED`" -#: ../../library/asyncio-task.rst:785 +#: ../../library/asyncio-task.rst:783 msgid "The function will return when any future finishes or is cancelled." msgstr "" -#: ../../library/asyncio-task.rst:788 +#: ../../library/asyncio-task.rst:786 msgid ":const:`FIRST_EXCEPTION`" msgstr ":const:`FIRST_EXCEPTION`" -#: ../../library/asyncio-task.rst:788 +#: ../../library/asyncio-task.rst:786 msgid "" "The function will return when any future finishes by raising an exception. " "If no future raises an exception then it is equivalent to :const:" "`ALL_COMPLETED`." msgstr "" -#: ../../library/asyncio-task.rst:794 +#: ../../library/asyncio-task.rst:792 msgid ":const:`ALL_COMPLETED`" msgstr ":const:`ALL_COMPLETED`" -#: ../../library/asyncio-task.rst:794 +#: ../../library/asyncio-task.rst:792 msgid "The function will return when all futures finish or are cancelled." msgstr "" -#: ../../library/asyncio-task.rst:798 +#: ../../library/asyncio-task.rst:796 msgid "" "Unlike :func:`~asyncio.wait_for`, ``wait()`` does not cancel the futures " "when a timeout occurs." msgstr "" -#: ../../library/asyncio-task.rst:804 +#: ../../library/asyncio-task.rst:802 msgid "Passing coroutine objects to ``wait()`` directly is forbidden." msgstr "" -#: ../../library/asyncio-task.rst:809 +#: ../../library/asyncio-task.rst:807 msgid "" "Run :ref:`awaitable objects ` in the *aws* iterable " "concurrently. Return an iterator of coroutines. Each coroutine returned can " @@ -772,26 +769,26 @@ msgid "" "remaining awaitables." msgstr "" -#: ../../library/asyncio-task.rst:814 +#: ../../library/asyncio-task.rst:812 msgid "" "Raises :exc:`TimeoutError` if the timeout occurs before all Futures are done." msgstr "" -#: ../../library/asyncio-task.rst:826 +#: ../../library/asyncio-task.rst:824 msgid "" "Deprecation warning is emitted if not all awaitable objects in the *aws* " "iterable are Future-like objects and there is no running event loop." msgstr "" -#: ../../library/asyncio-task.rst:832 +#: ../../library/asyncio-task.rst:830 msgid "Running in Threads" msgstr "" -#: ../../library/asyncio-task.rst:836 +#: ../../library/asyncio-task.rst:834 msgid "Asynchronously run function *func* in a separate thread." msgstr "" -#: ../../library/asyncio-task.rst:838 +#: ../../library/asyncio-task.rst:836 msgid "" "Any \\*args and \\*\\*kwargs supplied for this function are directly passed " "to *func*. Also, the current :class:`contextvars.Context` is propagated, " @@ -799,19 +796,19 @@ msgid "" "separate thread." msgstr "" -#: ../../library/asyncio-task.rst:843 +#: ../../library/asyncio-task.rst:841 msgid "" "Return a coroutine that can be awaited to get the eventual result of *func*." msgstr "" -#: ../../library/asyncio-task.rst:845 +#: ../../library/asyncio-task.rst:843 msgid "" "This coroutine function is primarily intended to be used for executing IO-" "bound functions/methods that would otherwise block the event loop if they " "were run in the main thread. For example::" msgstr "" -#: ../../library/asyncio-task.rst:875 +#: ../../library/asyncio-task.rst:873 msgid "" "Directly calling ``blocking_io()`` in any coroutine would block the event " "loop for its duration, resulting in an additional 1 second of run time. " @@ -819,7 +816,7 @@ msgid "" "thread without blocking the event loop." msgstr "" -#: ../../library/asyncio-task.rst:882 +#: ../../library/asyncio-task.rst:880 msgid "" "Due to the :term:`GIL`, ``asyncio.to_thread()`` can typically only be used " "to make IO-bound functions non-blocking. However, for extension modules that " @@ -827,81 +824,85 @@ msgid "" "``asyncio.to_thread()`` can also be used for CPU-bound functions." msgstr "" -#: ../../library/asyncio-task.rst:891 +#: ../../library/asyncio-task.rst:889 msgid "Scheduling From Other Threads" msgstr "" -#: ../../library/asyncio-task.rst:895 +#: ../../library/asyncio-task.rst:893 msgid "Submit a coroutine to the given event loop. Thread-safe." msgstr "" -#: ../../library/asyncio-task.rst:897 +#: ../../library/asyncio-task.rst:895 msgid "" "Return a :class:`concurrent.futures.Future` to wait for the result from " "another OS thread." msgstr "" -#: ../../library/asyncio-task.rst:900 +#: ../../library/asyncio-task.rst:898 msgid "" "This function is meant to be called from a different OS thread than the one " "where the event loop is running. Example::" msgstr "" -#: ../../library/asyncio-task.rst:912 +#: ../../library/asyncio-task.rst:910 msgid "" "If an exception is raised in the coroutine, the returned Future will be " "notified. It can also be used to cancel the task in the event loop::" msgstr "" -#: ../../library/asyncio-task.rst:926 +#: ../../library/asyncio-task.rst:924 msgid "" "See the :ref:`concurrency and multithreading ` " "section of the documentation." msgstr "" -#: ../../library/asyncio-task.rst:929 +#: ../../library/asyncio-task.rst:927 msgid "" "Unlike other asyncio functions this function requires the *loop* argument to " "be passed explicitly." msgstr "" -#: ../../library/asyncio-task.rst:936 +#: ../../library/asyncio-task.rst:934 msgid "Introspection" msgstr "" -#: ../../library/asyncio-task.rst:941 +#: ../../library/asyncio-task.rst:939 msgid "" "Return the currently running :class:`Task` instance, or ``None`` if no task " "is running." msgstr "" -#: ../../library/asyncio-task.rst:944 +#: ../../library/asyncio-task.rst:942 msgid "" "If *loop* is ``None`` :func:`get_running_loop` is used to get the current " "loop." msgstr "" -#: ../../library/asyncio-task.rst:952 +#: ../../library/asyncio-task.rst:950 msgid "Return a set of not yet finished :class:`Task` objects run by the loop." msgstr "" -#: ../../library/asyncio-task.rst:955 +#: ../../library/asyncio-task.rst:953 msgid "" "If *loop* is ``None``, :func:`get_running_loop` is used for getting current " "loop." msgstr "" -#: ../../library/asyncio-task.rst:962 +#: ../../library/asyncio-task.rst:961 +msgid "Return ``True`` if *obj* is a coroutine object." +msgstr "" + +#: ../../library/asyncio-task.rst:967 msgid "Task Object" msgstr "" -#: ../../library/asyncio-task.rst:966 +#: ../../library/asyncio-task.rst:971 msgid "" "A :class:`Future-like ` object that runs a Python :ref:`coroutine " "`. Not thread-safe." msgstr "" -#: ../../library/asyncio-task.rst:969 +#: ../../library/asyncio-task.rst:974 msgid "" "Tasks are used to run coroutines in event loops. If a coroutine awaits on a " "Future, the Task suspends the execution of the coroutine and waits for the " @@ -909,21 +910,21 @@ msgid "" "wrapped coroutine resumes." msgstr "" -#: ../../library/asyncio-task.rst:975 +#: ../../library/asyncio-task.rst:980 msgid "" "Event loops use cooperative scheduling: an event loop runs one Task at a " "time. While a Task awaits for the completion of a Future, the event loop " "runs other Tasks, callbacks, or performs IO operations." msgstr "" -#: ../../library/asyncio-task.rst:980 +#: ../../library/asyncio-task.rst:985 msgid "" "Use the high-level :func:`asyncio.create_task` function to create Tasks, or " "the low-level :meth:`loop.create_task` or :func:`ensure_future` functions. " "Manual instantiation of Tasks is discouraged." msgstr "" -#: ../../library/asyncio-task.rst:985 +#: ../../library/asyncio-task.rst:990 msgid "" "To cancel a running Task use the :meth:`cancel` method. Calling it will " "cause the Task to throw a :exc:`CancelledError` exception into the wrapped " @@ -931,112 +932,112 @@ msgid "" "cancellation, the Future object will be cancelled." msgstr "" -#: ../../library/asyncio-task.rst:990 +#: ../../library/asyncio-task.rst:995 msgid "" ":meth:`cancelled` can be used to check if the Task was cancelled. The method " "returns ``True`` if the wrapped coroutine did not suppress the :exc:" "`CancelledError` exception and was actually cancelled." msgstr "" -#: ../../library/asyncio-task.rst:995 +#: ../../library/asyncio-task.rst:1000 msgid "" ":class:`asyncio.Task` inherits from :class:`Future` all of its APIs except :" "meth:`Future.set_result` and :meth:`Future.set_exception`." msgstr "" -#: ../../library/asyncio-task.rst:999 +#: ../../library/asyncio-task.rst:1004 msgid "" "Tasks support the :mod:`contextvars` module. When a Task is created it " "copies the current context and later runs its coroutine in the copied " "context." msgstr "" -#: ../../library/asyncio-task.rst:1003 +#: ../../library/asyncio-task.rst:1008 msgid "Added support for the :mod:`contextvars` module." msgstr "" -#: ../../library/asyncio-task.rst:1009 +#: ../../library/asyncio-task.rst:1014 msgid "" "Deprecation warning is emitted if *loop* is not specified and there is no " "running event loop." msgstr "" -#: ../../library/asyncio-task.rst:1015 +#: ../../library/asyncio-task.rst:1020 msgid "Return ``True`` if the Task is *done*." msgstr "" -#: ../../library/asyncio-task.rst:1017 +#: ../../library/asyncio-task.rst:1022 msgid "" "A Task is *done* when the wrapped coroutine either returned a value, raised " "an exception, or the Task was cancelled." msgstr "" -#: ../../library/asyncio-task.rst:1022 +#: ../../library/asyncio-task.rst:1027 msgid "Return the result of the Task." msgstr "" -#: ../../library/asyncio-task.rst:1024 +#: ../../library/asyncio-task.rst:1029 msgid "" "If the Task is *done*, the result of the wrapped coroutine is returned (or " "if the coroutine raised an exception, that exception is re-raised.)" msgstr "" -#: ../../library/asyncio-task.rst:1028 ../../library/asyncio-task.rst:1042 +#: ../../library/asyncio-task.rst:1033 ../../library/asyncio-task.rst:1047 msgid "" "If the Task has been *cancelled*, this method raises a :exc:`CancelledError` " "exception." msgstr "" -#: ../../library/asyncio-task.rst:1031 +#: ../../library/asyncio-task.rst:1036 msgid "" "If the Task's result isn't yet available, this method raises a :exc:" "`InvalidStateError` exception." msgstr "" -#: ../../library/asyncio-task.rst:1036 +#: ../../library/asyncio-task.rst:1041 msgid "Return the exception of the Task." msgstr "" -#: ../../library/asyncio-task.rst:1038 +#: ../../library/asyncio-task.rst:1043 msgid "" "If the wrapped coroutine raised an exception that exception is returned. If " "the wrapped coroutine returned normally this method returns ``None``." msgstr "" -#: ../../library/asyncio-task.rst:1045 +#: ../../library/asyncio-task.rst:1050 msgid "" "If the Task isn't *done* yet, this method raises an :exc:`InvalidStateError` " "exception." msgstr "" -#: ../../library/asyncio-task.rst:1050 +#: ../../library/asyncio-task.rst:1055 msgid "Add a callback to be run when the Task is *done*." msgstr "" -#: ../../library/asyncio-task.rst:1052 ../../library/asyncio-task.rst:1061 +#: ../../library/asyncio-task.rst:1057 ../../library/asyncio-task.rst:1066 msgid "This method should only be used in low-level callback-based code." msgstr "" -#: ../../library/asyncio-task.rst:1054 +#: ../../library/asyncio-task.rst:1059 msgid "" "See the documentation of :meth:`Future.add_done_callback` for more details." msgstr "" -#: ../../library/asyncio-task.rst:1059 +#: ../../library/asyncio-task.rst:1064 msgid "Remove *callback* from the callbacks list." msgstr "" -#: ../../library/asyncio-task.rst:1063 +#: ../../library/asyncio-task.rst:1068 msgid "" "See the documentation of :meth:`Future.remove_done_callback` for more " "details." msgstr "" -#: ../../library/asyncio-task.rst:1068 +#: ../../library/asyncio-task.rst:1073 msgid "Return the list of stack frames for this Task." msgstr "" -#: ../../library/asyncio-task.rst:1070 +#: ../../library/asyncio-task.rst:1075 msgid "" "If the wrapped coroutine is not done, this returns the stack where it is " "suspended. If the coroutine has completed successfully or was cancelled, " @@ -1044,15 +1045,15 @@ msgid "" "this returns the list of traceback frames." msgstr "" -#: ../../library/asyncio-task.rst:1076 +#: ../../library/asyncio-task.rst:1081 msgid "The frames are always ordered from oldest to newest." msgstr "" -#: ../../library/asyncio-task.rst:1078 +#: ../../library/asyncio-task.rst:1083 msgid "Only one stack frame is returned for a suspended coroutine." msgstr "" -#: ../../library/asyncio-task.rst:1080 +#: ../../library/asyncio-task.rst:1085 msgid "" "The optional *limit* argument sets the maximum number of frames to return; " "by default all available frames are returned. The ordering of the returned " @@ -1061,115 +1062,117 @@ msgid "" "are returned. (This matches the behavior of the traceback module.)" msgstr "" -#: ../../library/asyncio-task.rst:1089 +#: ../../library/asyncio-task.rst:1094 msgid "Print the stack or traceback for this Task." msgstr "" -#: ../../library/asyncio-task.rst:1091 +#: ../../library/asyncio-task.rst:1096 msgid "" "This produces output similar to that of the traceback module for the frames " "retrieved by :meth:`get_stack`." msgstr "" -#: ../../library/asyncio-task.rst:1094 +#: ../../library/asyncio-task.rst:1099 msgid "The *limit* argument is passed to :meth:`get_stack` directly." msgstr "" -#: ../../library/asyncio-task.rst:1096 +#: ../../library/asyncio-task.rst:1101 msgid "" "The *file* argument is an I/O stream to which the output is written; by " "default output is written to :data:`sys.stdout`." msgstr "" -#: ../../library/asyncio-task.rst:1101 +#: ../../library/asyncio-task.rst:1106 msgid "Return the coroutine object wrapped by the :class:`Task`." msgstr "" -#: ../../library/asyncio-task.rst:1107 +#: ../../library/asyncio-task.rst:1112 msgid "Return the name of the Task." msgstr "" -#: ../../library/asyncio-task.rst:1109 +#: ../../library/asyncio-task.rst:1114 msgid "" "If no name has been explicitly assigned to the Task, the default asyncio " "Task implementation generates a default name during instantiation." msgstr "" -#: ../../library/asyncio-task.rst:1117 +#: ../../library/asyncio-task.rst:1122 msgid "Set the name of the Task." msgstr "" -#: ../../library/asyncio-task.rst:1119 +#: ../../library/asyncio-task.rst:1124 msgid "" "The *value* argument can be any object, which is then converted to a string." msgstr "" -#: ../../library/asyncio-task.rst:1122 +#: ../../library/asyncio-task.rst:1127 msgid "" "In the default Task implementation, the name will be visible in the :func:" "`repr` output of a task object." msgstr "" -#: ../../library/asyncio-task.rst:1129 +#: ../../library/asyncio-task.rst:1134 msgid "Request the Task to be cancelled." msgstr "" -#: ../../library/asyncio-task.rst:1131 +#: ../../library/asyncio-task.rst:1136 msgid "" "This arranges for a :exc:`CancelledError` exception to be thrown into the " "wrapped coroutine on the next cycle of the event loop." msgstr "" -#: ../../library/asyncio-task.rst:1134 +#: ../../library/asyncio-task.rst:1139 msgid "" "The coroutine then has a chance to clean up or even deny the request by " "suppressing the exception with a :keyword:`try` ... ... ``except " "CancelledError`` ... :keyword:`finally` block. Therefore, unlike :meth:" "`Future.cancel`, :meth:`Task.cancel` does not guarantee that the Task will " "be cancelled, although suppressing cancellation completely is not common and " -"is actively discouraged." +"is actively discouraged. Should the coroutine nevertheless decide to " +"suppress the cancellation, it needs to call :meth:`Task.uncancel` in " +"addition to catching the exception." msgstr "" -#: ../../library/asyncio-task.rst:1142 +#: ../../library/asyncio-task.rst:1149 msgid "Added the *msg* parameter." msgstr "新增 *msg* 參數。" -#: ../../library/asyncio-task.rst:1145 +#: ../../library/asyncio-task.rst:1152 msgid "The ``msg`` parameter is propagated from cancelled task to its awaiter." msgstr "" -#: ../../library/asyncio-task.rst:1150 +#: ../../library/asyncio-task.rst:1157 msgid "" "The following example illustrates how coroutines can intercept the " "cancellation request::" msgstr "" -#: ../../library/asyncio-task.rst:1189 +#: ../../library/asyncio-task.rst:1196 msgid "Return ``True`` if the Task is *cancelled*." msgstr "" -#: ../../library/asyncio-task.rst:1191 +#: ../../library/asyncio-task.rst:1198 msgid "" "The Task is *cancelled* when the cancellation was requested with :meth:" "`cancel` and the wrapped coroutine propagated the :exc:`CancelledError` " "exception thrown into it." msgstr "" -#: ../../library/asyncio-task.rst:1197 +#: ../../library/asyncio-task.rst:1204 msgid "Decrement the count of cancellation requests to this Task." msgstr "" -#: ../../library/asyncio-task.rst:1199 +#: ../../library/asyncio-task.rst:1206 msgid "Returns the remaining number of cancellation requests." msgstr "" -#: ../../library/asyncio-task.rst:1201 +#: ../../library/asyncio-task.rst:1208 msgid "" "Note that once execution of a cancelled task completed, further calls to :" "meth:`uncancel` are ineffective." msgstr "" -#: ../../library/asyncio-task.rst:1206 +#: ../../library/asyncio-task.rst:1213 msgid "" "This method is used by asyncio's internals and isn't expected to be used by " "end-user code. In particular, if a Task gets successfully uncancelled, this " @@ -1178,7 +1181,7 @@ msgid "" "respective structured block. For example::" msgstr "" -#: ../../library/asyncio-task.rst:1224 +#: ../../library/asyncio-task.rst:1231 msgid "" "While the block with ``make_request()`` and ``make_another_request()`` might " "get cancelled due to the timeout, ``unrelated_code()`` should continue " @@ -1187,13 +1190,20 @@ msgid "" "similar fashion." msgstr "" -#: ../../library/asyncio-task.rst:1232 +#: ../../library/asyncio-task.rst:1237 +msgid "" +"If end-user code is, for some reason, suppresing cancellation by catching :" +"exc:`CancelledError`, it needs to call this method to remove the " +"cancellation state." +msgstr "" + +#: ../../library/asyncio-task.rst:1243 msgid "" "Return the number of pending cancellation requests to this Task, i.e., the " "number of calls to :meth:`cancel` less the number of :meth:`uncancel` calls." msgstr "" -#: ../../library/asyncio-task.rst:1236 +#: ../../library/asyncio-task.rst:1247 msgid "" "Note that if this number is greater than zero but the Task is still " "executing, :meth:`cancelled` will still return ``False``. This is because " @@ -1202,7 +1212,7 @@ msgid "" "to zero." msgstr "" -#: ../../library/asyncio-task.rst:1242 +#: ../../library/asyncio-task.rst:1253 msgid "" "This method is used by asyncio's internals and isn't expected to be used by " "end-user code. See :meth:`uncancel` for more details." diff --git a/library/codeop.po b/library/codeop.po index bb6a0b0eab..8c5ab9c9a2 100644 --- a/library/codeop.po +++ b/library/codeop.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-06-20 18:08+0800\n" +"POT-Creation-Date: 2023-03-31 00:16+0000\n" "PO-Revision-Date: 2016-11-19 00:28+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -41,13 +41,13 @@ msgstr "" #: ../../library/codeop.rst:22 msgid "" -"Being able to tell if a line of input completes a Python statement: in " +"Being able to tell if a line of input completes a Python statement: in " "short, telling whether to print '``>>>``' or '``...``' next." msgstr "" #: ../../library/codeop.rst:25 msgid "" -"Remembering which future statements the user has entered, so subsequent " +"Remembering which future statements the user has entered, so subsequent " "input can be compiled with these in effect." msgstr "" @@ -64,9 +64,9 @@ msgstr "" #: ../../library/codeop.rst:35 msgid "" "Tries to compile *source*, which should be a string of Python code and " -"return a code object if *source* is valid Python code. In that case, the " +"return a code object if *source* is valid Python code. In that case, the " "filename attribute of the code object will be *filename*, which defaults to " -"``''``. Returns ``None`` if *source* is *not* valid Python code, but " +"``''``. Returns ``None`` if *source* is *not* valid Python code, but " "is a prefix of valid Python code." msgstr "" @@ -80,9 +80,9 @@ msgstr "" #: ../../library/codeop.rst:45 msgid "" "The *symbol* argument determines whether *source* is compiled as a statement " -"(``'single'``, the default), as a sequence of statements (``'exec'``) or as " -"an :term:`expression` (``'eval'``). Any other value will cause :exc:" -"`ValueError` to be raised." +"(``'single'``, the default), as a sequence of :term:`statement` (``'exec'``) " +"or as an :term:`expression` (``'eval'``). Any other value will cause :exc:" +"`ValueError` to be raised." msgstr "" #: ../../library/codeop.rst:52 @@ -107,6 +107,7 @@ msgstr "" msgid "" "Instances of this class have :meth:`__call__` methods identical in signature " "to :func:`compile_command`; the difference is that if the instance compiles " -"program text containing a ``__future__`` statement, the instance 'remembers' " -"and compiles all subsequent program texts with the statement in force." +"program text containing a :mod:`__future__` statement, the instance " +"'remembers' and compiles all subsequent program texts with the statement in " +"force." msgstr "" diff --git a/library/ctypes.po b/library/ctypes.po index 388e9d54b8..44a8088859 100644 --- a/library/ctypes.po +++ b/library/ctypes.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-10 17:25+0000\n" +"POT-Creation-Date: 2023-03-26 00:17+0000\n" "PO-Revision-Date: 2022-10-16 03:20+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -492,7 +492,7 @@ msgid "" msgstr "" #: ../../library/ctypes.rst:378 -msgid "Calling varadic functions" +msgid "Calling variadic functions" msgstr "" #: ../../library/ctypes.rst:380 diff --git a/library/enum.po b/library/enum.po index 8492f3343a..1aea8f69d6 100644 --- a/library/enum.po +++ b/library/enum.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-18 00:17+0000\n" +"POT-Creation-Date: 2023-04-04 00:15+0000\n" "PO-Revision-Date: 2018-05-23 16:01+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -255,23 +255,23 @@ msgstr ":func:`global_enum`" #: ../../library/enum.rst:143 msgid "" "Modify the :class:`str() ` and :func:`repr` of an enum to show its " -"members as belonging to the module instead of its class. Should only be used " -"if the enum members will be exported to the module global namespace." +"members as belonging to the module instead of its class, and export the enum " +"members to the global namespace." msgstr "" -#: ../../library/enum.rst:148 +#: ../../library/enum.rst:147 msgid ":func:`show_flag_values`" msgstr ":func:`show_flag_values`" -#: ../../library/enum.rst:150 +#: ../../library/enum.rst:149 msgid "Return a list of all power-of-two integers contained in a flag." msgstr "" -#: ../../library/enum.rst:153 +#: ../../library/enum.rst:152 msgid "``Flag``, ``IntFlag``, ``auto``" msgstr "``Flag``, ``IntFlag``, ``auto``" -#: ../../library/enum.rst:154 +#: ../../library/enum.rst:153 msgid "" "``StrEnum``, ``EnumCheck``, ``ReprEnum``, ``FlagBoundary``, ``property``, " "``member``, ``nonmember``, ``global_enum``, ``show_flag_values``" @@ -279,18 +279,18 @@ msgstr "" "``StrEnum``, ``EnumCheck``, ``ReprEnum``, ``FlagBoundary``, ``property``, " "``member``, ``nonmember``, ``global_enum``, ``show_flag_values``" -#: ../../library/enum.rst:159 +#: ../../library/enum.rst:158 msgid "Data Types" msgstr "" -#: ../../library/enum.rst:164 +#: ../../library/enum.rst:163 msgid "" "*EnumType* is the :term:`metaclass` for *enum* enumerations. It is possible " "to subclass *EnumType* -- see :ref:`Subclassing EnumType ` for details." msgstr "" -#: ../../library/enum.rst:168 +#: ../../library/enum.rst:167 msgid "" "*EnumType* is responsible for setting the correct :meth:`!__repr__`, :meth:`!" "__str__`, :meth:`!__format__`, and :meth:`!__reduce__` methods on the final " @@ -298,88 +298,11 @@ msgid "" "providing iteration over the enum class, etc." msgstr "" -#: ../../library/enum.rst:175 -msgid "Returns ``True`` if member belongs to the ``cls``::" -msgstr "" - -#: ../../library/enum.rst:183 -msgid "" -"In Python 3.12 it will be possible to check for member values and not just " -"members; until then, a ``TypeError`` will be raised if a non-Enum-member is " -"used in a containment check." -msgstr "" - -#: ../../library/enum.rst:189 -msgid "" -"Returns ``['__class__', '__doc__', '__members__', '__module__']`` and the " -"names of the members in *cls*::" -msgstr "" - -#: ../../library/enum.rst:197 -msgid "" -"Returns the Enum member in *cls* matching *name*, or raises an :exc:" -"`AttributeError`::" -msgstr "" - -#: ../../library/enum.rst:204 -msgid "" -"Returns the Enum member in *cls* matching *name*, or raises a :exc:" -"`KeyError`::" -msgstr "" - -#: ../../library/enum.rst:211 -msgid "Returns each member in *cls* in definition order::" -msgstr "" - -#: ../../library/enum.rst:218 -msgid "Returns the number of member in *cls*::" -msgstr "" - -#: ../../library/enum.rst:225 -msgid "Returns each member in *cls* in reverse definition order::" -msgstr "" - -#: ../../library/enum.rst:233 -msgid "*Enum* is the base class for all *enum* enumerations." -msgstr "" - -#: ../../library/enum.rst:237 -msgid "The name used to define the ``Enum`` member::" -msgstr "" - -#: ../../library/enum.rst:244 -msgid "The value given to the ``Enum`` member::" -msgstr "" - -#: ../../library/enum.rst:249 -msgid "Enum member values" -msgstr "" - -#: ../../library/enum.rst:251 -msgid "" -"Member values can be anything: :class:`int`, :class:`str`, etc. If the " -"exact value is unimportant you may use :class:`auto` instances and an " -"appropriate value will be chosen for you. See :class:`auto` for the details." -msgstr "" - -#: ../../library/enum.rst:258 -msgid "" -"``_ignore_`` is only used during creation and is removed from the " -"enumeration once creation is complete." -msgstr "" - -#: ../../library/enum.rst:261 -msgid "" -"``_ignore_`` is a list of names that will not become members, and whose " -"names will also be removed from the completed enumeration. See :ref:" -"`TimePeriod ` for an example." -msgstr "" - -#: ../../library/enum.rst:267 +#: ../../library/enum.rst:174 msgid "This method is called in two different ways:" msgstr "" -#: ../../library/enum.rst:269 +#: ../../library/enum.rst:176 msgid "to look up an existing member:" msgstr "" @@ -387,7 +310,7 @@ msgstr "" msgid "cls" msgstr "cls" -#: ../../library/enum.rst:271 ../../library/enum.rst:276 +#: ../../library/enum.rst:178 ../../library/enum.rst:184 msgid "The enum class being called." msgstr "" @@ -395,15 +318,17 @@ msgstr "" msgid "value" msgstr "" -#: ../../library/enum.rst:272 +#: ../../library/enum.rst:179 msgid "The value to lookup." msgstr "" -#: ../../library/enum.rst:274 -msgid "to use the ``cls`` enum to create a new enum:" +#: ../../library/enum.rst:181 +msgid "" +"to use the ``cls`` enum to create a new enum (only if the existing enum does " +"not have any members):" msgstr "" -#: ../../library/enum.rst:277 +#: ../../library/enum.rst:185 msgid "The name of the new Enum to create." msgstr "" @@ -411,7 +336,7 @@ msgstr "" msgid "names" msgstr "" -#: ../../library/enum.rst:278 +#: ../../library/enum.rst:186 msgid "The names/values of the members for the new Enum." msgstr "" @@ -419,7 +344,7 @@ msgstr "" msgid "module" msgstr "模組" -#: ../../library/enum.rst:279 +#: ../../library/enum.rst:187 msgid "The name of the module the new Enum is created in." msgstr "" @@ -427,7 +352,7 @@ msgstr "" msgid "qualname" msgstr "" -#: ../../library/enum.rst:280 +#: ../../library/enum.rst:188 msgid "The actual location in the module where this Enum can be found." msgstr "" @@ -435,7 +360,7 @@ msgstr "" msgid "type" msgstr "" -#: ../../library/enum.rst:281 +#: ../../library/enum.rst:189 msgid "A mix-in type for the new Enum." msgstr "" @@ -443,7 +368,7 @@ msgstr "" msgid "start" msgstr "" -#: ../../library/enum.rst:282 +#: ../../library/enum.rst:190 msgid "The first integer value for the Enum (used by :class:`auto`)." msgstr "" @@ -451,11 +376,88 @@ msgstr "" msgid "boundary" msgstr "" -#: ../../library/enum.rst:283 +#: ../../library/enum.rst:191 msgid "" "How to handle out-of-range values from bit operations (:class:`Flag` only)." msgstr "" +#: ../../library/enum.rst:195 +msgid "Returns ``True`` if member belongs to the ``cls``::" +msgstr "" + +#: ../../library/enum.rst:203 +msgid "" +"In Python 3.12 it will be possible to check for member values and not just " +"members; until then, a ``TypeError`` will be raised if a non-Enum-member is " +"used in a containment check." +msgstr "" + +#: ../../library/enum.rst:209 +msgid "" +"Returns ``['__class__', '__doc__', '__members__', '__module__']`` and the " +"names of the members in *cls*::" +msgstr "" + +#: ../../library/enum.rst:217 +msgid "" +"Returns the Enum member in *cls* matching *name*, or raises an :exc:" +"`AttributeError`::" +msgstr "" + +#: ../../library/enum.rst:224 +msgid "" +"Returns the Enum member in *cls* matching *name*, or raises a :exc:" +"`KeyError`::" +msgstr "" + +#: ../../library/enum.rst:231 +msgid "Returns each member in *cls* in definition order::" +msgstr "" + +#: ../../library/enum.rst:238 +msgid "Returns the number of member in *cls*::" +msgstr "" + +#: ../../library/enum.rst:245 +msgid "Returns each member in *cls* in reverse definition order::" +msgstr "" + +#: ../../library/enum.rst:253 +msgid "*Enum* is the base class for all *enum* enumerations." +msgstr "" + +#: ../../library/enum.rst:257 +msgid "The name used to define the ``Enum`` member::" +msgstr "" + +#: ../../library/enum.rst:264 +msgid "The value given to the ``Enum`` member::" +msgstr "" + +#: ../../library/enum.rst:269 +msgid "Enum member values" +msgstr "" + +#: ../../library/enum.rst:271 +msgid "" +"Member values can be anything: :class:`int`, :class:`str`, etc. If the " +"exact value is unimportant you may use :class:`auto` instances and an " +"appropriate value will be chosen for you. See :class:`auto` for the details." +msgstr "" + +#: ../../library/enum.rst:278 +msgid "" +"``_ignore_`` is only used during creation and is removed from the " +"enumeration once creation is complete." +msgstr "" + +#: ../../library/enum.rst:281 +msgid "" +"``_ignore_`` is a list of names that will not become members, and whose " +"names will also be removed from the completed enumeration. See :ref:" +"`TimePeriod ` for an example." +msgstr "" + #: ../../library/enum.rst:287 msgid "" "Returns ``['__class__', '__doc__', '__module__', 'name', 'value']`` and any " @@ -757,96 +759,95 @@ msgstr "" #: ../../library/enum.rst:724 msgid "" -"Out-of-range values lose their *Flag* membership and revert to :class:`int`. " -"This is the default for :class:`IntFlag`::" +"Out-of-range values lose their *Flag* membership and revert to :class:`int`." msgstr "" -#: ../../library/enum.rst:737 +#: ../../library/enum.rst:736 msgid "" -"Out-of-range values are kept, and the *Flag* membership is kept. This is " -"used for some stdlib flags::" +"Out-of-range values are kept, and the *Flag* membership is kept. This is the " +"default for :class:`IntFlag`::" msgstr "" -#: ../../library/enum.rst:753 +#: ../../library/enum.rst:752 msgid "Supported ``__dunder__`` names" msgstr "" -#: ../../library/enum.rst:755 +#: ../../library/enum.rst:754 msgid "" ":attr:`~EnumType.__members__` is a read-only ordered mapping of " "``member_name``:``member`` items. It is only available on the class." msgstr "" -#: ../../library/enum.rst:758 +#: ../../library/enum.rst:757 msgid "" ":meth:`~object.__new__`, if specified, must create and return the enum " "members; it is also a very good idea to set the member's :attr:`!_value_` " "appropriately. Once all the members are created it is no longer used." msgstr "" -#: ../../library/enum.rst:764 +#: ../../library/enum.rst:763 msgid "Supported ``_sunder_`` names" msgstr "" -#: ../../library/enum.rst:766 +#: ../../library/enum.rst:765 msgid "``_name_`` -- name of the member" msgstr "" -#: ../../library/enum.rst:767 +#: ../../library/enum.rst:766 msgid "" "``_value_`` -- value of the member; can be set / modified in ``__new__``" msgstr "" -#: ../../library/enum.rst:769 +#: ../../library/enum.rst:768 msgid "" "``_missing_`` -- a lookup function used when a value is not found; may be " "overridden" msgstr "" -#: ../../library/enum.rst:771 +#: ../../library/enum.rst:770 msgid "" "``_ignore_`` -- a list of names, either as a :class:`list` or a :class:" "`str`, that will not be transformed into members, and will be removed from " "the final class" msgstr "" -#: ../../library/enum.rst:774 +#: ../../library/enum.rst:773 msgid "" "``_order_`` -- used in Python 2/3 code to ensure member order is consistent " "(class attribute, removed during class creation)" msgstr "" -#: ../../library/enum.rst:776 +#: ../../library/enum.rst:775 msgid "" "``_generate_next_value_`` -- used to get an appropriate value for an enum " "member; may be overridden" msgstr "" -#: ../../library/enum.rst:781 +#: ../../library/enum.rst:780 msgid "" "For standard :class:`Enum` classes the next value chosen is the last value " "seen incremented by one." msgstr "" -#: ../../library/enum.rst:784 +#: ../../library/enum.rst:783 msgid "" "For :class:`Flag` classes the next value chosen will be the next highest " "power-of-two, regardless of the last value seen." msgstr "" -#: ../../library/enum.rst:787 +#: ../../library/enum.rst:786 msgid "``_missing_``, ``_order_``, ``_generate_next_value_``" msgstr "``_missing_``\\ 、\\ ``_order_``\\ 、\\ ``_generate_next_value_``" -#: ../../library/enum.rst:788 +#: ../../library/enum.rst:787 msgid "``_ignore_``" msgstr "``_ignore_``" -#: ../../library/enum.rst:793 +#: ../../library/enum.rst:792 msgid "Utilities and Decorators" msgstr "" -#: ../../library/enum.rst:797 +#: ../../library/enum.rst:796 msgid "" "*auto* can be used in place of a value. If used, the *Enum* machinery will " "call an *Enum*'s :meth:`~Enum._generate_next_value_` to get an appropriate " @@ -857,58 +858,58 @@ msgid "" "manually specified values." msgstr "" -#: ../../library/enum.rst:805 +#: ../../library/enum.rst:804 msgid "" "*auto* instances are only resolved when at the top level of an assignment:" msgstr "" -#: ../../library/enum.rst:807 +#: ../../library/enum.rst:806 msgid "``FIRST = auto()`` will work (auto() is replaced with ``1``);" msgstr "" -#: ../../library/enum.rst:808 +#: ../../library/enum.rst:807 msgid "" "``SECOND = auto(), -2`` will work (auto is replaced with ``2``, so ``2, -2`` " "is" msgstr "" -#: ../../library/enum.rst:809 +#: ../../library/enum.rst:808 msgid "used to create the ``SECOND`` enum member;" msgstr "" -#: ../../library/enum.rst:810 +#: ../../library/enum.rst:809 msgid "" "``THREE = [auto(), -3]`` will *not* work (``, -3`` is used to " "create the ``THREE`` enum member)" msgstr "" -#: ../../library/enum.rst:815 +#: ../../library/enum.rst:814 msgid "" "In prior versions, ``auto()`` had to be the only thing on the assignment " "line to work properly." msgstr "" -#: ../../library/enum.rst:818 +#: ../../library/enum.rst:817 msgid "" "``_generate_next_value_`` can be overridden to customize the values used by " "*auto*." msgstr "" -#: ../../library/enum.rst:821 +#: ../../library/enum.rst:820 msgid "" "in 3.13 the default ``_generate_next_value_`` will always return the highest " "member value incremented by 1, and will fail if any member is an " "incompatible type." msgstr "" -#: ../../library/enum.rst:827 +#: ../../library/enum.rst:826 msgid "" "A decorator similar to the built-in *property*, but specifically for " "enumerations. It allows member attributes to have the same names as members " "themselves." msgstr "" -#: ../../library/enum.rst:831 +#: ../../library/enum.rst:830 msgid "" "the *property* and the member must be defined in separate classes; for " "example, the *value* and *name* attributes are defined in the *Enum* class, " @@ -916,29 +917,29 @@ msgid "" "``name``." msgstr "" -#: ../../library/enum.rst:840 +#: ../../library/enum.rst:839 msgid "" "A :keyword:`class` decorator specifically for enumerations. It searches an " "enumeration's :attr:`~EnumType.__members__`, gathering any aliases it finds; " "if any are found :exc:`ValueError` is raised with the details::" msgstr "" -#: ../../library/enum.rst:858 +#: ../../library/enum.rst:857 msgid "" "A :keyword:`class` decorator specifically for enumerations. Members from :" "class:`EnumCheck` are used to specify which constraints should be checked on " "the decorated enumeration." msgstr "" -#: ../../library/enum.rst:866 +#: ../../library/enum.rst:865 msgid "A decorator for use in enums: its target will become a member." msgstr "" -#: ../../library/enum.rst:872 +#: ../../library/enum.rst:871 msgid "A decorator for use in enums: its target will not become a member." msgstr "" -#: ../../library/enum.rst:878 +#: ../../library/enum.rst:877 msgid "" "A decorator to change the :class:`str() ` and :func:`repr` of an enum " "to show its members as belonging to the module instead of its class. Should " @@ -946,41 +947,41 @@ msgid "" "namespace (see :class:`re.RegexFlag` for an example)." msgstr "" -#: ../../library/enum.rst:888 +#: ../../library/enum.rst:887 msgid "Return a list of all power-of-two integers contained in a flag *value*." msgstr "" -#: ../../library/enum.rst:895 +#: ../../library/enum.rst:894 msgid "Notes" msgstr "" -#: ../../library/enum.rst:897 +#: ../../library/enum.rst:896 msgid ":class:`IntEnum`, :class:`StrEnum`, and :class:`IntFlag`" msgstr "" -#: ../../library/enum.rst:899 +#: ../../library/enum.rst:898 msgid "" "These three enum types are designed to be drop-in replacements for existing " "integer- and string-based values; as such, they have extra limitations:" msgstr "" -#: ../../library/enum.rst:902 +#: ../../library/enum.rst:901 msgid "``__str__`` uses the value and not the name of the enum member" msgstr "" -#: ../../library/enum.rst:904 +#: ../../library/enum.rst:903 msgid "" "``__format__``, because it uses ``__str__``, will also use the value of the " "enum member instead of its name" msgstr "" -#: ../../library/enum.rst:907 +#: ../../library/enum.rst:906 msgid "" "If you do not need/want those limitations, you can either create your own " "base class by mixing in the ``int`` or ``str`` type yourself::" msgstr "" -#: ../../library/enum.rst:914 +#: ../../library/enum.rst:913 msgid "or you can reassign the appropriate :meth:`str`, etc., in your enum::" msgstr "" diff --git a/library/functions.po b/library/functions.po index 9125b59108..b853bedc45 100644 --- a/library/functions.po +++ b/library/functions.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-25 00:17+0000\n" +"POT-Creation-Date: 2023-04-06 00:14+0000\n" "PO-Revision-Date: 2023-01-04 14:53+0800\n" "Last-Translator: Phil Lin \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2373,36 +2373,36 @@ msgstr "" #: ../../library/functions.rst:1446 msgid "" -"Whether the output is buffered is usually determined by *file*, but if the " -"*flush* keyword argument is true, the stream is forcibly flushed." +"Output buffering is usually determined by *file*. However, if *flush* is " +"true, the stream is forcibly flushed." msgstr "" -#: ../../library/functions.rst:1449 +#: ../../library/functions.rst:1450 msgid "Added the *flush* keyword argument." msgstr "增加了 *flush* 關鍵字引數。" -#: ../../library/functions.rst:1455 +#: ../../library/functions.rst:1456 msgid "Return a property attribute." msgstr "回傳 property 屬性。" -#: ../../library/functions.rst:1457 +#: ../../library/functions.rst:1458 msgid "" "*fget* is a function for getting an attribute value. *fset* is a function " "for setting an attribute value. *fdel* is a function for deleting an " "attribute value. And *doc* creates a docstring for the attribute." msgstr "" -#: ../../library/functions.rst:1461 +#: ../../library/functions.rst:1462 msgid "A typical use is to define a managed attribute ``x``::" msgstr "" -#: ../../library/functions.rst:1478 +#: ../../library/functions.rst:1479 msgid "" "If *c* is an instance of *C*, ``c.x`` will invoke the getter, ``c.x = " "value`` will invoke the setter, and ``del c.x`` the deleter." msgstr "" -#: ../../library/functions.rst:1481 +#: ../../library/functions.rst:1482 msgid "" "If given, *doc* will be the docstring of the property attribute. Otherwise, " "the property will copy *fget*'s docstring (if it exists). This makes it " @@ -2410,14 +2410,14 @@ msgid "" "term:`decorator`::" msgstr "" -#: ../../library/functions.rst:1494 +#: ../../library/functions.rst:1495 msgid "" "The ``@property`` decorator turns the :meth:`voltage` method into a " "\"getter\" for a read-only attribute with the same name, and it sets the " "docstring for *voltage* to \"Get the current voltage.\"" msgstr "" -#: ../../library/functions.rst:1498 +#: ../../library/functions.rst:1499 msgid "" "A property object has :attr:`~property.getter`, :attr:`~property.setter`, " "and :attr:`~property.deleter` methods usable as decorators that create a " @@ -2425,30 +2425,30 @@ msgid "" "decorated function. This is best explained with an example::" msgstr "" -#: ../../library/functions.rst:1520 +#: ../../library/functions.rst:1521 msgid "" "This code is exactly equivalent to the first example. Be sure to give the " "additional functions the same name as the original property (``x`` in this " "case.)" msgstr "" -#: ../../library/functions.rst:1524 +#: ../../library/functions.rst:1525 msgid "" "The returned property object also has the attributes ``fget``, ``fset``, and " "``fdel`` corresponding to the constructor arguments." msgstr "" -#: ../../library/functions.rst:1527 +#: ../../library/functions.rst:1528 msgid "The docstrings of property objects are now writeable." msgstr "" -#: ../../library/functions.rst:1536 +#: ../../library/functions.rst:1537 msgid "" "Rather than being a function, :class:`range` is actually an immutable " "sequence type, as documented in :ref:`typesseq-range` and :ref:`typesseq`." msgstr "" -#: ../../library/functions.rst:1542 +#: ../../library/functions.rst:1543 msgid "" "Return a string containing a printable representation of an object. For " "many types, this function makes an attempt to return a string that would " @@ -2461,7 +2461,7 @@ msgid "" "`RuntimeError`." msgstr "" -#: ../../library/functions.rst:1555 +#: ../../library/functions.rst:1556 msgid "" "Return a reverse :term:`iterator`. *seq* must be an object which has a :" "meth:`__reversed__` method or supports the sequence protocol (the :meth:" @@ -2469,14 +2469,14 @@ msgid "" "starting at ``0``)." msgstr "" -#: ../../library/functions.rst:1563 +#: ../../library/functions.rst:1564 msgid "" "Return *number* rounded to *ndigits* precision after the decimal point. If " "*ndigits* is omitted or is ``None``, it returns the nearest integer to its " "input." msgstr "" -#: ../../library/functions.rst:1567 +#: ../../library/functions.rst:1568 msgid "" "For the built-in types supporting :func:`round`, values are rounded to the " "closest multiple of 10 to the power minus *ndigits*; if two multiples are " @@ -2487,13 +2487,13 @@ msgid "" "``None``. Otherwise, the return value has the same type as *number*." msgstr "" -#: ../../library/functions.rst:1576 +#: ../../library/functions.rst:1577 msgid "" "For a general Python object ``number``, ``round`` delegates to ``number." "__round__``." msgstr "" -#: ../../library/functions.rst:1581 +#: ../../library/functions.rst:1582 msgid "" "The behavior of :func:`round` for floats can be surprising: for example, " "``round(2.675, 2)`` gives ``2.67`` instead of the expected ``2.68``. This is " @@ -2502,21 +2502,21 @@ msgid "" "information." msgstr "" -#: ../../library/functions.rst:1593 +#: ../../library/functions.rst:1594 msgid "" "Return a new :class:`set` object, optionally with elements taken from " "*iterable*. ``set`` is a built-in class. See :class:`set` and :ref:`types-" "set` for documentation about this class." msgstr "" -#: ../../library/functions.rst:1597 +#: ../../library/functions.rst:1598 msgid "" "For other containers see the built-in :class:`frozenset`, :class:`list`, :" "class:`tuple`, and :class:`dict` classes, as well as the :mod:`collections` " "module." msgstr "" -#: ../../library/functions.rst:1604 +#: ../../library/functions.rst:1605 msgid "" "This is the counterpart of :func:`getattr`. The arguments are an object, a " "string, and an arbitrary value. The string may name an existing attribute " @@ -2525,7 +2525,7 @@ msgid "" "is equivalent to ``x.foobar = 123``." msgstr "" -#: ../../library/functions.rst:1610 +#: ../../library/functions.rst:1611 msgid "" "*name* need not be a Python identifier as defined in :ref:`identifiers` " "unless the object chooses to enforce that, for example in a custom :meth:" @@ -2534,14 +2534,14 @@ msgid "" "notation, but is accessible through :func:`getattr` etc.." msgstr "" -#: ../../library/functions.rst:1618 +#: ../../library/functions.rst:1619 msgid "" "Since :ref:`private name mangling ` happens at " "compilation time, one must manually mangle a private attribute's (attributes " "with two leading underscores) name in order to set it with :func:`setattr`." msgstr "" -#: ../../library/functions.rst:1627 +#: ../../library/functions.rst:1628 msgid "" "Return a :term:`slice` object representing the set of indices specified by " "``range(start, stop, step)``. The *start* and *step* arguments default to " @@ -2554,35 +2554,35 @@ msgid "" "func:`itertools.islice` for an alternate version that returns an iterator." msgstr "" -#: ../../library/functions.rst:1640 +#: ../../library/functions.rst:1641 msgid "Return a new sorted list from the items in *iterable*." msgstr "" -#: ../../library/functions.rst:1642 +#: ../../library/functions.rst:1643 msgid "" "Has two optional arguments which must be specified as keyword arguments." msgstr "有兩個選擇性引數,只能使用關鍵字引數來指定。" -#: ../../library/functions.rst:1644 +#: ../../library/functions.rst:1645 msgid "" "*key* specifies a function of one argument that is used to extract a " "comparison key from each element in *iterable* (for example, ``key=str." "lower``). The default value is ``None`` (compare the elements directly)." msgstr "" -#: ../../library/functions.rst:1648 +#: ../../library/functions.rst:1649 msgid "" "*reverse* is a boolean value. If set to ``True``, then the list elements " "are sorted as if each comparison were reversed." msgstr "" -#: ../../library/functions.rst:1651 +#: ../../library/functions.rst:1652 msgid "" "Use :func:`functools.cmp_to_key` to convert an old-style *cmp* function to a " "*key* function." msgstr "" -#: ../../library/functions.rst:1654 +#: ../../library/functions.rst:1655 msgid "" "The built-in :func:`sorted` function is guaranteed to be stable. A sort is " "stable if it guarantees not to change the relative order of elements that " @@ -2590,7 +2590,7 @@ msgid "" "example, sort by department, then by salary grade)." msgstr "" -#: ../../library/functions.rst:1659 +#: ../../library/functions.rst:1660 msgid "" "The sort algorithm uses only ``<`` comparisons between items. While " "defining an :meth:`~object.__lt__` method will suffice for sorting, :PEP:`8` " @@ -2602,22 +2602,22 @@ msgid "" "method." msgstr "" -#: ../../library/functions.rst:1668 +#: ../../library/functions.rst:1669 msgid "" "For sorting examples and a brief sorting tutorial, see :ref:`sortinghowto`." msgstr "" -#: ../../library/functions.rst:1672 +#: ../../library/functions.rst:1673 msgid "Transform a method into a static method." msgstr "" -#: ../../library/functions.rst:1674 +#: ../../library/functions.rst:1675 msgid "" "A static method does not receive an implicit first argument. To declare a " "static method, use this idiom::" msgstr "" -#: ../../library/functions.rst:1681 +#: ../../library/functions.rst:1682 msgid "" "The ``@staticmethod`` form is a function :term:`decorator` -- see :ref:" "`function` for details." @@ -2625,21 +2625,21 @@ msgstr "" "``@staticmethod`` 語法是一個函式 :term:`decorator` - 參見 :ref:`function` 中" "的詳細介紹。" -#: ../../library/functions.rst:1684 +#: ../../library/functions.rst:1685 msgid "" "A static method can be called either on the class (such as ``C.f()``) or on " "an instance (such as ``C().f()``). Moreover, they can be called as regular " "functions (such as ``f()``)." msgstr "" -#: ../../library/functions.rst:1688 +#: ../../library/functions.rst:1689 msgid "" "Static methods in Python are similar to those found in Java or C++. Also, " "see :func:`classmethod` for a variant that is useful for creating alternate " "class constructors." msgstr "" -#: ../../library/functions.rst:1692 +#: ../../library/functions.rst:1693 msgid "" "Like all decorators, it is also possible to call ``staticmethod`` as a " "regular function and do something with its result. This is needed in some " @@ -2648,36 +2648,36 @@ msgid "" "cases, use this idiom::" msgstr "" -#: ../../library/functions.rst:1704 +#: ../../library/functions.rst:1705 msgid "For more information on static methods, see :ref:`types`." msgstr "關於 static method 的更多資訊,請參考 :ref:`types`。" -#: ../../library/functions.rst:1706 +#: ../../library/functions.rst:1707 msgid "" "Static methods now inherit the method attributes (``__module__``, " "``__name__``, ``__qualname__``, ``__doc__`` and ``__annotations__``), have a " "new ``__wrapped__`` attribute, and are now callable as regular functions." msgstr "" -#: ../../library/functions.rst:1721 +#: ../../library/functions.rst:1722 msgid "" "Return a :class:`str` version of *object*. See :func:`str` for details." msgstr "" -#: ../../library/functions.rst:1723 +#: ../../library/functions.rst:1724 msgid "" "``str`` is the built-in string :term:`class`. For general information about " "strings, see :ref:`textseq`." msgstr "" -#: ../../library/functions.rst:1729 +#: ../../library/functions.rst:1730 msgid "" "Sums *start* and the items of an *iterable* from left to right and returns " "the total. The *iterable*'s items are normally numbers, and the start value " "is not allowed to be a string." msgstr "" -#: ../../library/functions.rst:1733 +#: ../../library/functions.rst:1734 msgid "" "For some use cases, there are good alternatives to :func:`sum`. The " "preferred, fast way to concatenate a sequence of strings is by calling ``''." @@ -2686,31 +2686,31 @@ msgid "" "using :func:`itertools.chain`." msgstr "" -#: ../../library/functions.rst:1739 +#: ../../library/functions.rst:1740 msgid "The *start* parameter can be specified as a keyword argument." msgstr "*start* 參數可被指定為關鍵字引數。" -#: ../../library/functions.rst:1745 +#: ../../library/functions.rst:1746 msgid "" "Return a proxy object that delegates method calls to a parent or sibling " "class of *type*. This is useful for accessing inherited methods that have " "been overridden in a class." msgstr "" -#: ../../library/functions.rst:1749 +#: ../../library/functions.rst:1750 msgid "" "The *object_or_type* determines the :term:`method resolution order` to be " "searched. The search starts from the class right after the *type*." msgstr "" -#: ../../library/functions.rst:1753 +#: ../../library/functions.rst:1754 msgid "" "For example, if :attr:`~class.__mro__` of *object_or_type* is ``D -> B -> C -" "> A -> object`` and the value of *type* is ``B``, then :func:`super` " "searches ``C -> A -> object``." msgstr "" -#: ../../library/functions.rst:1757 +#: ../../library/functions.rst:1758 msgid "" "The :attr:`~class.__mro__` attribute of the *object_or_type* lists the " "method resolution search order used by both :func:`getattr` and :func:" @@ -2718,7 +2718,7 @@ msgid "" "hierarchy is updated." msgstr "" -#: ../../library/functions.rst:1762 +#: ../../library/functions.rst:1763 msgid "" "If the second argument is omitted, the super object returned is unbound. If " "the second argument is an object, ``isinstance(obj, type)`` must be true. " @@ -2726,7 +2726,7 @@ msgid "" "(this is useful for classmethods)." msgstr "" -#: ../../library/functions.rst:1767 +#: ../../library/functions.rst:1768 msgid "" "There are two typical use cases for *super*. In a class hierarchy with " "single inheritance, *super* can be used to refer to parent classes without " @@ -2734,7 +2734,7 @@ msgid "" "closely parallels the use of *super* in other programming languages." msgstr "" -#: ../../library/functions.rst:1772 +#: ../../library/functions.rst:1773 msgid "" "The second use case is to support cooperative multiple inheritance in a " "dynamic execution environment. This use case is unique to Python and is not " @@ -2747,18 +2747,18 @@ msgid "" "classes that are unknown prior to runtime)." msgstr "" -#: ../../library/functions.rst:1782 +#: ../../library/functions.rst:1783 msgid "For both use cases, a typical superclass call looks like this::" msgstr "" -#: ../../library/functions.rst:1789 +#: ../../library/functions.rst:1790 msgid "" "In addition to method lookups, :func:`super` also works for attribute " "lookups. One possible use case for this is calling :term:`descriptors " "` in a parent or sibling class." msgstr "" -#: ../../library/functions.rst:1793 +#: ../../library/functions.rst:1794 msgid "" "Note that :func:`super` is implemented as part of the binding process for " "explicit dotted attribute lookups such as ``super().__getitem__(name)``. It " @@ -2768,7 +2768,7 @@ msgid "" "using statements or operators such as ``super()[name]``." msgstr "" -#: ../../library/functions.rst:1800 +#: ../../library/functions.rst:1801 msgid "" "Also note that, aside from the zero argument form, :func:`super` is not " "limited to use inside methods. The two argument form specifies the " @@ -2778,33 +2778,33 @@ msgid "" "accessing the current instance for ordinary methods." msgstr "" -#: ../../library/functions.rst:1807 +#: ../../library/functions.rst:1808 msgid "" "For practical suggestions on how to design cooperative classes using :func:" "`super`, see `guide to using super() `_." msgstr "" -#: ../../library/functions.rst:1817 +#: ../../library/functions.rst:1818 msgid "" "Rather than being a function, :class:`tuple` is actually an immutable " "sequence type, as documented in :ref:`typesseq-tuple` and :ref:`typesseq`." msgstr "" -#: ../../library/functions.rst:1826 +#: ../../library/functions.rst:1827 msgid "" "With one argument, return the type of an *object*. The return value is a " "type object and generally the same object as returned by :attr:`object." "__class__ `." msgstr "" -#: ../../library/functions.rst:1830 +#: ../../library/functions.rst:1831 msgid "" "The :func:`isinstance` built-in function is recommended for testing the type " "of an object, because it takes subclasses into account." msgstr "" -#: ../../library/functions.rst:1834 +#: ../../library/functions.rst:1835 msgid "" "With three arguments, return a new type object. This is essentially a " "dynamic form of the :keyword:`class` statement. The *name* string is the " @@ -2817,11 +2817,11 @@ msgid "" "identical :class:`type` objects:" msgstr "" -#: ../../library/functions.rst:1849 +#: ../../library/functions.rst:1850 msgid "See also :ref:`bltin-type-objects`." msgstr "另請參閱 :ref:`bltin-type-objects`。" -#: ../../library/functions.rst:1851 +#: ../../library/functions.rst:1852 msgid "" "Keyword arguments provided to the three argument form are passed to the " "appropriate metaclass machinery (usually :meth:`~object.__init_subclass__`) " @@ -2829,23 +2829,23 @@ msgid "" "would." msgstr "" -#: ../../library/functions.rst:1856 +#: ../../library/functions.rst:1857 msgid "See also :ref:`class-customization`." msgstr "另請參閱 :ref:`class-customization`。" -#: ../../library/functions.rst:1858 +#: ../../library/functions.rst:1859 msgid "" "Subclasses of :class:`type` which don't override ``type.__new__`` may no " "longer use the one-argument form to get the type of an object." msgstr "" -#: ../../library/functions.rst:1865 +#: ../../library/functions.rst:1866 msgid "" "Return the :attr:`~object.__dict__` attribute for a module, class, instance, " "or any other object with a :attr:`~object.__dict__` attribute." msgstr "" -#: ../../library/functions.rst:1868 +#: ../../library/functions.rst:1869 msgid "" "Objects such as modules and instances have an updateable :attr:`~object." "__dict__` attribute; however, other objects may have write restrictions on " @@ -2853,54 +2853,54 @@ msgid "" "`types.MappingProxyType` to prevent direct dictionary updates)." msgstr "" -#: ../../library/functions.rst:1873 +#: ../../library/functions.rst:1874 msgid "" "Without an argument, :func:`vars` acts like :func:`locals`. Note, the " "locals dictionary is only useful for reads since updates to the locals " "dictionary are ignored." msgstr "" -#: ../../library/functions.rst:1877 +#: ../../library/functions.rst:1878 msgid "" "A :exc:`TypeError` exception is raised if an object is specified but it " "doesn't have a :attr:`~object.__dict__` attribute (for example, if its class " "defines the :attr:`~object.__slots__` attribute)." msgstr "" -#: ../../library/functions.rst:1883 +#: ../../library/functions.rst:1884 msgid "" "Iterate over several iterables in parallel, producing tuples with an item " "from each one." msgstr "" -#: ../../library/functions.rst:1886 +#: ../../library/functions.rst:1887 msgid "Example::" msgstr "" "例如:\n" "\n" "::" -#: ../../library/functions.rst:1895 +#: ../../library/functions.rst:1896 msgid "" "More formally: :func:`zip` returns an iterator of tuples, where the *i*-th " "tuple contains the *i*-th element from each of the argument iterables." msgstr "" -#: ../../library/functions.rst:1898 +#: ../../library/functions.rst:1899 msgid "" "Another way to think of :func:`zip` is that it turns rows into columns, and " "columns into rows. This is similar to `transposing a matrix `_." msgstr "" -#: ../../library/functions.rst:1902 +#: ../../library/functions.rst:1903 msgid "" ":func:`zip` is lazy: The elements won't be processed until the iterable is " "iterated on, e.g. by a :keyword:`!for` loop or by wrapping in a :class:" "`list`." msgstr "" -#: ../../library/functions.rst:1906 +#: ../../library/functions.rst:1907 msgid "" "One thing to consider is that the iterables passed to :func:`zip` could have " "different lengths; sometimes by design, and sometimes because of a bug in " @@ -2908,51 +2908,51 @@ msgid "" "approaches to dealing with this issue:" msgstr "" -#: ../../library/functions.rst:1911 +#: ../../library/functions.rst:1912 msgid "" "By default, :func:`zip` stops when the shortest iterable is exhausted. It " "will ignore the remaining items in the longer iterables, cutting off the " "result to the length of the shortest iterable::" msgstr "" -#: ../../library/functions.rst:1918 +#: ../../library/functions.rst:1919 msgid "" ":func:`zip` is often used in cases where the iterables are assumed to be of " "equal length. In such cases, it's recommended to use the ``strict=True`` " "option. Its output is the same as regular :func:`zip`::" msgstr "" -#: ../../library/functions.rst:1925 +#: ../../library/functions.rst:1926 msgid "" "Unlike the default behavior, it raises a :exc:`ValueError` if one iterable " "is exhausted before the others:" msgstr "" -#: ../../library/functions.rst:1943 +#: ../../library/functions.rst:1944 msgid "" "Without the ``strict=True`` argument, any bug that results in iterables of " "different lengths will be silenced, possibly manifesting as a hard-to-find " "bug in another part of the program." msgstr "" -#: ../../library/functions.rst:1947 +#: ../../library/functions.rst:1948 msgid "" "Shorter iterables can be padded with a constant value to make all the " "iterables have the same length. This is done by :func:`itertools." "zip_longest`." msgstr "" -#: ../../library/functions.rst:1951 +#: ../../library/functions.rst:1952 msgid "" "Edge cases: With a single iterable argument, :func:`zip` returns an iterator " "of 1-tuples. With no arguments, it returns an empty iterator." msgstr "" -#: ../../library/functions.rst:1954 +#: ../../library/functions.rst:1955 msgid "Tips and tricks:" msgstr "" -#: ../../library/functions.rst:1956 +#: ../../library/functions.rst:1957 msgid "" "The left-to-right evaluation order of the iterables is guaranteed. This " "makes possible an idiom for clustering a data series into n-length groups " @@ -2961,23 +2961,23 @@ msgid "" "iterator. This has the effect of dividing the input into n-length chunks." msgstr "" -#: ../../library/functions.rst:1962 +#: ../../library/functions.rst:1963 msgid "" ":func:`zip` in conjunction with the ``*`` operator can be used to unzip a " "list::" msgstr "" -#: ../../library/functions.rst:1973 +#: ../../library/functions.rst:1974 msgid "Added the ``strict`` argument." msgstr "增加了 ``strict`` 引數。" -#: ../../library/functions.rst:1985 +#: ../../library/functions.rst:1986 msgid "" "This is an advanced function that is not needed in everyday Python " "programming, unlike :func:`importlib.import_module`." msgstr "" -#: ../../library/functions.rst:1988 +#: ../../library/functions.rst:1989 msgid "" "This function is invoked by the :keyword:`import` statement. It can be " "replaced (by importing the :mod:`builtins` module and assigning to " @@ -2989,7 +2989,7 @@ msgid "" "discouraged in favor of :func:`importlib.import_module`." msgstr "" -#: ../../library/functions.rst:1997 +#: ../../library/functions.rst:1998 msgid "" "The function imports the module *name*, potentially using the given " "*globals* and *locals* to determine how to interpret the name in a package " @@ -2999,7 +2999,7 @@ msgid "" "determine the package context of the :keyword:`import` statement." msgstr "" -#: ../../library/functions.rst:2004 +#: ../../library/functions.rst:2005 msgid "" "*level* specifies whether to use absolute or relative imports. ``0`` (the " "default) means only perform absolute imports. Positive values for *level* " @@ -3008,7 +3008,7 @@ msgid "" "details)." msgstr "" -#: ../../library/functions.rst:2010 +#: ../../library/functions.rst:2011 msgid "" "When the *name* variable is of the form ``package.module``, normally, the " "top-level package (the name up till the first dot) is returned, *not* the " @@ -3016,58 +3016,58 @@ msgid "" "given, the module named by *name* is returned." msgstr "" -#: ../../library/functions.rst:2015 +#: ../../library/functions.rst:2016 msgid "" "For example, the statement ``import spam`` results in bytecode resembling " "the following code::" msgstr "" -#: ../../library/functions.rst:2020 +#: ../../library/functions.rst:2021 msgid "The statement ``import spam.ham`` results in this call::" msgstr "" -#: ../../library/functions.rst:2024 +#: ../../library/functions.rst:2025 msgid "" "Note how :func:`__import__` returns the toplevel module here because this is " "the object that is bound to a name by the :keyword:`import` statement." msgstr "" -#: ../../library/functions.rst:2027 +#: ../../library/functions.rst:2028 msgid "" "On the other hand, the statement ``from spam.ham import eggs, sausage as " "saus`` results in ::" msgstr "" -#: ../../library/functions.rst:2034 +#: ../../library/functions.rst:2035 msgid "" "Here, the ``spam.ham`` module is returned from :func:`__import__`. From " "this object, the names to import are retrieved and assigned to their " "respective names." msgstr "" -#: ../../library/functions.rst:2038 +#: ../../library/functions.rst:2039 msgid "" "If you simply want to import a module (potentially within a package) by " "name, use :func:`importlib.import_module`." msgstr "" -#: ../../library/functions.rst:2041 +#: ../../library/functions.rst:2042 msgid "" "Negative values for *level* are no longer supported (which also changes the " "default value to 0)." msgstr "" -#: ../../library/functions.rst:2045 +#: ../../library/functions.rst:2046 msgid "" "When the command line options :option:`-E` or :option:`-I` are being used, " "the environment variable :envvar:`PYTHONCASEOK` is now ignored." msgstr "" -#: ../../library/functions.rst:2050 +#: ../../library/functions.rst:2051 msgid "Footnotes" msgstr "註解" -#: ../../library/functions.rst:2051 +#: ../../library/functions.rst:2052 msgid "" "Note that the parser only accepts the Unix-style end of line convention. If " "you are reading the code from a file, make sure to use newline conversion " diff --git a/library/gzip.po b/library/gzip.po index 80d5a11fcd..4a7e6cec21 100644 --- a/library/gzip.po +++ b/library/gzip.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-03-26 00:17+0000\n" "PO-Revision-Date: 2018-05-23 16:03+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -105,7 +105,7 @@ msgstr "" msgid "Added support for the ``'x'``, ``'xb'`` and ``'xt'`` modes." msgstr "" -#: ../../library/gzip.rst:59 ../../library/gzip.rst:165 +#: ../../library/gzip.rst:59 ../../library/gzip.rst:171 msgid "Accepts a :term:`path-like object`." msgstr "" @@ -224,38 +224,45 @@ msgid "" "returned by :func:`os.stat`." msgstr "" -#: ../../library/gzip.rst:146 +#: ../../library/gzip.rst:148 +msgid "" +"The path to the gzip file on disk, as a :class:`str` or :class:`bytes`. " +"Equivalent to the output of :func:`os.fspath` on the original input path, " +"with no other normalization, resolution or expansion." +msgstr "" + +#: ../../library/gzip.rst:152 msgid "" "Support for the :keyword:`with` statement was added, along with the *mtime* " "constructor argument and :attr:`mtime` attribute." msgstr "" -#: ../../library/gzip.rst:150 +#: ../../library/gzip.rst:156 msgid "Support for zero-padded and unseekable files was added." msgstr "" -#: ../../library/gzip.rst:153 +#: ../../library/gzip.rst:159 msgid "The :meth:`io.BufferedIOBase.read1` method is now implemented." msgstr "" -#: ../../library/gzip.rst:156 +#: ../../library/gzip.rst:162 msgid "Added support for the ``'x'`` and ``'xb'`` modes." msgstr "" -#: ../../library/gzip.rst:159 +#: ../../library/gzip.rst:165 msgid "" "Added support for writing arbitrary :term:`bytes-like objects `. The :meth:`~io.BufferedIOBase.read` method now accepts an argument " "of ``None``." msgstr "" -#: ../../library/gzip.rst:168 +#: ../../library/gzip.rst:174 msgid "" "Opening :class:`GzipFile` for writing without specifying the *mode* argument " "is deprecated." msgstr "" -#: ../../library/gzip.rst:175 +#: ../../library/gzip.rst:181 msgid "" "Compress the *data*, returning a :class:`bytes` object containing the " "compressed data. *compresslevel* and *mtime* have the same meaning as in " @@ -264,18 +271,18 @@ msgid "" "The zlib function is faster." msgstr "" -#: ../../library/gzip.rst:182 +#: ../../library/gzip.rst:188 msgid "Added the *mtime* parameter for reproducible output." msgstr "" -#: ../../library/gzip.rst:184 +#: ../../library/gzip.rst:190 msgid "" "Speed is improved by compressing all data at once instead of in a streamed " "fashion. Calls with *mtime* set to ``0`` are delegated to :func:`zlib." "compress` for better speed." msgstr "" -#: ../../library/gzip.rst:191 +#: ../../library/gzip.rst:197 msgid "" "Decompress the *data*, returning a :class:`bytes` object containing the " "uncompressed data. This function is capable of decompressing multi-member " @@ -284,82 +291,82 @@ msgid "" "*wbits* set to 31 is faster." msgstr "" -#: ../../library/gzip.rst:198 +#: ../../library/gzip.rst:204 msgid "" "Speed is improved by decompressing members at once in memory instead of in a " "streamed fashion." msgstr "" -#: ../../library/gzip.rst:205 +#: ../../library/gzip.rst:211 msgid "Examples of usage" msgstr "用法範例" -#: ../../library/gzip.rst:207 +#: ../../library/gzip.rst:213 msgid "Example of how to read a compressed file::" msgstr "" -#: ../../library/gzip.rst:213 +#: ../../library/gzip.rst:219 msgid "Example of how to create a compressed GZIP file::" msgstr "" -#: ../../library/gzip.rst:220 +#: ../../library/gzip.rst:226 msgid "Example of how to GZIP compress an existing file::" msgstr "" -#: ../../library/gzip.rst:228 +#: ../../library/gzip.rst:234 msgid "Example of how to GZIP compress a binary string::" msgstr "" -#: ../../library/gzip.rst:237 +#: ../../library/gzip.rst:243 msgid "Module :mod:`zlib`" msgstr ":mod:`zlib` 模組" -#: ../../library/gzip.rst:237 +#: ../../library/gzip.rst:243 msgid "" "The basic data compression module needed to support the :program:`gzip` file " "format." msgstr "" -#: ../../library/gzip.rst:244 +#: ../../library/gzip.rst:250 msgid "Command Line Interface" msgstr "" -#: ../../library/gzip.rst:246 +#: ../../library/gzip.rst:252 msgid "" "The :mod:`gzip` module provides a simple command line interface to compress " "or decompress files." msgstr "" -#: ../../library/gzip.rst:249 +#: ../../library/gzip.rst:255 msgid "Once executed the :mod:`gzip` module keeps the input file(s)." msgstr "" -#: ../../library/gzip.rst:253 +#: ../../library/gzip.rst:259 msgid "" "Add a new command line interface with a usage. By default, when you will " "execute the CLI, the default compression level is 6." msgstr "" -#: ../../library/gzip.rst:257 +#: ../../library/gzip.rst:263 msgid "Command line options" msgstr "" -#: ../../library/gzip.rst:261 +#: ../../library/gzip.rst:267 msgid "If *file* is not specified, read from :attr:`sys.stdin`." msgstr "" -#: ../../library/gzip.rst:265 +#: ../../library/gzip.rst:271 msgid "Indicates the fastest compression method (less compression)." msgstr "" -#: ../../library/gzip.rst:269 +#: ../../library/gzip.rst:275 msgid "Indicates the slowest compression method (best compression)." msgstr "" -#: ../../library/gzip.rst:273 +#: ../../library/gzip.rst:279 msgid "Decompress the given file." msgstr "" -#: ../../library/gzip.rst:277 +#: ../../library/gzip.rst:283 msgid "Show the help message." msgstr "" diff --git a/library/inspect.po b/library/inspect.po index c9bfd85dfb..44e0457999 100644 --- a/library/inspect.po +++ b/library/inspect.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-28 00:17+0000\n" +"POT-Creation-Date: 2023-03-24 00:16+0000\n" "PO-Revision-Date: 2022-10-16 06:59+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -829,30 +829,32 @@ msgid "" "object. The source code is returned as a list of the lines corresponding to " "the object and the line number indicates where in the original source file " "the first line of code was found. An :exc:`OSError` is raised if the source " -"code cannot be retrieved." +"code cannot be retrieved. A :exc:`TypeError` is raised if the object is a " +"built-in module, class, or function." msgstr "" -#: ../../library/inspect.rst:557 ../../library/inspect.rst:569 +#: ../../library/inspect.rst:559 ../../library/inspect.rst:573 msgid "" ":exc:`OSError` is raised instead of :exc:`IOError`, now an alias of the " "former." msgstr "" -#: ../../library/inspect.rst:564 +#: ../../library/inspect.rst:566 msgid "" "Return the text of the source code for an object. The argument may be a " "module, class, method, function, traceback, frame, or code object. The " "source code is returned as a single string. An :exc:`OSError` is raised if " -"the source code cannot be retrieved." +"the source code cannot be retrieved. A :exc:`TypeError` is raised if the " +"object is a built-in module, class, or function." msgstr "" -#: ../../library/inspect.rst:576 +#: ../../library/inspect.rst:580 msgid "" "Clean up indentation from docstrings that are indented to line up with " "blocks of code." msgstr "" -#: ../../library/inspect.rst:579 +#: ../../library/inspect.rst:583 msgid "" "All leading whitespace is removed from the first line. Any leading " "whitespace that can be uniformly removed from the second line onwards is " @@ -860,28 +862,28 @@ msgid "" "Also, all tabs are expanded to spaces." msgstr "" -#: ../../library/inspect.rst:588 +#: ../../library/inspect.rst:592 msgid "Introspecting callables with the Signature object" msgstr "" -#: ../../library/inspect.rst:592 +#: ../../library/inspect.rst:596 msgid "" "The Signature object represents the call signature of a callable object and " "its return annotation. To retrieve a Signature object, use the :func:" "`signature` function." msgstr "" -#: ../../library/inspect.rst:598 +#: ../../library/inspect.rst:602 msgid "Return a :class:`Signature` object for the given ``callable``::" msgstr "" -#: ../../library/inspect.rst:615 +#: ../../library/inspect.rst:619 msgid "" "Accepts a wide range of Python callables, from plain functions and classes " "to :func:`functools.partial` objects." msgstr "" -#: ../../library/inspect.rst:618 +#: ../../library/inspect.rst:622 msgid "" "For objects defined in modules using stringized annotations (``from " "__future__ import annotations``), :func:`signature` will attempt to " @@ -892,7 +894,7 @@ msgid "" "instructions on how to use these parameters." msgstr "" -#: ../../library/inspect.rst:627 +#: ../../library/inspect.rst:631 msgid "" "Raises :exc:`ValueError` if no signature can be provided, and :exc:" "`TypeError` if that type of object is not supported. Also, if the " @@ -901,39 +903,39 @@ msgid "" "exception." msgstr "" -#: ../../library/inspect.rst:633 +#: ../../library/inspect.rst:637 msgid "" "A slash(/) in the signature of a function denotes that the parameters prior " "to it are positional-only. For more info, see :ref:`the FAQ entry on " "positional-only parameters `." msgstr "" -#: ../../library/inspect.rst:637 +#: ../../library/inspect.rst:641 msgid "" "``follow_wrapped`` parameter. Pass ``False`` to get a signature of " "``callable`` specifically (``callable.__wrapped__`` will not be used to " "unwrap decorated callables.)" msgstr "" -#: ../../library/inspect.rst:642 +#: ../../library/inspect.rst:646 msgid "``globals``, ``locals``, and ``eval_str`` parameters." msgstr "" -#: ../../library/inspect.rst:647 +#: ../../library/inspect.rst:651 msgid "" "Some callables may not be introspectable in certain implementations of " "Python. For example, in CPython, some built-in functions defined in C " "provide no metadata about their arguments." msgstr "" -#: ../../library/inspect.rst:654 +#: ../../library/inspect.rst:658 msgid "" "A Signature object represents the call signature of a function and its " "return annotation. For each parameter accepted by the function it stores a :" "class:`Parameter` object in its :attr:`parameters` collection." msgstr "" -#: ../../library/inspect.rst:658 +#: ../../library/inspect.rst:662 msgid "" "The optional *parameters* argument is a sequence of :class:`Parameter` " "objects, which is validated to check that there are no parameters with " @@ -942,54 +944,54 @@ msgid "" "defaults follow parameters without defaults." msgstr "" -#: ../../library/inspect.rst:664 +#: ../../library/inspect.rst:668 msgid "" "The optional *return_annotation* argument, can be an arbitrary Python " "object, is the \"return\" annotation of the callable." msgstr "" -#: ../../library/inspect.rst:667 +#: ../../library/inspect.rst:671 msgid "" "Signature objects are *immutable*. Use :meth:`Signature.replace` to make a " "modified copy." msgstr "" -#: ../../library/inspect.rst:670 +#: ../../library/inspect.rst:674 msgid "Signature objects are picklable and :term:`hashable`." msgstr "" -#: ../../library/inspect.rst:675 +#: ../../library/inspect.rst:679 msgid "A special class-level marker to specify absence of a return annotation." msgstr "" -#: ../../library/inspect.rst:679 +#: ../../library/inspect.rst:683 msgid "" "An ordered mapping of parameters' names to the corresponding :class:" "`Parameter` objects. Parameters appear in strict definition order, " "including keyword-only parameters." msgstr "" -#: ../../library/inspect.rst:683 ../../library/inspect.rst:1008 +#: ../../library/inspect.rst:687 ../../library/inspect.rst:1012 msgid "" "Python only explicitly guaranteed that it preserved the declaration order of " "keyword-only parameters as of version 3.7, although in practice this order " "had always been preserved in Python 3." msgstr "" -#: ../../library/inspect.rst:690 +#: ../../library/inspect.rst:694 msgid "" "The \"return\" annotation for the callable. If the callable has no " "\"return\" annotation, this attribute is set to :attr:`Signature.empty`." msgstr "" -#: ../../library/inspect.rst:695 +#: ../../library/inspect.rst:699 msgid "" "Create a mapping from positional and keyword arguments to parameters. " "Returns :class:`BoundArguments` if ``*args`` and ``**kwargs`` match the " "signature, or raises a :exc:`TypeError`." msgstr "" -#: ../../library/inspect.rst:701 +#: ../../library/inspect.rst:705 msgid "" "Works the same way as :meth:`Signature.bind`, but allows the omission of " "some required arguments (mimics :func:`functools.partial` behavior.) " @@ -997,7 +999,7 @@ msgid "" "arguments do not match the signature." msgstr "" -#: ../../library/inspect.rst:708 +#: ../../library/inspect.rst:712 msgid "" "Create a new Signature instance based on the instance replace was invoked " "on. It is possible to pass different ``parameters`` and/or " @@ -1006,7 +1008,7 @@ msgid "" "attr:`Signature.empty`." msgstr "" -#: ../../library/inspect.rst:725 +#: ../../library/inspect.rst:729 msgid "" "Return a :class:`Signature` (or its subclass) object for a given callable " "``obj``. Pass ``follow_wrapped=False`` to get a signature of ``obj`` " @@ -1014,139 +1016,139 @@ msgid "" "will be used as the namespaces when resolving annotations." msgstr "" -#: ../../library/inspect.rst:730 +#: ../../library/inspect.rst:734 msgid "This method simplifies subclassing of :class:`Signature`::" msgstr "" -#: ../../library/inspect.rst:739 +#: ../../library/inspect.rst:743 msgid "``globalns`` and ``localns`` parameters." msgstr "" -#: ../../library/inspect.rst:745 +#: ../../library/inspect.rst:749 msgid "" "Parameter objects are *immutable*. Instead of modifying a Parameter object, " "you can use :meth:`Parameter.replace` to create a modified copy." msgstr "" -#: ../../library/inspect.rst:748 +#: ../../library/inspect.rst:752 msgid "Parameter objects are picklable and :term:`hashable`." msgstr "" -#: ../../library/inspect.rst:753 +#: ../../library/inspect.rst:757 msgid "" "A special class-level marker to specify absence of default values and " "annotations." msgstr "" -#: ../../library/inspect.rst:758 +#: ../../library/inspect.rst:762 msgid "" "The name of the parameter as a string. The name must be a valid Python " "identifier." msgstr "" -#: ../../library/inspect.rst:763 +#: ../../library/inspect.rst:767 msgid "" "CPython generates implicit parameter names of the form ``.0`` on the code " "objects used to implement comprehensions and generator expressions." msgstr "" -#: ../../library/inspect.rst:767 +#: ../../library/inspect.rst:771 msgid "" "These parameter names are exposed by this module as names like ``implicit0``." msgstr "" -#: ../../library/inspect.rst:773 +#: ../../library/inspect.rst:777 msgid "" "The default value for the parameter. If the parameter has no default value, " "this attribute is set to :attr:`Parameter.empty`." msgstr "" -#: ../../library/inspect.rst:778 +#: ../../library/inspect.rst:782 msgid "" "The annotation for the parameter. If the parameter has no annotation, this " "attribute is set to :attr:`Parameter.empty`." msgstr "" -#: ../../library/inspect.rst:783 +#: ../../library/inspect.rst:787 msgid "" "Describes how argument values are bound to the parameter. The possible " "values are accessible via :class:`Parameter` (like ``Parameter." "KEYWORD_ONLY``), and support comparison and ordering, in the following order:" msgstr "" -#: ../../library/inspect.rst:790 +#: ../../library/inspect.rst:794 msgid "Name" msgstr "名稱" -#: ../../library/inspect.rst:790 +#: ../../library/inspect.rst:794 msgid "Meaning" msgstr "意義" -#: ../../library/inspect.rst:792 +#: ../../library/inspect.rst:796 msgid "*POSITIONAL_ONLY*" msgstr "*POSITIONAL_ONLY*" -#: ../../library/inspect.rst:792 +#: ../../library/inspect.rst:796 msgid "" "Value must be supplied as a positional argument. Positional only parameters " "are those which appear before a ``/`` entry (if present) in a Python " "function definition." msgstr "" -#: ../../library/inspect.rst:797 +#: ../../library/inspect.rst:801 msgid "*POSITIONAL_OR_KEYWORD*" msgstr "*POSITIONAL_OR_KEYWORD*" -#: ../../library/inspect.rst:797 +#: ../../library/inspect.rst:801 msgid "" "Value may be supplied as either a keyword or positional argument (this is " "the standard binding behaviour for functions implemented in Python.)" msgstr "" -#: ../../library/inspect.rst:802 +#: ../../library/inspect.rst:806 msgid "*VAR_POSITIONAL*" msgstr "*VAR_POSITIONAL*" -#: ../../library/inspect.rst:802 +#: ../../library/inspect.rst:806 msgid "" "A tuple of positional arguments that aren't bound to any other parameter. " "This corresponds to a ``*args`` parameter in a Python function definition." msgstr "" -#: ../../library/inspect.rst:807 +#: ../../library/inspect.rst:811 msgid "*KEYWORD_ONLY*" msgstr "*KEYWORD_ONLY*" -#: ../../library/inspect.rst:807 +#: ../../library/inspect.rst:811 msgid "" "Value must be supplied as a keyword argument. Keyword only parameters are " "those which appear after a ``*`` or ``*args`` entry in a Python function " "definition." msgstr "" -#: ../../library/inspect.rst:812 +#: ../../library/inspect.rst:816 msgid "*VAR_KEYWORD*" msgstr "*VAR_KEYWORD*" -#: ../../library/inspect.rst:812 +#: ../../library/inspect.rst:816 msgid "" "A dict of keyword arguments that aren't bound to any other parameter. This " "corresponds to a ``**kwargs`` parameter in a Python function definition." msgstr "" -#: ../../library/inspect.rst:818 +#: ../../library/inspect.rst:822 msgid "Example: print all keyword-only arguments without default values::" msgstr "" -#: ../../library/inspect.rst:832 +#: ../../library/inspect.rst:836 msgid "Describes a enum value of Parameter.kind." msgstr "" -#: ../../library/inspect.rst:836 +#: ../../library/inspect.rst:840 msgid "Example: print all descriptions of arguments::" msgstr "" -#: ../../library/inspect.rst:851 +#: ../../library/inspect.rst:855 msgid "" "Create a new Parameter instance based on the instance replaced was invoked " "on. To override a :class:`Parameter` attribute, pass the corresponding " @@ -1154,94 +1156,94 @@ msgid "" "pass :attr:`Parameter.empty`." msgstr "" -#: ../../library/inspect.rst:869 +#: ../../library/inspect.rst:873 msgid "" "In Python 3.3 Parameter objects were allowed to have ``name`` set to " "``None`` if their ``kind`` was set to ``POSITIONAL_ONLY``. This is no longer " "permitted." msgstr "" -#: ../../library/inspect.rst:876 +#: ../../library/inspect.rst:880 msgid "" "Result of a :meth:`Signature.bind` or :meth:`Signature.bind_partial` call. " "Holds the mapping of arguments to the function's parameters." msgstr "" -#: ../../library/inspect.rst:881 +#: ../../library/inspect.rst:885 msgid "" "A mutable mapping of parameters' names to arguments' values. Contains only " "explicitly bound arguments. Changes in :attr:`arguments` will reflect in :" "attr:`args` and :attr:`kwargs`." msgstr "" -#: ../../library/inspect.rst:885 +#: ../../library/inspect.rst:889 msgid "" "Should be used in conjunction with :attr:`Signature.parameters` for any " "argument processing purposes." msgstr "" -#: ../../library/inspect.rst:890 +#: ../../library/inspect.rst:894 msgid "" "Arguments for which :meth:`Signature.bind` or :meth:`Signature.bind_partial` " "relied on a default value are skipped. However, if needed, use :meth:" "`BoundArguments.apply_defaults` to add them." msgstr "" -#: ../../library/inspect.rst:895 +#: ../../library/inspect.rst:899 msgid "" ":attr:`arguments` is now of type :class:`dict`. Formerly, it was of type :" "class:`collections.OrderedDict`." msgstr "" -#: ../../library/inspect.rst:901 +#: ../../library/inspect.rst:905 msgid "" "A tuple of positional arguments values. Dynamically computed from the :attr:" "`arguments` attribute." msgstr "" -#: ../../library/inspect.rst:906 +#: ../../library/inspect.rst:910 msgid "" "A dict of keyword arguments values. Dynamically computed from the :attr:" "`arguments` attribute." msgstr "" -#: ../../library/inspect.rst:911 +#: ../../library/inspect.rst:915 msgid "A reference to the parent :class:`Signature` object." msgstr "" -#: ../../library/inspect.rst:915 +#: ../../library/inspect.rst:919 msgid "Set default values for missing arguments." msgstr "" -#: ../../library/inspect.rst:917 +#: ../../library/inspect.rst:921 msgid "" "For variable-positional arguments (``*args``) the default is an empty tuple." msgstr "" -#: ../../library/inspect.rst:920 +#: ../../library/inspect.rst:924 msgid "" "For variable-keyword arguments (``**kwargs``) the default is an empty dict." msgstr "" -#: ../../library/inspect.rst:933 +#: ../../library/inspect.rst:937 msgid "" "The :attr:`args` and :attr:`kwargs` properties can be used to invoke " "functions::" msgstr "" -#: ../../library/inspect.rst:946 +#: ../../library/inspect.rst:950 msgid ":pep:`362` - Function Signature Object." msgstr "" -#: ../../library/inspect.rst:947 +#: ../../library/inspect.rst:951 msgid "The detailed specification, implementation details and examples." msgstr "" -#: ../../library/inspect.rst:953 +#: ../../library/inspect.rst:957 msgid "Classes and functions" msgstr "" -#: ../../library/inspect.rst:957 +#: ../../library/inspect.rst:961 msgid "" "Arrange the given list of classes into a hierarchy of nested lists. Where a " "nested list appears, it contains classes derived from the class whose entry " @@ -1252,19 +1254,19 @@ msgid "" "will appear multiple times." msgstr "" -#: ../../library/inspect.rst:968 +#: ../../library/inspect.rst:972 msgid "" "Get the names and default values of a Python function's parameters. A :term:" "`named tuple` is returned:" msgstr "" -#: ../../library/inspect.rst:971 +#: ../../library/inspect.rst:975 msgid "" "``FullArgSpec(args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, " "annotations)``" msgstr "" -#: ../../library/inspect.rst:974 +#: ../../library/inspect.rst:978 msgid "" "*args* is a list of the positional parameter names. *varargs* is the name of " "the ``*`` parameter or ``None`` if arbitrary positional arguments are not " @@ -1279,7 +1281,7 @@ msgid "" "report the function return value annotation (if any)." msgstr "" -#: ../../library/inspect.rst:989 +#: ../../library/inspect.rst:993 msgid "" "Note that :func:`signature` and :ref:`Signature Object ` provide the recommended API for callable introspection, and support " @@ -1289,14 +1291,14 @@ msgid "" "``inspect`` module API." msgstr "" -#: ../../library/inspect.rst:996 +#: ../../library/inspect.rst:1000 msgid "" "This function is now based on :func:`signature`, but still ignores " "``__wrapped__`` attributes and includes the already bound first parameter in " "the signature output for bound methods." msgstr "" -#: ../../library/inspect.rst:1001 +#: ../../library/inspect.rst:1005 msgid "" "This method was previously documented as deprecated in favour of :func:" "`signature` in Python 3.5, but that decision has been reversed in order to " @@ -1304,7 +1306,7 @@ msgid "" "code migrating away from the legacy :func:`getargspec` API." msgstr "" -#: ../../library/inspect.rst:1016 +#: ../../library/inspect.rst:1020 msgid "" "Get information about arguments passed into a particular frame. A :term:" "`named tuple` ``ArgInfo(args, varargs, keywords, locals)`` is returned. " @@ -1313,18 +1315,18 @@ msgid "" "dictionary of the given frame." msgstr "" -#: ../../library/inspect.rst:1023 ../../library/inspect.rst:1033 +#: ../../library/inspect.rst:1027 ../../library/inspect.rst:1037 msgid "This function was inadvertently marked as deprecated in Python 3.5." msgstr "" -#: ../../library/inspect.rst:1028 +#: ../../library/inspect.rst:1032 msgid "" "Format a pretty argument spec from the four values returned by :func:" "`getargvalues`. The format\\* arguments are the corresponding optional " "formatting functions that are called to turn names and values into strings." msgstr "" -#: ../../library/inspect.rst:1038 +#: ../../library/inspect.rst:1042 msgid "" "Return a tuple of class cls's base classes, including cls, in method " "resolution order. No class appears more than once in this tuple. Note that " @@ -1332,7 +1334,7 @@ msgid "" "user-defined metatype is in use, cls will be the first element of the tuple." msgstr "" -#: ../../library/inspect.rst:1046 +#: ../../library/inspect.rst:1050 msgid "" "Bind the *args* and *kwds* to the argument names of the Python function or " "method *func*, as if it was called with them. For bound methods, bind also " @@ -1345,11 +1347,11 @@ msgid "" "example::" msgstr "" -#: ../../library/inspect.rst:1069 +#: ../../library/inspect.rst:1073 msgid "Use :meth:`Signature.bind` and :meth:`Signature.bind_partial` instead." msgstr "" -#: ../../library/inspect.rst:1075 +#: ../../library/inspect.rst:1079 msgid "" "Get the mapping of external name references in a Python function or method " "*func* to their current values. A :term:`named tuple` " @@ -1361,18 +1363,18 @@ msgid "" "builtins." msgstr "" -#: ../../library/inspect.rst:1084 +#: ../../library/inspect.rst:1088 msgid "" ":exc:`TypeError` is raised if *func* is not a Python function or method." msgstr "" -#: ../../library/inspect.rst:1091 +#: ../../library/inspect.rst:1095 msgid "" "Get the object wrapped by *func*. It follows the chain of :attr:" "`__wrapped__` attributes returning the last object in the chain." msgstr "" -#: ../../library/inspect.rst:1094 +#: ../../library/inspect.rst:1098 msgid "" "*stop* is an optional callback accepting an object in the wrapper chain as " "its sole argument that allows the unwrapping to be terminated early if the " @@ -1382,68 +1384,68 @@ msgid "" "``__signature__`` attribute defined." msgstr "" -#: ../../library/inspect.rst:1101 +#: ../../library/inspect.rst:1105 msgid ":exc:`ValueError` is raised if a cycle is encountered." msgstr "" -#: ../../library/inspect.rst:1108 +#: ../../library/inspect.rst:1112 msgid "Compute the annotations dict for an object." msgstr "" -#: ../../library/inspect.rst:1110 +#: ../../library/inspect.rst:1114 msgid "" "``obj`` may be a callable, class, or module. Passing in an object of any " "other type raises :exc:`TypeError`." msgstr "" -#: ../../library/inspect.rst:1113 +#: ../../library/inspect.rst:1117 msgid "" "Returns a dict. ``get_annotations()`` returns a new dict every time it's " "called; calling it twice on the same object will return two different but " "equivalent dicts." msgstr "" -#: ../../library/inspect.rst:1117 +#: ../../library/inspect.rst:1121 msgid "This function handles several details for you:" msgstr "" -#: ../../library/inspect.rst:1119 +#: ../../library/inspect.rst:1123 msgid "" "If ``eval_str`` is true, values of type ``str`` will be un-stringized using :" "func:`eval()`. This is intended for use with stringized annotations (``from " "__future__ import annotations``)." msgstr "" -#: ../../library/inspect.rst:1123 +#: ../../library/inspect.rst:1127 msgid "" "If ``obj`` doesn't have an annotations dict, returns an empty dict. " "(Functions and methods always have an annotations dict; classes, modules, " "and other types of callables may not.)" msgstr "" -#: ../../library/inspect.rst:1127 +#: ../../library/inspect.rst:1131 msgid "" "Ignores inherited annotations on classes. If a class doesn't have its own " "annotations dict, returns an empty dict." msgstr "" -#: ../../library/inspect.rst:1129 +#: ../../library/inspect.rst:1133 msgid "" "All accesses to object members and dict values are done using ``getattr()`` " "and ``dict.get()`` for safety." msgstr "" -#: ../../library/inspect.rst:1131 +#: ../../library/inspect.rst:1135 msgid "Always, always, always returns a freshly created dict." msgstr "" -#: ../../library/inspect.rst:1133 +#: ../../library/inspect.rst:1137 msgid "" "``eval_str`` controls whether or not values of type ``str`` are replaced " "with the result of calling :func:`eval()` on those values:" msgstr "" -#: ../../library/inspect.rst:1136 +#: ../../library/inspect.rst:1140 msgid "" "If eval_str is true, :func:`eval()` is called on values of type ``str``. " "(Note that ``get_annotations`` doesn't catch exceptions; if :func:`eval()` " @@ -1451,12 +1453,12 @@ msgid "" "call.)" msgstr "" -#: ../../library/inspect.rst:1140 +#: ../../library/inspect.rst:1144 msgid "" "If eval_str is false (the default), values of type ``str`` are unchanged." msgstr "" -#: ../../library/inspect.rst:1142 +#: ../../library/inspect.rst:1146 msgid "" "``globals`` and ``locals`` are passed in to :func:`eval()`; see the " "documentation for :func:`eval()` for more information. If ``globals`` or " @@ -1464,35 +1466,35 @@ msgid "" "specific default, contingent on ``type(obj)``:" msgstr "" -#: ../../library/inspect.rst:1147 +#: ../../library/inspect.rst:1151 msgid "If ``obj`` is a module, ``globals`` defaults to ``obj.__dict__``." msgstr "" -#: ../../library/inspect.rst:1148 +#: ../../library/inspect.rst:1152 msgid "" "If ``obj`` is a class, ``globals`` defaults to ``sys.modules[obj.__module__]." "__dict__`` and ``locals`` defaults to the ``obj`` class namespace." msgstr "" -#: ../../library/inspect.rst:1151 +#: ../../library/inspect.rst:1155 msgid "" "If ``obj`` is a callable, ``globals`` defaults to ``obj.__globals__``, " "although if ``obj`` is a wrapped function (using ``functools." "update_wrapper()``) it is first unwrapped." msgstr "" -#: ../../library/inspect.rst:1155 +#: ../../library/inspect.rst:1159 msgid "" "Calling ``get_annotations`` is best practice for accessing the annotations " "dict of any object. See :ref:`annotations-howto` for more information on " "annotations best practices." msgstr "" -#: ../../library/inspect.rst:1165 +#: ../../library/inspect.rst:1169 msgid "The interpreter stack" msgstr "" -#: ../../library/inspect.rst:1167 +#: ../../library/inspect.rst:1171 msgid "" "Some of the following functions return :class:`FrameInfo` objects. For " "backwards compatibility these objects allow tuple-like operations on all " @@ -1500,95 +1502,95 @@ msgid "" "may be removed in the future." msgstr "" -#: ../../library/inspect.rst:1176 +#: ../../library/inspect.rst:1180 msgid "The :ref:`frame object ` that the record corresponds to." msgstr "" -#: ../../library/inspect.rst:1180 +#: ../../library/inspect.rst:1184 msgid "" "The file name associated with the code being executed by the frame this " "record corresponds to." msgstr "" -#: ../../library/inspect.rst:1185 +#: ../../library/inspect.rst:1189 msgid "" "The line number of the current line associated with the code being executed " "by the frame this record corresponds to." msgstr "" -#: ../../library/inspect.rst:1190 +#: ../../library/inspect.rst:1194 msgid "" "The function name that is being executed by the frame this record " "corresponds to." msgstr "" -#: ../../library/inspect.rst:1194 +#: ../../library/inspect.rst:1198 msgid "" "A list of lines of context from the source code that's being executed by the " "frame this record corresponds to." msgstr "" -#: ../../library/inspect.rst:1199 ../../library/inspect.rst:1238 +#: ../../library/inspect.rst:1203 ../../library/inspect.rst:1242 msgid "" "The index of the current line being executed in the :attr:`code_context` " "list." msgstr "" -#: ../../library/inspect.rst:1203 +#: ../../library/inspect.rst:1207 msgid "" "A :class:`dis.Positions` object containing the start line number, end line " "number, start column offset, and end column offset associated with the " "instruction being executed by the frame this record corresponds to." msgstr "" -#: ../../library/inspect.rst:1207 +#: ../../library/inspect.rst:1211 msgid "Return a :term:`named tuple` instead of a :class:`tuple`." msgstr "" -#: ../../library/inspect.rst:1210 +#: ../../library/inspect.rst:1214 msgid "" ":class:`!FrameInfo` is now a class instance (that is backwards compatible " "with the previous :term:`named tuple`)." msgstr "" -#: ../../library/inspect.rst:1219 +#: ../../library/inspect.rst:1223 msgid "" "The file name associated with the code being executed by the frame this " "traceback corresponds to." msgstr "" -#: ../../library/inspect.rst:1224 +#: ../../library/inspect.rst:1228 msgid "" "The line number of the current line associated with the code being executed " "by the frame this traceback corresponds to." msgstr "" -#: ../../library/inspect.rst:1229 +#: ../../library/inspect.rst:1233 msgid "" "The function name that is being executed by the frame this traceback " "corresponds to." msgstr "" -#: ../../library/inspect.rst:1233 +#: ../../library/inspect.rst:1237 msgid "" "A list of lines of context from the source code that's being executed by the " "frame this traceback corresponds to." msgstr "" -#: ../../library/inspect.rst:1242 +#: ../../library/inspect.rst:1246 msgid "" "A :class:`dis.Positions` object containing the start line number, end line " "number, start column offset, and end column offset associated with the " "instruction being executed by the frame this traceback corresponds to." msgstr "" -#: ../../library/inspect.rst:1247 +#: ../../library/inspect.rst:1251 msgid "" ":class:`!Traceback` is now a class instance (that is backwards compatible " "with the previous :term:`named tuple`)." msgstr "" -#: ../../library/inspect.rst:1254 +#: ../../library/inspect.rst:1258 msgid "" "Keeping references to frame objects, as found in the first element of the " "frame records these functions return, can cause your program to create " @@ -1600,7 +1602,7 @@ msgid "" "consumption which occurs." msgstr "" -#: ../../library/inspect.rst:1262 +#: ../../library/inspect.rst:1266 msgid "" "Though the cycle detector will catch these, destruction of the frames (and " "local variables) can be made deterministic by removing the cycle in a :" @@ -1608,31 +1610,31 @@ msgid "" "disabled when Python was compiled or using :func:`gc.disable`. For example::" msgstr "" -#: ../../library/inspect.rst:1274 +#: ../../library/inspect.rst:1278 msgid "" "If you want to keep the frame around (for example to print a traceback " "later), you can also break reference cycles by using the :meth:`frame.clear` " "method." msgstr "" -#: ../../library/inspect.rst:1278 +#: ../../library/inspect.rst:1282 msgid "" "The optional *context* argument supported by most of these functions " "specifies the number of lines of context to return, which are centered " "around the current line." msgstr "" -#: ../../library/inspect.rst:1285 +#: ../../library/inspect.rst:1289 msgid "" "Get information about a frame or traceback object. A :class:`Traceback` " "object is returned." msgstr "" -#: ../../library/inspect.rst:1288 +#: ../../library/inspect.rst:1292 msgid "A :class:`Traceback` object is returned instead of a named tuple." msgstr "" -#: ../../library/inspect.rst:1293 +#: ../../library/inspect.rst:1297 msgid "" "Get a list of :class:`FrameInfo` objects for a frame and all outer frames. " "These frames represent the calls that lead to the creation of *frame*. The " @@ -1640,19 +1642,19 @@ msgid "" "represents the outermost call on *frame*'s stack." msgstr "" -#: ../../library/inspect.rst:1298 ../../library/inspect.rst:1313 -#: ../../library/inspect.rst:1339 ../../library/inspect.rst:1354 +#: ../../library/inspect.rst:1302 ../../library/inspect.rst:1317 +#: ../../library/inspect.rst:1343 ../../library/inspect.rst:1358 msgid "" "A list of :term:`named tuples ` ``FrameInfo(frame, filename, " "lineno, function, code_context, index)`` is returned." msgstr "" -#: ../../library/inspect.rst:1303 ../../library/inspect.rst:1318 -#: ../../library/inspect.rst:1344 ../../library/inspect.rst:1359 +#: ../../library/inspect.rst:1307 ../../library/inspect.rst:1322 +#: ../../library/inspect.rst:1348 ../../library/inspect.rst:1363 msgid "A list of :class:`FrameInfo` objects is returned." msgstr "" -#: ../../library/inspect.rst:1308 +#: ../../library/inspect.rst:1312 msgid "" "Get a list of :class:`FrameInfo` objects for a traceback's frame and all " "inner frames. These frames represent calls made as a consequence of " @@ -1660,11 +1662,11 @@ msgid "" "represents where the exception was raised." msgstr "" -#: ../../library/inspect.rst:1323 +#: ../../library/inspect.rst:1327 msgid "Return the frame object for the caller's stack frame." msgstr "" -#: ../../library/inspect.rst:1327 +#: ../../library/inspect.rst:1331 msgid "" "This function relies on Python stack frame support in the interpreter, which " "isn't guaranteed to exist in all implementations of Python. If running in " @@ -1672,14 +1674,14 @@ msgid "" "``None``." msgstr "" -#: ../../library/inspect.rst:1335 +#: ../../library/inspect.rst:1339 msgid "" "Return a list of :class:`FrameInfo` objects for the caller's stack. The " "first entry in the returned list represents the caller; the last entry " "represents the outermost call on the stack." msgstr "" -#: ../../library/inspect.rst:1349 +#: ../../library/inspect.rst:1353 msgid "" "Return a list of :class:`FrameInfo` objects for the stack between the " "current frame and the frame in which an exception currently being handled " @@ -1687,11 +1689,11 @@ msgid "" "entry represents where the exception was raised." msgstr "" -#: ../../library/inspect.rst:1363 +#: ../../library/inspect.rst:1367 msgid "Fetching attributes statically" msgstr "" -#: ../../library/inspect.rst:1365 +#: ../../library/inspect.rst:1369 msgid "" "Both :func:`getattr` and :func:`hasattr` can trigger code execution when " "fetching or checking for the existence of attributes. Descriptors, like " @@ -1699,20 +1701,20 @@ msgid "" "`__getattribute__` may be called." msgstr "" -#: ../../library/inspect.rst:1370 +#: ../../library/inspect.rst:1374 msgid "" "For cases where you want passive introspection, like documentation tools, " "this can be inconvenient. :func:`getattr_static` has the same signature as :" "func:`getattr` but avoids executing code when it fetches attributes." msgstr "" -#: ../../library/inspect.rst:1376 +#: ../../library/inspect.rst:1380 msgid "" "Retrieve attributes without triggering dynamic lookup via the descriptor " "protocol, :meth:`__getattr__` or :meth:`__getattribute__`." msgstr "" -#: ../../library/inspect.rst:1379 +#: ../../library/inspect.rst:1383 msgid "" "Note: this function may not be able to retrieve all attributes that getattr " "can fetch (like dynamically created attributes) and may find attributes that " @@ -1720,31 +1722,31 @@ msgid "" "return descriptors objects instead of instance members." msgstr "" -#: ../../library/inspect.rst:1385 +#: ../../library/inspect.rst:1389 msgid "" "If the instance :attr:`~object.__dict__` is shadowed by another member (for " "example a property) then this function will be unable to find instance " "members." msgstr "" -#: ../../library/inspect.rst:1391 +#: ../../library/inspect.rst:1395 msgid "" ":func:`getattr_static` does not resolve descriptors, for example slot " "descriptors or getset descriptors on objects implemented in C. The " "descriptor object is returned instead of the underlying attribute." msgstr "" -#: ../../library/inspect.rst:1395 +#: ../../library/inspect.rst:1399 msgid "" "You can handle these with code like the following. Note that for arbitrary " "getset descriptors invoking these may trigger code execution::" msgstr "" -#: ../../library/inspect.rst:1421 +#: ../../library/inspect.rst:1425 msgid "Current State of Generators and Coroutines" msgstr "" -#: ../../library/inspect.rst:1423 +#: ../../library/inspect.rst:1427 msgid "" "When implementing coroutine schedulers and for other advanced uses of " "generators, it is useful to determine whether a generator is currently " @@ -1753,31 +1755,31 @@ msgid "" "generator to be determined easily." msgstr "" -#: ../../library/inspect.rst:1431 +#: ../../library/inspect.rst:1435 msgid "Get current state of a generator-iterator." msgstr "" -#: ../../library/inspect.rst:1437 ../../library/inspect.rst:1452 +#: ../../library/inspect.rst:1441 ../../library/inspect.rst:1456 msgid "Possible states are:" msgstr "" -#: ../../library/inspect.rst:1434 +#: ../../library/inspect.rst:1438 msgid "GEN_CREATED: Waiting to start execution." msgstr "" -#: ../../library/inspect.rst:1435 +#: ../../library/inspect.rst:1439 msgid "GEN_RUNNING: Currently being executed by the interpreter." msgstr "" -#: ../../library/inspect.rst:1436 +#: ../../library/inspect.rst:1440 msgid "GEN_SUSPENDED: Currently suspended at a yield expression." msgstr "" -#: ../../library/inspect.rst:1437 +#: ../../library/inspect.rst:1441 msgid "GEN_CLOSED: Execution has completed." msgstr "" -#: ../../library/inspect.rst:1443 +#: ../../library/inspect.rst:1447 msgid "" "Get current state of a coroutine object. The function is intended to be " "used with coroutine objects created by :keyword:`async def` functions, but " @@ -1785,30 +1787,30 @@ msgid "" "``cr_frame`` attributes." msgstr "" -#: ../../library/inspect.rst:1449 +#: ../../library/inspect.rst:1453 msgid "CORO_CREATED: Waiting to start execution." msgstr "" -#: ../../library/inspect.rst:1450 +#: ../../library/inspect.rst:1454 msgid "CORO_RUNNING: Currently being executed by the interpreter." msgstr "" -#: ../../library/inspect.rst:1451 +#: ../../library/inspect.rst:1455 msgid "CORO_SUSPENDED: Currently suspended at an await expression." msgstr "" -#: ../../library/inspect.rst:1452 +#: ../../library/inspect.rst:1456 msgid "CORO_CLOSED: Execution has completed." msgstr "" -#: ../../library/inspect.rst:1456 +#: ../../library/inspect.rst:1460 msgid "" "The current internal state of the generator can also be queried. This is " "mostly useful for testing purposes, to ensure that internal state is being " "updated as expected:" msgstr "" -#: ../../library/inspect.rst:1462 +#: ../../library/inspect.rst:1466 msgid "" "Get the mapping of live local variables in *generator* to their current " "values. A dictionary is returned that maps from variable names to values. " @@ -1816,14 +1818,14 @@ msgid "" "generator, and all the same caveats apply." msgstr "" -#: ../../library/inspect.rst:1467 +#: ../../library/inspect.rst:1471 msgid "" "If *generator* is a :term:`generator` with no currently associated frame, " "then an empty dictionary is returned. :exc:`TypeError` is raised if " "*generator* is not a Python generator object." msgstr "" -#: ../../library/inspect.rst:1473 +#: ../../library/inspect.rst:1477 msgid "" "This function relies on the generator exposing a Python stack frame for " "introspection, which isn't guaranteed to be the case in all implementations " @@ -1831,72 +1833,72 @@ msgid "" "dictionary." msgstr "" -#: ../../library/inspect.rst:1482 +#: ../../library/inspect.rst:1486 msgid "" "This function is analogous to :func:`~inspect.getgeneratorlocals`, but works " "for coroutine objects created by :keyword:`async def` functions." msgstr "" -#: ../../library/inspect.rst:1491 +#: ../../library/inspect.rst:1495 msgid "Code Objects Bit Flags" msgstr "" -#: ../../library/inspect.rst:1493 +#: ../../library/inspect.rst:1497 msgid "" "Python code objects have a ``co_flags`` attribute, which is a bitmap of the " "following flags:" msgstr "" -#: ../../library/inspect.rst:1498 +#: ../../library/inspect.rst:1502 msgid "The code object is optimized, using fast locals." msgstr "" -#: ../../library/inspect.rst:1502 +#: ../../library/inspect.rst:1506 msgid "" "If set, a new dict will be created for the frame's ``f_locals`` when the " "code object is executed." msgstr "" -#: ../../library/inspect.rst:1507 +#: ../../library/inspect.rst:1511 msgid "The code object has a variable positional parameter (``*args``-like)." msgstr "" -#: ../../library/inspect.rst:1511 +#: ../../library/inspect.rst:1515 msgid "The code object has a variable keyword parameter (``**kwargs``-like)." msgstr "" -#: ../../library/inspect.rst:1515 +#: ../../library/inspect.rst:1519 msgid "The flag is set when the code object is a nested function." msgstr "" -#: ../../library/inspect.rst:1519 +#: ../../library/inspect.rst:1523 msgid "" "The flag is set when the code object is a generator function, i.e. a " "generator object is returned when the code object is executed." msgstr "" -#: ../../library/inspect.rst:1524 +#: ../../library/inspect.rst:1528 msgid "" "The flag is set when the code object is a coroutine function. When the code " "object is executed it returns a coroutine object. See :pep:`492` for more " "details." msgstr "" -#: ../../library/inspect.rst:1532 +#: ../../library/inspect.rst:1536 msgid "" "The flag is used to transform generators into generator-based coroutines. " "Generator objects with this flag can be used in ``await`` expression, and " "can ``yield from`` coroutine objects. See :pep:`492` for more details." msgstr "" -#: ../../library/inspect.rst:1541 +#: ../../library/inspect.rst:1545 msgid "" "The flag is set when the code object is an asynchronous generator function. " "When the code object is executed it returns an asynchronous generator " "object. See :pep:`525` for more details." msgstr "" -#: ../../library/inspect.rst:1548 +#: ../../library/inspect.rst:1552 msgid "" "The flags are specific to CPython, and may not be defined in other Python " "implementations. Furthermore, the flags are an implementation detail, and " @@ -1904,24 +1906,24 @@ msgid "" "use public APIs from the :mod:`inspect` module for any introspection needs." msgstr "" -#: ../../library/inspect.rst:1558 +#: ../../library/inspect.rst:1562 msgid "Command Line Interface" msgstr "" -#: ../../library/inspect.rst:1560 +#: ../../library/inspect.rst:1564 msgid "" "The :mod:`inspect` module also provides a basic introspection capability " "from the command line." msgstr "" -#: ../../library/inspect.rst:1565 +#: ../../library/inspect.rst:1569 msgid "" "By default, accepts the name of a module and prints the source of that " "module. A class or function within the module can be printed instead by " "appended a colon and the qualified name of the target object." msgstr "" -#: ../../library/inspect.rst:1571 +#: ../../library/inspect.rst:1575 msgid "" "Print information about the specified object rather than the source code" msgstr "" diff --git a/library/logging.po b/library/logging.po index 445bd5e5d5..dc0e3f9366 100644 --- a/library/logging.po +++ b/library/logging.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-03-25 00:15+0000\n" "PO-Revision-Date: 2018-05-23 16:05+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -268,7 +268,7 @@ msgid "" "information." msgstr "" -#: ../../library/logging.rst:189 ../../library/logging.rst:1066 +#: ../../library/logging.rst:189 ../../library/logging.rst:1067 msgid "" "The second optional keyword argument is *stack_info*, which defaults to " "``False``. If true, stack information is added to the logging message, " @@ -280,14 +280,14 @@ msgid "" "handlers." msgstr "" -#: ../../library/logging.rst:198 ../../library/logging.rst:1075 +#: ../../library/logging.rst:198 ../../library/logging.rst:1076 msgid "" "You can specify *stack_info* independently of *exc_info*, e.g. to just show " "how you got to a certain point in your code, even when no exceptions were " "raised. The stack frames are printed following a header line which says:" msgstr "" -#: ../../library/logging.rst:206 ../../library/logging.rst:1083 +#: ../../library/logging.rst:206 ../../library/logging.rst:1084 msgid "" "This mimics the ``Traceback (most recent call last):`` which is used when " "displaying exception frames." @@ -336,7 +336,7 @@ msgid "" "dictionary with these keys." msgstr "" -#: ../../library/logging.rst:246 ../../library/logging.rst:1114 +#: ../../library/logging.rst:246 ../../library/logging.rst:1115 msgid "" "While this might be annoying, this feature is intended for use in " "specialized circumstances, such as multi-threaded servers where the same " @@ -354,7 +354,7 @@ msgid "" "will be sent to the handler set on :attr:`lastResort`." msgstr "" -#: ../../library/logging.rst:257 ../../library/logging.rst:1125 +#: ../../library/logging.rst:257 ../../library/logging.rst:1126 msgid "The *stack_info* parameter was added." msgstr "新增 *stack_info* 參數。" @@ -1001,33 +1001,34 @@ msgstr "" #: ../../library/logging.rst:798 msgid "" "The event description message, which can be a %-format string with " -"placeholders for variable data." +"placeholders for variable data, or an arbitrary object (see :ref:`arbitrary-" +"object-messages`)." msgstr "" -#: ../../library/logging.rst:802 +#: ../../library/logging.rst:803 msgid "" "Variable data to merge into the *msg* argument to obtain the event " "description." msgstr "" -#: ../../library/logging.rst:806 +#: ../../library/logging.rst:807 msgid "" "An exception tuple with the current exception information, as returned by :" "func:`sys.exc_info`, or ``None`` if no exception information is available." msgstr "" -#: ../../library/logging.rst:811 +#: ../../library/logging.rst:812 msgid "" "The name of the function or method from which the logging call was invoked." msgstr "" -#: ../../library/logging.rst:815 +#: ../../library/logging.rst:816 msgid "" "A text string representing stack information from the base of the stack in " "the current thread, up to the logging call." msgstr "" -#: ../../library/logging.rst:822 +#: ../../library/logging.rst:823 msgid "" "Returns the message for this :class:`LogRecord` instance after merging any " "user-supplied arguments with the message. If the user-supplied message " @@ -1036,7 +1037,7 @@ msgid "" "whose ``__str__`` method can return the actual format string to be used." msgstr "" -#: ../../library/logging.rst:829 +#: ../../library/logging.rst:830 msgid "" "The creation of a :class:`LogRecord` has been made more configurable by " "providing a factory which is used to create the record. The factory can be " @@ -1044,24 +1045,24 @@ msgid "" "this for the factory's signature)." msgstr "" -#: ../../library/logging.rst:835 +#: ../../library/logging.rst:836 msgid "" "This functionality can be used to inject your own values into a :class:" "`LogRecord` at creation time. You can use the following pattern::" msgstr "" -#: ../../library/logging.rst:847 +#: ../../library/logging.rst:848 msgid "" "With this pattern, multiple factories could be chained, and as long as they " "don't overwrite each other's attributes or unintentionally overwrite the " "standard attributes listed above, there should be no surprises." msgstr "" -#: ../../library/logging.rst:856 +#: ../../library/logging.rst:857 msgid "LogRecord attributes" msgstr "" -#: ../../library/logging.rst:858 +#: ../../library/logging.rst:859 msgid "" "The LogRecord has a number of attributes, most of which are derived from the " "parameters to the constructor. (Note that the names do not always correspond " @@ -1072,7 +1073,7 @@ msgid "" "style format string." msgstr "" -#: ../../library/logging.rst:866 +#: ../../library/logging.rst:867 msgid "" "If you are using {}-formatting (:func:`str.format`), you can use ``{attrname}" "`` as the placeholder in the format string. If you are using $-formatting (:" @@ -1080,7 +1081,7 @@ msgid "" "course, replace ``attrname`` with the actual attribute name you want to use." msgstr "" -#: ../../library/logging.rst:872 +#: ../../library/logging.rst:873 msgid "" "In the case of {}-formatting, you can specify formatting flags by placing " "them after the attribute name, separated from it with a colon. For example: " @@ -1089,308 +1090,308 @@ msgid "" "on the options available to you." msgstr "" -#: ../../library/logging.rst:879 +#: ../../library/logging.rst:880 msgid "Attribute name" msgstr "" -#: ../../library/logging.rst:879 ../../library/logging.rst:1270 +#: ../../library/logging.rst:880 ../../library/logging.rst:1271 msgid "Format" msgstr "格式" -#: ../../library/logging.rst:879 ../../library/logging.rst:1270 +#: ../../library/logging.rst:880 ../../library/logging.rst:1271 msgid "Description" msgstr "描述" -#: ../../library/logging.rst:0 ../../library/logging.rst:881 +#: ../../library/logging.rst:0 ../../library/logging.rst:882 msgid "args" msgstr "" -#: ../../library/logging.rst:881 ../../library/logging.rst:895 -#: ../../library/logging.rst:923 ../../library/logging.rst:941 +#: ../../library/logging.rst:882 ../../library/logging.rst:896 +#: ../../library/logging.rst:924 ../../library/logging.rst:942 msgid "You shouldn't need to format this yourself." msgstr "" -#: ../../library/logging.rst:881 +#: ../../library/logging.rst:882 msgid "" "The tuple of arguments merged into ``msg`` to produce ``message``, or a dict " "whose values are used for the merge (when there is only one argument, and it " "is a dictionary)." msgstr "" -#: ../../library/logging.rst:886 +#: ../../library/logging.rst:887 msgid "asctime" msgstr "" -#: ../../library/logging.rst:886 +#: ../../library/logging.rst:887 msgid "``%(asctime)s``" msgstr "``%(asctime)s``" -#: ../../library/logging.rst:886 +#: ../../library/logging.rst:887 msgid "" "Human-readable time when the :class:`LogRecord` was created. By default " "this is of the form '2003-07-08 16:49:45,896' (the numbers after the comma " "are millisecond portion of the time)." msgstr "" -#: ../../library/logging.rst:892 +#: ../../library/logging.rst:893 msgid "created" msgstr "" -#: ../../library/logging.rst:892 +#: ../../library/logging.rst:893 msgid "``%(created)f``" msgstr "``%(created)f``" -#: ../../library/logging.rst:892 +#: ../../library/logging.rst:893 msgid "" "Time when the :class:`LogRecord` was created (as returned by :func:`time." "time`)." msgstr "" -#: ../../library/logging.rst:0 ../../library/logging.rst:895 +#: ../../library/logging.rst:0 ../../library/logging.rst:896 msgid "exc_info" msgstr "exc_info" -#: ../../library/logging.rst:895 +#: ../../library/logging.rst:896 msgid "" "Exception tuple (à la ``sys.exc_info``) or, if no exception has occurred, " "``None``." msgstr "" -#: ../../library/logging.rst:898 +#: ../../library/logging.rst:899 msgid "filename" msgstr "" -#: ../../library/logging.rst:898 +#: ../../library/logging.rst:899 msgid "``%(filename)s``" msgstr "``%(filename)s``" -#: ../../library/logging.rst:898 +#: ../../library/logging.rst:899 msgid "Filename portion of ``pathname``." msgstr "" -#: ../../library/logging.rst:900 +#: ../../library/logging.rst:901 msgid "funcName" msgstr "" -#: ../../library/logging.rst:900 +#: ../../library/logging.rst:901 msgid "``%(funcName)s``" msgstr "``%(funcName)s``" -#: ../../library/logging.rst:900 +#: ../../library/logging.rst:901 msgid "Name of function containing the logging call." msgstr "" -#: ../../library/logging.rst:902 +#: ../../library/logging.rst:903 msgid "levelname" msgstr "" -#: ../../library/logging.rst:902 +#: ../../library/logging.rst:903 msgid "``%(levelname)s``" msgstr "``%(levelname)s``" -#: ../../library/logging.rst:902 +#: ../../library/logging.rst:903 msgid "" "Text logging level for the message (``'DEBUG'``, ``'INFO'``, ``'WARNING'``, " "``'ERROR'``, ``'CRITICAL'``)." msgstr "" -#: ../../library/logging.rst:906 +#: ../../library/logging.rst:907 msgid "levelno" msgstr "" -#: ../../library/logging.rst:906 +#: ../../library/logging.rst:907 msgid "``%(levelno)s``" msgstr "``%(levelno)s``" -#: ../../library/logging.rst:906 +#: ../../library/logging.rst:907 msgid "" "Numeric logging level for the message (:const:`DEBUG`, :const:`INFO`, :const:" "`WARNING`, :const:`ERROR`, :const:`CRITICAL`)." msgstr "" -#: ../../library/logging.rst:911 +#: ../../library/logging.rst:912 msgid "lineno" msgstr "" -#: ../../library/logging.rst:911 +#: ../../library/logging.rst:912 msgid "``%(lineno)d``" msgstr "``%(lineno)d``" -#: ../../library/logging.rst:911 +#: ../../library/logging.rst:912 msgid "Source line number where the logging call was issued (if available)." msgstr "" -#: ../../library/logging.rst:914 +#: ../../library/logging.rst:915 msgid "message" msgstr "" -#: ../../library/logging.rst:914 +#: ../../library/logging.rst:915 msgid "``%(message)s``" msgstr "``%(message)s``" -#: ../../library/logging.rst:914 +#: ../../library/logging.rst:915 msgid "" "The logged message, computed as ``msg % args``. This is set when :meth:" "`Formatter.format` is invoked." msgstr "" -#: ../../library/logging.rst:918 +#: ../../library/logging.rst:919 msgid "module" msgstr "模組" -#: ../../library/logging.rst:918 +#: ../../library/logging.rst:919 msgid "``%(module)s``" msgstr "``%(module)s``" -#: ../../library/logging.rst:918 +#: ../../library/logging.rst:919 msgid "Module (name portion of ``filename``)." msgstr "" -#: ../../library/logging.rst:920 +#: ../../library/logging.rst:921 msgid "msecs" msgstr "" -#: ../../library/logging.rst:920 +#: ../../library/logging.rst:921 msgid "``%(msecs)d``" msgstr "``%(msecs)d``" -#: ../../library/logging.rst:920 +#: ../../library/logging.rst:921 msgid "" "Millisecond portion of the time when the :class:`LogRecord` was created." msgstr "" -#: ../../library/logging.rst:0 ../../library/logging.rst:923 +#: ../../library/logging.rst:0 ../../library/logging.rst:924 msgid "msg" msgstr "" -#: ../../library/logging.rst:923 +#: ../../library/logging.rst:924 msgid "" "The format string passed in the original logging call. Merged with ``args`` " "to produce ``message``, or an arbitrary object (see :ref:`arbitrary-object-" "messages`)." msgstr "" -#: ../../library/logging.rst:0 ../../library/logging.rst:928 +#: ../../library/logging.rst:0 ../../library/logging.rst:929 msgid "name" msgstr "" -#: ../../library/logging.rst:928 +#: ../../library/logging.rst:929 msgid "``%(name)s``" msgstr "``%(name)s``" -#: ../../library/logging.rst:928 +#: ../../library/logging.rst:929 msgid "Name of the logger used to log the call." msgstr "" -#: ../../library/logging.rst:930 +#: ../../library/logging.rst:931 msgid "pathname" msgstr "" -#: ../../library/logging.rst:930 +#: ../../library/logging.rst:931 msgid "``%(pathname)s``" msgstr "``%(pathname)s``" -#: ../../library/logging.rst:930 +#: ../../library/logging.rst:931 msgid "" "Full pathname of the source file where the logging call was issued (if " "available)." msgstr "" -#: ../../library/logging.rst:933 +#: ../../library/logging.rst:934 msgid "process" msgstr "" -#: ../../library/logging.rst:933 +#: ../../library/logging.rst:934 msgid "``%(process)d``" msgstr "``%(process)d``" -#: ../../library/logging.rst:933 +#: ../../library/logging.rst:934 msgid "Process ID (if available)." msgstr "" -#: ../../library/logging.rst:935 +#: ../../library/logging.rst:936 msgid "processName" msgstr "" -#: ../../library/logging.rst:935 +#: ../../library/logging.rst:936 msgid "``%(processName)s``" msgstr "``%(processName)s``" -#: ../../library/logging.rst:935 +#: ../../library/logging.rst:936 msgid "Process name (if available)." msgstr "" -#: ../../library/logging.rst:937 +#: ../../library/logging.rst:938 msgid "relativeCreated" msgstr "" -#: ../../library/logging.rst:937 +#: ../../library/logging.rst:938 msgid "``%(relativeCreated)d``" msgstr "``%(relativeCreated)d``" -#: ../../library/logging.rst:937 +#: ../../library/logging.rst:938 msgid "" "Time in milliseconds when the LogRecord was created, relative to the time " "the logging module was loaded." msgstr "" -#: ../../library/logging.rst:941 +#: ../../library/logging.rst:942 msgid "stack_info" msgstr "stack_info" -#: ../../library/logging.rst:941 +#: ../../library/logging.rst:942 msgid "" "Stack frame information (where available) from the bottom of the stack in " "the current thread, up to and including the stack frame of the logging call " "which resulted in the creation of this record." msgstr "" -#: ../../library/logging.rst:947 +#: ../../library/logging.rst:948 msgid "thread" msgstr "" -#: ../../library/logging.rst:947 +#: ../../library/logging.rst:948 msgid "``%(thread)d``" msgstr "``%(thread)d``" -#: ../../library/logging.rst:947 +#: ../../library/logging.rst:948 msgid "Thread ID (if available)." msgstr "" -#: ../../library/logging.rst:949 +#: ../../library/logging.rst:950 msgid "threadName" msgstr "" -#: ../../library/logging.rst:949 +#: ../../library/logging.rst:950 msgid "``%(threadName)s``" msgstr "``%(threadName)s``" -#: ../../library/logging.rst:949 +#: ../../library/logging.rst:950 msgid "Thread name (if available)." msgstr "" -#: ../../library/logging.rst:952 +#: ../../library/logging.rst:953 msgid "*processName* was added." msgstr "新增 *processName*\\ 。" -#: ../../library/logging.rst:959 +#: ../../library/logging.rst:960 msgid "LoggerAdapter Objects" msgstr "LoggerAdapter 物件" -#: ../../library/logging.rst:961 +#: ../../library/logging.rst:962 msgid "" ":class:`LoggerAdapter` instances are used to conveniently pass contextual " "information into logging calls. For a usage example, see the section on :ref:" "`adding contextual information to your logging output `." msgstr "" -#: ../../library/logging.rst:967 +#: ../../library/logging.rst:968 msgid "" "Returns an instance of :class:`LoggerAdapter` initialized with an " "underlying :class:`Logger` instance and a dict-like object." msgstr "" -#: ../../library/logging.rst:972 +#: ../../library/logging.rst:973 msgid "" "Modifies the message and/or keyword arguments passed to a logging call in " "order to insert contextual information. This implementation takes the object " @@ -1399,7 +1400,7 @@ msgid "" "(possibly modified) versions of the arguments passed in." msgstr "" -#: ../../library/logging.rst:978 +#: ../../library/logging.rst:979 msgid "" "In addition to the above, :class:`LoggerAdapter` supports the following " "methods of :class:`Logger`: :meth:`~Logger.debug`, :meth:`~Logger.info`, :" @@ -1411,24 +1412,24 @@ msgid "" "interchangeably." msgstr "" -#: ../../library/logging.rst:987 +#: ../../library/logging.rst:988 msgid "" "The :meth:`~Logger.isEnabledFor`, :meth:`~Logger.getEffectiveLevel`, :meth:" "`~Logger.setLevel` and :meth:`~Logger.hasHandlers` methods were added to :" "class:`LoggerAdapter`. These methods delegate to the underlying logger." msgstr "" -#: ../../library/logging.rst:992 +#: ../../library/logging.rst:993 msgid "" "Attribute :attr:`manager` and method :meth:`_log` were added, which delegate " "to the underlying logger and allow adapters to be nested." msgstr "" -#: ../../library/logging.rst:998 +#: ../../library/logging.rst:999 msgid "Thread Safety" msgstr "" -#: ../../library/logging.rst:1000 +#: ../../library/logging.rst:1001 msgid "" "The logging module is intended to be thread-safe without any special work " "needing to be done by its clients. It achieves this though using threading " @@ -1437,7 +1438,7 @@ msgid "" "O." msgstr "" -#: ../../library/logging.rst:1005 +#: ../../library/logging.rst:1006 msgid "" "If you are implementing asynchronous signal handlers using the :mod:`signal` " "module, you may not be able to use logging from within such handlers. This " @@ -1445,17 +1446,17 @@ msgid "" "always re-entrant, and so cannot be invoked from such signal handlers." msgstr "" -#: ../../library/logging.rst:1012 +#: ../../library/logging.rst:1013 msgid "Module-Level Functions" msgstr "" -#: ../../library/logging.rst:1014 +#: ../../library/logging.rst:1015 msgid "" "In addition to the classes described above, there are a number of module-" "level functions." msgstr "" -#: ../../library/logging.rst:1020 +#: ../../library/logging.rst:1021 msgid "" "Return a logger with the specified name or, if name is ``None``, return a " "logger which is the root logger of the hierarchy. If specified, the name is " @@ -1464,14 +1465,14 @@ msgid "" "logging." msgstr "" -#: ../../library/logging.rst:1025 +#: ../../library/logging.rst:1026 msgid "" "All calls to this function with a given name return the same logger " "instance. This means that logger instances never need to be passed between " "different parts of an application." msgstr "" -#: ../../library/logging.rst:1032 +#: ../../library/logging.rst:1033 msgid "" "Return either the standard :class:`Logger` class, or the last class passed " "to :func:`setLoggerClass`. This function may be called from within a new " @@ -1480,24 +1481,24 @@ msgid "" "example::" msgstr "" -#: ../../library/logging.rst:1043 +#: ../../library/logging.rst:1044 msgid "Return a callable which is used to create a :class:`LogRecord`." msgstr "" -#: ../../library/logging.rst:1045 +#: ../../library/logging.rst:1046 msgid "" "This function has been provided, along with :func:`setLogRecordFactory`, to " "allow developers more control over how the :class:`LogRecord` representing a " "logging event is constructed." msgstr "" -#: ../../library/logging.rst:1050 +#: ../../library/logging.rst:1051 msgid "" "See :func:`setLogRecordFactory` for more information about the how the " "factory is called." msgstr "" -#: ../../library/logging.rst:1055 +#: ../../library/logging.rst:1056 msgid "" "Logs a message with level :const:`DEBUG` on the root logger. The *msg* is " "the message format string, and the *args* are the arguments which are merged " @@ -1506,7 +1507,7 @@ msgid "" "argument.)" msgstr "" -#: ../../library/logging.rst:1060 +#: ../../library/logging.rst:1061 msgid "" "There are three keyword arguments in *kwargs* which are inspected: " "*exc_info* which, if it does not evaluate as false, causes exception " @@ -1516,7 +1517,7 @@ msgid "" "exception information." msgstr "" -#: ../../library/logging.rst:1086 +#: ../../library/logging.rst:1087 msgid "" "The third optional keyword argument is *extra* which can be used to pass a " "dictionary which is used to populate the __dict__ of the LogRecord created " @@ -1525,18 +1526,18 @@ msgid "" "logged messages. For example::" msgstr "" -#: ../../library/logging.rst:1097 +#: ../../library/logging.rst:1098 msgid "would print something like:" msgstr "" -#: ../../library/logging.rst:1103 +#: ../../library/logging.rst:1104 msgid "" "The keys in the dictionary passed in *extra* should not clash with the keys " "used by the logging system. (See the :class:`Formatter` documentation for " "more information on which keys are used by the logging system.)" msgstr "" -#: ../../library/logging.rst:1107 +#: ../../library/logging.rst:1108 msgid "" "If you choose to use these attributes in logged messages, you need to " "exercise some care. In the above example, for instance, the :class:" @@ -1547,58 +1548,58 @@ msgid "" "dictionary with these keys." msgstr "" -#: ../../library/logging.rst:1121 +#: ../../library/logging.rst:1122 msgid "" "This function (as well as :func:`info`, :func:`warning`, :func:`error` and :" "func:`critical`) will call :func:`basicConfig` if the root logger doesn't " "have any handler attached." msgstr "" -#: ../../library/logging.rst:1130 +#: ../../library/logging.rst:1131 msgid "" "Logs a message with level :const:`INFO` on the root logger. The arguments " "are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1136 +#: ../../library/logging.rst:1137 msgid "" "Logs a message with level :const:`WARNING` on the root logger. The arguments " "are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1139 +#: ../../library/logging.rst:1140 msgid "" "There is an obsolete function ``warn`` which is functionally identical to " "``warning``. As ``warn`` is deprecated, please do not use it - use " "``warning`` instead." msgstr "" -#: ../../library/logging.rst:1146 +#: ../../library/logging.rst:1147 msgid "" "Logs a message with level :const:`ERROR` on the root logger. The arguments " "are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1152 +#: ../../library/logging.rst:1153 msgid "" "Logs a message with level :const:`CRITICAL` on the root logger. The " "arguments are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1158 +#: ../../library/logging.rst:1159 msgid "" "Logs a message with level :const:`ERROR` on the root logger. The arguments " "are interpreted as for :func:`debug`. Exception info is added to the logging " "message. This function should only be called from an exception handler." msgstr "" -#: ../../library/logging.rst:1164 +#: ../../library/logging.rst:1165 msgid "" "Logs a message with level *level* on the root logger. The other arguments " "are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1169 +#: ../../library/logging.rst:1170 msgid "" "Provides an overriding level *level* for all loggers which takes precedence " "over the logger's own level. When the need arises to temporarily throttle " @@ -1612,7 +1613,7 @@ msgid "" "individual loggers." msgstr "" -#: ../../library/logging.rst:1180 +#: ../../library/logging.rst:1181 msgid "" "Note that if you have defined any custom logging level higher than " "``CRITICAL`` (this is not recommended), you won't be able to rely on the " @@ -1620,13 +1621,13 @@ msgid "" "a suitable value." msgstr "" -#: ../../library/logging.rst:1185 +#: ../../library/logging.rst:1186 msgid "" "The *level* parameter was defaulted to level ``CRITICAL``. See :issue:" "`28524` for more information about this change." msgstr "" -#: ../../library/logging.rst:1191 +#: ../../library/logging.rst:1192 msgid "" "Associates level *level* with text *levelName* in an internal dictionary, " "which is used to map numeric levels to a textual representation, for example " @@ -1636,24 +1637,24 @@ msgid "" "and they should increase in increasing order of severity." msgstr "" -#: ../../library/logging.rst:1198 +#: ../../library/logging.rst:1199 msgid "" "If you are thinking of defining your own levels, please see the section on :" "ref:`custom-levels`." msgstr "" -#: ../../library/logging.rst:1203 +#: ../../library/logging.rst:1204 msgid "" "Returns a mapping from level names to their corresponding logging levels. " "For example, the string \"CRITICAL\" maps to :const:`CRITICAL`. The returned " "mapping is copied from an internal mapping on each call to this function." msgstr "" -#: ../../library/logging.rst:1211 +#: ../../library/logging.rst:1212 msgid "Returns the textual or numeric representation of logging level *level*." msgstr "" -#: ../../library/logging.rst:1213 +#: ../../library/logging.rst:1214 msgid "" "If *level* is one of the predefined levels :const:`CRITICAL`, :const:" "`ERROR`, :const:`WARNING`, :const:`INFO` or :const:`DEBUG` then you get the " @@ -1663,29 +1664,29 @@ msgid "" "the corresponding string representation is returned." msgstr "" -#: ../../library/logging.rst:1220 +#: ../../library/logging.rst:1221 msgid "" "The *level* parameter also accepts a string representation of the level such " "as 'INFO'. In such cases, this functions returns the corresponding numeric " "value of the level." msgstr "" -#: ../../library/logging.rst:1224 +#: ../../library/logging.rst:1225 msgid "" "If no matching numeric or string value is passed in, the string 'Level %s' % " "level is returned." msgstr "" -#: ../../library/logging.rst:1227 +#: ../../library/logging.rst:1228 msgid "" "Levels are internally integers (as they need to be compared in the logging " "logic). This function is used to convert between an integer level and the " -"level name displayed in the formatted log output by means of the ``" -"%(levelname)s`` format specifier (see :ref:`logrecord-attributes`), and vice " -"versa." +"level name displayed in the formatted log output by means of the " +"``%(levelname)s`` format specifier (see :ref:`logrecord-attributes`), and " +"vice versa." msgstr "" -#: ../../library/logging.rst:1233 +#: ../../library/logging.rst:1234 msgid "" "In Python versions earlier than 3.4, this function could also be passed a " "text level, and would return the corresponding numeric value of the level. " @@ -1693,7 +1694,7 @@ msgid "" "Python 3.4, but reinstated in 3.4.2 due to retain backward compatibility." msgstr "" -#: ../../library/logging.rst:1241 +#: ../../library/logging.rst:1242 msgid "" "Creates and returns a new :class:`LogRecord` instance whose attributes are " "defined by *attrdict*. This function is useful for taking a pickled :class:" @@ -1701,7 +1702,7 @@ msgid "" "as a :class:`LogRecord` instance at the receiving end." msgstr "" -#: ../../library/logging.rst:1249 +#: ../../library/logging.rst:1250 msgid "" "Does basic configuration for the logging system by creating a :class:" "`StreamHandler` with a default :class:`Formatter` and adding it to the root " @@ -1710,13 +1711,13 @@ msgid "" "no handlers are defined for the root logger." msgstr "" -#: ../../library/logging.rst:1255 +#: ../../library/logging.rst:1256 msgid "" "This function does nothing if the root logger already has handlers " "configured, unless the keyword argument *force* is set to ``True``." msgstr "" -#: ../../library/logging.rst:1258 +#: ../../library/logging.rst:1259 msgid "" "This function should be called from the main thread before other threads are " "started. In versions of Python prior to 2.7.1 and 3.2, if this function is " @@ -1725,54 +1726,54 @@ msgid "" "unexpected results such as messages being duplicated in the log." msgstr "" -#: ../../library/logging.rst:1265 +#: ../../library/logging.rst:1266 msgid "The following keyword arguments are supported." msgstr "" -#: ../../library/logging.rst:1272 +#: ../../library/logging.rst:1273 msgid "*filename*" msgstr "*filename*" -#: ../../library/logging.rst:1272 +#: ../../library/logging.rst:1273 msgid "" "Specifies that a :class:`FileHandler` be created, using the specified " "filename, rather than a :class:`StreamHandler`." msgstr "" -#: ../../library/logging.rst:1276 +#: ../../library/logging.rst:1277 msgid "*filemode*" msgstr "*filemode*" -#: ../../library/logging.rst:1276 +#: ../../library/logging.rst:1277 msgid "" "If *filename* is specified, open the file in this :ref:`mode `. " "Defaults to ``'a'``." msgstr "" -#: ../../library/logging.rst:1280 +#: ../../library/logging.rst:1281 msgid "*format*" msgstr "*format*" -#: ../../library/logging.rst:1280 +#: ../../library/logging.rst:1281 msgid "" "Use the specified format string for the handler. Defaults to attributes " "``levelname``, ``name`` and ``message`` separated by colons." msgstr "" -#: ../../library/logging.rst:1285 +#: ../../library/logging.rst:1286 msgid "*datefmt*" msgstr "*datefmt*" -#: ../../library/logging.rst:1285 +#: ../../library/logging.rst:1286 msgid "" "Use the specified date/time format, as accepted by :func:`time.strftime`." msgstr "" -#: ../../library/logging.rst:1288 +#: ../../library/logging.rst:1289 msgid "*style*" msgstr "*style*" -#: ../../library/logging.rst:1288 +#: ../../library/logging.rst:1289 msgid "" "If *format* is specified, use this style for the format string. One of " "``'%'``, ``'{'`` or ``'$'`` for :ref:`printf-style `." msgstr "" -#: ../../library/logging.rst:1299 +#: ../../library/logging.rst:1300 msgid "*stream*" msgstr "*stream*" -#: ../../library/logging.rst:1299 +#: ../../library/logging.rst:1300 msgid "" "Use the specified stream to initialize the :class:`StreamHandler`. Note that " "this argument is incompatible with *filename* - if both are present, a " "``ValueError`` is raised." msgstr "" -#: ../../library/logging.rst:1305 +#: ../../library/logging.rst:1306 msgid "*handlers*" msgstr "*handlers*" -#: ../../library/logging.rst:1305 +#: ../../library/logging.rst:1306 msgid "" "If specified, this should be an iterable of already created handlers to add " "to the root logger. Any handlers which don't already have a formatter set " @@ -1812,33 +1813,33 @@ msgid "" "present, a ``ValueError`` is raised." msgstr "" -#: ../../library/logging.rst:1314 +#: ../../library/logging.rst:1315 msgid "*force*" msgstr "*force*" -#: ../../library/logging.rst:1314 +#: ../../library/logging.rst:1315 msgid "" "If this keyword argument is specified as true, any existing handlers " "attached to the root logger are removed and closed, before carrying out the " "configuration as specified by the other arguments." msgstr "" -#: ../../library/logging.rst:1320 +#: ../../library/logging.rst:1321 msgid "*encoding*" msgstr "*encoding*" -#: ../../library/logging.rst:1320 +#: ../../library/logging.rst:1321 msgid "" "If this keyword argument is specified along with *filename*, its value is " "used when the :class:`FileHandler` is created, and thus used when opening " "the output file." msgstr "" -#: ../../library/logging.rst:1325 +#: ../../library/logging.rst:1326 msgid "*errors*" msgstr "*errors*" -#: ../../library/logging.rst:1325 +#: ../../library/logging.rst:1326 msgid "" "If this keyword argument is specified along with *filename*, its value is " "used when the :class:`FileHandler` is created, and thus used when opening " @@ -1847,39 +1848,39 @@ msgid "" "`open`, which means that it will be treated the same as passing 'errors'." msgstr "" -#: ../../library/logging.rst:1336 +#: ../../library/logging.rst:1337 msgid "The *style* argument was added." msgstr "新增 *style* 引數。" -#: ../../library/logging.rst:1339 +#: ../../library/logging.rst:1340 msgid "" "The *handlers* argument was added. Additional checks were added to catch " "situations where incompatible arguments are specified (e.g. *handlers* " "together with *stream* or *filename*, or *stream* together with *filename*)." msgstr "" -#: ../../library/logging.rst:1345 +#: ../../library/logging.rst:1346 msgid "The *force* argument was added." msgstr "新增 *force* 引數。" -#: ../../library/logging.rst:1348 +#: ../../library/logging.rst:1349 msgid "The *encoding* and *errors* arguments were added." msgstr "新增 *encoding* 與 *errors* 引數。" -#: ../../library/logging.rst:1353 +#: ../../library/logging.rst:1354 msgid "" "Informs the logging system to perform an orderly shutdown by flushing and " "closing all handlers. This should be called at application exit and no " "further use of the logging system should be made after this call." msgstr "" -#: ../../library/logging.rst:1357 +#: ../../library/logging.rst:1358 msgid "" "When the logging module is imported, it registers this function as an exit " "handler (see :mod:`atexit`), so normally there's no need to do that manually." msgstr "" -#: ../../library/logging.rst:1364 +#: ../../library/logging.rst:1365 msgid "" "Tells the logging system to use the class *klass* when instantiating a " "logger. The class should define :meth:`__init__` such that only a name " @@ -1891,32 +1892,32 @@ msgid "" "loggers." msgstr "" -#: ../../library/logging.rst:1375 +#: ../../library/logging.rst:1376 msgid "Set a callable which is used to create a :class:`LogRecord`." msgstr "" -#: ../../library/logging.rst:1377 +#: ../../library/logging.rst:1378 msgid "The factory callable to be used to instantiate a log record." msgstr "" -#: ../../library/logging.rst:1379 +#: ../../library/logging.rst:1380 msgid "" "This function has been provided, along with :func:`getLogRecordFactory`, to " "allow developers more control over how the :class:`LogRecord` representing a " "logging event is constructed." msgstr "" -#: ../../library/logging.rst:1384 +#: ../../library/logging.rst:1385 msgid "The factory has the following signature:" msgstr "" -#: ../../library/logging.rst:1386 +#: ../../library/logging.rst:1387 msgid "" "``factory(name, level, fn, lno, msg, args, exc_info, func=None, sinfo=None, " "**kwargs)``" msgstr "" -#: ../../library/logging.rst:1388 +#: ../../library/logging.rst:1389 msgid "The logger name." msgstr "" @@ -1924,7 +1925,7 @@ msgstr "" msgid "level" msgstr "" -#: ../../library/logging.rst:1389 +#: ../../library/logging.rst:1390 msgid "The logging level (numeric)." msgstr "" @@ -1932,7 +1933,7 @@ msgstr "" msgid "fn" msgstr "fn" -#: ../../library/logging.rst:1390 +#: ../../library/logging.rst:1391 msgid "The full pathname of the file where the logging call was made." msgstr "" @@ -1940,19 +1941,19 @@ msgstr "" msgid "lno" msgstr "lno" -#: ../../library/logging.rst:1391 +#: ../../library/logging.rst:1392 msgid "The line number in the file where the logging call was made." msgstr "" -#: ../../library/logging.rst:1392 +#: ../../library/logging.rst:1393 msgid "The logging message." msgstr "" -#: ../../library/logging.rst:1393 +#: ../../library/logging.rst:1394 msgid "The arguments for the logging message." msgstr "" -#: ../../library/logging.rst:1394 +#: ../../library/logging.rst:1395 msgid "An exception tuple, or ``None``." msgstr "" @@ -1960,7 +1961,7 @@ msgstr "" msgid "func" msgstr "func" -#: ../../library/logging.rst:1395 +#: ../../library/logging.rst:1396 msgid "The name of the function or method which invoked the logging call." msgstr "" @@ -1968,7 +1969,7 @@ msgstr "" msgid "sinfo" msgstr "sinfo" -#: ../../library/logging.rst:1397 +#: ../../library/logging.rst:1398 msgid "" "A stack traceback such as is provided by :func:`traceback.print_stack`, " "showing the call hierarchy." @@ -1978,15 +1979,15 @@ msgstr "" msgid "kwargs" msgstr "kwargs" -#: ../../library/logging.rst:1399 +#: ../../library/logging.rst:1400 msgid "Additional keyword arguments." msgstr "額外的關鍵字引數。" -#: ../../library/logging.rst:1403 +#: ../../library/logging.rst:1404 msgid "Module-Level Attributes" msgstr "" -#: ../../library/logging.rst:1407 +#: ../../library/logging.rst:1408 msgid "" "A \"handler of last resort\" is available through this attribute. This is a :" "class:`StreamHandler` writing to ``sys.stderr`` with a level of ``WARNING``, " @@ -1997,22 +1998,22 @@ msgid "" "reason, ``lastResort`` can be set to ``None``." msgstr "" -#: ../../library/logging.rst:1418 +#: ../../library/logging.rst:1419 msgid "Integration with the warnings module" msgstr "" -#: ../../library/logging.rst:1420 +#: ../../library/logging.rst:1421 msgid "" "The :func:`captureWarnings` function can be used to integrate :mod:`logging` " "with the :mod:`warnings` module." msgstr "" -#: ../../library/logging.rst:1425 +#: ../../library/logging.rst:1426 msgid "" "This function is used to turn the capture of warnings by logging on and off." msgstr "" -#: ../../library/logging.rst:1428 +#: ../../library/logging.rst:1429 msgid "" "If *capture* is ``True``, warnings issued by the :mod:`warnings` module will " "be redirected to the logging system. Specifically, a warning will be " @@ -2021,46 +2022,46 @@ msgid "" "`WARNING`." msgstr "" -#: ../../library/logging.rst:1433 +#: ../../library/logging.rst:1434 msgid "" "If *capture* is ``False``, the redirection of warnings to the logging system " "will stop, and warnings will be redirected to their original destinations (i." "e. those in effect before ``captureWarnings(True)`` was called)." msgstr "" -#: ../../library/logging.rst:1441 +#: ../../library/logging.rst:1442 msgid "Module :mod:`logging.config`" msgstr "" -#: ../../library/logging.rst:1441 +#: ../../library/logging.rst:1442 msgid "Configuration API for the logging module." msgstr "" -#: ../../library/logging.rst:1444 +#: ../../library/logging.rst:1445 msgid "Module :mod:`logging.handlers`" msgstr "" -#: ../../library/logging.rst:1444 +#: ../../library/logging.rst:1445 msgid "Useful handlers included with the logging module." msgstr "" -#: ../../library/logging.rst:1448 +#: ../../library/logging.rst:1449 msgid ":pep:`282` - A Logging System" msgstr "" -#: ../../library/logging.rst:1447 +#: ../../library/logging.rst:1448 msgid "" "The proposal which described this feature for inclusion in the Python " "standard library." msgstr "" -#: ../../library/logging.rst:1453 +#: ../../library/logging.rst:1454 msgid "" "`Original Python logging package `_" msgstr "" -#: ../../library/logging.rst:1451 +#: ../../library/logging.rst:1452 msgid "" "This is the original source for the :mod:`logging` package. The version of " "the package available from this site is suitable for use with Python 1.5.2, " diff --git a/library/os.po b/library/os.po index e3af33d909..352ab2795b 100644 --- a/library/os.po +++ b/library/os.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-03-04 00:16+0000\n" +"POT-Creation-Date: 2023-03-22 00:14+0000\n" "PO-Revision-Date: 2022-10-16 08:11+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -4012,8 +4012,8 @@ msgstr "" #: ../../library/os.rst:3735 msgid "" -"The standard way to exit is ``sys.exit(n)``. :func:`_exit` should normally " -"only be used in the child process after a :func:`fork`." +"The standard way to exit is :func:`sys.exit(n) `. :func:`!_exit` " +"should normally only be used in the child process after a :func:`fork`." msgstr "" #: ../../library/os.rst:3738 diff --git a/library/pdb.po b/library/pdb.po index 9bd9d8a958..92f066a2a2 100644 --- a/library/pdb.po +++ b/library/pdb.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-03-15 00:17+0000\n" +"POT-Creation-Date: 2023-03-26 00:17+0000\n" "PO-Revision-Date: 2018-05-23 16:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -147,7 +147,7 @@ msgstr "" msgid "" "Evaluate the *expression* (given as a string or a code object) under " "debugger control. When :func:`runeval` returns, it returns the value of the " -"expression. Otherwise this function is similar to :func:`run`." +"*expression*. Otherwise this function is similar to :func:`run`." msgstr "" #: ../../library/pdb.rst:133 @@ -211,10 +211,10 @@ msgstr "" #: ../../library/pdb.rst:180 msgid "" "By default, Pdb sets a handler for the SIGINT signal (which is sent when the " -"user presses :kbd:`Ctrl-C` on the console) when you give a ``continue`` " -"command. This allows you to break into the debugger again by pressing :kbd:" -"`Ctrl-C`. If you want Pdb not to touch the SIGINT handler, set *nosigint* " -"to true." +"user presses :kbd:`Ctrl-C` on the console) when you give a :pdbcmd:" +"`continue` command. This allows you to break into the debugger again by " +"pressing :kbd:`Ctrl-C`. If you want Pdb not to touch the SIGINT handler, " +"set *nosigint* to true." msgstr "" #: ../../library/pdb.rst:185 @@ -400,11 +400,11 @@ msgstr "" #: ../../library/pdb.rst:331 msgid "" -"Set the ignore count for the given breakpoint number. If count is omitted, " -"the ignore count is set to 0. A breakpoint becomes active when the ignore " -"count is zero. When non-zero, the count is decremented each time the " -"breakpoint is reached and the breakpoint is not disabled and any associated " -"condition evaluates to true." +"Set the ignore count for the given breakpoint number. If *count* is " +"omitted, the ignore count is set to 0. A breakpoint becomes active when the " +"ignore count is zero. When non-zero, the *count* is decremented each time " +"the breakpoint is reached and the breakpoint is not disabled and any " +"associated condition evaluates to true." msgstr "" #: ../../library/pdb.rst:339 @@ -452,8 +452,8 @@ msgstr "" #: ../../library/pdb.rst:372 msgid "" -"If you use the 'silent' command in the command list, the usual message about " -"stopping at a breakpoint is not printed. This may be desirable for " +"If you use the ``silent`` command in the command list, the usual message " +"about stopping at a breakpoint is not printed. This may be desirable for " "breakpoints that are to print a specific message and then continue. If none " "of the other commands print anything, you see no sign that the breakpoint " "was reached." @@ -482,9 +482,9 @@ msgstr "" #: ../../library/pdb.rst:395 msgid "" -"With a line number, continue execution until a line with a number greater or " -"equal to that is reached. In both cases, also stop when the current frame " -"returns." +"With *lineno*, continue execution until a line with a number greater or " +"equal to *lineno* is reached. In both cases, also stop when the current " +"frame returns." msgstr "" #: ../../library/pdb.rst:399 @@ -545,7 +545,7 @@ msgid "Print the argument list of the current function." msgstr "" #: ../../library/pdb.rst:449 -msgid "Evaluate the *expression* in the current context and print its value." +msgid "Evaluate *expression* in the current context and print its value." msgstr "" #: ../../library/pdb.rst:453 @@ -556,32 +556,33 @@ msgstr "" #: ../../library/pdb.rst:459 msgid "" -"Like the :pdbcmd:`p` command, except the value of the expression is pretty-" +"Like the :pdbcmd:`p` command, except the value of *expression* is pretty-" "printed using the :mod:`pprint` module." msgstr "" #: ../../library/pdb.rst:464 -msgid "Print the type of the *expression*." +msgid "Print the type of *expression*." msgstr "" #: ../../library/pdb.rst:468 -msgid "Try to get source code for the given object and display it." +msgid "Try to get source code of *expression* and display it." msgstr "" #: ../../library/pdb.rst:474 msgid "" -"Display the value of the expression if it changed, each time execution stops " +"Display the value of *expression* if it changed, each time execution stops " "in the current frame." msgstr "" #: ../../library/pdb.rst:477 -msgid "Without expression, list all display expressions for the current frame." +msgid "" +"Without *expression*, list all display expressions for the current frame." msgstr "" #: ../../library/pdb.rst:483 msgid "" -"Do not display the expression any more in the current frame. Without " -"expression, clear all display expressions for the current frame." +"Do not display *expression* anymore in the current frame. Without " +"*expression*, clear all display expressions for the current frame." msgstr "" #: ../../library/pdb.rst:490 @@ -593,10 +594,10 @@ msgstr "" #: ../../library/pdb.rst:500 msgid "" -"Create an alias called *name* that executes *command*. The command must " +"Create an alias called *name* that executes *command*. The *command* must " "*not* be enclosed in quotes. Replaceable parameters can be indicated by " "``%1``, ``%2``, and so on, while ``%*`` is replaced by all the parameters. " -"If no command is given, the current alias for *name* is shown. If no " +"If *command* is omitted, the current alias for *name* is shown. If no " "arguments are given, all aliases are listed." msgstr "" @@ -616,7 +617,7 @@ msgid "" msgstr "" #: ../../library/pdb.rst:522 -msgid "Delete the specified alias." +msgid "Delete the specified alias *name*." msgstr "" #: ../../library/pdb.rst:526 @@ -630,8 +631,8 @@ msgstr "" #: ../../library/pdb.rst:538 msgid "" -"Restart the debugged Python program. If an argument is supplied, it is " -"split with :mod:`shlex` and the result is used as the new :data:`sys.argv`. " +"Restart the debugged Python program. If *args* is supplied, it is split " +"with :mod:`shlex` and the result is used as the new :data:`sys.argv`. " "History, breakpoints, actions and debugger options are preserved. :pdbcmd:" "`restart` is an alias for :pdbcmd:`run`." msgstr "" @@ -642,8 +643,8 @@ msgstr "" #: ../../library/pdb.rst:549 msgid "" -"Enter a recursive debugger that steps through the code argument (which is an " -"arbitrary expression or statement to be executed in the current environment)." +"Enter a recursive debugger that steps through *code* (which is an arbitrary " +"expression or statement to be executed in the current environment)." msgstr "" #: ../../library/pdb.rst:555 diff --git a/library/profile.po b/library/profile.po index bb1e4ea951..b3d0a700ea 100644 --- a/library/profile.po +++ b/library/profile.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-04-03 00:16+0000\n" "PO-Revision-Date: 2018-05-23 16:08+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -101,7 +101,7 @@ msgstr "" msgid "" "The first line indicates that 214 calls were monitored. Of those calls, 207 " "were :dfn:`primitive`, meaning that the call was not induced via recursion. " -"The next line: ``Ordered by: cumulative name``, indicates that the text " +"The next line: ``Ordered by: cumulative time``, indicates that the text " "string in the far right column was used to sort the output. The column " "headings include:" msgstr "" diff --git a/library/random.po b/library/random.po index 86c00f1fd2..c5dc71c2df 100644 --- a/library/random.po +++ b/library/random.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-23 00:16+0000\n" +"POT-Creation-Date: 2023-03-17 00:16+0000\n" "PO-Revision-Date: 2023-01-23 22:47+0800\n" "Last-Translator: Allen Wu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -775,7 +775,7 @@ msgid "" "combinatoric iterators in the :mod:`itertools` module:" msgstr "" -#: ../../library/random.rst:598 +#: ../../library/random.rst:599 msgid "" "The default :func:`.random` returns multiples of 2⁻⁵³ in the range *0.0 ≤ x " "< 1.0*. All such numbers are evenly spaced and are exactly representable as " @@ -787,7 +787,7 @@ msgstr "" "均勻分佈的,並且可以完全表示為 Python float。但是,該間隔中的許多其他可表示" "的 float 不是可能的選擇。 例如 ``0.05954861408025609`` 不是 2⁻⁵³ 的整數倍。" -#: ../../library/random.rst:604 +#: ../../library/random.rst:605 msgid "" "The following recipe takes a different approach. All floats in the interval " "are possible selections. The mantissa comes from a uniform distribution of " @@ -799,7 +799,7 @@ msgstr "" "數 < 2⁵³* 範圍內的整數均勻分佈。指數來自幾何分佈,其中小於 *-53* 的指數的出現" "頻率是下一個較大指數的一半。" -#: ../../library/random.rst:626 +#: ../../library/random.rst:627 msgid "" "All :ref:`real valued distributions ` in the " "class will use the new method::" @@ -809,7 +809,7 @@ msgstr "" "\n" "::" -#: ../../library/random.rst:635 +#: ../../library/random.rst:636 msgid "" "The recipe is conceptually equivalent to an algorithm that chooses from all " "the multiples of 2⁻¹⁰⁷⁴ in the range *0.0 ≤ x < 1.0*. All such numbers are " @@ -822,7 +822,7 @@ msgstr "" "示的 Python float。(2⁻¹⁰⁷⁴ 是最小為正的非正規化 float,等於 ``math." "ulp(0.0)``)" -#: ../../library/random.rst:644 +#: ../../library/random.rst:645 msgid "" "`Generating Pseudo-random Floating-Point Values `_ a paper by Allen B. Downey describing " diff --git a/library/socket.po b/library/socket.po index b9bebf91ab..0745035742 100644 --- a/library/socket.po +++ b/library/socket.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:17+0000\n" +"POT-Creation-Date: 2023-04-05 00:14+0000\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -40,7 +40,6 @@ msgid "" msgstr "" #: ../../includes/wasm-notavail.rst:3 -#, fuzzy msgid ":ref:`Availability `: not Emscripten, not WASI." msgstr ":ref:`適用 `:非 Emscripten、非 WASI。" @@ -1380,7 +1379,6 @@ msgstr "" #: ../../library/socket.rst:1169 ../../library/socket.rst:1196 #: ../../library/socket.rst:1213 ../../library/socket.rst:1230 #: ../../library/socket.rst:1244 -#, fuzzy msgid "" ":ref:`Availability `: Unix, Windows, not Emscripten, not WASI." msgstr ":ref:`適用 `:Unix、Windows、非 Emscripten、非 WASI。" @@ -1880,8 +1878,8 @@ msgstr "" #: ../../library/socket.rst:1690 msgid "" -"The socket timeout is no more reset each time data is sent successfully. The " -"socket timeout is now the maximum total duration to send all data." +"The socket timeout is no longer reset each time data is sent successfully. " +"The socket timeout is now the maximum total duration to send all data." msgstr "" #: ../../library/socket.rst:1703 @@ -1927,7 +1925,6 @@ msgid "" msgstr "" #: ../../library/socket.rst:1748 -#, fuzzy msgid ":ref:`Availability `: Unix, not WASI." msgstr ":ref:`適用 `:Unix、非 WASI。" @@ -2092,8 +2089,8 @@ msgstr "" msgid "" "In *non-blocking mode*, operations fail (with an error that is unfortunately " "system-dependent) if they cannot be completed immediately: functions from " -"the :mod:`select` can be used to know when and whether a socket is available " -"for reading or writing." +"the :mod:`select` module can be used to know when and whether a socket is " +"available for reading or writing." msgstr "" #: ../../library/socket.rst:1917 @@ -2202,7 +2199,7 @@ msgstr "" #: ../../library/socket.rst:2103 msgid "" "After binding (:const:`CAN_RAW`) or connecting (:const:`CAN_BCM`) the " -"socket, you can use the :meth:`socket.send`, and the :meth:`socket.recv` " +"socket, you can use the :meth:`socket.send` and :meth:`socket.recv` " "operations (and their counterparts) on the socket object as usual." msgstr "" diff --git a/library/sqlite3.po b/library/sqlite3.po index 1f43b8342e..dc4b330103 100644 --- a/library/sqlite3.po +++ b/library/sqlite3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-03-03 01:56+0000\n" +"POT-Creation-Date: 2023-03-23 00:15+0000\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -273,10 +273,10 @@ msgstr "" #: ../../library/sqlite3.rst:272 msgid "" -"How many seconds the connection should wait before raising an exception, if " -"the database is locked by another connection. If another connection opens a " -"transaction to modify the database, it will be locked until that transaction " -"is committed. Default five seconds." +"How many seconds the connection should wait before raising an :exc:" +"`OperationalError` when a table is locked. If another connection opens a " +"transaction to modify a table, that table will be locked until the " +"transaction is committed. Default five seconds." msgstr "" #: ../../library/sqlite3.rst:279 @@ -894,7 +894,8 @@ msgstr "" #: ../../library/sqlite3.rst:868 msgid "" "Call this method from a different thread to abort any queries that might be " -"executing on the connection. Aborted queries will raise an exception." +"executing on the connection. Aborted queries will raise an :exc:" +"`OperationalError`." msgstr "" #: ../../library/sqlite3.rst:875 diff --git a/library/ssl.po b/library/ssl.po index d9cbb2c103..11de1dac19 100644 --- a/library/ssl.po +++ b/library/ssl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:17+0000\n" +"POT-Creation-Date: 2023-03-25 00:15+0000\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1425,7 +1425,7 @@ msgstr "" #: ../../library/ssl.rst:1312 msgid "" -"Return the list of ciphers shared by the client during the handshake. Each " +"Return the list of ciphers available in both the client and server. Each " "entry of the returned list is a three-value tuple containing the name of the " "cipher, the version of the SSL protocol that defines its use, and the number " "of secret bits the cipher uses. :meth:`~SSLSocket.shared_ciphers` returns " diff --git a/library/stdtypes.po b/library/stdtypes.po index b4ca86d33d..7e97b1cd21 100644 --- a/library/stdtypes.po +++ b/library/stdtypes.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-03-06 00:17+0000\n" +"POT-Creation-Date: 2023-03-17 00:16+0000\n" "PO-Revision-Date: 2022-06-12 15:22+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -121,22 +121,22 @@ msgid "These are the Boolean operations, ordered by ascending priority:" msgstr "" #: ../../library/stdtypes.rst:85 ../../library/stdtypes.rst:143 -#: ../../library/stdtypes.rst:275 ../../library/stdtypes.rst:364 -#: ../../library/stdtypes.rst:414 ../../library/stdtypes.rst:923 -#: ../../library/stdtypes.rst:1128 +#: ../../library/stdtypes.rst:275 ../../library/stdtypes.rst:363 +#: ../../library/stdtypes.rst:413 ../../library/stdtypes.rst:922 +#: ../../library/stdtypes.rst:1127 msgid "Operation" msgstr "" #: ../../library/stdtypes.rst:85 ../../library/stdtypes.rst:275 -#: ../../library/stdtypes.rst:364 ../../library/stdtypes.rst:414 -#: ../../library/stdtypes.rst:923 ../../library/stdtypes.rst:1128 +#: ../../library/stdtypes.rst:363 ../../library/stdtypes.rst:413 +#: ../../library/stdtypes.rst:922 ../../library/stdtypes.rst:1127 msgid "Result" msgstr "結果" #: ../../library/stdtypes.rst:85 ../../library/stdtypes.rst:275 -#: ../../library/stdtypes.rst:414 ../../library/stdtypes.rst:923 -#: ../../library/stdtypes.rst:1128 ../../library/stdtypes.rst:2373 -#: ../../library/stdtypes.rst:3591 +#: ../../library/stdtypes.rst:413 ../../library/stdtypes.rst:922 +#: ../../library/stdtypes.rst:1127 ../../library/stdtypes.rst:2372 +#: ../../library/stdtypes.rst:3590 msgid "Notes" msgstr "註解" @@ -149,9 +149,9 @@ msgid "if *x* is true, then *x*, else *y*" msgstr "" #: ../../library/stdtypes.rst:87 ../../library/stdtypes.rst:285 -#: ../../library/stdtypes.rst:925 ../../library/stdtypes.rst:928 -#: ../../library/stdtypes.rst:1139 ../../library/stdtypes.rst:2379 -#: ../../library/stdtypes.rst:3597 +#: ../../library/stdtypes.rst:924 ../../library/stdtypes.rst:927 +#: ../../library/stdtypes.rst:1138 ../../library/stdtypes.rst:2378 +#: ../../library/stdtypes.rst:3596 msgid "\\(1)" msgstr "\\(1)" @@ -164,9 +164,9 @@ msgid "if *x* is false, then *x*, else *y*" msgstr "" #: ../../library/stdtypes.rst:90 ../../library/stdtypes.rst:288 -#: ../../library/stdtypes.rst:308 ../../library/stdtypes.rst:1167 -#: ../../library/stdtypes.rst:2383 ../../library/stdtypes.rst:2385 -#: ../../library/stdtypes.rst:3601 ../../library/stdtypes.rst:3603 +#: ../../library/stdtypes.rst:308 ../../library/stdtypes.rst:1166 +#: ../../library/stdtypes.rst:2382 ../../library/stdtypes.rst:2384 +#: ../../library/stdtypes.rst:3600 ../../library/stdtypes.rst:3602 msgid "\\(2)" msgstr "\\(2)" @@ -178,19 +178,19 @@ msgstr "``not x``" msgid "if *x* is false, then ``True``, else ``False``" msgstr "" -#: ../../library/stdtypes.rst:93 ../../library/stdtypes.rst:937 -#: ../../library/stdtypes.rst:1170 ../../library/stdtypes.rst:2387 -#: ../../library/stdtypes.rst:2389 ../../library/stdtypes.rst:2391 -#: ../../library/stdtypes.rst:2393 ../../library/stdtypes.rst:3605 -#: ../../library/stdtypes.rst:3607 ../../library/stdtypes.rst:3609 -#: ../../library/stdtypes.rst:3611 +#: ../../library/stdtypes.rst:93 ../../library/stdtypes.rst:936 +#: ../../library/stdtypes.rst:1169 ../../library/stdtypes.rst:2386 +#: ../../library/stdtypes.rst:2388 ../../library/stdtypes.rst:2390 +#: ../../library/stdtypes.rst:2392 ../../library/stdtypes.rst:3604 +#: ../../library/stdtypes.rst:3606 ../../library/stdtypes.rst:3608 +#: ../../library/stdtypes.rst:3610 msgid "\\(3)" msgstr "\\(3)" #: ../../library/stdtypes.rst:102 ../../library/stdtypes.rst:319 -#: ../../library/stdtypes.rst:432 ../../library/stdtypes.rst:974 -#: ../../library/stdtypes.rst:1178 ../../library/stdtypes.rst:2419 -#: ../../library/stdtypes.rst:3641 +#: ../../library/stdtypes.rst:431 ../../library/stdtypes.rst:973 +#: ../../library/stdtypes.rst:1177 ../../library/stdtypes.rst:2418 +#: ../../library/stdtypes.rst:3640 msgid "Notes:" msgstr "註解:" @@ -229,9 +229,9 @@ msgstr "" msgid "This table summarizes the comparison operations:" msgstr "" -#: ../../library/stdtypes.rst:143 ../../library/stdtypes.rst:2350 -#: ../../library/stdtypes.rst:2373 ../../library/stdtypes.rst:3568 -#: ../../library/stdtypes.rst:3591 +#: ../../library/stdtypes.rst:143 ../../library/stdtypes.rst:2349 +#: ../../library/stdtypes.rst:2372 ../../library/stdtypes.rst:3567 +#: ../../library/stdtypes.rst:3590 msgid "Meaning" msgstr "" @@ -513,8 +513,8 @@ msgid "" "zero." msgstr "" -#: ../../library/stdtypes.rst:301 ../../library/stdtypes.rst:1160 -#: ../../library/stdtypes.rst:2381 ../../library/stdtypes.rst:3628 +#: ../../library/stdtypes.rst:301 ../../library/stdtypes.rst:1159 +#: ../../library/stdtypes.rst:2380 ../../library/stdtypes.rst:3627 msgid "\\(6)" msgstr "\\(6)" @@ -551,10 +551,10 @@ msgid "*x* to the power *y*" msgstr "" #: ../../library/stdtypes.rst:310 ../../library/stdtypes.rst:312 -#: ../../library/stdtypes.rst:1149 ../../library/stdtypes.rst:1152 -#: ../../library/stdtypes.rst:2406 ../../library/stdtypes.rst:2409 -#: ../../library/stdtypes.rst:2412 ../../library/stdtypes.rst:3624 -#: ../../library/stdtypes.rst:3631 +#: ../../library/stdtypes.rst:1148 ../../library/stdtypes.rst:1151 +#: ../../library/stdtypes.rst:2405 ../../library/stdtypes.rst:2408 +#: ../../library/stdtypes.rst:2411 ../../library/stdtypes.rst:3623 +#: ../../library/stdtypes.rst:3630 msgid "\\(5)" msgstr "\\(5)" @@ -580,95 +580,95 @@ msgid "" "appropriate." msgstr "" -#: ../../library/stdtypes.rst:340 +#: ../../library/stdtypes.rst:339 msgid "" -"Conversion from floating point to integer may round or truncate as in C; see " -"functions :func:`math.floor` and :func:`math.ceil` for well-defined " -"conversions." +"Conversion from :class:`float` to :class:`int` truncates, discarding the " +"fractional part. See functions :func:`math.floor` and :func:`math.ceil` for " +"alternative conversions." msgstr "" -#: ../../library/stdtypes.rst:345 +#: ../../library/stdtypes.rst:344 msgid "" "float also accepts the strings \"nan\" and \"inf\" with an optional prefix " "\"+\" or \"-\" for Not a Number (NaN) and positive or negative infinity." msgstr "" -#: ../../library/stdtypes.rst:349 +#: ../../library/stdtypes.rst:348 msgid "" "Python defines ``pow(0, 0)`` and ``0 ** 0`` to be ``1``, as is common for " "programming languages." msgstr "" -#: ../../library/stdtypes.rst:353 +#: ../../library/stdtypes.rst:352 msgid "" "The numeric literals accepted include the digits ``0`` to ``9`` or any " "Unicode equivalent (code points with the ``Nd`` property)." msgstr "" -#: ../../library/stdtypes.rst:356 +#: ../../library/stdtypes.rst:355 msgid "" "See https://www.unicode.org/Public/14.0.0/ucd/extracted/DerivedNumericType." "txt for a complete list of code points with the ``Nd`` property." msgstr "" -#: ../../library/stdtypes.rst:360 +#: ../../library/stdtypes.rst:359 msgid "" "All :class:`numbers.Real` types (:class:`int` and :class:`float`) also " "include the following operations:" msgstr "" -#: ../../library/stdtypes.rst:366 +#: ../../library/stdtypes.rst:365 msgid ":func:`math.trunc(\\ x) `" msgstr ":func:`math.trunc(\\ x) `" -#: ../../library/stdtypes.rst:366 +#: ../../library/stdtypes.rst:365 msgid "*x* truncated to :class:`~numbers.Integral`" msgstr "" -#: ../../library/stdtypes.rst:369 +#: ../../library/stdtypes.rst:368 msgid ":func:`round(x[, n]) `" msgstr ":func:`round(x[, n]) `" -#: ../../library/stdtypes.rst:369 +#: ../../library/stdtypes.rst:368 msgid "" "*x* rounded to *n* digits, rounding half to even. If *n* is omitted, it " "defaults to 0." msgstr "" -#: ../../library/stdtypes.rst:373 +#: ../../library/stdtypes.rst:372 msgid ":func:`math.floor(\\ x) `" msgstr ":func:`math.floor(\\ x) `" -#: ../../library/stdtypes.rst:373 +#: ../../library/stdtypes.rst:372 msgid "the greatest :class:`~numbers.Integral` <= *x*" msgstr "" -#: ../../library/stdtypes.rst:376 +#: ../../library/stdtypes.rst:375 msgid ":func:`math.ceil(x) `" msgstr ":func:`math.ceil(x) `" -#: ../../library/stdtypes.rst:376 +#: ../../library/stdtypes.rst:375 msgid "the least :class:`~numbers.Integral` >= *x*" msgstr "" -#: ../../library/stdtypes.rst:380 +#: ../../library/stdtypes.rst:379 msgid "" "For additional numeric operations see the :mod:`math` and :mod:`cmath` " "modules." msgstr "" -#: ../../library/stdtypes.rst:389 +#: ../../library/stdtypes.rst:388 msgid "Bitwise Operations on Integer Types" msgstr "" -#: ../../library/stdtypes.rst:403 +#: ../../library/stdtypes.rst:402 msgid "" "Bitwise operations only make sense for integers. The result of bitwise " "operations is calculated as though carried out in two's complement with an " "infinite number of sign bits." msgstr "" -#: ../../library/stdtypes.rst:407 +#: ../../library/stdtypes.rst:406 msgid "" "The priorities of the binary bitwise operations are all lower than the " "numeric operations and higher than the comparisons; the unary operation " @@ -676,89 +676,89 @@ msgid "" "``-``)." msgstr "" -#: ../../library/stdtypes.rst:411 +#: ../../library/stdtypes.rst:410 msgid "This table lists the bitwise operations sorted in ascending priority:" msgstr "" -#: ../../library/stdtypes.rst:416 +#: ../../library/stdtypes.rst:415 msgid "``x | y``" msgstr "``x | y``" -#: ../../library/stdtypes.rst:416 +#: ../../library/stdtypes.rst:415 msgid "bitwise :dfn:`or` of *x* and *y*" msgstr "" -#: ../../library/stdtypes.rst:416 ../../library/stdtypes.rst:419 -#: ../../library/stdtypes.rst:422 ../../library/stdtypes.rst:1173 -#: ../../library/stdtypes.rst:2395 ../../library/stdtypes.rst:2399 -#: ../../library/stdtypes.rst:3613 ../../library/stdtypes.rst:3617 +#: ../../library/stdtypes.rst:415 ../../library/stdtypes.rst:418 +#: ../../library/stdtypes.rst:421 ../../library/stdtypes.rst:1172 +#: ../../library/stdtypes.rst:2394 ../../library/stdtypes.rst:2398 +#: ../../library/stdtypes.rst:3612 ../../library/stdtypes.rst:3616 msgid "\\(4)" msgstr "\\(4)" -#: ../../library/stdtypes.rst:419 +#: ../../library/stdtypes.rst:418 msgid "``x ^ y``" msgstr "``x ^ y``" -#: ../../library/stdtypes.rst:419 +#: ../../library/stdtypes.rst:418 msgid "bitwise :dfn:`exclusive or` of *x* and *y*" msgstr "" -#: ../../library/stdtypes.rst:422 +#: ../../library/stdtypes.rst:421 msgid "``x & y``" msgstr "``x & y``" -#: ../../library/stdtypes.rst:422 +#: ../../library/stdtypes.rst:421 msgid "bitwise :dfn:`and` of *x* and *y*" msgstr "" -#: ../../library/stdtypes.rst:425 +#: ../../library/stdtypes.rst:424 msgid "``x << n``" msgstr "``x << n``" -#: ../../library/stdtypes.rst:425 +#: ../../library/stdtypes.rst:424 msgid "*x* shifted left by *n* bits" msgstr "" -#: ../../library/stdtypes.rst:425 +#: ../../library/stdtypes.rst:424 msgid "(1)(2)" msgstr "(1)(2)" -#: ../../library/stdtypes.rst:427 +#: ../../library/stdtypes.rst:426 msgid "``x >> n``" msgstr "``x >> n``" -#: ../../library/stdtypes.rst:427 +#: ../../library/stdtypes.rst:426 msgid "*x* shifted right by *n* bits" msgstr "" -#: ../../library/stdtypes.rst:427 +#: ../../library/stdtypes.rst:426 msgid "(1)(3)" msgstr "(1)(3)" -#: ../../library/stdtypes.rst:429 +#: ../../library/stdtypes.rst:428 msgid "``~x``" msgstr "``~x``" -#: ../../library/stdtypes.rst:429 +#: ../../library/stdtypes.rst:428 msgid "the bits of *x* inverted" msgstr "" -#: ../../library/stdtypes.rst:435 +#: ../../library/stdtypes.rst:434 msgid "" "Negative shift counts are illegal and cause a :exc:`ValueError` to be raised." msgstr "" -#: ../../library/stdtypes.rst:438 +#: ../../library/stdtypes.rst:437 msgid "" "A left shift by *n* bits is equivalent to multiplication by ``pow(2, n)``." msgstr "" -#: ../../library/stdtypes.rst:441 +#: ../../library/stdtypes.rst:440 msgid "" "A right shift by *n* bits is equivalent to floor division by ``pow(2, n)``." msgstr "" -#: ../../library/stdtypes.rst:444 +#: ../../library/stdtypes.rst:443 msgid "" "Performing these calculations with at least one extra sign extension bit in " "a finite two's complement representation (a working bit-width of ``1 + max(x." @@ -766,23 +766,23 @@ msgid "" "result as if there were an infinite number of sign bits." msgstr "" -#: ../../library/stdtypes.rst:451 +#: ../../library/stdtypes.rst:450 msgid "Additional Methods on Integer Types" msgstr "" -#: ../../library/stdtypes.rst:453 +#: ../../library/stdtypes.rst:452 msgid "" "The int type implements the :class:`numbers.Integral` :term:`abstract base " "class`. In addition, it provides a few more methods:" msgstr "" -#: ../../library/stdtypes.rst:458 +#: ../../library/stdtypes.rst:457 msgid "" "Return the number of bits necessary to represent an integer in binary, " "excluding the sign and leading zeros::" msgstr "" -#: ../../library/stdtypes.rst:467 +#: ../../library/stdtypes.rst:466 msgid "" "More precisely, if ``x`` is nonzero, then ``x.bit_length()`` is the unique " "positive integer ``k`` such that ``2**(k-1) <= abs(x) < 2**k``. " @@ -791,32 +791,32 @@ msgid "" "bit_length()`` returns ``0``." msgstr "" -#: ../../library/stdtypes.rst:473 ../../library/stdtypes.rst:496 -#: ../../library/stdtypes.rst:541 ../../library/stdtypes.rst:585 +#: ../../library/stdtypes.rst:472 ../../library/stdtypes.rst:495 +#: ../../library/stdtypes.rst:540 ../../library/stdtypes.rst:584 msgid "Equivalent to::" msgstr "" "等價於:\n" "\n" "::" -#: ../../library/stdtypes.rst:484 +#: ../../library/stdtypes.rst:483 msgid "" "Return the number of ones in the binary representation of the absolute value " "of the integer. This is also known as the population count. Example::" msgstr "" -#: ../../library/stdtypes.rst:505 +#: ../../library/stdtypes.rst:504 msgid "Return an array of bytes representing an integer." msgstr "" -#: ../../library/stdtypes.rst:517 +#: ../../library/stdtypes.rst:516 msgid "" "The integer is represented using *length* bytes, and defaults to 1. An :exc:" "`OverflowError` is raised if the integer is not representable with the given " "number of bytes." msgstr "" -#: ../../library/stdtypes.rst:521 +#: ../../library/stdtypes.rst:520 msgid "" "The *byteorder* argument determines the byte order used to represent the " "integer, and defaults to ``\"big\"``. If *byteorder* is ``\"big\"``, the " @@ -824,7 +824,7 @@ msgid "" "is ``\"little\"``, the most significant byte is at the end of the byte array." msgstr "" -#: ../../library/stdtypes.rst:527 +#: ../../library/stdtypes.rst:526 msgid "" "The *signed* argument determines whether two's complement is used to " "represent the integer. If *signed* is ``False`` and a negative integer is " @@ -832,33 +832,33 @@ msgid "" "``False``." msgstr "" -#: ../../library/stdtypes.rst:532 +#: ../../library/stdtypes.rst:531 msgid "" "The default values can be used to conveniently turn an integer into a single " "byte object::" msgstr "" -#: ../../library/stdtypes.rst:538 +#: ../../library/stdtypes.rst:537 msgid "" "However, when using the default arguments, don't try to convert a value " "greater than 255 or you'll get an :exc:`OverflowError`." msgstr "" -#: ../../library/stdtypes.rst:554 +#: ../../library/stdtypes.rst:553 msgid "Added default argument values for ``length`` and ``byteorder``." msgstr "" -#: ../../library/stdtypes.rst:559 +#: ../../library/stdtypes.rst:558 msgid "Return the integer represented by the given array of bytes." msgstr "" -#: ../../library/stdtypes.rst:572 +#: ../../library/stdtypes.rst:571 msgid "" "The argument *bytes* must either be a :term:`bytes-like object` or an " "iterable producing bytes." msgstr "" -#: ../../library/stdtypes.rst:575 +#: ../../library/stdtypes.rst:574 msgid "" "The *byteorder* argument determines the byte order used to represent the " "integer, and defaults to ``\"big\"``. If *byteorder* is ``\"big\"``, the " @@ -868,17 +868,17 @@ msgid "" "byteorder` as the byte order value." msgstr "" -#: ../../library/stdtypes.rst:582 +#: ../../library/stdtypes.rst:581 msgid "" "The *signed* argument indicates whether two's complement is used to " "represent the integer." msgstr "" -#: ../../library/stdtypes.rst:602 +#: ../../library/stdtypes.rst:601 msgid "Added default argument value for ``byteorder``." msgstr "" -#: ../../library/stdtypes.rst:607 +#: ../../library/stdtypes.rst:606 msgid "" "Return a pair of integers whose ratio is exactly equal to the original " "integer and with a positive denominator. The integer ratio of integers " @@ -886,30 +886,30 @@ msgid "" "denominator." msgstr "" -#: ../../library/stdtypes.rst:615 +#: ../../library/stdtypes.rst:614 msgid "Additional Methods on Float" msgstr "" -#: ../../library/stdtypes.rst:617 +#: ../../library/stdtypes.rst:616 msgid "" "The float type implements the :class:`numbers.Real` :term:`abstract base " "class`. float also has the following additional methods." msgstr "" -#: ../../library/stdtypes.rst:622 +#: ../../library/stdtypes.rst:621 msgid "" "Return a pair of integers whose ratio is exactly equal to the original float " "and with a positive denominator. Raises :exc:`OverflowError` on infinities " "and a :exc:`ValueError` on NaNs." msgstr "" -#: ../../library/stdtypes.rst:629 +#: ../../library/stdtypes.rst:628 msgid "" "Return ``True`` if the float instance is finite with integral value, and " "``False`` otherwise::" msgstr "" -#: ../../library/stdtypes.rst:637 +#: ../../library/stdtypes.rst:636 msgid "" "Two methods support conversion to and from hexadecimal strings. Since " "Python's floats are stored internally as binary numbers, converting a float " @@ -919,30 +919,30 @@ msgid "" "numerical work." msgstr "" -#: ../../library/stdtypes.rst:648 +#: ../../library/stdtypes.rst:647 msgid "" "Return a representation of a floating-point number as a hexadecimal string. " "For finite floating-point numbers, this representation will always include a " "leading ``0x`` and a trailing ``p`` and exponent." msgstr "" -#: ../../library/stdtypes.rst:656 +#: ../../library/stdtypes.rst:655 msgid "" "Class method to return the float represented by a hexadecimal string *s*. " "The string *s* may have leading and trailing whitespace." msgstr "" -#: ../../library/stdtypes.rst:661 +#: ../../library/stdtypes.rst:660 msgid "" "Note that :meth:`float.hex` is an instance method, while :meth:`float." "fromhex` is a class method." msgstr "" -#: ../../library/stdtypes.rst:664 +#: ../../library/stdtypes.rst:663 msgid "A hexadecimal string takes the form::" msgstr "" -#: ../../library/stdtypes.rst:668 +#: ../../library/stdtypes.rst:667 msgid "" "where the optional ``sign`` may by either ``+`` or ``-``, ``integer`` and " "``fraction`` are strings of hexadecimal digits, and ``exponent`` is a " @@ -956,7 +956,7 @@ msgid "" "by :meth:`float.fromhex`." msgstr "" -#: ../../library/stdtypes.rst:681 +#: ../../library/stdtypes.rst:680 msgid "" "Note that the exponent is written in decimal rather than hexadecimal, and " "that it gives the power of 2 by which to multiply the coefficient. For " @@ -964,17 +964,17 @@ msgid "" "number ``(3 + 10./16 + 7./16**2) * 2.0**10``, or ``3740.0``::" msgstr "" -#: ../../library/stdtypes.rst:691 +#: ../../library/stdtypes.rst:690 msgid "" "Applying the reverse conversion to ``3740.0`` gives a different hexadecimal " "string representing the same number::" msgstr "" -#: ../../library/stdtypes.rst:701 +#: ../../library/stdtypes.rst:700 msgid "Hashing of numeric types" msgstr "" -#: ../../library/stdtypes.rst:703 +#: ../../library/stdtypes.rst:702 msgid "" "For numbers ``x`` and ``y``, possibly of different types, it's a requirement " "that ``hash(x) == hash(y)`` whenever ``x == y`` (see the :meth:`~object." @@ -990,24 +990,24 @@ msgid "" "of :data:`sys.hash_info`." msgstr "" -#: ../../library/stdtypes.rst:718 +#: ../../library/stdtypes.rst:717 msgid "" "Currently, the prime used is ``P = 2**31 - 1`` on machines with 32-bit C " "longs and ``P = 2**61 - 1`` on machines with 64-bit C longs." msgstr "" -#: ../../library/stdtypes.rst:721 +#: ../../library/stdtypes.rst:720 msgid "Here are the rules in detail:" msgstr "" -#: ../../library/stdtypes.rst:723 +#: ../../library/stdtypes.rst:722 msgid "" "If ``x = m / n`` is a nonnegative rational number and ``n`` is not divisible " "by ``P``, define ``hash(x)`` as ``m * invmod(n, P) % P``, where ``invmod(n, " "P)`` gives the inverse of ``n`` modulo ``P``." msgstr "" -#: ../../library/stdtypes.rst:727 +#: ../../library/stdtypes.rst:726 msgid "" "If ``x = m / n`` is a nonnegative rational number and ``n`` is divisible by " "``P`` (but ``m`` is not) then ``n`` has no inverse modulo ``P`` and the rule " @@ -1015,20 +1015,20 @@ msgid "" "value ``sys.hash_info.inf``." msgstr "" -#: ../../library/stdtypes.rst:732 +#: ../../library/stdtypes.rst:731 msgid "" "If ``x = m / n`` is a negative rational number define ``hash(x)`` as ``-" "hash(-x)``. If the resulting hash is ``-1``, replace it with ``-2``." msgstr "" -#: ../../library/stdtypes.rst:736 +#: ../../library/stdtypes.rst:735 msgid "" "The particular values ``sys.hash_info.inf`` and ``-sys.hash_info.inf`` are " "used as hash values for positive infinity or negative infinity " "(respectively)." msgstr "" -#: ../../library/stdtypes.rst:740 +#: ../../library/stdtypes.rst:739 msgid "" "For a :class:`complex` number ``z``, the hash values of the real and " "imaginary parts are combined by computing ``hash(z.real) + sys.hash_info." @@ -1037,18 +1037,18 @@ msgid "" "1))``. Again, if the result is ``-1``, it's replaced with ``-2``." msgstr "" -#: ../../library/stdtypes.rst:748 +#: ../../library/stdtypes.rst:747 msgid "" "To clarify the above rules, here's some example Python code, equivalent to " "the built-in hash, for computing the hash of a rational number, :class:" "`float`, or :class:`complex`::" msgstr "" -#: ../../library/stdtypes.rst:803 +#: ../../library/stdtypes.rst:802 msgid "Iterator Types" msgstr "" -#: ../../library/stdtypes.rst:811 +#: ../../library/stdtypes.rst:810 msgid "" "Python supports a concept of iteration over containers. This is implemented " "using two distinct methods; these are used to allow user-defined classes to " @@ -1056,13 +1056,13 @@ msgid "" "support the iteration methods." msgstr "" -#: ../../library/stdtypes.rst:816 +#: ../../library/stdtypes.rst:815 msgid "" "One method needs to be defined for container objects to provide :term:" "`iterable` support:" msgstr "" -#: ../../library/stdtypes.rst:823 +#: ../../library/stdtypes.rst:822 msgid "" "Return an :term:`iterator` object. The object is required to support the " "iterator protocol described below. If a container supports different types " @@ -1074,13 +1074,13 @@ msgid "" "in the Python/C API." msgstr "" -#: ../../library/stdtypes.rst:832 +#: ../../library/stdtypes.rst:831 msgid "" "The iterator objects themselves are required to support the following two " "methods, which together form the :dfn:`iterator protocol`:" msgstr "" -#: ../../library/stdtypes.rst:838 +#: ../../library/stdtypes.rst:837 msgid "" "Return the :term:`iterator` object itself. This is required to allow both " "containers and iterators to be used with the :keyword:`for` and :keyword:" @@ -1088,7 +1088,7 @@ msgid "" "tp_iter` slot of the type structure for Python objects in the Python/C API." msgstr "" -#: ../../library/stdtypes.rst:847 +#: ../../library/stdtypes.rst:846 msgid "" "Return the next item from the :term:`iterator`. If there are no further " "items, raise the :exc:`StopIteration` exception. This method corresponds to " @@ -1096,7 +1096,7 @@ msgid "" "Python objects in the Python/C API." msgstr "" -#: ../../library/stdtypes.rst:852 +#: ../../library/stdtypes.rst:851 msgid "" "Python defines several iterator objects to support iteration over general " "and specific sequence types, dictionaries, and other more specialized " @@ -1104,18 +1104,18 @@ msgid "" "the iterator protocol." msgstr "" -#: ../../library/stdtypes.rst:857 +#: ../../library/stdtypes.rst:856 msgid "" "Once an iterator's :meth:`~iterator.__next__` method raises :exc:" "`StopIteration`, it must continue to do so on subsequent calls. " "Implementations that do not obey this property are deemed broken." msgstr "" -#: ../../library/stdtypes.rst:865 +#: ../../library/stdtypes.rst:864 msgid "Generator Types" msgstr "" -#: ../../library/stdtypes.rst:867 +#: ../../library/stdtypes.rst:866 msgid "" "Python's :term:`generator`\\s provide a convenient way to implement the " "iterator protocol. If a container object's :meth:`__iter__` method is " @@ -1125,11 +1125,11 @@ msgid "" "found in :ref:`the documentation for the yield expression `." msgstr "" -#: ../../library/stdtypes.rst:879 +#: ../../library/stdtypes.rst:878 msgid "Sequence Types --- :class:`list`, :class:`tuple`, :class:`range`" msgstr "" -#: ../../library/stdtypes.rst:881 +#: ../../library/stdtypes.rst:880 msgid "" "There are three basic sequence types: lists, tuples, and range objects. " "Additional sequence types tailored for processing of :ref:`binary data " @@ -1137,11 +1137,11 @@ msgid "" "sections." msgstr "" -#: ../../library/stdtypes.rst:890 +#: ../../library/stdtypes.rst:889 msgid "Common Sequence Operations" msgstr "" -#: ../../library/stdtypes.rst:894 +#: ../../library/stdtypes.rst:893 msgid "" "The operations in the following table are supported by most sequence types, " "both mutable and immutable. The :class:`collections.abc.Sequence` ABC is " @@ -1149,7 +1149,7 @@ msgid "" "sequence types." msgstr "" -#: ../../library/stdtypes.rst:899 +#: ../../library/stdtypes.rst:898 msgid "" "This table lists the sequence operations sorted in ascending priority. In " "the table, *s* and *t* are sequences of the same type, *n*, *i*, *j* and *k* " @@ -1157,7 +1157,7 @@ msgid "" "restrictions imposed by *s*." msgstr "" -#: ../../library/stdtypes.rst:904 +#: ../../library/stdtypes.rst:903 msgid "" "The ``in`` and ``not in`` operations have the same priorities as the " "comparison operations. The ``+`` (concatenation) and ``*`` (repetition) " @@ -1165,125 +1165,125 @@ msgid "" "[3]_" msgstr "" -#: ../../library/stdtypes.rst:925 +#: ../../library/stdtypes.rst:924 msgid "``x in s``" msgstr "``x in s``" -#: ../../library/stdtypes.rst:925 +#: ../../library/stdtypes.rst:924 msgid "``True`` if an item of *s* is equal to *x*, else ``False``" msgstr "" -#: ../../library/stdtypes.rst:928 +#: ../../library/stdtypes.rst:927 msgid "``x not in s``" msgstr "``x not in s``" -#: ../../library/stdtypes.rst:928 +#: ../../library/stdtypes.rst:927 msgid "``False`` if an item of *s* is equal to *x*, else ``True``" msgstr "" -#: ../../library/stdtypes.rst:931 +#: ../../library/stdtypes.rst:930 msgid "``s + t``" msgstr "``s + t``" -#: ../../library/stdtypes.rst:931 +#: ../../library/stdtypes.rst:930 msgid "the concatenation of *s* and *t*" msgstr "" -#: ../../library/stdtypes.rst:931 +#: ../../library/stdtypes.rst:930 msgid "(6)(7)" msgstr "(6)(7)" -#: ../../library/stdtypes.rst:934 +#: ../../library/stdtypes.rst:933 msgid "``s * n`` or ``n * s``" msgstr "``s * n`` 或 ``n * s``" -#: ../../library/stdtypes.rst:934 +#: ../../library/stdtypes.rst:933 msgid "equivalent to adding *s* to itself *n* times" msgstr "" -#: ../../library/stdtypes.rst:934 +#: ../../library/stdtypes.rst:933 msgid "(2)(7)" msgstr "(2)(7)" -#: ../../library/stdtypes.rst:937 +#: ../../library/stdtypes.rst:936 msgid "``s[i]``" msgstr "``s[i]``" -#: ../../library/stdtypes.rst:937 +#: ../../library/stdtypes.rst:936 msgid "*i*\\ th item of *s*, origin 0" msgstr "" -#: ../../library/stdtypes.rst:939 +#: ../../library/stdtypes.rst:938 msgid "``s[i:j]``" msgstr "``s[i:j]``" -#: ../../library/stdtypes.rst:939 +#: ../../library/stdtypes.rst:938 msgid "slice of *s* from *i* to *j*" msgstr "" -#: ../../library/stdtypes.rst:939 +#: ../../library/stdtypes.rst:938 msgid "(3)(4)" msgstr "(3)(4)" -#: ../../library/stdtypes.rst:941 +#: ../../library/stdtypes.rst:940 msgid "``s[i:j:k]``" msgstr "``s[i:j:k]``" -#: ../../library/stdtypes.rst:941 +#: ../../library/stdtypes.rst:940 msgid "slice of *s* from *i* to *j* with step *k*" msgstr "" -#: ../../library/stdtypes.rst:941 +#: ../../library/stdtypes.rst:940 msgid "(3)(5)" msgstr "(3)(5)" -#: ../../library/stdtypes.rst:944 +#: ../../library/stdtypes.rst:943 msgid "``len(s)``" msgstr "``len(s)``" -#: ../../library/stdtypes.rst:944 +#: ../../library/stdtypes.rst:943 msgid "length of *s*" msgstr "" -#: ../../library/stdtypes.rst:946 +#: ../../library/stdtypes.rst:945 msgid "``min(s)``" msgstr "``min(s)``" -#: ../../library/stdtypes.rst:946 +#: ../../library/stdtypes.rst:945 msgid "smallest item of *s*" msgstr "" -#: ../../library/stdtypes.rst:948 +#: ../../library/stdtypes.rst:947 msgid "``max(s)``" msgstr "``max(s)``" -#: ../../library/stdtypes.rst:948 +#: ../../library/stdtypes.rst:947 msgid "largest item of *s*" msgstr "" -#: ../../library/stdtypes.rst:950 +#: ../../library/stdtypes.rst:949 msgid "``s.index(x[, i[, j]])``" msgstr "``s.index(x[, i[, j]])``" -#: ../../library/stdtypes.rst:950 +#: ../../library/stdtypes.rst:949 msgid "" "index of the first occurrence of *x* in *s* (at or after index *i* and " "before index *j*)" msgstr "" -#: ../../library/stdtypes.rst:950 ../../library/stdtypes.rst:3599 +#: ../../library/stdtypes.rst:949 ../../library/stdtypes.rst:3598 msgid "\\(8)" msgstr "\\(8)" -#: ../../library/stdtypes.rst:954 +#: ../../library/stdtypes.rst:953 msgid "``s.count(x)``" msgstr "``s.count(x)``" -#: ../../library/stdtypes.rst:954 +#: ../../library/stdtypes.rst:953 msgid "total number of occurrences of *x* in *s*" msgstr "" -#: ../../library/stdtypes.rst:958 +#: ../../library/stdtypes.rst:957 msgid "" "Sequences of the same type also support comparisons. In particular, tuples " "and lists are compared lexicographically by comparing corresponding " @@ -1292,7 +1292,7 @@ msgid "" "(For full details see :ref:`comparisons` in the language reference.)" msgstr "" -#: ../../library/stdtypes.rst:968 +#: ../../library/stdtypes.rst:967 msgid "" "Forward and reversed iterators over mutable sequences access values using an " "index. That index will continue to march forward (or backward) even if the " @@ -1301,7 +1301,7 @@ msgid "" "drops below zero)." msgstr "" -#: ../../library/stdtypes.rst:977 +#: ../../library/stdtypes.rst:976 msgid "" "While the ``in`` and ``not in`` operations are used only for simple " "containment testing in the general case, some specialised sequences (such " @@ -1309,7 +1309,7 @@ msgid "" "subsequence testing::" msgstr "" -#: ../../library/stdtypes.rst:986 +#: ../../library/stdtypes.rst:985 msgid "" "Values of *n* less than ``0`` are treated as ``0`` (which yields an empty " "sequence of the same type as *s*). Note that items in the sequence *s* are " @@ -1317,7 +1317,7 @@ msgid "" "Python programmers; consider::" msgstr "" -#: ../../library/stdtypes.rst:998 +#: ../../library/stdtypes.rst:997 msgid "" "What has happened is that ``[[]]`` is a one-element list containing an empty " "list, so all three elements of ``[[]] * 3`` are references to this single " @@ -1325,20 +1325,20 @@ msgid "" "list. You can create a list of different lists this way::" msgstr "" -#: ../../library/stdtypes.rst:1010 +#: ../../library/stdtypes.rst:1009 msgid "" "Further explanation is available in the FAQ entry :ref:`faq-multidimensional-" "list`." msgstr "" -#: ../../library/stdtypes.rst:1014 +#: ../../library/stdtypes.rst:1013 msgid "" "If *i* or *j* is negative, the index is relative to the end of sequence *s*: " "``len(s) + i`` or ``len(s) + j`` is substituted. But note that ``-0`` is " "still ``0``." msgstr "" -#: ../../library/stdtypes.rst:1019 +#: ../../library/stdtypes.rst:1018 msgid "" "The slice of *s* from *i* to *j* is defined as the sequence of items with " "index *k* such that ``i <= k < j``. If *i* or *j* is greater than " @@ -1347,7 +1347,7 @@ msgid "" "to *j*, the slice is empty." msgstr "" -#: ../../library/stdtypes.rst:1026 +#: ../../library/stdtypes.rst:1025 msgid "" "The slice of *s* from *i* to *j* with step *k* is defined as the sequence of " "items with index ``x = i + n*k`` such that ``0 <= n < (j-i)/k``. In other " @@ -1360,7 +1360,7 @@ msgid "" "``None``, it is treated like ``1``." msgstr "" -#: ../../library/stdtypes.rst:1037 +#: ../../library/stdtypes.rst:1036 msgid "" "Concatenating immutable sequences always results in a new object. This " "means that building up a sequence by repeated concatenation will have a " @@ -1368,14 +1368,14 @@ msgid "" "runtime cost, you must switch to one of the alternatives below:" msgstr "" -#: ../../library/stdtypes.rst:1042 +#: ../../library/stdtypes.rst:1041 msgid "" "if concatenating :class:`str` objects, you can build a list and use :meth:" "`str.join` at the end or else write to an :class:`io.StringIO` instance and " "retrieve its value when complete" msgstr "" -#: ../../library/stdtypes.rst:1046 +#: ../../library/stdtypes.rst:1045 msgid "" "if concatenating :class:`bytes` objects, you can similarly use :meth:`bytes." "join` or :class:`io.BytesIO`, or you can do in-place concatenation with a :" @@ -1383,22 +1383,22 @@ msgid "" "an efficient overallocation mechanism" msgstr "" -#: ../../library/stdtypes.rst:1051 +#: ../../library/stdtypes.rst:1050 msgid "if concatenating :class:`tuple` objects, extend a :class:`list` instead" msgstr "" -#: ../../library/stdtypes.rst:1053 +#: ../../library/stdtypes.rst:1052 msgid "for other types, investigate the relevant class documentation" msgstr "" -#: ../../library/stdtypes.rst:1057 +#: ../../library/stdtypes.rst:1056 msgid "" "Some sequence types (such as :class:`range`) only support item sequences " "that follow specific patterns, and hence don't support sequence " "concatenation or repetition." msgstr "" -#: ../../library/stdtypes.rst:1062 +#: ../../library/stdtypes.rst:1061 msgid "" "``index`` raises :exc:`ValueError` when *x* is not found in *s*. Not all " "implementations support passing the additional arguments *i* and *j*. These " @@ -1408,42 +1408,42 @@ msgid "" "start of the sequence rather than the start of the slice." msgstr "" -#: ../../library/stdtypes.rst:1073 +#: ../../library/stdtypes.rst:1072 msgid "Immutable Sequence Types" msgstr "" -#: ../../library/stdtypes.rst:1080 +#: ../../library/stdtypes.rst:1079 msgid "" "The only operation that immutable sequence types generally implement that is " "not also implemented by mutable sequence types is support for the :func:" "`hash` built-in." msgstr "" -#: ../../library/stdtypes.rst:1084 +#: ../../library/stdtypes.rst:1083 msgid "" "This support allows immutable sequences, such as :class:`tuple` instances, " "to be used as :class:`dict` keys and stored in :class:`set` and :class:" "`frozenset` instances." msgstr "" -#: ../../library/stdtypes.rst:1088 +#: ../../library/stdtypes.rst:1087 msgid "" "Attempting to hash an immutable sequence that contains unhashable values " "will result in :exc:`TypeError`." msgstr "" -#: ../../library/stdtypes.rst:1095 +#: ../../library/stdtypes.rst:1094 msgid "Mutable Sequence Types" msgstr "" -#: ../../library/stdtypes.rst:1102 +#: ../../library/stdtypes.rst:1101 msgid "" "The operations in the following table are defined on mutable sequence types. " "The :class:`collections.abc.MutableSequence` ABC is provided to make it " "easier to correctly implement these operations on custom sequence types." msgstr "" -#: ../../library/stdtypes.rst:1106 +#: ../../library/stdtypes.rst:1105 msgid "" "In the table *s* is an instance of a mutable sequence type, *t* is any " "iterable object and *x* is an arbitrary object that meets any type and value " @@ -1451,145 +1451,145 @@ msgid "" "integers that meet the value restriction ``0 <= x <= 255``)." msgstr "" -#: ../../library/stdtypes.rst:1130 +#: ../../library/stdtypes.rst:1129 msgid "``s[i] = x``" msgstr "``s[i] = x``" -#: ../../library/stdtypes.rst:1130 +#: ../../library/stdtypes.rst:1129 msgid "item *i* of *s* is replaced by *x*" msgstr "" -#: ../../library/stdtypes.rst:1133 +#: ../../library/stdtypes.rst:1132 msgid "``s[i:j] = t``" msgstr "``s[i:j] = t``" -#: ../../library/stdtypes.rst:1133 +#: ../../library/stdtypes.rst:1132 msgid "" "slice of *s* from *i* to *j* is replaced by the contents of the iterable *t*" msgstr "" -#: ../../library/stdtypes.rst:1137 +#: ../../library/stdtypes.rst:1136 msgid "``del s[i:j]``" msgstr "``del s[i:j]``" -#: ../../library/stdtypes.rst:1137 +#: ../../library/stdtypes.rst:1136 msgid "same as ``s[i:j] = []``" msgstr "" -#: ../../library/stdtypes.rst:1139 +#: ../../library/stdtypes.rst:1138 msgid "``s[i:j:k] = t``" msgstr "``s[i:j:k] = t``" -#: ../../library/stdtypes.rst:1139 +#: ../../library/stdtypes.rst:1138 msgid "the elements of ``s[i:j:k]`` are replaced by those of *t*" msgstr "" -#: ../../library/stdtypes.rst:1142 +#: ../../library/stdtypes.rst:1141 msgid "``del s[i:j:k]``" msgstr "``del s[i:j:k]``" -#: ../../library/stdtypes.rst:1142 +#: ../../library/stdtypes.rst:1141 msgid "removes the elements of ``s[i:j:k]`` from the list" msgstr "" -#: ../../library/stdtypes.rst:1145 +#: ../../library/stdtypes.rst:1144 msgid "``s.append(x)``" msgstr "``s.append(x)``" -#: ../../library/stdtypes.rst:1145 +#: ../../library/stdtypes.rst:1144 msgid "" "appends *x* to the end of the sequence (same as ``s[len(s):len(s)] = [x]``)" msgstr "" -#: ../../library/stdtypes.rst:1149 +#: ../../library/stdtypes.rst:1148 msgid "``s.clear()``" msgstr "``s.clear()``" -#: ../../library/stdtypes.rst:1149 +#: ../../library/stdtypes.rst:1148 msgid "removes all items from *s* (same as ``del s[:]``)" msgstr "" -#: ../../library/stdtypes.rst:1152 +#: ../../library/stdtypes.rst:1151 msgid "``s.copy()``" msgstr "``s.copy()``" -#: ../../library/stdtypes.rst:1152 +#: ../../library/stdtypes.rst:1151 msgid "creates a shallow copy of *s* (same as ``s[:]``)" msgstr "" -#: ../../library/stdtypes.rst:1155 +#: ../../library/stdtypes.rst:1154 msgid "``s.extend(t)`` or ``s += t``" msgstr "``s.extend(t)`` 或 ``s += t``" -#: ../../library/stdtypes.rst:1155 +#: ../../library/stdtypes.rst:1154 msgid "" "extends *s* with the contents of *t* (for the most part the same as " "``s[len(s):len(s)] = t``)" msgstr "" -#: ../../library/stdtypes.rst:1160 +#: ../../library/stdtypes.rst:1159 msgid "``s *= n``" msgstr "``s *= n``" -#: ../../library/stdtypes.rst:1160 +#: ../../library/stdtypes.rst:1159 msgid "updates *s* with its contents repeated *n* times" msgstr "" -#: ../../library/stdtypes.rst:1163 +#: ../../library/stdtypes.rst:1162 msgid "``s.insert(i, x)``" msgstr "``s.insert(i, x)``" -#: ../../library/stdtypes.rst:1163 +#: ../../library/stdtypes.rst:1162 msgid "" "inserts *x* into *s* at the index given by *i* (same as ``s[i:i] = [x]``)" msgstr "" -#: ../../library/stdtypes.rst:1167 +#: ../../library/stdtypes.rst:1166 msgid "``s.pop()`` or ``s.pop(i)``" msgstr "``s.pop()`` 或 ``s.pop(i)``" -#: ../../library/stdtypes.rst:1167 +#: ../../library/stdtypes.rst:1166 msgid "retrieves the item at *i* and also removes it from *s*" msgstr "" -#: ../../library/stdtypes.rst:1170 +#: ../../library/stdtypes.rst:1169 msgid "``s.remove(x)``" msgstr "``s.remove(x)``" -#: ../../library/stdtypes.rst:1170 +#: ../../library/stdtypes.rst:1169 msgid "remove the first item from *s* where ``s[i]`` is equal to *x*" msgstr "" -#: ../../library/stdtypes.rst:1173 +#: ../../library/stdtypes.rst:1172 msgid "``s.reverse()``" msgstr "``s.reverse()``" -#: ../../library/stdtypes.rst:1173 +#: ../../library/stdtypes.rst:1172 msgid "reverses the items of *s* in place" msgstr "" -#: ../../library/stdtypes.rst:1181 +#: ../../library/stdtypes.rst:1180 msgid "*t* must have the same length as the slice it is replacing." msgstr "" -#: ../../library/stdtypes.rst:1184 +#: ../../library/stdtypes.rst:1183 msgid "" "The optional argument *i* defaults to ``-1``, so that by default the last " "item is removed and returned." msgstr "" -#: ../../library/stdtypes.rst:1188 +#: ../../library/stdtypes.rst:1187 msgid ":meth:`remove` raises :exc:`ValueError` when *x* is not found in *s*." msgstr "" -#: ../../library/stdtypes.rst:1191 +#: ../../library/stdtypes.rst:1190 msgid "" "The :meth:`reverse` method modifies the sequence in place for economy of " "space when reversing a large sequence. To remind users that it operates by " "side effect, it does not return the reversed sequence." msgstr "" -#: ../../library/stdtypes.rst:1196 +#: ../../library/stdtypes.rst:1195 msgid "" ":meth:`clear` and :meth:`!copy` are included for consistency with the " "interfaces of mutable containers that don't support slicing operations (such " @@ -1598,11 +1598,11 @@ msgid "" "classes provide it." msgstr "" -#: ../../library/stdtypes.rst:1202 +#: ../../library/stdtypes.rst:1201 msgid ":meth:`clear` and :meth:`!copy` methods." msgstr "" -#: ../../library/stdtypes.rst:1206 +#: ../../library/stdtypes.rst:1205 msgid "" "The value *n* is an integer, or an object implementing :meth:`~object." "__index__`. Zero and negative values of *n* clear the sequence. Items in " @@ -1610,39 +1610,39 @@ msgid "" "explained for ``s * n`` under :ref:`typesseq-common`." msgstr "" -#: ../../library/stdtypes.rst:1215 +#: ../../library/stdtypes.rst:1214 msgid "Lists" msgstr "List(串列)" -#: ../../library/stdtypes.rst:1219 +#: ../../library/stdtypes.rst:1218 msgid "" "Lists are mutable sequences, typically used to store collections of " "homogeneous items (where the precise degree of similarity will vary by " "application)." msgstr "" -#: ../../library/stdtypes.rst:1225 +#: ../../library/stdtypes.rst:1224 msgid "Lists may be constructed in several ways:" msgstr "" -#: ../../library/stdtypes.rst:1227 +#: ../../library/stdtypes.rst:1226 msgid "Using a pair of square brackets to denote the empty list: ``[]``" msgstr "" -#: ../../library/stdtypes.rst:1228 +#: ../../library/stdtypes.rst:1227 msgid "" "Using square brackets, separating items with commas: ``[a]``, ``[a, b, c]``" msgstr "" -#: ../../library/stdtypes.rst:1229 +#: ../../library/stdtypes.rst:1228 msgid "Using a list comprehension: ``[x for x in iterable]``" msgstr "" -#: ../../library/stdtypes.rst:1230 +#: ../../library/stdtypes.rst:1229 msgid "Using the type constructor: ``list()`` or ``list(iterable)``" msgstr "" -#: ../../library/stdtypes.rst:1232 +#: ../../library/stdtypes.rst:1231 msgid "" "The constructor builds a list whose items are the same and in the same order " "as *iterable*'s items. *iterable* may be either a sequence, a container " @@ -1653,20 +1653,20 @@ msgid "" "new empty list, ``[]``." msgstr "" -#: ../../library/stdtypes.rst:1241 +#: ../../library/stdtypes.rst:1240 msgid "" "Many other operations also produce lists, including the :func:`sorted` built-" "in." msgstr "" -#: ../../library/stdtypes.rst:1244 +#: ../../library/stdtypes.rst:1243 msgid "" "Lists implement all of the :ref:`common ` and :ref:`mutable " "` sequence operations. Lists also provide the following " "additional method:" msgstr "" -#: ../../library/stdtypes.rst:1250 +#: ../../library/stdtypes.rst:1249 msgid "" "This method sorts the list in place, using only ``<`` comparisons between " "items. Exceptions are not suppressed - if any comparison operations fail, " @@ -1674,13 +1674,13 @@ msgid "" "partially modified state)." msgstr "" -#: ../../library/stdtypes.rst:1255 +#: ../../library/stdtypes.rst:1254 msgid "" ":meth:`sort` accepts two arguments that can only be passed by keyword (:ref:" "`keyword-only arguments `):" msgstr "" -#: ../../library/stdtypes.rst:1258 +#: ../../library/stdtypes.rst:1257 msgid "" "*key* specifies a function of one argument that is used to extract a " "comparison key from each list element (for example, ``key=str.lower``). The " @@ -1689,19 +1689,19 @@ msgid "" "list items are sorted directly without calculating a separate key value." msgstr "" -#: ../../library/stdtypes.rst:1265 +#: ../../library/stdtypes.rst:1264 msgid "" "The :func:`functools.cmp_to_key` utility is available to convert a 2.x style " "*cmp* function to a *key* function." msgstr "" -#: ../../library/stdtypes.rst:1268 +#: ../../library/stdtypes.rst:1267 msgid "" "*reverse* is a boolean value. If set to ``True``, then the list elements " "are sorted as if each comparison were reversed." msgstr "" -#: ../../library/stdtypes.rst:1271 +#: ../../library/stdtypes.rst:1270 msgid "" "This method modifies the sequence in place for economy of space when sorting " "a large sequence. To remind users that it operates by side effect, it does " @@ -1709,7 +1709,7 @@ msgid "" "new sorted list instance)." msgstr "" -#: ../../library/stdtypes.rst:1276 +#: ../../library/stdtypes.rst:1275 msgid "" "The :meth:`sort` method is guaranteed to be stable. A sort is stable if it " "guarantees not to change the relative order of elements that compare equal " @@ -1717,12 +1717,12 @@ msgid "" "department, then by salary grade)." msgstr "" -#: ../../library/stdtypes.rst:1281 +#: ../../library/stdtypes.rst:1280 msgid "" "For sorting examples and a brief sorting tutorial, see :ref:`sortinghowto`." msgstr "" -#: ../../library/stdtypes.rst:1285 +#: ../../library/stdtypes.rst:1284 msgid "" "While a list is being sorted, the effect of attempting to mutate, or even " "inspect, the list is undefined. The C implementation of Python makes the " @@ -1730,11 +1730,11 @@ msgid "" "detect that the list has been mutated during a sort." msgstr "" -#: ../../library/stdtypes.rst:1294 +#: ../../library/stdtypes.rst:1293 msgid "Tuples" msgstr "" -#: ../../library/stdtypes.rst:1298 +#: ../../library/stdtypes.rst:1297 msgid "" "Tuples are immutable sequences, typically used to store collections of " "heterogeneous data (such as the 2-tuples produced by the :func:`enumerate` " @@ -1743,27 +1743,27 @@ msgid "" "class:`dict` instance)." msgstr "" -#: ../../library/stdtypes.rst:1306 +#: ../../library/stdtypes.rst:1305 msgid "Tuples may be constructed in a number of ways:" msgstr "" -#: ../../library/stdtypes.rst:1308 +#: ../../library/stdtypes.rst:1307 msgid "Using a pair of parentheses to denote the empty tuple: ``()``" msgstr "" -#: ../../library/stdtypes.rst:1309 +#: ../../library/stdtypes.rst:1308 msgid "Using a trailing comma for a singleton tuple: ``a,`` or ``(a,)``" msgstr "" -#: ../../library/stdtypes.rst:1310 +#: ../../library/stdtypes.rst:1309 msgid "Separating items with commas: ``a, b, c`` or ``(a, b, c)``" msgstr "" -#: ../../library/stdtypes.rst:1311 +#: ../../library/stdtypes.rst:1310 msgid "Using the :func:`tuple` built-in: ``tuple()`` or ``tuple(iterable)``" msgstr "" -#: ../../library/stdtypes.rst:1313 +#: ../../library/stdtypes.rst:1312 msgid "" "The constructor builds a tuple whose items are the same and in the same " "order as *iterable*'s items. *iterable* may be either a sequence, a " @@ -1774,7 +1774,7 @@ msgid "" "``()``." msgstr "" -#: ../../library/stdtypes.rst:1321 +#: ../../library/stdtypes.rst:1320 msgid "" "Note that it is actually the comma which makes a tuple, not the parentheses. " "The parentheses are optional, except in the empty tuple case, or when they " @@ -1783,30 +1783,30 @@ msgid "" "call with a 3-tuple as the sole argument." msgstr "" -#: ../../library/stdtypes.rst:1327 +#: ../../library/stdtypes.rst:1326 msgid "" "Tuples implement all of the :ref:`common ` sequence " "operations." msgstr "" -#: ../../library/stdtypes.rst:1330 +#: ../../library/stdtypes.rst:1329 msgid "" "For heterogeneous collections of data where access by name is clearer than " "access by index, :func:`collections.namedtuple` may be a more appropriate " "choice than a simple tuple object." msgstr "" -#: ../../library/stdtypes.rst:1338 +#: ../../library/stdtypes.rst:1337 msgid "Ranges" msgstr "" -#: ../../library/stdtypes.rst:1342 +#: ../../library/stdtypes.rst:1341 msgid "" "The :class:`range` type represents an immutable sequence of numbers and is " "commonly used for looping a specific number of times in :keyword:`for` loops." msgstr "" -#: ../../library/stdtypes.rst:1349 +#: ../../library/stdtypes.rst:1348 msgid "" "The arguments to the range constructor must be integers (either built-in :" "class:`int` or any object that implements the :meth:`~object.__index__` " @@ -1815,38 +1815,38 @@ msgid "" "zero, :exc:`ValueError` is raised." msgstr "" -#: ../../library/stdtypes.rst:1355 +#: ../../library/stdtypes.rst:1354 msgid "" "For a positive *step*, the contents of a range ``r`` are determined by the " "formula ``r[i] = start + step*i`` where ``i >= 0`` and ``r[i] < stop``." msgstr "" -#: ../../library/stdtypes.rst:1359 +#: ../../library/stdtypes.rst:1358 msgid "" "For a negative *step*, the contents of the range are still determined by the " "formula ``r[i] = start + step*i``, but the constraints are ``i >= 0`` and " "``r[i] > stop``." msgstr "" -#: ../../library/stdtypes.rst:1363 +#: ../../library/stdtypes.rst:1362 msgid "" "A range object will be empty if ``r[0]`` does not meet the value constraint. " "Ranges do support negative indices, but these are interpreted as indexing " "from the end of the sequence determined by the positive indices." msgstr "" -#: ../../library/stdtypes.rst:1368 +#: ../../library/stdtypes.rst:1367 msgid "" "Ranges containing absolute values larger than :data:`sys.maxsize` are " "permitted but some features (such as :func:`len`) may raise :exc:" "`OverflowError`." msgstr "" -#: ../../library/stdtypes.rst:1372 +#: ../../library/stdtypes.rst:1371 msgid "Range examples::" msgstr "" -#: ../../library/stdtypes.rst:1389 +#: ../../library/stdtypes.rst:1388 msgid "" "Ranges implement all of the :ref:`common ` sequence " "operations except concatenation and repetition (due to the fact that range " @@ -1854,23 +1854,23 @@ msgid "" "repetition and concatenation will usually violate that pattern)." msgstr "" -#: ../../library/stdtypes.rst:1396 +#: ../../library/stdtypes.rst:1395 msgid "" "The value of the *start* parameter (or ``0`` if the parameter was not " "supplied)" msgstr "" -#: ../../library/stdtypes.rst:1401 +#: ../../library/stdtypes.rst:1400 msgid "The value of the *stop* parameter" msgstr "" -#: ../../library/stdtypes.rst:1405 +#: ../../library/stdtypes.rst:1404 msgid "" "The value of the *step* parameter (or ``1`` if the parameter was not " "supplied)" msgstr "" -#: ../../library/stdtypes.rst:1408 +#: ../../library/stdtypes.rst:1407 msgid "" "The advantage of the :class:`range` type over a regular :class:`list` or :" "class:`tuple` is that a :class:`range` object will always take the same " @@ -1879,14 +1879,14 @@ msgid "" "individual items and subranges as needed)." msgstr "" -#: ../../library/stdtypes.rst:1414 +#: ../../library/stdtypes.rst:1413 msgid "" "Range objects implement the :class:`collections.abc.Sequence` ABC, and " "provide features such as containment tests, element index lookup, slicing " "and support for negative indices (see :ref:`typesseq`):" msgstr "" -#: ../../library/stdtypes.rst:1434 +#: ../../library/stdtypes.rst:1433 msgid "" "Testing range objects for equality with ``==`` and ``!=`` compares them as " "sequences. That is, two range objects are considered equal if they " @@ -1896,111 +1896,111 @@ msgid "" "3)`` or ``range(0, 3, 2) == range(0, 4, 2)``.)" msgstr "" -#: ../../library/stdtypes.rst:1441 +#: ../../library/stdtypes.rst:1440 msgid "" "Implement the Sequence ABC. Support slicing and negative indices. Test :" "class:`int` objects for membership in constant time instead of iterating " "through all items." msgstr "" -#: ../../library/stdtypes.rst:1447 +#: ../../library/stdtypes.rst:1446 msgid "" "Define '==' and '!=' to compare range objects based on the sequence of " "values they define (instead of comparing based on object identity)." msgstr "" -#: ../../library/stdtypes.rst:1452 +#: ../../library/stdtypes.rst:1451 msgid "" "The :attr:`~range.start`, :attr:`~range.stop` and :attr:`~range.step` " "attributes." msgstr "" -#: ../../library/stdtypes.rst:1458 +#: ../../library/stdtypes.rst:1457 msgid "" "The `linspace recipe `_ shows " "how to implement a lazy version of range suitable for floating point " "applications." msgstr "" -#: ../../library/stdtypes.rst:1470 +#: ../../library/stdtypes.rst:1469 msgid "Text Sequence Type --- :class:`str`" msgstr "" -#: ../../library/stdtypes.rst:1472 +#: ../../library/stdtypes.rst:1471 msgid "" "Textual data in Python is handled with :class:`str` objects, or :dfn:" "`strings`. Strings are immutable :ref:`sequences ` of Unicode code " "points. String literals are written in a variety of ways:" msgstr "" -#: ../../library/stdtypes.rst:1477 +#: ../../library/stdtypes.rst:1476 msgid "Single quotes: ``'allows embedded \"double\" quotes'``" msgstr "" -#: ../../library/stdtypes.rst:1478 +#: ../../library/stdtypes.rst:1477 msgid "Double quotes: ``\"allows embedded 'single' quotes\"``" msgstr "" -#: ../../library/stdtypes.rst:1479 +#: ../../library/stdtypes.rst:1478 msgid "" "Triple quoted: ``'''Three single quotes'''``, ``\"\"\"Three double " "quotes\"\"\"``" msgstr "" -#: ../../library/stdtypes.rst:1481 +#: ../../library/stdtypes.rst:1480 msgid "" "Triple quoted strings may span multiple lines - all associated whitespace " "will be included in the string literal." msgstr "" -#: ../../library/stdtypes.rst:1484 +#: ../../library/stdtypes.rst:1483 msgid "" "String literals that are part of a single expression and have only " "whitespace between them will be implicitly converted to a single string " "literal. That is, ``(\"spam \" \"eggs\") == \"spam eggs\"``." msgstr "" -#: ../../library/stdtypes.rst:1488 +#: ../../library/stdtypes.rst:1487 msgid "" "See :ref:`strings` for more about the various forms of string literal, " "including supported escape sequences, and the ``r`` (\"raw\") prefix that " "disables most escape sequence processing." msgstr "" -#: ../../library/stdtypes.rst:1492 +#: ../../library/stdtypes.rst:1491 msgid "" "Strings may also be created from other objects using the :class:`str` " "constructor." msgstr "" -#: ../../library/stdtypes.rst:1495 +#: ../../library/stdtypes.rst:1494 msgid "" "Since there is no separate \"character\" type, indexing a string produces " "strings of length 1. That is, for a non-empty string *s*, ``s[0] == s[0:1]``." msgstr "" -#: ../../library/stdtypes.rst:1501 +#: ../../library/stdtypes.rst:1500 msgid "" "There is also no mutable string type, but :meth:`str.join` or :class:`io." "StringIO` can be used to efficiently construct strings from multiple " "fragments." msgstr "" -#: ../../library/stdtypes.rst:1505 +#: ../../library/stdtypes.rst:1504 msgid "" "For backwards compatibility with the Python 2 series, the ``u`` prefix is " "once again permitted on string literals. It has no effect on the meaning of " "string literals and cannot be combined with the ``r`` prefix." msgstr "" -#: ../../library/stdtypes.rst:1517 +#: ../../library/stdtypes.rst:1516 msgid "" "Return a :ref:`string ` version of *object*. If *object* is not " "provided, returns the empty string. Otherwise, the behavior of ``str()`` " "depends on whether *encoding* or *errors* is given, as follows." msgstr "" -#: ../../library/stdtypes.rst:1521 +#: ../../library/stdtypes.rst:1520 msgid "" "If neither *encoding* nor *errors* is given, ``str(object)`` returns :meth:" "`type(object).__str__(object) `, which is the \"informal\" " @@ -2010,7 +2010,7 @@ msgid "" "`repr(object) `." msgstr "" -#: ../../library/stdtypes.rst:1533 +#: ../../library/stdtypes.rst:1532 msgid "" "If at least one of *encoding* or *errors* is given, *object* should be a :" "term:`bytes-like object` (e.g. :class:`bytes` or :class:`bytearray`). In " @@ -2022,7 +2022,7 @@ msgid "" "buffer objects." msgstr "" -#: ../../library/stdtypes.rst:1542 +#: ../../library/stdtypes.rst:1541 msgid "" "Passing a :class:`bytes` object to :func:`str` without the *encoding* or " "*errors* arguments falls under the first case of returning the informal " @@ -2030,7 +2030,7 @@ msgid "" "Python). For example::" msgstr "" -#: ../../library/stdtypes.rst:1550 +#: ../../library/stdtypes.rst:1549 msgid "" "For more information on the ``str`` class and its methods, see :ref:" "`textseq` and the :ref:`string-methods` section below. To output formatted " @@ -2038,17 +2038,17 @@ msgid "" "addition, see the :ref:`stringservices` section." msgstr "" -#: ../../library/stdtypes.rst:1562 +#: ../../library/stdtypes.rst:1561 msgid "String Methods" msgstr "" -#: ../../library/stdtypes.rst:1567 +#: ../../library/stdtypes.rst:1566 msgid "" "Strings implement all of the :ref:`common ` sequence " "operations, along with the additional methods described below." msgstr "" -#: ../../library/stdtypes.rst:1570 +#: ../../library/stdtypes.rst:1569 msgid "" "Strings also support two styles of string formatting, one providing a large " "degree of flexibility and customization (see :meth:`str.format`, :ref:" @@ -2058,33 +2058,33 @@ msgid "" "handle (:ref:`old-string-formatting`)." msgstr "" -#: ../../library/stdtypes.rst:1577 +#: ../../library/stdtypes.rst:1576 msgid "" "The :ref:`textservices` section of the standard library covers a number of " "other modules that provide various text related utilities (including regular " "expression support in the :mod:`re` module)." msgstr "" -#: ../../library/stdtypes.rst:1583 +#: ../../library/stdtypes.rst:1582 msgid "" "Return a copy of the string with its first character capitalized and the " "rest lowercased." msgstr "" -#: ../../library/stdtypes.rst:1586 +#: ../../library/stdtypes.rst:1585 msgid "" "The first character is now put into titlecase rather than uppercase. This " "means that characters like digraphs will only have their first letter " "capitalized, instead of the full character." msgstr "" -#: ../../library/stdtypes.rst:1593 +#: ../../library/stdtypes.rst:1592 msgid "" "Return a casefolded copy of the string. Casefolded strings may be used for " "caseless matching." msgstr "" -#: ../../library/stdtypes.rst:1596 +#: ../../library/stdtypes.rst:1595 msgid "" "Casefolding is similar to lowercasing but more aggressive because it is " "intended to remove all case distinctions in a string. For example, the " @@ -2093,43 +2093,43 @@ msgid "" "`casefold` converts it to ``\"ss\"``." msgstr "" -#: ../../library/stdtypes.rst:1602 +#: ../../library/stdtypes.rst:1601 msgid "" "The casefolding algorithm is described in section 3.13 of the Unicode " "Standard." msgstr "" -#: ../../library/stdtypes.rst:1610 +#: ../../library/stdtypes.rst:1609 msgid "" "Return centered in a string of length *width*. Padding is done using the " "specified *fillchar* (default is an ASCII space). The original string is " "returned if *width* is less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:1618 +#: ../../library/stdtypes.rst:1617 msgid "" "Return the number of non-overlapping occurrences of substring *sub* in the " "range [*start*, *end*]. Optional arguments *start* and *end* are " "interpreted as in slice notation." msgstr "" -#: ../../library/stdtypes.rst:1622 +#: ../../library/stdtypes.rst:1621 msgid "" "If *sub* is empty, returns the number of empty strings between characters " "which is the length of the string plus one." msgstr "" -#: ../../library/stdtypes.rst:1628 +#: ../../library/stdtypes.rst:1627 msgid "Return the string encoded to :class:`bytes`." msgstr "" -#: ../../library/stdtypes.rst:1630 ../../library/stdtypes.rst:2765 +#: ../../library/stdtypes.rst:1629 ../../library/stdtypes.rst:2764 msgid "" "*encoding* defaults to ``'utf-8'``; see :ref:`standard-encodings` for " "possible values." msgstr "" -#: ../../library/stdtypes.rst:1633 +#: ../../library/stdtypes.rst:1632 msgid "" "*errors* controls how encoding errors are handled. If ``'strict'`` (the " "default), a :exc:`UnicodeError` exception is raised. Other possible values " @@ -2138,24 +2138,24 @@ msgid "" "register_error`. See :ref:`error-handlers` for details." msgstr "" -#: ../../library/stdtypes.rst:1640 +#: ../../library/stdtypes.rst:1639 msgid "" "For performance reasons, the value of *errors* is not checked for validity " "unless an encoding error actually occurs, :ref:`devmode` is enabled or a :" "ref:`debug build ` is used." msgstr "" -#: ../../library/stdtypes.rst:1645 ../../library/stdtypes.rst:2784 +#: ../../library/stdtypes.rst:1644 ../../library/stdtypes.rst:2783 msgid "Added support for keyword arguments." msgstr "新增關鍵字引數的支援。" -#: ../../library/stdtypes.rst:1648 ../../library/stdtypes.rst:2787 +#: ../../library/stdtypes.rst:1647 ../../library/stdtypes.rst:2786 msgid "" "The value of the *errors* argument is now checked in :ref:`devmode` and in :" "ref:`debug mode `." msgstr "" -#: ../../library/stdtypes.rst:1655 +#: ../../library/stdtypes.rst:1654 msgid "" "Return ``True`` if the string ends with the specified *suffix*, otherwise " "return ``False``. *suffix* can also be a tuple of suffixes to look for. " @@ -2163,7 +2163,7 @@ msgid "" "*end*, stop comparing at that position." msgstr "" -#: ../../library/stdtypes.rst:1663 +#: ../../library/stdtypes.rst:1662 msgid "" "Return a copy of the string where all tab characters are replaced by one or " "more spaces, depending on the current column and the given tab size. Tab " @@ -2179,21 +2179,21 @@ msgid "" "printed." msgstr "" -#: ../../library/stdtypes.rst:1684 +#: ../../library/stdtypes.rst:1683 msgid "" "Return the lowest index in the string where substring *sub* is found within " "the slice ``s[start:end]``. Optional arguments *start* and *end* are " "interpreted as in slice notation. Return ``-1`` if *sub* is not found." msgstr "" -#: ../../library/stdtypes.rst:1690 +#: ../../library/stdtypes.rst:1689 msgid "" "The :meth:`~str.find` method should be used only if you need to know the " "position of *sub*. To check if *sub* is a substring or not, use the :" "keyword:`in` operator::" msgstr "" -#: ../../library/stdtypes.rst:1700 +#: ../../library/stdtypes.rst:1699 msgid "" "Perform a string formatting operation. The string on which this method is " "called can contain literal text or replacement fields delimited by braces " @@ -2203,13 +2203,13 @@ msgid "" "the corresponding argument." msgstr "" -#: ../../library/stdtypes.rst:1710 +#: ../../library/stdtypes.rst:1709 msgid "" "See :ref:`formatstrings` for a description of the various formatting options " "that can be specified in format strings." msgstr "" -#: ../../library/stdtypes.rst:1714 +#: ../../library/stdtypes.rst:1713 msgid "" "When formatting a number (:class:`int`, :class:`float`, :class:`complex`, :" "class:`decimal.Decimal` and subclasses) with the ``n`` type (ex: ``'{:n}'." @@ -2220,26 +2220,26 @@ msgid "" "This temporary change affects other threads." msgstr "" -#: ../../library/stdtypes.rst:1723 +#: ../../library/stdtypes.rst:1722 msgid "" "When formatting a number with the ``n`` type, the function sets temporarily " "the ``LC_CTYPE`` locale to the ``LC_NUMERIC`` locale in some cases." msgstr "" -#: ../../library/stdtypes.rst:1731 +#: ../../library/stdtypes.rst:1730 msgid "" "Similar to ``str.format(**mapping)``, except that ``mapping`` is used " "directly and not copied to a :class:`dict`. This is useful if for example " "``mapping`` is a dict subclass:" msgstr "" -#: ../../library/stdtypes.rst:1747 +#: ../../library/stdtypes.rst:1746 msgid "" "Like :meth:`~str.find`, but raise :exc:`ValueError` when the substring is " "not found." msgstr "" -#: ../../library/stdtypes.rst:1753 +#: ../../library/stdtypes.rst:1752 msgid "" "Return ``True`` if all characters in the string are alphanumeric and there " "is at least one character, ``False`` otherwise. A character ``c`` is " @@ -2247,7 +2247,7 @@ msgid "" "isdecimal()``, ``c.isdigit()``, or ``c.isnumeric()``." msgstr "" -#: ../../library/stdtypes.rst:1761 +#: ../../library/stdtypes.rst:1760 msgid "" "Return ``True`` if all characters in the string are alphabetic and there is " "at least one character, ``False`` otherwise. Alphabetic characters are " @@ -2257,14 +2257,14 @@ msgid "" "\"Alphabetic\" property defined in the Unicode Standard." msgstr "" -#: ../../library/stdtypes.rst:1770 +#: ../../library/stdtypes.rst:1769 msgid "" "Return ``True`` if the string is empty or all characters in the string are " "ASCII, ``False`` otherwise. ASCII characters have code points in the range " "U+0000-U+007F." msgstr "" -#: ../../library/stdtypes.rst:1779 +#: ../../library/stdtypes.rst:1778 msgid "" "Return ``True`` if all characters in the string are decimal characters and " "there is at least one character, ``False`` otherwise. Decimal characters are " @@ -2273,7 +2273,7 @@ msgid "" "General Category \"Nd\"." msgstr "" -#: ../../library/stdtypes.rst:1789 +#: ../../library/stdtypes.rst:1788 msgid "" "Return ``True`` if all characters in the string are digits and there is at " "least one character, ``False`` otherwise. Digits include decimal characters " @@ -2283,32 +2283,32 @@ msgid "" "property value Numeric_Type=Digit or Numeric_Type=Decimal." msgstr "" -#: ../../library/stdtypes.rst:1799 +#: ../../library/stdtypes.rst:1798 msgid "" "Return ``True`` if the string is a valid identifier according to the " "language definition, section :ref:`identifiers`." msgstr "" -#: ../../library/stdtypes.rst:1802 +#: ../../library/stdtypes.rst:1801 msgid "" "Call :func:`keyword.iskeyword` to test whether string ``s`` is a reserved " "identifier, such as :keyword:`def` and :keyword:`class`." msgstr "" -#: ../../library/stdtypes.rst:1805 +#: ../../library/stdtypes.rst:1804 msgid "Example: ::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/stdtypes.rst:1818 +#: ../../library/stdtypes.rst:1817 msgid "" "Return ``True`` if all cased characters [4]_ in the string are lowercase and " "there is at least one cased character, ``False`` otherwise." msgstr "" -#: ../../library/stdtypes.rst:1824 +#: ../../library/stdtypes.rst:1823 msgid "" "Return ``True`` if all characters in the string are numeric characters, and " "there is at least one character, ``False`` otherwise. Numeric characters " @@ -2318,7 +2318,7 @@ msgid "" "Numeric_Type=Decimal or Numeric_Type=Numeric." msgstr "" -#: ../../library/stdtypes.rst:1834 +#: ../../library/stdtypes.rst:1833 msgid "" "Return ``True`` if all characters in the string are printable or the string " "is empty, ``False`` otherwise. Nonprintable characters are those characters " @@ -2329,20 +2329,20 @@ msgid "" "of strings written to :data:`sys.stdout` or :data:`sys.stderr`.)" msgstr "" -#: ../../library/stdtypes.rst:1845 +#: ../../library/stdtypes.rst:1844 msgid "" "Return ``True`` if there are only whitespace characters in the string and " "there is at least one character, ``False`` otherwise." msgstr "" -#: ../../library/stdtypes.rst:1848 +#: ../../library/stdtypes.rst:1847 msgid "" "A character is *whitespace* if in the Unicode character database (see :mod:" "`unicodedata`), either its general category is ``Zs`` (\"Separator, " "space\"), or its bidirectional class is one of ``WS``, ``B``, or ``S``." msgstr "" -#: ../../library/stdtypes.rst:1856 +#: ../../library/stdtypes.rst:1855 msgid "" "Return ``True`` if the string is a titlecased string and there is at least " "one character, for example uppercase characters may only follow uncased " @@ -2350,13 +2350,13 @@ msgid "" "otherwise." msgstr "" -#: ../../library/stdtypes.rst:1863 +#: ../../library/stdtypes.rst:1862 msgid "" "Return ``True`` if all cased characters [4]_ in the string are uppercase and " "there is at least one cased character, ``False`` otherwise." msgstr "" -#: ../../library/stdtypes.rst:1881 +#: ../../library/stdtypes.rst:1880 msgid "" "Return a string which is the concatenation of the strings in *iterable*. A :" "exc:`TypeError` will be raised if there are any non-string values in " @@ -2364,26 +2364,26 @@ msgid "" "elements is the string providing this method." msgstr "" -#: ../../library/stdtypes.rst:1889 +#: ../../library/stdtypes.rst:1888 msgid "" "Return the string left justified in a string of length *width*. Padding is " "done using the specified *fillchar* (default is an ASCII space). The " "original string is returned if *width* is less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:1896 +#: ../../library/stdtypes.rst:1895 msgid "" "Return a copy of the string with all the cased characters [4]_ converted to " "lowercase." msgstr "" -#: ../../library/stdtypes.rst:1899 +#: ../../library/stdtypes.rst:1898 msgid "" "The lowercasing algorithm used is described in section 3.13 of the Unicode " "Standard." msgstr "" -#: ../../library/stdtypes.rst:1905 +#: ../../library/stdtypes.rst:1904 msgid "" "Return a copy of the string with leading characters removed. The *chars* " "argument is a string specifying the set of characters to be removed. If " @@ -2392,19 +2392,19 @@ msgid "" "are stripped::" msgstr "" -#: ../../library/stdtypes.rst:1915 +#: ../../library/stdtypes.rst:1914 msgid "" "See :meth:`str.removeprefix` for a method that will remove a single prefix " "string rather than all of a set of characters. For example::" msgstr "" -#: ../../library/stdtypes.rst:1926 +#: ../../library/stdtypes.rst:1925 msgid "" "This static method returns a translation table usable for :meth:`str." "translate`." msgstr "" -#: ../../library/stdtypes.rst:1928 +#: ../../library/stdtypes.rst:1927 msgid "" "If there is only one argument, it must be a dictionary mapping Unicode " "ordinals (integers) or characters (strings of length 1) to Unicode ordinals, " @@ -2412,7 +2412,7 @@ msgid "" "converted to ordinals." msgstr "" -#: ../../library/stdtypes.rst:1933 +#: ../../library/stdtypes.rst:1932 msgid "" "If there are two arguments, they must be strings of equal length, and in the " "resulting dictionary, each character in x will be mapped to the character at " @@ -2420,7 +2420,7 @@ msgid "" "whose characters will be mapped to ``None`` in the result." msgstr "" -#: ../../library/stdtypes.rst:1941 +#: ../../library/stdtypes.rst:1940 msgid "" "Split the string at the first occurrence of *sep*, and return a 3-tuple " "containing the part before the separator, the separator itself, and the part " @@ -2428,47 +2428,47 @@ msgid "" "containing the string itself, followed by two empty strings." msgstr "" -#: ../../library/stdtypes.rst:1949 +#: ../../library/stdtypes.rst:1948 msgid "" "If the string starts with the *prefix* string, return " "``string[len(prefix):]``. Otherwise, return a copy of the original string::" msgstr "" -#: ../../library/stdtypes.rst:1963 +#: ../../library/stdtypes.rst:1962 msgid "" "If the string ends with the *suffix* string and that *suffix* is not empty, " "return ``string[:-len(suffix)]``. Otherwise, return a copy of the original " "string::" msgstr "" -#: ../../library/stdtypes.rst:1977 +#: ../../library/stdtypes.rst:1976 msgid "" "Return a copy of the string with all occurrences of substring *old* replaced " "by *new*. If the optional argument *count* is given, only the first *count* " "occurrences are replaced." msgstr "" -#: ../../library/stdtypes.rst:1984 +#: ../../library/stdtypes.rst:1983 msgid "" "Return the highest index in the string where substring *sub* is found, such " "that *sub* is contained within ``s[start:end]``. Optional arguments *start* " "and *end* are interpreted as in slice notation. Return ``-1`` on failure." msgstr "" -#: ../../library/stdtypes.rst:1991 +#: ../../library/stdtypes.rst:1990 msgid "" "Like :meth:`rfind` but raises :exc:`ValueError` when the substring *sub* is " "not found." msgstr "" -#: ../../library/stdtypes.rst:1997 +#: ../../library/stdtypes.rst:1996 msgid "" "Return the string right justified in a string of length *width*. Padding is " "done using the specified *fillchar* (default is an ASCII space). The " "original string is returned if *width* is less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:2004 +#: ../../library/stdtypes.rst:2003 msgid "" "Split the string at the last occurrence of *sep*, and return a 3-tuple " "containing the part before the separator, the separator itself, and the part " @@ -2476,7 +2476,7 @@ msgid "" "containing two empty strings, followed by the string itself." msgstr "" -#: ../../library/stdtypes.rst:2012 +#: ../../library/stdtypes.rst:2011 msgid "" "Return a list of the words in the string, using *sep* as the delimiter " "string. If *maxsplit* is given, at most *maxsplit* splits are done, the " @@ -2485,7 +2485,7 @@ msgid "" "behaves like :meth:`split` which is described in detail below." msgstr "" -#: ../../library/stdtypes.rst:2021 +#: ../../library/stdtypes.rst:2020 msgid "" "Return a copy of the string with trailing characters removed. The *chars* " "argument is a string specifying the set of characters to be removed. If " @@ -2494,13 +2494,13 @@ msgid "" "are stripped::" msgstr "" -#: ../../library/stdtypes.rst:2031 +#: ../../library/stdtypes.rst:2030 msgid "" "See :meth:`str.removesuffix` for a method that will remove a single suffix " "string rather than all of a set of characters. For example::" msgstr "" -#: ../../library/stdtypes.rst:2041 +#: ../../library/stdtypes.rst:2040 msgid "" "Return a list of the words in the string, using *sep* as the delimiter " "string. If *maxsplit* is given, at most *maxsplit* splits are done (thus, " @@ -2509,7 +2509,7 @@ msgid "" "possible splits are made)." msgstr "" -#: ../../library/stdtypes.rst:2047 +#: ../../library/stdtypes.rst:2046 msgid "" "If *sep* is given, consecutive delimiters are not grouped together and are " "deemed to delimit empty strings (for example, ``'1,,2'.split(',')`` returns " @@ -2518,23 +2518,23 @@ msgid "" "Splitting an empty string with a specified separator returns ``['']``." msgstr "" -#: ../../library/stdtypes.rst:2053 ../../library/stdtypes.rst:2069 -#: ../../library/stdtypes.rst:2121 ../../library/stdtypes.rst:2189 -#: ../../library/stdtypes.rst:2256 ../../library/stdtypes.rst:3103 -#: ../../library/stdtypes.rst:3119 ../../library/stdtypes.rst:3210 -#: ../../library/stdtypes.rst:3226 ../../library/stdtypes.rst:3251 -#: ../../library/stdtypes.rst:3265 ../../library/stdtypes.rst:3293 -#: ../../library/stdtypes.rst:3307 ../../library/stdtypes.rst:3325 -#: ../../library/stdtypes.rst:3352 ../../library/stdtypes.rst:3375 -#: ../../library/stdtypes.rst:3402 ../../library/stdtypes.rst:3444 -#: ../../library/stdtypes.rst:3468 +#: ../../library/stdtypes.rst:2052 ../../library/stdtypes.rst:2068 +#: ../../library/stdtypes.rst:2120 ../../library/stdtypes.rst:2188 +#: ../../library/stdtypes.rst:2255 ../../library/stdtypes.rst:3102 +#: ../../library/stdtypes.rst:3118 ../../library/stdtypes.rst:3209 +#: ../../library/stdtypes.rst:3225 ../../library/stdtypes.rst:3250 +#: ../../library/stdtypes.rst:3264 ../../library/stdtypes.rst:3292 +#: ../../library/stdtypes.rst:3306 ../../library/stdtypes.rst:3324 +#: ../../library/stdtypes.rst:3351 ../../library/stdtypes.rst:3374 +#: ../../library/stdtypes.rst:3401 ../../library/stdtypes.rst:3443 +#: ../../library/stdtypes.rst:3467 msgid "For example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/stdtypes.rst:2062 +#: ../../library/stdtypes.rst:2061 msgid "" "If *sep* is not specified or is ``None``, a different splitting algorithm is " "applied: runs of consecutive whitespace are regarded as a single separator, " @@ -2544,131 +2544,131 @@ msgid "" "returns ``[]``." msgstr "" -#: ../../library/stdtypes.rst:2084 +#: ../../library/stdtypes.rst:2083 msgid "" "Return a list of the lines in the string, breaking at line boundaries. Line " "breaks are not included in the resulting list unless *keepends* is given and " "true." msgstr "" -#: ../../library/stdtypes.rst:2088 +#: ../../library/stdtypes.rst:2087 msgid "" "This method splits on the following line boundaries. In particular, the " "boundaries are a superset of :term:`universal newlines`." msgstr "" -#: ../../library/stdtypes.rst:2092 +#: ../../library/stdtypes.rst:2091 msgid "Representation" msgstr "" -#: ../../library/stdtypes.rst:2092 +#: ../../library/stdtypes.rst:2091 msgid "Description" msgstr "描述" -#: ../../library/stdtypes.rst:2094 +#: ../../library/stdtypes.rst:2093 msgid "``\\n``" msgstr "``\\n``" -#: ../../library/stdtypes.rst:2094 +#: ../../library/stdtypes.rst:2093 msgid "Line Feed" msgstr "" -#: ../../library/stdtypes.rst:2096 +#: ../../library/stdtypes.rst:2095 msgid "``\\r``" msgstr "``\\r``" -#: ../../library/stdtypes.rst:2096 +#: ../../library/stdtypes.rst:2095 msgid "Carriage Return" msgstr "" -#: ../../library/stdtypes.rst:2098 +#: ../../library/stdtypes.rst:2097 msgid "``\\r\\n``" msgstr "``\\r\\n``" -#: ../../library/stdtypes.rst:2098 +#: ../../library/stdtypes.rst:2097 msgid "Carriage Return + Line Feed" msgstr "" -#: ../../library/stdtypes.rst:2100 +#: ../../library/stdtypes.rst:2099 msgid "``\\v`` or ``\\x0b``" msgstr "``\\v`` 或 ``\\x0b``" -#: ../../library/stdtypes.rst:2100 +#: ../../library/stdtypes.rst:2099 msgid "Line Tabulation" msgstr "" -#: ../../library/stdtypes.rst:2102 +#: ../../library/stdtypes.rst:2101 msgid "``\\f`` or ``\\x0c``" msgstr "``\\f`` 或 ``\\x0c``" -#: ../../library/stdtypes.rst:2102 +#: ../../library/stdtypes.rst:2101 msgid "Form Feed" msgstr "" -#: ../../library/stdtypes.rst:2104 +#: ../../library/stdtypes.rst:2103 msgid "``\\x1c``" msgstr "``\\x1c``" -#: ../../library/stdtypes.rst:2104 +#: ../../library/stdtypes.rst:2103 msgid "File Separator" msgstr "" -#: ../../library/stdtypes.rst:2106 +#: ../../library/stdtypes.rst:2105 msgid "``\\x1d``" msgstr "``\\x1d``" -#: ../../library/stdtypes.rst:2106 +#: ../../library/stdtypes.rst:2105 msgid "Group Separator" msgstr "" -#: ../../library/stdtypes.rst:2108 +#: ../../library/stdtypes.rst:2107 msgid "``\\x1e``" msgstr "``\\x1e``" -#: ../../library/stdtypes.rst:2108 +#: ../../library/stdtypes.rst:2107 msgid "Record Separator" msgstr "" -#: ../../library/stdtypes.rst:2110 +#: ../../library/stdtypes.rst:2109 msgid "``\\x85``" msgstr "``\\x85``" -#: ../../library/stdtypes.rst:2110 +#: ../../library/stdtypes.rst:2109 msgid "Next Line (C1 Control Code)" msgstr "" -#: ../../library/stdtypes.rst:2112 +#: ../../library/stdtypes.rst:2111 msgid "``\\u2028``" msgstr "``\\u2028``" -#: ../../library/stdtypes.rst:2112 +#: ../../library/stdtypes.rst:2111 msgid "Line Separator" msgstr "" -#: ../../library/stdtypes.rst:2114 +#: ../../library/stdtypes.rst:2113 msgid "``\\u2029``" msgstr "``\\u2029``" -#: ../../library/stdtypes.rst:2114 +#: ../../library/stdtypes.rst:2113 msgid "Paragraph Separator" msgstr "" -#: ../../library/stdtypes.rst:2119 +#: ../../library/stdtypes.rst:2118 msgid "``\\v`` and ``\\f`` added to list of line boundaries." msgstr "" -#: ../../library/stdtypes.rst:2128 +#: ../../library/stdtypes.rst:2127 msgid "" "Unlike :meth:`~str.split` when a delimiter string *sep* is given, this " "method returns an empty list for the empty string, and a terminal line break " "does not result in an extra line::" msgstr "" -#: ../../library/stdtypes.rst:2137 +#: ../../library/stdtypes.rst:2136 msgid "For comparison, ``split('\\n')`` gives::" msgstr "" -#: ../../library/stdtypes.rst:2147 +#: ../../library/stdtypes.rst:2146 msgid "" "Return ``True`` if string starts with the *prefix*, otherwise return " "``False``. *prefix* can also be a tuple of prefixes to look for. With " @@ -2676,7 +2676,7 @@ msgid "" "*end*, stop comparing string at that position." msgstr "" -#: ../../library/stdtypes.rst:2155 +#: ../../library/stdtypes.rst:2154 msgid "" "Return a copy of the string with the leading and trailing characters " "removed. The *chars* argument is a string specifying the set of characters " @@ -2685,7 +2685,7 @@ msgid "" "all combinations of its values are stripped::" msgstr "" -#: ../../library/stdtypes.rst:2166 +#: ../../library/stdtypes.rst:2165 msgid "" "The outermost leading and trailing *chars* argument values are stripped from " "the string. Characters are removed from the leading end until reaching a " @@ -2693,20 +2693,20 @@ msgid "" "A similar action takes place on the trailing end. For example::" msgstr "" -#: ../../library/stdtypes.rst:2179 +#: ../../library/stdtypes.rst:2178 msgid "" "Return a copy of the string with uppercase characters converted to lowercase " "and vice versa. Note that it is not necessarily true that ``s.swapcase()." "swapcase() == s``." msgstr "" -#: ../../library/stdtypes.rst:2186 +#: ../../library/stdtypes.rst:2185 msgid "" "Return a titlecased version of the string where words start with an " "uppercase character and the remaining characters are lowercase." msgstr "" -#: ../../library/stdtypes.rst:2194 ../../library/stdtypes.rst:3412 +#: ../../library/stdtypes.rst:2193 ../../library/stdtypes.rst:3411 msgid "" "The algorithm uses a simple language-independent definition of a word as " "groups of consecutive letters. The definition works in many contexts but it " @@ -2714,19 +2714,19 @@ msgid "" "which may not be the desired result::" msgstr "" -#: ../../library/stdtypes.rst:2202 +#: ../../library/stdtypes.rst:2201 msgid "" "The :func:`string.capwords` function does not have this problem, as it " "splits words on spaces only." msgstr "" -#: ../../library/stdtypes.rst:2205 +#: ../../library/stdtypes.rst:2204 msgid "" "Alternatively, a workaround for apostrophes can be constructed using regular " "expressions::" msgstr "" -#: ../../library/stdtypes.rst:2220 +#: ../../library/stdtypes.rst:2219 msgid "" "Return a copy of the string in which each character has been mapped through " "the given translation table. The table must be an object that implements " @@ -2738,19 +2738,19 @@ msgid "" "exception, to map the character to itself." msgstr "" -#: ../../library/stdtypes.rst:2229 +#: ../../library/stdtypes.rst:2228 msgid "" "You can use :meth:`str.maketrans` to create a translation map from character-" "to-character mappings in different formats." msgstr "" -#: ../../library/stdtypes.rst:2232 +#: ../../library/stdtypes.rst:2231 msgid "" "See also the :mod:`codecs` module for a more flexible approach to custom " "character mappings." msgstr "" -#: ../../library/stdtypes.rst:2238 +#: ../../library/stdtypes.rst:2237 msgid "" "Return a copy of the string with all the cased characters [4]_ converted to " "uppercase. Note that ``s.upper().isupper()`` might be ``False`` if ``s`` " @@ -2759,13 +2759,13 @@ msgid "" "titlecase)." msgstr "" -#: ../../library/stdtypes.rst:2244 +#: ../../library/stdtypes.rst:2243 msgid "" "The uppercasing algorithm used is described in section 3.13 of the Unicode " "Standard." msgstr "" -#: ../../library/stdtypes.rst:2250 +#: ../../library/stdtypes.rst:2249 msgid "" "Return a copy of the string left filled with ASCII ``'0'`` digits to make a " "string of length *width*. A leading sign prefix (``'+'``/``'-'``) is handled " @@ -2773,11 +2773,11 @@ msgid "" "original string is returned if *width* is less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:2268 +#: ../../library/stdtypes.rst:2267 msgid "``printf``-style String Formatting" msgstr "" -#: ../../library/stdtypes.rst:2281 +#: ../../library/stdtypes.rst:2280 msgid "" "The formatting operations described here exhibit a variety of quirks that " "lead to a number of common errors (such as failing to display tuples and " @@ -2788,7 +2788,7 @@ msgid "" "or extensibility." msgstr "" -#: ../../library/stdtypes.rst:2289 +#: ../../library/stdtypes.rst:2288 msgid "" "String objects have one unique built-in operation: the ``%`` operator " "(modulo). This is also known as the string *formatting* or *interpolation* " @@ -2798,7 +2798,7 @@ msgid "" "in the C language." msgstr "" -#: ../../library/stdtypes.rst:2295 +#: ../../library/stdtypes.rst:2294 msgid "" "If *format* requires a single argument, *values* may be a single non-tuple " "object. [5]_ Otherwise, *values* must be a tuple with exactly the number of " @@ -2806,36 +2806,36 @@ msgid "" "example, a dictionary)." msgstr "" -#: ../../library/stdtypes.rst:2305 ../../library/stdtypes.rst:3523 +#: ../../library/stdtypes.rst:2304 ../../library/stdtypes.rst:3522 msgid "" "A conversion specifier contains two or more characters and has the following " "components, which must occur in this order:" msgstr "" -#: ../../library/stdtypes.rst:2308 ../../library/stdtypes.rst:3526 +#: ../../library/stdtypes.rst:2307 ../../library/stdtypes.rst:3525 msgid "The ``'%'`` character, which marks the start of the specifier." msgstr "" -#: ../../library/stdtypes.rst:2310 ../../library/stdtypes.rst:3528 +#: ../../library/stdtypes.rst:2309 ../../library/stdtypes.rst:3527 msgid "" "Mapping key (optional), consisting of a parenthesised sequence of characters " "(for example, ``(somename)``)." msgstr "" -#: ../../library/stdtypes.rst:2313 ../../library/stdtypes.rst:3531 +#: ../../library/stdtypes.rst:2312 ../../library/stdtypes.rst:3530 msgid "" "Conversion flags (optional), which affect the result of some conversion " "types." msgstr "" -#: ../../library/stdtypes.rst:2316 ../../library/stdtypes.rst:3534 +#: ../../library/stdtypes.rst:2315 ../../library/stdtypes.rst:3533 msgid "" "Minimum field width (optional). If specified as an ``'*'`` (asterisk), the " "actual width is read from the next element of the tuple in *values*, and the " "object to convert comes after the minimum field width and optional precision." msgstr "" -#: ../../library/stdtypes.rst:2320 ../../library/stdtypes.rst:3538 +#: ../../library/stdtypes.rst:2319 ../../library/stdtypes.rst:3537 msgid "" "Precision (optional), given as a ``'.'`` (dot) followed by the precision. " "If specified as ``'*'`` (an asterisk), the actual precision is read from the " @@ -2843,15 +2843,15 @@ msgid "" "the precision." msgstr "" -#: ../../library/stdtypes.rst:2325 ../../library/stdtypes.rst:3543 +#: ../../library/stdtypes.rst:2324 ../../library/stdtypes.rst:3542 msgid "Length modifier (optional)." msgstr "" -#: ../../library/stdtypes.rst:2327 ../../library/stdtypes.rst:3545 +#: ../../library/stdtypes.rst:2326 ../../library/stdtypes.rst:3544 msgid "Conversion type." msgstr "" -#: ../../library/stdtypes.rst:2329 +#: ../../library/stdtypes.rst:2328 msgid "" "When the right argument is a dictionary (or other mapping type), then the " "formats in the string *must* include a parenthesised mapping key into that " @@ -2859,279 +2859,279 @@ msgid "" "selects the value to be formatted from the mapping. For example:" msgstr "" -#: ../../library/stdtypes.rst:2338 ../../library/stdtypes.rst:3556 +#: ../../library/stdtypes.rst:2337 ../../library/stdtypes.rst:3555 msgid "" "In this case no ``*`` specifiers may occur in a format (since they require a " "sequential parameter list)." msgstr "" -#: ../../library/stdtypes.rst:2341 ../../library/stdtypes.rst:3559 +#: ../../library/stdtypes.rst:2340 ../../library/stdtypes.rst:3558 msgid "The conversion flag characters are:" msgstr "" -#: ../../library/stdtypes.rst:2350 ../../library/stdtypes.rst:3568 +#: ../../library/stdtypes.rst:2349 ../../library/stdtypes.rst:3567 msgid "Flag" msgstr "" -#: ../../library/stdtypes.rst:2352 ../../library/stdtypes.rst:3570 +#: ../../library/stdtypes.rst:2351 ../../library/stdtypes.rst:3569 msgid "``'#'``" msgstr "``'#'``" -#: ../../library/stdtypes.rst:2352 ../../library/stdtypes.rst:3570 +#: ../../library/stdtypes.rst:2351 ../../library/stdtypes.rst:3569 msgid "" "The value conversion will use the \"alternate form\" (where defined below)." msgstr "" -#: ../../library/stdtypes.rst:2355 ../../library/stdtypes.rst:3573 +#: ../../library/stdtypes.rst:2354 ../../library/stdtypes.rst:3572 msgid "``'0'``" msgstr "``'0'``" -#: ../../library/stdtypes.rst:2355 ../../library/stdtypes.rst:3573 +#: ../../library/stdtypes.rst:2354 ../../library/stdtypes.rst:3572 msgid "The conversion will be zero padded for numeric values." msgstr "" -#: ../../library/stdtypes.rst:2357 ../../library/stdtypes.rst:3575 +#: ../../library/stdtypes.rst:2356 ../../library/stdtypes.rst:3574 msgid "``'-'``" msgstr "``'-'``" -#: ../../library/stdtypes.rst:2357 ../../library/stdtypes.rst:3575 +#: ../../library/stdtypes.rst:2356 ../../library/stdtypes.rst:3574 msgid "" "The converted value is left adjusted (overrides the ``'0'`` conversion if " "both are given)." msgstr "" -#: ../../library/stdtypes.rst:2360 ../../library/stdtypes.rst:3578 +#: ../../library/stdtypes.rst:2359 ../../library/stdtypes.rst:3577 msgid "``' '``" msgstr "``' '``" -#: ../../library/stdtypes.rst:2360 ../../library/stdtypes.rst:3578 +#: ../../library/stdtypes.rst:2359 ../../library/stdtypes.rst:3577 msgid "" "(a space) A blank should be left before a positive number (or empty string) " "produced by a signed conversion." msgstr "" -#: ../../library/stdtypes.rst:2363 ../../library/stdtypes.rst:3581 +#: ../../library/stdtypes.rst:2362 ../../library/stdtypes.rst:3580 msgid "``'+'``" msgstr "``'+'``" -#: ../../library/stdtypes.rst:2363 ../../library/stdtypes.rst:3581 +#: ../../library/stdtypes.rst:2362 ../../library/stdtypes.rst:3580 msgid "" "A sign character (``'+'`` or ``'-'``) will precede the conversion (overrides " "a \"space\" flag)." msgstr "" -#: ../../library/stdtypes.rst:2367 ../../library/stdtypes.rst:3585 +#: ../../library/stdtypes.rst:2366 ../../library/stdtypes.rst:3584 msgid "" "A length modifier (``h``, ``l``, or ``L``) may be present, but is ignored as " "it is not necessary for Python -- so e.g. ``%ld`` is identical to ``%d``." msgstr "" -#: ../../library/stdtypes.rst:2370 ../../library/stdtypes.rst:3588 +#: ../../library/stdtypes.rst:2369 ../../library/stdtypes.rst:3587 msgid "The conversion types are:" msgstr "" -#: ../../library/stdtypes.rst:2373 ../../library/stdtypes.rst:3591 +#: ../../library/stdtypes.rst:2372 ../../library/stdtypes.rst:3590 msgid "Conversion" msgstr "" -#: ../../library/stdtypes.rst:2375 ../../library/stdtypes.rst:3593 +#: ../../library/stdtypes.rst:2374 ../../library/stdtypes.rst:3592 msgid "``'d'``" msgstr "``'d'``" -#: ../../library/stdtypes.rst:2375 ../../library/stdtypes.rst:2377 -#: ../../library/stdtypes.rst:3593 ../../library/stdtypes.rst:3595 +#: ../../library/stdtypes.rst:2374 ../../library/stdtypes.rst:2376 +#: ../../library/stdtypes.rst:3592 ../../library/stdtypes.rst:3594 msgid "Signed integer decimal." msgstr "" -#: ../../library/stdtypes.rst:2377 ../../library/stdtypes.rst:3595 +#: ../../library/stdtypes.rst:2376 ../../library/stdtypes.rst:3594 msgid "``'i'``" msgstr "``'i'``" -#: ../../library/stdtypes.rst:2379 ../../library/stdtypes.rst:3597 +#: ../../library/stdtypes.rst:2378 ../../library/stdtypes.rst:3596 msgid "``'o'``" msgstr "``'o'``" -#: ../../library/stdtypes.rst:2379 ../../library/stdtypes.rst:3597 +#: ../../library/stdtypes.rst:2378 ../../library/stdtypes.rst:3596 msgid "Signed octal value." msgstr "" -#: ../../library/stdtypes.rst:2381 ../../library/stdtypes.rst:3599 +#: ../../library/stdtypes.rst:2380 ../../library/stdtypes.rst:3598 msgid "``'u'``" msgstr "``'u'``" -#: ../../library/stdtypes.rst:2381 ../../library/stdtypes.rst:3599 +#: ../../library/stdtypes.rst:2380 ../../library/stdtypes.rst:3598 msgid "Obsolete type -- it is identical to ``'d'``." msgstr "" -#: ../../library/stdtypes.rst:2383 ../../library/stdtypes.rst:3601 +#: ../../library/stdtypes.rst:2382 ../../library/stdtypes.rst:3600 msgid "``'x'``" msgstr "``'x'``" -#: ../../library/stdtypes.rst:2383 ../../library/stdtypes.rst:3601 +#: ../../library/stdtypes.rst:2382 ../../library/stdtypes.rst:3600 msgid "Signed hexadecimal (lowercase)." msgstr "" -#: ../../library/stdtypes.rst:2385 ../../library/stdtypes.rst:3603 +#: ../../library/stdtypes.rst:2384 ../../library/stdtypes.rst:3602 msgid "``'X'``" msgstr "``'X'``" -#: ../../library/stdtypes.rst:2385 ../../library/stdtypes.rst:3603 +#: ../../library/stdtypes.rst:2384 ../../library/stdtypes.rst:3602 msgid "Signed hexadecimal (uppercase)." msgstr "" -#: ../../library/stdtypes.rst:2387 ../../library/stdtypes.rst:3605 +#: ../../library/stdtypes.rst:2386 ../../library/stdtypes.rst:3604 msgid "``'e'``" msgstr "``'e'``" -#: ../../library/stdtypes.rst:2387 ../../library/stdtypes.rst:3605 +#: ../../library/stdtypes.rst:2386 ../../library/stdtypes.rst:3604 msgid "Floating point exponential format (lowercase)." msgstr "" -#: ../../library/stdtypes.rst:2389 ../../library/stdtypes.rst:3607 +#: ../../library/stdtypes.rst:2388 ../../library/stdtypes.rst:3606 msgid "``'E'``" msgstr "``'E'``" -#: ../../library/stdtypes.rst:2389 ../../library/stdtypes.rst:3607 +#: ../../library/stdtypes.rst:2388 ../../library/stdtypes.rst:3606 msgid "Floating point exponential format (uppercase)." msgstr "" -#: ../../library/stdtypes.rst:2391 ../../library/stdtypes.rst:3609 +#: ../../library/stdtypes.rst:2390 ../../library/stdtypes.rst:3608 msgid "``'f'``" msgstr "``'f'``" -#: ../../library/stdtypes.rst:2391 ../../library/stdtypes.rst:2393 -#: ../../library/stdtypes.rst:3609 ../../library/stdtypes.rst:3611 +#: ../../library/stdtypes.rst:2390 ../../library/stdtypes.rst:2392 +#: ../../library/stdtypes.rst:3608 ../../library/stdtypes.rst:3610 msgid "Floating point decimal format." msgstr "" -#: ../../library/stdtypes.rst:2393 ../../library/stdtypes.rst:3611 +#: ../../library/stdtypes.rst:2392 ../../library/stdtypes.rst:3610 msgid "``'F'``" msgstr "``'F'``" -#: ../../library/stdtypes.rst:2395 ../../library/stdtypes.rst:3613 +#: ../../library/stdtypes.rst:2394 ../../library/stdtypes.rst:3612 msgid "``'g'``" msgstr "``'g'``" -#: ../../library/stdtypes.rst:2395 ../../library/stdtypes.rst:3613 +#: ../../library/stdtypes.rst:2394 ../../library/stdtypes.rst:3612 msgid "" "Floating point format. Uses lowercase exponential format if exponent is less " "than -4 or not less than precision, decimal format otherwise." msgstr "" -#: ../../library/stdtypes.rst:2399 ../../library/stdtypes.rst:3617 +#: ../../library/stdtypes.rst:2398 ../../library/stdtypes.rst:3616 msgid "``'G'``" msgstr "``'G'``" -#: ../../library/stdtypes.rst:2399 ../../library/stdtypes.rst:3617 +#: ../../library/stdtypes.rst:2398 ../../library/stdtypes.rst:3616 msgid "" "Floating point format. Uses uppercase exponential format if exponent is less " "than -4 or not less than precision, decimal format otherwise." msgstr "" -#: ../../library/stdtypes.rst:2403 ../../library/stdtypes.rst:3621 +#: ../../library/stdtypes.rst:2402 ../../library/stdtypes.rst:3620 msgid "``'c'``" msgstr "``'c'``" -#: ../../library/stdtypes.rst:2403 +#: ../../library/stdtypes.rst:2402 msgid "Single character (accepts integer or single character string)." msgstr "" -#: ../../library/stdtypes.rst:2406 ../../library/stdtypes.rst:3634 +#: ../../library/stdtypes.rst:2405 ../../library/stdtypes.rst:3633 msgid "``'r'``" msgstr "``'r'``" -#: ../../library/stdtypes.rst:2406 +#: ../../library/stdtypes.rst:2405 msgid "String (converts any Python object using :func:`repr`)." msgstr "" -#: ../../library/stdtypes.rst:2409 ../../library/stdtypes.rst:3628 +#: ../../library/stdtypes.rst:2408 ../../library/stdtypes.rst:3627 msgid "``'s'``" msgstr "``'s'``" -#: ../../library/stdtypes.rst:2409 +#: ../../library/stdtypes.rst:2408 msgid "String (converts any Python object using :func:`str`)." msgstr "" -#: ../../library/stdtypes.rst:2412 ../../library/stdtypes.rst:3631 +#: ../../library/stdtypes.rst:2411 ../../library/stdtypes.rst:3630 msgid "``'a'``" msgstr "``'a'``" -#: ../../library/stdtypes.rst:2412 +#: ../../library/stdtypes.rst:2411 msgid "String (converts any Python object using :func:`ascii`)." msgstr "" -#: ../../library/stdtypes.rst:2415 ../../library/stdtypes.rst:3637 +#: ../../library/stdtypes.rst:2414 ../../library/stdtypes.rst:3636 msgid "``'%'``" msgstr "``'%'``" -#: ../../library/stdtypes.rst:2415 ../../library/stdtypes.rst:3637 +#: ../../library/stdtypes.rst:2414 ../../library/stdtypes.rst:3636 msgid "No argument is converted, results in a ``'%'`` character in the result." msgstr "" -#: ../../library/stdtypes.rst:2422 ../../library/stdtypes.rst:3644 +#: ../../library/stdtypes.rst:2421 ../../library/stdtypes.rst:3643 msgid "" "The alternate form causes a leading octal specifier (``'0o'``) to be " "inserted before the first digit." msgstr "" -#: ../../library/stdtypes.rst:2426 ../../library/stdtypes.rst:3648 +#: ../../library/stdtypes.rst:2425 ../../library/stdtypes.rst:3647 msgid "" "The alternate form causes a leading ``'0x'`` or ``'0X'`` (depending on " "whether the ``'x'`` or ``'X'`` format was used) to be inserted before the " "first digit." msgstr "" -#: ../../library/stdtypes.rst:2430 ../../library/stdtypes.rst:3652 +#: ../../library/stdtypes.rst:2429 ../../library/stdtypes.rst:3651 msgid "" "The alternate form causes the result to always contain a decimal point, even " "if no digits follow it." msgstr "" -#: ../../library/stdtypes.rst:2433 ../../library/stdtypes.rst:3655 +#: ../../library/stdtypes.rst:2432 ../../library/stdtypes.rst:3654 msgid "" "The precision determines the number of digits after the decimal point and " "defaults to 6." msgstr "" -#: ../../library/stdtypes.rst:2437 ../../library/stdtypes.rst:3659 +#: ../../library/stdtypes.rst:2436 ../../library/stdtypes.rst:3658 msgid "" "The alternate form causes the result to always contain a decimal point, and " "trailing zeroes are not removed as they would otherwise be." msgstr "" -#: ../../library/stdtypes.rst:2440 ../../library/stdtypes.rst:3662 +#: ../../library/stdtypes.rst:2439 ../../library/stdtypes.rst:3661 msgid "" "The precision determines the number of significant digits before and after " "the decimal point and defaults to 6." msgstr "" -#: ../../library/stdtypes.rst:2444 ../../library/stdtypes.rst:3666 +#: ../../library/stdtypes.rst:2443 ../../library/stdtypes.rst:3665 msgid "If precision is ``N``, the output is truncated to ``N`` characters." msgstr "" -#: ../../library/stdtypes.rst:2447 ../../library/stdtypes.rst:3675 +#: ../../library/stdtypes.rst:2446 ../../library/stdtypes.rst:3674 msgid "See :pep:`237`." msgstr "參閱 :pep:`237`\\ 。" -#: ../../library/stdtypes.rst:2449 +#: ../../library/stdtypes.rst:2448 msgid "" "Since Python strings have an explicit length, ``%s`` conversions do not " "assume that ``'\\0'`` is the end of the string." msgstr "" -#: ../../library/stdtypes.rst:2454 +#: ../../library/stdtypes.rst:2453 msgid "" "``%f`` conversions for numbers whose absolute value is over 1e50 are no " "longer replaced by ``%g`` conversions." msgstr "" -#: ../../library/stdtypes.rst:2465 +#: ../../library/stdtypes.rst:2464 msgid "" "Binary Sequence Types --- :class:`bytes`, :class:`bytearray`, :class:" "`memoryview`" msgstr "" -#: ../../library/stdtypes.rst:2473 +#: ../../library/stdtypes.rst:2472 msgid "" "The core built-in types for manipulating binary data are :class:`bytes` and :" "class:`bytearray`. They are supported by :class:`memoryview` which uses the :" @@ -3139,17 +3139,17 @@ msgid "" "objects without needing to make a copy." msgstr "" -#: ../../library/stdtypes.rst:2478 +#: ../../library/stdtypes.rst:2477 msgid "" "The :mod:`array` module supports efficient storage of basic data types like " "32-bit integers and IEEE754 double-precision floating values." msgstr "" -#: ../../library/stdtypes.rst:2484 +#: ../../library/stdtypes.rst:2483 msgid "Bytes Objects" msgstr "" -#: ../../library/stdtypes.rst:2488 +#: ../../library/stdtypes.rst:2487 msgid "" "Bytes objects are immutable sequences of single bytes. Since many major " "binary protocols are based on the ASCII text encoding, bytes objects offer " @@ -3157,40 +3157,40 @@ msgid "" "and are closely related to string objects in a variety of other ways." msgstr "" -#: ../../library/stdtypes.rst:2495 +#: ../../library/stdtypes.rst:2494 msgid "" "Firstly, the syntax for bytes literals is largely the same as that for " "string literals, except that a ``b`` prefix is added:" msgstr "" -#: ../../library/stdtypes.rst:2498 +#: ../../library/stdtypes.rst:2497 msgid "Single quotes: ``b'still allows embedded \"double\" quotes'``" msgstr "" -#: ../../library/stdtypes.rst:2499 +#: ../../library/stdtypes.rst:2498 msgid "Double quotes: ``b\"still allows embedded 'single' quotes\"``" msgstr "" -#: ../../library/stdtypes.rst:2500 +#: ../../library/stdtypes.rst:2499 msgid "" "Triple quoted: ``b'''3 single quotes'''``, ``b\"\"\"3 double quotes\"\"\"``" msgstr "" -#: ../../library/stdtypes.rst:2502 +#: ../../library/stdtypes.rst:2501 msgid "" "Only ASCII characters are permitted in bytes literals (regardless of the " "declared source code encoding). Any binary values over 127 must be entered " "into bytes literals using the appropriate escape sequence." msgstr "" -#: ../../library/stdtypes.rst:2506 +#: ../../library/stdtypes.rst:2505 msgid "" "As with string literals, bytes literals may also use a ``r`` prefix to " "disable processing of escape sequences. See :ref:`strings` for more about " "the various forms of bytes literal, including supported escape sequences." msgstr "" -#: ../../library/stdtypes.rst:2510 +#: ../../library/stdtypes.rst:2509 msgid "" "While bytes literals and representations are based on ASCII text, bytes " "objects actually behave like immutable sequences of integers, with each " @@ -3203,29 +3203,29 @@ msgid "" "compatible will usually lead to data corruption)." msgstr "" -#: ../../library/stdtypes.rst:2520 +#: ../../library/stdtypes.rst:2519 msgid "" "In addition to the literal forms, bytes objects can be created in a number " "of other ways:" msgstr "" -#: ../../library/stdtypes.rst:2523 +#: ../../library/stdtypes.rst:2522 msgid "A zero-filled bytes object of a specified length: ``bytes(10)``" msgstr "" -#: ../../library/stdtypes.rst:2524 +#: ../../library/stdtypes.rst:2523 msgid "From an iterable of integers: ``bytes(range(20))``" msgstr "" -#: ../../library/stdtypes.rst:2525 +#: ../../library/stdtypes.rst:2524 msgid "Copying existing binary data via the buffer protocol: ``bytes(obj)``" msgstr "" -#: ../../library/stdtypes.rst:2527 +#: ../../library/stdtypes.rst:2526 msgid "Also see the :ref:`bytes ` built-in." msgstr "" -#: ../../library/stdtypes.rst:2529 +#: ../../library/stdtypes.rst:2528 msgid "" "Since 2 hexadecimal digits correspond precisely to a single byte, " "hexadecimal numbers are a commonly used format for describing binary data. " @@ -3233,32 +3233,32 @@ msgid "" "that format:" msgstr "" -#: ../../library/stdtypes.rst:2535 +#: ../../library/stdtypes.rst:2534 msgid "" "This :class:`bytes` class method returns a bytes object, decoding the given " "string object. The string must contain two hexadecimal digits per byte, " "with ASCII whitespace being ignored." msgstr "" -#: ../../library/stdtypes.rst:2542 +#: ../../library/stdtypes.rst:2541 msgid "" ":meth:`bytes.fromhex` now skips all ASCII whitespace in the string, not just " "spaces." msgstr "" -#: ../../library/stdtypes.rst:2546 +#: ../../library/stdtypes.rst:2545 msgid "" "A reverse conversion function exists to transform a bytes object into its " "hexadecimal representation." msgstr "" -#: ../../library/stdtypes.rst:2551 ../../library/stdtypes.rst:2636 +#: ../../library/stdtypes.rst:2550 ../../library/stdtypes.rst:2635 msgid "" "Return a string object containing two hexadecimal digits for each byte in " "the instance." msgstr "" -#: ../../library/stdtypes.rst:2557 +#: ../../library/stdtypes.rst:2556 msgid "" "If you want to make the hex string easier to read, you can specify a single " "character separator *sep* parameter to include in the output. By default, " @@ -3267,13 +3267,13 @@ msgid "" "the separator position from the right, negative values from the left." msgstr "" -#: ../../library/stdtypes.rst:2574 +#: ../../library/stdtypes.rst:2573 msgid "" ":meth:`bytes.hex` now supports optional *sep* and *bytes_per_sep* parameters " "to insert separators between bytes in the hex output." msgstr "" -#: ../../library/stdtypes.rst:2578 +#: ../../library/stdtypes.rst:2577 msgid "" "Since bytes objects are sequences of integers (akin to a tuple), for a bytes " "object *b*, ``b[0]`` will be an integer, while ``b[0:1]`` will be a bytes " @@ -3281,58 +3281,58 @@ msgid "" "and slicing will produce a string of length 1)" msgstr "" -#: ../../library/stdtypes.rst:2583 +#: ../../library/stdtypes.rst:2582 msgid "" "The representation of bytes objects uses the literal format (``b'...'``) " "since it is often more useful than e.g. ``bytes([46, 46, 46])``. You can " "always convert a bytes object into a list of integers using ``list(b)``." msgstr "" -#: ../../library/stdtypes.rst:2591 +#: ../../library/stdtypes.rst:2590 msgid "Bytearray Objects" msgstr "" -#: ../../library/stdtypes.rst:2595 +#: ../../library/stdtypes.rst:2594 msgid "" ":class:`bytearray` objects are a mutable counterpart to :class:`bytes` " "objects." msgstr "" -#: ../../library/stdtypes.rst:2600 +#: ../../library/stdtypes.rst:2599 msgid "" "There is no dedicated literal syntax for bytearray objects, instead they are " "always created by calling the constructor:" msgstr "" -#: ../../library/stdtypes.rst:2603 +#: ../../library/stdtypes.rst:2602 msgid "Creating an empty instance: ``bytearray()``" msgstr "" -#: ../../library/stdtypes.rst:2604 +#: ../../library/stdtypes.rst:2603 msgid "Creating a zero-filled instance with a given length: ``bytearray(10)``" msgstr "" -#: ../../library/stdtypes.rst:2605 +#: ../../library/stdtypes.rst:2604 msgid "From an iterable of integers: ``bytearray(range(20))``" msgstr "" -#: ../../library/stdtypes.rst:2606 +#: ../../library/stdtypes.rst:2605 msgid "" "Copying existing binary data via the buffer protocol: ``bytearray(b'Hi!')``" msgstr "" -#: ../../library/stdtypes.rst:2608 +#: ../../library/stdtypes.rst:2607 msgid "" "As bytearray objects are mutable, they support the :ref:`mutable ` sequence operations in addition to the common bytes and bytearray " "operations described in :ref:`bytes-methods`." msgstr "" -#: ../../library/stdtypes.rst:2612 +#: ../../library/stdtypes.rst:2611 msgid "Also see the :ref:`bytearray ` built-in." msgstr "" -#: ../../library/stdtypes.rst:2614 +#: ../../library/stdtypes.rst:2613 msgid "" "Since 2 hexadecimal digits correspond precisely to a single byte, " "hexadecimal numbers are a commonly used format for describing binary data. " @@ -3340,33 +3340,33 @@ msgid "" "in that format:" msgstr "" -#: ../../library/stdtypes.rst:2620 +#: ../../library/stdtypes.rst:2619 msgid "" "This :class:`bytearray` class method returns bytearray object, decoding the " "given string object. The string must contain two hexadecimal digits per " "byte, with ASCII whitespace being ignored." msgstr "" -#: ../../library/stdtypes.rst:2627 +#: ../../library/stdtypes.rst:2626 msgid "" ":meth:`bytearray.fromhex` now skips all ASCII whitespace in the string, not " "just spaces." msgstr "" -#: ../../library/stdtypes.rst:2631 +#: ../../library/stdtypes.rst:2630 msgid "" "A reverse conversion function exists to transform a bytearray object into " "its hexadecimal representation." msgstr "" -#: ../../library/stdtypes.rst:2644 +#: ../../library/stdtypes.rst:2643 msgid "" "Similar to :meth:`bytes.hex`, :meth:`bytearray.hex` now supports optional " "*sep* and *bytes_per_sep* parameters to insert separators between bytes in " "the hex output." msgstr "" -#: ../../library/stdtypes.rst:2649 +#: ../../library/stdtypes.rst:2648 msgid "" "Since bytearray objects are sequences of integers (akin to a list), for a " "bytearray object *b*, ``b[0]`` will be an integer, while ``b[0:1]`` will be " @@ -3374,7 +3374,7 @@ msgid "" "both indexing and slicing will produce a string of length 1)" msgstr "" -#: ../../library/stdtypes.rst:2654 +#: ../../library/stdtypes.rst:2653 msgid "" "The representation of bytearray objects uses the bytes literal format " "(``bytearray(b'...')``) since it is often more useful than e.g. " @@ -3382,11 +3382,11 @@ msgid "" "a list of integers using ``list(b)``." msgstr "" -#: ../../library/stdtypes.rst:2663 +#: ../../library/stdtypes.rst:2662 msgid "Bytes and Bytearray Operations" msgstr "" -#: ../../library/stdtypes.rst:2668 +#: ../../library/stdtypes.rst:2667 msgid "" "Both bytes and bytearray objects support the :ref:`common ` " "sequence operations. They interoperate not just with operands of the same " @@ -3395,107 +3395,107 @@ msgid "" "return type of the result may depend on the order of operands." msgstr "" -#: ../../library/stdtypes.rst:2676 +#: ../../library/stdtypes.rst:2675 msgid "" "The methods on bytes and bytearray objects don't accept strings as their " "arguments, just as the methods on strings don't accept bytes as their " "arguments. For example, you have to write::" msgstr "" -#: ../../library/stdtypes.rst:2683 +#: ../../library/stdtypes.rst:2682 msgid "and::" msgstr "" "和:\n" "\n" "::" -#: ../../library/stdtypes.rst:2688 +#: ../../library/stdtypes.rst:2687 msgid "" "Some bytes and bytearray operations assume the use of ASCII compatible " "binary formats, and hence should be avoided when working with arbitrary " "binary data. These restrictions are covered below." msgstr "" -#: ../../library/stdtypes.rst:2693 +#: ../../library/stdtypes.rst:2692 msgid "" "Using these ASCII based operations to manipulate binary data that is not " "stored in an ASCII based format may lead to data corruption." msgstr "" -#: ../../library/stdtypes.rst:2696 +#: ../../library/stdtypes.rst:2695 msgid "" "The following methods on bytes and bytearray objects can be used with " "arbitrary binary data." msgstr "" -#: ../../library/stdtypes.rst:2702 +#: ../../library/stdtypes.rst:2701 msgid "" "Return the number of non-overlapping occurrences of subsequence *sub* in the " "range [*start*, *end*]. Optional arguments *start* and *end* are " "interpreted as in slice notation." msgstr "" -#: ../../library/stdtypes.rst:2706 ../../library/stdtypes.rst:2811 -#: ../../library/stdtypes.rst:2833 ../../library/stdtypes.rst:2899 -#: ../../library/stdtypes.rst:2912 +#: ../../library/stdtypes.rst:2705 ../../library/stdtypes.rst:2810 +#: ../../library/stdtypes.rst:2832 ../../library/stdtypes.rst:2898 +#: ../../library/stdtypes.rst:2911 msgid "" "The subsequence to search for may be any :term:`bytes-like object` or an " "integer in the range 0 to 255." msgstr "" -#: ../../library/stdtypes.rst:2709 +#: ../../library/stdtypes.rst:2708 msgid "" "If *sub* is empty, returns the number of empty slices between characters " "which is the length of the bytes object plus one." msgstr "" -#: ../../library/stdtypes.rst:2712 ../../library/stdtypes.rst:2823 -#: ../../library/stdtypes.rst:2836 ../../library/stdtypes.rst:2902 -#: ../../library/stdtypes.rst:2915 +#: ../../library/stdtypes.rst:2711 ../../library/stdtypes.rst:2822 +#: ../../library/stdtypes.rst:2835 ../../library/stdtypes.rst:2901 +#: ../../library/stdtypes.rst:2914 msgid "Also accept an integer in the range 0 to 255 as the subsequence." msgstr "" -#: ../../library/stdtypes.rst:2719 +#: ../../library/stdtypes.rst:2718 msgid "" "If the binary data starts with the *prefix* string, return " "``bytes[len(prefix):]``. Otherwise, return a copy of the original binary " "data::" msgstr "" -#: ../../library/stdtypes.rst:2728 +#: ../../library/stdtypes.rst:2727 msgid "The *prefix* may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:2732 ../../library/stdtypes.rst:2754 -#: ../../library/stdtypes.rst:2887 ../../library/stdtypes.rst:2980 -#: ../../library/stdtypes.rst:2994 ../../library/stdtypes.rst:3025 -#: ../../library/stdtypes.rst:3039 ../../library/stdtypes.rst:3081 -#: ../../library/stdtypes.rst:3151 ../../library/stdtypes.rst:3169 -#: ../../library/stdtypes.rst:3197 ../../library/stdtypes.rst:3336 -#: ../../library/stdtypes.rst:3391 ../../library/stdtypes.rst:3434 -#: ../../library/stdtypes.rst:3455 ../../library/stdtypes.rst:3477 -#: ../../library/stdtypes.rst:3679 +#: ../../library/stdtypes.rst:2731 ../../library/stdtypes.rst:2753 +#: ../../library/stdtypes.rst:2886 ../../library/stdtypes.rst:2979 +#: ../../library/stdtypes.rst:2993 ../../library/stdtypes.rst:3024 +#: ../../library/stdtypes.rst:3038 ../../library/stdtypes.rst:3080 +#: ../../library/stdtypes.rst:3150 ../../library/stdtypes.rst:3168 +#: ../../library/stdtypes.rst:3196 ../../library/stdtypes.rst:3335 +#: ../../library/stdtypes.rst:3390 ../../library/stdtypes.rst:3433 +#: ../../library/stdtypes.rst:3454 ../../library/stdtypes.rst:3476 +#: ../../library/stdtypes.rst:3678 msgid "" "The bytearray version of this method does *not* operate in place - it always " "produces a new object, even if no changes were made." msgstr "" -#: ../../library/stdtypes.rst:2741 +#: ../../library/stdtypes.rst:2740 msgid "" "If the binary data ends with the *suffix* string and that *suffix* is not " "empty, return ``bytes[:-len(suffix)]``. Otherwise, return a copy of the " "original binary data::" msgstr "" -#: ../../library/stdtypes.rst:2750 +#: ../../library/stdtypes.rst:2749 msgid "The *suffix* may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:2763 +#: ../../library/stdtypes.rst:2762 msgid "Return the bytes decoded to a :class:`str`." msgstr "" -#: ../../library/stdtypes.rst:2768 +#: ../../library/stdtypes.rst:2767 msgid "" "*errors* controls how decoding errors are handled. If ``'strict'`` (the " "default), a :exc:`UnicodeError` exception is raised. Other possible values " @@ -3503,21 +3503,21 @@ msgid "" "`codecs.register_error`. See :ref:`error-handlers` for details." msgstr "" -#: ../../library/stdtypes.rst:2774 +#: ../../library/stdtypes.rst:2773 msgid "" "For performance reasons, the value of *errors* is not checked for validity " "unless a decoding error actually occurs, :ref:`devmode` is enabled or a :ref:" "`debug build ` is used." msgstr "" -#: ../../library/stdtypes.rst:2780 +#: ../../library/stdtypes.rst:2779 msgid "" "Passing the *encoding* argument to :class:`str` allows decoding any :term:" "`bytes-like object` directly, without needing to make a temporary :class:`!" "bytes` or :class:`!bytearray` object." msgstr "" -#: ../../library/stdtypes.rst:2795 +#: ../../library/stdtypes.rst:2794 msgid "" "Return ``True`` if the binary data ends with the specified *suffix*, " "otherwise return ``False``. *suffix* can also be a tuple of suffixes to " @@ -3525,11 +3525,11 @@ msgid "" "optional *end*, stop comparing at that position." msgstr "" -#: ../../library/stdtypes.rst:2800 +#: ../../library/stdtypes.rst:2799 msgid "The suffix(es) to search for may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:2806 +#: ../../library/stdtypes.rst:2805 msgid "" "Return the lowest index in the data where the subsequence *sub* is found, " "such that *sub* is contained in the slice ``s[start:end]``. Optional " @@ -3537,20 +3537,20 @@ msgid "" "``-1`` if *sub* is not found." msgstr "" -#: ../../library/stdtypes.rst:2816 +#: ../../library/stdtypes.rst:2815 msgid "" "The :meth:`~bytes.find` method should be used only if you need to know the " "position of *sub*. To check if *sub* is a substring or not, use the :" "keyword:`in` operator::" msgstr "" -#: ../../library/stdtypes.rst:2830 +#: ../../library/stdtypes.rst:2829 msgid "" "Like :meth:`~bytes.find`, but raise :exc:`ValueError` when the subsequence " "is not found." msgstr "" -#: ../../library/stdtypes.rst:2843 +#: ../../library/stdtypes.rst:2842 msgid "" "Return a bytes or bytearray object which is the concatenation of the binary " "data sequences in *iterable*. A :exc:`TypeError` will be raised if there " @@ -3560,7 +3560,7 @@ msgid "" "method." msgstr "" -#: ../../library/stdtypes.rst:2854 +#: ../../library/stdtypes.rst:2853 msgid "" "This static method returns a translation table usable for :meth:`bytes." "translate` that will map each character in *from* into the character at the " @@ -3568,7 +3568,7 @@ msgid "" "objects ` and have the same length." msgstr "" -#: ../../library/stdtypes.rst:2865 +#: ../../library/stdtypes.rst:2864 msgid "" "Split the sequence at the first occurrence of *sep*, and return a 3-tuple " "containing the part before the separator, the separator itself or its " @@ -3577,24 +3577,24 @@ msgid "" "by two empty bytes or bytearray objects." msgstr "" -#: ../../library/stdtypes.rst:2872 ../../library/stdtypes.rst:2929 +#: ../../library/stdtypes.rst:2871 ../../library/stdtypes.rst:2928 msgid "The separator to search for may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:2878 +#: ../../library/stdtypes.rst:2877 msgid "" "Return a copy of the sequence with all occurrences of subsequence *old* " "replaced by *new*. If the optional argument *count* is given, only the " "first *count* occurrences are replaced." msgstr "" -#: ../../library/stdtypes.rst:2882 +#: ../../library/stdtypes.rst:2881 msgid "" "The subsequence to search for and its replacement may be any :term:`bytes-" "like object`." msgstr "" -#: ../../library/stdtypes.rst:2894 +#: ../../library/stdtypes.rst:2893 msgid "" "Return the highest index in the sequence where the subsequence *sub* is " "found, such that *sub* is contained within ``s[start:end]``. Optional " @@ -3602,13 +3602,13 @@ msgid "" "``-1`` on failure." msgstr "" -#: ../../library/stdtypes.rst:2909 +#: ../../library/stdtypes.rst:2908 msgid "" "Like :meth:`~bytes.rfind` but raises :exc:`ValueError` when the subsequence " "*sub* is not found." msgstr "" -#: ../../library/stdtypes.rst:2922 +#: ../../library/stdtypes.rst:2921 msgid "" "Split the sequence at the last occurrence of *sep*, and return a 3-tuple " "containing the part before the separator, the separator itself or its " @@ -3617,7 +3617,7 @@ msgid "" "followed by a copy of the original sequence." msgstr "" -#: ../../library/stdtypes.rst:2935 +#: ../../library/stdtypes.rst:2934 msgid "" "Return ``True`` if the binary data starts with the specified *prefix*, " "otherwise return ``False``. *prefix* can also be a tuple of prefixes to " @@ -3625,11 +3625,11 @@ msgid "" "optional *end*, stop comparing at that position." msgstr "" -#: ../../library/stdtypes.rst:2940 +#: ../../library/stdtypes.rst:2939 msgid "The prefix(es) to search for may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:2946 +#: ../../library/stdtypes.rst:2945 msgid "" "Return a copy of the bytes or bytearray object where all bytes occurring in " "the optional argument *delete* are removed, and the remaining bytes have " @@ -3637,22 +3637,22 @@ msgid "" "object of length 256." msgstr "" -#: ../../library/stdtypes.rst:2951 +#: ../../library/stdtypes.rst:2950 msgid "" "You can use the :func:`bytes.maketrans` method to create a translation table." msgstr "" -#: ../../library/stdtypes.rst:2954 +#: ../../library/stdtypes.rst:2953 msgid "" "Set the *table* argument to ``None`` for translations that only delete " "characters::" msgstr "" -#: ../../library/stdtypes.rst:2960 +#: ../../library/stdtypes.rst:2959 msgid "*delete* is now supported as a keyword argument." msgstr "" -#: ../../library/stdtypes.rst:2964 +#: ../../library/stdtypes.rst:2963 msgid "" "The following methods on bytes and bytearray objects have default behaviours " "that assume the use of ASCII compatible binary formats, but can still be " @@ -3661,7 +3661,7 @@ msgid "" "instead produce new objects." msgstr "" -#: ../../library/stdtypes.rst:2973 +#: ../../library/stdtypes.rst:2972 msgid "" "Return a copy of the object centered in a sequence of length *width*. " "Padding is done using the specified *fillbyte* (default is an ASCII space). " @@ -3669,7 +3669,7 @@ msgid "" "less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:2987 +#: ../../library/stdtypes.rst:2986 msgid "" "Return a copy of the object left justified in a sequence of length *width*. " "Padding is done using the specified *fillbyte* (default is an ASCII space). " @@ -3677,7 +3677,7 @@ msgid "" "less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:3001 +#: ../../library/stdtypes.rst:3000 msgid "" "Return a copy of the sequence with specified leading bytes removed. The " "*chars* argument is a binary sequence specifying the set of byte values to " @@ -3687,14 +3687,14 @@ msgid "" "all combinations of its values are stripped::" msgstr "" -#: ../../library/stdtypes.rst:3013 +#: ../../library/stdtypes.rst:3012 msgid "" "The binary sequence of byte values to remove may be any :term:`bytes-like " "object`. See :meth:`~bytes.removeprefix` for a method that will remove a " "single prefix string rather than all of a set of characters. For example::" msgstr "" -#: ../../library/stdtypes.rst:3032 +#: ../../library/stdtypes.rst:3031 msgid "" "Return a copy of the object right justified in a sequence of length *width*. " "Padding is done using the specified *fillbyte* (default is an ASCII space). " @@ -3702,7 +3702,7 @@ msgid "" "less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:3046 +#: ../../library/stdtypes.rst:3045 msgid "" "Split the binary sequence into subsequences of the same type, using *sep* as " "the delimiter string. If *maxsplit* is given, at most *maxsplit* splits are " @@ -3712,7 +3712,7 @@ msgid "" "described in detail below." msgstr "" -#: ../../library/stdtypes.rst:3057 +#: ../../library/stdtypes.rst:3056 msgid "" "Return a copy of the sequence with specified trailing bytes removed. The " "*chars* argument is a binary sequence specifying the set of byte values to " @@ -3722,14 +3722,14 @@ msgid "" "all combinations of its values are stripped::" msgstr "" -#: ../../library/stdtypes.rst:3069 +#: ../../library/stdtypes.rst:3068 msgid "" "The binary sequence of byte values to remove may be any :term:`bytes-like " "object`. See :meth:`~bytes.removesuffix` for a method that will remove a " "single suffix string rather than all of a set of characters. For example::" msgstr "" -#: ../../library/stdtypes.rst:3088 +#: ../../library/stdtypes.rst:3087 msgid "" "Split the binary sequence into subsequences of the same type, using *sep* as " "the delimiter string. If *maxsplit* is given and non-negative, at most " @@ -3738,7 +3738,7 @@ msgid "" "limit on the number of splits (all possible splits are made)." msgstr "" -#: ../../library/stdtypes.rst:3094 +#: ../../library/stdtypes.rst:3093 msgid "" "If *sep* is given, consecutive delimiters are not grouped together and are " "deemed to delimit empty subsequences (for example, ``b'1,,2'.split(b',')`` " @@ -3749,7 +3749,7 @@ msgid "" "object being split. The *sep* argument may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:3112 +#: ../../library/stdtypes.rst:3111 msgid "" "If *sep* is not specified or is ``None``, a different splitting algorithm is " "applied: runs of consecutive ASCII whitespace are regarded as a single " @@ -3759,7 +3759,7 @@ msgid "" "without a specified separator returns ``[]``." msgstr "" -#: ../../library/stdtypes.rst:3133 +#: ../../library/stdtypes.rst:3132 msgid "" "Return a copy of the sequence with specified leading and trailing bytes " "removed. The *chars* argument is a binary sequence specifying the set of " @@ -3769,13 +3769,13 @@ msgid "" "a prefix or suffix; rather, all combinations of its values are stripped::" msgstr "" -#: ../../library/stdtypes.rst:3146 +#: ../../library/stdtypes.rst:3145 msgid "" "The binary sequence of byte values to remove may be any :term:`bytes-like " "object`." msgstr "" -#: ../../library/stdtypes.rst:3155 +#: ../../library/stdtypes.rst:3154 msgid "" "The following methods on bytes and bytearray objects assume the use of ASCII " "compatible binary formats and should not be applied to arbitrary binary " @@ -3783,14 +3783,14 @@ msgid "" "operate in place, and instead produce new objects." msgstr "" -#: ../../library/stdtypes.rst:3163 +#: ../../library/stdtypes.rst:3162 msgid "" "Return a copy of the sequence with each byte interpreted as an ASCII " "character, and the first byte capitalized and the rest lowercased. Non-ASCII " "byte values are passed through unchanged." msgstr "" -#: ../../library/stdtypes.rst:3176 +#: ../../library/stdtypes.rst:3175 msgid "" "Return a copy of the sequence where all ASCII tab characters are replaced by " "one or more ASCII spaces, depending on the current column and the given tab " @@ -3806,7 +3806,7 @@ msgid "" "by one regardless of how the byte value is represented when printed::" msgstr "" -#: ../../library/stdtypes.rst:3204 +#: ../../library/stdtypes.rst:3203 msgid "" "Return ``True`` if all bytes in the sequence are alphabetical ASCII " "characters or ASCII decimal digits and the sequence is not empty, ``False`` " @@ -3815,7 +3815,7 @@ msgid "" "digits are those byte values in the sequence ``b'0123456789'``." msgstr "" -#: ../../library/stdtypes.rst:3221 +#: ../../library/stdtypes.rst:3220 msgid "" "Return ``True`` if all bytes in the sequence are alphabetic ASCII characters " "and the sequence is not empty, ``False`` otherwise. Alphabetic ASCII " @@ -3823,35 +3823,35 @@ msgid "" "``b'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'``." msgstr "" -#: ../../library/stdtypes.rst:3237 +#: ../../library/stdtypes.rst:3236 msgid "" "Return ``True`` if the sequence is empty or all bytes in the sequence are " "ASCII, ``False`` otherwise. ASCII bytes are in the range 0-0x7F." msgstr "" -#: ../../library/stdtypes.rst:3247 +#: ../../library/stdtypes.rst:3246 msgid "" "Return ``True`` if all bytes in the sequence are ASCII decimal digits and " "the sequence is not empty, ``False`` otherwise. ASCII decimal digits are " "those byte values in the sequence ``b'0123456789'``." msgstr "" -#: ../../library/stdtypes.rst:3262 +#: ../../library/stdtypes.rst:3261 msgid "" "Return ``True`` if there is at least one lowercase ASCII character in the " "sequence and no uppercase ASCII characters, ``False`` otherwise." msgstr "" -#: ../../library/stdtypes.rst:3272 ../../library/stdtypes.rst:3314 -#: ../../library/stdtypes.rst:3330 ../../library/stdtypes.rst:3380 -#: ../../library/stdtypes.rst:3449 +#: ../../library/stdtypes.rst:3271 ../../library/stdtypes.rst:3313 +#: ../../library/stdtypes.rst:3329 ../../library/stdtypes.rst:3379 +#: ../../library/stdtypes.rst:3448 msgid "" "Lowercase ASCII characters are those byte values in the sequence " "``b'abcdefghijklmnopqrstuvwxyz'``. Uppercase ASCII characters are those byte " "values in the sequence ``b'ABCDEFGHIJKLMNOPQRSTUVWXYZ'``." msgstr "" -#: ../../library/stdtypes.rst:3280 +#: ../../library/stdtypes.rst:3279 msgid "" "Return ``True`` if all bytes in the sequence are ASCII whitespace and the " "sequence is not empty, ``False`` otherwise. ASCII whitespace characters are " @@ -3859,27 +3859,27 @@ msgid "" "newline, carriage return, vertical tab, form feed)." msgstr "" -#: ../../library/stdtypes.rst:3289 +#: ../../library/stdtypes.rst:3288 msgid "" "Return ``True`` if the sequence is ASCII titlecase and the sequence is not " "empty, ``False`` otherwise. See :meth:`bytes.title` for more details on the " "definition of \"titlecase\"." msgstr "" -#: ../../library/stdtypes.rst:3304 +#: ../../library/stdtypes.rst:3303 msgid "" "Return ``True`` if there is at least one uppercase alphabetic ASCII " "character in the sequence and no lowercase ASCII characters, ``False`` " "otherwise." msgstr "" -#: ../../library/stdtypes.rst:3322 +#: ../../library/stdtypes.rst:3321 msgid "" "Return a copy of the sequence with all the uppercase ASCII characters " "converted to their corresponding lowercase counterpart." msgstr "" -#: ../../library/stdtypes.rst:3347 +#: ../../library/stdtypes.rst:3346 msgid "" "Return a list of the lines in the binary sequence, breaking at ASCII line " "boundaries. This method uses the :term:`universal newlines` approach to " @@ -3887,20 +3887,20 @@ msgid "" "*keepends* is given and true." msgstr "" -#: ../../library/stdtypes.rst:3359 +#: ../../library/stdtypes.rst:3358 msgid "" "Unlike :meth:`~bytes.split` when a delimiter string *sep* is given, this " "method returns an empty list for the empty string, and a terminal line break " "does not result in an extra line::" msgstr "" -#: ../../library/stdtypes.rst:3372 +#: ../../library/stdtypes.rst:3371 msgid "" "Return a copy of the sequence with all the lowercase ASCII characters " "converted to their corresponding uppercase counterpart and vice-versa." msgstr "" -#: ../../library/stdtypes.rst:3384 +#: ../../library/stdtypes.rst:3383 msgid "" "Unlike :func:`str.swapcase()`, it is always the case that ``bin.swapcase()." "swapcase() == bin`` for the binary versions. Case conversions are " @@ -3908,14 +3908,14 @@ msgid "" "Unicode code points." msgstr "" -#: ../../library/stdtypes.rst:3398 +#: ../../library/stdtypes.rst:3397 msgid "" "Return a titlecased version of the binary sequence where words start with an " "uppercase ASCII character and the remaining characters are lowercase. " "Uncased byte values are left unmodified." msgstr "" -#: ../../library/stdtypes.rst:3407 +#: ../../library/stdtypes.rst:3406 msgid "" "Lowercase ASCII characters are those byte values in the sequence " "``b'abcdefghijklmnopqrstuvwxyz'``. Uppercase ASCII characters are those byte " @@ -3923,18 +3923,18 @@ msgid "" "values are uncased." msgstr "" -#: ../../library/stdtypes.rst:3420 +#: ../../library/stdtypes.rst:3419 msgid "" "A workaround for apostrophes can be constructed using regular expressions::" msgstr "" -#: ../../library/stdtypes.rst:3441 +#: ../../library/stdtypes.rst:3440 msgid "" "Return a copy of the sequence with all the lowercase ASCII characters " "converted to their corresponding uppercase counterpart." msgstr "" -#: ../../library/stdtypes.rst:3462 +#: ../../library/stdtypes.rst:3461 msgid "" "Return a copy of the sequence left filled with ASCII ``b'0'`` digits to make " "a sequence of length *width*. A leading sign prefix (``b'+'``/ ``b'-'``) is " @@ -3943,11 +3943,11 @@ msgid "" "*width* is less than or equal to ``len(seq)``." msgstr "" -#: ../../library/stdtypes.rst:3484 +#: ../../library/stdtypes.rst:3483 msgid "``printf``-style Bytes Formatting" msgstr "" -#: ../../library/stdtypes.rst:3501 +#: ../../library/stdtypes.rst:3500 msgid "" "The formatting operations described here exhibit a variety of quirks that " "lead to a number of common errors (such as failing to display tuples and " @@ -3955,7 +3955,7 @@ msgid "" "dictionary, wrap it in a tuple." msgstr "" -#: ../../library/stdtypes.rst:3506 +#: ../../library/stdtypes.rst:3505 msgid "" "Bytes objects (``bytes``/``bytearray``) have one unique built-in operation: " "the ``%`` operator (modulo). This is also known as the bytes *formatting* or " @@ -3965,7 +3965,7 @@ msgid "" "func:`sprintf` in the C language." msgstr "" -#: ../../library/stdtypes.rst:3513 +#: ../../library/stdtypes.rst:3512 msgid "" "If *format* requires a single argument, *values* may be a single non-tuple " "object. [5]_ Otherwise, *values* must be a tuple with exactly the number of " @@ -3973,7 +3973,7 @@ msgid "" "example, a dictionary)." msgstr "" -#: ../../library/stdtypes.rst:3547 +#: ../../library/stdtypes.rst:3546 msgid "" "When the right argument is a dictionary (or other mapping type), then the " "formats in the bytes object *must* include a parenthesised mapping key into " @@ -3981,73 +3981,73 @@ msgid "" "mapping key selects the value to be formatted from the mapping. For example:" msgstr "" -#: ../../library/stdtypes.rst:3621 +#: ../../library/stdtypes.rst:3620 msgid "Single byte (accepts integer or single byte objects)." msgstr "" -#: ../../library/stdtypes.rst:3624 +#: ../../library/stdtypes.rst:3623 msgid "``'b'``" msgstr "``'b'``" -#: ../../library/stdtypes.rst:3624 +#: ../../library/stdtypes.rst:3623 msgid "" "Bytes (any object that follows the :ref:`buffer protocol ` or " "has :meth:`__bytes__`)." msgstr "" -#: ../../library/stdtypes.rst:3628 +#: ../../library/stdtypes.rst:3627 msgid "" "``'s'`` is an alias for ``'b'`` and should only be used for Python2/3 code " "bases." msgstr "" -#: ../../library/stdtypes.rst:3631 +#: ../../library/stdtypes.rst:3630 msgid "" "Bytes (converts any Python object using ``repr(obj).encode('ascii', " "'backslashreplace')``)." msgstr "" -#: ../../library/stdtypes.rst:3634 +#: ../../library/stdtypes.rst:3633 msgid "" "``'r'`` is an alias for ``'a'`` and should only be used for Python2/3 code " "bases." msgstr "" -#: ../../library/stdtypes.rst:3634 +#: ../../library/stdtypes.rst:3633 msgid "\\(7)" msgstr "\\(7)" -#: ../../library/stdtypes.rst:3669 +#: ../../library/stdtypes.rst:3668 msgid "``b'%s'`` is deprecated, but will not be removed during the 3.x series." msgstr "" -#: ../../library/stdtypes.rst:3672 +#: ../../library/stdtypes.rst:3671 msgid "``b'%r'`` is deprecated, but will not be removed during the 3.x series." msgstr "" -#: ../../library/stdtypes.rst:3684 +#: ../../library/stdtypes.rst:3683 msgid ":pep:`461` - Adding % formatting to bytes and bytearray" msgstr "" -#: ../../library/stdtypes.rst:3691 +#: ../../library/stdtypes.rst:3690 msgid "Memory Views" msgstr "" -#: ../../library/stdtypes.rst:3693 +#: ../../library/stdtypes.rst:3692 msgid "" ":class:`memoryview` objects allow Python code to access the internal data of " "an object that supports the :ref:`buffer protocol ` without " "copying." msgstr "" -#: ../../library/stdtypes.rst:3699 +#: ../../library/stdtypes.rst:3698 msgid "" "Create a :class:`memoryview` that references *object*. *object* must " "support the buffer protocol. Built-in objects that support the buffer " "protocol include :class:`bytes` and :class:`bytearray`." msgstr "" -#: ../../library/stdtypes.rst:3703 +#: ../../library/stdtypes.rst:3702 msgid "" "A :class:`memoryview` has the notion of an *element*, which is the atomic " "memory unit handled by the originating *object*. For many simple types such " @@ -4055,7 +4055,7 @@ msgid "" "other types such as :class:`array.array` may have bigger elements." msgstr "" -#: ../../library/stdtypes.rst:3708 +#: ../../library/stdtypes.rst:3707 msgid "" "``len(view)`` is equal to the length of :class:`~memoryview.tolist`. If " "``view.ndim = 0``, the length is 1. If ``view.ndim = 1``, the length is " @@ -4065,13 +4065,13 @@ msgid "" "bytes in a single element." msgstr "" -#: ../../library/stdtypes.rst:3715 +#: ../../library/stdtypes.rst:3714 msgid "" "A :class:`memoryview` supports slicing and indexing to expose its data. One-" "dimensional slicing will result in a subview::" msgstr "" -#: ../../library/stdtypes.rst:3728 +#: ../../library/stdtypes.rst:3727 msgid "" "If :class:`~memoryview.format` is one of the native format specifiers from " "the :mod:`struct` module, indexing with an integer or a tuple of integers is " @@ -4082,82 +4082,82 @@ msgid "" "memoryviews can be indexed with the empty tuple." msgstr "" -#: ../../library/stdtypes.rst:3737 +#: ../../library/stdtypes.rst:3736 msgid "Here is an example with a non-byte format::" msgstr "" -#: ../../library/stdtypes.rst:3749 +#: ../../library/stdtypes.rst:3748 msgid "" "If the underlying object is writable, the memoryview supports one-" "dimensional slice assignment. Resizing is not allowed::" msgstr "" -#: ../../library/stdtypes.rst:3770 +#: ../../library/stdtypes.rst:3769 msgid "" "One-dimensional memoryviews of :term:`hashable` (read-only) types with " "formats 'B', 'b' or 'c' are also hashable. The hash is defined as ``hash(m) " "== hash(m.tobytes())``::" msgstr "" -#: ../../library/stdtypes.rst:3782 +#: ../../library/stdtypes.rst:3781 msgid "" "One-dimensional memoryviews can now be sliced. One-dimensional memoryviews " "with formats 'B', 'b' or 'c' are now :term:`hashable`." msgstr "" -#: ../../library/stdtypes.rst:3786 +#: ../../library/stdtypes.rst:3785 msgid "" "memoryview is now registered automatically with :class:`collections.abc." "Sequence`" msgstr "" -#: ../../library/stdtypes.rst:3790 +#: ../../library/stdtypes.rst:3789 msgid "memoryviews can now be indexed with tuple of integers." msgstr "" -#: ../../library/stdtypes.rst:3793 +#: ../../library/stdtypes.rst:3792 msgid ":class:`memoryview` has several methods:" msgstr "" -#: ../../library/stdtypes.rst:3797 +#: ../../library/stdtypes.rst:3796 msgid "" "A memoryview and a :pep:`3118` exporter are equal if their shapes are " "equivalent and if all corresponding values are equal when the operands' " "respective format codes are interpreted using :mod:`struct` syntax." msgstr "" -#: ../../library/stdtypes.rst:3801 +#: ../../library/stdtypes.rst:3800 msgid "" "For the subset of :mod:`struct` format strings currently supported by :meth:" "`tolist`, ``v`` and ``w`` are equal if ``v.tolist() == w.tolist()``::" msgstr "" -#: ../../library/stdtypes.rst:3820 +#: ../../library/stdtypes.rst:3819 msgid "" "If either format string is not supported by the :mod:`struct` module, then " "the objects will always compare as unequal (even if the format strings and " "buffer contents are identical)::" msgstr "" -#: ../../library/stdtypes.rst:3836 +#: ../../library/stdtypes.rst:3835 msgid "" "Note that, as with floating point numbers, ``v is w`` does *not* imply ``v " "== w`` for memoryview objects." msgstr "" -#: ../../library/stdtypes.rst:3839 +#: ../../library/stdtypes.rst:3838 msgid "" "Previous versions compared the raw memory disregarding the item format and " "the logical array structure." msgstr "" -#: ../../library/stdtypes.rst:3845 +#: ../../library/stdtypes.rst:3844 msgid "" "Return the data in the buffer as a bytestring. This is equivalent to " "calling the :class:`bytes` constructor on the memoryview. ::" msgstr "" -#: ../../library/stdtypes.rst:3854 +#: ../../library/stdtypes.rst:3853 msgid "" "For non-contiguous arrays the result is equal to the flattened list " "representation with all elements converted to bytes. :meth:`tobytes` " @@ -4165,7 +4165,7 @@ msgid "" "module syntax." msgstr "" -#: ../../library/stdtypes.rst:3859 +#: ../../library/stdtypes.rst:3858 msgid "" "*order* can be {'C', 'F', 'A'}. When *order* is 'C' or 'F', the data of the " "original array is converted to C or Fortran order. For contiguous views, 'A' " @@ -4174,36 +4174,36 @@ msgid "" "to C first. *order=None* is the same as *order='C'*." msgstr "" -#: ../../library/stdtypes.rst:3868 +#: ../../library/stdtypes.rst:3867 msgid "" "Return a string object containing two hexadecimal digits for each byte in " "the buffer. ::" msgstr "" -#: ../../library/stdtypes.rst:3877 +#: ../../library/stdtypes.rst:3876 msgid "" "Similar to :meth:`bytes.hex`, :meth:`memoryview.hex` now supports optional " "*sep* and *bytes_per_sep* parameters to insert separators between bytes in " "the hex output." msgstr "" -#: ../../library/stdtypes.rst:3884 +#: ../../library/stdtypes.rst:3883 msgid "Return the data in the buffer as a list of elements. ::" msgstr "" -#: ../../library/stdtypes.rst:3894 +#: ../../library/stdtypes.rst:3893 msgid "" ":meth:`tolist` now supports all single character native formats in :mod:" "`struct` module syntax as well as multi-dimensional representations." msgstr "" -#: ../../library/stdtypes.rst:3901 +#: ../../library/stdtypes.rst:3900 msgid "" "Return a readonly version of the memoryview object. The original memoryview " "object is unchanged. ::" msgstr "" -#: ../../library/stdtypes.rst:3920 +#: ../../library/stdtypes.rst:3919 msgid "" "Release the underlying buffer exposed by the memoryview object. Many " "objects take special actions when a view is held on them (for example, a :" @@ -4212,20 +4212,20 @@ msgid "" "resources) as soon as possible." msgstr "" -#: ../../library/stdtypes.rst:3926 +#: ../../library/stdtypes.rst:3925 msgid "" "After this method has been called, any further operation on the view raises " "a :class:`ValueError` (except :meth:`release()` itself which can be called " "multiple times)::" msgstr "" -#: ../../library/stdtypes.rst:3937 +#: ../../library/stdtypes.rst:3936 msgid "" "The context management protocol can be used for a similar effect, using the " "``with`` statement::" msgstr "" -#: ../../library/stdtypes.rst:3953 +#: ../../library/stdtypes.rst:3952 msgid "" "Cast a memoryview to a new format or shape. *shape* defaults to " "``[byte_length//new_itemsize]``, which means that the result view will be " @@ -4234,57 +4234,57 @@ msgid "" "contiguous -> 1D." msgstr "" -#: ../../library/stdtypes.rst:3959 +#: ../../library/stdtypes.rst:3958 msgid "" "The destination format is restricted to a single element native format in :" "mod:`struct` syntax. One of the formats must be a byte format ('B', 'b' or " "'c'). The byte length of the result must be the same as the original length." msgstr "" -#: ../../library/stdtypes.rst:3964 +#: ../../library/stdtypes.rst:3963 msgid "Cast 1D/long to 1D/unsigned bytes::" msgstr "" -#: ../../library/stdtypes.rst:3987 +#: ../../library/stdtypes.rst:3986 msgid "Cast 1D/unsigned bytes to 1D/char::" msgstr "" -#: ../../library/stdtypes.rst:4000 +#: ../../library/stdtypes.rst:3999 msgid "Cast 1D/bytes to 3D/ints to 1D/signed char::" msgstr "" -#: ../../library/stdtypes.rst:4026 +#: ../../library/stdtypes.rst:4025 msgid "Cast 1D/unsigned long to 2D/unsigned long::" msgstr "" -#: ../../library/stdtypes.rst:4040 +#: ../../library/stdtypes.rst:4039 msgid "The source format is no longer restricted when casting to a byte view." msgstr "" -#: ../../library/stdtypes.rst:4043 +#: ../../library/stdtypes.rst:4042 msgid "There are also several readonly attributes available:" msgstr "" -#: ../../library/stdtypes.rst:4047 +#: ../../library/stdtypes.rst:4046 msgid "The underlying object of the memoryview::" msgstr "" -#: ../../library/stdtypes.rst:4058 +#: ../../library/stdtypes.rst:4057 msgid "" "``nbytes == product(shape) * itemsize == len(m.tobytes())``. This is the " "amount of space in bytes that the array would use in a contiguous " "representation. It is not necessarily equal to ``len(m)``::" msgstr "" -#: ../../library/stdtypes.rst:4077 +#: ../../library/stdtypes.rst:4076 msgid "Multi-dimensional arrays::" msgstr "" -#: ../../library/stdtypes.rst:4094 +#: ../../library/stdtypes.rst:4093 msgid "A bool indicating whether the memory is read only." msgstr "" -#: ../../library/stdtypes.rst:4098 +#: ../../library/stdtypes.rst:4097 msgid "" "A string containing the format (in :mod:`struct` module style) for each " "element in the view. A memoryview can be created from exporters with " @@ -4292,59 +4292,59 @@ msgid "" "restricted to native single element formats." msgstr "" -#: ../../library/stdtypes.rst:4103 +#: ../../library/stdtypes.rst:4102 msgid "" "format ``'B'`` is now handled according to the struct module syntax. This " "means that ``memoryview(b'abc')[0] == b'abc'[0] == 97``." msgstr "" -#: ../../library/stdtypes.rst:4109 +#: ../../library/stdtypes.rst:4108 msgid "The size in bytes of each element of the memoryview::" msgstr "" -#: ../../library/stdtypes.rst:4122 +#: ../../library/stdtypes.rst:4121 msgid "" "An integer indicating how many dimensions of a multi-dimensional array the " "memory represents." msgstr "" -#: ../../library/stdtypes.rst:4127 +#: ../../library/stdtypes.rst:4126 msgid "" "A tuple of integers the length of :attr:`ndim` giving the shape of the " "memory as an N-dimensional array." msgstr "" -#: ../../library/stdtypes.rst:4130 ../../library/stdtypes.rst:4138 +#: ../../library/stdtypes.rst:4129 ../../library/stdtypes.rst:4137 msgid "An empty tuple instead of ``None`` when ndim = 0." msgstr "" -#: ../../library/stdtypes.rst:4135 +#: ../../library/stdtypes.rst:4134 msgid "" "A tuple of integers the length of :attr:`ndim` giving the size in bytes to " "access each element for each dimension of the array." msgstr "" -#: ../../library/stdtypes.rst:4143 +#: ../../library/stdtypes.rst:4142 msgid "Used internally for PIL-style arrays. The value is informational only." msgstr "" -#: ../../library/stdtypes.rst:4147 +#: ../../library/stdtypes.rst:4146 msgid "A bool indicating whether the memory is C-:term:`contiguous`." msgstr "" -#: ../../library/stdtypes.rst:4153 +#: ../../library/stdtypes.rst:4152 msgid "A bool indicating whether the memory is Fortran :term:`contiguous`." msgstr "" -#: ../../library/stdtypes.rst:4159 +#: ../../library/stdtypes.rst:4158 msgid "A bool indicating whether the memory is :term:`contiguous`." msgstr "" -#: ../../library/stdtypes.rst:4167 +#: ../../library/stdtypes.rst:4166 msgid "Set Types --- :class:`set`, :class:`frozenset`" msgstr "" -#: ../../library/stdtypes.rst:4171 +#: ../../library/stdtypes.rst:4170 msgid "" "A :dfn:`set` object is an unordered collection of distinct :term:`hashable` " "objects. Common uses include membership testing, removing duplicates from a " @@ -4354,7 +4354,7 @@ msgid "" "`collections` module.)" msgstr "" -#: ../../library/stdtypes.rst:4178 +#: ../../library/stdtypes.rst:4177 msgid "" "Like other collections, sets support ``x in set``, ``len(set)``, and ``for x " "in set``. Being an unordered collection, sets do not record element " @@ -4362,7 +4362,7 @@ msgid "" "slicing, or other sequence-like behavior." msgstr "" -#: ../../library/stdtypes.rst:4183 +#: ../../library/stdtypes.rst:4182 msgid "" "There are currently two built-in set types, :class:`set` and :class:" "`frozenset`. The :class:`set` type is mutable --- the contents can be " @@ -4374,18 +4374,18 @@ msgid "" "of another set." msgstr "" -#: ../../library/stdtypes.rst:4191 +#: ../../library/stdtypes.rst:4190 msgid "" "Non-empty sets (not frozensets) can be created by placing a comma-separated " "list of elements within braces, for example: ``{'jack', 'sjoerd'}``, in " "addition to the :class:`set` constructor." msgstr "" -#: ../../library/stdtypes.rst:4195 +#: ../../library/stdtypes.rst:4194 msgid "The constructors for both classes work the same:" msgstr "" -#: ../../library/stdtypes.rst:4200 +#: ../../library/stdtypes.rst:4199 msgid "" "Return a new set or frozenset object whose elements are taken from " "*iterable*. The elements of a set must be :term:`hashable`. To represent " @@ -4393,92 +4393,92 @@ msgid "" "*iterable* is not specified, a new empty set is returned." msgstr "" -#: ../../library/stdtypes.rst:4206 +#: ../../library/stdtypes.rst:4205 msgid "Sets can be created by several means:" msgstr "" -#: ../../library/stdtypes.rst:4208 +#: ../../library/stdtypes.rst:4207 msgid "" "Use a comma-separated list of elements within braces: ``{'jack', 'sjoerd'}``" msgstr "" -#: ../../library/stdtypes.rst:4209 +#: ../../library/stdtypes.rst:4208 msgid "" "Use a set comprehension: ``{c for c in 'abracadabra' if c not in 'abc'}``" msgstr "" -#: ../../library/stdtypes.rst:4210 +#: ../../library/stdtypes.rst:4209 msgid "" "Use the type constructor: ``set()``, ``set('foobar')``, ``set(['a', 'b', " "'foo'])``" msgstr "" -#: ../../library/stdtypes.rst:4212 +#: ../../library/stdtypes.rst:4211 msgid "" "Instances of :class:`set` and :class:`frozenset` provide the following " "operations:" msgstr "" -#: ../../library/stdtypes.rst:4217 +#: ../../library/stdtypes.rst:4216 msgid "Return the number of elements in set *s* (cardinality of *s*)." msgstr "" -#: ../../library/stdtypes.rst:4221 +#: ../../library/stdtypes.rst:4220 msgid "Test *x* for membership in *s*." msgstr "" -#: ../../library/stdtypes.rst:4225 +#: ../../library/stdtypes.rst:4224 msgid "Test *x* for non-membership in *s*." msgstr "" -#: ../../library/stdtypes.rst:4229 +#: ../../library/stdtypes.rst:4228 msgid "" "Return ``True`` if the set has no elements in common with *other*. Sets are " "disjoint if and only if their intersection is the empty set." msgstr "" -#: ../../library/stdtypes.rst:4235 +#: ../../library/stdtypes.rst:4234 msgid "Test whether every element in the set is in *other*." msgstr "" -#: ../../library/stdtypes.rst:4239 +#: ../../library/stdtypes.rst:4238 msgid "" "Test whether the set is a proper subset of *other*, that is, ``set <= other " "and set != other``." msgstr "" -#: ../../library/stdtypes.rst:4245 +#: ../../library/stdtypes.rst:4244 msgid "Test whether every element in *other* is in the set." msgstr "" -#: ../../library/stdtypes.rst:4249 +#: ../../library/stdtypes.rst:4248 msgid "" "Test whether the set is a proper superset of *other*, that is, ``set >= " "other and set != other``." msgstr "" -#: ../../library/stdtypes.rst:4255 +#: ../../library/stdtypes.rst:4254 msgid "Return a new set with elements from the set and all others." msgstr "" -#: ../../library/stdtypes.rst:4260 +#: ../../library/stdtypes.rst:4259 msgid "Return a new set with elements common to the set and all others." msgstr "" -#: ../../library/stdtypes.rst:4265 +#: ../../library/stdtypes.rst:4264 msgid "Return a new set with elements in the set that are not in the others." msgstr "" -#: ../../library/stdtypes.rst:4270 +#: ../../library/stdtypes.rst:4269 msgid "" "Return a new set with elements in either the set or *other* but not both." msgstr "" -#: ../../library/stdtypes.rst:4274 +#: ../../library/stdtypes.rst:4273 msgid "Return a shallow copy of the set." msgstr "" -#: ../../library/stdtypes.rst:4277 +#: ../../library/stdtypes.rst:4276 msgid "" "Note, the non-operator versions of :meth:`union`, :meth:`intersection`, :" "meth:`difference`, :meth:`symmetric_difference`, :meth:`issubset`, and :meth:" @@ -4488,7 +4488,7 @@ msgid "" "the more readable ``set('abc').intersection('cbs')``." msgstr "" -#: ../../library/stdtypes.rst:4284 +#: ../../library/stdtypes.rst:4283 msgid "" "Both :class:`set` and :class:`frozenset` support set to set comparisons. Two " "sets are equal if and only if every element of each set is contained in the " @@ -4498,14 +4498,14 @@ msgid "" "set is a proper superset of the second set (is a superset, but is not equal)." msgstr "" -#: ../../library/stdtypes.rst:4291 +#: ../../library/stdtypes.rst:4290 msgid "" "Instances of :class:`set` are compared to instances of :class:`frozenset` " "based on their members. For example, ``set('abc') == frozenset('abc')`` " "returns ``True`` and so does ``set('abc') in set([frozenset('abc')])``." msgstr "" -#: ../../library/stdtypes.rst:4295 +#: ../../library/stdtypes.rst:4294 msgid "" "The subset and equality comparisons do not generalize to a total ordering " "function. For example, any two nonempty disjoint sets are not equal and are " @@ -4513,71 +4513,71 @@ msgid "" "``ab``." msgstr "" -#: ../../library/stdtypes.rst:4300 +#: ../../library/stdtypes.rst:4299 msgid "" "Since sets only define partial ordering (subset relationships), the output " "of the :meth:`list.sort` method is undefined for lists of sets." msgstr "" -#: ../../library/stdtypes.rst:4303 +#: ../../library/stdtypes.rst:4302 msgid "Set elements, like dictionary keys, must be :term:`hashable`." msgstr "" -#: ../../library/stdtypes.rst:4305 +#: ../../library/stdtypes.rst:4304 msgid "" "Binary operations that mix :class:`set` instances with :class:`frozenset` " "return the type of the first operand. For example: ``frozenset('ab') | " "set('bc')`` returns an instance of :class:`frozenset`." msgstr "" -#: ../../library/stdtypes.rst:4309 +#: ../../library/stdtypes.rst:4308 msgid "" "The following table lists operations available for :class:`set` that do not " "apply to immutable instances of :class:`frozenset`:" msgstr "" -#: ../../library/stdtypes.rst:4315 +#: ../../library/stdtypes.rst:4314 msgid "Update the set, adding elements from all others." msgstr "" -#: ../../library/stdtypes.rst:4320 +#: ../../library/stdtypes.rst:4319 msgid "Update the set, keeping only elements found in it and all others." msgstr "" -#: ../../library/stdtypes.rst:4325 +#: ../../library/stdtypes.rst:4324 msgid "Update the set, removing elements found in others." msgstr "" -#: ../../library/stdtypes.rst:4330 +#: ../../library/stdtypes.rst:4329 msgid "" "Update the set, keeping only elements found in either set, but not in both." msgstr "" -#: ../../library/stdtypes.rst:4334 +#: ../../library/stdtypes.rst:4333 msgid "Add element *elem* to the set." msgstr "" -#: ../../library/stdtypes.rst:4338 +#: ../../library/stdtypes.rst:4337 msgid "" "Remove element *elem* from the set. Raises :exc:`KeyError` if *elem* is not " "contained in the set." msgstr "" -#: ../../library/stdtypes.rst:4343 +#: ../../library/stdtypes.rst:4342 msgid "Remove element *elem* from the set if it is present." msgstr "" -#: ../../library/stdtypes.rst:4347 +#: ../../library/stdtypes.rst:4346 msgid "" "Remove and return an arbitrary element from the set. Raises :exc:`KeyError` " "if the set is empty." msgstr "" -#: ../../library/stdtypes.rst:4352 +#: ../../library/stdtypes.rst:4351 msgid "Remove all elements from the set." msgstr "" -#: ../../library/stdtypes.rst:4355 +#: ../../library/stdtypes.rst:4354 msgid "" "Note, the non-operator versions of the :meth:`update`, :meth:" "`intersection_update`, :meth:`difference_update`, and :meth:" @@ -4585,18 +4585,18 @@ msgid "" "argument." msgstr "" -#: ../../library/stdtypes.rst:4360 +#: ../../library/stdtypes.rst:4359 msgid "" "Note, the *elem* argument to the :meth:`__contains__`, :meth:`remove`, and :" "meth:`discard` methods may be a set. To support searching for an equivalent " "frozenset, a temporary one is created from *elem*." msgstr "" -#: ../../library/stdtypes.rst:4368 +#: ../../library/stdtypes.rst:4367 msgid "Mapping Types --- :class:`dict`" msgstr "" -#: ../../library/stdtypes.rst:4378 +#: ../../library/stdtypes.rst:4377 msgid "" "A :term:`mapping` object maps :term:`hashable` values to arbitrary objects. " "Mappings are mutable objects. There is currently only one standard mapping " @@ -4605,7 +4605,7 @@ msgid "" "module.)" msgstr "" -#: ../../library/stdtypes.rst:4384 +#: ../../library/stdtypes.rst:4383 msgid "" "A dictionary's keys are *almost* arbitrary values. Values that are not :" "term:`hashable`, that is, values containing lists, dictionaries or other " @@ -4614,33 +4614,33 @@ msgid "" "and ``True``) can be used interchangeably to index the same dictionary entry." msgstr "" -#: ../../library/stdtypes.rst:4395 +#: ../../library/stdtypes.rst:4394 msgid "" "Return a new dictionary initialized from an optional positional argument and " "a possibly empty set of keyword arguments." msgstr "" -#: ../../library/stdtypes.rst:4398 +#: ../../library/stdtypes.rst:4397 msgid "Dictionaries can be created by several means:" msgstr "" -#: ../../library/stdtypes.rst:4400 +#: ../../library/stdtypes.rst:4399 msgid "" "Use a comma-separated list of ``key: value`` pairs within braces: ``{'jack': " "4098, 'sjoerd': 4127}`` or ``{4098: 'jack', 4127: 'sjoerd'}``" msgstr "" -#: ../../library/stdtypes.rst:4402 +#: ../../library/stdtypes.rst:4401 msgid "Use a dict comprehension: ``{}``, ``{x: x ** 2 for x in range(10)}``" msgstr "" -#: ../../library/stdtypes.rst:4403 +#: ../../library/stdtypes.rst:4402 msgid "" "Use the type constructor: ``dict()``, ``dict([('foo', 100), ('bar', " "200)])``, ``dict(foo=100, bar=200)``" msgstr "" -#: ../../library/stdtypes.rst:4406 +#: ../../library/stdtypes.rst:4405 msgid "" "If no positional argument is given, an empty dictionary is created. If a " "positional argument is given and it is a mapping object, a dictionary is " @@ -4652,7 +4652,7 @@ msgid "" "value for that key becomes the corresponding value in the new dictionary." msgstr "" -#: ../../library/stdtypes.rst:4416 +#: ../../library/stdtypes.rst:4415 msgid "" "If keyword arguments are given, the keyword arguments and their values are " "added to the dictionary created from the positional argument. If a key " @@ -4660,39 +4660,39 @@ msgid "" "the value from the positional argument." msgstr "" -#: ../../library/stdtypes.rst:4421 +#: ../../library/stdtypes.rst:4420 msgid "" "To illustrate, the following examples all return a dictionary equal to " "``{\"one\": 1, \"two\": 2, \"three\": 3}``::" msgstr "" -#: ../../library/stdtypes.rst:4433 +#: ../../library/stdtypes.rst:4432 msgid "" "Providing keyword arguments as in the first example only works for keys that " "are valid Python identifiers. Otherwise, any valid keys can be used." msgstr "" -#: ../../library/stdtypes.rst:4437 +#: ../../library/stdtypes.rst:4436 msgid "" "These are the operations that dictionaries support (and therefore, custom " "mapping types should support too):" msgstr "" -#: ../../library/stdtypes.rst:4442 +#: ../../library/stdtypes.rst:4441 msgid "Return a list of all the keys used in the dictionary *d*." msgstr "" -#: ../../library/stdtypes.rst:4446 +#: ../../library/stdtypes.rst:4445 msgid "Return the number of items in the dictionary *d*." msgstr "" -#: ../../library/stdtypes.rst:4450 +#: ../../library/stdtypes.rst:4449 msgid "" "Return the item of *d* with key *key*. Raises a :exc:`KeyError` if *key* is " "not in the map." msgstr "" -#: ../../library/stdtypes.rst:4455 +#: ../../library/stdtypes.rst:4454 msgid "" "If a subclass of dict defines a method :meth:`__missing__` and *key* is not " "present, the ``d[key]`` operation calls that method with the key *key* as " @@ -4703,51 +4703,51 @@ msgid "" "an instance variable::" msgstr "" -#: ../../library/stdtypes.rst:4473 +#: ../../library/stdtypes.rst:4472 msgid "" "The example above shows part of the implementation of :class:`collections." "Counter`. A different ``__missing__`` method is used by :class:`collections." "defaultdict`." msgstr "" -#: ../../library/stdtypes.rst:4479 +#: ../../library/stdtypes.rst:4478 msgid "Set ``d[key]`` to *value*." msgstr "" -#: ../../library/stdtypes.rst:4483 +#: ../../library/stdtypes.rst:4482 msgid "" "Remove ``d[key]`` from *d*. Raises a :exc:`KeyError` if *key* is not in the " "map." msgstr "" -#: ../../library/stdtypes.rst:4488 +#: ../../library/stdtypes.rst:4487 msgid "Return ``True`` if *d* has a key *key*, else ``False``." msgstr "" -#: ../../library/stdtypes.rst:4492 +#: ../../library/stdtypes.rst:4491 msgid "Equivalent to ``not key in d``." msgstr "" -#: ../../library/stdtypes.rst:4496 +#: ../../library/stdtypes.rst:4495 msgid "" "Return an iterator over the keys of the dictionary. This is a shortcut for " "``iter(d.keys())``." msgstr "" -#: ../../library/stdtypes.rst:4501 +#: ../../library/stdtypes.rst:4500 msgid "Remove all items from the dictionary." msgstr "" -#: ../../library/stdtypes.rst:4505 +#: ../../library/stdtypes.rst:4504 msgid "Return a shallow copy of the dictionary." msgstr "" -#: ../../library/stdtypes.rst:4509 +#: ../../library/stdtypes.rst:4508 msgid "" "Create a new dictionary with keys from *iterable* and values set to *value*." msgstr "" -#: ../../library/stdtypes.rst:4511 +#: ../../library/stdtypes.rst:4510 msgid "" ":meth:`fromkeys` is a class method that returns a new dictionary. *value* " "defaults to ``None``. All of the values refer to just a single instance, so " @@ -4756,70 +4756,70 @@ msgid "" "` instead." msgstr "" -#: ../../library/stdtypes.rst:4519 +#: ../../library/stdtypes.rst:4518 msgid "" "Return the value for *key* if *key* is in the dictionary, else *default*. If " "*default* is not given, it defaults to ``None``, so that this method never " "raises a :exc:`KeyError`." msgstr "" -#: ../../library/stdtypes.rst:4525 +#: ../../library/stdtypes.rst:4524 msgid "" "Return a new view of the dictionary's items (``(key, value)`` pairs). See " "the :ref:`documentation of view objects `." msgstr "" -#: ../../library/stdtypes.rst:4530 +#: ../../library/stdtypes.rst:4529 msgid "" "Return a new view of the dictionary's keys. See the :ref:`documentation of " "view objects `." msgstr "" -#: ../../library/stdtypes.rst:4535 +#: ../../library/stdtypes.rst:4534 msgid "" "If *key* is in the dictionary, remove it and return its value, else return " "*default*. If *default* is not given and *key* is not in the dictionary, a :" "exc:`KeyError` is raised." msgstr "" -#: ../../library/stdtypes.rst:4541 +#: ../../library/stdtypes.rst:4540 msgid "" "Remove and return a ``(key, value)`` pair from the dictionary. Pairs are " "returned in :abbr:`LIFO (last-in, first-out)` order." msgstr "" -#: ../../library/stdtypes.rst:4544 +#: ../../library/stdtypes.rst:4543 msgid "" ":meth:`popitem` is useful to destructively iterate over a dictionary, as " "often used in set algorithms. If the dictionary is empty, calling :meth:" "`popitem` raises a :exc:`KeyError`." msgstr "" -#: ../../library/stdtypes.rst:4548 +#: ../../library/stdtypes.rst:4547 msgid "" "LIFO order is now guaranteed. In prior versions, :meth:`popitem` would " "return an arbitrary key/value pair." msgstr "" -#: ../../library/stdtypes.rst:4554 +#: ../../library/stdtypes.rst:4553 msgid "" "Return a reverse iterator over the keys of the dictionary. This is a " "shortcut for ``reversed(d.keys())``." msgstr "" -#: ../../library/stdtypes.rst:4561 +#: ../../library/stdtypes.rst:4560 msgid "" "If *key* is in the dictionary, return its value. If not, insert *key* with " "a value of *default* and return *default*. *default* defaults to ``None``." msgstr "" -#: ../../library/stdtypes.rst:4567 +#: ../../library/stdtypes.rst:4566 msgid "" "Update the dictionary with the key/value pairs from *other*, overwriting " "existing keys. Return ``None``." msgstr "" -#: ../../library/stdtypes.rst:4570 +#: ../../library/stdtypes.rst:4569 msgid "" ":meth:`update` accepts either another dictionary object or an iterable of " "key/value pairs (as tuples or other iterables of length two). If keyword " @@ -4827,71 +4827,71 @@ msgid "" "pairs: ``d.update(red=1, blue=2)``." msgstr "" -#: ../../library/stdtypes.rst:4577 +#: ../../library/stdtypes.rst:4576 msgid "" "Return a new view of the dictionary's values. See the :ref:`documentation " "of view objects `." msgstr "" -#: ../../library/stdtypes.rst:4580 +#: ../../library/stdtypes.rst:4579 msgid "" "An equality comparison between one ``dict.values()`` view and another will " "always return ``False``. This also applies when comparing ``dict.values()`` " "to itself::" msgstr "" -#: ../../library/stdtypes.rst:4590 +#: ../../library/stdtypes.rst:4589 msgid "" "Create a new dictionary with the merged keys and values of *d* and *other*, " "which must both be dictionaries. The values of *other* take priority when " "*d* and *other* share keys." msgstr "" -#: ../../library/stdtypes.rst:4598 +#: ../../library/stdtypes.rst:4597 msgid "" "Update the dictionary *d* with keys and values from *other*, which may be " "either a :term:`mapping` or an :term:`iterable` of key/value pairs. The " "values of *other* take priority when *d* and *other* share keys." msgstr "" -#: ../../library/stdtypes.rst:4604 +#: ../../library/stdtypes.rst:4603 msgid "" "Dictionaries compare equal if and only if they have the same ``(key, " "value)`` pairs (regardless of ordering). Order comparisons ('<', '<=', '>=', " "'>') raise :exc:`TypeError`." msgstr "" -#: ../../library/stdtypes.rst:4608 +#: ../../library/stdtypes.rst:4607 msgid "" "Dictionaries preserve insertion order. Note that updating a key does not " "affect the order. Keys added after deletion are inserted at the end. ::" msgstr "" -#: ../../library/stdtypes.rst:4626 +#: ../../library/stdtypes.rst:4625 msgid "" "Dictionary order is guaranteed to be insertion order. This behavior was an " "implementation detail of CPython from 3.6." msgstr "" -#: ../../library/stdtypes.rst:4630 +#: ../../library/stdtypes.rst:4629 msgid "Dictionaries and dictionary views are reversible. ::" msgstr "" -#: ../../library/stdtypes.rst:4642 +#: ../../library/stdtypes.rst:4641 msgid "Dictionaries are now reversible." msgstr "" -#: ../../library/stdtypes.rst:4647 +#: ../../library/stdtypes.rst:4646 msgid "" ":class:`types.MappingProxyType` can be used to create a read-only view of a :" "class:`dict`." msgstr "" -#: ../../library/stdtypes.rst:4654 +#: ../../library/stdtypes.rst:4653 msgid "Dictionary view objects" msgstr "字典視圖物件" -#: ../../library/stdtypes.rst:4656 +#: ../../library/stdtypes.rst:4655 msgid "" "The objects returned by :meth:`dict.keys`, :meth:`dict.values` and :meth:" "`dict.items` are *view objects*. They provide a dynamic view on the " @@ -4899,23 +4899,23 @@ msgid "" "reflects these changes." msgstr "" -#: ../../library/stdtypes.rst:4661 +#: ../../library/stdtypes.rst:4660 msgid "" "Dictionary views can be iterated over to yield their respective data, and " "support membership tests:" msgstr "" -#: ../../library/stdtypes.rst:4666 +#: ../../library/stdtypes.rst:4665 msgid "Return the number of entries in the dictionary." msgstr "" -#: ../../library/stdtypes.rst:4670 +#: ../../library/stdtypes.rst:4669 msgid "" "Return an iterator over the keys, values or items (represented as tuples of " "``(key, value)``) in the dictionary." msgstr "" -#: ../../library/stdtypes.rst:4673 +#: ../../library/stdtypes.rst:4672 msgid "" "Keys and values are iterated over in insertion order. This allows the " "creation of ``(value, key)`` pairs using :func:`zip`: ``pairs = zip(d." @@ -4923,39 +4923,39 @@ msgid "" "[(v, k) for (k, v) in d.items()]``." msgstr "" -#: ../../library/stdtypes.rst:4678 +#: ../../library/stdtypes.rst:4677 msgid "" "Iterating views while adding or deleting entries in the dictionary may raise " "a :exc:`RuntimeError` or fail to iterate over all entries." msgstr "" -#: ../../library/stdtypes.rst:4681 +#: ../../library/stdtypes.rst:4680 msgid "Dictionary order is guaranteed to be insertion order." msgstr "" -#: ../../library/stdtypes.rst:4686 +#: ../../library/stdtypes.rst:4685 msgid "" "Return ``True`` if *x* is in the underlying dictionary's keys, values or " "items (in the latter case, *x* should be a ``(key, value)`` tuple)." msgstr "" -#: ../../library/stdtypes.rst:4691 +#: ../../library/stdtypes.rst:4690 msgid "" "Return a reverse iterator over the keys, values or items of the dictionary. " "The view will be iterated in reverse order of the insertion." msgstr "" -#: ../../library/stdtypes.rst:4694 +#: ../../library/stdtypes.rst:4693 msgid "Dictionary views are now reversible." msgstr "" -#: ../../library/stdtypes.rst:4699 +#: ../../library/stdtypes.rst:4698 msgid "" "Return a :class:`types.MappingProxyType` that wraps the original dictionary " "to which the view refers." msgstr "" -#: ../../library/stdtypes.rst:4704 +#: ../../library/stdtypes.rst:4703 msgid "" "Keys views are set-like since their entries are unique and :term:" "`hashable`. If all values are hashable, so that ``(key, value)`` pairs are " @@ -4966,15 +4966,15 @@ msgid "" "``<``, or ``^``)." msgstr "" -#: ../../library/stdtypes.rst:4711 +#: ../../library/stdtypes.rst:4710 msgid "An example of dictionary view usage::" msgstr "" -#: ../../library/stdtypes.rst:4752 +#: ../../library/stdtypes.rst:4751 msgid "Context Manager Types" msgstr "" -#: ../../library/stdtypes.rst:4759 +#: ../../library/stdtypes.rst:4758 msgid "" "Python's :keyword:`with` statement supports the concept of a runtime context " "defined by a context manager. This is implemented using a pair of methods " @@ -4982,7 +4982,7 @@ msgid "" "before the statement body is executed and exited when the statement ends:" msgstr "" -#: ../../library/stdtypes.rst:4767 +#: ../../library/stdtypes.rst:4766 msgid "" "Enter the runtime context and return either this object or another object " "related to the runtime context. The value returned by this method is bound " @@ -4990,14 +4990,14 @@ msgid "" "using this context manager." msgstr "" -#: ../../library/stdtypes.rst:4772 +#: ../../library/stdtypes.rst:4771 msgid "" "An example of a context manager that returns itself is a :term:`file " "object`. File objects return themselves from __enter__() to allow :func:" "`open` to be used as the context expression in a :keyword:`with` statement." msgstr "" -#: ../../library/stdtypes.rst:4776 +#: ../../library/stdtypes.rst:4775 msgid "" "An example of a context manager that returns a related object is the one " "returned by :func:`decimal.localcontext`. These managers set the active " @@ -5007,7 +5007,7 @@ msgid "" "the :keyword:`!with` statement." msgstr "" -#: ../../library/stdtypes.rst:4786 +#: ../../library/stdtypes.rst:4785 msgid "" "Exit the runtime context and return a Boolean flag indicating if any " "exception that occurred should be suppressed. If an exception occurred while " @@ -5016,7 +5016,7 @@ msgid "" "arguments are ``None``." msgstr "" -#: ../../library/stdtypes.rst:4791 +#: ../../library/stdtypes.rst:4790 msgid "" "Returning a true value from this method will cause the :keyword:`with` " "statement to suppress the exception and continue execution with the " @@ -5027,7 +5027,7 @@ msgid "" "statement." msgstr "" -#: ../../library/stdtypes.rst:4798 +#: ../../library/stdtypes.rst:4797 msgid "" "The exception passed in should never be reraised explicitly - instead, this " "method should return a false value to indicate that the method completed " @@ -5036,7 +5036,7 @@ msgid "" "method has actually failed." msgstr "" -#: ../../library/stdtypes.rst:4804 +#: ../../library/stdtypes.rst:4803 msgid "" "Python defines several context managers to support easy thread " "synchronisation, prompt closure of files or other objects, and simpler " @@ -5045,7 +5045,7 @@ msgid "" "management protocol. See the :mod:`contextlib` module for some examples." msgstr "" -#: ../../library/stdtypes.rst:4810 +#: ../../library/stdtypes.rst:4809 msgid "" "Python's :term:`generator`\\s and the :class:`contextlib.contextmanager` " "decorator provide a convenient way to implement these protocols. If a " @@ -5055,7 +5055,7 @@ msgid "" "rather than the iterator produced by an undecorated generator function." msgstr "" -#: ../../library/stdtypes.rst:4817 +#: ../../library/stdtypes.rst:4816 msgid "" "Note that there is no specific slot for any of these methods in the type " "structure for Python objects in the Python/C API. Extension types wanting to " @@ -5064,23 +5064,23 @@ msgid "" "a single class dictionary lookup is negligible." msgstr "" -#: ../../library/stdtypes.rst:4825 +#: ../../library/stdtypes.rst:4824 msgid "" "Type Annotation Types --- :ref:`Generic Alias `, :ref:" "`Union `" msgstr "" -#: ../../library/stdtypes.rst:4830 +#: ../../library/stdtypes.rst:4829 msgid "" "The core built-in types for :term:`type annotations ` are :ref:" "`Generic Alias ` and :ref:`Union `." msgstr "" -#: ../../library/stdtypes.rst:4837 +#: ../../library/stdtypes.rst:4836 msgid "Generic Alias Type" msgstr "" -#: ../../library/stdtypes.rst:4843 +#: ../../library/stdtypes.rst:4842 msgid "" "``GenericAlias`` objects are generally created by :ref:`subscripting " "` a class. They are most often used with :ref:`container " @@ -5090,19 +5090,19 @@ msgid "" "are intended primarily for use with :term:`type annotations `." msgstr "" -#: ../../library/stdtypes.rst:4853 +#: ../../library/stdtypes.rst:4852 msgid "" "It is generally only possible to subscript a class if the class implements " "the special method :meth:`~object.__class_getitem__`." msgstr "" -#: ../../library/stdtypes.rst:4856 +#: ../../library/stdtypes.rst:4855 msgid "" "A ``GenericAlias`` object acts as a proxy for a :term:`generic type`, " "implementing *parameterized generics*." msgstr "" -#: ../../library/stdtypes.rst:4859 +#: ../../library/stdtypes.rst:4858 msgid "" "For a container class, the argument(s) supplied to a :ref:`subscription " "` of the class may indicate the type(s) of the elements an " @@ -5111,7 +5111,7 @@ msgid "" "`bytes`." msgstr "" -#: ../../library/stdtypes.rst:4865 +#: ../../library/stdtypes.rst:4864 msgid "" "For a class which defines :meth:`~object.__class_getitem__` but is not a " "container, the argument(s) supplied to a subscription of the class will " @@ -5120,7 +5120,7 @@ msgid "" "the :class:`str` data type and the :class:`bytes` data type:" msgstr "" -#: ../../library/stdtypes.rst:4871 +#: ../../library/stdtypes.rst:4870 msgid "" "If ``x = re.search('foo', 'foo')``, ``x`` will be a :ref:`re.Match ` object where the return values of ``x.group(0)`` and ``x[0]`` will " @@ -5128,7 +5128,7 @@ msgid "" "annotations with the ``GenericAlias`` ``re.Match[str]``." msgstr "" -#: ../../library/stdtypes.rst:4877 +#: ../../library/stdtypes.rst:4876 msgid "" "If ``y = re.search(b'bar', b'bar')``, (note the ``b`` for :class:`bytes`), " "``y`` will also be an instance of ``re.Match``, but the return values of ``y." @@ -5137,21 +5137,21 @@ msgid "" "objects>` objects with ``re.Match[bytes]``." msgstr "" -#: ../../library/stdtypes.rst:4883 +#: ../../library/stdtypes.rst:4882 msgid "" "``GenericAlias`` objects are instances of the class :class:`types." "GenericAlias`, which can also be used to create ``GenericAlias`` objects " "directly." msgstr "" -#: ../../library/stdtypes.rst:4889 +#: ../../library/stdtypes.rst:4888 msgid "" "Creates a ``GenericAlias`` representing a type ``T`` parameterized by types " "*X*, *Y*, and more depending on the ``T`` used. For example, a function " "expecting a :class:`list` containing :class:`float` elements::" msgstr "" -#: ../../library/stdtypes.rst:4897 +#: ../../library/stdtypes.rst:4896 msgid "" "Another example for :term:`mapping` objects, using a :class:`dict`, which is " "a generic type expecting two type parameters representing the key type and " @@ -5159,13 +5159,13 @@ msgid "" "of type :class:`str` and values of type :class:`int`::" msgstr "" -#: ../../library/stdtypes.rst:4905 +#: ../../library/stdtypes.rst:4904 msgid "" "The builtin functions :func:`isinstance` and :func:`issubclass` do not " "accept ``GenericAlias`` types for their second argument::" msgstr "" -#: ../../library/stdtypes.rst:4913 +#: ../../library/stdtypes.rst:4912 msgid "" "The Python runtime does not enforce :term:`type annotations `. " "This extends to generic types and their type parameters. When creating a " @@ -5174,331 +5174,331 @@ msgid "" "discouraged, but will run without errors::" msgstr "" -#: ../../library/stdtypes.rst:4923 +#: ../../library/stdtypes.rst:4922 msgid "" "Furthermore, parameterized generics erase type parameters during object " "creation::" msgstr "" -#: ../../library/stdtypes.rst:4934 +#: ../../library/stdtypes.rst:4933 msgid "" "Calling :func:`repr` or :func:`str` on a generic shows the parameterized " "type::" msgstr "" -#: ../../library/stdtypes.rst:4942 +#: ../../library/stdtypes.rst:4941 msgid "" "The :meth:`~object.__getitem__` method of generic containers will raise an " "exception to disallow mistakes like ``dict[str][str]``::" msgstr "" -#: ../../library/stdtypes.rst:4950 +#: ../../library/stdtypes.rst:4949 msgid "" "However, such expressions are valid when :ref:`type variables ` " "are used. The index must have as many elements as there are type variable " "items in the ``GenericAlias`` object's :attr:`~genericalias.__args__`. ::" msgstr "" -#: ../../library/stdtypes.rst:4961 +#: ../../library/stdtypes.rst:4960 msgid "Standard Generic Classes" msgstr "" -#: ../../library/stdtypes.rst:4963 +#: ../../library/stdtypes.rst:4962 msgid "" "The following standard library classes support parameterized generics. This " "list is non-exhaustive." msgstr "" -#: ../../library/stdtypes.rst:4966 +#: ../../library/stdtypes.rst:4965 msgid ":class:`tuple`" msgstr ":class:`tuple`" -#: ../../library/stdtypes.rst:4967 +#: ../../library/stdtypes.rst:4966 msgid ":class:`list`" msgstr ":class:`list`" -#: ../../library/stdtypes.rst:4968 +#: ../../library/stdtypes.rst:4967 msgid ":class:`dict`" msgstr ":class:`dict`" -#: ../../library/stdtypes.rst:4969 +#: ../../library/stdtypes.rst:4968 msgid ":class:`set`" msgstr ":class:`set`" -#: ../../library/stdtypes.rst:4970 +#: ../../library/stdtypes.rst:4969 msgid ":class:`frozenset`" msgstr ":class:`frozenset`" -#: ../../library/stdtypes.rst:4971 +#: ../../library/stdtypes.rst:4970 msgid ":class:`type`" msgstr ":class:`type`" -#: ../../library/stdtypes.rst:4972 +#: ../../library/stdtypes.rst:4971 msgid ":class:`collections.deque`" msgstr ":class:`collections.deque`" -#: ../../library/stdtypes.rst:4973 +#: ../../library/stdtypes.rst:4972 msgid ":class:`collections.defaultdict`" msgstr ":class:`collections.defaultdict`" -#: ../../library/stdtypes.rst:4974 +#: ../../library/stdtypes.rst:4973 msgid ":class:`collections.OrderedDict`" msgstr ":class:`collections.OrderedDict`" -#: ../../library/stdtypes.rst:4975 +#: ../../library/stdtypes.rst:4974 msgid ":class:`collections.Counter`" msgstr ":class:`collections.Counter`" -#: ../../library/stdtypes.rst:4976 +#: ../../library/stdtypes.rst:4975 msgid ":class:`collections.ChainMap`" msgstr ":class:`collections.ChainMap`" -#: ../../library/stdtypes.rst:4977 +#: ../../library/stdtypes.rst:4976 msgid ":class:`collections.abc.Awaitable`" msgstr ":class:`collections.abc.Awaitable`" -#: ../../library/stdtypes.rst:4978 +#: ../../library/stdtypes.rst:4977 msgid ":class:`collections.abc.Coroutine`" msgstr ":class:`collections.abc.Coroutine`" -#: ../../library/stdtypes.rst:4979 +#: ../../library/stdtypes.rst:4978 msgid ":class:`collections.abc.AsyncIterable`" msgstr ":class:`collections.abc.AsyncIterable`" -#: ../../library/stdtypes.rst:4980 +#: ../../library/stdtypes.rst:4979 msgid ":class:`collections.abc.AsyncIterator`" msgstr ":class:`collections.abc.AsyncIterator`" -#: ../../library/stdtypes.rst:4981 +#: ../../library/stdtypes.rst:4980 msgid ":class:`collections.abc.AsyncGenerator`" msgstr ":class:`collections.abc.AsyncGenerator`" -#: ../../library/stdtypes.rst:4982 +#: ../../library/stdtypes.rst:4981 msgid ":class:`collections.abc.Iterable`" msgstr ":class:`collections.abc.Iterable`" -#: ../../library/stdtypes.rst:4983 +#: ../../library/stdtypes.rst:4982 msgid ":class:`collections.abc.Iterator`" msgstr ":class:`collections.abc.Iterator`" -#: ../../library/stdtypes.rst:4984 +#: ../../library/stdtypes.rst:4983 msgid ":class:`collections.abc.Generator`" msgstr ":class:`collections.abc.Generator`" -#: ../../library/stdtypes.rst:4985 +#: ../../library/stdtypes.rst:4984 msgid ":class:`collections.abc.Reversible`" msgstr ":class:`collections.abc.Reversible`" -#: ../../library/stdtypes.rst:4986 +#: ../../library/stdtypes.rst:4985 msgid ":class:`collections.abc.Container`" msgstr ":class:`collections.abc.Container`" -#: ../../library/stdtypes.rst:4987 +#: ../../library/stdtypes.rst:4986 msgid ":class:`collections.abc.Collection`" msgstr ":class:`collections.abc.Collection`" -#: ../../library/stdtypes.rst:4988 +#: ../../library/stdtypes.rst:4987 msgid ":class:`collections.abc.Callable`" msgstr ":class:`collections.abc.Callable`" -#: ../../library/stdtypes.rst:4989 +#: ../../library/stdtypes.rst:4988 msgid ":class:`collections.abc.Set`" msgstr ":class:`collections.abc.Set`" -#: ../../library/stdtypes.rst:4990 +#: ../../library/stdtypes.rst:4989 msgid ":class:`collections.abc.MutableSet`" msgstr ":class:`collections.abc.MutableSet`" -#: ../../library/stdtypes.rst:4991 +#: ../../library/stdtypes.rst:4990 msgid ":class:`collections.abc.Mapping`" msgstr ":class:`collections.abc.Mapping`" -#: ../../library/stdtypes.rst:4992 +#: ../../library/stdtypes.rst:4991 msgid ":class:`collections.abc.MutableMapping`" msgstr ":class:`collections.abc.MutableMapping`" -#: ../../library/stdtypes.rst:4993 +#: ../../library/stdtypes.rst:4992 msgid ":class:`collections.abc.Sequence`" msgstr ":class:`collections.abc.Sequence`" -#: ../../library/stdtypes.rst:4994 +#: ../../library/stdtypes.rst:4993 msgid ":class:`collections.abc.MutableSequence`" msgstr ":class:`collections.abc.MutableSequence`" -#: ../../library/stdtypes.rst:4995 +#: ../../library/stdtypes.rst:4994 msgid ":class:`collections.abc.ByteString`" msgstr ":class:`collections.abc.ByteString`" -#: ../../library/stdtypes.rst:4996 +#: ../../library/stdtypes.rst:4995 msgid ":class:`collections.abc.MappingView`" msgstr ":class:`collections.abc.MappingView`" -#: ../../library/stdtypes.rst:4997 +#: ../../library/stdtypes.rst:4996 msgid ":class:`collections.abc.KeysView`" msgstr ":class:`collections.abc.KeysView`" -#: ../../library/stdtypes.rst:4998 +#: ../../library/stdtypes.rst:4997 msgid ":class:`collections.abc.ItemsView`" msgstr ":class:`collections.abc.ItemsView`" -#: ../../library/stdtypes.rst:4999 +#: ../../library/stdtypes.rst:4998 msgid ":class:`collections.abc.ValuesView`" msgstr ":class:`collections.abc.ValuesView`" -#: ../../library/stdtypes.rst:5000 +#: ../../library/stdtypes.rst:4999 msgid ":class:`contextlib.AbstractContextManager`" msgstr ":class:`contextlib.AbstractContextManager`" -#: ../../library/stdtypes.rst:5001 +#: ../../library/stdtypes.rst:5000 msgid ":class:`contextlib.AbstractAsyncContextManager`" msgstr ":class:`contextlib.AbstractAsyncContextManager`" -#: ../../library/stdtypes.rst:5002 +#: ../../library/stdtypes.rst:5001 msgid ":class:`dataclasses.Field`" msgstr ":class:`dataclasses.Field`" -#: ../../library/stdtypes.rst:5003 +#: ../../library/stdtypes.rst:5002 msgid ":class:`functools.cached_property`" msgstr ":class:`functools.cached_property`" -#: ../../library/stdtypes.rst:5004 +#: ../../library/stdtypes.rst:5003 msgid ":class:`functools.partialmethod`" msgstr ":class:`functools.partialmethod`" -#: ../../library/stdtypes.rst:5005 +#: ../../library/stdtypes.rst:5004 msgid ":class:`os.PathLike`" msgstr ":class:`os.PathLike`" -#: ../../library/stdtypes.rst:5006 +#: ../../library/stdtypes.rst:5005 msgid ":class:`queue.LifoQueue`" msgstr ":class:`queue.LifoQueue`" -#: ../../library/stdtypes.rst:5007 +#: ../../library/stdtypes.rst:5006 msgid ":class:`queue.Queue`" msgstr ":class:`queue.Queue`" -#: ../../library/stdtypes.rst:5008 +#: ../../library/stdtypes.rst:5007 msgid ":class:`queue.PriorityQueue`" msgstr ":class:`queue.PriorityQueue`" -#: ../../library/stdtypes.rst:5009 +#: ../../library/stdtypes.rst:5008 msgid ":class:`queue.SimpleQueue`" msgstr ":class:`queue.SimpleQueue`" -#: ../../library/stdtypes.rst:5010 +#: ../../library/stdtypes.rst:5009 msgid ":ref:`re.Pattern `" msgstr ":ref:`re.Pattern `" -#: ../../library/stdtypes.rst:5011 +#: ../../library/stdtypes.rst:5010 msgid ":ref:`re.Match `" msgstr ":ref:`re.Match `" -#: ../../library/stdtypes.rst:5012 +#: ../../library/stdtypes.rst:5011 msgid ":class:`shelve.BsdDbShelf`" msgstr ":class:`shelve.BsdDbShelf`" -#: ../../library/stdtypes.rst:5013 +#: ../../library/stdtypes.rst:5012 msgid ":class:`shelve.DbfilenameShelf`" msgstr ":class:`shelve.DbfilenameShelf`" -#: ../../library/stdtypes.rst:5014 +#: ../../library/stdtypes.rst:5013 msgid ":class:`shelve.Shelf`" msgstr ":class:`shelve.Shelf`" -#: ../../library/stdtypes.rst:5015 +#: ../../library/stdtypes.rst:5014 msgid ":class:`types.MappingProxyType`" msgstr ":class:`types.MappingProxyType`" -#: ../../library/stdtypes.rst:5016 +#: ../../library/stdtypes.rst:5015 msgid ":class:`weakref.WeakKeyDictionary`" msgstr ":class:`weakref.WeakKeyDictionary`" -#: ../../library/stdtypes.rst:5017 +#: ../../library/stdtypes.rst:5016 msgid ":class:`weakref.WeakMethod`" msgstr ":class:`weakref.WeakMethod`" -#: ../../library/stdtypes.rst:5018 +#: ../../library/stdtypes.rst:5017 msgid ":class:`weakref.WeakSet`" msgstr ":class:`weakref.WeakSet`" -#: ../../library/stdtypes.rst:5019 +#: ../../library/stdtypes.rst:5018 msgid ":class:`weakref.WeakValueDictionary`" msgstr ":class:`weakref.WeakValueDictionary`" -#: ../../library/stdtypes.rst:5024 +#: ../../library/stdtypes.rst:5023 msgid "Special Attributes of ``GenericAlias`` objects" msgstr "" -#: ../../library/stdtypes.rst:5026 +#: ../../library/stdtypes.rst:5025 msgid "All parameterized generics implement special read-only attributes." msgstr "" -#: ../../library/stdtypes.rst:5030 +#: ../../library/stdtypes.rst:5029 msgid "This attribute points at the non-parameterized generic class::" msgstr "" -#: ../../library/stdtypes.rst:5038 +#: ../../library/stdtypes.rst:5037 msgid "" "This attribute is a :class:`tuple` (possibly of length 1) of generic types " "passed to the original :meth:`~object.__class_getitem__` of the generic " "class::" msgstr "" -#: ../../library/stdtypes.rst:5048 +#: ../../library/stdtypes.rst:5047 msgid "" "This attribute is a lazily computed tuple (possibly empty) of unique type " "variables found in ``__args__``::" msgstr "" -#: ../../library/stdtypes.rst:5059 +#: ../../library/stdtypes.rst:5058 msgid "" "A ``GenericAlias`` object with :class:`typing.ParamSpec` parameters may not " "have correct ``__parameters__`` after substitution because :class:`typing." "ParamSpec` is intended primarily for static type checking." msgstr "" -#: ../../library/stdtypes.rst:5066 +#: ../../library/stdtypes.rst:5065 msgid "" "A boolean that is true if the alias has been unpacked using the ``*`` " "operator (see :data:`~typing.TypeVarTuple`)." msgstr "" -#: ../../library/stdtypes.rst:5075 +#: ../../library/stdtypes.rst:5074 msgid ":pep:`484` - Type Hints" msgstr "" -#: ../../library/stdtypes.rst:5075 +#: ../../library/stdtypes.rst:5074 msgid "Introducing Python's framework for type annotations." msgstr "" -#: ../../library/stdtypes.rst:5080 +#: ../../library/stdtypes.rst:5079 msgid ":pep:`585` - Type Hinting Generics In Standard Collections" msgstr "" -#: ../../library/stdtypes.rst:5078 +#: ../../library/stdtypes.rst:5077 msgid "" "Introducing the ability to natively parameterize standard-library classes, " "provided they implement the special class method :meth:`~object." "__class_getitem__`." msgstr "" -#: ../../library/stdtypes.rst:5083 +#: ../../library/stdtypes.rst:5082 msgid "" ":ref:`Generics`, :ref:`user-defined generics ` and :" "class:`typing.Generic`" msgstr "" -#: ../../library/stdtypes.rst:5083 +#: ../../library/stdtypes.rst:5082 msgid "" "Documentation on how to implement generic classes that can be parameterized " "at runtime and understood by static type-checkers." msgstr "" -#: ../../library/stdtypes.rst:5092 +#: ../../library/stdtypes.rst:5091 msgid "Union Type" msgstr "" -#: ../../library/stdtypes.rst:5098 +#: ../../library/stdtypes.rst:5097 msgid "" "A union object holds the value of the ``|`` (bitwise or) operation on " "multiple :ref:`type objects `. These types are intended " @@ -5507,7 +5507,7 @@ msgid "" "Union`." msgstr "" -#: ../../library/stdtypes.rst:5105 +#: ../../library/stdtypes.rst:5104 msgid "" "Defines a union object which holds types *X*, *Y*, and so forth. ``X | Y`` " "means either X or Y. It is equivalent to ``typing.Union[X, Y]``. For " @@ -5515,76 +5515,76 @@ msgid "" "class:`float`::" msgstr "" -#: ../../library/stdtypes.rst:5115 +#: ../../library/stdtypes.rst:5114 msgid "" "Union objects can be tested for equality with other union objects. Details:" msgstr "" -#: ../../library/stdtypes.rst:5117 +#: ../../library/stdtypes.rst:5116 msgid "Unions of unions are flattened::" msgstr "" -#: ../../library/stdtypes.rst:5121 +#: ../../library/stdtypes.rst:5120 msgid "Redundant types are removed::" msgstr "" -#: ../../library/stdtypes.rst:5125 +#: ../../library/stdtypes.rst:5124 msgid "When comparing unions, the order is ignored::" msgstr "" -#: ../../library/stdtypes.rst:5129 +#: ../../library/stdtypes.rst:5128 msgid "It is compatible with :data:`typing.Union`::" msgstr "" -#: ../../library/stdtypes.rst:5133 +#: ../../library/stdtypes.rst:5132 msgid "Optional types can be spelled as a union with ``None``::" msgstr "" -#: ../../library/stdtypes.rst:5140 +#: ../../library/stdtypes.rst:5139 msgid "" "Calls to :func:`isinstance` and :func:`issubclass` are also supported with a " "union object::" msgstr "" -#: ../../library/stdtypes.rst:5146 +#: ../../library/stdtypes.rst:5145 msgid "" "However, union objects containing :ref:`parameterized generics ` cannot be used::" msgstr "" -#: ../../library/stdtypes.rst:5154 +#: ../../library/stdtypes.rst:5153 msgid "" "The user-exposed type for the union object can be accessed from :data:`types." "UnionType` and used for :func:`isinstance` checks. An object cannot be " "instantiated from the type::" msgstr "" -#: ../../library/stdtypes.rst:5167 +#: ../../library/stdtypes.rst:5166 msgid "" "The :meth:`__or__` method for type objects was added to support the syntax " "``X | Y``. If a metaclass implements :meth:`__or__`, the Union may override " "it::" msgstr "" -#: ../../library/stdtypes.rst:5185 +#: ../../library/stdtypes.rst:5184 msgid ":pep:`604` -- PEP proposing the ``X | Y`` syntax and the Union type." msgstr "" -#: ../../library/stdtypes.rst:5193 +#: ../../library/stdtypes.rst:5192 msgid "Other Built-in Types" msgstr "" -#: ../../library/stdtypes.rst:5195 +#: ../../library/stdtypes.rst:5194 msgid "" "The interpreter supports several other kinds of objects. Most of these " "support only one or two operations." msgstr "" -#: ../../library/stdtypes.rst:5202 +#: ../../library/stdtypes.rst:5201 msgid "Modules" msgstr "模組" -#: ../../library/stdtypes.rst:5204 +#: ../../library/stdtypes.rst:5203 msgid "" "The only special operation on a module is attribute access: ``m.name``, " "where *m* is a module and *name* accesses a name defined in *m*'s symbol " @@ -5595,7 +5595,7 @@ msgid "" "*foo* somewhere.)" msgstr "" -#: ../../library/stdtypes.rst:5211 +#: ../../library/stdtypes.rst:5210 msgid "" "A special attribute of every module is :attr:`~object.__dict__`. This is the " "dictionary containing the module's symbol table. Modifying this dictionary " @@ -5606,32 +5606,32 @@ msgid "" "recommended." msgstr "" -#: ../../library/stdtypes.rst:5219 +#: ../../library/stdtypes.rst:5218 msgid "" "Modules built into the interpreter are written like this: ````. If loaded from a file, they are written as ````." msgstr "" -#: ../../library/stdtypes.rst:5227 +#: ../../library/stdtypes.rst:5226 msgid "Classes and Class Instances" msgstr "" -#: ../../library/stdtypes.rst:5229 +#: ../../library/stdtypes.rst:5228 msgid "See :ref:`objects` and :ref:`class` for these." msgstr "" -#: ../../library/stdtypes.rst:5235 +#: ../../library/stdtypes.rst:5234 msgid "Functions" msgstr "函式" -#: ../../library/stdtypes.rst:5237 +#: ../../library/stdtypes.rst:5236 msgid "" "Function objects are created by function definitions. The only operation on " "a function object is to call it: ``func(argument-list)``." msgstr "" -#: ../../library/stdtypes.rst:5240 +#: ../../library/stdtypes.rst:5239 msgid "" "There are really two flavors of function objects: built-in functions and " "user-defined functions. Both support the same operation (to call the " @@ -5639,15 +5639,15 @@ msgid "" "types." msgstr "" -#: ../../library/stdtypes.rst:5244 +#: ../../library/stdtypes.rst:5243 msgid "See :ref:`function` for more information." msgstr "更多資訊請見 :ref:`function`\\ 。" -#: ../../library/stdtypes.rst:5250 +#: ../../library/stdtypes.rst:5249 msgid "Methods" msgstr "" -#: ../../library/stdtypes.rst:5254 +#: ../../library/stdtypes.rst:5253 msgid "" "Methods are functions that are called using the attribute notation. There " "are two flavors: built-in methods (such as :meth:`append` on lists) and " @@ -5655,7 +5655,7 @@ msgid "" "support them." msgstr "" -#: ../../library/stdtypes.rst:5259 +#: ../../library/stdtypes.rst:5258 msgid "" "If you access a method (a function defined in a class namespace) through an " "instance, you get a special object: a :dfn:`bound method` (also called :dfn:" @@ -5667,7 +5667,7 @@ msgid "" "arg-2, ..., arg-n)``." msgstr "" -#: ../../library/stdtypes.rst:5268 +#: ../../library/stdtypes.rst:5267 msgid "" "Like function objects, bound method objects support getting arbitrary " "attributes. However, since method attributes are actually stored on the " @@ -5677,15 +5677,15 @@ msgid "" "attribute, you need to explicitly set it on the underlying function object::" msgstr "" -#: ../../library/stdtypes.rst:5288 ../../library/stdtypes.rst:5319 +#: ../../library/stdtypes.rst:5287 ../../library/stdtypes.rst:5318 msgid "See :ref:`types` for more information." msgstr "更多資訊請見 :ref:`types`\\ 。" -#: ../../library/stdtypes.rst:5296 +#: ../../library/stdtypes.rst:5295 msgid "Code Objects" msgstr "" -#: ../../library/stdtypes.rst:5302 +#: ../../library/stdtypes.rst:5301 msgid "" "Code objects are used by the implementation to represent \"pseudo-compiled\" " "executable Python code such as a function body. They differ from function " @@ -5695,23 +5695,23 @@ msgid "" "`__code__` attribute. See also the :mod:`code` module." msgstr "" -#: ../../library/stdtypes.rst:5309 +#: ../../library/stdtypes.rst:5308 msgid "" "Accessing ``__code__`` raises an :ref:`auditing event ` ``object." "__getattr__`` with arguments ``obj`` and ``\"__code__\"``." msgstr "" -#: ../../library/stdtypes.rst:5316 +#: ../../library/stdtypes.rst:5315 msgid "" "A code object can be executed or evaluated by passing it (instead of a " "source string) to the :func:`exec` or :func:`eval` built-in functions." msgstr "" -#: ../../library/stdtypes.rst:5325 +#: ../../library/stdtypes.rst:5324 msgid "Type Objects" msgstr "" -#: ../../library/stdtypes.rst:5331 +#: ../../library/stdtypes.rst:5330 msgid "" "Type objects represent the various object types. An object's type is " "accessed by the built-in function :func:`type`. There are no special " @@ -5719,30 +5719,30 @@ msgid "" "standard built-in types." msgstr "" -#: ../../library/stdtypes.rst:5336 +#: ../../library/stdtypes.rst:5335 msgid "Types are written like this: ````." msgstr "" -#: ../../library/stdtypes.rst:5342 +#: ../../library/stdtypes.rst:5341 msgid "The Null Object" msgstr "" -#: ../../library/stdtypes.rst:5344 +#: ../../library/stdtypes.rst:5343 msgid "" "This object is returned by functions that don't explicitly return a value. " "It supports no special operations. There is exactly one null object, named " "``None`` (a built-in name). ``type(None)()`` produces the same singleton." msgstr "" -#: ../../library/stdtypes.rst:5348 +#: ../../library/stdtypes.rst:5347 msgid "It is written as ``None``." msgstr "" -#: ../../library/stdtypes.rst:5355 +#: ../../library/stdtypes.rst:5354 msgid "The Ellipsis Object" msgstr "" -#: ../../library/stdtypes.rst:5357 +#: ../../library/stdtypes.rst:5356 msgid "" "This object is commonly used by slicing (see :ref:`slicings`). It supports " "no special operations. There is exactly one ellipsis object, named :const:" @@ -5750,15 +5750,15 @@ msgid "" "`Ellipsis` singleton." msgstr "" -#: ../../library/stdtypes.rst:5362 +#: ../../library/stdtypes.rst:5361 msgid "It is written as ``Ellipsis`` or ``...``." msgstr "" -#: ../../library/stdtypes.rst:5368 +#: ../../library/stdtypes.rst:5367 msgid "The NotImplemented Object" msgstr "" -#: ../../library/stdtypes.rst:5370 +#: ../../library/stdtypes.rst:5369 msgid "" "This object is returned from comparisons and binary operations when they are " "asked to operate on types they don't support. See :ref:`comparisons` for " @@ -5766,15 +5766,15 @@ msgid "" "``type(NotImplemented)()`` produces the singleton instance." msgstr "" -#: ../../library/stdtypes.rst:5375 +#: ../../library/stdtypes.rst:5374 msgid "It is written as ``NotImplemented``." msgstr "" -#: ../../library/stdtypes.rst:5381 +#: ../../library/stdtypes.rst:5380 msgid "Boolean Values" msgstr "" -#: ../../library/stdtypes.rst:5383 +#: ../../library/stdtypes.rst:5382 msgid "" "Boolean values are the two constant objects ``False`` and ``True``. They " "are used to represent truth values (although other values can also be " @@ -5785,81 +5785,81 @@ msgid "" "(see section :ref:`truth` above)." msgstr "" -#: ../../library/stdtypes.rst:5396 +#: ../../library/stdtypes.rst:5395 msgid "They are written as ``False`` and ``True``, respectively." msgstr "" -#: ../../library/stdtypes.rst:5402 +#: ../../library/stdtypes.rst:5401 msgid "Internal Objects" msgstr "" -#: ../../library/stdtypes.rst:5404 +#: ../../library/stdtypes.rst:5403 msgid "" "See :ref:`types` for this information. It describes stack frame objects, " "traceback objects, and slice objects." msgstr "" -#: ../../library/stdtypes.rst:5411 +#: ../../library/stdtypes.rst:5410 msgid "Special Attributes" msgstr "" -#: ../../library/stdtypes.rst:5413 +#: ../../library/stdtypes.rst:5412 msgid "" "The implementation adds a few special read-only attributes to several object " "types, where they are relevant. Some of these are not reported by the :func:" "`dir` built-in function." msgstr "" -#: ../../library/stdtypes.rst:5420 +#: ../../library/stdtypes.rst:5419 msgid "" "A dictionary or other mapping object used to store an object's (writable) " "attributes." msgstr "" -#: ../../library/stdtypes.rst:5426 +#: ../../library/stdtypes.rst:5425 msgid "The class to which a class instance belongs." msgstr "" -#: ../../library/stdtypes.rst:5431 +#: ../../library/stdtypes.rst:5430 msgid "The tuple of base classes of a class object." msgstr "" -#: ../../library/stdtypes.rst:5436 +#: ../../library/stdtypes.rst:5435 msgid "" "The name of the class, function, method, descriptor, or generator instance." msgstr "" -#: ../../library/stdtypes.rst:5442 +#: ../../library/stdtypes.rst:5441 msgid "" "The :term:`qualified name` of the class, function, method, descriptor, or " "generator instance." msgstr "" -#: ../../library/stdtypes.rst:5450 +#: ../../library/stdtypes.rst:5449 msgid "" "This attribute is a tuple of classes that are considered when looking for " "base classes during method resolution." msgstr "" -#: ../../library/stdtypes.rst:5456 +#: ../../library/stdtypes.rst:5455 msgid "" "This method can be overridden by a metaclass to customize the method " "resolution order for its instances. It is called at class instantiation, " "and its result is stored in :attr:`~class.__mro__`." msgstr "" -#: ../../library/stdtypes.rst:5463 +#: ../../library/stdtypes.rst:5462 msgid "" "Each class keeps a list of weak references to its immediate subclasses. " "This method returns a list of all those references still alive. The list is " "in definition order. Example::" msgstr "" -#: ../../library/stdtypes.rst:5474 +#: ../../library/stdtypes.rst:5473 msgid "Integer string conversion length limitation" msgstr "" -#: ../../library/stdtypes.rst:5476 +#: ../../library/stdtypes.rst:5475 msgid "" "CPython has a global limit for converting between :class:`int` and :class:" "`str` to mitigate denial of service attacks. This limit *only* applies to " @@ -5867,7 +5867,7 @@ msgid "" "binary conversions are unlimited. The limit can be configured." msgstr "" -#: ../../library/stdtypes.rst:5481 +#: ../../library/stdtypes.rst:5480 msgid "" "The :class:`int` type in CPython is an arbitrary length number stored in " "binary form (commonly known as a \"bignum\"). There exists no algorithm that " @@ -5877,25 +5877,25 @@ msgid "" "value such as ``int('1' * 500_000)`` can take over a second on a fast CPU." msgstr "" -#: ../../library/stdtypes.rst:5488 +#: ../../library/stdtypes.rst:5487 msgid "" "Limiting conversion size offers a practical way to avoid `CVE-2020-10735 " "`_." msgstr "" -#: ../../library/stdtypes.rst:5491 +#: ../../library/stdtypes.rst:5490 msgid "" "The limit is applied to the number of digit characters in the input or " "output string when a non-linear conversion algorithm would be involved. " "Underscores and the sign are not counted towards the limit." msgstr "" -#: ../../library/stdtypes.rst:5495 +#: ../../library/stdtypes.rst:5494 msgid "" "When an operation would exceed the limit, a :exc:`ValueError` is raised:" msgstr "" -#: ../../library/stdtypes.rst:5517 +#: ../../library/stdtypes.rst:5516 msgid "" "The default limit is 4300 digits as provided in :data:`sys.int_info." "default_max_str_digits `. The lowest limit that can be " @@ -5903,94 +5903,94 @@ msgid "" "str_digits_check_threshold `." msgstr "" -#: ../../library/stdtypes.rst:5522 +#: ../../library/stdtypes.rst:5521 msgid "Verification:" msgstr "" -#: ../../library/stdtypes.rst:5537 +#: ../../library/stdtypes.rst:5536 msgid "Affected APIs" msgstr "" -#: ../../library/stdtypes.rst:5539 +#: ../../library/stdtypes.rst:5538 msgid "" "The limitation only applies to potentially slow conversions between :class:" "`int` and :class:`str` or :class:`bytes`:" msgstr "" -#: ../../library/stdtypes.rst:5542 +#: ../../library/stdtypes.rst:5541 msgid "``int(string)`` with default base 10." msgstr "" -#: ../../library/stdtypes.rst:5543 +#: ../../library/stdtypes.rst:5542 msgid "``int(string, base)`` for all bases that are not a power of 2." msgstr "" -#: ../../library/stdtypes.rst:5544 +#: ../../library/stdtypes.rst:5543 msgid "``str(integer)``." msgstr "``str(integer)``。" -#: ../../library/stdtypes.rst:5545 +#: ../../library/stdtypes.rst:5544 msgid "``repr(integer)``." msgstr "``repr(integer)``。" -#: ../../library/stdtypes.rst:5546 +#: ../../library/stdtypes.rst:5545 msgid "" "any other string conversion to base 10, for example ``f\"{integer}\"``, " "``\"{}\".format(integer)``, or ``b\"%d\" % integer``." msgstr "" -#: ../../library/stdtypes.rst:5549 +#: ../../library/stdtypes.rst:5548 msgid "The limitations do not apply to functions with a linear algorithm:" msgstr "" -#: ../../library/stdtypes.rst:5551 +#: ../../library/stdtypes.rst:5550 msgid "``int(string, base)`` with base 2, 4, 8, 16, or 32." msgstr "" -#: ../../library/stdtypes.rst:5552 +#: ../../library/stdtypes.rst:5551 msgid ":func:`int.from_bytes` and :func:`int.to_bytes`." msgstr "" -#: ../../library/stdtypes.rst:5553 +#: ../../library/stdtypes.rst:5552 msgid ":func:`hex`, :func:`oct`, :func:`bin`." msgstr "" -#: ../../library/stdtypes.rst:5554 +#: ../../library/stdtypes.rst:5553 msgid ":ref:`formatspec` for hex, octal, and binary numbers." msgstr "" -#: ../../library/stdtypes.rst:5555 +#: ../../library/stdtypes.rst:5554 msgid ":class:`str` to :class:`float`." msgstr "" -#: ../../library/stdtypes.rst:5556 +#: ../../library/stdtypes.rst:5555 msgid ":class:`str` to :class:`decimal.Decimal`." msgstr "" -#: ../../library/stdtypes.rst:5559 +#: ../../library/stdtypes.rst:5558 msgid "Configuring the limit" msgstr "" -#: ../../library/stdtypes.rst:5561 +#: ../../library/stdtypes.rst:5560 msgid "" "Before Python starts up you can use an environment variable or an " "interpreter command line flag to configure the limit:" msgstr "" -#: ../../library/stdtypes.rst:5564 +#: ../../library/stdtypes.rst:5563 msgid "" ":envvar:`PYTHONINTMAXSTRDIGITS`, e.g. ``PYTHONINTMAXSTRDIGITS=640 python3`` " "to set the limit to 640 or ``PYTHONINTMAXSTRDIGITS=0 python3`` to disable " "the limitation." msgstr "" -#: ../../library/stdtypes.rst:5567 +#: ../../library/stdtypes.rst:5566 msgid "" ":option:`-X int_max_str_digits <-X>`, e.g. ``python3 -X " "int_max_str_digits=640``" msgstr "" -#: ../../library/stdtypes.rst:5569 +#: ../../library/stdtypes.rst:5568 msgid "" ":data:`sys.flags.int_max_str_digits` contains the value of :envvar:" "`PYTHONINTMAXSTRDIGITS` or :option:`-X int_max_str_digits <-X>`. If both the " @@ -5999,38 +5999,38 @@ msgid "" "int_info.default_max_str_digits` was used during initialization." msgstr "" -#: ../../library/stdtypes.rst:5575 +#: ../../library/stdtypes.rst:5574 msgid "" "From code, you can inspect the current limit and set a new one using these :" "mod:`sys` APIs:" msgstr "" -#: ../../library/stdtypes.rst:5578 +#: ../../library/stdtypes.rst:5577 msgid "" ":func:`sys.get_int_max_str_digits` and :func:`sys.set_int_max_str_digits` " "are a getter and setter for the interpreter-wide limit. Subinterpreters have " "their own limit." msgstr "" -#: ../../library/stdtypes.rst:5582 +#: ../../library/stdtypes.rst:5581 msgid "" "Information about the default and minimum can be found in :attr:`sys." "int_info`:" msgstr "" -#: ../../library/stdtypes.rst:5584 +#: ../../library/stdtypes.rst:5583 msgid "" ":data:`sys.int_info.default_max_str_digits ` is the compiled-" "in default limit." msgstr "" -#: ../../library/stdtypes.rst:5586 +#: ../../library/stdtypes.rst:5585 msgid "" ":data:`sys.int_info.str_digits_check_threshold ` is the lowest " "accepted value for the limit (other than 0 which disables it)." msgstr "" -#: ../../library/stdtypes.rst:5593 +#: ../../library/stdtypes.rst:5592 msgid "" "Setting a low limit *can* lead to problems. While rare, code exists that " "contains integer constants in decimal in their source that exceed the " @@ -6042,7 +6042,7 @@ msgid "" "constants is to convert them to ``0x`` hexadecimal form as it has no limit." msgstr "" -#: ../../library/stdtypes.rst:5602 +#: ../../library/stdtypes.rst:5601 msgid "" "Test your application thoroughly if you use a low limit. Ensure your tests " "run with the limit set early via the environment or flag so that it applies " @@ -6050,11 +6050,11 @@ msgid "" "to precompile ``.py`` sources to ``.pyc`` files." msgstr "" -#: ../../library/stdtypes.rst:5608 +#: ../../library/stdtypes.rst:5607 msgid "Recommended configuration" msgstr "" -#: ../../library/stdtypes.rst:5610 +#: ../../library/stdtypes.rst:5609 msgid "" "The default :data:`sys.int_info.default_max_str_digits` is expected to be " "reasonable for most applications. If your application requires a different " @@ -6062,45 +6062,45 @@ msgid "" "as these APIs were added in security patch releases in versions before 3.11." msgstr "" -#: ../../library/stdtypes.rst:5615 +#: ../../library/stdtypes.rst:5614 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/stdtypes.rst:5627 +#: ../../library/stdtypes.rst:5626 msgid "If you need to disable it entirely, set it to ``0``." msgstr "" -#: ../../library/stdtypes.rst:5631 +#: ../../library/stdtypes.rst:5630 msgid "Footnotes" msgstr "註解" -#: ../../library/stdtypes.rst:5632 +#: ../../library/stdtypes.rst:5631 msgid "" "Additional information on these special methods may be found in the Python " "Reference Manual (:ref:`customization`)." msgstr "" -#: ../../library/stdtypes.rst:5635 +#: ../../library/stdtypes.rst:5634 msgid "" "As a consequence, the list ``[1, 2]`` is considered equal to ``[1.0, 2.0]``, " "and similarly for tuples." msgstr "" -#: ../../library/stdtypes.rst:5638 +#: ../../library/stdtypes.rst:5637 msgid "They must have since the parser can't tell the type of the operands." msgstr "" -#: ../../library/stdtypes.rst:5640 +#: ../../library/stdtypes.rst:5639 msgid "" "Cased characters are those with general category property being one of " "\"Lu\" (Letter, uppercase), \"Ll\" (Letter, lowercase), or \"Lt\" (Letter, " "titlecase)." msgstr "" -#: ../../library/stdtypes.rst:5643 +#: ../../library/stdtypes.rst:5642 msgid "" "To format only a tuple you should therefore provide a singleton tuple whose " "only element is the tuple to be formatted." diff --git a/library/sys.po b/library/sys.po index 606115a8e0..418c474b7b 100644 --- a/library/sys.po +++ b/library/sys.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-03-02 10:05+0000\n" +"POT-Creation-Date: 2023-04-06 00:14+0000\n" "PO-Revision-Date: 2018-05-23 16:12+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1056,7 +1056,7 @@ msgid "" "the encoding used with the :term:`filesystem error handler ` to convert between Unicode filenames and bytes " "filenames. The filesystem error handler is returned from :func:" -"`getfilesystemencoding`." +"`getfilesystemencodeerrors`." msgstr "" #: ../../library/sys.rst:702 @@ -1890,10 +1890,10 @@ msgstr "" #: ../../library/sys.rst:1308 msgid "" "A string giving the site-specific directory prefix where the platform " -"independent Python files are installed; on Unix, the default is ``'/usr/" -"local'``. This can be set at build time with the ``--prefix`` argument to " -"the :program:`configure` script. See :ref:`installation_paths` for derived " -"paths." +"independent Python files are installed; on Unix, the default is :file:`/usr/" +"local`. This can be set at build time with the :option:`--prefix` argument " +"to the :program:`configure` script. See :ref:`installation_paths` for " +"derived paths." msgstr "" #: ../../library/sys.rst:1314 diff --git a/library/test.po b/library/test.po index a252ce1480..47069f3f84 100644 --- a/library/test.po +++ b/library/test.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-04-03 00:16+0000\n" "PO-Revision-Date: 2018-05-23 16:12+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -671,9 +671,9 @@ msgstr "" #: ../../library/test.rst:624 msgid "" -"Print a warning into :data:`sys.__stderr__`. Format the message as: ``f" -"\"Warning -- {msg}\"``. If *msg* is made of multiple lines, add ``\"Warning " -"-- \"`` prefix to each line." +"Print a warning into :data:`sys.__stderr__`. Format the message as: " +"``f\"Warning -- {msg}\"``. If *msg* is made of multiple lines, add " +"``\"Warning -- \"`` prefix to each line." msgstr "" #: ../../library/test.rst:633 @@ -1674,12 +1674,20 @@ msgstr "" #: ../../library/test.rst:1636 msgid "" +"Suppress warnings that are instances of *category*, which must be :exc:" +"`Warning` or a subclass. Roughly equivalent to :func:`warnings." +"catch_warnings` with :meth:`warnings.simplefilter('ignore', " +"category=category) `. For example::" +msgstr "" + +#: ../../library/test.rst:1651 +msgid "" "Context manager to check that no :exc:`ResourceWarning` was raised. You " "must remove the object which may emit :exc:`ResourceWarning` before the end " "of the context manager." msgstr "" -#: ../../library/test.rst:1643 +#: ../../library/test.rst:1658 msgid "" "Test for syntax warning in *statement* by attempting to compile *statement*. " "Test also that the :exc:`SyntaxWarning` is emitted only once, and that it " @@ -1691,7 +1699,7 @@ msgid "" "``None``, compares to the offset of the exception." msgstr "" -#: ../../library/test.rst:1657 +#: ../../library/test.rst:1672 msgid "" "A convenience wrapper for :func:`warnings.catch_warnings()` that makes it " "easier to test that a warning was correctly raised. It is approximately " @@ -1700,7 +1708,7 @@ msgid "" "automatically validate the results that are recorded." msgstr "" -#: ../../library/test.rst:1663 +#: ../../library/test.rst:1678 msgid "" "``check_warnings`` accepts 2-tuples of the form ``(\"message regexp\", " "WarningCategory)`` as positional arguments. If one or more *filters* are " @@ -1712,15 +1720,15 @@ msgid "" "*quiet* to ``True``." msgstr "" -#: ../../library/test.rst:1672 +#: ../../library/test.rst:1687 msgid "If no arguments are specified, it defaults to::" msgstr "" -#: ../../library/test.rst:1676 +#: ../../library/test.rst:1691 msgid "In this case all warnings are caught and no errors are raised." msgstr "" -#: ../../library/test.rst:1678 +#: ../../library/test.rst:1693 msgid "" "On entry to the context manager, a :class:`WarningRecorder` instance is " "returned. The underlying warnings list from :func:`~warnings.catch_warnings` " @@ -1732,39 +1740,39 @@ msgid "" "return ``None``." msgstr "" -#: ../../library/test.rst:1687 +#: ../../library/test.rst:1702 msgid "" "The recorder object also has a :meth:`reset` method, which clears the " "warnings list." msgstr "" -#: ../../library/test.rst:1690 +#: ../../library/test.rst:1705 msgid "The context manager is designed to be used like this::" msgstr "" -#: ../../library/test.rst:1697 +#: ../../library/test.rst:1712 msgid "" "In this case if either warning was not raised, or some other warning was " "raised, :func:`check_warnings` would raise an error." msgstr "" -#: ../../library/test.rst:1700 +#: ../../library/test.rst:1715 msgid "" "When a test needs to look more deeply into the warnings, rather than just " "checking whether or not they occurred, code like this can be used::" msgstr "" -#: ../../library/test.rst:1714 +#: ../../library/test.rst:1729 msgid "" "Here all warnings will be caught, and the test code tests the captured " "warnings directly." msgstr "" -#: ../../library/test.rst:1717 +#: ../../library/test.rst:1732 msgid "New optional arguments *filters* and *quiet*." msgstr "" -#: ../../library/test.rst:1723 +#: ../../library/test.rst:1738 msgid "" "Class used to record warnings for unit tests. See documentation of :func:" "`check_warnings` above for more details." diff --git a/library/typing.po b/library/typing.po index 8adca57a88..3f273e461e 100644 --- a/library/typing.po +++ b/library/typing.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-26 00:19+0000\n" +"POT-Creation-Date: 2023-03-31 00:16+0000\n" "PO-Revision-Date: 2018-05-23 16:14+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -68,199 +68,213 @@ msgstr "" #: ../../library/typing.rst:44 msgid "" +"For a quick overview of type hints, refer to `this cheat sheet `_." +msgstr "" + +#: ../../library/typing.rst:47 +msgid "" +"The \"Type System Reference\" section of https://mypy.readthedocs.io/ -- " +"since the Python typing system is standardised via PEPs, this reference " +"should broadly apply to most Python type checkers, although some parts may " +"still be specific to mypy." +msgstr "" + +#: ../../library/typing.rst:52 +msgid "" "The documentation at https://typing.readthedocs.io/ serves as useful " "reference for type system features, useful typing related tools and typing " "best practices." msgstr "" -#: ../../library/typing.rst:51 +#: ../../library/typing.rst:58 msgid "Relevant PEPs" msgstr "" -#: ../../library/typing.rst:53 +#: ../../library/typing.rst:60 msgid "" "Since the initial introduction of type hints in :pep:`484` and :pep:`483`, a " "number of PEPs have modified and enhanced Python's framework for type " "annotations. These include:" msgstr "" -#: ../../library/typing.rst:58 +#: ../../library/typing.rst:65 msgid ":pep:`526`: Syntax for Variable Annotations" msgstr "" -#: ../../library/typing.rst:58 +#: ../../library/typing.rst:65 msgid "" "*Introducing* syntax for annotating variables outside of function " "definitions, and :data:`ClassVar`" msgstr "" -#: ../../library/typing.rst:61 +#: ../../library/typing.rst:68 msgid ":pep:`544`: Protocols: Structural subtyping (static duck typing)" msgstr "" -#: ../../library/typing.rst:61 +#: ../../library/typing.rst:68 msgid "" "*Introducing* :class:`Protocol` and the :func:" "`@runtime_checkable` decorator" msgstr "" -#: ../../library/typing.rst:64 +#: ../../library/typing.rst:71 msgid ":pep:`585`: Type Hinting Generics In Standard Collections" msgstr "" -#: ../../library/typing.rst:64 +#: ../../library/typing.rst:71 msgid "" "*Introducing* :class:`types.GenericAlias` and the ability to use standard " "library classes as :ref:`generic types`" msgstr "" -#: ../../library/typing.rst:66 +#: ../../library/typing.rst:73 msgid ":pep:`586`: Literal Types" msgstr "" -#: ../../library/typing.rst:67 +#: ../../library/typing.rst:74 msgid "*Introducing* :data:`Literal`" msgstr "" -#: ../../library/typing.rst:68 +#: ../../library/typing.rst:75 msgid "" ":pep:`589`: TypedDict: Type Hints for Dictionaries with a Fixed Set of Keys" msgstr "" -#: ../../library/typing.rst:69 +#: ../../library/typing.rst:76 msgid "*Introducing* :class:`TypedDict`" msgstr "" -#: ../../library/typing.rst:70 +#: ../../library/typing.rst:77 msgid ":pep:`591`: Adding a final qualifier to typing" msgstr "" -#: ../../library/typing.rst:71 +#: ../../library/typing.rst:78 msgid "*Introducing* :data:`Final` and the :func:`@final` decorator" msgstr "" -#: ../../library/typing.rst:72 +#: ../../library/typing.rst:79 msgid ":pep:`593`: Flexible function and variable annotations" msgstr "" -#: ../../library/typing.rst:73 +#: ../../library/typing.rst:80 msgid "*Introducing* :data:`Annotated`" msgstr "" -#: ../../library/typing.rst:76 +#: ../../library/typing.rst:83 msgid ":pep:`604`: Allow writing union types as ``X | Y``" msgstr "" -#: ../../library/typing.rst:75 +#: ../../library/typing.rst:82 msgid "" "*Introducing* :data:`types.UnionType` and the ability to use the binary-or " "operator ``|`` to signify a :ref:`union of types`" msgstr "" -#: ../../library/typing.rst:78 +#: ../../library/typing.rst:85 msgid ":pep:`612`: Parameter Specification Variables" msgstr "" -#: ../../library/typing.rst:79 +#: ../../library/typing.rst:86 msgid "*Introducing* :class:`ParamSpec` and :data:`Concatenate`" msgstr "" -#: ../../library/typing.rst:80 +#: ../../library/typing.rst:87 msgid ":pep:`613`: Explicit Type Aliases" msgstr "" -#: ../../library/typing.rst:81 +#: ../../library/typing.rst:88 msgid "*Introducing* :data:`TypeAlias`" msgstr "*引入* :data:`TypeAlias`" -#: ../../library/typing.rst:82 +#: ../../library/typing.rst:89 msgid ":pep:`646`: Variadic Generics" msgstr "" -#: ../../library/typing.rst:83 +#: ../../library/typing.rst:90 msgid "*Introducing* :data:`TypeVarTuple`" msgstr "*引入* :data:`TypeVarTuple`" -#: ../../library/typing.rst:84 +#: ../../library/typing.rst:91 msgid ":pep:`647`: User-Defined Type Guards" msgstr "" -#: ../../library/typing.rst:85 +#: ../../library/typing.rst:92 msgid "*Introducing* :data:`TypeGuard`" msgstr "*引入* :data:`TypeGuard`" -#: ../../library/typing.rst:86 +#: ../../library/typing.rst:93 msgid "" ":pep:`655`: Marking individual TypedDict items as required or potentially " "missing" msgstr "" -#: ../../library/typing.rst:87 +#: ../../library/typing.rst:94 msgid "*Introducing* :data:`Required` and :data:`NotRequired`" msgstr "*引入* :data:`Required` 和 :data:`NotRequired`" -#: ../../library/typing.rst:88 +#: ../../library/typing.rst:95 msgid ":pep:`673`: Self type" msgstr "" -#: ../../library/typing.rst:89 +#: ../../library/typing.rst:96 msgid "*Introducing* :data:`Self`" msgstr "*引入* :data:`Self`" -#: ../../library/typing.rst:90 +#: ../../library/typing.rst:97 msgid ":pep:`675`: Arbitrary Literal String Type" msgstr "" -#: ../../library/typing.rst:91 +#: ../../library/typing.rst:98 msgid "*Introducing* :data:`LiteralString`" msgstr "*引入* :data:`LiteralString`" -#: ../../library/typing.rst:93 +#: ../../library/typing.rst:100 msgid ":pep:`681`: Data Class Transforms" msgstr "" -#: ../../library/typing.rst:93 +#: ../../library/typing.rst:100 msgid "" "*Introducing* the :func:`@dataclass_transform` decorator" msgstr "*引入* :func:`@dataclass_transform` 裝飾器" -#: ../../library/typing.rst:98 +#: ../../library/typing.rst:105 msgid "Type aliases" msgstr "" -#: ../../library/typing.rst:100 +#: ../../library/typing.rst:107 msgid "" "A type alias is defined by assigning the type to the alias. In this example, " "``Vector`` and ``list[float]`` will be treated as interchangeable synonyms::" msgstr "" -#: ../../library/typing.rst:111 +#: ../../library/typing.rst:118 msgid "" "Type aliases are useful for simplifying complex type signatures. For " "example::" msgstr "" -#: ../../library/typing.rst:129 +#: ../../library/typing.rst:136 msgid "" "Note that ``None`` as a type hint is a special case and is replaced by " "``type(None)``." msgstr "" -#: ../../library/typing.rst:135 +#: ../../library/typing.rst:142 msgid "NewType" msgstr "NewType" -#: ../../library/typing.rst:137 +#: ../../library/typing.rst:144 msgid "Use the :class:`NewType` helper to create distinct types::" msgstr "" -#: ../../library/typing.rst:144 +#: ../../library/typing.rst:151 msgid "" "The static type checker will treat the new type as if it were a subclass of " "the original type. This is useful in helping catch logical errors::" msgstr "" -#: ../../library/typing.rst:156 +#: ../../library/typing.rst:163 msgid "" "You may still perform all ``int`` operations on a variable of type " "``UserId``, but the result will always be of type ``int``. This lets you " @@ -268,7 +282,7 @@ msgid "" "you from accidentally creating a ``UserId`` in an invalid way::" msgstr "" -#: ../../library/typing.rst:164 +#: ../../library/typing.rst:171 msgid "" "Note that these checks are enforced only by the static type checker. At " "runtime, the statement ``Derived = NewType('Derived', Base)`` will make " @@ -277,31 +291,31 @@ msgid "" "class or introduce much overhead beyond that of a regular function call." msgstr "" -#: ../../library/typing.rst:170 +#: ../../library/typing.rst:177 msgid "" "More precisely, the expression ``some_value is Derived(some_value)`` is " "always true at runtime." msgstr "" -#: ../../library/typing.rst:173 +#: ../../library/typing.rst:180 msgid "It is invalid to create a subtype of ``Derived``::" msgstr "" -#: ../../library/typing.rst:182 +#: ../../library/typing.rst:189 msgid "" "However, it is possible to create a :class:`NewType` based on a 'derived' " "``NewType``::" msgstr "" -#: ../../library/typing.rst:190 +#: ../../library/typing.rst:197 msgid "and typechecking for ``ProUserId`` will work as expected." msgstr "" -#: ../../library/typing.rst:192 +#: ../../library/typing.rst:199 msgid "See :pep:`484` for more details." msgstr "更多細節請見 :pep:`484`\\ 。" -#: ../../library/typing.rst:196 +#: ../../library/typing.rst:203 msgid "" "Recall that the use of a type alias declares two types to be *equivalent* to " "one another. Doing ``Alias = Original`` will make the static type checker " @@ -309,7 +323,7 @@ msgid "" "This is useful when you want to simplify complex type signatures." msgstr "" -#: ../../library/typing.rst:201 +#: ../../library/typing.rst:208 msgid "" "In contrast, ``NewType`` declares one type to be a *subtype* of another. " "Doing ``Derived = NewType('Derived', Original)`` will make the static type " @@ -319,39 +333,39 @@ msgid "" "errors with minimal runtime cost." msgstr "" -#: ../../library/typing.rst:210 +#: ../../library/typing.rst:217 msgid "" "``NewType`` is now a class rather than a function. There is some additional " "runtime cost when calling ``NewType`` over a regular function. However, " "this cost will be reduced in 3.11.0." msgstr "" -#: ../../library/typing.rst:217 +#: ../../library/typing.rst:224 msgid "Callable" msgstr "" -#: ../../library/typing.rst:219 +#: ../../library/typing.rst:226 msgid "" "Frameworks expecting callback functions of specific signatures might be type " "hinted using ``Callable[[Arg1Type, Arg2Type], ReturnType]``." msgstr "" -#: ../../library/typing.rst:222 ../../library/typing.rst:1164 -#: ../../library/typing.rst:2801 +#: ../../library/typing.rst:229 ../../library/typing.rst:1171 +#: ../../library/typing.rst:2824 msgid "For example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/typing.rst:237 +#: ../../library/typing.rst:244 msgid "" "It is possible to declare the return type of a callable without specifying " "the call signature by substituting a literal ellipsis for the list of " "arguments in the type hint: ``Callable[..., ReturnType]``." msgstr "" -#: ../../library/typing.rst:241 ../../library/typing.rst:843 +#: ../../library/typing.rst:248 ../../library/typing.rst:850 msgid "" "Callables which take other callables as arguments may indicate that their " "parameter types are dependent on each other using :class:`ParamSpec`. " @@ -362,97 +376,97 @@ msgid "" "ReturnType]`` respectively." msgstr "" -#: ../../library/typing.rst:249 ../../library/typing.rst:855 +#: ../../library/typing.rst:256 ../../library/typing.rst:862 msgid "" "``Callable`` now supports :class:`ParamSpec` and :data:`Concatenate`. See :" "pep:`612` for more details." msgstr "" -#: ../../library/typing.rst:254 +#: ../../library/typing.rst:261 msgid "" "The documentation for :class:`ParamSpec` and :class:`Concatenate` provides " "examples of usage in ``Callable``." msgstr "" -#: ../../library/typing.rst:260 +#: ../../library/typing.rst:267 msgid "Generics" msgstr "" -#: ../../library/typing.rst:262 +#: ../../library/typing.rst:269 msgid "" "Since type information about objects kept in containers cannot be statically " "inferred in a generic way, abstract base classes have been extended to " "support subscription to denote expected types for container elements." msgstr "" -#: ../../library/typing.rst:273 +#: ../../library/typing.rst:280 msgid "" "Generics can be parameterized by using a factory available in typing called :" "class:`TypeVar`." msgstr "" -#: ../../library/typing.rst:289 +#: ../../library/typing.rst:296 msgid "User-defined generic types" msgstr "" -#: ../../library/typing.rst:291 +#: ../../library/typing.rst:298 msgid "A user-defined class can be defined as a generic class." msgstr "" -#: ../../library/typing.rst:317 +#: ../../library/typing.rst:324 msgid "" "``Generic[T]`` as a base class defines that the class ``LoggedVar`` takes a " "single type parameter ``T`` . This also makes ``T`` valid as a type within " "the class body." msgstr "" -#: ../../library/typing.rst:321 +#: ../../library/typing.rst:328 msgid "" "The :class:`Generic` base class defines :meth:`~object.__class_getitem__` so " "that ``LoggedVar[T]`` is valid as a type::" msgstr "" -#: ../../library/typing.rst:330 +#: ../../library/typing.rst:337 msgid "" "A generic type can have any number of type variables. All varieties of :" "class:`TypeVar` are permissible as parameters for a generic type::" msgstr "" -#: ../../library/typing.rst:342 +#: ../../library/typing.rst:349 msgid "" "Each type variable argument to :class:`Generic` must be distinct. This is " "thus invalid::" msgstr "" -#: ../../library/typing.rst:353 +#: ../../library/typing.rst:360 msgid "You can use multiple inheritance with :class:`Generic`::" msgstr "" -#: ../../library/typing.rst:363 +#: ../../library/typing.rst:370 msgid "" "When inheriting from generic classes, some type variables could be fixed::" msgstr "" -#: ../../library/typing.rst:373 +#: ../../library/typing.rst:380 msgid "In this case ``MyDict`` has a single parameter, ``T``." msgstr "" -#: ../../library/typing.rst:375 +#: ../../library/typing.rst:382 msgid "" "Using a generic class without specifying type parameters assumes :data:`Any` " "for each position. In the following example, ``MyIterable`` is not generic " "but implicitly inherits from ``Iterable[Any]``::" msgstr "" -#: ../../library/typing.rst:383 +#: ../../library/typing.rst:390 msgid "User defined generic type aliases are also supported. Examples::" msgstr "" -#: ../../library/typing.rst:400 +#: ../../library/typing.rst:407 msgid ":class:`Generic` no longer has a custom metaclass." msgstr "" -#: ../../library/typing.rst:403 +#: ../../library/typing.rst:410 msgid "" "User-defined generics for parameter expressions are also supported via " "parameter specification variables in the form ``Generic[P]``. The behavior " @@ -462,7 +476,7 @@ msgid "" "used to substitute a :class:`ParamSpec`::" msgstr "" -#: ../../library/typing.rst:420 +#: ../../library/typing.rst:427 msgid "" "Furthermore, a generic with only one parameter specification variable will " "accept parameter lists in the forms ``X[[Type1, Type2, ...]]`` and also " @@ -470,20 +484,20 @@ msgid "" "converted to the former, so the following are equivalent::" msgstr "" -#: ../../library/typing.rst:432 +#: ../../library/typing.rst:439 msgid "" "Do note that generics with :class:`ParamSpec` may not have correct " "``__parameters__`` after substitution in some cases because they are " "intended primarily for static type checking." msgstr "" -#: ../../library/typing.rst:436 +#: ../../library/typing.rst:443 msgid "" ":class:`Generic` can now be parameterized over parameter expressions. See :" "class:`ParamSpec` and :pep:`612` for more details." msgstr "" -#: ../../library/typing.rst:440 +#: ../../library/typing.rst:447 msgid "" "A user-defined generic class can have ABCs as base classes without a " "metaclass conflict. Generic metaclasses are not supported. The outcome of " @@ -491,24 +505,24 @@ msgid "" "term:`hashable` and comparable for equality." msgstr "" -#: ../../library/typing.rst:447 +#: ../../library/typing.rst:454 msgid "The :data:`Any` type" msgstr ":data:`Any` 型別" -#: ../../library/typing.rst:449 +#: ../../library/typing.rst:456 msgid "" "A special kind of type is :data:`Any`. A static type checker will treat " "every type as being compatible with :data:`Any` and :data:`Any` as being " "compatible with every type." msgstr "" -#: ../../library/typing.rst:453 +#: ../../library/typing.rst:460 msgid "" "This means that it is possible to perform any operation or method call on a " "value of type :data:`Any` and assign it to any variable::" msgstr "" -#: ../../library/typing.rst:471 +#: ../../library/typing.rst:478 msgid "" "Notice that no type checking is performed when assigning a value of type :" "data:`Any` to a more precise type. For example, the static type checker did " @@ -517,19 +531,19 @@ msgid "" "runtime!" msgstr "" -#: ../../library/typing.rst:477 +#: ../../library/typing.rst:484 msgid "" "Furthermore, all functions without a return type or parameter types will " "implicitly default to using :data:`Any`::" msgstr "" -#: ../../library/typing.rst:490 +#: ../../library/typing.rst:497 msgid "" "This behavior allows :data:`Any` to be used as an *escape hatch* when you " "need to mix dynamically and statically typed code." msgstr "" -#: ../../library/typing.rst:493 +#: ../../library/typing.rst:500 msgid "" "Contrast the behavior of :data:`Any` with the behavior of :class:`object`. " "Similar to :data:`Any`, every type is a subtype of :class:`object`. However, " @@ -537,7 +551,7 @@ msgid "" "subtype of every other type." msgstr "" -#: ../../library/typing.rst:498 +#: ../../library/typing.rst:505 msgid "" "That means when the type of a value is :class:`object`, a type checker will " "reject almost all operations on it, and assigning it to a variable (or using " @@ -545,24 +559,24 @@ msgid "" "example::" msgstr "" -#: ../../library/typing.rst:520 +#: ../../library/typing.rst:527 msgid "" "Use :class:`object` to indicate that a value could be any type in a typesafe " "manner. Use :data:`Any` to indicate that a value is dynamically typed." msgstr "" -#: ../../library/typing.rst:525 +#: ../../library/typing.rst:532 msgid "Nominal vs structural subtyping" msgstr "" -#: ../../library/typing.rst:527 +#: ../../library/typing.rst:534 msgid "" "Initially :pep:`484` defined the Python static type system as using *nominal " "subtyping*. This means that a class ``A`` is allowed where a class ``B`` is " "expected if and only if ``A`` is a subclass of ``B``." msgstr "" -#: ../../library/typing.rst:531 +#: ../../library/typing.rst:538 msgid "" "This requirement previously also applied to abstract base classes, such as :" "class:`~collections.abc.Iterable`. The problem with this approach is that a " @@ -571,7 +585,7 @@ msgid "" "code. For example, this conforms to :pep:`484`::" msgstr "" -#: ../../library/typing.rst:544 +#: ../../library/typing.rst:551 msgid "" ":pep:`544` allows to solve this problem by allowing users to write the above " "code without explicit base classes in the class definition, allowing " @@ -580,22 +594,22 @@ msgid "" "subtyping* (or static duck-typing)::" msgstr "" -#: ../../library/typing.rst:560 +#: ../../library/typing.rst:567 msgid "" "Moreover, by subclassing a special class :class:`Protocol`, a user can " "define new custom protocols to fully enjoy structural subtyping (see " "examples below)." msgstr "" -#: ../../library/typing.rst:565 +#: ../../library/typing.rst:572 msgid "Module contents" msgstr "模組內容" -#: ../../library/typing.rst:567 +#: ../../library/typing.rst:574 msgid "The module defines the following classes, functions and decorators." msgstr "" -#: ../../library/typing.rst:571 +#: ../../library/typing.rst:578 msgid "" "This module defines several types that are subclasses of pre-existing " "standard library classes which also extend :class:`Generic` to support type " @@ -603,7 +617,7 @@ msgid "" "corresponding pre-existing classes were enhanced to support ``[]``." msgstr "" -#: ../../library/typing.rst:577 +#: ../../library/typing.rst:584 msgid "" "The redundant types are deprecated as of Python 3.9 but no deprecation " "warnings will be issued by the interpreter. It is expected that type " @@ -611,45 +625,45 @@ msgid "" "Python 3.9 or newer." msgstr "" -#: ../../library/typing.rst:582 +#: ../../library/typing.rst:589 msgid "" "The deprecated types will be removed from the :mod:`typing` module in the " "first Python version released 5 years after the release of Python 3.9.0. See " "details in :pep:`585`—*Type Hinting Generics In Standard Collections*." msgstr "" -#: ../../library/typing.rst:588 +#: ../../library/typing.rst:595 msgid "Special typing primitives" msgstr "" -#: ../../library/typing.rst:591 +#: ../../library/typing.rst:598 msgid "Special types" msgstr "" -#: ../../library/typing.rst:593 +#: ../../library/typing.rst:600 msgid "These can be used as types in annotations and do not support ``[]``." msgstr "" -#: ../../library/typing.rst:597 +#: ../../library/typing.rst:604 msgid "Special type indicating an unconstrained type." msgstr "" -#: ../../library/typing.rst:599 +#: ../../library/typing.rst:606 msgid "Every type is compatible with :data:`Any`." msgstr "" -#: ../../library/typing.rst:600 +#: ../../library/typing.rst:607 msgid ":data:`Any` is compatible with every type." msgstr "" -#: ../../library/typing.rst:602 +#: ../../library/typing.rst:609 msgid "" ":data:`Any` can now be used as a base class. This can be useful for avoiding " "type checker errors with classes that can duck type anywhere or are highly " "dynamic." msgstr "" -#: ../../library/typing.rst:609 +#: ../../library/typing.rst:616 msgid "" "Special type that includes only literal strings. A string literal is " "compatible with ``LiteralString``, as is another ``LiteralString``, but an " @@ -657,47 +671,47 @@ msgid "" "``LiteralString``-typed objects is also acceptable as a ``LiteralString``." msgstr "" -#: ../../library/typing.rst:615 ../../library/typing.rst:2443 +#: ../../library/typing.rst:622 ../../library/typing.rst:2466 msgid "Example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/typing.rst:629 +#: ../../library/typing.rst:636 msgid "" "This is useful for sensitive APIs where arbitrary user-generated strings " "could generate problems. For example, the two cases above that generate type " "checker errors could be vulnerable to an SQL injection attack." msgstr "" -#: ../../library/typing.rst:634 +#: ../../library/typing.rst:641 msgid "See :pep:`675` for more details." msgstr "更多細節請見 :pep:`675`。" -#: ../../library/typing.rst:640 +#: ../../library/typing.rst:647 msgid "" "The `bottom type `_, a type that " "has no members." msgstr "" -#: ../../library/typing.rst:643 +#: ../../library/typing.rst:650 msgid "" "This can be used to define a function that should never be called, or a " "function that never returns::" msgstr "" -#: ../../library/typing.rst:663 +#: ../../library/typing.rst:670 msgid "" "On older Python versions, :data:`NoReturn` may be used to express the same " "concept. ``Never`` was added to make the intended meaning more explicit." msgstr "" -#: ../../library/typing.rst:668 +#: ../../library/typing.rst:675 msgid "Special type indicating that a function never returns. For example::" msgstr "" -#: ../../library/typing.rst:676 +#: ../../library/typing.rst:683 msgid "" "``NoReturn`` can also be used as a `bottom type `_, a type that has no values. Starting in Python 3.11, " @@ -705,150 +719,150 @@ msgid "" "checkers should treat the two equivalently." msgstr "" -#: ../../library/typing.rst:687 +#: ../../library/typing.rst:694 msgid "Special type to represent the current enclosed class. For example::" msgstr "" -#: ../../library/typing.rst:698 +#: ../../library/typing.rst:705 msgid "" "This annotation is semantically equivalent to the following, albeit in a " "more succinct fashion::" msgstr "" -#: ../../library/typing.rst:710 +#: ../../library/typing.rst:717 msgid "In general if something currently follows the pattern of::" msgstr "" -#: ../../library/typing.rst:717 +#: ../../library/typing.rst:724 msgid "" "You should use :data:`Self` as calls to ``SubclassOfFoo.return_self`` would " "have ``Foo`` as the return type and not ``SubclassOfFoo``." msgstr "" -#: ../../library/typing.rst:720 +#: ../../library/typing.rst:727 msgid "Other common use cases include:" msgstr "" -#: ../../library/typing.rst:722 +#: ../../library/typing.rst:729 msgid "" ":class:`classmethod`\\s that are used as alternative constructors and return " "instances of the ``cls`` parameter." msgstr "" -#: ../../library/typing.rst:724 +#: ../../library/typing.rst:731 msgid "Annotating an :meth:`~object.__enter__` method which returns self." msgstr "" -#: ../../library/typing.rst:726 +#: ../../library/typing.rst:733 msgid "See :pep:`673` for more details." msgstr "更多細節請見 :pep:`673`。" -#: ../../library/typing.rst:732 +#: ../../library/typing.rst:739 msgid "" "Special annotation for explicitly declaring a :ref:`type alias `. For example::" msgstr "" -#: ../../library/typing.rst:739 +#: ../../library/typing.rst:746 msgid "See :pep:`613` for more details about explicit type aliases." msgstr "" -#: ../../library/typing.rst:744 +#: ../../library/typing.rst:751 msgid "Special forms" msgstr "" -#: ../../library/typing.rst:746 +#: ../../library/typing.rst:753 msgid "" "These can be used as types in annotations using ``[]``, each having a unique " "syntax." msgstr "" -#: ../../library/typing.rst:750 +#: ../../library/typing.rst:757 msgid "" "Tuple type; ``Tuple[X, Y]`` is the type of a tuple of two items with the " "first item of type X and the second of type Y. The type of the empty tuple " "can be written as ``Tuple[()]``." msgstr "" -#: ../../library/typing.rst:754 +#: ../../library/typing.rst:761 msgid "" "Example: ``Tuple[T1, T2]`` is a tuple of two elements corresponding to type " "variables T1 and T2. ``Tuple[int, float, str]`` is a tuple of an int, a " "float and a string." msgstr "" -#: ../../library/typing.rst:758 +#: ../../library/typing.rst:765 msgid "" "To specify a variable-length tuple of homogeneous type, use literal " "ellipsis, e.g. ``Tuple[int, ...]``. A plain :data:`Tuple` is equivalent to " "``Tuple[Any, ...]``, and in turn to :class:`tuple`." msgstr "" -#: ../../library/typing.rst:762 +#: ../../library/typing.rst:769 msgid "" ":class:`builtins.tuple ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:768 +#: ../../library/typing.rst:775 msgid "" "Union type; ``Union[X, Y]`` is equivalent to ``X | Y`` and means either X or " "Y." msgstr "" -#: ../../library/typing.rst:770 +#: ../../library/typing.rst:777 msgid "" "To define a union, use e.g. ``Union[int, str]`` or the shorthand ``int | " "str``. Using that shorthand is recommended. Details:" msgstr "" -#: ../../library/typing.rst:772 +#: ../../library/typing.rst:779 msgid "The arguments must be types and there must be at least one." msgstr "" -#: ../../library/typing.rst:774 +#: ../../library/typing.rst:781 msgid "Unions of unions are flattened, e.g.::" msgstr "" -#: ../../library/typing.rst:778 +#: ../../library/typing.rst:785 msgid "Unions of a single argument vanish, e.g.::" msgstr "" -#: ../../library/typing.rst:782 +#: ../../library/typing.rst:789 msgid "Redundant arguments are skipped, e.g.::" msgstr "" -#: ../../library/typing.rst:786 +#: ../../library/typing.rst:793 msgid "When comparing unions, the argument order is ignored, e.g.::" msgstr "" -#: ../../library/typing.rst:790 +#: ../../library/typing.rst:797 msgid "You cannot subclass or instantiate a ``Union``." msgstr "" -#: ../../library/typing.rst:792 +#: ../../library/typing.rst:799 msgid "You cannot write ``Union[X][Y]``." msgstr "你不能寫成 ``Union[X][Y]``。" -#: ../../library/typing.rst:794 +#: ../../library/typing.rst:801 msgid "Don't remove explicit subclasses from unions at runtime." msgstr "" -#: ../../library/typing.rst:797 +#: ../../library/typing.rst:804 msgid "" "Unions can now be written as ``X | Y``. See :ref:`union type " "expressions`." msgstr "" -#: ../../library/typing.rst:803 +#: ../../library/typing.rst:810 msgid "Optional type." msgstr "" -#: ../../library/typing.rst:805 +#: ../../library/typing.rst:812 msgid "``Optional[X]`` is equivalent to ``X | None`` (or ``Union[X, None]``)." msgstr "" -#: ../../library/typing.rst:807 +#: ../../library/typing.rst:814 msgid "" "Note that this is not the same concept as an optional argument, which is one " "that has a default. An optional argument with a default does not require " @@ -856,31 +870,31 @@ msgid "" "optional. For example::" msgstr "" -#: ../../library/typing.rst:815 +#: ../../library/typing.rst:822 msgid "" "On the other hand, if an explicit value of ``None`` is allowed, the use of " "``Optional`` is appropriate, whether the argument is optional or not. For " "example::" msgstr "" -#: ../../library/typing.rst:822 +#: ../../library/typing.rst:829 msgid "" "Optional can now be written as ``X | None``. See :ref:`union type " "expressions`." msgstr "" -#: ../../library/typing.rst:828 +#: ../../library/typing.rst:835 msgid "Callable type; ``Callable[[int], str]`` is a function of (int) -> str." msgstr "" -#: ../../library/typing.rst:830 +#: ../../library/typing.rst:837 msgid "" "The subscription syntax must always be used with exactly two values: the " "argument list and the return type. The argument list must be a list of " "types or an ellipsis; the return type must be a single type." msgstr "" -#: ../../library/typing.rst:835 +#: ../../library/typing.rst:842 msgid "" "There is no syntax to indicate optional or keyword arguments; such function " "types are rarely used as callback types. ``Callable[..., ReturnType]`` " @@ -890,19 +904,19 @@ msgid "" "Callable`." msgstr "" -#: ../../library/typing.rst:851 +#: ../../library/typing.rst:858 msgid "" ":class:`collections.abc.Callable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:860 +#: ../../library/typing.rst:867 msgid "" "The documentation for :class:`ParamSpec` and :class:`Concatenate` provide " "examples of usage with ``Callable``." msgstr "" -#: ../../library/typing.rst:865 +#: ../../library/typing.rst:872 msgid "" "Used with :data:`Callable` and :class:`ParamSpec` to type annotate a higher " "order callable which adds, removes, or transforms parameters of another " @@ -912,7 +926,7 @@ msgid "" "``Concatenate`` must be a :class:`ParamSpec` or ellipsis (``...``)." msgstr "" -#: ../../library/typing.rst:873 +#: ../../library/typing.rst:880 msgid "" "For example, to annotate a decorator ``with_lock`` which provides a :class:" "`threading.Lock` to the decorated function, ``Concatenate`` can be used to " @@ -923,17 +937,17 @@ msgid "" "passed in::" msgstr "" -#: ../../library/typing.rst:912 ../../library/typing.rst:1500 +#: ../../library/typing.rst:919 ../../library/typing.rst:1507 msgid "" ":pep:`612` -- Parameter Specification Variables (the PEP which introduced " "``ParamSpec`` and ``Concatenate``)." msgstr "" -#: ../../library/typing.rst:914 +#: ../../library/typing.rst:921 msgid ":class:`ParamSpec` and :class:`Callable`." msgstr ":class:`ParamSpec` 和 :class:`Callable`\\ 。" -#: ../../library/typing.rst:919 +#: ../../library/typing.rst:926 msgid "" "A variable annotated with ``C`` may accept a value of type ``C``. In " "contrast, a variable annotated with ``Type[C]`` may accept values that are " @@ -941,11 +955,11 @@ msgid "" "``C``. For example::" msgstr "" -#: ../../library/typing.rst:928 +#: ../../library/typing.rst:935 msgid "Note that ``Type[C]`` is covariant::" msgstr "" -#: ../../library/typing.rst:940 +#: ../../library/typing.rst:947 msgid "" "The fact that ``Type[C]`` is covariant implies that all subclasses of ``C`` " "should implement the same constructor signature and class method signatures " @@ -955,39 +969,39 @@ msgid "" "particular case may change in future revisions of :pep:`484`." msgstr "" -#: ../../library/typing.rst:948 +#: ../../library/typing.rst:955 msgid "" "The only legal parameters for :class:`Type` are classes, :data:`Any`, :ref:" "`type variables `, and unions of any of these types. For example::" msgstr "" -#: ../../library/typing.rst:954 +#: ../../library/typing.rst:961 msgid "" "``Type[Any]`` is equivalent to ``Type`` which in turn is equivalent to " "``type``, which is the root of Python's metaclass hierarchy." msgstr "" -#: ../../library/typing.rst:959 +#: ../../library/typing.rst:966 msgid "" ":class:`builtins.type ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:965 +#: ../../library/typing.rst:972 msgid "" "A type that can be used to indicate to type checkers that the corresponding " "variable or function parameter has a value equivalent to the provided " "literal (or one of several literals). For example::" msgstr "" -#: ../../library/typing.rst:979 +#: ../../library/typing.rst:986 msgid "" "``Literal[...]`` cannot be subclassed. At runtime, an arbitrary value is " "allowed as type argument to ``Literal[...]``, but type checkers may impose " "restrictions. See :pep:`586` for more details about literal types." msgstr "" -#: ../../library/typing.rst:985 +#: ../../library/typing.rst:992 msgid "" "``Literal`` now de-duplicates parameters. Equality comparisons of " "``Literal`` objects are no longer order dependent. ``Literal`` objects will " @@ -995,22 +1009,22 @@ msgid "" "their parameters are not :term:`hashable`." msgstr "" -#: ../../library/typing.rst:993 +#: ../../library/typing.rst:1000 msgid "Special type construct to mark class variables." msgstr "" -#: ../../library/typing.rst:995 +#: ../../library/typing.rst:1002 msgid "" "As introduced in :pep:`526`, a variable annotation wrapped in ClassVar " "indicates that a given attribute is intended to be used as a class variable " "and should not be set on instances of that class. Usage::" msgstr "" -#: ../../library/typing.rst:1003 +#: ../../library/typing.rst:1010 msgid ":data:`ClassVar` accepts only types and cannot be further subscribed." msgstr "" -#: ../../library/typing.rst:1005 +#: ../../library/typing.rst:1012 msgid "" ":data:`ClassVar` is not a class itself, and should not be used with :func:" "`isinstance` or :func:`issubclass`. :data:`ClassVar` does not change Python " @@ -1018,29 +1032,29 @@ msgid "" "example, a type checker might flag the following code as an error::" msgstr "" -#: ../../library/typing.rst:1019 +#: ../../library/typing.rst:1026 msgid "" "A special typing construct to indicate to type checkers that a name cannot " "be re-assigned or overridden in a subclass. For example::" msgstr "" -#: ../../library/typing.rst:1031 ../../library/typing.rst:2684 +#: ../../library/typing.rst:1038 ../../library/typing.rst:2707 msgid "" "There is no runtime checking of these properties. See :pep:`591` for more " "details." msgstr "" -#: ../../library/typing.rst:1040 +#: ../../library/typing.rst:1047 msgid "" "Special typing constructs that mark individual keys of a :class:`TypedDict` " "as either required or non-required respectively." msgstr "" -#: ../../library/typing.rst:1043 +#: ../../library/typing.rst:1050 msgid "See :class:`TypedDict` and :pep:`655` for more details." msgstr "更多細節請見 :class:`TypedDict` 與 :pep:`655`。" -#: ../../library/typing.rst:1049 +#: ../../library/typing.rst:1056 msgid "" "A type, introduced in :pep:`593` (``Flexible function and variable " "annotations``), to decorate existing types with context-specific metadata " @@ -1057,7 +1071,7 @@ msgid "" "application." msgstr "" -#: ../../library/typing.rst:1063 +#: ../../library/typing.rst:1070 msgid "" "Ultimately, the responsibility of how to interpret the annotations (if at " "all) is the responsibility of the tool or library encountering the " @@ -1066,21 +1080,21 @@ msgid "" "using ``isinstance()``)." msgstr "" -#: ../../library/typing.rst:1069 +#: ../../library/typing.rst:1076 msgid "" "When a tool or a library does not support annotations or encounters an " "unknown annotation it should just ignore it and treat annotated type as the " "underlying type." msgstr "" -#: ../../library/typing.rst:1073 +#: ../../library/typing.rst:1080 msgid "" "It's up to the tool consuming the annotations to decide whether the client " "is allowed to have several annotations on one type and how to merge those " "annotations." msgstr "" -#: ../../library/typing.rst:1077 +#: ../../library/typing.rst:1084 msgid "" "Since the ``Annotated`` type allows you to put several annotations of the " "same (or different) type(s) on any node, the tools or libraries consuming " @@ -1088,59 +1102,59 @@ msgid "" "example, if you are doing value range analysis you might allow this::" msgstr "" -#: ../../library/typing.rst:1086 +#: ../../library/typing.rst:1093 msgid "" "Passing ``include_extras=True`` to :func:`get_type_hints` lets one access " "the extra annotations at runtime." msgstr "" -#: ../../library/typing.rst:1089 +#: ../../library/typing.rst:1096 msgid "The details of the syntax:" msgstr "" -#: ../../library/typing.rst:1091 +#: ../../library/typing.rst:1098 msgid "The first argument to ``Annotated`` must be a valid type" msgstr "" -#: ../../library/typing.rst:1093 +#: ../../library/typing.rst:1100 msgid "" "Multiple type annotations are supported (``Annotated`` supports variadic " "arguments)::" msgstr "" -#: ../../library/typing.rst:1098 +#: ../../library/typing.rst:1105 msgid "" "``Annotated`` must be called with at least two arguments " "( ``Annotated[int]`` is not valid)" msgstr "" -#: ../../library/typing.rst:1101 +#: ../../library/typing.rst:1108 msgid "" "The order of the annotations is preserved and matters for equality checks::" msgstr "" -#: ../../library/typing.rst:1108 +#: ../../library/typing.rst:1115 msgid "" "Nested ``Annotated`` types are flattened, with metadata ordered starting " "with the innermost annotation::" msgstr "" -#: ../../library/typing.rst:1115 +#: ../../library/typing.rst:1122 msgid "Duplicated annotations are not removed::" msgstr "" -#: ../../library/typing.rst:1121 +#: ../../library/typing.rst:1128 msgid "``Annotated`` can be used with nested and generic aliases::" msgstr "" -#: ../../library/typing.rst:1134 +#: ../../library/typing.rst:1141 msgid "" "Special typing form used to annotate the return type of a user-defined type " "guard function. ``TypeGuard`` only accepts a single type argument. At " "runtime, functions marked this way should return a boolean." msgstr "" -#: ../../library/typing.rst:1138 +#: ../../library/typing.rst:1145 msgid "" "``TypeGuard`` aims to benefit *type narrowing* -- a technique used by static " "type checkers to determine a more precise type of an expression within a " @@ -1149,44 +1163,44 @@ msgid "" "conditional expression here is sometimes referred to as a \"type guard\"::" msgstr "" -#: ../../library/typing.rst:1153 +#: ../../library/typing.rst:1160 msgid "" "Sometimes it would be convenient to use a user-defined boolean function as a " "type guard. Such a function should use ``TypeGuard[...]`` as its return " "type to alert static type checkers to this intention." msgstr "" -#: ../../library/typing.rst:1157 +#: ../../library/typing.rst:1164 msgid "" "Using ``-> TypeGuard`` tells the static type checker that for a given " "function:" msgstr "" -#: ../../library/typing.rst:1160 +#: ../../library/typing.rst:1167 msgid "The return value is a boolean." msgstr "" -#: ../../library/typing.rst:1161 +#: ../../library/typing.rst:1168 msgid "" "If the return value is ``True``, the type of its argument is the type inside " "``TypeGuard``." msgstr "" -#: ../../library/typing.rst:1178 +#: ../../library/typing.rst:1185 msgid "" "If ``is_str_list`` is a class or instance method, then the type in " "``TypeGuard`` maps to the type of the second parameter after ``cls`` or " "``self``." msgstr "" -#: ../../library/typing.rst:1182 +#: ../../library/typing.rst:1189 msgid "" "In short, the form ``def foo(arg: TypeA) -> TypeGuard[TypeB]: ...``, means " "that if ``foo(arg)`` returns ``True``, then ``arg`` narrows from ``TypeA`` " "to ``TypeB``." msgstr "" -#: ../../library/typing.rst:1188 +#: ../../library/typing.rst:1195 msgid "" "``TypeB`` need not be a narrower form of ``TypeA`` -- it can even be a wider " "form. The main reason is to allow for things like narrowing ``list[object]`` " @@ -1195,50 +1209,50 @@ msgid "" "guards is left to the user." msgstr "" -#: ../../library/typing.rst:1194 +#: ../../library/typing.rst:1201 msgid "" "``TypeGuard`` also works with type variables. See :pep:`647` for more " "details." msgstr "" -#: ../../library/typing.rst:1200 +#: ../../library/typing.rst:1207 msgid "Building generic types" msgstr "" -#: ../../library/typing.rst:1202 +#: ../../library/typing.rst:1209 msgid "" "These are not used in annotations. They are building blocks for creating " "generic types." msgstr "" -#: ../../library/typing.rst:1206 +#: ../../library/typing.rst:1213 msgid "Abstract base class for generic types." msgstr "" -#: ../../library/typing.rst:1208 +#: ../../library/typing.rst:1215 msgid "" "A generic type is typically declared by inheriting from an instantiation of " "this class with one or more type variables. For example, a generic mapping " "type might be defined as::" msgstr "" -#: ../../library/typing.rst:1217 +#: ../../library/typing.rst:1224 msgid "This class can then be used as follows::" msgstr "" -#: ../../library/typing.rst:1230 +#: ../../library/typing.rst:1237 msgid "Type variable." msgstr "" -#: ../../library/typing.rst:1232 ../../library/typing.rst:1429 -#: ../../library/typing.rst:1606 +#: ../../library/typing.rst:1239 ../../library/typing.rst:1436 +#: ../../library/typing.rst:1629 msgid "Usage::" msgstr "" "用法:\n" "\n" "::" -#: ../../library/typing.rst:1238 +#: ../../library/typing.rst:1245 msgid "" "Type variables exist primarily for the benefit of static type checkers. " "They serve as the parameters for generic types as well as for generic " @@ -1246,51 +1260,51 @@ msgid "" "types. Generic functions work as follows::" msgstr "" -#: ../../library/typing.rst:1258 +#: ../../library/typing.rst:1265 msgid "" "Note that type variables can be *bound*, *constrained*, or neither, but " "cannot be both bound *and* constrained." msgstr "" -#: ../../library/typing.rst:1261 +#: ../../library/typing.rst:1268 msgid "" "Bound type variables and constrained type variables have different semantics " "in several important ways. Using a *bound* type variable means that the " "``TypeVar`` will be solved using the most specific type possible::" msgstr "" -#: ../../library/typing.rst:1276 +#: ../../library/typing.rst:1283 msgid "" "Type variables can be bound to concrete types, abstract types (ABCs or " "protocols), and even unions of types::" msgstr "" -#: ../../library/typing.rst:1282 +#: ../../library/typing.rst:1289 msgid "" "Using a *constrained* type variable, however, means that the ``TypeVar`` can " "only ever be solved as being exactly one of the constraints given::" msgstr "" -#: ../../library/typing.rst:1293 +#: ../../library/typing.rst:1300 msgid "" "At runtime, ``isinstance(x, T)`` will raise :exc:`TypeError`. In general, :" "func:`isinstance` and :func:`issubclass` should not be used with types." msgstr "" -#: ../../library/typing.rst:1296 +#: ../../library/typing.rst:1303 msgid "" "Type variables may be marked covariant or contravariant by passing " "``covariant=True`` or ``contravariant=True``. See :pep:`484` for more " "details. By default, type variables are invariant." msgstr "" -#: ../../library/typing.rst:1302 +#: ../../library/typing.rst:1309 msgid "" "Type variable tuple. A specialized form of :class:`type variable ` " "that enables *variadic* generics." msgstr "" -#: ../../library/typing.rst:1305 +#: ../../library/typing.rst:1312 msgid "" "A normal type variable enables parameterization with a single type. A type " "variable tuple, in contrast, allows parameterization with an *arbitrary* " @@ -1298,7 +1312,7 @@ msgid "" "wrapped in a tuple. For example::" msgstr "" -#: ../../library/typing.rst:1333 +#: ../../library/typing.rst:1340 msgid "" "Note the use of the unpacking operator ``*`` in ``tuple[T, *Ts]``. " "Conceptually, you can think of ``Ts`` as a tuple of type variables ``(T1, " @@ -1308,36 +1322,36 @@ msgid "" "` instead, as ``Unpack[Ts]``.)" msgstr "" -#: ../../library/typing.rst:1341 +#: ../../library/typing.rst:1348 msgid "" "Type variable tuples must *always* be unpacked. This helps distinguish type " "variable tuples from normal type variables::" msgstr "" -#: ../../library/typing.rst:1348 +#: ../../library/typing.rst:1355 msgid "" "Type variable tuples can be used in the same contexts as normal type " "variables. For example, in class definitions, arguments, and return types::" msgstr "" -#: ../../library/typing.rst:1357 +#: ../../library/typing.rst:1364 msgid "" "Type variable tuples can be happily combined with normal type variables::" msgstr "" -#: ../../library/typing.rst:1370 +#: ../../library/typing.rst:1377 msgid "" "However, note that at most one type variable tuple may appear in a single " "list of type arguments or type parameters::" msgstr "" -#: ../../library/typing.rst:1377 +#: ../../library/typing.rst:1384 msgid "" "Finally, an unpacked type variable tuple can be used as the type annotation " "of ``*args``::" msgstr "" -#: ../../library/typing.rst:1387 +#: ../../library/typing.rst:1394 msgid "" "In contrast to non-unpacked annotations of ``*args`` - e.g. ``*args: int``, " "which would specify that *all* arguments are ``int`` - ``*args: *Ts`` " @@ -1346,11 +1360,11 @@ msgid "" "``call_soon`` match the types of the (positional) arguments of ``callback``." msgstr "" -#: ../../library/typing.rst:1394 +#: ../../library/typing.rst:1401 msgid "See :pep:`646` for more details on type variable tuples." msgstr "" -#: ../../library/typing.rst:1400 +#: ../../library/typing.rst:1407 msgid "" "A typing operator that conceptually marks an object as having been unpacked. " "For example, using the unpack operator ``*`` on a :class:`type variable " @@ -1358,20 +1372,20 @@ msgid "" "variable tuple as having been unpacked::" msgstr "" -#: ../../library/typing.rst:1410 +#: ../../library/typing.rst:1417 msgid "" "In fact, ``Unpack`` can be used interchangeably with ``*`` in the context of " "types. You might see ``Unpack`` being used explicitly in older versions of " "Python, where ``*`` couldn't be used in certain places::" msgstr "" -#: ../../library/typing.rst:1426 +#: ../../library/typing.rst:1433 msgid "" "Parameter specification variable. A specialized version of :class:`type " "variables `." msgstr "" -#: ../../library/typing.rst:1433 +#: ../../library/typing.rst:1440 msgid "" "Parameter specification variables exist primarily for the benefit of static " "type checkers. They are used to forward the parameter types of one callable " @@ -1381,7 +1395,7 @@ msgid "" "See :class:`Generic` for more information on generic types." msgstr "" -#: ../../library/typing.rst:1440 +#: ../../library/typing.rst:1447 msgid "" "For example, to add basic logging to a function, one can create a decorator " "``add_logging`` to log function calls. The parameter specification variable " @@ -1389,27 +1403,27 @@ msgid "" "new callable returned by it have inter-dependent type parameters::" msgstr "" -#: ../../library/typing.rst:1464 +#: ../../library/typing.rst:1471 msgid "" "Without ``ParamSpec``, the simplest way to annotate this previously was to " "use a :class:`TypeVar` with bound ``Callable[..., Any]``. However this " "causes two problems:" msgstr "" -#: ../../library/typing.rst:1468 +#: ../../library/typing.rst:1475 msgid "" "The type checker can't type check the ``inner`` function because ``*args`` " "and ``**kwargs`` have to be typed :data:`Any`." msgstr "" -#: ../../library/typing.rst:1470 +#: ../../library/typing.rst:1477 msgid "" ":func:`~cast` may be required in the body of the ``add_logging`` decorator " "when returning the ``inner`` function, or the static type checker must be " "told to ignore the ``return inner``." msgstr "" -#: ../../library/typing.rst:1477 +#: ../../library/typing.rst:1484 msgid "" "Since ``ParamSpec`` captures both positional and keyword parameters, ``P." "args`` and ``P.kwargs`` can be used to split a ``ParamSpec`` into its " @@ -1422,7 +1436,7 @@ msgid "" "`ParamSpecKwargs`." msgstr "" -#: ../../library/typing.rst:1487 +#: ../../library/typing.rst:1494 msgid "" "Parameter specification variables created with ``covariant=True`` or " "``contravariant=True`` can be used to declare covariant or contravariant " @@ -1431,17 +1445,17 @@ msgid "" "decided." msgstr "" -#: ../../library/typing.rst:1496 +#: ../../library/typing.rst:1503 msgid "" "Only parameter specification variables defined in global scope can be " "pickled." msgstr "" -#: ../../library/typing.rst:1502 +#: ../../library/typing.rst:1509 msgid ":class:`Callable` and :class:`Concatenate`." msgstr ":class:`Callable` 和 :class:`Concatenate`\\ 。" -#: ../../library/typing.rst:1507 +#: ../../library/typing.rst:1514 msgid "" "Arguments and keyword arguments attributes of a :class:`ParamSpec`. The ``P." "args`` attribute of a ``ParamSpec`` is an instance of ``ParamSpecArgs``, and " @@ -1449,36 +1463,36 @@ msgid "" "runtime introspection and have no special meaning to static type checkers." msgstr "" -#: ../../library/typing.rst:1512 +#: ../../library/typing.rst:1519 msgid "" "Calling :func:`get_origin` on either of these objects will return the " "original ``ParamSpec``::" msgstr "" -#: ../../library/typing.rst:1524 +#: ../../library/typing.rst:1531 msgid "" "``AnyStr`` is a :class:`constrained type variable ` defined as " "``AnyStr = TypeVar('AnyStr', str, bytes)``." msgstr "" -#: ../../library/typing.rst:1527 +#: ../../library/typing.rst:1534 msgid "" "It is meant to be used for functions that may accept any kind of string " "without allowing different kinds of strings to mix. For example::" msgstr "" -#: ../../library/typing.rst:1539 +#: ../../library/typing.rst:1546 msgid "" "Base class for protocol classes. Protocol classes are defined like this::" msgstr "" -#: ../../library/typing.rst:1545 +#: ../../library/typing.rst:1552 msgid "" "Such classes are primarily used with static type checkers that recognize " "structural subtyping (static duck-typing), for example::" msgstr "" -#: ../../library/typing.rst:1557 +#: ../../library/typing.rst:1564 msgid "" "See :pep:`544` for more details. Protocol classes decorated with :func:" "`runtime_checkable` (described later) act as simple-minded runtime protocols " @@ -1486,15 +1500,15 @@ msgid "" "signatures." msgstr "" -#: ../../library/typing.rst:1562 +#: ../../library/typing.rst:1569 msgid "Protocol classes can be generic, for example::" msgstr "" -#: ../../library/typing.rst:1572 +#: ../../library/typing.rst:1579 msgid "Mark a protocol class as a runtime protocol." msgstr "" -#: ../../library/typing.rst:1574 +#: ../../library/typing.rst:1581 msgid "" "Such a protocol can be used with :func:`isinstance` and :func:`issubclass`. " "This raises :exc:`TypeError` when applied to a non-protocol class. This " @@ -1503,48 +1517,57 @@ msgid "" "Iterable`. For example::" msgstr "" -#: ../../library/typing.rst:1587 +#: ../../library/typing.rst:1601 +msgid "" +":func:`!runtime_checkable` will check only the presence of the required " +"methods or attributes, not their type signatures or types. For example, :" +"class:`ssl.SSLObject` is a class, therefore it passes an :func:`issubclass` " +"check against :data:`Callable`. However, the ``ssl.SSLObject.__init__`` " +"method exists only to raise a :exc:`TypeError` with a more informative " +"message, therefore making it impossible to call (instantiate) :class:`ssl." +"SSLObject`." +msgstr "" + +#: ../../library/typing.rst:1612 msgid "" -":func:`runtime_checkable` will check only the presence of the required " -"methods, not their type signatures. For example, :class:`ssl.SSLObject` is a " -"class, therefore it passes an :func:`issubclass` check against :data:" -"`Callable`. However, the ``ssl.SSLObject.__init__`` method exists only to " -"raise a :exc:`TypeError` with a more informative message, therefore making " -"it impossible to call (instantiate) :class:`ssl.SSLObject`." +"An :func:`isinstance` check against a runtime-checkable protocol can be " +"surprisingly slow compared to an ``isinstance()`` check against a non-" +"protocol class. Consider using alternative idioms such as :func:`hasattr` " +"calls for structural checks in performance-sensitive code." msgstr "" -#: ../../library/typing.rst:1598 +#: ../../library/typing.rst:1621 msgid "Other special directives" msgstr "" -#: ../../library/typing.rst:1600 +#: ../../library/typing.rst:1623 msgid "" "These are not used in annotations. They are building blocks for declaring " "types." msgstr "" -#: ../../library/typing.rst:1604 +#: ../../library/typing.rst:1627 msgid "Typed version of :func:`collections.namedtuple`." msgstr "" -#: ../../library/typing.rst:1612 +#: ../../library/typing.rst:1635 msgid "This is equivalent to::" msgstr "" "這等價於:\n" "\n" "::" -#: ../../library/typing.rst:1616 +#: ../../library/typing.rst:1639 msgid "" "To give a field a default value, you can assign to it in the class body::" msgstr "" -#: ../../library/typing.rst:1625 +#: ../../library/typing.rst:1648 msgid "" "Fields with a default value must come after any fields without a default." msgstr "" -#: ../../library/typing.rst:1627 +#: ../../library/typing.rst:1650 msgid "" "The resulting class has an extra attribute ``__annotations__`` giving a dict " "that maps the field names to the field types. (The field names are in the " @@ -1553,60 +1576,60 @@ msgid "" "API.)" msgstr "" -#: ../../library/typing.rst:1633 +#: ../../library/typing.rst:1656 msgid "``NamedTuple`` subclasses can also have docstrings and methods::" msgstr "" -#: ../../library/typing.rst:1643 +#: ../../library/typing.rst:1666 msgid "``NamedTuple`` subclasses can be generic::" msgstr "" -#: ../../library/typing.rst:1649 +#: ../../library/typing.rst:1672 msgid "Backward-compatible usage::" msgstr "" -#: ../../library/typing.rst:1653 +#: ../../library/typing.rst:1676 msgid "Added support for :pep:`526` variable annotation syntax." msgstr "" -#: ../../library/typing.rst:1656 +#: ../../library/typing.rst:1679 msgid "Added support for default values, methods, and docstrings." msgstr "" -#: ../../library/typing.rst:1659 +#: ../../library/typing.rst:1682 msgid "" "The ``_field_types`` and ``__annotations__`` attributes are now regular " "dictionaries instead of instances of ``OrderedDict``." msgstr "" -#: ../../library/typing.rst:1663 +#: ../../library/typing.rst:1686 msgid "" "Removed the ``_field_types`` attribute in favor of the more standard " "``__annotations__`` attribute which has the same information." msgstr "" -#: ../../library/typing.rst:1667 +#: ../../library/typing.rst:1690 msgid "Added support for generic namedtuples." msgstr "" -#: ../../library/typing.rst:1672 +#: ../../library/typing.rst:1695 msgid "" "A helper class to indicate a distinct type to a typechecker, see :ref:" "`distinct`. At runtime it returns an object that returns its argument when " "called. Usage::" msgstr "" -#: ../../library/typing.rst:1682 +#: ../../library/typing.rst:1705 msgid "``NewType`` is now a class rather than a function." msgstr "" -#: ../../library/typing.rst:1687 +#: ../../library/typing.rst:1710 msgid "" "Special construct to add type hints to a dictionary. At runtime it is a " "plain :class:`dict`." msgstr "" -#: ../../library/typing.rst:1690 +#: ../../library/typing.rst:1713 msgid "" "``TypedDict`` declares a dictionary type that expects all of its instances " "to have a certain set of keys, where each key is associated with a value of " @@ -1614,53 +1637,53 @@ msgid "" "enforced by type checkers. Usage::" msgstr "" -#: ../../library/typing.rst:1706 +#: ../../library/typing.rst:1729 msgid "" "To allow using this feature with older versions of Python that do not " "support :pep:`526`, ``TypedDict`` supports two additional equivalent " "syntactic forms:" msgstr "" -#: ../../library/typing.rst:1710 +#: ../../library/typing.rst:1733 msgid "Using a literal :class:`dict` as the second argument::" msgstr "" -#: ../../library/typing.rst:1714 +#: ../../library/typing.rst:1737 msgid "Using keyword arguments::" msgstr "" -#: ../../library/typing.rst:1721 +#: ../../library/typing.rst:1744 msgid "" "The keyword-argument syntax is deprecated in 3.11 and will be removed in " "3.13. It may also be unsupported by static type checkers." msgstr "" -#: ../../library/typing.rst:1722 +#: ../../library/typing.rst:1745 msgid "" "The functional syntax should also be used when any of the keys are not " "valid :ref:`identifiers `, for example because they are " "keywords or contain hyphens. Example::" msgstr "" -#: ../../library/typing.rst:1734 +#: ../../library/typing.rst:1757 msgid "" "By default, all keys must be present in a ``TypedDict``. It is possible to " "mark individual keys as non-required using :data:`NotRequired`::" msgstr "" -#: ../../library/typing.rst:1745 +#: ../../library/typing.rst:1768 msgid "" "This means that a ``Point2D`` ``TypedDict`` can have the ``label`` key " "omitted." msgstr "" -#: ../../library/typing.rst:1748 +#: ../../library/typing.rst:1771 msgid "" "It is also possible to mark all keys as non-required by default by " "specifying a totality of ``False``::" msgstr "" -#: ../../library/typing.rst:1758 +#: ../../library/typing.rst:1781 msgid "" "This means that a ``Point2D`` ``TypedDict`` can have any of the keys " "omitted. A type checker is only expected to support a literal ``False`` or " @@ -1668,61 +1691,61 @@ msgid "" "and makes all items defined in the class body required." msgstr "" -#: ../../library/typing.rst:1763 +#: ../../library/typing.rst:1786 msgid "" "Individual keys of a ``total=False`` ``TypedDict`` can be marked as required " "using :data:`Required`::" msgstr "" -#: ../../library/typing.rst:1778 +#: ../../library/typing.rst:1801 msgid "" "It is possible for a ``TypedDict`` type to inherit from one or more other " "``TypedDict`` types using the class-based syntax. Usage::" msgstr "" -#: ../../library/typing.rst:1785 +#: ../../library/typing.rst:1808 msgid "" "``Point3D`` has three items: ``x``, ``y`` and ``z``. It is equivalent to " "this definition::" msgstr "" -#: ../../library/typing.rst:1793 +#: ../../library/typing.rst:1816 msgid "" "A ``TypedDict`` cannot inherit from a non-\\ ``TypedDict`` class, except " "for :class:`Generic`. For example::" msgstr "" -#: ../../library/typing.rst:1811 +#: ../../library/typing.rst:1834 msgid "A ``TypedDict`` can be generic::" msgstr "" -#: ../../library/typing.rst:1817 +#: ../../library/typing.rst:1840 msgid "" "A ``TypedDict`` can be introspected via annotations dicts (see :ref:" "`annotations-howto` for more information on annotations best practices), :" "attr:`__total__`, :attr:`__required_keys__`, and :attr:`__optional_keys__`." msgstr "" -#: ../../library/typing.rst:1823 +#: ../../library/typing.rst:1846 msgid "" "``Point2D.__total__`` gives the value of the ``total`` argument. Example::" msgstr "" -#: ../../library/typing.rst:1843 +#: ../../library/typing.rst:1866 msgid "" "``Point2D.__required_keys__`` and ``Point2D.__optional_keys__`` return :" "class:`frozenset` objects containing required and non-required keys, " "respectively." msgstr "" -#: ../../library/typing.rst:1846 +#: ../../library/typing.rst:1869 msgid "" "Keys marked with :data:`Required` will always appear in " "``__required_keys__`` and keys marked with :data:`NotRequired` will always " "appear in ``__optional_keys__``." msgstr "" -#: ../../library/typing.rst:1849 +#: ../../library/typing.rst:1872 msgid "" "For backwards compatibility with Python 3.10 and below, it is also possible " "to use inheritance to declare both required and non-required keys in the " @@ -1731,162 +1754,162 @@ msgid "" "``TypedDict`` with a different value for ``total``::" msgstr "" -#: ../../library/typing.rst:1870 +#: ../../library/typing.rst:1893 msgid "" "See :pep:`589` for more examples and detailed rules of using ``TypedDict``." msgstr "" -#: ../../library/typing.rst:1874 +#: ../../library/typing.rst:1897 msgid "" "Added support for marking individual keys as :data:`Required` or :data:" "`NotRequired`. See :pep:`655`." msgstr "" -#: ../../library/typing.rst:1878 +#: ../../library/typing.rst:1901 msgid "Added support for generic ``TypedDict``\\ s." msgstr "" -#: ../../library/typing.rst:1882 +#: ../../library/typing.rst:1905 msgid "Generic concrete collections" msgstr "" -#: ../../library/typing.rst:1885 +#: ../../library/typing.rst:1908 msgid "Corresponding to built-in types" msgstr "" -#: ../../library/typing.rst:1889 +#: ../../library/typing.rst:1912 msgid "" "A generic version of :class:`dict`. Useful for annotating return types. To " "annotate arguments it is preferred to use an abstract collection type such " "as :class:`Mapping`." msgstr "" -#: ../../library/typing.rst:1893 +#: ../../library/typing.rst:1916 msgid "This type can be used as follows::" msgstr "" -#: ../../library/typing.rst:1898 +#: ../../library/typing.rst:1921 msgid "" ":class:`builtins.dict ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1904 +#: ../../library/typing.rst:1927 msgid "" "Generic version of :class:`list`. Useful for annotating return types. To " "annotate arguments it is preferred to use an abstract collection type such " "as :class:`Sequence` or :class:`Iterable`." msgstr "" -#: ../../library/typing.rst:1909 +#: ../../library/typing.rst:1932 msgid "This type may be used as follows::" msgstr "" -#: ../../library/typing.rst:1919 +#: ../../library/typing.rst:1942 msgid "" ":class:`builtins.list ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1925 +#: ../../library/typing.rst:1948 msgid "" "A generic version of :class:`builtins.set `. Useful for annotating " "return types. To annotate arguments it is preferred to use an abstract " "collection type such as :class:`AbstractSet`." msgstr "" -#: ../../library/typing.rst:1929 +#: ../../library/typing.rst:1952 msgid "" ":class:`builtins.set ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1935 +#: ../../library/typing.rst:1958 msgid "A generic version of :class:`builtins.frozenset `." msgstr "" -#: ../../library/typing.rst:1937 +#: ../../library/typing.rst:1960 msgid "" ":class:`builtins.frozenset ` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1942 +#: ../../library/typing.rst:1965 msgid ":data:`Tuple` is a special form." msgstr "" -#: ../../library/typing.rst:1945 +#: ../../library/typing.rst:1968 msgid "Corresponding to types in :mod:`collections`" msgstr "" -#: ../../library/typing.rst:1949 +#: ../../library/typing.rst:1972 msgid "A generic version of :class:`collections.defaultdict`." msgstr "" -#: ../../library/typing.rst:1953 +#: ../../library/typing.rst:1976 msgid "" ":class:`collections.defaultdict` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1959 +#: ../../library/typing.rst:1982 msgid "A generic version of :class:`collections.OrderedDict`." msgstr "" -#: ../../library/typing.rst:1963 +#: ../../library/typing.rst:1986 msgid "" ":class:`collections.OrderedDict` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1969 +#: ../../library/typing.rst:1992 msgid "A generic version of :class:`collections.ChainMap`." msgstr "" -#: ../../library/typing.rst:1974 +#: ../../library/typing.rst:1997 msgid "" ":class:`collections.ChainMap` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1980 +#: ../../library/typing.rst:2003 msgid "A generic version of :class:`collections.Counter`." msgstr "" -#: ../../library/typing.rst:1985 +#: ../../library/typing.rst:2008 msgid "" ":class:`collections.Counter` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:1991 +#: ../../library/typing.rst:2014 msgid "A generic version of :class:`collections.deque`." msgstr "" -#: ../../library/typing.rst:1996 +#: ../../library/typing.rst:2019 msgid "" ":class:`collections.deque` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2001 +#: ../../library/typing.rst:2024 msgid "Other concrete types" msgstr "" -#: ../../library/typing.rst:2007 +#: ../../library/typing.rst:2030 msgid "" "Generic type ``IO[AnyStr]`` and its subclasses ``TextIO(IO[str])`` and " "``BinaryIO(IO[bytes])`` represent the types of I/O streams such as returned " "by :func:`open`." msgstr "" -#: ../../library/typing.rst:2014 +#: ../../library/typing.rst:2037 msgid "" "The ``typing.io`` namespace is deprecated and will be removed. These types " "should be directly imported from ``typing`` instead." msgstr "" -#: ../../library/typing.rst:2019 +#: ../../library/typing.rst:2042 msgid "" "These type aliases correspond to the return types from :func:`re.compile` " "and :func:`re.match`. These types (and the corresponding functions) are " @@ -1894,32 +1917,32 @@ msgid "" "``Pattern[bytes]``, ``Match[str]``, or ``Match[bytes]``." msgstr "" -#: ../../library/typing.rst:2029 +#: ../../library/typing.rst:2052 msgid "" "The ``typing.re`` namespace is deprecated and will be removed. These types " "should be directly imported from ``typing`` instead." msgstr "" -#: ../../library/typing.rst:2030 +#: ../../library/typing.rst:2053 msgid "" "Classes ``Pattern`` and ``Match`` from :mod:`re` now support ``[]``. See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2036 +#: ../../library/typing.rst:2059 msgid "" "``Text`` is an alias for ``str``. It is provided to supply a forward " "compatible path for Python 2 code: in Python 2, ``Text`` is an alias for " "``unicode``." msgstr "" -#: ../../library/typing.rst:2040 +#: ../../library/typing.rst:2063 msgid "" "Use ``Text`` to indicate that a value must contain a unicode string in a " "manner that is compatible with both Python 2 and Python 3::" msgstr "" -#: ../../library/typing.rst:2048 +#: ../../library/typing.rst:2071 msgid "" "Python 2 is no longer supported, and most type checkers also no longer " "support type checking Python 2 code. Removal of the alias is not currently " @@ -1927,416 +1950,416 @@ msgid "" "wherever possible." msgstr "" -#: ../../library/typing.rst:2055 +#: ../../library/typing.rst:2078 msgid "Abstract Base Classes" msgstr "" -#: ../../library/typing.rst:2058 +#: ../../library/typing.rst:2081 msgid "Corresponding to collections in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:2062 +#: ../../library/typing.rst:2085 msgid "A generic version of :class:`collections.abc.Set`." msgstr "" -#: ../../library/typing.rst:2064 +#: ../../library/typing.rst:2087 msgid "" ":class:`collections.abc.Set` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2070 +#: ../../library/typing.rst:2093 msgid "A generic version of :class:`collections.abc.ByteString`." msgstr "" -#: ../../library/typing.rst:2072 +#: ../../library/typing.rst:2095 msgid "" "This type represents the types :class:`bytes`, :class:`bytearray`, and :" "class:`memoryview` of byte sequences." msgstr "" -#: ../../library/typing.rst:2075 +#: ../../library/typing.rst:2098 msgid "" "As a shorthand for this type, :class:`bytes` can be used to annotate " "arguments of any of the types mentioned above." msgstr "" -#: ../../library/typing.rst:2078 +#: ../../library/typing.rst:2101 msgid "" ":class:`collections.abc.ByteString` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2084 +#: ../../library/typing.rst:2107 msgid "A generic version of :class:`collections.abc.Collection`" msgstr "" -#: ../../library/typing.rst:2088 +#: ../../library/typing.rst:2111 msgid "" ":class:`collections.abc.Collection` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2094 +#: ../../library/typing.rst:2117 msgid "A generic version of :class:`collections.abc.Container`." msgstr "" -#: ../../library/typing.rst:2096 +#: ../../library/typing.rst:2119 msgid "" ":class:`collections.abc.Container` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2102 +#: ../../library/typing.rst:2125 msgid "A generic version of :class:`collections.abc.ItemsView`." msgstr "" -#: ../../library/typing.rst:2104 +#: ../../library/typing.rst:2127 msgid "" ":class:`collections.abc.ItemsView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2110 +#: ../../library/typing.rst:2133 msgid "A generic version of :class:`collections.abc.KeysView`." msgstr "" -#: ../../library/typing.rst:2112 +#: ../../library/typing.rst:2135 msgid "" ":class:`collections.abc.KeysView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2118 +#: ../../library/typing.rst:2141 msgid "" "A generic version of :class:`collections.abc.Mapping`. This type can be used " "as follows::" msgstr "" -#: ../../library/typing.rst:2124 +#: ../../library/typing.rst:2147 msgid "" ":class:`collections.abc.Mapping` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2130 +#: ../../library/typing.rst:2153 msgid "A generic version of :class:`collections.abc.MappingView`." msgstr "" -#: ../../library/typing.rst:2132 +#: ../../library/typing.rst:2155 msgid "" ":class:`collections.abc.MappingView` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2138 +#: ../../library/typing.rst:2161 msgid "A generic version of :class:`collections.abc.MutableMapping`." msgstr "" -#: ../../library/typing.rst:2140 +#: ../../library/typing.rst:2163 msgid "" ":class:`collections.abc.MutableMapping` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2147 +#: ../../library/typing.rst:2170 msgid "A generic version of :class:`collections.abc.MutableSequence`." msgstr "" -#: ../../library/typing.rst:2149 +#: ../../library/typing.rst:2172 msgid "" ":class:`collections.abc.MutableSequence` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2156 +#: ../../library/typing.rst:2179 msgid "A generic version of :class:`collections.abc.MutableSet`." msgstr "" -#: ../../library/typing.rst:2158 +#: ../../library/typing.rst:2181 msgid "" ":class:`collections.abc.MutableSet` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2164 +#: ../../library/typing.rst:2187 msgid "A generic version of :class:`collections.abc.Sequence`." msgstr "" -#: ../../library/typing.rst:2166 +#: ../../library/typing.rst:2189 msgid "" ":class:`collections.abc.Sequence` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2172 +#: ../../library/typing.rst:2195 msgid "A generic version of :class:`collections.abc.ValuesView`." msgstr "" -#: ../../library/typing.rst:2174 +#: ../../library/typing.rst:2197 msgid "" ":class:`collections.abc.ValuesView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2179 +#: ../../library/typing.rst:2202 msgid "Corresponding to other types in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:2183 +#: ../../library/typing.rst:2206 msgid "A generic version of :class:`collections.abc.Iterable`." msgstr "" -#: ../../library/typing.rst:2185 +#: ../../library/typing.rst:2208 msgid "" ":class:`collections.abc.Iterable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2191 +#: ../../library/typing.rst:2214 msgid "A generic version of :class:`collections.abc.Iterator`." msgstr "" -#: ../../library/typing.rst:2193 +#: ../../library/typing.rst:2216 msgid "" ":class:`collections.abc.Iterator` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2199 +#: ../../library/typing.rst:2222 msgid "" "A generator can be annotated by the generic type ``Generator[YieldType, " "SendType, ReturnType]``. For example::" msgstr "" -#: ../../library/typing.rst:2208 +#: ../../library/typing.rst:2231 msgid "" "Note that unlike many other generics in the typing module, the ``SendType`` " "of :class:`Generator` behaves contravariantly, not covariantly or " "invariantly." msgstr "" -#: ../../library/typing.rst:2212 +#: ../../library/typing.rst:2235 msgid "" "If your generator will only yield values, set the ``SendType`` and " "``ReturnType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:2220 +#: ../../library/typing.rst:2243 msgid "" "Alternatively, annotate your generator as having a return type of either " "``Iterable[YieldType]`` or ``Iterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:2228 +#: ../../library/typing.rst:2251 msgid "" ":class:`collections.abc.Generator` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2234 +#: ../../library/typing.rst:2257 msgid "An alias to :class:`collections.abc.Hashable`." msgstr "" -#: ../../library/typing.rst:2238 +#: ../../library/typing.rst:2261 msgid "A generic version of :class:`collections.abc.Reversible`." msgstr "" -#: ../../library/typing.rst:2240 +#: ../../library/typing.rst:2263 msgid "" ":class:`collections.abc.Reversible` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2246 +#: ../../library/typing.rst:2269 msgid "An alias to :class:`collections.abc.Sized`." msgstr "" -#: ../../library/typing.rst:2249 +#: ../../library/typing.rst:2272 msgid "Asynchronous programming" msgstr "" -#: ../../library/typing.rst:2253 +#: ../../library/typing.rst:2276 msgid "" "A generic version of :class:`collections.abc.Coroutine`. The variance and " "order of type variables correspond to those of :class:`Generator`, for " "example::" msgstr "" -#: ../../library/typing.rst:2265 +#: ../../library/typing.rst:2288 msgid "" ":class:`collections.abc.Coroutine` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2271 +#: ../../library/typing.rst:2294 msgid "" "An async generator can be annotated by the generic type " "``AsyncGenerator[YieldType, SendType]``. For example::" msgstr "" -#: ../../library/typing.rst:2280 +#: ../../library/typing.rst:2303 msgid "" "Unlike normal generators, async generators cannot return a value, so there " "is no ``ReturnType`` type parameter. As with :class:`Generator`, the " "``SendType`` behaves contravariantly." msgstr "" -#: ../../library/typing.rst:2284 +#: ../../library/typing.rst:2307 msgid "" "If your generator will only yield values, set the ``SendType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:2292 +#: ../../library/typing.rst:2315 msgid "" "Alternatively, annotate your generator as having a return type of either " "``AsyncIterable[YieldType]`` or ``AsyncIterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:2302 +#: ../../library/typing.rst:2325 msgid "" ":class:`collections.abc.AsyncGenerator` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2309 +#: ../../library/typing.rst:2332 msgid "A generic version of :class:`collections.abc.AsyncIterable`." msgstr "" -#: ../../library/typing.rst:2313 +#: ../../library/typing.rst:2336 msgid "" ":class:`collections.abc.AsyncIterable` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2319 +#: ../../library/typing.rst:2342 msgid "A generic version of :class:`collections.abc.AsyncIterator`." msgstr "" -#: ../../library/typing.rst:2323 +#: ../../library/typing.rst:2346 msgid "" ":class:`collections.abc.AsyncIterator` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2329 +#: ../../library/typing.rst:2352 msgid "A generic version of :class:`collections.abc.Awaitable`." msgstr "" -#: ../../library/typing.rst:2333 +#: ../../library/typing.rst:2356 msgid "" ":class:`collections.abc.Awaitable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2339 +#: ../../library/typing.rst:2362 msgid "Context manager types" msgstr "" -#: ../../library/typing.rst:2343 +#: ../../library/typing.rst:2366 msgid "A generic version of :class:`contextlib.AbstractContextManager`." msgstr "" -#: ../../library/typing.rst:2348 +#: ../../library/typing.rst:2371 msgid "" ":class:`contextlib.AbstractContextManager` now supports subscripting " "(``[]``). See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2355 +#: ../../library/typing.rst:2378 msgid "A generic version of :class:`contextlib.AbstractAsyncContextManager`." msgstr "" -#: ../../library/typing.rst:2360 +#: ../../library/typing.rst:2383 msgid "" ":class:`contextlib.AbstractAsyncContextManager` now supports subscripting " "(``[]``). See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2366 +#: ../../library/typing.rst:2389 msgid "Protocols" msgstr "協定" -#: ../../library/typing.rst:2368 +#: ../../library/typing.rst:2391 msgid "These protocols are decorated with :func:`runtime_checkable`." msgstr "" -#: ../../library/typing.rst:2372 +#: ../../library/typing.rst:2395 msgid "" "An ABC with one abstract method ``__abs__`` that is covariant in its return " "type." msgstr "" -#: ../../library/typing.rst:2377 +#: ../../library/typing.rst:2400 msgid "An ABC with one abstract method ``__bytes__``." msgstr "一個有抽象方法 ``__bytes__`` 的 ABC。" -#: ../../library/typing.rst:2381 +#: ../../library/typing.rst:2404 msgid "An ABC with one abstract method ``__complex__``." msgstr "一個有抽象方法 ``__complex__`` 的 ABC。" -#: ../../library/typing.rst:2385 +#: ../../library/typing.rst:2408 msgid "An ABC with one abstract method ``__float__``." msgstr "一個有抽象方法 ``__float__`` 的 ABC。" -#: ../../library/typing.rst:2389 +#: ../../library/typing.rst:2412 msgid "An ABC with one abstract method ``__index__``." msgstr "一個有抽象方法 ``__index__`` 的 ABC。" -#: ../../library/typing.rst:2395 +#: ../../library/typing.rst:2418 msgid "An ABC with one abstract method ``__int__``." msgstr "一個有抽象方法 ``__int__`` 的 ABC。" -#: ../../library/typing.rst:2399 +#: ../../library/typing.rst:2422 msgid "" "An ABC with one abstract method ``__round__`` that is covariant in its " "return type." msgstr "" -#: ../../library/typing.rst:2403 +#: ../../library/typing.rst:2426 msgid "Functions and decorators" msgstr "函式與裝飾器" -#: ../../library/typing.rst:2407 +#: ../../library/typing.rst:2430 msgid "Cast a value to a type." msgstr "" -#: ../../library/typing.rst:2409 +#: ../../library/typing.rst:2432 msgid "" "This returns the value unchanged. To the type checker this signals that the " "return value has the designated type, but at runtime we intentionally don't " "check anything (we want this to be as fast as possible)." msgstr "" -#: ../../library/typing.rst:2416 +#: ../../library/typing.rst:2439 msgid "" "Ask a static type checker to confirm that *val* has an inferred type of " "*typ*." msgstr "" -#: ../../library/typing.rst:2418 +#: ../../library/typing.rst:2441 msgid "" "When the type checker encounters a call to ``assert_type()``, it emits an " "error if the value is not of the specified type::" msgstr "" -#: ../../library/typing.rst:2425 +#: ../../library/typing.rst:2448 msgid "" "At runtime this returns the first argument unchanged with no side effects." msgstr "" -#: ../../library/typing.rst:2427 +#: ../../library/typing.rst:2450 msgid "" "This function is useful for ensuring the type checker's understanding of a " "script is in line with the developer's intentions::" msgstr "" -#: ../../library/typing.rst:2441 +#: ../../library/typing.rst:2464 msgid "" "Ask a static type checker to confirm that a line of code is unreachable." msgstr "" -#: ../../library/typing.rst:2454 +#: ../../library/typing.rst:2477 msgid "" "Here, the annotations allow the type checker to infer that the last case can " "never execute, because ``arg`` is either an :class:`int` or a :class:`str`, " @@ -2349,53 +2372,53 @@ msgid "" "bottom type, :data:`Never`, and nothing else." msgstr "" -#: ../../library/typing.rst:2466 +#: ../../library/typing.rst:2489 msgid "At runtime, this throws an exception when called." msgstr "" -#: ../../library/typing.rst:2469 +#: ../../library/typing.rst:2492 msgid "" "`Unreachable Code and Exhaustiveness Checking `__ has more information about " "exhaustiveness checking with static typing." msgstr "" -#: ../../library/typing.rst:2477 +#: ../../library/typing.rst:2500 msgid "Reveal the inferred static type of an expression." msgstr "" -#: ../../library/typing.rst:2479 +#: ../../library/typing.rst:2502 msgid "" "When a static type checker encounters a call to this function, it emits a " "diagnostic with the type of the argument. For example::" msgstr "" -#: ../../library/typing.rst:2485 +#: ../../library/typing.rst:2508 msgid "" "This can be useful when you want to debug how your type checker handles a " "particular piece of code." msgstr "" -#: ../../library/typing.rst:2488 +#: ../../library/typing.rst:2511 msgid "" "The function returns its argument unchanged, which allows using it within an " "expression::" msgstr "" -#: ../../library/typing.rst:2493 +#: ../../library/typing.rst:2516 msgid "" "Most type checkers support ``reveal_type()`` anywhere, even if the name is " "not imported from ``typing``. Importing the name from ``typing`` allows your " "code to run without runtime errors and communicates intent more clearly." msgstr "" -#: ../../library/typing.rst:2498 +#: ../../library/typing.rst:2521 msgid "" "At runtime, this function prints the runtime type of its argument to stderr " "and returns it unchanged::" msgstr "" -#: ../../library/typing.rst:2508 +#: ../../library/typing.rst:2531 msgid "" ":data:`~typing.dataclass_transform` may be used to decorate a class, " "metaclass, or a function that is itself a decorator. The presence of " @@ -2404,19 +2427,19 @@ msgid "" "`dataclasses.dataclass`-like behaviors." msgstr "" -#: ../../library/typing.rst:2514 +#: ../../library/typing.rst:2537 msgid "Example usage with a decorator function::" msgstr "" -#: ../../library/typing.rst:2528 +#: ../../library/typing.rst:2551 msgid "On a base class::" msgstr "" -#: ../../library/typing.rst:2537 +#: ../../library/typing.rst:2560 msgid "On a metaclass::" msgstr "" -#: ../../library/typing.rst:2548 +#: ../../library/typing.rst:2571 msgid "" "The ``CustomerModel`` classes defined above will be treated by type checkers " "similarly to classes created with :func:`@dataclasses.dataclass `-decorated definitions for " "*func*. *func* is the function object for the implementation of the " @@ -2562,25 +2585,25 @@ msgid "" "returns an empty sequence." msgstr "" -#: ../../library/typing.rst:2650 +#: ../../library/typing.rst:2673 msgid "" "``get_overloads()`` can be used for introspecting an overloaded function at " "runtime." msgstr "" -#: ../../library/typing.rst:2658 +#: ../../library/typing.rst:2681 msgid "" "Clear all registered overloads in the internal registry. This can be used to " "reclaim the memory used by the registry." msgstr "" -#: ../../library/typing.rst:2666 +#: ../../library/typing.rst:2689 msgid "" "A decorator to indicate to type checkers that the decorated method cannot be " "overridden, and the decorated class cannot be subclassed. For example::" msgstr "" -#: ../../library/typing.rst:2689 +#: ../../library/typing.rst:2712 msgid "" "The decorator will now set the ``__final__`` attribute to ``True`` on the " "decorated object. Thus, a check like ``if getattr(obj, \"__final__\", " @@ -2590,59 +2613,59 @@ msgid "" "exception." msgstr "" -#: ../../library/typing.rst:2700 +#: ../../library/typing.rst:2723 msgid "Decorator to indicate that annotations are not type hints." msgstr "" -#: ../../library/typing.rst:2702 +#: ../../library/typing.rst:2725 msgid "" "This works as class or function :term:`decorator`. With a class, it applies " "recursively to all methods and classes defined in that class (but not to " "methods defined in its superclasses or subclasses)." msgstr "" -#: ../../library/typing.rst:2706 +#: ../../library/typing.rst:2729 msgid "This mutates the function(s) in place." msgstr "" -#: ../../library/typing.rst:2710 +#: ../../library/typing.rst:2733 msgid "Decorator to give another decorator the :func:`no_type_check` effect." msgstr "" -#: ../../library/typing.rst:2712 +#: ../../library/typing.rst:2735 msgid "" "This wraps the decorator with something that wraps the decorated function " "in :func:`no_type_check`." msgstr "" -#: ../../library/typing.rst:2717 +#: ../../library/typing.rst:2740 msgid "Decorator to mark a class or function to be unavailable at runtime." msgstr "" -#: ../../library/typing.rst:2719 +#: ../../library/typing.rst:2742 msgid "" "This decorator is itself not available at runtime. It is mainly intended to " "mark classes that are defined in type stub files if an implementation " "returns an instance of a private class::" msgstr "" -#: ../../library/typing.rst:2730 +#: ../../library/typing.rst:2753 msgid "" "Note that returning instances of private classes is not recommended. It is " "usually preferable to make such classes public." msgstr "" -#: ../../library/typing.rst:2734 +#: ../../library/typing.rst:2757 msgid "Introspection helpers" msgstr "" -#: ../../library/typing.rst:2738 +#: ../../library/typing.rst:2761 msgid "" "Return a dictionary containing type hints for a function, method, module or " "class object." msgstr "" -#: ../../library/typing.rst:2741 +#: ../../library/typing.rst:2764 msgid "" "This is often the same as ``obj.__annotations__``. In addition, forward " "references encoded as string literals are handled by evaluating them in " @@ -2651,36 +2674,36 @@ msgid "" "__mro__`` in reverse order." msgstr "" -#: ../../library/typing.rst:2747 +#: ../../library/typing.rst:2770 msgid "" "The function recursively replaces all ``Annotated[T, ...]`` with ``T``, " "unless ``include_extras`` is set to ``True`` (see :class:`Annotated` for " "more information). For example::" msgstr "" -#: ../../library/typing.rst:2762 +#: ../../library/typing.rst:2785 msgid "" ":func:`get_type_hints` does not work with imported :ref:`type aliases ` that include forward references. Enabling postponed evaluation of " "annotations (:pep:`563`) may remove the need for most forward references." msgstr "" -#: ../../library/typing.rst:2767 +#: ../../library/typing.rst:2790 msgid "Added ``include_extras`` parameter as part of :pep:`593`." msgstr "新增 ``include_extras`` 參數(如 :pep:`593` 中所述)。" -#: ../../library/typing.rst:2770 +#: ../../library/typing.rst:2793 msgid "" "Previously, ``Optional[t]`` was added for function and method annotations if " "a default value equal to ``None`` was set. Now the annotation is returned " "unchanged." msgstr "" -#: ../../library/typing.rst:2778 +#: ../../library/typing.rst:2801 msgid "Provide basic introspection for generic types and special typing forms." msgstr "" -#: ../../library/typing.rst:2780 +#: ../../library/typing.rst:2803 msgid "" "For a typing object of the form ``X[Y, Z, ...]`` these functions return " "``X`` and ``(Y, Z, ...)``. If ``X`` is a generic alias for a builtin or :mod:" @@ -2691,11 +2714,11 @@ msgid "" "and ``()`` correspondingly. Examples::" msgstr "" -#: ../../library/typing.rst:2799 +#: ../../library/typing.rst:2822 msgid "Check if a type is a :class:`TypedDict`." msgstr "" -#: ../../library/typing.rst:2814 +#: ../../library/typing.rst:2837 msgid "" "A class used for internal typing representation of string forward " "references. For example, ``List[\"SomeClass\"]`` is implicitly transformed " @@ -2703,24 +2726,24 @@ msgid "" "instantiated by a user, but may be used by introspection tools." msgstr "" -#: ../../library/typing.rst:2820 +#: ../../library/typing.rst:2843 msgid "" ":pep:`585` generic types such as ``list[\"SomeClass\"]`` will not be " "implicitly transformed into ``list[ForwardRef(\"SomeClass\")]`` and thus " "will not automatically resolve to ``list[SomeClass]``." msgstr "" -#: ../../library/typing.rst:2827 +#: ../../library/typing.rst:2850 msgid "Constant" msgstr "常數" -#: ../../library/typing.rst:2831 +#: ../../library/typing.rst:2854 msgid "" "A special constant that is assumed to be ``True`` by 3rd party static type " "checkers. It is ``False`` at runtime. Usage::" msgstr "" -#: ../../library/typing.rst:2840 +#: ../../library/typing.rst:2863 msgid "" "The first type annotation must be enclosed in quotes, making it a \"forward " "reference\", to hide the ``expensive_mod`` reference from the interpreter " @@ -2728,7 +2751,7 @@ msgid "" "second annotation does not need to be enclosed in quotes." msgstr "" -#: ../../library/typing.rst:2847 +#: ../../library/typing.rst:2870 msgid "" "If ``from __future__ import annotations`` is used, annotations are not " "evaluated at function definition time. Instead, they are stored as strings " @@ -2736,11 +2759,11 @@ msgid "" "annotation (see :pep:`563`)." msgstr "" -#: ../../library/typing.rst:2856 +#: ../../library/typing.rst:2879 msgid "Deprecation Timeline of Major Features" msgstr "" -#: ../../library/typing.rst:2858 +#: ../../library/typing.rst:2881 msgid "" "Certain features in ``typing`` are deprecated and may be removed in a future " "version of Python. The following table summarizes major deprecations for " @@ -2748,62 +2771,62 @@ msgid "" "listed." msgstr "" -#: ../../library/typing.rst:2863 +#: ../../library/typing.rst:2886 msgid "Feature" msgstr "" -#: ../../library/typing.rst:2863 +#: ../../library/typing.rst:2886 msgid "Deprecated in" msgstr "棄用於" -#: ../../library/typing.rst:2863 +#: ../../library/typing.rst:2886 msgid "Projected removal" msgstr "" -#: ../../library/typing.rst:2863 +#: ../../library/typing.rst:2886 msgid "PEP/issue" msgstr "" -#: ../../library/typing.rst:2865 +#: ../../library/typing.rst:2888 msgid "``typing.io`` and ``typing.re`` submodules" msgstr "" -#: ../../library/typing.rst:2865 +#: ../../library/typing.rst:2888 msgid "3.8" msgstr "3.8" -#: ../../library/typing.rst:2865 +#: ../../library/typing.rst:2888 msgid "3.13" msgstr "3.13" -#: ../../library/typing.rst:2865 +#: ../../library/typing.rst:2888 msgid ":issue:`38291`" msgstr ":issue:`38291`" -#: ../../library/typing.rst:2868 +#: ../../library/typing.rst:2891 msgid "``typing`` versions of standard collections" msgstr "" -#: ../../library/typing.rst:2868 +#: ../../library/typing.rst:2891 msgid "3.9" msgstr "3.9" -#: ../../library/typing.rst:2868 ../../library/typing.rst:2871 +#: ../../library/typing.rst:2891 ../../library/typing.rst:2894 msgid "Undecided" msgstr "" -#: ../../library/typing.rst:2868 +#: ../../library/typing.rst:2891 msgid ":pep:`585`" msgstr ":pep:`585`" -#: ../../library/typing.rst:2871 +#: ../../library/typing.rst:2894 msgid "``typing.Text``" msgstr "``typing.Text``" -#: ../../library/typing.rst:2871 +#: ../../library/typing.rst:2894 msgid "3.11" msgstr "3.11" -#: ../../library/typing.rst:2871 +#: ../../library/typing.rst:2894 msgid ":gh:`92332`" msgstr ":gh:`92332`" diff --git a/library/venv.po b/library/venv.po index 8a9828c90d..98c285f89b 100644 --- a/library/venv.po +++ b/library/venv.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:17+0000\n" +"POT-Creation-Date: 2023-03-16 00:18+0000\n" "PO-Revision-Date: 2018-05-23 16:15+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -196,7 +196,7 @@ msgstr "" msgid "" "A virtual environment may be \"activated\" using a script in its binary " "directory (``bin`` on POSIX; ``Scripts`` on Windows). This will prepend that " -"directory to your :envvar:`!PATH`, so that running :program:`!python` will " +"directory to your :envvar:`!PATH`, so that running :program:`python` will " "invoke the environment's Python interpreter and you can run installed " "scripts without having to use their full path. The invocation of the " "activation script is platform-specific (:samp:`{}` must be replaced by " @@ -268,7 +268,7 @@ msgid ":samp:`PS C:\\\\> {}\\\\Scripts\\\\Activate.ps1`" msgstr ":samp:`PS C:\\\\> {}\\\\Scripts\\\\Activate.ps1`" #: ../../library/venv.rst:86 -msgid ":program:`!fish` and :program:`!csh` activation scripts." +msgid ":program:`fish` and :program:`csh` activation scripts." msgstr "" #: ../../library/venv.rst:89 diff --git a/using/configure.po b/using/configure.po index 2ccd28c09c..59052b6722 100644 --- a/using/configure.po +++ b/using/configure.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-03-16 00:18+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -252,172 +252,198 @@ msgstr "" #: ../../using/configure.rst:179 msgid "" +"Install architecture-independent files in PREFIX. On Unix, it defaults to :" +"file:`/usr/local`." +msgstr "" + +#: ../../using/configure.rst:182 +msgid "This value can be retrived at runtime using :data:`sys.prefix`." +msgstr "" + +#: ../../using/configure.rst:184 +msgid "" +"As an example, one can use ``--prefix=\"$HOME/.local/\"`` to install a " +"Python in its home directory." +msgstr "" + +#: ../../using/configure.rst:189 +msgid "" +"Install architecture-dependent files in EPREFIX, defaults to :option:`--" +"prefix`." +msgstr "" + +#: ../../using/configure.rst:191 +msgid "This value can be retrived at runtime using :data:`sys.exec_prefix`." +msgstr "" + +#: ../../using/configure.rst:195 +msgid "" "Don't build nor install test modules, like the :mod:`test` package or the :" "mod:`_testcapi` extension module (built and installed by default)." msgstr "" -#: ../../using/configure.rst:186 +#: ../../using/configure.rst:202 msgid "Select the :mod:`ensurepip` command run on Python installation:" msgstr "" -#: ../../using/configure.rst:188 +#: ../../using/configure.rst:204 msgid "" "``upgrade`` (default): run ``python -m ensurepip --altinstall --upgrade`` " "command." msgstr "" -#: ../../using/configure.rst:190 +#: ../../using/configure.rst:206 msgid "``install``: run ``python -m ensurepip --altinstall`` command;" msgstr "" -#: ../../using/configure.rst:191 +#: ../../using/configure.rst:207 msgid "``no``: don't run ensurepip;" msgstr "" -#: ../../using/configure.rst:197 +#: ../../using/configure.rst:213 msgid "Performance options" msgstr "" -#: ../../using/configure.rst:199 +#: ../../using/configure.rst:215 msgid "" "Configuring Python using ``--enable-optimizations --with-lto`` (PGO + LTO) " "is recommended for best performance." msgstr "" -#: ../../using/configure.rst:204 +#: ../../using/configure.rst:220 msgid "" "Enable Profile Guided Optimization (PGO) using :envvar:`PROFILE_TASK` " "(disabled by default)." msgstr "" -#: ../../using/configure.rst:207 +#: ../../using/configure.rst:223 msgid "" "The C compiler Clang requires ``llvm-profdata`` program for PGO. On macOS, " "GCC also requires it: GCC is just an alias to Clang on macOS." msgstr "" -#: ../../using/configure.rst:210 +#: ../../using/configure.rst:226 msgid "" "Disable also semantic interposition in libpython if ``--enable-shared`` and " "GCC is used: add ``-fno-semantic-interposition`` to the compiler and linker " "flags." msgstr "" -#: ../../using/configure.rst:216 +#: ../../using/configure.rst:232 msgid "Use ``-fno-semantic-interposition`` on GCC." msgstr "" -#: ../../using/configure.rst:221 +#: ../../using/configure.rst:237 msgid "" "Environment variable used in the Makefile: Python command line arguments for " "the PGO generation task." msgstr "" -#: ../../using/configure.rst:224 +#: ../../using/configure.rst:240 msgid "Default: ``-m test --pgo --timeout=$(TESTTIMEOUT)``." msgstr "" -#: ../../using/configure.rst:230 +#: ../../using/configure.rst:246 msgid "Enable Link Time Optimization (LTO) in any build (disabled by default)." msgstr "" -#: ../../using/configure.rst:232 +#: ../../using/configure.rst:248 msgid "" "The C compiler Clang requires ``llvm-ar`` for LTO (``ar`` on macOS), as well " "as an LTO-aware linker (``ld.gold`` or ``lld``)." msgstr "" -#: ../../using/configure.rst:237 +#: ../../using/configure.rst:253 msgid "To use ThinLTO feature, use ``--with-lto=thin`` on Clang." msgstr "" -#: ../../using/configure.rst:242 +#: ../../using/configure.rst:258 msgid "" "Enable computed gotos in evaluation loop (enabled by default on supported " "compilers)." msgstr "" -#: ../../using/configure.rst:247 +#: ../../using/configure.rst:263 msgid "" "Disable the specialized Python memory allocator :ref:`pymalloc ` " "(enabled by default)." msgstr "" -#: ../../using/configure.rst:250 +#: ../../using/configure.rst:266 msgid "See also :envvar:`PYTHONMALLOC` environment variable." msgstr "另請參閱 :envvar:`PYTHONMALLOC` 環境變數。" -#: ../../using/configure.rst:254 +#: ../../using/configure.rst:270 msgid "" "Disable static documentation strings to reduce the memory footprint (enabled " "by default). Documentation strings defined in Python are not affected." msgstr "" -#: ../../using/configure.rst:257 +#: ../../using/configure.rst:273 msgid "Don't define the ``WITH_DOC_STRINGS`` macro." msgstr "" -#: ../../using/configure.rst:259 +#: ../../using/configure.rst:275 msgid "See the ``PyDoc_STRVAR()`` macro." msgstr "" -#: ../../using/configure.rst:263 +#: ../../using/configure.rst:279 msgid "Enable C-level code profiling with ``gprof`` (disabled by default)." msgstr "" -#: ../../using/configure.rst:269 +#: ../../using/configure.rst:285 msgid "Python Debug Build" msgstr "" -#: ../../using/configure.rst:271 +#: ../../using/configure.rst:287 msgid "" "A debug build is Python built with the :option:`--with-pydebug` configure " "option." msgstr "" -#: ../../using/configure.rst:274 +#: ../../using/configure.rst:290 msgid "Effects of a debug build:" msgstr "" -#: ../../using/configure.rst:276 +#: ../../using/configure.rst:292 msgid "" "Display all warnings by default: the list of default warning filters is " "empty in the :mod:`warnings` module." msgstr "" -#: ../../using/configure.rst:278 +#: ../../using/configure.rst:294 msgid "Add ``d`` to :data:`sys.abiflags`." msgstr "" -#: ../../using/configure.rst:279 +#: ../../using/configure.rst:295 msgid "Add :func:`sys.gettotalrefcount` function." msgstr "" -#: ../../using/configure.rst:280 +#: ../../using/configure.rst:296 msgid "Add :option:`-X showrefcount <-X>` command line option." msgstr "" -#: ../../using/configure.rst:281 +#: ../../using/configure.rst:297 msgid "Add :envvar:`PYTHONTHREADDEBUG` environment variable." msgstr "" -#: ../../using/configure.rst:282 +#: ../../using/configure.rst:298 msgid "" "Add support for the ``__lltrace__`` variable: enable low-level tracing in " "the bytecode evaluation loop if the variable is defined." msgstr "" -#: ../../using/configure.rst:284 +#: ../../using/configure.rst:300 msgid "" "Install :ref:`debug hooks on memory allocators ` " "to detect buffer overflow and other memory errors." msgstr "" -#: ../../using/configure.rst:286 +#: ../../using/configure.rst:302 msgid "Define ``Py_DEBUG`` and ``Py_REF_DEBUG`` macros." msgstr "" -#: ../../using/configure.rst:287 +#: ../../using/configure.rst:303 msgid "" "Add runtime checks: code surrounded by ``#ifdef Py_DEBUG`` and ``#endif``. " "Enable ``assert(...)`` and ``_PyObject_ASSERT(...)`` assertions: don't set " @@ -425,45 +451,45 @@ msgid "" "option). Main runtime checks:" msgstr "" -#: ../../using/configure.rst:292 +#: ../../using/configure.rst:308 msgid "Add sanity checks on the function arguments." msgstr "" -#: ../../using/configure.rst:293 +#: ../../using/configure.rst:309 msgid "" "Unicode and int objects are created with their memory filled with a pattern " "to detect usage of uninitialized objects." msgstr "" -#: ../../using/configure.rst:295 +#: ../../using/configure.rst:311 msgid "" "Ensure that functions which can clear or replace the current exception are " "not called with an exception raised." msgstr "" -#: ../../using/configure.rst:297 +#: ../../using/configure.rst:313 msgid "Check that deallocator functions don't change the current exception." msgstr "" -#: ../../using/configure.rst:298 +#: ../../using/configure.rst:314 msgid "" "The garbage collector (:func:`gc.collect` function) runs some basic checks " "on objects consistency." msgstr "" -#: ../../using/configure.rst:300 +#: ../../using/configure.rst:316 msgid "" "The :c:macro:`Py_SAFE_DOWNCAST()` macro checks for integer underflow and " "overflow when downcasting from wide types to narrow types." msgstr "" -#: ../../using/configure.rst:303 +#: ../../using/configure.rst:319 msgid "" "See also the :ref:`Python Development Mode ` and the :option:`--" "with-trace-refs` configure option." msgstr "" -#: ../../using/configure.rst:306 +#: ../../using/configure.rst:322 msgid "" "Release builds and debug builds are now ABI compatible: defining the " "``Py_DEBUG`` macro no longer implies the ``Py_TRACE_REFS`` macro (see the :" @@ -471,326 +497,326 @@ msgid "" "incompatibility." msgstr "" -#: ../../using/configure.rst:314 +#: ../../using/configure.rst:330 msgid "Debug options" msgstr "" -#: ../../using/configure.rst:318 +#: ../../using/configure.rst:334 msgid "" ":ref:`Build Python in debug mode `: define the ``Py_DEBUG`` " "macro (disabled by default)." msgstr "" -#: ../../using/configure.rst:323 +#: ../../using/configure.rst:339 msgid "Enable tracing references for debugging purpose (disabled by default)." msgstr "" -#: ../../using/configure.rst:325 +#: ../../using/configure.rst:341 msgid "Effects:" msgstr "" -#: ../../using/configure.rst:327 +#: ../../using/configure.rst:343 msgid "Define the ``Py_TRACE_REFS`` macro." msgstr "" -#: ../../using/configure.rst:328 +#: ../../using/configure.rst:344 msgid "Add :func:`sys.getobjects` function." msgstr "" -#: ../../using/configure.rst:329 +#: ../../using/configure.rst:345 msgid "Add :envvar:`PYTHONDUMPREFS` environment variable." msgstr "" -#: ../../using/configure.rst:331 +#: ../../using/configure.rst:347 msgid "" "This build is not ABI compatible with release build (default build) or debug " "build (``Py_DEBUG`` and ``Py_REF_DEBUG`` macros)." msgstr "" -#: ../../using/configure.rst:338 +#: ../../using/configure.rst:354 msgid "" "Build with C assertions enabled (default is no): ``assert(...);`` and " "``_PyObject_ASSERT(...);``." msgstr "" -#: ../../using/configure.rst:341 +#: ../../using/configure.rst:357 msgid "" "If set, the ``NDEBUG`` macro is not defined in the :envvar:`OPT` compiler " "variable." msgstr "" -#: ../../using/configure.rst:344 +#: ../../using/configure.rst:360 msgid "" "See also the :option:`--with-pydebug` option (:ref:`debug build `) which also enables assertions." msgstr "" -#: ../../using/configure.rst:351 +#: ../../using/configure.rst:367 msgid "Enable Valgrind support (default is no)." msgstr "" -#: ../../using/configure.rst:355 +#: ../../using/configure.rst:371 msgid "Enable DTrace support (default is no)." msgstr "" -#: ../../using/configure.rst:357 +#: ../../using/configure.rst:373 msgid "" "See :ref:`Instrumenting CPython with DTrace and SystemTap `." msgstr "" -#: ../../using/configure.rst:364 +#: ../../using/configure.rst:380 msgid "" "Enable AddressSanitizer memory error detector, ``asan`` (default is no)." msgstr "" -#: ../../using/configure.rst:370 +#: ../../using/configure.rst:386 msgid "" "Enable MemorySanitizer allocation error detector, ``msan`` (default is no)." msgstr "" -#: ../../using/configure.rst:376 +#: ../../using/configure.rst:392 msgid "" "Enable UndefinedBehaviorSanitizer undefined behaviour detector, ``ubsan`` " "(default is no)." msgstr "" -#: ../../using/configure.rst:383 +#: ../../using/configure.rst:399 msgid "Linker options" msgstr "" -#: ../../using/configure.rst:387 +#: ../../using/configure.rst:403 msgid "Enable building a shared Python library: ``libpython`` (default is no)." msgstr "" -#: ../../using/configure.rst:391 +#: ../../using/configure.rst:407 msgid "" "Do not build ``libpythonMAJOR.MINOR.a`` and do not install ``python.o`` " "(built and enabled by default)." msgstr "" -#: ../../using/configure.rst:398 +#: ../../using/configure.rst:414 msgid "Libraries options" msgstr "" -#: ../../using/configure.rst:402 +#: ../../using/configure.rst:418 msgid "Link against additional libraries (default is no)." msgstr "" -#: ../../using/configure.rst:406 +#: ../../using/configure.rst:422 msgid "" "Build the :mod:`pyexpat` module using an installed ``expat`` library " "(default is no)." msgstr "" -#: ../../using/configure.rst:411 +#: ../../using/configure.rst:427 msgid "" "Build the :mod:`_ctypes` extension module using an installed ``ffi`` " "library, see the :mod:`ctypes` module (default is system-dependent)." msgstr "" -#: ../../using/configure.rst:416 +#: ../../using/configure.rst:432 msgid "" "Build the ``_decimal`` extension module using an installed ``mpdec`` " "library, see the :mod:`decimal` module (default is no)." msgstr "" -#: ../../using/configure.rst:423 +#: ../../using/configure.rst:439 msgid "Use ``editline`` library for backend of the :mod:`readline` module." msgstr "" -#: ../../using/configure.rst:425 +#: ../../using/configure.rst:441 msgid "Define the ``WITH_EDITLINE`` macro." msgstr "" -#: ../../using/configure.rst:431 +#: ../../using/configure.rst:447 msgid "Don't build the :mod:`readline` module (built by default)." msgstr "" -#: ../../using/configure.rst:433 +#: ../../using/configure.rst:449 msgid "Don't define the ``HAVE_LIBREADLINE`` macro." msgstr "" -#: ../../using/configure.rst:439 +#: ../../using/configure.rst:455 msgid "" "Override ``libm`` math library to *STRING* (default is system-dependent)." msgstr "" -#: ../../using/configure.rst:443 +#: ../../using/configure.rst:459 msgid "Override ``libc`` C library to *STRING* (default is system-dependent)." msgstr "" -#: ../../using/configure.rst:447 +#: ../../using/configure.rst:463 msgid "Root of the OpenSSL directory." msgstr "" -#: ../../using/configure.rst:453 +#: ../../using/configure.rst:469 msgid "Set runtime library directory (rpath) for OpenSSL libraries:" msgstr "" -#: ../../using/configure.rst:455 +#: ../../using/configure.rst:471 msgid "``no`` (default): don't set rpath;" msgstr "" -#: ../../using/configure.rst:456 +#: ../../using/configure.rst:472 msgid "" "``auto``: auto-detect rpath from :option:`--with-openssl` and ``pkg-config``;" msgstr "" -#: ../../using/configure.rst:458 +#: ../../using/configure.rst:474 msgid "*DIR*: set an explicit rpath." msgstr "" -#: ../../using/configure.rst:464 +#: ../../using/configure.rst:480 msgid "Security Options" msgstr "" -#: ../../using/configure.rst:468 +#: ../../using/configure.rst:484 msgid "Select hash algorithm for use in ``Python/pyhash.c``:" msgstr "" -#: ../../using/configure.rst:470 +#: ../../using/configure.rst:486 msgid "``siphash13`` (default);" msgstr "" -#: ../../using/configure.rst:471 +#: ../../using/configure.rst:487 msgid "``siphash24``;" msgstr "" -#: ../../using/configure.rst:472 +#: ../../using/configure.rst:488 msgid "``fnv``." msgstr "" -#: ../../using/configure.rst:476 +#: ../../using/configure.rst:492 msgid "``siphash13`` is added and it is the new default." msgstr "" -#: ../../using/configure.rst:481 +#: ../../using/configure.rst:497 msgid "Built-in hash modules:" msgstr "" -#: ../../using/configure.rst:483 +#: ../../using/configure.rst:499 msgid "``md5``;" msgstr "``md5``;" -#: ../../using/configure.rst:484 +#: ../../using/configure.rst:500 msgid "``sha1``;" msgstr "``sha1``;" -#: ../../using/configure.rst:485 +#: ../../using/configure.rst:501 msgid "``sha256``;" msgstr "``sha256``;" -#: ../../using/configure.rst:486 +#: ../../using/configure.rst:502 msgid "``sha512``;" msgstr "``sha512``;" -#: ../../using/configure.rst:487 +#: ../../using/configure.rst:503 msgid "``sha3`` (with shake);" msgstr "" -#: ../../using/configure.rst:488 +#: ../../using/configure.rst:504 msgid "``blake2``." msgstr "``blake2``。" -#: ../../using/configure.rst:494 +#: ../../using/configure.rst:510 msgid "Override the OpenSSL default cipher suites string:" msgstr "" -#: ../../using/configure.rst:496 +#: ../../using/configure.rst:512 msgid "``python`` (default): use Python's preferred selection;" msgstr "" -#: ../../using/configure.rst:497 +#: ../../using/configure.rst:513 msgid "``openssl``: leave OpenSSL's defaults untouched;" msgstr "" -#: ../../using/configure.rst:498 +#: ../../using/configure.rst:514 msgid "*STRING*: use a custom string" msgstr "" -#: ../../using/configure.rst:500 +#: ../../using/configure.rst:516 msgid "See the :mod:`ssl` module." msgstr "" -#: ../../using/configure.rst:506 +#: ../../using/configure.rst:522 msgid "" "The settings ``python`` and *STRING* also set TLS 1.2 as minimum protocol " "version." msgstr "" -#: ../../using/configure.rst:510 +#: ../../using/configure.rst:526 msgid "macOS Options" msgstr "" -#: ../../using/configure.rst:512 +#: ../../using/configure.rst:528 msgid "See ``Mac/README.rst``." msgstr "參閱 ``Mac/README.rst``\\ 。" -#: ../../using/configure.rst:517 +#: ../../using/configure.rst:533 msgid "" "Create a universal binary build. *SDKDIR* specifies which macOS SDK should " "be used to perform the build (default is no)." msgstr "" -#: ../../using/configure.rst:523 +#: ../../using/configure.rst:539 msgid "" "Create a Python.framework rather than a traditional Unix install. Optional " "*INSTALLDIR* specifies the installation path (default is no)." msgstr "" -#: ../../using/configure.rst:528 +#: ../../using/configure.rst:544 msgid "" "Specify the kind of universal binary that should be created. This option is " "only valid when :option:`--enable-universalsdk` is set." msgstr "" -#: ../../using/configure.rst:531 +#: ../../using/configure.rst:547 msgid "Options:" msgstr "" -#: ../../using/configure.rst:533 +#: ../../using/configure.rst:549 msgid "``universal2``;" msgstr "``universal2``;" -#: ../../using/configure.rst:534 +#: ../../using/configure.rst:550 msgid "``32-bit``;" msgstr "``32-bit``;" -#: ../../using/configure.rst:535 +#: ../../using/configure.rst:551 msgid "``64-bit``;" msgstr "``64-bit``;" -#: ../../using/configure.rst:536 +#: ../../using/configure.rst:552 msgid "``3-way``;" msgstr "``3-way``;" -#: ../../using/configure.rst:537 +#: ../../using/configure.rst:553 msgid "``intel``;" msgstr "``intel``;" -#: ../../using/configure.rst:538 +#: ../../using/configure.rst:554 msgid "``intel-32``;" msgstr "``intel-32``;" -#: ../../using/configure.rst:539 +#: ../../using/configure.rst:555 msgid "``intel-64``;" msgstr "``intel-64``;" -#: ../../using/configure.rst:540 +#: ../../using/configure.rst:556 msgid "``all``." msgstr "``all``。" -#: ../../using/configure.rst:544 +#: ../../using/configure.rst:560 msgid "" "Specify the name for the python framework on macOS only valid when :option:" "`--enable-framework` is set (default: ``Python``)." msgstr "" -#: ../../using/configure.rst:549 +#: ../../using/configure.rst:565 msgid "Cross Compiling Options" msgstr "" -#: ../../using/configure.rst:551 +#: ../../using/configure.rst:567 msgid "" "Cross compiling, also known as cross building, can be used to build Python " "for another CPU architecture or platform. Cross compiling requires a Python " @@ -798,101 +824,101 @@ msgid "" "match the version of the cross compiled host Python." msgstr "" -#: ../../using/configure.rst:558 +#: ../../using/configure.rst:574 msgid "" "configure for building on BUILD, usually guessed by :program:`config.guess`." msgstr "" -#: ../../using/configure.rst:562 +#: ../../using/configure.rst:578 msgid "cross-compile to build programs to run on HOST (target platform)" msgstr "" -#: ../../using/configure.rst:566 +#: ../../using/configure.rst:582 msgid "path to build ``python`` binary for cross compiling" msgstr "" -#: ../../using/configure.rst:572 +#: ../../using/configure.rst:588 msgid "An environment variable that points to a file with configure overrides." msgstr "" -#: ../../using/configure.rst:574 +#: ../../using/configure.rst:590 msgid "Example *config.site* file::" msgstr "" -#: ../../using/configure.rst:582 +#: ../../using/configure.rst:598 msgid "Cross compiling example::" msgstr "" -#: ../../using/configure.rst:591 +#: ../../using/configure.rst:607 msgid "Python Build System" msgstr "" -#: ../../using/configure.rst:594 +#: ../../using/configure.rst:610 msgid "Main files of the build system" msgstr "" -#: ../../using/configure.rst:596 +#: ../../using/configure.rst:612 msgid ":file:`configure.ac` => :file:`configure`;" msgstr ":file:`configure.ac` => :file:`configure`\\ ;" -#: ../../using/configure.rst:597 +#: ../../using/configure.rst:613 msgid "" ":file:`Makefile.pre.in` => :file:`Makefile` (created by :file:`configure`);" msgstr "" -#: ../../using/configure.rst:598 +#: ../../using/configure.rst:614 msgid ":file:`pyconfig.h` (created by :file:`configure`);" msgstr ":file:`pyconfig.h` (created by :file:`configure`)\\ ;" -#: ../../using/configure.rst:599 +#: ../../using/configure.rst:615 msgid "" ":file:`Modules/Setup`: C extensions built by the Makefile using :file:" "`Module/makesetup` shell script;" msgstr "" -#: ../../using/configure.rst:601 +#: ../../using/configure.rst:617 msgid ":file:`setup.py`: C extensions built using the :mod:`distutils` module." msgstr "" -#: ../../using/configure.rst:604 +#: ../../using/configure.rst:620 msgid "Main build steps" msgstr "" -#: ../../using/configure.rst:606 +#: ../../using/configure.rst:622 msgid "C files (``.c``) are built as object files (``.o``)." msgstr "" -#: ../../using/configure.rst:607 +#: ../../using/configure.rst:623 msgid "A static ``libpython`` library (``.a``) is created from objects files." msgstr "" -#: ../../using/configure.rst:608 +#: ../../using/configure.rst:624 msgid "" "``python.o`` and the static ``libpython`` library are linked into the final " "``python`` program." msgstr "" -#: ../../using/configure.rst:610 +#: ../../using/configure.rst:626 msgid "" "C extensions are built by the Makefile (see :file:`Modules/Setup`) and " "``python setup.py build``." msgstr "" -#: ../../using/configure.rst:614 +#: ../../using/configure.rst:630 msgid "Main Makefile targets" msgstr "" -#: ../../using/configure.rst:616 +#: ../../using/configure.rst:632 msgid "``make``: Build Python with the standard library." msgstr "" -#: ../../using/configure.rst:617 +#: ../../using/configure.rst:633 msgid "" "``make platform:``: build the ``python`` program, but don't build the " "standard library extension modules." msgstr "" -#: ../../using/configure.rst:619 +#: ../../using/configure.rst:635 msgid "" "``make profile-opt``: build Python using Profile Guided Optimization (PGO). " "You can use the configure :option:`--enable-optimizations` option to make " @@ -900,53 +926,53 @@ msgid "" "``make``)." msgstr "" -#: ../../using/configure.rst:623 +#: ../../using/configure.rst:639 msgid "" "``make buildbottest``: Build Python and run the Python test suite, the same " "way than buildbots test Python. Set ``TESTTIMEOUT`` variable (in seconds) to " "change the test timeout (1200 by default: 20 minutes)." msgstr "" -#: ../../using/configure.rst:626 +#: ../../using/configure.rst:642 msgid "``make install``: Build and install Python." msgstr "" -#: ../../using/configure.rst:627 +#: ../../using/configure.rst:643 msgid "" "``make regen-all``: Regenerate (almost) all generated files; ``make regen-" "stdlib-module-names`` and ``autoconf`` must be run separately for the " "remaining generated files." msgstr "" -#: ../../using/configure.rst:630 +#: ../../using/configure.rst:646 msgid "``make clean``: Remove built files." msgstr "" -#: ../../using/configure.rst:631 +#: ../../using/configure.rst:647 msgid "" "``make distclean``: Same than ``make clean``, but remove also files created " "by the configure script." msgstr "" -#: ../../using/configure.rst:635 +#: ../../using/configure.rst:651 msgid "C extensions" msgstr "" -#: ../../using/configure.rst:637 +#: ../../using/configure.rst:653 msgid "" "Some C extensions are built as built-in modules, like the ``sys`` module. " "They are built with the ``Py_BUILD_CORE_BUILTIN`` macro defined. Built-in " "modules have no ``__file__`` attribute::" msgstr "" -#: ../../using/configure.rst:649 +#: ../../using/configure.rst:665 msgid "" "Other C extensions are built as dynamic libraries, like the ``_asyncio`` " "module. They are built with the ``Py_BUILD_CORE_MODULE`` macro defined. " "Example on Linux x86-64::" msgstr "" -#: ../../using/configure.rst:659 +#: ../../using/configure.rst:675 msgid "" ":file:`Modules/Setup` is used to generate Makefile targets to build C " "extensions. At the beginning of the files, C extensions are built as built-" @@ -954,322 +980,322 @@ msgid "" "dynamic libraries." msgstr "" -#: ../../using/configure.rst:663 +#: ../../using/configure.rst:679 msgid "" "The :file:`setup.py` script only builds C extensions as shared libraries " "using the :mod:`distutils` module." msgstr "" -#: ../../using/configure.rst:666 +#: ../../using/configure.rst:682 msgid "" "The :c:macro:`PyAPI_FUNC()`, :c:macro:`PyAPI_API()` and :c:macro:" "`PyMODINIT_FUNC()` macros of :file:`Include/pyport.h` are defined " "differently depending if the ``Py_BUILD_CORE_MODULE`` macro is defined:" msgstr "" -#: ../../using/configure.rst:670 +#: ../../using/configure.rst:686 msgid "Use ``Py_EXPORTED_SYMBOL`` if the ``Py_BUILD_CORE_MODULE`` is defined" msgstr "" -#: ../../using/configure.rst:671 +#: ../../using/configure.rst:687 msgid "Use ``Py_IMPORTED_SYMBOL`` otherwise." msgstr "" -#: ../../using/configure.rst:673 +#: ../../using/configure.rst:689 msgid "" "If the ``Py_BUILD_CORE_BUILTIN`` macro is used by mistake on a C extension " "built as a shared library, its ``PyInit_xxx()`` function is not exported, " "causing an :exc:`ImportError` on import." msgstr "" -#: ../../using/configure.rst:679 +#: ../../using/configure.rst:695 msgid "Compiler and linker flags" msgstr "" -#: ../../using/configure.rst:681 +#: ../../using/configure.rst:697 msgid "" "Options set by the ``./configure`` script and environment variables and used " "by ``Makefile``." msgstr "" -#: ../../using/configure.rst:685 +#: ../../using/configure.rst:701 msgid "Preprocessor flags" msgstr "" -#: ../../using/configure.rst:689 +#: ../../using/configure.rst:705 msgid "" "Value of :envvar:`CPPFLAGS` variable passed to the ``./configure`` script." msgstr "" -#: ../../using/configure.rst:695 +#: ../../using/configure.rst:711 msgid "" "(Objective) C/C++ preprocessor flags, e.g. ``-I`` if you have " "headers in a nonstandard directory ````." msgstr "" -#: ../../using/configure.rst:698 ../../using/configure.rst:893 +#: ../../using/configure.rst:714 ../../using/configure.rst:909 msgid "" "Both :envvar:`CPPFLAGS` and :envvar:`LDFLAGS` need to contain the shell's " "value for setup.py to be able to build extension modules using the " "directories specified in the environment variables." msgstr "" -#: ../../using/configure.rst:708 +#: ../../using/configure.rst:724 msgid "" "Extra preprocessor flags added for building the interpreter object files." msgstr "" -#: ../../using/configure.rst:710 +#: ../../using/configure.rst:726 msgid "" "Default: ``$(BASECPPFLAGS) -I. -I$(srcdir)/Include $(CONFIGURE_CPPFLAGS) " "$(CPPFLAGS)``." msgstr "" -#: ../../using/configure.rst:715 +#: ../../using/configure.rst:731 msgid "Compiler flags" msgstr "" -#: ../../using/configure.rst:719 +#: ../../using/configure.rst:735 msgid "C compiler command." msgstr "" -#: ../../using/configure.rst:721 +#: ../../using/configure.rst:737 msgid "Example: ``gcc -pthread``." msgstr "" -#: ../../using/configure.rst:725 +#: ../../using/configure.rst:741 msgid "" "C compiler command used to build the ``main()`` function of programs like " "``python``." msgstr "" -#: ../../using/configure.rst:728 +#: ../../using/configure.rst:744 msgid "" "Variable set by the :option:`--with-cxx-main` option of the configure script." msgstr "" -#: ../../using/configure.rst:731 +#: ../../using/configure.rst:747 msgid "Default: ``$(CC)``." msgstr "" -#: ../../using/configure.rst:735 +#: ../../using/configure.rst:751 msgid "C++ compiler command." msgstr "" -#: ../../using/configure.rst:737 +#: ../../using/configure.rst:753 msgid "Used if the :option:`--with-cxx-main` option is used." msgstr "" -#: ../../using/configure.rst:739 +#: ../../using/configure.rst:755 msgid "Example: ``g++ -pthread``." msgstr "" -#: ../../using/configure.rst:743 +#: ../../using/configure.rst:759 msgid "C compiler flags." msgstr "" -#: ../../using/configure.rst:747 +#: ../../using/configure.rst:763 msgid "" ":envvar:`CFLAGS_NODIST` is used for building the interpreter and stdlib C " "extensions. Use it when a compiler flag should *not* be part of the " "distutils :envvar:`CFLAGS` once Python is installed (:issue:`21121`)." msgstr "" -#: ../../using/configure.rst:751 +#: ../../using/configure.rst:767 msgid "In particular, :envvar:`CFLAGS` should not contain:" msgstr "" -#: ../../using/configure.rst:753 +#: ../../using/configure.rst:769 msgid "" "the compiler flag ``-I`` (for setting the search path for include files). " "The ``-I`` flags are processed from left to right, and any flags in :envvar:" "`CFLAGS` would take precedence over user- and package-supplied ``-I`` flags." msgstr "" -#: ../../using/configure.rst:758 +#: ../../using/configure.rst:774 msgid "" "hardening flags such as ``-Werror`` because distributions cannot control " "whether packages installed by users conform to such heightened standards." msgstr "" -#: ../../using/configure.rst:766 +#: ../../using/configure.rst:782 msgid "Extra C compiler flags." msgstr "" -#: ../../using/configure.rst:770 +#: ../../using/configure.rst:786 msgid "" "Value of :envvar:`CFLAGS` variable passed to the ``./configure`` script." msgstr "" -#: ../../using/configure.rst:777 +#: ../../using/configure.rst:793 msgid "" "Value of :envvar:`CFLAGS_NODIST` variable passed to the ``./configure`` " "script." msgstr "" -#: ../../using/configure.rst:784 +#: ../../using/configure.rst:800 msgid "Base compiler flags." msgstr "" -#: ../../using/configure.rst:788 +#: ../../using/configure.rst:804 msgid "Optimization flags." msgstr "" -#: ../../using/configure.rst:792 +#: ../../using/configure.rst:808 msgid "Strict or non-strict aliasing flags used to compile ``Python/dtoa.c``." msgstr "" -#: ../../using/configure.rst:798 +#: ../../using/configure.rst:814 msgid "Compiler flags used to build a shared library." msgstr "" -#: ../../using/configure.rst:800 +#: ../../using/configure.rst:816 msgid "For example, ``-fPIC`` is used on Linux and on BSD." msgstr "例如說 ``-fPIC`` 被使用於 Linux 與 BSD 上。" -#: ../../using/configure.rst:804 +#: ../../using/configure.rst:820 msgid "Extra C flags added for building the interpreter object files." msgstr "" -#: ../../using/configure.rst:806 +#: ../../using/configure.rst:822 msgid "" "Default: ``$(CCSHARED)`` when :option:`--enable-shared` is used, or an empty " "string otherwise." msgstr "" -#: ../../using/configure.rst:811 +#: ../../using/configure.rst:827 msgid "" "Default: ``$(BASECFLAGS) $(OPT) $(CONFIGURE_CFLAGS) $(CFLAGS) " "$(EXTRA_CFLAGS)``." msgstr "" -#: ../../using/configure.rst:815 +#: ../../using/configure.rst:831 msgid "" "Default: ``$(CONFIGURE_CFLAGS_NODIST) $(CFLAGS_NODIST) -I$(srcdir)/Include/" "internal``." msgstr "" -#: ../../using/configure.rst:821 +#: ../../using/configure.rst:837 msgid "C flags used for building the interpreter object files." msgstr "" -#: ../../using/configure.rst:823 +#: ../../using/configure.rst:839 msgid "" "Default: ``$(PY_CFLAGS) $(PY_CFLAGS_NODIST) $(PY_CPPFLAGS) " "$(CFLAGSFORSHARED)``." msgstr "" -#: ../../using/configure.rst:829 +#: ../../using/configure.rst:845 msgid "Default: ``$(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE``." msgstr "" -#: ../../using/configure.rst:835 +#: ../../using/configure.rst:851 msgid "" "Compiler flags to build a standard library extension module as a built-in " "module, like the :mod:`posix` module." msgstr "" -#: ../../using/configure.rst:838 +#: ../../using/configure.rst:854 msgid "Default: ``$(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN``." msgstr "" -#: ../../using/configure.rst:844 +#: ../../using/configure.rst:860 msgid "Purify command. Purify is a memory debugger program." msgstr "" -#: ../../using/configure.rst:846 +#: ../../using/configure.rst:862 msgid "Default: empty string (not used)." msgstr "" -#: ../../using/configure.rst:850 +#: ../../using/configure.rst:866 msgid "Linker flags" msgstr "" -#: ../../using/configure.rst:854 +#: ../../using/configure.rst:870 msgid "" "Linker command used to build programs like ``python`` and ``_testembed``." msgstr "" -#: ../../using/configure.rst:856 +#: ../../using/configure.rst:872 msgid "Default: ``$(PURIFY) $(MAINCC)``." msgstr "" -#: ../../using/configure.rst:860 +#: ../../using/configure.rst:876 msgid "" "Value of :envvar:`LDFLAGS` variable passed to the ``./configure`` script." msgstr "" -#: ../../using/configure.rst:862 +#: ../../using/configure.rst:878 msgid "" "Avoid assigning :envvar:`CFLAGS`, :envvar:`LDFLAGS`, etc. so users can use " "them on the command line to append to these values without stomping the pre-" "set values." msgstr "" -#: ../../using/configure.rst:870 +#: ../../using/configure.rst:886 msgid "" ":envvar:`LDFLAGS_NODIST` is used in the same manner as :envvar:" "`CFLAGS_NODIST`. Use it when a linker flag should *not* be part of the " "distutils :envvar:`LDFLAGS` once Python is installed (:issue:`35257`)." msgstr "" -#: ../../using/configure.rst:874 +#: ../../using/configure.rst:890 msgid "In particular, :envvar:`LDFLAGS` should not contain:" msgstr "" -#: ../../using/configure.rst:876 +#: ../../using/configure.rst:892 msgid "" "the compiler flag ``-L`` (for setting the search path for libraries). The ``-" "L`` flags are processed from left to right, and any flags in :envvar:" "`LDFLAGS` would take precedence over user- and package-supplied ``-L`` flags." msgstr "" -#: ../../using/configure.rst:883 +#: ../../using/configure.rst:899 msgid "" "Value of :envvar:`LDFLAGS_NODIST` variable passed to the ``./configure`` " "script." msgstr "" -#: ../../using/configure.rst:890 +#: ../../using/configure.rst:906 msgid "" "Linker flags, e.g. ``-L`` if you have libraries in a nonstandard " "directory ````." msgstr "" -#: ../../using/configure.rst:899 +#: ../../using/configure.rst:915 msgid "" "Linker flags to pass libraries to the linker when linking the Python " "executable." msgstr "" -#: ../../using/configure.rst:902 +#: ../../using/configure.rst:918 msgid "Example: ``-lrt``." msgstr "" -#: ../../using/configure.rst:906 +#: ../../using/configure.rst:922 msgid "Command to build a shared library." msgstr "" -#: ../../using/configure.rst:908 +#: ../../using/configure.rst:924 msgid "Default: ``@LDSHARED@ $(PY_LDFLAGS)``." msgstr "" -#: ../../using/configure.rst:912 +#: ../../using/configure.rst:928 msgid "Command to build ``libpython`` shared library." msgstr "" -#: ../../using/configure.rst:914 +#: ../../using/configure.rst:930 msgid "Default: ``@BLDSHARED@ $(PY_CORE_LDFLAGS)``." msgstr "" -#: ../../using/configure.rst:918 +#: ../../using/configure.rst:934 msgid "Default: ``$(CONFIGURE_LDFLAGS) $(LDFLAGS)``." msgstr "" -#: ../../using/configure.rst:922 +#: ../../using/configure.rst:938 msgid "Default: ``$(CONFIGURE_LDFLAGS_NODIST) $(LDFLAGS_NODIST)``." msgstr "" -#: ../../using/configure.rst:928 +#: ../../using/configure.rst:944 msgid "Linker flags used for building the interpreter object files." msgstr "" diff --git a/using/unix.po b/using/unix.po index 12fdee43c8..eb1c27b679 100644 --- a/using/unix.po +++ b/using/unix.po @@ -1,14 +1,14 @@ -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2023, Python Software Foundation # This file is distributed under the same license as the Python package. # # Translators: -# Matt Wang , 2022 +# Matt Wang , 2022-2023 msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" -"PO-Revision-Date: 2022-10-31 16:31+0800\n" +"POT-Creation-Date: 2023-03-16 00:18+0000\n" +"PO-Revision-Date: 2023-03-27 12:40+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -17,7 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Poedit 3.1.1\n" +"X-Generator: Poedit 3.2.2\n" #: ../../using/unix.rst:7 msgid "Using Python on Unix platforms" @@ -138,9 +138,9 @@ msgid "" "contribute patches, you will need a clone.)" msgstr "" "如果你想自己編譯 CPython,首先要做的是獲取\\ `原始碼 `_。你可以下載最新版本的原始碼,也可以直接提取最新的 " -"`clone(克隆) `_。(如果你想要貢獻修補程式碼,也會需要一份 clone。)" +"downloads/source/>`_。你可以下載最新版本的原始碼,也可以直接提取最新的 `clone" +"(克隆) `_。(如" +"果你想要貢獻修補程式碼,也會需要一份 clone。)" #: ../../using/unix.rst:75 msgid "The build process consists of the usual commands::" @@ -176,13 +176,12 @@ msgstr "與 Python 相關的路徑和檔案" #: ../../using/unix.rst:95 msgid "" "These are subject to difference depending on local installation " -"conventions; :envvar:`prefix` (``${prefix}``) and :envvar:`exec_prefix` (``" -"${exec_prefix}``) are installation-dependent and should be interpreted as " -"for GNU software; they may be the same." +"conventions; :option:`prefix <--prefix>` and :option:`exec_prefix <--exec-" +"prefix>` are installation-dependent and should be interpreted as for GNU " +"software; they may be the same." msgstr "" -"這取決於本地安裝慣例;:envvar:`prefix` (``${prefix}``) 和 :envvar:" -"`exec_prefix` (``${exec_prefix}``) 相依於安裝方式,應被直譯來讓 GNU 軟體使" -"用;它們也可能相同。" +"這取決於本地安裝慣例;:option:`prefix <--prefix>` 和 :option:`exec_prefix <--" +"exec-prefix>` 相依於安裝方式,應被直譯來讓 GNU 軟體使用;它們也可能相同。" #: ../../using/unix.rst:100 msgid "" diff --git a/whatsnew/3.11.po b/whatsnew/3.11.po index ed81cf3bbd..264b2a171f 100644 --- a/whatsnew/3.11.po +++ b/whatsnew/3.11.po @@ -1,15 +1,15 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2023, Python Software Foundation # This file is distributed under the same license as the Python package. # Translators: -# Matt Wang , 2022 +# Matt Wang , 2022-2023 # msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-03-08 00:17+0000\n" -"PO-Revision-Date: 2023-03-15 11:03+0800\n" +"POT-Creation-Date: 2023-03-23 00:15+0000\n" +"PO-Revision-Date: 2023-03-27 12:47+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -165,7 +165,7 @@ msgid "" "pep670>`" msgstr ":pep:`670`:\\ :ref:`轉換為靜態行內函式的巨集 `" -#: ../../whatsnew/3.11.rst:110 ../../whatsnew/3.11.rst:2207 +#: ../../whatsnew/3.11.rst:110 ../../whatsnew/3.11.rst:2199 msgid "New Features" msgstr "新增特性" @@ -2589,7 +2589,7 @@ msgid "" "in :issue:`40222`.)" msgstr "" "實作了「無代價 (Zero-cost)」的例外,消除了在沒有例外被引發時的 :keyword:" -"`try` 陳述式開銷。(由 Mark Shannon 於 :issue:ˋ40222` 貢獻。)" +"`try` 陳述式開銷。(由 Mark Shannon 於 :issue:`40222` 貢獻。)" #: ../../whatsnew/3.11.rst:1523 msgid "" @@ -2963,7 +2963,7 @@ msgstr "" "刪除 :opcode:`!COPY_DICT_WITHOUT_KEYS`、:opcode:`!GEN_START`、:opcode:`!" "POP_BLOCK`、:opcode:`!SETUP_FINALLY` 和 :opcode:`!YIELD_FROM`。" -#: ../../whatsnew/3.11.rst:1699 ../../whatsnew/3.11.rst:2575 +#: ../../whatsnew/3.11.rst:1699 ../../whatsnew/3.11.rst:2567 msgid "Deprecated" msgstr "已棄用" @@ -3375,7 +3375,7 @@ msgstr ":meth:`unittest.TestLoader.getTestCaseNames`" msgid "(Contributed by Erlend E. Aasland in :issue:`5846`.)" msgstr "(由 Erlend E. Aasland 於 :issue:`5846` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:1874 ../../whatsnew/3.11.rst:2603 +#: ../../whatsnew/3.11.rst:1874 ../../whatsnew/3.11.rst:2595 msgid "Pending Removal in Python 3.12" msgstr "Python 3.12 中待決議的移除項目" @@ -3643,7 +3643,7 @@ msgstr ":meth:`.assertNotRegex`" msgid "3.5" msgstr "3.5" -#: ../../whatsnew/3.11.rst:1937 ../../whatsnew/3.11.rst:2629 +#: ../../whatsnew/3.11.rst:1937 ../../whatsnew/3.11.rst:2621 msgid "Removed" msgstr "已移除" @@ -3866,7 +3866,7 @@ msgstr "" "編輯器 --- 已被移出 ``Tools/scripts``,`獨立開發 `_\\ 於 Python 原始碼之外。" -#: ../../whatsnew/3.11.rst:2043 ../../whatsnew/3.11.rst:2273 +#: ../../whatsnew/3.11.rst:2043 ../../whatsnew/3.11.rst:2265 msgid "Porting to Python 3.11" msgstr "移植至 Python 3.11" @@ -4016,22 +4016,23 @@ msgstr "" "Heimes 在 :gh:`90473` 貢獻;平台在 :gh:`95085` 中推廣)" #: ../../whatsnew/3.11.rst:2119 -msgid "Building Python now requires:" -msgstr "建置 Python 現在必須要有:" +msgid "Building CPython now requires:" +msgstr "建置 CPython 現在必須要有:" #: ../../whatsnew/3.11.rst:2121 msgid "" -"A `C11 `_ compiler. `Optional C11 " -"features `_ compiler and standard library. " +"`Optional C11 features `_ are not required. " -"(Contributed by Victor Stinner in :issue:`46656`.)" +"(Contributed by Victor Stinner in :issue:`46656`, :issue:`45440` and :issue:" +"`46640`.)" msgstr "" -"`C11 `_ 編譯器。`可選的 C11 特性 " -"`_ 編譯器與標準函式庫。`可選的 C11 " +"特性 `_ 並非必要。(由 Victor Stinner " -"於 :issue:`46656` 中貢獻。)" +"於 :issue:`46656`、:issue:`45440` 和 :issue:`46640` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2127 +#: ../../whatsnew/3.11.rst:2128 msgid "" "Support for `IEEE 754 `_ floating " "point numbers. (Contributed by Victor Stinner in :issue:`46917`.)" @@ -4039,40 +4040,24 @@ msgstr "" "對 `IEEE 754 `_ 浮點數的支援(由 " "Victor Stinner 於 :issue:`46917` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2131 +#: ../../whatsnew/3.11.rst:2132 msgid "" -"Support for `floating point Not-a-Number (NaN) `_, as the :c:macro:`!Py_NO_NAN` macro has been " -"removed. (Contributed by Victor Stinner in :issue:`46656`.)" +"The :c:macro:`!Py_NO_NAN` macro has been removed. Since CPython now requires " +"IEEE 754 floats, NaN values are always available. (Contributed by Victor " +"Stinner in :issue:`46656`.)" msgstr "" -"支援\\ `浮點非數字 (floating point NaN) `_,因為 :c:macro:`!Py_NO_NAN` 巨集已被刪除。 (由 Victor " -"Stinner 在 :issue:`46656` 中貢獻。)" +":c:macro:`!Py_NO_NAN` 巨集已被移除。因為 CPython 現在需要 IEEE 754 浮點數," +"NaN 數值皆為可得的。(由 Victor Stinner 在 :issue:`46656` 中貢獻。)" #: ../../whatsnew/3.11.rst:2136 msgid "" -"A `C99 `_ ```` header file " -"providing the :c:func:`!copysign`, :c:func:`!hypot`, :c:func:`!isfinite`, :c:" -"func:`!isinf`, :c:func:`!isnan`, and :c:func:`!round` functions (contributed " -"by Victor Stinner in :issue:`45440`); and a :c:data:`!NAN` constant or the :" -"c:func:`!__builtin_nan` function (Contributed by Victor Stinner in :issue:" -"`46640`)." -msgstr "" -"`C99 `_ ```` 標頭檔提供了 :c:" -"func:`!copysign`、:c:func:`!hypot`、:c:func:`!isfinite`、:c:func:`!isinf`、:" -"c:func:`!isnan` 和 :c:func:`!round` 函數(由 Victor Stinner 在 :issue:" -"`45440` 中貢獻);和一個 :c:data:`!NAN` 常數或 :c:func:`!__builtin_nan` 函式" -"(由 Victor Stinner 在 :issue:`46640` 中貢獻)。" - -#: ../../whatsnew/3.11.rst:2144 -msgid "" "The :mod:`tkinter` package now requires `Tcl/Tk `_ " "version 8.5.12 or newer. (Contributed by Serhiy Storchaka in :issue:`46996`.)" msgstr "" ":mod:`tkinter` 套件現在必須要有 `Tcl/Tk `_ 8.5.12 或更新" "的版本。(由 Serhiy Storchaka 於 :issue:`46996` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2148 +#: ../../whatsnew/3.11.rst:2140 msgid "" "Build dependencies, compiler flags, and linker flags for most stdlib " "extension modules are now detected by :program:`configure`. libffi, libnsl, " @@ -4091,7 +4076,7 @@ msgstr "" "和函式庫的開發設定。(由 Christian Heimes 和 Erlend Egeberg Aasland 在 :" "issue:`45847`、:issue:`45747` 和 :issue:`45763` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2158 +#: ../../whatsnew/3.11.rst:2150 msgid "" "libpython is no longer linked against libcrypt. (Contributed by Mike Gilbert " "in :issue:`45433`.)" @@ -4099,7 +4084,7 @@ msgstr "" "libpython 不再鏈接到 libcrypt。 (由 Mike Gilbert 在 :issue:`45433` 中貢" "獻。)" -#: ../../whatsnew/3.11.rst:2161 +#: ../../whatsnew/3.11.rst:2153 msgid "" "CPython can now be built with the `ThinLTO `_ option via passing ``thin`` to :option:`--with-lto`, i.e. " @@ -4111,7 +4096,7 @@ msgstr "" "html>`_ 選項建置。(由 Dong-hee Na 與 Brett Holman 於 :issue:`44340` 中所貢" "獻。)" -#: ../../whatsnew/3.11.rst:2166 +#: ../../whatsnew/3.11.rst:2158 msgid "" "Freelists for object structs can now be disabled. A new :program:`configure` " "option :option:`!--without-freelists` can be used to disable all freelists " @@ -4122,7 +4107,7 @@ msgstr "" "—without-freelists` 可用於禁用除空元組單例之外的所有空閒列表。(由 Christian " "Heimes 在 :issue:`45522` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2171 +#: ../../whatsnew/3.11.rst:2163 msgid "" "``Modules/Setup`` and ``Modules/makesetup`` have been improved and tied up. " "Extension modules can now be built through ``makesetup``. All except some " @@ -4135,7 +4120,7 @@ msgstr "" "的二進制文件或函式庫中。(由 Brett Cannon 和 Christian Heimes 在 :issue:" "`45548`、:issue:`45570`、:issue:`45571` 和 :issue:`43974` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2178 +#: ../../whatsnew/3.11.rst:2170 msgid "" "Use the environment variables :envvar:`!TCLTK_CFLAGS` and :envvar:`!" "TCLTK_LIBS` to manually specify the location of Tcl/Tk headers and " @@ -4146,7 +4131,7 @@ msgstr "" "Tk 標頭檔和函式庫的位置。:program:`configure` 選項 :option:`!—with-tcltk-" "includes` 和 :option:`!—with-tcltk-libs` 已被刪除。" -#: ../../whatsnew/3.11.rst:2184 +#: ../../whatsnew/3.11.rst:2176 msgid "" "On RHEL 7 and CentOS 7 the development packages do not provide ``tcl.pc`` " "and ``tk.pc``; use ``TCLTK_LIBS=\"-ltk8.5 -ltkstub8.5 -ltcl8.5\"``. The " @@ -4158,7 +4143,7 @@ msgstr "" "pc`` 檔案與如何使用 RHEL 7 和 CentOS 7 的 Tcl/Tk 與 OpenSSL 建置 Python 的指" "示。" -#: ../../whatsnew/3.11.rst:2189 +#: ../../whatsnew/3.11.rst:2181 msgid "" "CPython will now use 30-bit digits by default for the Python :class:`int` " "implementation. Previously, the default was to use 30-bit digits on " @@ -4176,11 +4161,11 @@ msgstr "" "此選項可能會在將來的某個時候被刪除。 (由 Mark Dickinson 在 :issue:`45569` 中" "貢獻。)" -#: ../../whatsnew/3.11.rst:2202 +#: ../../whatsnew/3.11.rst:2194 msgid "C API Changes" msgstr "C API 變更" -#: ../../whatsnew/3.11.rst:2209 +#: ../../whatsnew/3.11.rst:2201 msgid "" "Add a new :c:func:`PyType_GetName` function to get type's short name. " "(Contributed by Hai Shi in :issue:`42035`.)" @@ -4188,7 +4173,7 @@ msgstr "" "新增 :c:func:`PyType_GetName` 函式來取得型別的短名。(由 Hai Shi 於 :issue:" "`42035` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2212 +#: ../../whatsnew/3.11.rst:2204 msgid "" "Add a new :c:func:`PyType_GetQualName` function to get type's qualified " "name. (Contributed by Hai Shi in :issue:`42035`.)" @@ -4196,7 +4181,7 @@ msgstr "" "新增 :c:func:`PyType_GetQualName` 函式來取得型別的合格名稱 (qualified name)。" "(由 Hai Shi 於 :issue:`42035` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2215 +#: ../../whatsnew/3.11.rst:2207 msgid "" "Add new :c:func:`PyThreadState_EnterTracing` and :c:func:" "`PyThreadState_LeaveTracing` functions to the limited C API to suspend and " @@ -4207,7 +4192,7 @@ msgstr "" "c:func:`PyThreadState_LeaveTracing` 函式來中止和繼續追蹤 (tracing) 和性能分" "析 (profiling)。(由 Victor Stinner 於 :issue:`43760` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2220 +#: ../../whatsnew/3.11.rst:2212 msgid "" "Added the :c:data:`Py_Version` constant which bears the same value as :c:" "macro:`PY_VERSION_HEX`. (Contributed by Gabriele N. Tornetta in :issue:" @@ -4216,61 +4201,61 @@ msgstr "" "添加了 :c:data:`Py_Version` 常數,其值與 :c:macro:`PY_VERSION_HEX` 相同。" "(由 Gabriele N. Tornetta 在 :issue:`43931` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2224 +#: ../../whatsnew/3.11.rst:2216 msgid "" ":c:type:`Py_buffer` and APIs are now part of the limited API and the stable " "ABI:" msgstr ":c:type:`Py_buffer` 與 API 目前是受限 API 與穩定 ABI 中的一部分:" -#: ../../whatsnew/3.11.rst:2227 +#: ../../whatsnew/3.11.rst:2219 msgid ":c:func:`PyObject_CheckBuffer`" msgstr ":c:func:`PyObject_CheckBuffer`" -#: ../../whatsnew/3.11.rst:2228 +#: ../../whatsnew/3.11.rst:2220 msgid ":c:func:`PyObject_GetBuffer`" msgstr ":c:func:`PyObject_GetBuffer`" -#: ../../whatsnew/3.11.rst:2229 +#: ../../whatsnew/3.11.rst:2221 msgid ":c:func:`PyBuffer_GetPointer`" msgstr ":c:func:`PyBuffer_GetPointer`" -#: ../../whatsnew/3.11.rst:2230 +#: ../../whatsnew/3.11.rst:2222 msgid ":c:func:`PyBuffer_SizeFromFormat`" msgstr ":c:func:`PyBuffer_SizeFromFormat`" -#: ../../whatsnew/3.11.rst:2231 +#: ../../whatsnew/3.11.rst:2223 msgid ":c:func:`PyBuffer_ToContiguous`" msgstr ":c:func:`PyBuffer_ToContiguous`" -#: ../../whatsnew/3.11.rst:2232 +#: ../../whatsnew/3.11.rst:2224 msgid ":c:func:`PyBuffer_FromContiguous`" msgstr ":c:func:`PyBuffer_FromContiguous`" -#: ../../whatsnew/3.11.rst:2233 +#: ../../whatsnew/3.11.rst:2225 msgid ":c:func:`PyBuffer_CopyData`" msgstr ":c:func:`PyBuffer_CopyData`" -#: ../../whatsnew/3.11.rst:2234 +#: ../../whatsnew/3.11.rst:2226 msgid ":c:func:`PyBuffer_IsContiguous`" msgstr ":c:func:`PyBuffer_IsContiguous`" -#: ../../whatsnew/3.11.rst:2235 +#: ../../whatsnew/3.11.rst:2227 msgid ":c:func:`PyBuffer_FillContiguousStrides`" msgstr ":c:func:`PyBuffer_FillContiguousStrides`" -#: ../../whatsnew/3.11.rst:2236 +#: ../../whatsnew/3.11.rst:2228 msgid ":c:func:`PyBuffer_FillInfo`" msgstr ":c:func:`PyBuffer_FillInfo`" -#: ../../whatsnew/3.11.rst:2237 +#: ../../whatsnew/3.11.rst:2229 msgid ":c:func:`PyBuffer_Release`" msgstr ":c:func:`PyBuffer_Release`" -#: ../../whatsnew/3.11.rst:2238 +#: ../../whatsnew/3.11.rst:2230 msgid ":c:func:`PyMemoryView_FromBuffer`" msgstr ":c:func:`PyMemoryView_FromBuffer`" -#: ../../whatsnew/3.11.rst:2239 +#: ../../whatsnew/3.11.rst:2231 msgid "" ":c:member:`~PyBufferProcs.bf_getbuffer` and :c:member:`~PyBufferProcs." "bf_releasebuffer` type slots" @@ -4278,11 +4263,11 @@ msgstr "" ":c:member:`~PyBufferProcs.bf_getbuffer` 與 :c:member:`~PyBufferProcs." "bf_releasebuffer` 型別插槽 (type slot)" -#: ../../whatsnew/3.11.rst:2242 +#: ../../whatsnew/3.11.rst:2234 msgid "(Contributed by Christian Heimes in :issue:`45459`.)" msgstr "(由 Christian Heimes 於 :issue:`45459` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2244 +#: ../../whatsnew/3.11.rst:2236 msgid "" "Added the :c:data:`PyType_GetModuleByDef` function, used to get the module " "in which a method was defined, in cases where this information is not " @@ -4293,7 +4278,7 @@ msgstr "" "以免這項資訊無法直接被取得(透過 :c:type:`PyCMethod`)。(由 Petr Viktorin " "於 :issue:`46613` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2249 +#: ../../whatsnew/3.11.rst:2241 msgid "" "Add new functions to pack and unpack C double (serialize and deserialize): :" "c:func:`PyFloat_Pack2`, :c:func:`PyFloat_Pack4`, :c:func:`PyFloat_Pack8`, :c:" @@ -4305,7 +4290,7 @@ msgstr "" "`PyFloat_Unpack2` , :c:func:`PyFloat_Unpack4` 和 :c:func:`PyFloat_Unpack8`。" "(由 Victor Stinner 在 :issue:`46906` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2255 +#: ../../whatsnew/3.11.rst:2247 msgid "" "Add new functions to get frame object attributes: :c:func:" "`PyFrame_GetBuiltins`, :c:func:`PyFrame_GetGenerator`, :c:func:" @@ -4315,7 +4300,7 @@ msgstr "" "`PyFrame_GetGenerator`、:c:func:`PyFrame_GetGlobals`、:c:func:" "`PyFrame_GetLasti`。" -#: ../../whatsnew/3.11.rst:2259 +#: ../../whatsnew/3.11.rst:2251 msgid "" "Added two new functions to get and set the active exception instance: :c:" "func:`PyErr_GetHandledException` and :c:func:`PyErr_SetHandledException`. " @@ -4329,7 +4314,7 @@ msgstr "" "例外的遺留三元組表示法一起作用。(由 Irit Katriel 在 :issue:`46343` 中貢" "獻。)" -#: ../../whatsnew/3.11.rst:2266 +#: ../../whatsnew/3.11.rst:2258 msgid "" "Added the :c:member:`PyConfig.safe_path` member. (Contributed by Victor " "Stinner in :gh:`57684`.)" @@ -4337,7 +4322,7 @@ msgstr "" "新增 :c:member:`PyConfig.safe_path` 成員。(由 Victor Stinner 於 :gh:`57684` " "中所貢獻。)" -#: ../../whatsnew/3.11.rst:2277 +#: ../../whatsnew/3.11.rst:2269 msgid "" "Some macros have been converted to static inline functions to avoid `macro " "pitfalls `_. The " @@ -4355,7 +4340,7 @@ msgstr "" "要將引數轉換為他們期望的型別。有關更多詳細資訊,請參閱 :pep:`670`。 (由 " "Victor Stinner 和 Erlend E. Aasland 在 :gh:`89653` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2288 +#: ../../whatsnew/3.11.rst:2280 msgid "" ":c:func:`PyErr_SetExcInfo()` no longer uses the ``type`` and ``traceback`` " "arguments, the interpreter now derives those values from the exception " @@ -4366,7 +4351,7 @@ msgstr "" "現在從例外實例(``value`` 引數)中獲得這些值。該函式仍會偷用這三個引數的參" "照。(由 Irit Katriel 在 :issue:`45711` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2294 +#: ../../whatsnew/3.11.rst:2286 msgid "" ":c:func:`PyErr_GetExcInfo()` now derives the ``type`` and ``traceback`` " "fields of the result from the exception instance (the ``value`` field). " @@ -4376,7 +4361,7 @@ msgstr "" "``type`` 和 ``traceback`` 欄位。(由 Irit Katriel 在 :issue:`45711` 中貢" "獻。)" -#: ../../whatsnew/3.11.rst:2298 +#: ../../whatsnew/3.11.rst:2290 msgid "" ":c:struct:`_frozen` has a new ``is_package`` field to indicate whether or " "not the frozen module is a package. Previously, a negative value in the " @@ -4387,7 +4372,7 @@ msgstr "" "件。以前 ``size`` 欄位中的負值是指標,現在只有非負值可用於 ``size``。 (由 " "Kumar Aditya 在 :issue:`46608` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2304 +#: ../../whatsnew/3.11.rst:2296 msgid "" ":c:func:`_PyFrameEvalFunction` now takes ``_PyInterpreterFrame*`` as its " "second parameter, instead of ``PyFrameObject*``. See :pep:`523` for more " @@ -4397,7 +4382,7 @@ msgstr "" "數,而不是 ``PyFrameObject*``。有關如何使用此函式指標型別的更多詳細資訊,請參" "閱 :pep:`523`。" -#: ../../whatsnew/3.11.rst:2308 +#: ../../whatsnew/3.11.rst:2300 msgid "" ":c:func:`PyCode_New` and :c:func:`PyCode_NewWithPosOnlyArgs` now take an " "additional ``exception_table`` argument. Using these functions should be " @@ -4410,7 +4395,7 @@ msgstr "" "碼物件,使用編譯器建立一個程式碼物件,然後使用 ``replace`` 方法來得到修改後的" "版本。" -#: ../../whatsnew/3.11.rst:2314 +#: ../../whatsnew/3.11.rst:2306 msgid "" ":c:type:`PyCodeObject` no longer has the ``co_code``, ``co_varnames``, " "``co_cellvars`` and ``co_freevars`` fields. Instead, use :c:func:" @@ -4425,7 +4410,7 @@ msgstr "" "和 :c:func:`PyCode_GetFreevars` 來存取。(由 Brandt Bucher 在 :issue:" "`46841`、Ken Jin 在 :gh:`92154` 與 :gh:`94936` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2322 +#: ../../whatsnew/3.11.rst:2314 msgid "" "The old trashcan macros (``Py_TRASHCAN_SAFE_BEGIN``/" "``Py_TRASHCAN_SAFE_END``) are now deprecated. They should be replaced by the " @@ -4435,21 +4420,21 @@ msgstr "" "``Py_TRASHCAN_SAFE_END``) 現在已經被棄用,它們應被新的巨集 " "``Py_TRASHCAN_BEGIN`` 和 ``Py_TRASHCAN_END`` 所取代。" -#: ../../whatsnew/3.11.rst:2326 +#: ../../whatsnew/3.11.rst:2318 msgid "A tp_dealloc function that has the old macros, such as::" msgstr "" "一個用到老舊巨集的 tp_dealloc 函式,像是:\n" "\n" "::" -#: ../../whatsnew/3.11.rst:2337 +#: ../../whatsnew/3.11.rst:2329 msgid "should migrate to the new macros as follows::" msgstr "" "應該要搬遷到新的巨集,如下所示:\n" "\n" "::" -#: ../../whatsnew/3.11.rst:2348 +#: ../../whatsnew/3.11.rst:2340 msgid "" "Note that ``Py_TRASHCAN_BEGIN`` has a second argument which should be the " "deallocation function it is in." @@ -4457,7 +4442,7 @@ msgstr "" "請注意 ``Py_TRASHCAN_BEGIN`` 有第二個引數,它應該是它所在的釋放函數 " "(deallocation function)。" -#: ../../whatsnew/3.11.rst:2351 +#: ../../whatsnew/3.11.rst:2343 msgid "" "To support older Python versions in the same codebase, you can define the " "following macros and use them throughout the code (credit: these were copied " @@ -4468,7 +4453,7 @@ msgstr "" "\n" "::" -#: ../../whatsnew/3.11.rst:2363 +#: ../../whatsnew/3.11.rst:2355 msgid "" "The :c:func:`PyType_Ready` function now raises an error if a type is defined " "with the :const:`Py_TPFLAGS_HAVE_GC` flag set but has no traverse function (:" @@ -4480,7 +4465,7 @@ msgstr "" "`PyType_Ready` 函式現在會引發一個錯誤。(由 Victor Stinner 於 :issue:`44263` " "中貢獻。)" -#: ../../whatsnew/3.11.rst:2368 +#: ../../whatsnew/3.11.rst:2360 msgid "" "Heap types with the :const:`Py_TPFLAGS_IMMUTABLETYPE` flag can now inherit " "the :pep:`590` vectorcall protocol. Previously, this was only possible for :" @@ -4491,7 +4476,7 @@ msgstr "" "向量呼叫協定 (vectorcall protocol)。以前這僅適用於 :ref:`static types " "`。(由 Erlend E. Aasland 在 :issue:`43908` 中貢獻)。" -#: ../../whatsnew/3.11.rst:2373 +#: ../../whatsnew/3.11.rst:2365 msgid "" "Since :c:func:`Py_TYPE()` is changed to a inline static function, " "``Py_TYPE(obj) = new_type`` must be replaced with ``Py_SET_TYPE(obj, " @@ -4503,11 +4488,11 @@ msgstr "" "c:func:`Py_SET_TYPE()` 函式(自 Python 3.9 起可用)。為了向後相容,可以使用這" "個巨集:" -#: ../../whatsnew/3.11.rst:2385 ../../whatsnew/3.11.rst:2399 +#: ../../whatsnew/3.11.rst:2377 ../../whatsnew/3.11.rst:2391 msgid "(Contributed by Victor Stinner in :issue:`39573`.)" msgstr "(由 Victor Stinner 於 :issue:`39573` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2387 +#: ../../whatsnew/3.11.rst:2379 msgid "" "Since :c:func:`Py_SIZE()` is changed to a inline static function, " "``Py_SIZE(obj) = new_size`` must be replaced with ``Py_SET_SIZE(obj, " @@ -4519,7 +4504,7 @@ msgstr "" "`Py_SET_SIZE()` 函式(自 Python 3.9 起可用)。為了向後相容,可以使用這個巨" "集:" -#: ../../whatsnew/3.11.rst:2401 +#: ../../whatsnew/3.11.rst:2393 msgid "" "```` no longer includes the header files ````, ````, ```` and ```` when the ``Py_LIMITED_API`` macro is " @@ -4532,7 +4517,7 @@ msgstr "" "和 ````。C 擴充程式應該要清楚的在 ``#include `` 之後引入" "標頭檔案。(由 Victor Stinner 於 :issue:`45434` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2407 +#: ../../whatsnew/3.11.rst:2399 msgid "" "The non-limited API files ``cellobject.h``, ``classobject.h``, ``code.h``, " "``context.h``, ``funcobject.h``, ``genobject.h`` and ``longintrepr.h`` have " @@ -4549,7 +4534,7 @@ msgstr "" "檔案 `。如果它們已被直接引入,請考慮改為引入 ``Python.h``。 " "(由 Victor Stinner 在 :issue:`35134` 中貢獻。)" -#: ../../whatsnew/3.11.rst:2415 +#: ../../whatsnew/3.11.rst:2407 msgid "" "The :c:func:`PyUnicode_CHECK_INTERNED` macro has been excluded from the " "limited C API. It was never usable there, because it used internal " @@ -4560,7 +4545,7 @@ msgstr "" "使用,因為它使用了受限 C API 不提供的內部結構。(由 Victor Stinner 於 :issue:" "`46007` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2420 +#: ../../whatsnew/3.11.rst:2412 msgid "" "The following frame functions and type are now directly available with " "``#include ``, it's no longer needed to add ``#include " @@ -4569,49 +4554,49 @@ msgstr "" "以下用於幀 (frame) 的函式與型別現在可直接透過 ``#include `` 來使" "用,不必再加上 ``#include ``:" -#: ../../whatsnew/3.11.rst:2424 +#: ../../whatsnew/3.11.rst:2416 msgid ":c:func:`PyFrame_Check`" msgstr ":c:func:`PyFrame_Check`" -#: ../../whatsnew/3.11.rst:2425 +#: ../../whatsnew/3.11.rst:2417 msgid ":c:func:`PyFrame_GetBack`" msgstr ":c:func:`PyFrame_GetBack`" -#: ../../whatsnew/3.11.rst:2426 +#: ../../whatsnew/3.11.rst:2418 msgid ":c:func:`PyFrame_GetBuiltins`" msgstr ":c:func:`PyFrame_GetBuiltins`" -#: ../../whatsnew/3.11.rst:2427 +#: ../../whatsnew/3.11.rst:2419 msgid ":c:func:`PyFrame_GetGenerator`" msgstr ":c:func:`PyFrame_GetGenerator`" -#: ../../whatsnew/3.11.rst:2428 +#: ../../whatsnew/3.11.rst:2420 msgid ":c:func:`PyFrame_GetGlobals`" msgstr ":c:func:`PyFrame_GetGlobals`" -#: ../../whatsnew/3.11.rst:2429 +#: ../../whatsnew/3.11.rst:2421 msgid ":c:func:`PyFrame_GetLasti`" msgstr ":c:func:`PyFrame_GetLasti`" -#: ../../whatsnew/3.11.rst:2430 +#: ../../whatsnew/3.11.rst:2422 msgid ":c:func:`PyFrame_GetLocals`" msgstr ":c:func:`PyFrame_GetLocals`" -#: ../../whatsnew/3.11.rst:2431 +#: ../../whatsnew/3.11.rst:2423 msgid ":c:type:`PyFrame_Type`" msgstr ":c:type:`PyFrame_Type`" -#: ../../whatsnew/3.11.rst:2433 +#: ../../whatsnew/3.11.rst:2425 msgid "(Contributed by Victor Stinner in :gh:`93937`.)" msgstr "(由 Victor Stinner 於 :gh:`93937` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2437 +#: ../../whatsnew/3.11.rst:2429 msgid "" "The :c:type:`PyFrameObject` structure members have been removed from the " "public C API." msgstr ":c:type:`PyFrameObject` 結構成員已經從公開的 C API 中移除。" -#: ../../whatsnew/3.11.rst:2440 +#: ../../whatsnew/3.11.rst:2432 msgid "" "While the documentation notes that the :c:type:`PyFrameObject` fields are " "subject to change at any time, they have been stable for a long time and " @@ -4620,7 +4605,7 @@ msgstr "" "雖然文件指出 :c:type:`PyFrameObject` 欄位隨時可能發生變化,但它們已經穩定了很" "長時間,並被用於幾個流行的擴充套件中。" -#: ../../whatsnew/3.11.rst:2444 +#: ../../whatsnew/3.11.rst:2436 msgid "" "In Python 3.11, the frame struct was reorganized to allow performance " "optimizations. Some fields were removed entirely, as they were details of " @@ -4629,39 +4614,39 @@ msgstr "" "Python 3.11 中,幀的結構被重新編制來為性能做最佳化,有些作為舊版實作細節的欄" "位被整個移除。" -#: ../../whatsnew/3.11.rst:2448 +#: ../../whatsnew/3.11.rst:2440 msgid ":c:type:`PyFrameObject` fields:" msgstr ":c:type:`PyFrameObject` 欄位:" -#: ../../whatsnew/3.11.rst:2450 +#: ../../whatsnew/3.11.rst:2442 msgid "``f_back``: use :c:func:`PyFrame_GetBack`." msgstr "``f_back``:使用 :c:func:`PyFrame_GetBack`。" -#: ../../whatsnew/3.11.rst:2451 +#: ../../whatsnew/3.11.rst:2443 msgid "``f_blockstack``: removed." msgstr "``f_blockstack``:已移除。" -#: ../../whatsnew/3.11.rst:2452 +#: ../../whatsnew/3.11.rst:2444 msgid "``f_builtins``: use :c:func:`PyFrame_GetBuiltins`." msgstr "``f_builtins``:使用 :c:func:`PyFrame_GetBuiltins`。" -#: ../../whatsnew/3.11.rst:2453 +#: ../../whatsnew/3.11.rst:2445 msgid "``f_code``: use :c:func:`PyFrame_GetCode`." msgstr "``f_code``:使用 :c:func:`PyFrame_GetCode`。" -#: ../../whatsnew/3.11.rst:2454 +#: ../../whatsnew/3.11.rst:2446 msgid "``f_gen``: use :c:func:`PyFrame_GetGenerator`." msgstr "``f_gen``:使用 :c:func:`PyFrame_GetGenerator`。" -#: ../../whatsnew/3.11.rst:2455 +#: ../../whatsnew/3.11.rst:2447 msgid "``f_globals``: use :c:func:`PyFrame_GetGlobals`." msgstr "``f_globals``:使用 :c:func:`PyFrame_GetGlobals`。" -#: ../../whatsnew/3.11.rst:2456 +#: ../../whatsnew/3.11.rst:2448 msgid "``f_iblock``: removed." msgstr "``f_iblock``:已移除。" -#: ../../whatsnew/3.11.rst:2457 +#: ../../whatsnew/3.11.rst:2449 msgid "" "``f_lasti``: use :c:func:`PyFrame_GetLasti`. Code using ``f_lasti`` with " "``PyCode_Addr2Line()`` should use :c:func:`PyFrame_GetLineNumber` instead; " @@ -4671,27 +4656,27 @@ msgstr "" "``PyCode_Addr2Line()`` 同時使用的部分應該改用 :c:func:" "`PyFrame_GetLineNumber`;它可能會更快。" -#: ../../whatsnew/3.11.rst:2460 +#: ../../whatsnew/3.11.rst:2452 msgid "``f_lineno``: use :c:func:`PyFrame_GetLineNumber`" msgstr "``f_lineno``:使用 :c:func:`PyFrame_GetLineNumber`" -#: ../../whatsnew/3.11.rst:2461 +#: ../../whatsnew/3.11.rst:2453 msgid "``f_locals``: use :c:func:`PyFrame_GetLocals`." msgstr "``f_locals``:使用 :c:func:`PyFrame_GetLocals`。" -#: ../../whatsnew/3.11.rst:2462 +#: ../../whatsnew/3.11.rst:2454 msgid "``f_stackdepth``: removed." msgstr "``f_stackdepth``:已移除。" -#: ../../whatsnew/3.11.rst:2463 +#: ../../whatsnew/3.11.rst:2455 msgid "``f_state``: no public API (renamed to ``f_frame.f_state``)." msgstr "``f_state``:無公開 API(重新命名為 ``f_frame.f_state``)。" -#: ../../whatsnew/3.11.rst:2464 +#: ../../whatsnew/3.11.rst:2456 msgid "``f_trace``: no public API." msgstr "``f_trace``:無公開 API。" -#: ../../whatsnew/3.11.rst:2465 +#: ../../whatsnew/3.11.rst:2457 msgid "" "``f_trace_lines``: use ``PyObject_GetAttrString((PyObject*)frame, " "\"f_trace_lines\")``." @@ -4699,7 +4684,7 @@ msgstr "" "``f_trace_lines``:使用 ``PyObject_GetAttrString((PyObject*)frame, " "“f_trace_lines”)``。" -#: ../../whatsnew/3.11.rst:2466 +#: ../../whatsnew/3.11.rst:2458 msgid "" "``f_trace_opcodes``: use ``PyObject_GetAttrString((PyObject*)frame, " "\"f_trace_opcodes\")``." @@ -4707,15 +4692,15 @@ msgstr "" "``f_trace_opcodes``:使用 ``PyObject_GetAttrString((PyObject*)frame, " "“f_trace_opcodes”)``。" -#: ../../whatsnew/3.11.rst:2467 +#: ../../whatsnew/3.11.rst:2459 msgid "``f_localsplus``: no public API (renamed to ``f_frame.localsplus``)." msgstr "``f_localsplus``:無公開 API(重新命名為 ``f_frame.localsplus``)。" -#: ../../whatsnew/3.11.rst:2468 +#: ../../whatsnew/3.11.rst:2460 msgid "``f_valuestack``: removed." msgstr "``f_valuestack``:已移除。" -#: ../../whatsnew/3.11.rst:2470 +#: ../../whatsnew/3.11.rst:2462 msgid "" "The Python frame object is now created lazily. A side effect is that the " "``f_back`` member must not be accessed directly, since its value is now also " @@ -4725,7 +4710,7 @@ msgstr "" "Python 幀物件的建立現為惰性的 (lazily),一個副作用是 ``f_back`` 成員不能被直" "接存取,因為其職的計算也是惰性的,要改呼叫 :c:func:`PyFrame_GetBack`。" -#: ../../whatsnew/3.11.rst:2475 +#: ../../whatsnew/3.11.rst:2467 msgid "" "Debuggers that accessed the ``f_locals`` directly *must* call :c:func:" "`PyFrame_GetLocals` instead. They no longer need to call :c:func:" @@ -4738,21 +4723,21 @@ msgstr "" "`PyFrame_FastToLocalsWithError` 或 :c:func:`PyFrame_LocalsToFast`,事實上他們" "不應該呼叫這些函式。框架的必要更新現在由虛擬機管理。" -#: ../../whatsnew/3.11.rst:2481 +#: ../../whatsnew/3.11.rst:2473 msgid "Code defining ``PyFrame_GetCode()`` on Python 3.8 and older::" msgstr "" "``PyFrame_GetCode()`` 在 Python 3.8 以前的程式定義:\n" "\n" "::" -#: ../../whatsnew/3.11.rst:2491 +#: ../../whatsnew/3.11.rst:2483 msgid "Code defining ``PyFrame_GetBack()`` on Python 3.8 and older::" msgstr "" "``PyFrame_GetBack()`` 在 Python 3.8 以前的程式定義:\n" "\n" "::" -#: ../../whatsnew/3.11.rst:2501 +#: ../../whatsnew/3.11.rst:2493 msgid "" "Or use the `pythoncapi_compat project `__ to get these two functions on older Python versions." @@ -4760,11 +4745,11 @@ msgstr "" "或是使用 `pythoncapi_compat 計畫 `__\\ 來在舊版 Python 中取得它們。" -#: ../../whatsnew/3.11.rst:2505 +#: ../../whatsnew/3.11.rst:2497 msgid "Changes of the :c:type:`PyThreadState` structure members:" msgstr ":c:type:`PyThreadState` 結構成員的改動:" -#: ../../whatsnew/3.11.rst:2507 +#: ../../whatsnew/3.11.rst:2499 msgid "" "``frame``: removed, use :c:func:`PyThreadState_GetFrame` (function added to " "Python 3.9 by :issue:`40429`). Warning: the function returns a :term:`strong " @@ -4774,7 +4759,7 @@ msgstr "" "於 Python 3.9 新增的函式)。警告:會回傳 :term:`strong reference` 的函式必須" "呼叫 :c:func:`Py_XDECREF`。" -#: ../../whatsnew/3.11.rst:2511 +#: ../../whatsnew/3.11.rst:2503 msgid "" "``tracing``: changed, use :c:func:`PyThreadState_EnterTracing` and :c:func:" "`PyThreadState_LeaveTracing` (functions added to Python 3.11 by :issue:" @@ -4784,7 +4769,7 @@ msgstr "" "`PyThreadState_LeaveTracing`\\ (:issue:`43760` 於 Python 3.11 中新增的函" "式)。" -#: ../../whatsnew/3.11.rst:2514 +#: ../../whatsnew/3.11.rst:2506 msgid "" "``recursion_depth``: removed, use ``(tstate->recursion_limit - tstate-" ">recursion_remaining)`` instead." @@ -4792,18 +4777,18 @@ msgstr "" "``recursion_depth``:已移除,請改用 ``(tstate->recursion_limit - tstate-" ">recursion_remaining)``。" -#: ../../whatsnew/3.11.rst:2516 +#: ../../whatsnew/3.11.rst:2508 msgid "``stackcheck_counter``: removed." msgstr "``stackcheck_counter``:已移除。" -#: ../../whatsnew/3.11.rst:2518 +#: ../../whatsnew/3.11.rst:2510 msgid "Code defining ``PyThreadState_GetFrame()`` on Python 3.8 and older::" msgstr "" "``PyThreadState_GetFrame()`` 在 Python 3.8 以前的程式定義:\n" "\n" "::" -#: ../../whatsnew/3.11.rst:2528 +#: ../../whatsnew/3.11.rst:2520 msgid "" "Code defining ``PyThreadState_EnterTracing()`` and " "``PyThreadState_LeaveTracing()`` on Python 3.10 and older::" @@ -4813,7 +4798,7 @@ msgstr "" "\n" "::" -#: ../../whatsnew/3.11.rst:2554 +#: ../../whatsnew/3.11.rst:2546 msgid "" "Or use `the pythoncapi_compat project `__ to get these functions on old Python functions." @@ -4821,13 +4806,13 @@ msgstr "" "或是使用 `pythoncapi_compat 計畫 `__\\ 來在舊版 Python 函式中取得它們。" -#: ../../whatsnew/3.11.rst:2558 +#: ../../whatsnew/3.11.rst:2550 msgid "" "Distributors are encouraged to build Python with the optimized Blake2 " "library `libb2`_." msgstr "鼓勵發布者們使用最佳化過的 Blake2 函式庫 `libb2`_ 來建置 Python。" -#: ../../whatsnew/3.11.rst:2561 +#: ../../whatsnew/3.11.rst:2553 msgid "" "The :c:member:`PyConfig.module_search_paths_set` field must now be set to 1 " "for initialization to use :c:member:`PyConfig.module_search_paths` to " @@ -4838,7 +4823,7 @@ msgstr "" "`sys.path`,則現在 :c:member:`PyConfig.module_search_paths_set` 必須被設為 " "1。否則,初始化會重新計算路徑並取代所有被加到 ``module_search_paths`` 的值。" -#: ../../whatsnew/3.11.rst:2566 +#: ../../whatsnew/3.11.rst:2558 msgid "" ":c:func:`PyConfig_Read` no longer calculates the initial search path, and " "will not fill any values into :c:member:`PyConfig.module_search_paths`. To " @@ -4851,60 +4836,60 @@ msgstr "" "初始化並使用 :c:func:`PySys_GetObject` 以取得 :data:`sys.path` 作為 Python 列" "表物件並直接修改它。" -#: ../../whatsnew/3.11.rst:2577 +#: ../../whatsnew/3.11.rst:2569 msgid "" "Deprecate the following functions to configure the Python initialization:" msgstr "棄用以下用來配置 Python 初始化的函式:" -#: ../../whatsnew/3.11.rst:2579 +#: ../../whatsnew/3.11.rst:2571 msgid ":c:func:`PySys_AddWarnOptionUnicode`" msgstr ":c:func:`PySys_AddWarnOptionUnicode`" -#: ../../whatsnew/3.11.rst:2580 +#: ../../whatsnew/3.11.rst:2572 msgid ":c:func:`PySys_AddWarnOption`" msgstr ":c:func:`PySys_AddWarnOption`" -#: ../../whatsnew/3.11.rst:2581 +#: ../../whatsnew/3.11.rst:2573 msgid ":c:func:`PySys_AddXOption`" msgstr ":c:func:`PySys_AddXOption`" -#: ../../whatsnew/3.11.rst:2582 +#: ../../whatsnew/3.11.rst:2574 msgid ":c:func:`PySys_HasWarnOptions`" msgstr ":c:func:`PySys_HasWarnOptions`" -#: ../../whatsnew/3.11.rst:2583 +#: ../../whatsnew/3.11.rst:2575 msgid ":c:func:`PySys_SetArgvEx`" msgstr ":c:func:`PySys_SetArgvEx`" -#: ../../whatsnew/3.11.rst:2584 +#: ../../whatsnew/3.11.rst:2576 msgid ":c:func:`PySys_SetArgv`" msgstr ":c:func:`PySys_SetArgv`" -#: ../../whatsnew/3.11.rst:2585 +#: ../../whatsnew/3.11.rst:2577 msgid ":c:func:`PySys_SetPath`" msgstr ":c:func:`PySys_SetPath`" -#: ../../whatsnew/3.11.rst:2586 +#: ../../whatsnew/3.11.rst:2578 msgid ":c:func:`Py_SetPath`" msgstr ":c:func:`Py_SetPath`" -#: ../../whatsnew/3.11.rst:2587 +#: ../../whatsnew/3.11.rst:2579 msgid ":c:func:`Py_SetProgramName`" msgstr ":c:func:`Py_SetProgramName`" -#: ../../whatsnew/3.11.rst:2588 +#: ../../whatsnew/3.11.rst:2580 msgid ":c:func:`Py_SetPythonHome`" msgstr ":c:func:`Py_SetPythonHome`" -#: ../../whatsnew/3.11.rst:2589 +#: ../../whatsnew/3.11.rst:2581 msgid ":c:func:`Py_SetStandardStreamEncoding`" msgstr ":c:func:`Py_SetStandardStreamEncoding`" -#: ../../whatsnew/3.11.rst:2590 +#: ../../whatsnew/3.11.rst:2582 msgid ":c:func:`_Py_SetProgramFullPath`" msgstr ":c:func:`_Py_SetProgramFullPath`" -#: ../../whatsnew/3.11.rst:2592 +#: ../../whatsnew/3.11.rst:2584 msgid "" "Use the new :c:type:`PyConfig` API of the :ref:`Python Initialization " "Configuration ` instead (:pep:`587`). (Contributed by Victor " @@ -4913,7 +4898,7 @@ msgstr "" "請改用 :ref:`Python 初始化配置 `\\ 中新的 :c:type:`PyConfig` " "API。(由 Victor Stinner 於 :gh:`88279` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2596 +#: ../../whatsnew/3.11.rst:2588 msgid "" "Deprecate the ``ob_shash`` member of the :c:type:`PyBytesObject`. Use :c:" "func:`PyObject_Hash` instead. (Contributed by Inada Naoki in :issue:`46864`.)" @@ -4921,77 +4906,77 @@ msgstr "" "棄用 :c:type:`PyBytesObject` 中的 ``ob_shash`` 成員。請改用 :c:func:" "`PyObject_Hash`。(由 Inada Naoki 於 :issue:`46864` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2605 +#: ../../whatsnew/3.11.rst:2597 msgid "" "The following C APIs have been deprecated in earlier Python releases, and " "will be removed in Python 3.12." msgstr "以下 C API 已於先前 Python 發布版本中棄用,並將於 Python 3.12 中移除。" -#: ../../whatsnew/3.11.rst:2608 +#: ../../whatsnew/3.11.rst:2600 msgid ":c:func:`PyUnicode_AS_DATA`" msgstr ":c:func:`PyUnicode_AS_DATA`" -#: ../../whatsnew/3.11.rst:2609 +#: ../../whatsnew/3.11.rst:2601 msgid ":c:func:`PyUnicode_AS_UNICODE`" msgstr ":c:func:`PyUnicode_AS_UNICODE`" -#: ../../whatsnew/3.11.rst:2610 +#: ../../whatsnew/3.11.rst:2602 msgid ":c:func:`PyUnicode_AsUnicodeAndSize`" msgstr ":c:func:`PyUnicode_AsUnicodeAndSize`" -#: ../../whatsnew/3.11.rst:2611 +#: ../../whatsnew/3.11.rst:2603 msgid ":c:func:`PyUnicode_AsUnicode`" msgstr ":c:func:`PyUnicode_AsUnicode`" -#: ../../whatsnew/3.11.rst:2612 +#: ../../whatsnew/3.11.rst:2604 msgid ":c:func:`PyUnicode_FromUnicode`" msgstr ":c:func:`PyUnicode_FromUnicode`" -#: ../../whatsnew/3.11.rst:2613 +#: ../../whatsnew/3.11.rst:2605 msgid ":c:func:`PyUnicode_GET_DATA_SIZE`" msgstr ":c:func:`PyUnicode_GET_DATA_SIZE`" -#: ../../whatsnew/3.11.rst:2614 +#: ../../whatsnew/3.11.rst:2606 msgid ":c:func:`PyUnicode_GET_SIZE`" msgstr ":c:func:`PyUnicode_GET_SIZE`" -#: ../../whatsnew/3.11.rst:2615 +#: ../../whatsnew/3.11.rst:2607 msgid ":c:func:`PyUnicode_GetSize`" msgstr ":c:func:`PyUnicode_GetSize`" -#: ../../whatsnew/3.11.rst:2616 +#: ../../whatsnew/3.11.rst:2608 msgid ":c:func:`PyUnicode_IS_COMPACT`" msgstr ":c:func:`PyUnicode_IS_COMPACT`" -#: ../../whatsnew/3.11.rst:2617 +#: ../../whatsnew/3.11.rst:2609 msgid ":c:func:`PyUnicode_IS_READY`" msgstr ":c:func:`PyUnicode_IS_READY`" -#: ../../whatsnew/3.11.rst:2618 +#: ../../whatsnew/3.11.rst:2610 msgid ":c:func:`PyUnicode_READY`" msgstr ":c:func:`PyUnicode_READY`" -#: ../../whatsnew/3.11.rst:2619 +#: ../../whatsnew/3.11.rst:2611 msgid ":c:func:`Py_UNICODE_WSTR_LENGTH`" msgstr ":c:func:`Py_UNICODE_WSTR_LENGTH`" -#: ../../whatsnew/3.11.rst:2620 +#: ../../whatsnew/3.11.rst:2612 msgid ":c:func:`_PyUnicode_AsUnicode`" msgstr ":c:func:`_PyUnicode_AsUnicode`" -#: ../../whatsnew/3.11.rst:2621 +#: ../../whatsnew/3.11.rst:2613 msgid ":c:macro:`PyUnicode_WCHAR_KIND`" msgstr ":c:macro:`PyUnicode_WCHAR_KIND`" -#: ../../whatsnew/3.11.rst:2622 +#: ../../whatsnew/3.11.rst:2614 msgid ":c:type:`PyUnicodeObject`" msgstr ":c:type:`PyUnicodeObject`" -#: ../../whatsnew/3.11.rst:2623 +#: ../../whatsnew/3.11.rst:2615 msgid ":c:func:`PyUnicode_InternImmortal()`" msgstr ":c:func:`PyUnicode_InternImmortal()`" -#: ../../whatsnew/3.11.rst:2631 +#: ../../whatsnew/3.11.rst:2623 msgid "" ":c:func:`PyFrame_BlockSetup` and :c:func:`PyFrame_BlockPop` have been " "removed. (Contributed by Mark Shannon in :issue:`40222`.)" @@ -4999,35 +4984,35 @@ msgstr "" "移除 :c:func:`PyFrame_BlockSetup` 和 :c:func:`PyFrame_BlockPop`。(由 Mark " "Shannon 於 :issue:`40222` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2635 +#: ../../whatsnew/3.11.rst:2627 msgid "Remove the following math macros using the ``errno`` variable:" msgstr "移除以下使用到 ``errno`` 變數的數學巨集:" -#: ../../whatsnew/3.11.rst:2637 +#: ../../whatsnew/3.11.rst:2629 msgid "``Py_ADJUST_ERANGE1()``" msgstr "``Py_ADJUST_ERANGE1()``" -#: ../../whatsnew/3.11.rst:2638 +#: ../../whatsnew/3.11.rst:2630 msgid "``Py_ADJUST_ERANGE2()``" msgstr "``Py_ADJUST_ERANGE2()``" -#: ../../whatsnew/3.11.rst:2639 +#: ../../whatsnew/3.11.rst:2631 msgid "``Py_OVERFLOWED()``" msgstr "``Py_OVERFLOWED()``" -#: ../../whatsnew/3.11.rst:2640 +#: ../../whatsnew/3.11.rst:2632 msgid "``Py_SET_ERANGE_IF_OVERFLOW()``" msgstr "``Py_SET_ERANGE_IF_OVERFLOW()``" -#: ../../whatsnew/3.11.rst:2641 +#: ../../whatsnew/3.11.rst:2633 msgid "``Py_SET_ERRNO_ON_MATH_ERROR()``" msgstr "``Py_SET_ERRNO_ON_MATH_ERROR()``" -#: ../../whatsnew/3.11.rst:2643 +#: ../../whatsnew/3.11.rst:2635 msgid "(Contributed by Victor Stinner in :issue:`45412`.)" msgstr "(由 Victor Stinner 於 :issue:`45412` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2645 +#: ../../whatsnew/3.11.rst:2637 msgid "" "Remove ``Py_UNICODE_COPY()`` and ``Py_UNICODE_FILL()`` macros, deprecated " "since Python 3.3. Use ``PyUnicode_CopyCharacters()`` or ``memcpy()`` " @@ -5039,7 +5024,7 @@ msgstr "" "和 ``PyUnicode_Fill()`` 函式。(由 Victor Stinner 於 :issue:`41123` 中所貢" "獻。)" -#: ../../whatsnew/3.11.rst:2650 +#: ../../whatsnew/3.11.rst:2642 msgid "" "Remove the ``pystrhex.h`` header file. It only contains private functions. C " "extensions should only include the main ```` header file. " @@ -5048,7 +5033,7 @@ msgstr "" "移除 ``pystrhex.h`` 標頭檔案。它只有包含私有函式。C 的擴充應該只要引入主要的 " "```` 標頭檔案。(由 Victor Stinner 於 :issue:`45434` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2654 +#: ../../whatsnew/3.11.rst:2646 msgid "" "Remove the ``Py_FORCE_DOUBLE()`` macro. It was used by the " "``Py_IS_INFINITY()`` macro. (Contributed by Victor Stinner in :issue:" @@ -5057,41 +5042,41 @@ msgstr "" "移除 ``Py_FORCE_DOUBLE()`` 巨集。它先前被用於 ``Py_IS_INFINITY()`` 巨集。" "(由 Victor Stinner 於 :issue:`45440` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2658 +#: ../../whatsnew/3.11.rst:2650 msgid "" "The following items are no longer available when :c:macro:`Py_LIMITED_API` " "is defined:" msgstr "當 :c:macro:`Py_LIMITED_API` 有被定義時,以下項目將無法被取得:" -#: ../../whatsnew/3.11.rst:2661 +#: ../../whatsnew/3.11.rst:2653 msgid ":c:func:`PyMarshal_WriteLongToFile`" msgstr ":c:func:`PyMarshal_WriteLongToFile`" -#: ../../whatsnew/3.11.rst:2662 +#: ../../whatsnew/3.11.rst:2654 msgid ":c:func:`PyMarshal_WriteObjectToFile`" msgstr ":c:func:`PyMarshal_WriteObjectToFile`" -#: ../../whatsnew/3.11.rst:2663 +#: ../../whatsnew/3.11.rst:2655 msgid ":c:func:`PyMarshal_ReadObjectFromString`" msgstr ":c:func:`PyMarshal_ReadObjectFromString`" -#: ../../whatsnew/3.11.rst:2664 +#: ../../whatsnew/3.11.rst:2656 msgid ":c:func:`PyMarshal_WriteObjectToString`" msgstr ":c:func:`PyMarshal_WriteObjectToString`" -#: ../../whatsnew/3.11.rst:2665 +#: ../../whatsnew/3.11.rst:2657 msgid "the ``Py_MARSHAL_VERSION`` macro" msgstr "``Py_MARSHAL_VERSION`` 巨集" -#: ../../whatsnew/3.11.rst:2667 +#: ../../whatsnew/3.11.rst:2659 msgid "These are not part of the :ref:`limited API `." msgstr "這些並非\\ :ref:`受限 API ` 的一部分。" -#: ../../whatsnew/3.11.rst:2669 +#: ../../whatsnew/3.11.rst:2661 msgid "(Contributed by Victor Stinner in :issue:`45474`.)" msgstr "(由 Victor Stinner 於 :issue:`45474` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2671 +#: ../../whatsnew/3.11.rst:2663 msgid "" "Exclude :c:func:`PyWeakref_GET_OBJECT` from the limited C API. It never " "worked since the :c:type:`PyWeakReference` structure is opaque in the " @@ -5101,7 +5086,7 @@ msgstr "" "`PyWeakReference` 結構在受限 C API 中過於晦澀而從未運作。(由 Victor Stinner " "於 :issue:`35134` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2676 +#: ../../whatsnew/3.11.rst:2668 msgid "" "Remove the ``PyHeapType_GET_MEMBERS()`` macro. It was exposed in the public " "C API by mistake, it must only be used by Python internally. Use the " @@ -5112,7 +5097,7 @@ msgstr "" "該只能被 Python 內部所使用。請改用 ``PyTypeObject.tp_members``。(由 Victor " "Stinner 於 :issue:`40170` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2681 +#: ../../whatsnew/3.11.rst:2673 msgid "" "Remove the ``HAVE_PY_SET_53BIT_PRECISION`` macro (moved to the internal C " "API). (Contributed by Victor Stinner in :issue:`45412`.)" @@ -5120,7 +5105,7 @@ msgstr "" "移除 ``HAVE_PY_SET_53BIT_PRECISION`` 巨集(移動至內部 C API)。(由 Victor " "Stinner 於 :issue:`45412` 中所貢獻。)" -#: ../../whatsnew/3.11.rst:2687 +#: ../../whatsnew/3.11.rst:2679 msgid "" "Remove the :c:type:`Py_UNICODE` encoder APIs, as they have been deprecated " "since Python 3.3, are little used and are inefficient relative to the " @@ -5129,66 +5114,103 @@ msgstr "" "移除 :c:type:`Py_UNICODE` 編碼器 API,它們自從 Python 3.3 就被棄用,非常少用" "且和推薦的替代方案已無太大關聯。" -#: ../../whatsnew/3.11.rst:2692 +#: ../../whatsnew/3.11.rst:2684 msgid "The removed functions are:" msgstr "被移除的函式為:" -#: ../../whatsnew/3.11.rst:2694 +#: ../../whatsnew/3.11.rst:2686 msgid ":func:`!PyUnicode_Encode`" msgstr ":func:`!PyUnicode_Encode`" -#: ../../whatsnew/3.11.rst:2695 +#: ../../whatsnew/3.11.rst:2687 msgid ":func:`!PyUnicode_EncodeASCII`" msgstr ":func:`!PyUnicode_EncodeASCII`" -#: ../../whatsnew/3.11.rst:2696 +#: ../../whatsnew/3.11.rst:2688 msgid ":func:`!PyUnicode_EncodeLatin1`" msgstr ":func:`!PyUnicode_EncodeLatin1`" -#: ../../whatsnew/3.11.rst:2697 +#: ../../whatsnew/3.11.rst:2689 msgid ":func:`!PyUnicode_EncodeUTF7`" msgstr ":func:`!PyUnicode_EncodeUTF7`" -#: ../../whatsnew/3.11.rst:2698 +#: ../../whatsnew/3.11.rst:2690 msgid ":func:`!PyUnicode_EncodeUTF8`" msgstr ":func:`!PyUnicode_EncodeUTF8`" -#: ../../whatsnew/3.11.rst:2699 +#: ../../whatsnew/3.11.rst:2691 msgid ":func:`!PyUnicode_EncodeUTF16`" msgstr ":func:`!PyUnicode_EncodeUTF16`" -#: ../../whatsnew/3.11.rst:2700 +#: ../../whatsnew/3.11.rst:2692 msgid ":func:`!PyUnicode_EncodeUTF32`" msgstr ":func:`!PyUnicode_EncodeUTF32`" -#: ../../whatsnew/3.11.rst:2701 +#: ../../whatsnew/3.11.rst:2693 msgid ":func:`!PyUnicode_EncodeUnicodeEscape`" msgstr ":func:`!PyUnicode_EncodeUnicodeEscape`" -#: ../../whatsnew/3.11.rst:2702 +#: ../../whatsnew/3.11.rst:2694 msgid ":func:`!PyUnicode_EncodeRawUnicodeEscape`" msgstr ":func:`!PyUnicode_EncodeRawUnicodeEscape`" -#: ../../whatsnew/3.11.rst:2703 +#: ../../whatsnew/3.11.rst:2695 msgid ":func:`!PyUnicode_EncodeCharmap`" msgstr ":func:`!PyUnicode_EncodeCharmap`" -#: ../../whatsnew/3.11.rst:2704 +#: ../../whatsnew/3.11.rst:2696 msgid ":func:`!PyUnicode_TranslateCharmap`" msgstr ":func:`!PyUnicode_TranslateCharmap`" -#: ../../whatsnew/3.11.rst:2705 +#: ../../whatsnew/3.11.rst:2697 msgid ":func:`!PyUnicode_EncodeDecimal`" msgstr ":func:`!PyUnicode_EncodeDecimal`" -#: ../../whatsnew/3.11.rst:2706 +#: ../../whatsnew/3.11.rst:2698 msgid ":func:`!PyUnicode_TransformDecimalToASCII`" msgstr ":func:`!PyUnicode_TransformDecimalToASCII`" -#: ../../whatsnew/3.11.rst:2708 +#: ../../whatsnew/3.11.rst:2700 msgid "" "See :pep:`624` for details and :pep:`migration guidance <624#alternative-" "apis>`. (Contributed by Inada Naoki in :issue:`44029`.)" msgstr "" "詳情請見 :pep:`624` 與\\ :pep:`搬遷指南 <624#alternative-apis>`。(由 Inada " "Naoki 於 :issue:`44029` 中所貢獻。)" + +#~ msgid "Building Python now requires:" +#~ msgstr "建置 Python 現在必須要有:" + +#~ msgid "" +#~ "A `C11 `_ compiler. `Optional C11 " +#~ "features `_ are not required. " +#~ "(Contributed by Victor Stinner in :issue:`46656`.)" +#~ msgstr "" +#~ "`C11 `_ 編譯器。`可選的 C11 特性 " +#~ "`_ 並非必要。(由 Victor " +#~ "Stinner 於 :issue:`46656` 中貢獻。)" + +#~ msgid "" +#~ "Support for `floating point Not-a-Number (NaN) `_, as the :c:macro:`!Py_NO_NAN` macro has been " +#~ "removed. (Contributed by Victor Stinner in :issue:`46656`.)" +#~ msgstr "" +#~ "支援\\ `浮點非數字 (floating point NaN) `_,因為 :c:macro:`!Py_NO_NAN` 巨集已被刪除。 (由 " +#~ "Victor Stinner 在 :issue:`46656` 中貢獻。)" + +#~ msgid "" +#~ "A `C99 `_ ```` header file " +#~ "providing the :c:func:`!copysign`, :c:func:`!hypot`, :c:func:`!" +#~ "isfinite`, :c:func:`!isinf`, :c:func:`!isnan`, and :c:func:`!round` " +#~ "functions (contributed by Victor Stinner in :issue:`45440`); and a :c:" +#~ "data:`!NAN` constant or the :c:func:`!__builtin_nan` function " +#~ "(Contributed by Victor Stinner in :issue:`46640`)." +#~ msgstr "" +#~ "`C99 `_ ```` 標頭檔提供了 :c:" +#~ "func:`!copysign`、:c:func:`!hypot`、:c:func:`!isfinite`、:c:func:`!" +#~ "isinf`、:c:func:`!isnan` 和 :c:func:`!round` 函數(由 Victor Stinner 在 :" +#~ "issue:`45440` 中貢獻);和一個 :c:data:`!NAN` 常數或 :c:func:`!" +#~ "__builtin_nan` 函式(由 Victor Stinner 在 :issue:`46640` 中貢獻)。"