From c5d2c8ff3643607a8fa98db111d3a550ee1a6760 Mon Sep 17 00:00:00 2001 From: "pydoc-zh-tw[bot]" <90344106+pydoc-zh-tw[bot]@users.noreply.github.com> Date: Wed, 11 Oct 2023 17:11:28 +0000 Subject: [PATCH 01/39] Sync with CPython 3.12 (#625) * sync with cpython f90099c3 * sync with cpython 7c7b2bfb * sync with cpython cdca4af6 * sync with cpython 036dd695 * sync with cpython 320d3982 * sync with cpython 8c3793a5 * sync with cpython 4dc07d2b * sync with cpython dcaacd90 * sync with cpython e0f60808 * sync with cpython 88ff02e3 * sync with cpython 495ba703 * sync with cpython ce370956 * sync with cpython af83d1e8 * sync with cpython af83d1e8 * sync with cpython 21f4e6d6 * sync with cpython 5b38bdea * sync with cpython 35c633d2 * fix: resolve fuzzy entries --------- Co-authored-by: github-actions[bot] Co-authored-by: Matt Wang --- c-api/dict.po | 92 +- c-api/mapping.po | 61 +- c-api/object.po | 39 +- c-api/stable.po | 10 +- c-api/typeobj.po | 4 +- faq/gui.po | 35 +- howto/enum.po | 364 ++++--- howto/logging-cookbook.po | 462 ++++---- library/ast.po | 329 +++--- library/calendar.po | 284 +++-- library/configparser.po | 146 +-- library/datetime.po | 1148 ++++++++++---------- library/dis.po | 385 +++---- library/idle.po | 4 +- library/importlib.po | 429 +++++--- library/importlib.resources.abc.po | 55 +- library/importlib.resources.po | 74 +- library/inspect.po | 6 +- library/io.po | 356 ++++--- library/itertools.po | 4 +- library/multiprocessing.po | 4 +- library/os.po | 1568 ++++++++++++++-------------- library/pickle.po | 249 ++--- library/socket.po | 8 +- library/sqlite3.po | 4 +- library/sys.monitoring.po | 540 ++++++++++ library/sys.po | 30 +- library/threading.po | 32 +- library/tkinter.po | 4 +- library/traceback.po | 159 +-- library/turtle.po | 10 +- library/typing.po | 1503 +++++++++++++++----------- library/unittest.mock-examples.po | 272 ++--- library/unittest.po | 6 +- library/uuid.po | 193 ++-- library/zipapp.po | 34 +- reference/datamodel.po | 936 ++++++++--------- sphinx.po | 6 +- tutorial/appendix.po | 22 +- tutorial/classes.po | 8 +- using/configure.po | 599 ++++++----- whatsnew/3.12.po | 1337 +++++++++++++----------- 42 files changed, 6583 insertions(+), 5228 deletions(-) create mode 100644 library/sys.monitoring.po diff --git a/c-api/dict.po b/c-api/dict.po index 5f484c64d1..f2083a7490 100644 --- a/c-api/dict.po +++ b/c-api/dict.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-26 00:03+0000\n" +"POT-Creation-Date: 2023-09-03 00:03+0000\n" "PO-Revision-Date: 2017-09-22 18:26+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -87,15 +87,14 @@ msgid "" "to *val*." msgstr "" -#: ../../c-api/dict.rst:75 +#: ../../c-api/dict.rst:73 msgid "" -"Insert *val* into the dictionary *p* using *key* as a key. *key* should be " -"a :c:expr:`const char*` UTF-8 encoded bytes string. The key object is " -"created using ``PyUnicode_FromString(key)``. Return ``0`` on success or " -"``-1`` on failure. This function *does not* steal a reference to *val*." +"This is the same as :c:func:`PyDict_SetItem`, but *key* is specified as a :c:" +"expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" +"`PyObject*`." msgstr "" -#: ../../c-api/dict.rst:83 +#: ../../c-api/dict.rst:80 msgid "" "Remove the entry in dictionary *p* with key *key*. *key* must be :term:" "`hashable`; if it isn't, :exc:`TypeError` is raised. If *key* is not in the " @@ -103,47 +102,47 @@ msgid "" "failure." msgstr "" -#: ../../c-api/dict.rst:91 +#: ../../c-api/dict.rst:88 msgid "" -"Remove the entry in dictionary *p* which has a key specified by the UTF-8 " -"encoded bytes string *key*. If *key* is not in the dictionary, :exc:" -"`KeyError` is raised. Return ``0`` on success or ``-1`` on failure." +"This is the same as :c:func:`PyDict_DelItem`, but *key* is specified as a :c:" +"expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" +"`PyObject*`." msgstr "" -#: ../../c-api/dict.rst:99 +#: ../../c-api/dict.rst:95 msgid "" "Return the object from dictionary *p* which has a key *key*. Return " "``NULL`` if the key *key* is not present, but *without* setting an exception." msgstr "" -#: ../../c-api/dict.rst:104 +#: ../../c-api/dict.rst:100 msgid "" "Exceptions that occur while this calls :meth:`~object.__hash__` and :meth:" "`~object.__eq__` methods are silently ignored. Prefer the :c:func:" "`PyDict_GetItemWithError` function instead." msgstr "" -#: ../../c-api/dict.rst:108 +#: ../../c-api/dict.rst:104 msgid "" "Calling this API without :term:`GIL` held had been allowed for historical " "reason. It is no longer allowed." msgstr "" -#: ../../c-api/dict.rst:115 +#: ../../c-api/dict.rst:111 msgid "" "Variant of :c:func:`PyDict_GetItem` that does not suppress exceptions. " "Return ``NULL`` **with** an exception set if an exception occurred. Return " "``NULL`` **without** an exception set if the key wasn't present." msgstr "" -#: ../../c-api/dict.rst:123 +#: ../../c-api/dict.rst:119 msgid "" "This is the same as :c:func:`PyDict_GetItem`, but *key* is specified as a :c:" "expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" "`PyObject*`." msgstr "" -#: ../../c-api/dict.rst:129 +#: ../../c-api/dict.rst:125 msgid "" "Exceptions that occur while this calls :meth:`~object.__hash__` and :meth:" "`~object.__eq__` methods or while creating the temporary :class:`str` object " @@ -151,7 +150,7 @@ msgid "" "function with your own :c:func:`PyUnicode_FromString` *key* instead." msgstr "" -#: ../../c-api/dict.rst:138 +#: ../../c-api/dict.rst:134 msgid "" "This is the same as the Python-level :meth:`dict.setdefault`. If present, " "it returns the value corresponding to *key* from the dictionary *p*. If the " @@ -161,29 +160,29 @@ msgid "" "the insertion." msgstr "" -#: ../../c-api/dict.rst:148 +#: ../../c-api/dict.rst:144 msgid "" "Return a :c:type:`PyListObject` containing all the items from the dictionary." msgstr "" -#: ../../c-api/dict.rst:153 +#: ../../c-api/dict.rst:149 msgid "" "Return a :c:type:`PyListObject` containing all the keys from the dictionary." msgstr "" -#: ../../c-api/dict.rst:158 +#: ../../c-api/dict.rst:154 msgid "" "Return a :c:type:`PyListObject` containing all the values from the " "dictionary *p*." msgstr "" -#: ../../c-api/dict.rst:166 +#: ../../c-api/dict.rst:162 msgid "" "Return the number of items in the dictionary. This is equivalent to " "``len(p)`` on a dictionary." msgstr "" -#: ../../c-api/dict.rst:172 +#: ../../c-api/dict.rst:168 msgid "" "Iterate over all key-value pairs in the dictionary *p*. The :c:type:" "`Py_ssize_t` referred to by *ppos* must be initialized to ``0`` prior to the " @@ -197,21 +196,21 @@ msgid "" "structure is sparse, the offsets are not consecutive." msgstr "" -#: ../../c-api/dict.rst:183 +#: ../../c-api/dict.rst:179 msgid "For example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../c-api/dict.rst:193 +#: ../../c-api/dict.rst:189 msgid "" "The dictionary *p* should not be mutated during iteration. It is safe to " "modify the values of the keys as you iterate over the dictionary, but only " "so long as the set of keys does not change. For example::" msgstr "" -#: ../../c-api/dict.rst:218 +#: ../../c-api/dict.rst:214 msgid "" "Iterate over mapping object *b* adding key-value pairs to dictionary *a*. " "*b* may be a dictionary, or any object supporting :c:func:`PyMapping_Keys` " @@ -221,7 +220,7 @@ msgid "" "or ``-1`` if an exception was raised." msgstr "" -#: ../../c-api/dict.rst:228 +#: ../../c-api/dict.rst:224 msgid "" "This is the same as ``PyDict_Merge(a, b, 1)`` in C, and is similar to ``a." "update(b)`` in Python except that :c:func:`PyDict_Update` doesn't fall back " @@ -230,7 +229,7 @@ msgid "" "exception was raised." msgstr "" -#: ../../c-api/dict.rst:237 +#: ../../c-api/dict.rst:233 msgid "" "Update or merge into dictionary *a*, from the key-value pairs in *seq2*. " "*seq2* must be an iterable object producing iterable objects of length 2, " @@ -239,7 +238,7 @@ msgid "" "if an exception was raised. Equivalent Python (except for the return value)::" msgstr "" -#: ../../c-api/dict.rst:251 +#: ../../c-api/dict.rst:247 msgid "" "Register *callback* as a dictionary watcher. Return a non-negative integer " "id which must be passed to future calls to :c:func:`PyDict_Watch`. In case " @@ -247,21 +246,21 @@ msgid "" "exception." msgstr "" -#: ../../c-api/dict.rst:260 +#: ../../c-api/dict.rst:256 msgid "" "Clear watcher identified by *watcher_id* previously returned from :c:func:" "`PyDict_AddWatcher`. Return ``0`` on success, ``-1`` on error (e.g. if the " "given *watcher_id* was never registered.)" msgstr "" -#: ../../c-api/dict.rst:268 +#: ../../c-api/dict.rst:264 msgid "" "Mark dictionary *dict* as watched. The callback granted *watcher_id* by :c:" "func:`PyDict_AddWatcher` will be called when *dict* is modified or " "deallocated. Return ``0`` on success or ``-1`` on error." msgstr "" -#: ../../c-api/dict.rst:276 +#: ../../c-api/dict.rst:272 msgid "" "Mark dictionary *dict* as no longer watched. The callback granted " "*watcher_id* by :c:func:`PyDict_AddWatcher` will no longer be called when " @@ -269,7 +268,7 @@ msgid "" "watched by this watcher. Return ``0`` on success or ``-1`` on error." msgstr "" -#: ../../c-api/dict.rst:285 +#: ../../c-api/dict.rst:281 msgid "" "Enumeration of possible dictionary watcher events: ``PyDict_EVENT_ADDED``, " "``PyDict_EVENT_MODIFIED``, ``PyDict_EVENT_DELETED``, " @@ -277,11 +276,11 @@ msgid "" "``PyDict_EVENT_DEALLOCATED``." msgstr "" -#: ../../c-api/dict.rst:293 +#: ../../c-api/dict.rst:289 msgid "Type of a dict watcher callback function." msgstr "" -#: ../../c-api/dict.rst:295 +#: ../../c-api/dict.rst:291 msgid "" "If *event* is ``PyDict_EVENT_CLEARED`` or ``PyDict_EVENT_DEALLOCATED``, both " "*key* and *new_value* will be ``NULL``. If *event* is ``PyDict_EVENT_ADDED`` " @@ -290,7 +289,7 @@ msgid "" "dictionary and *new_value* will be ``NULL``." msgstr "" -#: ../../c-api/dict.rst:301 +#: ../../c-api/dict.rst:297 msgid "" "``PyDict_EVENT_CLONED`` occurs when *dict* was previously empty and another " "dict is merged into it. To maintain efficiency of this operation, per-key " @@ -298,14 +297,14 @@ msgid "" "``PyDict_EVENT_CLONED`` is issued, and *key* will be the source dictionary." msgstr "" -#: ../../c-api/dict.rst:307 +#: ../../c-api/dict.rst:303 msgid "" "The callback may inspect but must not modify *dict*; doing so could have " "unpredictable effects, including infinite recursion. Do not trigger Python " "code execution in the callback, as it could modify the dict as a side effect." msgstr "" -#: ../../c-api/dict.rst:311 +#: ../../c-api/dict.rst:307 msgid "" "If *event* is ``PyDict_EVENT_DEALLOCATED``, taking a new reference in the " "callback to the about-to-be-destroyed dictionary will resurrect it and " @@ -314,20 +313,20 @@ msgid "" "again." msgstr "" -#: ../../c-api/dict.rst:317 +#: ../../c-api/dict.rst:313 msgid "" "Callbacks occur before the notified modification to *dict* takes place, so " "the prior state of *dict* can be inspected." msgstr "" -#: ../../c-api/dict.rst:320 +#: ../../c-api/dict.rst:316 msgid "" "If the callback sets an exception, it must return ``-1``; this exception " "will be printed as an unraisable exception using :c:func:" "`PyErr_WriteUnraisable`. Otherwise it should return ``0``." msgstr "" -#: ../../c-api/dict.rst:324 +#: ../../c-api/dict.rst:320 msgid "" "There may already be a pending exception set on entry to the callback. In " "this case, the callback should return ``0`` with the same exception still " @@ -344,14 +343,13 @@ msgstr "object(物件)" msgid "dictionary" msgstr "dictionary(字典)" -#: ../../c-api/dict.rst:73 -msgid "PyUnicode_FromString()" -msgstr "PyUnicode_FromString()" - -#: ../../c-api/dict.rst:164 +#: ../../c-api/dict.rst:160 msgid "built-in function" msgstr "built-in function(內建函式)" -#: ../../c-api/dict.rst:164 +#: ../../c-api/dict.rst:160 msgid "len" msgstr "len" + +#~ msgid "PyUnicode_FromString()" +#~ msgstr "PyUnicode_FromString()" diff --git a/c-api/mapping.po b/c-api/mapping.po index cdfeb15ebe..b1d0f462d8 100644 --- a/c-api/mapping.po +++ b/c-api/mapping.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-24 00:03+0000\n" +"POT-Creation-Date: 2023-09-03 00:03+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-" @@ -45,33 +45,30 @@ msgstr "" #: ../../c-api/mapping.rst:31 msgid "" -"Return element of *o* corresponding to the string *key* or ``NULL`` on " -"failure. This is the equivalent of the Python expression ``o[key]``. See " -"also :c:func:`PyObject_GetItem`." +"This is the same as :c:func:`PyObject_GetItem`, but *key* is specified as a :" +"c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" +"`PyObject*`." msgstr "" #: ../../c-api/mapping.rst:38 msgid "" -"Map the string *key* to the value *v* in object *o*. Returns ``-1`` on " -"failure. This is the equivalent of the Python statement ``o[key] = v``. See " -"also :c:func:`PyObject_SetItem`. This function *does not* steal a reference " -"to *v*." +"This is the same as :c:func:`PyObject_SetItem`, but *key* is specified as a :" +"c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" +"`PyObject*`." msgstr "" -#: ../../c-api/mapping.rst:46 -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]``. This " -"is an alias of :c:func:`PyObject_DelItem`." +#: ../../c-api/mapping.rst:45 +msgid "This is an alias of :c:func:`PyObject_DelItem`." msgstr "" -#: ../../c-api/mapping.rst:53 +#: ../../c-api/mapping.rst:50 msgid "" -"Remove the mapping for the string *key* from the object *o*. Return ``-1`` " -"on failure. This is equivalent to the Python statement ``del o[key]``." +"This is the same as :c:func:`PyObject_DelItem`, but *key* is specified as a :" +"c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" +"`PyObject*`." msgstr "" -#: ../../c-api/mapping.rst:59 ../../c-api/mapping.rst:70 +#: ../../c-api/mapping.rst:57 msgid "" "Return ``1`` if the mapping object has the key *key* and ``0`` otherwise. " "This is equivalent to the Python expression ``key in o``. This function " @@ -80,37 +77,43 @@ msgstr "" #: ../../c-api/mapping.rst:63 msgid "" -"Note that exceptions which occur while calling the :meth:`~object." -"__getitem__` method will get suppressed. To get error reporting use :c:func:" +"Exceptions which occur when this calls :meth:`~object.__getitem__` method " +"are silently ignored. For proper error handling, use :c:func:" "`PyObject_GetItem()` instead." msgstr "" -#: ../../c-api/mapping.rst:74 +#: ../../c-api/mapping.rst:70 +msgid "" +"This is the same as :c:func:`PyMapping_HasKey`, but *key* is specified as a :" +"c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" +"`PyObject*`." +msgstr "" + +#: ../../c-api/mapping.rst:76 msgid "" -"Note that exceptions which occur while calling the :meth:`~object." -"__getitem__` method and creating a temporary string object will get " -"suppressed. To get error reporting use :c:func:`PyMapping_GetItemString()` " -"instead." +"Exceptions that occur when this calls :meth:`~object.__getitem__` method or " +"while creating the temporary :class:`str` object are silently ignored. For " +"proper error handling, use :c:func:`PyMapping_GetItemString` instead." msgstr "" -#: ../../c-api/mapping.rst:81 +#: ../../c-api/mapping.rst:84 msgid "" "On success, return a list of the keys in object *o*. On failure, return " "``NULL``." msgstr "" -#: ../../c-api/mapping.rst:84 ../../c-api/mapping.rst:93 -#: ../../c-api/mapping.rst:102 +#: ../../c-api/mapping.rst:87 ../../c-api/mapping.rst:96 +#: ../../c-api/mapping.rst:105 msgid "Previously, the function returned a list or a tuple." msgstr "" -#: ../../c-api/mapping.rst:90 +#: ../../c-api/mapping.rst:93 msgid "" "On success, return a list of the values in object *o*. On failure, return " "``NULL``." msgstr "" -#: ../../c-api/mapping.rst:99 +#: ../../c-api/mapping.rst:102 msgid "" "On success, return a list of the items in object *o*, where each item is a " "tuple containing a key-value pair. On failure, return ``NULL``." diff --git a/c-api/object.po b/c-api/object.po index 26c27baa4c..87c4863fc6 100644 --- a/c-api/object.po +++ b/c-api/object.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-09 00:03+0000\n" +"POT-Creation-Date: 2023-09-03 00:03+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-" @@ -43,7 +43,7 @@ msgid "" "the object is written instead of the :func:`repr`." msgstr "" -#: ../../c-api/object.rst:32 ../../c-api/object.rst:45 +#: ../../c-api/object.rst:32 msgid "" "Returns ``1`` if *o* has the attribute *attr_name*, and ``0`` otherwise. " "This is equivalent to the Python expression ``hasattr(o, attr_name)``. This " @@ -57,6 +57,13 @@ msgid "" "handling, use :c:func:`PyObject_GetAttr` instead." msgstr "" +#: ../../c-api/object.rst:45 +msgid "" +"This is the same as :c:func:`PyObject_HasAttr`, but *attr_name* is specified " +"as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" +"`PyObject*`." +msgstr "" + #: ../../c-api/object.rst:51 msgid "" "Exceptions that occur when this calls :meth:`~object.__getattr__` and :meth:" @@ -74,9 +81,9 @@ msgstr "" #: ../../c-api/object.rst:66 msgid "" -"Retrieve an attribute named *attr_name* from object *o*. Returns the " -"attribute value on success, or ``NULL`` on failure. This is the equivalent " -"of the Python expression ``o.attr_name``." +"This is the same as :c:func:`PyObject_GetAttr`, but *attr_name* is specified " +"as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" +"`PyObject*`." msgstr "" #: ../../c-api/object.rst:73 @@ -89,7 +96,7 @@ msgid "" "descriptors don't. Otherwise, an :exc:`AttributeError` is raised." msgstr "" -#: ../../c-api/object.rst:83 ../../c-api/object.rst:95 +#: ../../c-api/object.rst:83 msgid "" "Set the value of the attribute named *attr_name*, for object *o*, to the " "value *v*. Raise an exception and return ``-1`` on failure; return ``0`` on " @@ -103,13 +110,20 @@ msgid "" "plans to remove it." msgstr "" -#: ../../c-api/object.rst:100 +#: ../../c-api/object.rst:95 +msgid "" +"This is the same as :c:func:`PyObject_SetAttr`, but *attr_name* is specified " +"as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" +"`PyObject*`." +msgstr "" + +#: ../../c-api/object.rst:99 msgid "" "If *v* is ``NULL``, the attribute is deleted, but this feature is deprecated " "in favour of using :c:func:`PyObject_DelAttrString`." msgstr "" -#: ../../c-api/object.rst:106 +#: ../../c-api/object.rst:105 msgid "" "Generic attribute setter and deleter function that is meant to be put into a " "type object's :c:member:`~PyTypeObject.tp_setattro` slot. It looks for a " @@ -121,12 +135,19 @@ msgid "" "returned." msgstr "" -#: ../../c-api/object.rst:118 ../../c-api/object.rst:124 +#: ../../c-api/object.rst:117 msgid "" "Delete attribute named *attr_name*, for object *o*. Returns ``-1`` on " "failure. This is the equivalent of the Python statement ``del o.attr_name``." msgstr "" +#: ../../c-api/object.rst:123 +msgid "" +"This is the same as :c:func:`PyObject_DelAttr`, but *attr_name* is specified " +"as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" +"`PyObject*`." +msgstr "" + #: ../../c-api/object.rst:130 msgid "" "A generic implementation for the getter of a ``__dict__`` descriptor. It " diff --git a/c-api/stable.po b/c-api/stable.po index 59f5a6d71c..ea5b0c5350 100644 --- a/c-api/stable.po +++ b/c-api/stable.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-08-29 12:27+0000\n" "PO-Revision-Date: 2023-01-24 21:07+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -48,7 +48,7 @@ msgstr "" "行,反之亦然,但 3.9.x 和 3.10.x 就需要分別編譯。" #: ../../c-api/stable.rst:21 -msgid "There are two tiers of C API with different stability exepectations:" +msgid "There are two tiers of C API with different stability expectations:" msgstr "" #: ../../c-api/stable.rst:23 @@ -147,9 +147,9 @@ msgid "" "the specified one onward, and can use Limited API introduced up to that " "version." msgstr "" -"將 ``Py_LIMITED_API`` 定義為對應於你的擴充有支援的最低 Python 版本的 :c:macro:" -"`PY_VERSION_HEX` 值。該擴充無需重新編譯即可與從指定版本開始的所有 Python 3 版" -"本一起使用,並且可以使用過去版本有引入的受限 API。" +"將 ``Py_LIMITED_API`` 定義為對應於你的擴充有支援的最低 Python 版本的 :c:" +"macro:`PY_VERSION_HEX` 值。該擴充無需重新編譯即可與從指定版本開始的所有 " +"Python 3 版本一起使用,並且可以使用過去版本有引入的受限 API。" #: ../../c-api/stable.rst:83 msgid "" diff --git a/c-api/typeobj.po b/c-api/typeobj.po index 7b0d0db989..1c052f1ed6 100644 --- a/c-api/typeobj.po +++ b/c-api/typeobj.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-18 00:03+0000\n" +"POT-Creation-Date: 2023-08-29 12:27+0000\n" "PO-Revision-Date: 2018-05-23 14:33+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2610,7 +2610,7 @@ msgstr "" #: ../../c-api/typeobj.rst:1730 msgid "" "Some types may not store their dictionary in this slot. Use :c:func:" -"`PyType_GetDict` to retreive the dictionary for an arbitrary type." +"`PyType_GetDict` to retrieve the dictionary for an arbitrary type." msgstr "" #: ../../c-api/typeobj.rst:1736 diff --git a/faq/gui.po b/faq/gui.po index d22809b8e0..8526ae7277 100644 --- a/faq/gui.po +++ b/faq/gui.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-09-28 00:27+0000\n" +"POT-Creation-Date: 2023-09-05 00:04+0000\n" "PO-Revision-Date: 2022-07-02 17:41+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -86,11 +86,11 @@ msgstr "" #: ../../faq/gui.rst:45 msgid "" "One solution is to ship the application with the Tcl and Tk libraries, and " -"point to them at run-time using the :envvar:`TCL_LIBRARY` and :envvar:" -"`TK_LIBRARY` environment variables." +"point to them at run-time using the :envvar:`!TCL_LIBRARY` and :envvar:`!" +"TK_LIBRARY` environment variables." msgstr "" "將應用程式與 Tcl 和 Tk 函式庫一併發送是一種解決方法,並在執行環境 (run-time) " -"使用 :envvar:`TCL_LIBRARY` 和 :envvar:`TK_LIBRARY` 環境變數來指向該函式庫。" +"使用 :envvar:`!TCL_LIBRARY` 和 :envvar:`!TK_LIBRARY` 環境變數來指向該函式庫。" #: ../../faq/gui.rst:49 msgid "" @@ -105,12 +105,12 @@ msgstr "" #: ../../faq/gui.rst:54 msgid "" -"Build Tix with SAM enabled, perform the appropriate call to :c:func:" -"`Tclsam_init`, etc. inside Python's :file:`Modules/tkappinit.c`, and link " +"Build Tix with SAM enabled, perform the appropriate call to :c:func:`!" +"Tclsam_init`, etc. inside Python's :file:`Modules/tkappinit.c`, and link " "with libtclsam and libtksam (you might include the Tix libraries as well)." msgstr "" "請在 SAM 被啟用的情況下建置 Tix,對 Python 的 :file:`Modules/tkappinit.c` 中" -"的 :c:func:`Tclsam_init` 等函式執行適當的呼叫,並與 libtclsam 和 libtksam 連" +"的 :c:func:`!Tclsam_init` 等函式執行適當的呼叫,並與 libtclsam 和 libtksam 連" "結(你可能也會 include Tix 函式庫)。" #: ../../faq/gui.rst:61 @@ -121,14 +121,14 @@ msgstr "是否可以在等待 I/O 時處理 Tk 事件?" msgid "" "On platforms other than Windows, yes, and you don't even need threads! But " "you'll have to restructure your I/O code a bit. Tk has the equivalent of " -"Xt's :c:func:`XtAddInput()` call, which allows you to register a callback " +"Xt's :c:func:`!XtAddInput` call, which allows you to register a callback " "function which will be called from the Tk mainloop when I/O is possible on a " "file descriptor. See :ref:`tkinter-file-handlers`." msgstr "" "在 Windows 以外的平台上是可以的,你甚至不需要執行緒!但是,你必須稍微調整你" -"的 I/O 程式碼。Tk 具有等效於 Xt 的 :c:func:`XtAddInput()` 的函式呼叫,它能讓" -"你記錄一個回呼 (callback) 函式,當 I/O 在一個檔案描述符 (file descriptor) 上" -"可進行時,該函式將會從 Tk mainloop 被呼叫。請參閱\\ :ref:`tkinter-file-" +"的 I/O 程式碼。Tk 具有等效於 Xt 的 :c:func:`!XtAddInput` 的函式呼叫,它能讓你" +"記錄一個回呼 (callback) 函式,當 I/O 在一個檔案描述符 (file descriptor) 上可" +"進行時,該函式將會從 Tk mainloop 被呼叫。請參閱\\ :ref:`tkinter-file-" "handlers`。" #: ../../faq/gui.rst:71 @@ -137,14 +137,15 @@ msgstr "我無法讓鍵繫結 (key binding) 在 Tkinter 中作用:為什麼? #: ../../faq/gui.rst:73 msgid "" -"An often-heard complaint is that event handlers bound to events with the :" -"meth:`bind` method don't get handled even when the appropriate key is " -"pressed." +"An often-heard complaint is that event handlers :ref:`bound ` to events with the :meth:`!bind` method don't get handled even when " +"the appropriate key is pressed." msgstr "" -"一個經常聽到的抱怨是,儘管事件處理程式 (event handler) 已經繫結到帶有 :meth:" -"`bind` method 的事件,但在按下相應的鍵時,該事件也沒有被處理。" +"一個經常聽到的抱怨是,儘管事件處理程式 (event handler) 已經\\ :ref:`繫結" +"`\\ 到帶有 :meth:`!bind` method 的事件,但在按下相應的鍵" +"時,該事件也沒有被處理。" -#: ../../faq/gui.rst:76 +#: ../../faq/gui.rst:77 msgid "" "The most common cause is that the widget to which the binding applies " "doesn't have \"keyboard focus\". Check out the Tk documentation for the " diff --git a/howto/enum.po b/howto/enum.po index 2c8f289c56..b8dfcac179 100644 --- a/howto/enum.po +++ b/howto/enum.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-09-01 00:03+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -323,33 +323,41 @@ msgstr "" #: ../../howto/enum.rst:429 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." +"Note: if your enumeration defines :meth:`__new__` and/or :meth:`__init__`, " +"any value(s) given to the enum member will be passed into those methods. See " +"`Planet`_ for an example." msgstr "" #: ../../howto/enum.rst:435 +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. See :ref:`new-vs-init` for " +"more details." +msgstr "" + +#: ../../howto/enum.rst:442 msgid "Restricted Enum subclassing" msgstr "" -#: ../../howto/enum.rst:437 +#: ../../howto/enum.rst:444 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:444 +#: ../../howto/enum.rst:451 msgid "" "Also, subclassing an enumeration is allowed only if the enumeration does not " "define any members. So this is forbidden::" msgstr "" -#: ../../howto/enum.rst:454 +#: ../../howto/enum.rst:461 msgid "But this is allowed::" msgstr "" -#: ../../howto/enum.rst:465 +#: ../../howto/enum.rst:472 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 " @@ -357,78 +365,78 @@ msgid "" "enumerations. (See `OrderedEnum`_ for an example.)" msgstr "" -#: ../../howto/enum.rst:474 +#: ../../howto/enum.rst:481 msgid "Dataclass support" msgstr "" -#: ../../howto/enum.rst:476 +#: ../../howto/enum.rst:483 msgid "" "When inheriting from a :class:`~dataclasses.dataclass`, the :meth:`~Enum." "__repr__` omits the inherited class' name. For example::" msgstr "" -#: ../../howto/enum.rst:492 +#: ../../howto/enum.rst:499 msgid "" "Use the :func:`!dataclass` argument ``repr=False`` to use the standard :func:" "`repr`." msgstr "" -#: ../../howto/enum.rst:495 +#: ../../howto/enum.rst:502 msgid "" "Only the dataclass fields are shown in the value area, not the dataclass' " "name." msgstr "" -#: ../../howto/enum.rst:501 +#: ../../howto/enum.rst:508 msgid "Pickling" msgstr "" -#: ../../howto/enum.rst:503 +#: ../../howto/enum.rst:510 msgid "Enumerations can be pickled and unpickled::" msgstr "" -#: ../../howto/enum.rst:510 +#: ../../howto/enum.rst:517 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:516 +#: ../../howto/enum.rst:523 msgid "" "With pickle protocol version 4 it is possible to easily pickle enums nested " "in other classes." msgstr "" -#: ../../howto/enum.rst:519 +#: ../../howto/enum.rst:526 msgid "" "It is possible to modify how enum members are pickled/unpickled by defining :" "meth:`__reduce_ex__` in the enumeration class. The default method is by-" "value, but enums with complicated values may want to use by-name::" msgstr "" -#: ../../howto/enum.rst:528 +#: ../../howto/enum.rst:535 msgid "" "Using by-name for flags is not recommended, as unnamed aliases will not " "unpickle." msgstr "" -#: ../../howto/enum.rst:533 +#: ../../howto/enum.rst:540 msgid "Functional API" msgstr "" -#: ../../howto/enum.rst:535 +#: ../../howto/enum.rst:542 msgid "" "The :class:`Enum` class is callable, providing the following functional API::" msgstr "" -#: ../../howto/enum.rst:545 +#: ../../howto/enum.rst:552 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:548 +#: ../../howto/enum.rst:555 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-" @@ -440,14 +448,14 @@ msgid "" "assignment to :class:`Animal` is equivalent to::" msgstr "" -#: ../../howto/enum.rst:564 +#: ../../howto/enum.rst:571 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:568 +#: ../../howto/enum.rst:575 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 " @@ -456,14 +464,14 @@ msgid "" "Jython). The solution is to specify the module name explicitly as follows::" msgstr "" -#: ../../howto/enum.rst:578 +#: ../../howto/enum.rst:585 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:582 +#: ../../howto/enum.rst:589 msgid "" "The new pickle protocol 4 also, in some circumstances, relies on :attr:" "`~definition.__qualname__` being set to the location where pickle will be " @@ -471,7 +479,7 @@ msgid "" "class SomeData in the global scope::" msgstr "" -#: ../../howto/enum.rst:589 +#: ../../howto/enum.rst:596 msgid "The complete signature is::" msgstr "" @@ -479,7 +487,7 @@ msgstr "" msgid "value" msgstr "" -#: ../../howto/enum.rst:601 +#: ../../howto/enum.rst:608 msgid "What the new enum class will record as its name." msgstr "" @@ -487,21 +495,21 @@ msgstr "" msgid "names" msgstr "" -#: ../../howto/enum.rst:603 +#: ../../howto/enum.rst:610 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:608 +#: ../../howto/enum.rst:615 msgid "or an iterator of names::" msgstr "" -#: ../../howto/enum.rst:612 +#: ../../howto/enum.rst:619 msgid "or an iterator of (name, value) pairs::" msgstr "" -#: ../../howto/enum.rst:616 +#: ../../howto/enum.rst:623 msgid "or a mapping::" msgstr "" @@ -509,7 +517,7 @@ msgstr "" msgid "module" msgstr "" -#: ../../howto/enum.rst:620 +#: ../../howto/enum.rst:627 msgid "name of module where new enum class can be found." msgstr "" @@ -517,7 +525,7 @@ msgstr "" msgid "qualname" msgstr "" -#: ../../howto/enum.rst:622 +#: ../../howto/enum.rst:629 msgid "where in module new enum class can be found." msgstr "" @@ -525,7 +533,7 @@ msgstr "" msgid "type" msgstr "" -#: ../../howto/enum.rst:624 +#: ../../howto/enum.rst:631 msgid "type to mix in to new enum class." msgstr "" @@ -533,23 +541,23 @@ msgstr "" msgid "start" msgstr "" -#: ../../howto/enum.rst:626 +#: ../../howto/enum.rst:633 msgid "number to start counting at if only names are passed in." msgstr "" -#: ../../howto/enum.rst:628 +#: ../../howto/enum.rst:635 msgid "The *start* parameter was added." msgstr "" -#: ../../howto/enum.rst:633 +#: ../../howto/enum.rst:640 msgid "Derived Enumerations" msgstr "" -#: ../../howto/enum.rst:636 +#: ../../howto/enum.rst:643 msgid "IntEnum" msgstr "" -#: ../../howto/enum.rst:638 +#: ../../howto/enum.rst:645 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 " @@ -557,22 +565,22 @@ msgid "" "each other::" msgstr "" -#: ../../howto/enum.rst:659 +#: ../../howto/enum.rst:666 msgid "" "However, they still can't be compared to standard :class:`Enum` " "enumerations::" msgstr "" -#: ../../howto/enum.rst:672 +#: ../../howto/enum.rst:679 msgid "" ":class:`IntEnum` values behave like integers in other ways you'd expect::" msgstr "" -#: ../../howto/enum.rst:683 +#: ../../howto/enum.rst:690 msgid "StrEnum" msgstr "" -#: ../../howto/enum.rst:685 +#: ../../howto/enum.rst:692 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; " @@ -580,11 +588,11 @@ msgid "" "each other." msgstr "" -#: ../../howto/enum.rst:694 +#: ../../howto/enum.rst:701 msgid "IntFlag" msgstr "" -#: ../../howto/enum.rst:696 +#: ../../howto/enum.rst:703 msgid "" "The next variation of :class:`Enum` provided, :class:`IntFlag`, is also " "based on :class:`int`. The difference being :class:`IntFlag` members can be " @@ -594,60 +602,60 @@ msgid "" "is used." msgstr "" -#: ../../howto/enum.rst:704 +#: ../../howto/enum.rst:711 msgid "" "Any operation on an :class:`IntFlag` member besides the bit-wise operations " "will lose the :class:`IntFlag` membership." msgstr "" -#: ../../howto/enum.rst:707 +#: ../../howto/enum.rst:714 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:714 +#: ../../howto/enum.rst:721 msgid "Sample :class:`IntFlag` class::" msgstr "" -#: ../../howto/enum.rst:730 +#: ../../howto/enum.rst:737 msgid "It is also possible to name the combinations::" msgstr "" -#: ../../howto/enum.rst:747 +#: ../../howto/enum.rst:754 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:752 +#: ../../howto/enum.rst:759 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:760 +#: ../../howto/enum.rst:767 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:771 +#: ../../howto/enum.rst:778 msgid "" "The negation operator, ``~``, always returns an :class:`IntFlag` member with " "a positive value::" msgstr "" -#: ../../howto/enum.rst:777 +#: ../../howto/enum.rst:784 msgid ":class:`IntFlag` members can also be iterated over::" msgstr "" -#: ../../howto/enum.rst:786 +#: ../../howto/enum.rst:793 msgid "Flag" msgstr "" -#: ../../howto/enum.rst:788 +#: ../../howto/enum.rst:795 msgid "" "The last variation is :class:`Flag`. Like :class:`IntFlag`, :class:`Flag` " "members can be combined using the bitwise operators (&, \\|, ^, ~). Unlike :" @@ -657,29 +665,29 @@ msgid "" "value and let :class:`Flag` select an appropriate value." msgstr "" -#: ../../howto/enum.rst:797 +#: ../../howto/enum.rst:804 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:811 +#: ../../howto/enum.rst:818 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:823 +#: ../../howto/enum.rst:830 msgid "" "Giving a name to the \"no flags set\" condition does not change its boolean " "value::" msgstr "" -#: ../../howto/enum.rst:837 +#: ../../howto/enum.rst:844 msgid ":class:`Flag` members can also be iterated over::" msgstr "" -#: ../../howto/enum.rst:847 +#: ../../howto/enum.rst:854 msgid "" "For the majority of new code, :class:`Enum` and :class:`Flag` are strongly " "recommended, since :class:`IntEnum` and :class:`IntFlag` break some semantic " @@ -690,42 +698,42 @@ msgid "" "enumerations, or for interoperability with other systems." msgstr "" -#: ../../howto/enum.rst:857 +#: ../../howto/enum.rst:864 msgid "Others" msgstr "" -#: ../../howto/enum.rst:859 +#: ../../howto/enum.rst:866 msgid "" "While :class:`IntEnum` is part of the :mod:`enum` module, it would be very " "simple to implement independently::" msgstr "" -#: ../../howto/enum.rst:865 +#: ../../howto/enum.rst:872 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:868 +#: ../../howto/enum.rst:875 msgid "Some rules:" msgstr "" -#: ../../howto/enum.rst:870 +#: ../../howto/enum.rst:877 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:873 +#: ../../howto/enum.rst:880 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:876 +#: ../../howto/enum.rst:883 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:" @@ -733,163 +741,169 @@ msgid "" "methods and don't specify another type." msgstr "" -#: ../../howto/enum.rst:880 +#: ../../howto/enum.rst:887 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:883 +#: ../../howto/enum.rst:890 msgid "" "A ``data type`` is a mixin that defines :meth:`__new__`, or a :class:" "`~dataclasses.dataclass`" msgstr "" -#: ../../howto/enum.rst:885 +#: ../../howto/enum.rst:892 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:888 +#: ../../howto/enum.rst:895 msgid "" ":ref:`Formatted string literals `, :meth:`str.format`, and :func:" "`format` will use the enum's :meth:`__str__` method." msgstr "" -#: ../../howto/enum.rst:893 +#: ../../howto/enum.rst:900 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:899 +#: ../../howto/enum.rst:908 msgid "When to use :meth:`__new__` vs. :meth:`__init__`" msgstr "" -#: ../../howto/enum.rst:901 +#: ../../howto/enum.rst:910 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:905 +#: ../../howto/enum.rst:914 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:932 +#: ../../howto/enum.rst:941 +msgid "" +"*Do not* call ``super().__new__()``, as the lookup-only ``__new__`` is the " +"one that is found; instead, use the data type directly." +msgstr "" + +#: ../../howto/enum.rst:946 msgid "Finer Points" msgstr "" -#: ../../howto/enum.rst:935 +#: ../../howto/enum.rst:949 msgid "Supported ``__dunder__`` names" msgstr "" -#: ../../howto/enum.rst:937 +#: ../../howto/enum.rst:951 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:940 +#: ../../howto/enum.rst:954 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:946 +#: ../../howto/enum.rst:960 msgid "Supported ``_sunder_`` names" msgstr "" -#: ../../howto/enum.rst:948 +#: ../../howto/enum.rst:962 msgid "``_name_`` -- name of the member" msgstr "" -#: ../../howto/enum.rst:949 +#: ../../howto/enum.rst:963 msgid "" "``_value_`` -- value of the member; can be set / modified in ``__new__``" msgstr "" -#: ../../howto/enum.rst:951 +#: ../../howto/enum.rst:965 msgid "" "``_missing_`` -- a lookup function used when a value is not found; may be " "overridden" msgstr "" -#: ../../howto/enum.rst:953 +#: ../../howto/enum.rst:967 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:956 +#: ../../howto/enum.rst:970 msgid "" "``_order_`` -- used in Python 2/3 code to ensure member order is consistent " "(class attribute, removed during class creation)" msgstr "" -#: ../../howto/enum.rst:958 +#: ../../howto/enum.rst:972 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:964 +#: ../../howto/enum.rst:978 msgid "" "For standard :class:`Enum` classes the next value chosen is the last value " "seen incremented by one." msgstr "" -#: ../../howto/enum.rst:967 +#: ../../howto/enum.rst:981 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:970 +#: ../../howto/enum.rst:984 msgid "``_missing_``, ``_order_``, ``_generate_next_value_``" msgstr "" -#: ../../howto/enum.rst:971 +#: ../../howto/enum.rst:985 msgid "``_ignore_``" msgstr "" -#: ../../howto/enum.rst:973 +#: ../../howto/enum.rst:987 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:991 +#: ../../howto/enum.rst:1005 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:996 +#: ../../howto/enum.rst:1010 msgid "_Private__names" msgstr "" -#: ../../howto/enum.rst:998 +#: ../../howto/enum.rst:1012 msgid "" ":ref:`Private names ` are not converted to enum " "members, but remain normal attributes." msgstr "" -#: ../../howto/enum.rst:1005 +#: ../../howto/enum.rst:1019 msgid "``Enum`` member type" msgstr "" -#: ../../howto/enum.rst:1007 +#: ../../howto/enum.rst:1021 msgid "" "Enum members are instances of their enum class, and are normally accessed as " "``EnumClass.member``. In certain situations, such as writing custom enum " @@ -899,22 +913,22 @@ msgid "" "strongly recommended." msgstr "" -#: ../../howto/enum.rst:1018 +#: ../../howto/enum.rst:1032 msgid "Creating members that are mixed with other data types" msgstr "" -#: ../../howto/enum.rst:1020 +#: ../../howto/enum.rst:1034 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:1032 +#: ../../howto/enum.rst:1046 msgid "Boolean value of ``Enum`` classes and members" msgstr "" -#: ../../howto/enum.rst:1034 +#: ../../howto/enum.rst:1048 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 " @@ -923,137 +937,137 @@ msgid "" "your class::" msgstr "" -#: ../../howto/enum.rst:1043 +#: ../../howto/enum.rst:1057 msgid "Plain :class:`Enum` classes always evaluate as :data:`True`." msgstr "" -#: ../../howto/enum.rst:1047 +#: ../../howto/enum.rst:1061 msgid "``Enum`` classes with methods" msgstr "" -#: ../../howto/enum.rst:1049 +#: ../../howto/enum.rst:1063 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:1060 +#: ../../howto/enum.rst:1074 msgid "Combining members of ``Flag``" msgstr "" -#: ../../howto/enum.rst:1062 +#: ../../howto/enum.rst:1076 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:1080 +#: ../../howto/enum.rst:1094 msgid "``Flag`` and ``IntFlag`` minutia" msgstr "" -#: ../../howto/enum.rst:1082 +#: ../../howto/enum.rst:1096 msgid "Using the following snippet for our examples::" msgstr "" -#: ../../howto/enum.rst:1093 +#: ../../howto/enum.rst:1107 msgid "the following are true:" msgstr "" -#: ../../howto/enum.rst:1095 +#: ../../howto/enum.rst:1109 msgid "single-bit flags are canonical" msgstr "" -#: ../../howto/enum.rst:1096 +#: ../../howto/enum.rst:1110 msgid "multi-bit and zero-bit flags are aliases" msgstr "" -#: ../../howto/enum.rst:1097 +#: ../../howto/enum.rst:1111 msgid "only canonical flags are returned during iteration::" msgstr "" -#: ../../howto/enum.rst:1102 +#: ../../howto/enum.rst:1116 msgid "" "negating a flag or flag set returns a new flag/flag set with the " "corresponding positive integer value::" msgstr "" -#: ../../howto/enum.rst:1111 +#: ../../howto/enum.rst:1125 msgid "names of pseudo-flags are constructed from their members' names::" msgstr "" -#: ../../howto/enum.rst:1116 +#: ../../howto/enum.rst:1130 msgid "multi-bit flags, aka aliases, can be returned from operations::" msgstr "" -#: ../../howto/enum.rst:1127 +#: ../../howto/enum.rst:1141 msgid "" "membership / containment checking: zero-valued flags are always considered " "to be contained::" msgstr "" -#: ../../howto/enum.rst:1133 +#: ../../howto/enum.rst:1147 msgid "" "otherwise, only if all bits of one flag are in the other flag will True be " "returned::" msgstr "" -#: ../../howto/enum.rst:1142 +#: ../../howto/enum.rst:1156 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:1145 +#: ../../howto/enum.rst:1159 msgid "STRICT --> raises an exception when presented with invalid values" msgstr "" -#: ../../howto/enum.rst:1146 +#: ../../howto/enum.rst:1160 msgid "CONFORM --> discards any invalid bits" msgstr "" -#: ../../howto/enum.rst:1147 +#: ../../howto/enum.rst:1161 msgid "EJECT --> lose Flag status and become a normal int with the given value" msgstr "" -#: ../../howto/enum.rst:1151 +#: ../../howto/enum.rst:1165 msgid "KEEP --> keep the extra bits" msgstr "" -#: ../../howto/enum.rst:1149 +#: ../../howto/enum.rst:1163 msgid "keeps Flag status and extra bits" msgstr "" -#: ../../howto/enum.rst:1150 +#: ../../howto/enum.rst:1164 msgid "extra bits do not show up in iteration" msgstr "" -#: ../../howto/enum.rst:1151 +#: ../../howto/enum.rst:1165 msgid "extra bits do show up in repr() and str()" msgstr "" -#: ../../howto/enum.rst:1153 +#: ../../howto/enum.rst:1167 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:1161 +#: ../../howto/enum.rst:1175 msgid "How are Enums and Flags different?" msgstr "" -#: ../../howto/enum.rst:1163 +#: ../../howto/enum.rst:1177 msgid "" "Enums have a custom metaclass that affects many aspects of both derived :" "class:`Enum` classes and their instances (members)." msgstr "" -#: ../../howto/enum.rst:1168 +#: ../../howto/enum.rst:1182 msgid "Enum Classes" msgstr "" -#: ../../howto/enum.rst:1170 +#: ../../howto/enum.rst:1184 msgid "" "The :class:`EnumType` metaclass is responsible for providing the :meth:" "`__contains__`, :meth:`__dir__`, :meth:`__iter__` and other methods that " @@ -1064,11 +1078,11 @@ msgid "" "`__getnewargs__`, :meth:`__str__` and :meth:`__repr__`)." msgstr "" -#: ../../howto/enum.rst:1179 +#: ../../howto/enum.rst:1193 msgid "Flag Classes" msgstr "" -#: ../../howto/enum.rst:1181 +#: ../../howto/enum.rst:1195 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 " @@ -1077,11 +1091,11 @@ msgid "" "considered an alias." msgstr "" -#: ../../howto/enum.rst:1187 +#: ../../howto/enum.rst:1201 msgid "Enum Members (aka instances)" msgstr "" -#: ../../howto/enum.rst:1189 +#: ../../howto/enum.rst:1203 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 " @@ -1090,37 +1104,37 @@ msgid "" "instances." msgstr "" -#: ../../howto/enum.rst:1195 +#: ../../howto/enum.rst:1209 msgid "Flag Members" msgstr "" -#: ../../howto/enum.rst:1197 +#: ../../howto/enum.rst:1211 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:1203 +#: ../../howto/enum.rst:1217 msgid "(Note that ``BLACK``, ``PURPLE``, and ``WHITE`` do not show up.)" msgstr "" -#: ../../howto/enum.rst:1205 +#: ../../howto/enum.rst:1219 msgid "" "Inverting a flag member returns the corresponding positive value, rather " "than a negative value --- for example::" msgstr "" -#: ../../howto/enum.rst:1211 +#: ../../howto/enum.rst:1225 msgid "" "Flag members have a length corresponding to the number of power-of-two " "values they contain. For example::" msgstr "" -#: ../../howto/enum.rst:1221 +#: ../../howto/enum.rst:1235 msgid "Enum Cookbook" msgstr "" -#: ../../howto/enum.rst:1224 +#: ../../howto/enum.rst:1238 msgid "" "While :class:`Enum`, :class:`IntEnum`, :class:`StrEnum`, :class:`Flag`, and :" "class:`IntFlag` are expected to cover the majority of use-cases, they cannot " @@ -1128,149 +1142,155 @@ msgid "" "that can be used directly, or as examples for creating one's own." msgstr "" -#: ../../howto/enum.rst:1231 +#: ../../howto/enum.rst:1245 msgid "Omitting values" msgstr "" -#: ../../howto/enum.rst:1233 +#: ../../howto/enum.rst:1247 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:1236 +#: ../../howto/enum.rst:1250 msgid "use instances of :class:`auto` for the value" msgstr "" -#: ../../howto/enum.rst:1237 +#: ../../howto/enum.rst:1251 msgid "use instances of :class:`object` as the value" msgstr "" -#: ../../howto/enum.rst:1238 +#: ../../howto/enum.rst:1252 msgid "use a descriptive string as the value" msgstr "" -#: ../../howto/enum.rst:1239 +#: ../../howto/enum.rst:1253 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:1242 +#: ../../howto/enum.rst:1256 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:1248 +#: ../../howto/enum.rst:1262 msgid "Using :class:`auto`" msgstr "" -#: ../../howto/enum.rst:1250 +#: ../../howto/enum.rst:1264 msgid "Using :class:`auto` would look like::" msgstr "" -#: ../../howto/enum.rst:1262 +#: ../../howto/enum.rst:1276 msgid "Using :class:`object`" msgstr "" -#: ../../howto/enum.rst:1264 +#: ../../howto/enum.rst:1278 msgid "Using :class:`object` would look like::" msgstr "" -#: ../../howto/enum.rst:1274 +#: ../../howto/enum.rst:1288 msgid "" "This is also a good example of why you might want to write your own :meth:" "`__repr__`::" msgstr "" -#: ../../howto/enum.rst:1290 +#: ../../howto/enum.rst:1304 msgid "Using a descriptive string" msgstr "" -#: ../../howto/enum.rst:1292 +#: ../../howto/enum.rst:1306 msgid "Using a string as the value would look like::" msgstr "" -#: ../../howto/enum.rst:1304 +#: ../../howto/enum.rst:1318 msgid "Using a custom :meth:`__new__`" msgstr "" -#: ../../howto/enum.rst:1306 +#: ../../howto/enum.rst:1320 msgid "Using an auto-numbering :meth:`__new__` would look like::" msgstr "" -#: ../../howto/enum.rst:1323 +#: ../../howto/enum.rst:1337 msgid "" "To make a more general purpose ``AutoNumber``, add ``*args`` to the " "signature::" msgstr "" -#: ../../howto/enum.rst:1333 +#: ../../howto/enum.rst:1347 msgid "" "Then when you inherit from ``AutoNumber`` you can write your own " "``__init__`` to handle any extra arguments::" msgstr "" -#: ../../howto/enum.rst:1352 +#: ../../howto/enum.rst:1366 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:1358 +#: ../../howto/enum.rst:1372 +msgid "" +"*Do not* call ``super().__new__()``, as the lookup-only ``__new__`` is the " +"one that is found; instead, use the data type directly -- e.g.::" +msgstr "" + +#: ../../howto/enum.rst:1379 msgid "OrderedEnum" msgstr "" -#: ../../howto/enum.rst:1360 +#: ../../howto/enum.rst:1381 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:1394 +#: ../../howto/enum.rst:1415 msgid "DuplicateFreeEnum" msgstr "" -#: ../../howto/enum.rst:1396 +#: ../../howto/enum.rst:1417 msgid "" "Raises an error if a duplicate member value is found instead of creating an " "alias::" msgstr "" -#: ../../howto/enum.rst:1421 +#: ../../howto/enum.rst:1442 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:1427 +#: ../../howto/enum.rst:1448 msgid "Planet" msgstr "" -#: ../../howto/enum.rst:1429 +#: ../../howto/enum.rst:1450 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:1458 +#: ../../howto/enum.rst:1479 msgid "TimePeriod" msgstr "" -#: ../../howto/enum.rst:1460 +#: ../../howto/enum.rst:1481 msgid "An example to show the :attr:`_ignore_` attribute in use::" msgstr "" -#: ../../howto/enum.rst:1479 +#: ../../howto/enum.rst:1500 msgid "Subclassing EnumType" msgstr "" -#: ../../howto/enum.rst:1481 +#: ../../howto/enum.rst:1502 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 aff058ea1a..31e89a4211 100644 --- a/howto/logging-cookbook.po +++ b/howto/logging-cookbook.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-08-31 00:03+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-" @@ -357,9 +357,9 @@ msgstr "" 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 " -"overriding the :meth:`~handlers.SocketHandler.makePickle` method and " -"implementing your alternative there, as well as adapting the above script to " -"use your alternative serialization." +"overriding the :meth:`~SocketHandler.makePickle` method and implementing " +"your alternative there, as well as adapting the above script to use your " +"alternative serialization." msgstr "" #: ../../howto/logging-cookbook.rst:770 @@ -509,11 +509,11 @@ msgid "" "configured ports clash with something else in your test environment." msgstr "" -#: ../../howto/logging-cookbook.rst:841 +#: ../../howto/logging-cookbook.rst:843 msgid "Adding contextual information to your logging output" msgstr "" -#: ../../howto/logging-cookbook.rst:843 +#: ../../howto/logging-cookbook.rst:845 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:858 +#: ../../howto/logging-cookbook.rst:860 msgid "Using LoggerAdapters to impart contextual information" msgstr "" -#: ../../howto/logging-cookbook.rst:860 +#: ../../howto/logging-cookbook.rst:862 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:868 +#: ../../howto/logging-cookbook.rst:870 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:884 +#: ../../howto/logging-cookbook.rst:886 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:893 +#: ../../howto/logging-cookbook.rst:895 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:909 +#: ../../howto/logging-cookbook.rst:911 msgid "which you can use like this::" msgstr "" -#: ../../howto/logging-cookbook.rst:914 +#: ../../howto/logging-cookbook.rst:916 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:918 +#: ../../howto/logging-cookbook.rst:920 msgid "Using objects other than dicts to pass contextual information" msgstr "" -#: ../../howto/logging-cookbook.rst:920 +#: ../../howto/logging-cookbook.rst:922 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:929 +#: ../../howto/logging-cookbook.rst:931 msgid "Using Filters to impart contextual information" msgstr "" -#: ../../howto/logging-cookbook.rst:931 +#: ../../howto/logging-cookbook.rst:933 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:936 +#: ../../howto/logging-cookbook.rst:938 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:982 +#: ../../howto/logging-cookbook.rst:984 msgid "which, when run, produces something like:" msgstr "" -#: ../../howto/logging-cookbook.rst:1000 +#: ../../howto/logging-cookbook.rst:1002 msgid "Use of ``contextvars``" msgstr "" -#: ../../howto/logging-cookbook.rst:1002 +#: ../../howto/logging-cookbook.rst:1004 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:1008 +#: ../../howto/logging-cookbook.rst:1010 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:1015 +#: ../../howto/logging-cookbook.rst:1017 msgid "Let's assume that the library can be simulated by the following code:" msgstr "" -#: ../../howto/logging-cookbook.rst:1031 +#: ../../howto/logging-cookbook.rst:1033 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:1175 +#: ../../howto/logging-cookbook.rst:1177 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:1222 +#: ../../howto/logging-cookbook.rst:1224 msgid "Imparting contextual information in handlers" msgstr "" -#: ../../howto/logging-cookbook.rst:1224 +#: ../../howto/logging-cookbook.rst:1226 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:1251 +#: ../../howto/logging-cookbook.rst:1253 msgid "Logging to a single file from multiple processes" msgstr "" -#: ../../howto/logging-cookbook.rst:1253 +#: ../../howto/logging-cookbook.rst:1255 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:1266 +#: ../../howto/logging-cookbook.rst:1268 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:1276 +#: ../../howto/logging-cookbook.rst:1278 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:1392 +#: ../../howto/logging-cookbook.rst:1394 msgid "" "A variant of the above script keeps the logging in the main process, in a " "separate thread::" msgstr "" -#: ../../howto/logging-cookbook.rst:1487 +#: ../../howto/logging-cookbook.rst:1489 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:1494 +#: ../../howto/logging-cookbook.rst:1496 msgid "Using concurrent.futures.ProcessPoolExecutor" msgstr "" -#: ../../howto/logging-cookbook.rst:1496 +#: ../../howto/logging-cookbook.rst:1498 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:1504 +#: ../../howto/logging-cookbook.rst:1506 msgid "you should use" msgstr "" -#: ../../howto/logging-cookbook.rst:1510 +#: ../../howto/logging-cookbook.rst:1512 msgid "and you can then replace the worker creation from this::" msgstr "" -#: ../../howto/logging-cookbook.rst:1521 +#: ../../howto/logging-cookbook.rst:1523 msgid "to this (remembering to first import :mod:`concurrent.futures`)::" msgstr "" -#: ../../howto/logging-cookbook.rst:1528 +#: ../../howto/logging-cookbook.rst:1530 msgid "Deploying Web applications using Gunicorn and uWSGI" msgstr "" -#: ../../howto/logging-cookbook.rst:1530 +#: ../../howto/logging-cookbook.rst:1532 msgid "" "When deploying Web applications using `Gunicorn `_ or " "`uWSGI `_ (or similar), " @@ -791,27 +791,26 @@ msgid "" "listener in production`_ for more details." msgstr "" -#: ../../howto/logging-cookbook.rst:1540 +#: ../../howto/logging-cookbook.rst:1542 msgid "Using file rotation" msgstr "" -#: ../../howto/logging-cookbook.rst:1545 +#: ../../howto/logging-cookbook.rst:1547 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, " "and when that many files have been created, rotate the files so that the " "number of files and the size of the files both remain bounded. For this " -"usage pattern, the logging package provides a :class:`~handlers." -"RotatingFileHandler`::" +"usage pattern, the logging package provides a :class:`RotatingFileHandler`::" msgstr "" -#: ../../howto/logging-cookbook.rst:1577 +#: ../../howto/logging-cookbook.rst:1579 msgid "" "The result should be 6 separate files, each with part of the log history for " "the application:" msgstr "" -#: ../../howto/logging-cookbook.rst:1589 +#: ../../howto/logging-cookbook.rst:1591 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 +818,17 @@ msgid "" "(``.1`` becomes ``.2``, etc.) and the ``.6`` file is erased." msgstr "" -#: ../../howto/logging-cookbook.rst:1594 +#: ../../howto/logging-cookbook.rst:1596 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:1600 +#: ../../howto/logging-cookbook.rst:1604 msgid "Use of alternative formatting styles" msgstr "" -#: ../../howto/logging-cookbook.rst:1602 +#: ../../howto/logging-cookbook.rst:1606 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 +837,7 @@ msgid "" "Python 2.6)." msgstr "" -#: ../../howto/logging-cookbook.rst:1608 +#: ../../howto/logging-cookbook.rst:1612 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 +850,14 @@ msgid "" "session to show the possibilities:" msgstr "" -#: ../../howto/logging-cookbook.rst:1642 +#: ../../howto/logging-cookbook.rst:1646 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:1650 +#: ../../howto/logging-cookbook.rst:1654 msgid "" "Logging calls (``logger.debug()``, ``logger.info()`` etc.) only take " "positional parameters for the actual logging message itself, with keyword " @@ -874,7 +873,7 @@ msgid "" "strings." msgstr "" -#: ../../howto/logging-cookbook.rst:1663 +#: ../../howto/logging-cookbook.rst:1667 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 +882,7 @@ msgid "" "the following two classes::" msgstr "" -#: ../../howto/logging-cookbook.rst:1687 +#: ../../howto/logging-cookbook.rst:1691 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 +893,21 @@ msgid "" "used as a synonym/alias for :func:`gettext.gettext` or its brethren)." msgstr "" -#: ../../howto/logging-cookbook.rst:1695 +#: ../../howto/logging-cookbook.rst:1699 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:1717 +#: ../../howto/logging-cookbook.rst:1721 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:1721 +#: ../../howto/logging-cookbook.rst:1725 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 +918,23 @@ msgid "" "sugar for a constructor call to one of the XXXMessage classes." msgstr "" -#: ../../howto/logging-cookbook.rst:1729 +#: ../../howto/logging-cookbook.rst:1733 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:1760 +#: ../../howto/logging-cookbook.rst:1764 msgid "" "The above script should log the message ``Hello, world!`` when run with " "Python 3.2 or later." msgstr "" -#: ../../howto/logging-cookbook.rst:1769 +#: ../../howto/logging-cookbook.rst:1773 msgid "Customizing ``LogRecord``" msgstr "" -#: ../../howto/logging-cookbook.rst:1771 +#: ../../howto/logging-cookbook.rst:1775 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 +945,13 @@ msgid "" "was done:" msgstr "" -#: ../../howto/logging-cookbook.rst:1778 +#: ../../howto/logging-cookbook.rst:1782 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:1781 +#: ../../howto/logging-cookbook.rst:1785 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 +960,27 @@ msgid "" "`~handlers.HTTPHandler`)." msgstr "" -#: ../../howto/logging-cookbook.rst:1787 +#: ../../howto/logging-cookbook.rst:1791 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:1790 +#: ../../howto/logging-cookbook.rst:1794 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:1793 +#: ../../howto/logging-cookbook.rst:1797 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:1797 +#: ../../howto/logging-cookbook.rst:1801 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 +988,7 @@ msgid "" "last would win." msgstr "" -#: ../../howto/logging-cookbook.rst:1802 +#: ../../howto/logging-cookbook.rst:1806 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 +997,7 @@ msgid "" "would do simply by adding new packages or modules and doing ::" msgstr "" -#: ../../howto/logging-cookbook.rst:1810 +#: ../../howto/logging-cookbook.rst:1814 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 +1007,7 @@ msgid "" "developer." msgstr "" -#: ../../howto/logging-cookbook.rst:1816 +#: ../../howto/logging-cookbook.rst:1820 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 +1017,7 @@ msgid "" "`LogRecord` is the default setting for the factory." msgstr "" -#: ../../howto/logging-cookbook.rst:1823 +#: ../../howto/logging-cookbook.rst:1827 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 +1025,7 @@ msgid "" "this::" msgstr "" -#: ../../howto/logging-cookbook.rst:1836 +#: ../../howto/logging-cookbook.rst:1840 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 +1035,70 @@ msgid "" "used when the use of a :class:`Filter` does not provide the desired result." msgstr "" -#: ../../howto/logging-cookbook.rst:1847 +#: ../../howto/logging-cookbook.rst:1852 msgid "Subclassing QueueHandler - a ZeroMQ example" msgstr "" -#: ../../howto/logging-cookbook.rst:1849 +#: ../../howto/logging-cookbook.rst:1854 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:1868 +#: ../../howto/logging-cookbook.rst:1873 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:1886 +#: ../../howto/logging-cookbook.rst:1891 msgid "Subclassing QueueListener - a ZeroMQ example" msgstr "" -#: ../../howto/logging-cookbook.rst:1888 +#: ../../howto/logging-cookbook.rst:1893 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:1907 ../../howto/logging-cookbook.rst:3948 +#: ../../howto/logging-cookbook.rst:1912 ../../howto/logging-cookbook.rst:3955 msgid "Module :mod:`logging`" msgstr ":mod:`logging` 模組" -#: ../../howto/logging-cookbook.rst:1907 ../../howto/logging-cookbook.rst:3948 +#: ../../howto/logging-cookbook.rst:1912 ../../howto/logging-cookbook.rst:3955 msgid "API reference for the logging module." msgstr "" -#: ../../howto/logging-cookbook.rst:1910 ../../howto/logging-cookbook.rst:3951 +#: ../../howto/logging-cookbook.rst:1915 ../../howto/logging-cookbook.rst:3958 msgid "Module :mod:`logging.config`" msgstr ":mod:`logging.config` 模組" -#: ../../howto/logging-cookbook.rst:1910 ../../howto/logging-cookbook.rst:3951 +#: ../../howto/logging-cookbook.rst:1915 ../../howto/logging-cookbook.rst:3958 msgid "Configuration API for the logging module." msgstr "" -#: ../../howto/logging-cookbook.rst:1913 ../../howto/logging-cookbook.rst:3954 +#: ../../howto/logging-cookbook.rst:1918 ../../howto/logging-cookbook.rst:3961 msgid "Module :mod:`logging.handlers`" msgstr ":mod:`logging.handlers` 模組" -#: ../../howto/logging-cookbook.rst:1913 ../../howto/logging-cookbook.rst:3954 +#: ../../howto/logging-cookbook.rst:1918 ../../howto/logging-cookbook.rst:3961 msgid "Useful handlers included with the logging module." msgstr "" -#: ../../howto/logging-cookbook.rst:1915 +#: ../../howto/logging-cookbook.rst:1920 msgid ":ref:`A basic logging tutorial `" msgstr "" -#: ../../howto/logging-cookbook.rst:1917 +#: ../../howto/logging-cookbook.rst:1922 msgid ":ref:`A more advanced logging tutorial `" msgstr "" -#: ../../howto/logging-cookbook.rst:1921 +#: ../../howto/logging-cookbook.rst:1928 msgid "An example dictionary-based configuration" msgstr "" -#: ../../howto/logging-cookbook.rst:1923 +#: ../../howto/logging-cookbook.rst:1930 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:1986 +#: ../../howto/logging-cookbook.rst:1993 msgid "Using a rotator and namer to customize log rotation processing" msgstr "" -#: ../../howto/logging-cookbook.rst:1988 +#: ../../howto/logging-cookbook.rst:1995 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:2019 +#: ../../howto/logging-cookbook.rst:2026 msgid "" "After running this, you will see six new files, five of which are compressed:" msgstr "" -#: ../../howto/logging-cookbook.rst:2032 +#: ../../howto/logging-cookbook.rst:2039 msgid "A more elaborate multiprocessing example" msgstr "" -#: ../../howto/logging-cookbook.rst:2034 +#: ../../howto/logging-cookbook.rst:2041 msgid "" "The following working example shows how logging can be used with " "multiprocessing using configuration files. The configurations are fairly " @@ -1141,7 +1140,7 @@ msgid "" "in a real multiprocessing scenario." msgstr "" -#: ../../howto/logging-cookbook.rst:2039 +#: ../../howto/logging-cookbook.rst:2046 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 +1153,17 @@ msgid "" "own scenario." msgstr "" -#: ../../howto/logging-cookbook.rst:2049 +#: ../../howto/logging-cookbook.rst:2056 msgid "" "Here's the script - the docstrings and the comments hopefully explain how it " "works::" msgstr "" -#: ../../howto/logging-cookbook.rst:2261 +#: ../../howto/logging-cookbook.rst:2268 msgid "Inserting a BOM into messages sent to a SysLogHandler" msgstr "" -#: ../../howto/logging-cookbook.rst:2263 +#: ../../howto/logging-cookbook.rst:2270 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 +1172,7 @@ msgid "" "<5424#section-6>`.)" msgstr "" -#: ../../howto/logging-cookbook.rst:2269 +#: ../../howto/logging-cookbook.rst:2276 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 +1180,7 @@ msgid "" "hence not allowing any pure-ASCII component to appear before it." msgstr "" -#: ../../howto/logging-cookbook.rst:2275 +#: ../../howto/logging-cookbook.rst:2282 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 +1189,33 @@ msgid "" "encoded using UTF-8, then you need to do the following:" msgstr "" -#: ../../howto/logging-cookbook.rst:2281 +#: ../../howto/logging-cookbook.rst:2288 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:2287 +#: ../../howto/logging-cookbook.rst:2294 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:2290 +#: ../../howto/logging-cookbook.rst:2297 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:2294 +#: ../../howto/logging-cookbook.rst:2301 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:2298 +#: ../../howto/logging-cookbook.rst:2305 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 +1224,11 @@ msgid "" "daemon may complain." msgstr "" -#: ../../howto/logging-cookbook.rst:2305 +#: ../../howto/logging-cookbook.rst:2312 msgid "Implementing structured logging" msgstr "" -#: ../../howto/logging-cookbook.rst:2307 +#: ../../howto/logging-cookbook.rst:2314 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 +1240,31 @@ msgid "" "machine-parseable manner::" msgstr "" -#: ../../howto/logging-cookbook.rst:2331 +#: ../../howto/logging-cookbook.rst:2338 msgid "If the above script is run, it prints:" msgstr "" -#: ../../howto/logging-cookbook.rst:2337 ../../howto/logging-cookbook.rst:2379 +#: ../../howto/logging-cookbook.rst:2344 ../../howto/logging-cookbook.rst:2386 msgid "" "Note that the order of items might be different according to the version of " "Python used." msgstr "" -#: ../../howto/logging-cookbook.rst:2340 +#: ../../howto/logging-cookbook.rst:2347 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:2373 +#: ../../howto/logging-cookbook.rst:2380 msgid "When the above script is run, it prints:" msgstr "" -#: ../../howto/logging-cookbook.rst:2388 +#: ../../howto/logging-cookbook.rst:2395 msgid "Customizing handlers with :func:`dictConfig`" msgstr "" -#: ../../howto/logging-cookbook.rst:2390 +#: ../../howto/logging-cookbook.rst:2397 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 +1274,24 @@ msgid "" "customize handler creation using a plain function such as::" msgstr "" -#: ../../howto/logging-cookbook.rst:2404 +#: ../../howto/logging-cookbook.rst:2411 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:2437 +#: ../../howto/logging-cookbook.rst:2444 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:2484 +#: ../../howto/logging-cookbook.rst:2491 msgid "To run this, you will probably need to run as ``root``:" msgstr "" -#: ../../howto/logging-cookbook.rst:2494 +#: ../../howto/logging-cookbook.rst:2501 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 +1300,17 @@ msgid "" "change using e.g. :func:`os.chown`." msgstr "" -#: ../../howto/logging-cookbook.rst:2500 +#: ../../howto/logging-cookbook.rst:2507 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:2505 +#: ../../howto/logging-cookbook.rst:2512 msgid "you could use e.g.::" msgstr "" -#: ../../howto/logging-cookbook.rst:2509 +#: ../../howto/logging-cookbook.rst:2516 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 +1318,25 @@ msgid "" "resolved by :func:`dictConfig` from the ``ext://`` specification." msgstr "" -#: ../../howto/logging-cookbook.rst:2514 +#: ../../howto/logging-cookbook.rst:2521 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:2518 +#: ../../howto/logging-cookbook.rst:2525 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:2528 +#: ../../howto/logging-cookbook.rst:2535 msgid "Using particular formatting styles throughout your application" msgstr "" -#: ../../howto/logging-cookbook.rst:2530 +#: ../../howto/logging-cookbook.rst:2537 msgid "" "In Python 3.2, the :class:`~logging.Formatter` gained a ``style`` keyword " "parameter which, while defaulting to ``%`` for backward compatibility, " @@ -1348,7 +1347,7 @@ msgid "" "is constructed." msgstr "" -#: ../../howto/logging-cookbook.rst:2537 +#: ../../howto/logging-cookbook.rst:2544 msgid "" "Logging calls (:meth:`~Logger.debug`, :meth:`~Logger.info` etc.) only take " "positional parameters for the actual logging message itself, with keyword " @@ -1363,7 +1362,7 @@ msgid "" "calls which are out there in existing code will be using %-format strings." msgstr "" -#: ../../howto/logging-cookbook.rst:2549 +#: ../../howto/logging-cookbook.rst:2556 msgid "" "There have been suggestions to associate format styles with specific " "loggers, but that approach also runs into backward compatibility problems " @@ -1371,7 +1370,7 @@ msgid "" "formatting." msgstr "" -#: ../../howto/logging-cookbook.rst:2553 +#: ../../howto/logging-cookbook.rst:2560 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 +1378,11 @@ msgid "" "formatting styles can be accommodated." msgstr "" -#: ../../howto/logging-cookbook.rst:2560 +#: ../../howto/logging-cookbook.rst:2567 msgid "Using LogRecord factories" msgstr "" -#: ../../howto/logging-cookbook.rst:2562 +#: ../../howto/logging-cookbook.rst:2569 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 +1397,17 @@ msgid "" "implementation does." msgstr "" -#: ../../howto/logging-cookbook.rst:2573 +#: ../../howto/logging-cookbook.rst:2580 msgid "" "Refer to the reference documentation on :func:`setLogRecordFactory` and :" "class:`LogRecord` for more information." msgstr "" -#: ../../howto/logging-cookbook.rst:2578 +#: ../../howto/logging-cookbook.rst:2585 msgid "Using custom message objects" msgstr "" -#: ../../howto/logging-cookbook.rst:2580 +#: ../../howto/logging-cookbook.rst:2587 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 +1417,7 @@ msgid "" "following two classes::" msgstr "" -#: ../../howto/logging-cookbook.rst:2605 +#: ../../howto/logging-cookbook.rst:2612 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 +1428,17 @@ msgid "" "using ``_`` for localization)." msgstr "" -#: ../../howto/logging-cookbook.rst:2613 +#: ../../howto/logging-cookbook.rst:2620 msgid "" "Examples of this approach are given below. Firstly, formatting with :meth:" "`str.format`::" msgstr "" -#: ../../howto/logging-cookbook.rst:2627 +#: ../../howto/logging-cookbook.rst:2634 msgid "Secondly, formatting with :class:`string.Template`::" msgstr "" -#: ../../howto/logging-cookbook.rst:2634 +#: ../../howto/logging-cookbook.rst:2641 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 +1450,11 @@ msgid "" "above." msgstr "" -#: ../../howto/logging-cookbook.rst:2648 +#: ../../howto/logging-cookbook.rst:2655 msgid "Configuring filters with :func:`dictConfig`" msgstr "" -#: ../../howto/logging-cookbook.rst:2650 +#: ../../howto/logging-cookbook.rst:2657 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 +1469,22 @@ msgid "" "complete example::" msgstr "" -#: ../../howto/logging-cookbook.rst:2703 +#: ../../howto/logging-cookbook.rst:2710 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:2711 +#: ../../howto/logging-cookbook.rst:2718 msgid "which shows that the filter is working as configured." msgstr "" -#: ../../howto/logging-cookbook.rst:2713 +#: ../../howto/logging-cookbook.rst:2720 msgid "A couple of extra points to note:" msgstr "" -#: ../../howto/logging-cookbook.rst:2715 +#: ../../howto/logging-cookbook.rst:2722 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 +1494,7 @@ msgid "" "the above example." msgstr "" -#: ../../howto/logging-cookbook.rst:2722 +#: ../../howto/logging-cookbook.rst:2729 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 +1503,11 @@ msgid "" "above." msgstr "" -#: ../../howto/logging-cookbook.rst:2731 +#: ../../howto/logging-cookbook.rst:2738 msgid "Customized exception formatting" msgstr "" -#: ../../howto/logging-cookbook.rst:2733 +#: ../../howto/logging-cookbook.rst:2740 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 +1515,22 @@ msgid "" "formatter class, as shown in the following example::" msgstr "" -#: ../../howto/logging-cookbook.rst:2774 +#: ../../howto/logging-cookbook.rst:2781 msgid "When run, this produces a file with exactly two lines:" msgstr "" -#: ../../howto/logging-cookbook.rst:2781 +#: ../../howto/logging-cookbook.rst:2788 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:2788 +#: ../../howto/logging-cookbook.rst:2795 msgid "Speaking logging messages" msgstr "" -#: ../../howto/logging-cookbook.rst:2790 +#: ../../howto/logging-cookbook.rst:2797 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 +1547,24 @@ msgid "" "approach, which assumes that the ``espeak`` TTS package is available::" msgstr "" -#: ../../howto/logging-cookbook.rst:2832 +#: ../../howto/logging-cookbook.rst:2839 msgid "" "When run, this script should say \"Hello\" and then \"Goodbye\" in a female " "voice." msgstr "" -#: ../../howto/logging-cookbook.rst:2834 +#: ../../howto/logging-cookbook.rst:2841 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:2842 +#: ../../howto/logging-cookbook.rst:2849 msgid "Buffering logging messages and outputting them conditionally" msgstr "" -#: ../../howto/logging-cookbook.rst:2844 +#: ../../howto/logging-cookbook.rst:2851 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 +1574,7 @@ msgid "" "debug information to be output as well as the error." msgstr "" -#: ../../howto/logging-cookbook.rst:2851 +#: ../../howto/logging-cookbook.rst:2858 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 +1587,7 @@ msgid "" "subclass of ``MemoryHandler`` if you want custom flushing behavior." msgstr "" -#: ../../howto/logging-cookbook.rst:2861 +#: ../../howto/logging-cookbook.rst:2868 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 +1596,7 @@ msgid "" "levels - otherwise, it only logs at DEBUG, INFO and WARNING levels." msgstr "" -#: ../../howto/logging-cookbook.rst:2867 +#: ../../howto/logging-cookbook.rst:2874 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 +1608,30 @@ msgid "" "respectively." msgstr "" -#: ../../howto/logging-cookbook.rst:2875 +#: ../../howto/logging-cookbook.rst:2882 msgid "Here's the script::" msgstr "" -#: ../../howto/logging-cookbook.rst:2938 +#: ../../howto/logging-cookbook.rst:2945 msgid "When this script is run, the following output should be observed:" msgstr "" -#: ../../howto/logging-cookbook.rst:2968 +#: ../../howto/logging-cookbook.rst:2975 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:2972 +#: ../../howto/logging-cookbook.rst:2979 msgid "You can of course use the conventional means of decoration::" msgstr "" -#: ../../howto/logging-cookbook.rst:2982 +#: ../../howto/logging-cookbook.rst:2989 msgid "Sending logging messages to email, with buffering" msgstr "" -#: ../../howto/logging-cookbook.rst:2984 +#: ../../howto/logging-cookbook.rst:2991 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 +1642,7 @@ msgid "" "argument to see the required and optional arguments.)" msgstr "" -#: ../../howto/logging-cookbook.rst:3056 +#: ../../howto/logging-cookbook.rst:3063 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 +1650,17 @@ msgid "" "messages. That makes up 102 messages as specified in the script." msgstr "" -#: ../../howto/logging-cookbook.rst:3064 +#: ../../howto/logging-cookbook.rst:3071 msgid "Formatting times using UTC (GMT) via configuration" msgstr "" -#: ../../howto/logging-cookbook.rst:3066 +#: ../../howto/logging-cookbook.rst:3073 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:3075 +#: ../../howto/logging-cookbook.rst:3082 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 +1668,21 @@ msgid "" "the following complete example::" msgstr "" -#: ../../howto/logging-cookbook.rst:3118 +#: ../../howto/logging-cookbook.rst:3125 msgid "When this script is run, it should print something like:" msgstr "" -#: ../../howto/logging-cookbook.rst:3125 +#: ../../howto/logging-cookbook.rst:3132 msgid "" "showing how the time is formatted both as local time and UTC, one for each " "handler." msgstr "" -#: ../../howto/logging-cookbook.rst:3132 +#: ../../howto/logging-cookbook.rst:3139 msgid "Using a context manager for selective logging" msgstr "" -#: ../../howto/logging-cookbook.rst:3134 +#: ../../howto/logging-cookbook.rst:3141 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 +1692,7 @@ msgid "" "scope of the context manager::" msgstr "" -#: ../../howto/logging-cookbook.rst:3167 +#: ../../howto/logging-cookbook.rst:3174 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 +1701,13 @@ msgid "" "block exit - you could do this if you don't need the handler any more." msgstr "" -#: ../../howto/logging-cookbook.rst:3173 +#: ../../howto/logging-cookbook.rst:3180 msgid "" "To illustrate how it works, we can add the following block of code to the " "above::" msgstr "" -#: ../../howto/logging-cookbook.rst:3191 +#: ../../howto/logging-cookbook.rst:3198 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 +1720,56 @@ msgid "" "(like message #1) whereas message #7 doesn't (just like message #2)." msgstr "" -#: ../../howto/logging-cookbook.rst:3201 +#: ../../howto/logging-cookbook.rst:3208 msgid "If we run the resulting script, the result is as follows:" msgstr "" -#: ../../howto/logging-cookbook.rst:3212 +#: ../../howto/logging-cookbook.rst:3219 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:3220 +#: ../../howto/logging-cookbook.rst:3227 msgid "Once again, but piping ``stdout`` to ``/dev/null``, we get:" msgstr "" -#: ../../howto/logging-cookbook.rst:3230 +#: ../../howto/logging-cookbook.rst:3237 msgid "" "In this case, the message #5 printed to ``stdout`` doesn't appear, as " "expected." msgstr "" -#: ../../howto/logging-cookbook.rst:3232 +#: ../../howto/logging-cookbook.rst:3239 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:3240 +#: ../../howto/logging-cookbook.rst:3247 msgid "A CLI application starter template" msgstr "" -#: ../../howto/logging-cookbook.rst:3242 +#: ../../howto/logging-cookbook.rst:3249 msgid "Here's an example which shows how you can:" msgstr "" -#: ../../howto/logging-cookbook.rst:3244 +#: ../../howto/logging-cookbook.rst:3251 msgid "Use a logging level based on command-line arguments" msgstr "" -#: ../../howto/logging-cookbook.rst:3245 +#: ../../howto/logging-cookbook.rst:3252 msgid "" "Dispatch to multiple subcommands in separate files, all logging at the same " "level in a consistent way" msgstr "" -#: ../../howto/logging-cookbook.rst:3247 +#: ../../howto/logging-cookbook.rst:3254 msgid "Make use of simple, minimal configuration" msgstr "" -#: ../../howto/logging-cookbook.rst:3249 +#: ../../howto/logging-cookbook.rst:3256 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 +1780,53 @@ msgid "" "``logging.INFO``. Here's one way that ``app.py`` could be written::" msgstr "" -#: ../../howto/logging-cookbook.rst:3298 +#: ../../howto/logging-cookbook.rst:3305 msgid "" "And the ``start``, ``stop`` and ``restart`` commands can be implemented in " "separate modules, like so for starting::" msgstr "" -#: ../../howto/logging-cookbook.rst:3311 +#: ../../howto/logging-cookbook.rst:3318 msgid "and thus for stopping::" msgstr "" -#: ../../howto/logging-cookbook.rst:3332 +#: ../../howto/logging-cookbook.rst:3339 msgid "and similarly for restarting::" msgstr "" -#: ../../howto/logging-cookbook.rst:3353 +#: ../../howto/logging-cookbook.rst:3360 msgid "" "If we run this application with the default log level, we get output like " "this:" msgstr "" -#: ../../howto/logging-cookbook.rst:3366 +#: ../../howto/logging-cookbook.rst:3373 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:3369 +#: ../../howto/logging-cookbook.rst:3376 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:3386 +#: ../../howto/logging-cookbook.rst:3393 msgid "And if we want less:" msgstr "" -#: ../../howto/logging-cookbook.rst:3394 +#: ../../howto/logging-cookbook.rst:3401 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:3400 +#: ../../howto/logging-cookbook.rst:3407 msgid "A Qt GUI for logging" msgstr "" -#: ../../howto/logging-cookbook.rst:3402 +#: ../../howto/logging-cookbook.rst:3409 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 +1834,7 @@ msgid "" "project/PySide2/>`_ or `PyQt5 `_ libraries." msgstr "" -#: ../../howto/logging-cookbook.rst:3408 +#: ../../howto/logging-cookbook.rst:3415 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 +1844,14 @@ msgid "" "logging messages at random levels with random short delays in between)." msgstr "" -#: ../../howto/logging-cookbook.rst:3415 +#: ../../howto/logging-cookbook.rst:3422 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:3419 +#: ../../howto/logging-cookbook.rst:3426 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 +1859,11 @@ msgid "" "information." msgstr "" -#: ../../howto/logging-cookbook.rst:3633 +#: ../../howto/logging-cookbook.rst:3640 msgid "Logging to syslog with RFC5424 support" msgstr "" -#: ../../howto/logging-cookbook.rst:3635 +#: ../../howto/logging-cookbook.rst:3642 msgid "" "Although :rfc:`5424` dates from 2009, most syslog servers are configured by " "default to use the older :rfc:`3164`, which hails from 2001. When " @@ -1874,14 +1873,14 @@ msgid "" "handlers.SysLogHandler` functionality has not been updated." msgstr "" -#: ../../howto/logging-cookbook.rst:3642 +#: ../../howto/logging-cookbook.rst:3649 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:3708 +#: ../../howto/logging-cookbook.rst:3715 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 +1889,11 @@ msgid "" "using something like this::" msgstr "" -#: ../../howto/logging-cookbook.rst:3722 +#: ../../howto/logging-cookbook.rst:3729 msgid "How to treat a logger like an output stream" msgstr "" -#: ../../howto/logging-cookbook.rst:3724 +#: ../../howto/logging-cookbook.rst:3731 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 +1901,17 @@ msgid "" "API. Here's a short script illustrating such a class:" msgstr "" -#: ../../howto/logging-cookbook.rst:3764 +#: ../../howto/logging-cookbook.rst:3771 msgid "When this script is run, it prints" msgstr "" -#: ../../howto/logging-cookbook.rst:3771 +#: ../../howto/logging-cookbook.rst:3778 msgid "" "You could also use ``LoggerWriter`` to redirect ``sys.stdout`` and ``sys." "stderr`` by doing something like this:" msgstr "" -#: ../../howto/logging-cookbook.rst:3781 +#: ../../howto/logging-cookbook.rst:3788 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 +1919,25 @@ msgid "" "Then, you'd get this kind of result:" msgstr "" -#: ../../howto/logging-cookbook.rst:3794 +#: ../../howto/logging-cookbook.rst:3801 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:3798 +#: ../../howto/logging-cookbook.rst:3805 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:3807 +#: ../../howto/logging-cookbook.rst:3814 msgid "then running the script results in" msgstr "" -#: ../../howto/logging-cookbook.rst:3825 +#: ../../howto/logging-cookbook.rst:3832 msgid "" "As you can see, this output isn't ideal. That's because the underlying code " "which writes to ``sys.stderr`` makes multiple writes, each of which results " @@ -1948,17 +1947,17 @@ msgid "" "``LoggerWriter``:" msgstr "" -#: ../../howto/logging-cookbook.rst:3850 +#: ../../howto/logging-cookbook.rst:3857 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:3866 +#: ../../howto/logging-cookbook.rst:3873 msgid "Patterns to avoid" msgstr "" -#: ../../howto/logging-cookbook.rst:3868 +#: ../../howto/logging-cookbook.rst:3875 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 +1965,11 @@ msgid "" "The following sections are in no particular order." msgstr "" -#: ../../howto/logging-cookbook.rst:3874 +#: ../../howto/logging-cookbook.rst:3881 msgid "Opening the same log file multiple times" msgstr "" -#: ../../howto/logging-cookbook.rst:3876 +#: ../../howto/logging-cookbook.rst:3883 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 +1977,32 @@ msgid "" "file multiple times. This could be done accidentally, for example by:" msgstr "" -#: ../../howto/logging-cookbook.rst:3881 +#: ../../howto/logging-cookbook.rst:3888 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:3884 +#: ../../howto/logging-cookbook.rst:3891 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:3887 +#: ../../howto/logging-cookbook.rst:3894 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:3891 +#: ../../howto/logging-cookbook.rst:3898 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:3894 +#: ../../howto/logging-cookbook.rst:3901 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 +2011,7 @@ msgid "" "different handler instances which happen to point to the same file." msgstr "" -#: ../../howto/logging-cookbook.rst:3900 +#: ../../howto/logging-cookbook.rst:3907 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 +2021,17 @@ msgid "" "being supposedly in place." msgstr "" -#: ../../howto/logging-cookbook.rst:3907 +#: ../../howto/logging-cookbook.rst:3914 msgid "" "Use the techniques outlined in :ref:`multiple-processes` to circumvent such " "issues." msgstr "" -#: ../../howto/logging-cookbook.rst:3911 +#: ../../howto/logging-cookbook.rst:3918 msgid "Using loggers as attributes in a class or passing them as parameters" msgstr "" -#: ../../howto/logging-cookbook.rst:3913 +#: ../../howto/logging-cookbook.rst:3920 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 +2042,13 @@ msgid "" "module (and not the class) is the unit of software decomposition." msgstr "" -#: ../../howto/logging-cookbook.rst:3922 +#: ../../howto/logging-cookbook.rst:3929 msgid "" -"Adding handlers other than :class:`NullHandler` to a logger in a library" +"Adding handlers other than :class:`~logging.NullHandler` to a logger in a " +"library" msgstr "" -#: ../../howto/logging-cookbook.rst:3924 +#: ../../howto/logging-cookbook.rst:3931 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:3930 +#: ../../howto/logging-cookbook.rst:3937 msgid "Creating a lot of loggers" msgstr "" -#: ../../howto/logging-cookbook.rst:3932 +#: ../../howto/logging-cookbook.rst:3939 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:3943 +#: ../../howto/logging-cookbook.rst:3950 msgid "Other resources" msgstr "" -#: ../../howto/logging-cookbook.rst:3956 +#: ../../howto/logging-cookbook.rst:3963 msgid ":ref:`Basic Tutorial `" msgstr "" -#: ../../howto/logging-cookbook.rst:3958 +#: ../../howto/logging-cookbook.rst:3965 msgid ":ref:`Advanced Tutorial `" msgstr "" diff --git a/library/ast.po b/library/ast.po index 3d3224d116..e021b7c35f 100644 --- a/library/ast.po +++ b/library/ast.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-09-09 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:38+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -420,8 +420,8 @@ msgstr "" #: ../../library/ast.rst:588 msgid "" -"``keywords`` holds a list of :class:`keyword` objects representing arguments " -"passed by keyword." +"``keywords`` holds a list of :class:`.keyword` objects representing " +"arguments passed by keyword." msgstr "" #: ../../library/ast.rst:591 @@ -458,11 +458,11 @@ msgid "" "case both ``target`` and ``value`` must be single nodes." msgstr "" -#: ../../library/ast.rst:668 +#: ../../library/ast.rst:669 msgid "Subscripting" msgstr "" -#: ../../library/ast.rst:672 +#: ../../library/ast.rst:673 msgid "" "A subscript, such as ``l[1]``. ``value`` is the subscripted object (usually " "sequence or mapping). ``slice`` is an index, slice or key. It can be a :" @@ -470,29 +470,29 @@ msgid "" "`Store` or :class:`Del` according to the action performed with the subscript." msgstr "" -#: ../../library/ast.rst:696 +#: ../../library/ast.rst:697 msgid "" "Regular slicing (on the form ``lower:upper`` or ``lower:upper:step``). Can " "occur only inside the *slice* field of :class:`Subscript`, either directly " "or as an element of :class:`Tuple`." msgstr "" -#: ../../library/ast.rst:713 +#: ../../library/ast.rst:714 msgid "Comprehensions" msgstr "" -#: ../../library/ast.rst:720 +#: ../../library/ast.rst:721 msgid "" "List and set comprehensions, generator expressions, and dictionary " "comprehensions. ``elt`` (or ``key`` and ``value``) is a single node " "representing the part that will be evaluated for each item." msgstr "" -#: ../../library/ast.rst:724 +#: ../../library/ast.rst:725 msgid "``generators`` is a list of :class:`comprehension` nodes." msgstr "" -#: ../../library/ast.rst:766 +#: ../../library/ast.rst:767 msgid "" "One ``for`` clause in a comprehension. ``target`` is the reference to use " "for each element - typically a :class:`Name` or :class:`Tuple` node. " @@ -500,36 +500,36 @@ msgid "" "expressions: each ``for`` clause can have multiple ``ifs``." msgstr "" -#: ../../library/ast.rst:771 +#: ../../library/ast.rst:772 msgid "" "``is_async`` indicates a comprehension is asynchronous (using an ``async " "for`` instead of ``for``). The value is an integer (0 or 1)." msgstr "" -#: ../../library/ast.rst:840 +#: ../../library/ast.rst:841 msgid "Statements" msgstr "" -#: ../../library/ast.rst:844 +#: ../../library/ast.rst:845 msgid "" "An assignment. ``targets`` is a list of nodes, and ``value`` is a single " "node." msgstr "" -#: ../../library/ast.rst:846 +#: ../../library/ast.rst:847 msgid "" "Multiple nodes in ``targets`` represents assigning the same value to each. " "Unpacking is represented by putting a :class:`Tuple` or :class:`List` within " "``targets``." msgstr "" -#: ../../library/ast.rst:852 ../../library/ast.rst:1159 -#: ../../library/ast.rst:1363 ../../library/ast.rst:1862 +#: ../../library/ast.rst:853 ../../library/ast.rst:1161 +#: ../../library/ast.rst:1366 ../../library/ast.rst:1891 msgid "" "``type_comment`` is an optional string with the type annotation as a comment." msgstr "" -#: ../../library/ast.rst:882 +#: ../../library/ast.rst:883 msgid "" "An assignment with a type annotation. ``target`` is a single node and can be " "a :class:`Name`, a :class:`Attribute` or a :class:`Subscript`. " @@ -539,7 +539,7 @@ msgid "" "appear in between parenthesis and are hence pure names and not expressions." msgstr "" -#: ../../library/ast.rst:937 +#: ../../library/ast.rst:938 msgid "" "Augmented assignment, such as ``a += 1``. In the following example, " "``target`` is a :class:`Name` node for ``x`` (with the :class:`Store` " @@ -547,36 +547,36 @@ msgid "" "value for 1." msgstr "" -#: ../../library/ast.rst:942 +#: ../../library/ast.rst:943 msgid "" "The ``target`` attribute cannot be of class :class:`Tuple` or :class:`List`, " "unlike the targets of :class:`Assign`." msgstr "" -#: ../../library/ast.rst:959 +#: ../../library/ast.rst:960 msgid "" "A ``raise`` statement. ``exc`` is the exception object to be raised, " "normally a :class:`Call` or :class:`Name`, or ``None`` for a standalone " "``raise``. ``cause`` is the optional part for ``y`` in ``raise x from y``." msgstr "" -#: ../../library/ast.rst:976 +#: ../../library/ast.rst:977 msgid "" "An assertion. ``test`` holds the condition, such as a :class:`Compare` node. " "``msg`` holds the failure message." msgstr "" -#: ../../library/ast.rst:992 +#: ../../library/ast.rst:993 msgid "" "Represents a ``del`` statement. ``targets`` is a list of nodes, such as :" "class:`Name`, :class:`Attribute` or :class:`Subscript` nodes." msgstr "" -#: ../../library/ast.rst:1010 +#: ../../library/ast.rst:1011 msgid "A ``pass`` statement." msgstr "" -#: ../../library/ast.rst:1023 +#: ../../library/ast.rst:1024 msgid "" "A :ref:`type alias ` created through the :keyword:`type` " "statement. ``name`` is the name of the alias, ``type_params`` is a list of :" @@ -584,21 +584,21 @@ msgid "" "type alias." msgstr "" -#: ../../library/ast.rst:1040 +#: ../../library/ast.rst:1042 msgid "" "Other statements which are only applicable inside functions or loops are " "described in other sections." msgstr "" -#: ../../library/ast.rst:1044 +#: ../../library/ast.rst:1046 msgid "Imports" msgstr "" -#: ../../library/ast.rst:1048 +#: ../../library/ast.rst:1050 msgid "An import statement. ``names`` is a list of :class:`alias` nodes." msgstr "" -#: ../../library/ast.rst:1065 +#: ../../library/ast.rst:1067 msgid "" "Represents ``from x import y``. ``module`` is a raw string of the 'from' " "name, without any leading dots, or ``None`` for statements such as ``from . " @@ -606,36 +606,36 @@ msgid "" "import (0 means absolute import)." msgstr "" -#: ../../library/ast.rst:1087 +#: ../../library/ast.rst:1089 msgid "" "Both parameters are raw strings of the names. ``asname`` can be ``None`` if " "the regular name is to be used." msgstr "" -#: ../../library/ast.rst:1104 +#: ../../library/ast.rst:1106 msgid "Control flow" msgstr "" -#: ../../library/ast.rst:1107 +#: ../../library/ast.rst:1109 msgid "" "Optional clauses such as ``else`` are stored as an empty list if they're not " "present." msgstr "" -#: ../../library/ast.rst:1112 +#: ../../library/ast.rst:1114 msgid "" "An ``if`` statement. ``test`` holds a single node, such as a :class:" "`Compare` node. ``body`` and ``orelse`` each hold a list of nodes." msgstr "" -#: ../../library/ast.rst:1115 +#: ../../library/ast.rst:1117 msgid "" "``elif`` clauses don't have a special representation in the AST, but rather " "appear as extra :class:`If` nodes within the ``orelse`` section of the " "previous one." msgstr "" -#: ../../library/ast.rst:1150 +#: ../../library/ast.rst:1152 msgid "" "A ``for`` loop. ``target`` holds the variable(s) the loop assigns to, as a " "single :class:`Name`, :class:`Tuple`, :class:`List`, :class:`Attribute` or :" @@ -645,30 +645,30 @@ msgid "" "via a ``break`` statement." msgstr "" -#: ../../library/ast.rst:1185 +#: ../../library/ast.rst:1187 msgid "" "A ``while`` loop. ``test`` holds the condition, such as a :class:`Compare` " "node." msgstr "" -#: ../../library/ast.rst:1212 +#: ../../library/ast.rst:1214 msgid "The ``break`` and ``continue`` statements." msgstr "" -#: ../../library/ast.rst:1247 +#: ../../library/ast.rst:1249 msgid "" "``try`` blocks. All attributes are list of nodes to execute, except for " "``handlers``, which is a list of :class:`ExceptHandler` nodes." msgstr "" -#: ../../library/ast.rst:1293 +#: ../../library/ast.rst:1295 msgid "" "``try`` blocks which are followed by ``except*`` clauses. The attributes are " "the same as for :class:`Try` but the :class:`ExceptHandler` nodes in " "``handlers`` are interpreted as ``except*`` blocks rather then ``except``." msgstr "" -#: ../../library/ast.rst:1324 +#: ../../library/ast.rst:1327 msgid "" "A single ``except`` clause. ``type`` is the exception type it will match, " "typically a :class:`Name` node (or ``None`` for a catch-all ``except:`` " @@ -676,14 +676,14 @@ msgid "" "``None`` if the clause doesn't have ``as foo``. ``body`` is a list of nodes." msgstr "" -#: ../../library/ast.rst:1358 +#: ../../library/ast.rst:1361 msgid "" "A ``with`` block. ``items`` is a list of :class:`withitem` nodes " "representing the context managers, and ``body`` is the indented block inside " "the context." msgstr "" -#: ../../library/ast.rst:1368 +#: ../../library/ast.rst:1371 msgid "" "A single context manager in a ``with`` block. ``context_expr`` is the " "context manager, often a :class:`Call` node. ``optional_vars`` is a :class:" @@ -691,18 +691,18 @@ msgid "" "if that isn't used." msgstr "" -#: ../../library/ast.rst:1401 +#: ../../library/ast.rst:1404 msgid "Pattern matching" msgstr "" -#: ../../library/ast.rst:1406 +#: ../../library/ast.rst:1409 msgid "" "A ``match`` statement. ``subject`` holds the subject of the match (the " "object that is being matched against the cases) and ``cases`` contains an " "iterable of :class:`match_case` nodes with the different cases." msgstr "" -#: ../../library/ast.rst:1412 +#: ../../library/ast.rst:1417 msgid "" "A single case pattern in a ``match`` statement. ``pattern`` contains the " "match pattern that the subject will be matched against. Note that the :class:" @@ -710,19 +710,19 @@ msgid "" "expressions, even when they share the same syntax." msgstr "" -#: ../../library/ast.rst:1417 +#: ../../library/ast.rst:1422 msgid "" "The ``guard`` attribute contains an expression that will be evaluated if the " "pattern matches the subject." msgstr "" -#: ../../library/ast.rst:1420 +#: ../../library/ast.rst:1425 msgid "" "``body`` contains a list of nodes to execute if the pattern matches and the " "result of evaluating the guard expression is true." msgstr "" -#: ../../library/ast.rst:1463 +#: ../../library/ast.rst:1470 msgid "" "A match literal or value pattern that compares by equality. ``value`` is an " "expression node. Permitted value nodes are restricted as described in the " @@ -730,14 +730,14 @@ msgid "" "equal to the evaluated value." msgstr "" -#: ../../library/ast.rst:1490 +#: ../../library/ast.rst:1499 msgid "" "A match literal pattern that compares by identity. ``value`` is the " "singleton to be compared against: ``None``, ``True``, or ``False``. This " "pattern succeeds if the match subject is the given constant." msgstr "" -#: ../../library/ast.rst:1515 +#: ../../library/ast.rst:1526 msgid "" "A match sequence pattern. ``patterns`` contains the patterns to be matched " "against the subject elements if the subject is a sequence. Matches a " @@ -745,7 +745,7 @@ msgid "" "otherwise matches a fixed length sequence." msgstr "" -#: ../../library/ast.rst:1546 +#: ../../library/ast.rst:1559 msgid "" "Matches the rest of the sequence in a variable length match sequence " "pattern. If ``name`` is not ``None``, a list containing the remaining " @@ -753,7 +753,7 @@ msgid "" "successful." msgstr "" -#: ../../library/ast.rst:1586 +#: ../../library/ast.rst:1601 msgid "" "A match mapping pattern. ``keys`` is a sequence of expression nodes. " "``patterns`` is a corresponding sequence of pattern nodes. ``rest`` is an " @@ -762,7 +762,7 @@ msgid "" "statement documentation." msgstr "" -#: ../../library/ast.rst:1592 +#: ../../library/ast.rst:1607 msgid "" "This pattern succeeds if the subject is a mapping, all evaluated key " "expressions are present in the mapping, and the value corresponding to each " @@ -771,7 +771,7 @@ msgid "" "overall mapping pattern is successful." msgstr "" -#: ../../library/ast.rst:1632 +#: ../../library/ast.rst:1649 msgid "" "A match class pattern. ``cls`` is an expression giving the nominal class to " "be matched. ``patterns`` is a sequence of pattern nodes to be matched " @@ -782,21 +782,21 @@ msgid "" "pattern)." msgstr "" -#: ../../library/ast.rst:1639 +#: ../../library/ast.rst:1656 msgid "" "This pattern succeeds if the subject is an instance of the nominated class, " "all positional patterns match the corresponding class-defined attributes, " "and any specified keyword attributes match their corresponding pattern." msgstr "" -#: ../../library/ast.rst:1643 +#: ../../library/ast.rst:1660 msgid "" "Note: classes may define a property that returns self in order to match a " "pattern node against the instance being matched. Several builtin types are " "also matched that way, as described in the match statement documentation." msgstr "" -#: ../../library/ast.rst:1696 +#: ../../library/ast.rst:1715 msgid "" "A match \"as-pattern\", capture pattern or wildcard pattern. ``pattern`` " "contains the match pattern that the subject will be matched against. If the " @@ -804,14 +804,14 @@ msgid "" "and will always succeed." msgstr "" -#: ../../library/ast.rst:1701 +#: ../../library/ast.rst:1720 msgid "" "The ``name`` attribute contains the name that will be bound if the pattern " "is successful. If ``name`` is ``None``, ``pattern`` must also be ``None`` " "and the node represents the wildcard pattern." msgstr "" -#: ../../library/ast.rst:1737 +#: ../../library/ast.rst:1758 msgid "" "A match \"or-pattern\". An or-pattern matches each of its subpatterns in " "turn to the subject, until one succeeds. The or-pattern is then deemed to " @@ -820,184 +820,189 @@ msgid "" "matched against the subject." msgstr "" -#: ../../library/ast.rst:1770 +#: ../../library/ast.rst:1793 msgid "Type parameters" msgstr "" -#: ../../library/ast.rst:1772 +#: ../../library/ast.rst:1795 msgid "" ":ref:`Type parameters ` can exist on classes, functions, and " "type aliases." msgstr "" -#: ../../library/ast.rst:1777 +#: ../../library/ast.rst:1800 msgid "" "A :class:`typing.TypeVar`. ``name`` is the name of the type variable. " "``bound`` is the bound or constraints, if any. If ``bound`` is a :class:" "`Tuple`, it represents constraints; otherwise it represents the bound." msgstr "" -#: ../../library/ast.rst:1800 +#: ../../library/ast.rst:1825 msgid "" "A :class:`typing.ParamSpec`. ``name`` is the name of the parameter " "specification." msgstr "" -#: ../../library/ast.rst:1823 +#: ../../library/ast.rst:1850 msgid "" "A :class:`typing.TypeVarTuple`. ``name`` is the name of the type variable " "tuple." msgstr "" -#: ../../library/ast.rst:1846 +#: ../../library/ast.rst:1875 msgid "Function and class definitions" msgstr "" -#: ../../library/ast.rst:1850 +#: ../../library/ast.rst:1879 msgid "A function definition." msgstr "" -#: ../../library/ast.rst:1852 +#: ../../library/ast.rst:1881 msgid "``name`` is a raw string of the function name." msgstr "" -#: ../../library/ast.rst:1853 +#: ../../library/ast.rst:1882 msgid "``args`` is an :class:`arguments` node." msgstr "" -#: ../../library/ast.rst:1854 +#: ../../library/ast.rst:1883 msgid "``body`` is the list of nodes inside the function." msgstr "" -#: ../../library/ast.rst:1855 +#: ../../library/ast.rst:1884 msgid "" "``decorator_list`` is the list of decorators to be applied, stored outermost " "first (i.e. the first in the list will be applied last)." msgstr "" -#: ../../library/ast.rst:1857 +#: ../../library/ast.rst:1886 msgid "``returns`` is the return annotation." msgstr "" -#: ../../library/ast.rst:1858 ../../library/ast.rst:2033 +#: ../../library/ast.rst:1887 ../../library/ast.rst:2065 msgid "``type_params`` is a list of :ref:`type parameters `." msgstr "" -#: ../../library/ast.rst:1867 +#: ../../library/ast.rst:1893 ../../library/ast.rst:2094 +#: ../../library/ast.rst:2105 +msgid "Added ``type_params``." +msgstr "" + +#: ../../library/ast.rst:1899 msgid "" "``lambda`` is a minimal function definition that can be used inside an " "expression. Unlike :class:`FunctionDef`, ``body`` holds a single node." msgstr "" -#: ../../library/ast.rst:1891 +#: ../../library/ast.rst:1923 msgid "The arguments for a function." msgstr "" -#: ../../library/ast.rst:1893 +#: ../../library/ast.rst:1925 msgid "" "``posonlyargs``, ``args`` and ``kwonlyargs`` are lists of :class:`arg` nodes." msgstr "" -#: ../../library/ast.rst:1894 +#: ../../library/ast.rst:1926 msgid "" "``vararg`` and ``kwarg`` are single :class:`arg` nodes, referring to the " "``*args, **kwargs`` parameters." msgstr "" -#: ../../library/ast.rst:1896 +#: ../../library/ast.rst:1928 msgid "" "``kw_defaults`` is a list of default values for keyword-only arguments. If " "one is ``None``, the corresponding argument is required." msgstr "" -#: ../../library/ast.rst:1898 +#: ../../library/ast.rst:1930 msgid "" "``defaults`` is a list of default values for arguments that can be passed " "positionally. If there are fewer defaults, they correspond to the last n " "arguments." msgstr "" -#: ../../library/ast.rst:1905 +#: ../../library/ast.rst:1937 msgid "" "A single argument in a list. ``arg`` is a raw string of the argument name, " "``annotation`` is its annotation, such as a :class:`Str` or :class:`Name` " "node." msgstr "" -#: ../../library/ast.rst:1911 +#: ../../library/ast.rst:1943 msgid "" "``type_comment`` is an optional string with the type annotation as a comment" msgstr "" -#: ../../library/ast.rst:1956 +#: ../../library/ast.rst:1988 msgid "A ``return`` statement." msgstr "" -#: ../../library/ast.rst:1971 +#: ../../library/ast.rst:2003 msgid "" "A ``yield`` or ``yield from`` expression. Because these are expressions, " "they must be wrapped in a :class:`Expr` node if the value sent back is not " "used." msgstr "" -#: ../../library/ast.rst:1996 +#: ../../library/ast.rst:2028 msgid "" "``global`` and ``nonlocal`` statements. ``names`` is a list of raw strings." msgstr "" -#: ../../library/ast.rst:2023 +#: ../../library/ast.rst:2055 msgid "A class definition." msgstr "" -#: ../../library/ast.rst:2025 +#: ../../library/ast.rst:2057 msgid "``name`` is a raw string for the class name" msgstr "" -#: ../../library/ast.rst:2026 +#: ../../library/ast.rst:2058 msgid "``bases`` is a list of nodes for explicitly specified base classes." msgstr "" -#: ../../library/ast.rst:2027 +#: ../../library/ast.rst:2059 msgid "" -"``keywords`` is a list of :class:`keyword` nodes, principally for " +"``keywords`` is a list of :class:`.keyword` nodes, principally for " "'metaclass'. Other keywords will be passed to the metaclass, as per " "`PEP-3115 `_." msgstr "" -#: ../../library/ast.rst:2030 +#: ../../library/ast.rst:2062 msgid "" "``body`` is a list of nodes representing the code within the class " "definition." msgstr "" -#: ../../library/ast.rst:2032 +#: ../../library/ast.rst:2064 msgid "``decorator_list`` is a list of nodes, as in :class:`FunctionDef`." msgstr "" -#: ../../library/ast.rst:2063 +#: ../../library/ast.rst:2098 msgid "Async and await" msgstr "" -#: ../../library/ast.rst:2067 +#: ../../library/ast.rst:2102 msgid "" "An ``async def`` function definition. Has the same fields as :class:" "`FunctionDef`." msgstr "" -#: ../../library/ast.rst:2073 +#: ../../library/ast.rst:2111 msgid "" "An ``await`` expression. ``value`` is what it waits for. Only valid in the " "body of an :class:`AsyncFunctionDef`." msgstr "" -#: ../../library/ast.rst:2107 +#: ../../library/ast.rst:2145 msgid "" "``async for`` loops and ``async with`` context managers. They have the same " "fields as :class:`For` and :class:`With`, respectively. Only valid in the " "body of an :class:`AsyncFunctionDef`." msgstr "" -#: ../../library/ast.rst:2112 +#: ../../library/ast.rst:2150 msgid "" "When a string is parsed by :func:`ast.parse`, operator nodes (subclasses of :" "class:`ast.operator`, :class:`ast.unaryop`, :class:`ast.cmpop`, :class:`ast." @@ -1006,23 +1011,23 @@ msgid "" "same value (e.g. :class:`ast.Add`)." msgstr "" -#: ../../library/ast.rst:2120 +#: ../../library/ast.rst:2158 msgid ":mod:`ast` Helpers" msgstr "" -#: ../../library/ast.rst:2122 +#: ../../library/ast.rst:2160 msgid "" "Apart from the node classes, the :mod:`ast` module defines these utility " "functions and classes for traversing abstract syntax trees:" msgstr "" -#: ../../library/ast.rst:2127 +#: ../../library/ast.rst:2165 msgid "" "Parse the source into an AST node. Equivalent to ``compile(source, " "filename, mode, ast.PyCF_ONLY_AST)``." msgstr "" -#: ../../library/ast.rst:2130 +#: ../../library/ast.rst:2168 msgid "" "If ``type_comments=True`` is given, the parser is modified to check and " "return type comments as specified by :pep:`484` and :pep:`526`. This is " @@ -1035,14 +1040,14 @@ msgid "" "empty list)." msgstr "" -#: ../../library/ast.rst:2140 +#: ../../library/ast.rst:2178 msgid "" "In addition, if ``mode`` is ``'func_type'``, the input syntax is modified to " "correspond to :pep:`484` \"signature type comments\", e.g. ``(str, int) -> " "List[str]``." msgstr "" -#: ../../library/ast.rst:2144 +#: ../../library/ast.rst:2182 msgid "" "Also, setting ``feature_version`` to a tuple ``(major, minor)`` will attempt " "to parse using that Python version's grammar. Currently ``major`` must equal " @@ -1051,12 +1056,12 @@ msgid "" "version is ``(3, 4)``; the highest is ``sys.version_info[0:2]``." msgstr "" -#: ../../library/ast.rst:2151 +#: ../../library/ast.rst:2189 msgid "" "If source contains a null character ('\\0'), :exc:`ValueError` is raised." msgstr "" -#: ../../library/ast.rst:2154 +#: ../../library/ast.rst:2192 msgid "" "Note that successfully parsing source code into an AST object doesn't " "guarantee that the source code provided is valid Python code that can be " @@ -1066,45 +1071,45 @@ msgid "" "inside a function node)." msgstr "" -#: ../../library/ast.rst:2161 +#: ../../library/ast.rst:2199 msgid "" "In particular, :func:`ast.parse` won't do any scoping checks, which the " "compilation step does." msgstr "" -#: ../../library/ast.rst:2165 +#: ../../library/ast.rst:2203 msgid "" "It is possible to crash the Python interpreter with a sufficiently large/" "complex string due to stack depth limitations in Python's AST compiler." msgstr "" -#: ../../library/ast.rst:2169 +#: ../../library/ast.rst:2207 msgid "Added ``type_comments``, ``mode='func_type'`` and ``feature_version``." msgstr "" "新增 ``type_comments``\\ 、\\ ``mode='func_type'`` 與 " "``feature_version``\\ 。" -#: ../../library/ast.rst:2175 +#: ../../library/ast.rst:2213 msgid "" "Unparse an :class:`ast.AST` object and generate a string with code that " "would produce an equivalent :class:`ast.AST` object if parsed back with :" "func:`ast.parse`." msgstr "" -#: ../../library/ast.rst:2180 +#: ../../library/ast.rst:2218 msgid "" "The produced code string will not necessarily be equal to the original code " "that generated the :class:`ast.AST` object (without any compiler " "optimizations, such as constant tuples/frozensets)." msgstr "" -#: ../../library/ast.rst:2185 +#: ../../library/ast.rst:2223 msgid "" "Trying to unparse a highly complex expression would result with :exc:" "`RecursionError`." msgstr "" -#: ../../library/ast.rst:2193 +#: ../../library/ast.rst:2231 msgid "" "Evaluate an expression node or a string containing only a Python literal or " "container display. The string or node provided may only consist of the " @@ -1112,14 +1117,14 @@ msgid "" "dicts, sets, booleans, ``None`` and ``Ellipsis``." msgstr "" -#: ../../library/ast.rst:2198 +#: ../../library/ast.rst:2236 msgid "" "This can be used for evaluating strings containing Python values without the " "need to parse the values oneself. It is not capable of evaluating " "arbitrarily complex expressions, for example involving operators or indexing." msgstr "" -#: ../../library/ast.rst:2203 +#: ../../library/ast.rst:2241 msgid "" "This function had been documented as \"safe\" in the past without defining " "what that meant. That was misleading. This is specifically designed not to " @@ -1131,31 +1136,31 @@ msgid "" "untrusted data is thus not recommended." msgstr "" -#: ../../library/ast.rst:2213 +#: ../../library/ast.rst:2251 msgid "" "It is possible to crash the Python interpreter due to stack depth " "limitations in Python's AST compiler." msgstr "" -#: ../../library/ast.rst:2216 +#: ../../library/ast.rst:2254 msgid "" "It can raise :exc:`ValueError`, :exc:`TypeError`, :exc:`SyntaxError`, :exc:" "`MemoryError` and :exc:`RecursionError` depending on the malformed input." msgstr "" -#: ../../library/ast.rst:2220 +#: ../../library/ast.rst:2258 msgid "Now allows bytes and set literals." msgstr "" -#: ../../library/ast.rst:2223 +#: ../../library/ast.rst:2261 msgid "Now supports creating empty sets with ``'set()'``." msgstr "" -#: ../../library/ast.rst:2226 +#: ../../library/ast.rst:2264 msgid "For string inputs, leading spaces and tabs are now stripped." msgstr "" -#: ../../library/ast.rst:2232 +#: ../../library/ast.rst:2270 msgid "" "Return the docstring of the given *node* (which must be a :class:" "`FunctionDef`, :class:`AsyncFunctionDef`, :class:`ClassDef`, or :class:" @@ -1163,24 +1168,24 @@ msgid "" "clean up the docstring's indentation with :func:`inspect.cleandoc`." msgstr "" -#: ../../library/ast.rst:2238 +#: ../../library/ast.rst:2276 msgid ":class:`AsyncFunctionDef` is now supported." msgstr "目前已支援 :class:`AsyncFunctionDef`\\ 。" -#: ../../library/ast.rst:2244 +#: ../../library/ast.rst:2282 msgid "" "Get source code segment of the *source* that generated *node*. If some " "location information (:attr:`lineno`, :attr:`end_lineno`, :attr:" "`col_offset`, or :attr:`end_col_offset`) is missing, return ``None``." msgstr "" -#: ../../library/ast.rst:2248 +#: ../../library/ast.rst:2286 msgid "" "If *padded* is ``True``, the first line of a multi-line statement will be " "padded with spaces to match its original position." msgstr "" -#: ../../library/ast.rst:2256 +#: ../../library/ast.rst:2294 msgid "" "When you compile a node tree with :func:`compile`, the compiler expects :" "attr:`lineno` and :attr:`col_offset` attributes for every node that supports " @@ -1189,77 +1194,77 @@ msgid "" "the values of the parent node. It works recursively starting at *node*." msgstr "" -#: ../../library/ast.rst:2265 +#: ../../library/ast.rst:2303 msgid "" "Increment the line number and end line number of each node in the tree " "starting at *node* by *n*. This is useful to \"move code\" to a different " "location in a file." msgstr "" -#: ../../library/ast.rst:2272 +#: ../../library/ast.rst:2310 msgid "" "Copy source location (:attr:`lineno`, :attr:`col_offset`, :attr:" "`end_lineno`, and :attr:`end_col_offset`) from *old_node* to *new_node* if " "possible, and return *new_node*." msgstr "" -#: ../../library/ast.rst:2279 +#: ../../library/ast.rst:2317 msgid "" "Yield a tuple of ``(fieldname, value)`` for each field in ``node._fields`` " "that is present on *node*." msgstr "" -#: ../../library/ast.rst:2285 +#: ../../library/ast.rst:2323 msgid "" "Yield all direct child nodes of *node*, that is, all fields that are nodes " "and all items of fields that are lists of nodes." msgstr "" -#: ../../library/ast.rst:2291 +#: ../../library/ast.rst:2329 msgid "" "Recursively yield all descendant nodes in the tree starting at *node* " "(including *node* itself), in no specified order. This is useful if you " "only want to modify nodes in place and don't care about the context." msgstr "" -#: ../../library/ast.rst:2298 +#: ../../library/ast.rst:2336 msgid "" "A node visitor base class that walks the abstract syntax tree and calls a " "visitor function for every node found. This function may return a value " "which is forwarded by the :meth:`visit` method." msgstr "" -#: ../../library/ast.rst:2302 +#: ../../library/ast.rst:2340 msgid "" "This class is meant to be subclassed, with the subclass adding visitor " "methods." msgstr "" -#: ../../library/ast.rst:2307 +#: ../../library/ast.rst:2345 msgid "" "Visit a node. The default implementation calls the method called :samp:" "`self.visit_{classname}` where *classname* is the name of the node class, " "or :meth:`generic_visit` if that method doesn't exist." msgstr "" -#: ../../library/ast.rst:2313 +#: ../../library/ast.rst:2351 msgid "This visitor calls :meth:`visit` on all children of the node." msgstr "" -#: ../../library/ast.rst:2315 +#: ../../library/ast.rst:2353 msgid "" "Note that child nodes of nodes that have a custom visitor method won't be " "visited unless the visitor calls :meth:`generic_visit` or visits them itself." msgstr "" -#: ../../library/ast.rst:2319 +#: ../../library/ast.rst:2357 msgid "" "Don't use the :class:`NodeVisitor` if you want to apply changes to nodes " "during traversal. For this a special visitor exists (:class:" "`NodeTransformer`) that allows modifications." msgstr "" -#: ../../library/ast.rst:2325 +#: ../../library/ast.rst:2363 msgid "" "Methods :meth:`visit_Num`, :meth:`visit_Str`, :meth:`visit_Bytes`, :meth:" "`visit_NameConstant` and :meth:`visit_Ellipsis` are deprecated now and will " @@ -1267,13 +1272,13 @@ msgid "" "method to handle all constant nodes." msgstr "" -#: ../../library/ast.rst:2333 +#: ../../library/ast.rst:2371 msgid "" "A :class:`NodeVisitor` subclass that walks the abstract syntax tree and " "allows modification of nodes." msgstr "" -#: ../../library/ast.rst:2336 +#: ../../library/ast.rst:2374 msgid "" "The :class:`NodeTransformer` will walk the AST and use the return value of " "the visitor methods to replace or remove the old node. If the return value " @@ -1282,27 +1287,27 @@ msgid "" "may be the original node in which case no replacement takes place." msgstr "" -#: ../../library/ast.rst:2342 +#: ../../library/ast.rst:2380 msgid "" "Here is an example transformer that rewrites all occurrences of name lookups " "(``foo``) to ``data['foo']``::" msgstr "" -#: ../../library/ast.rst:2354 +#: ../../library/ast.rst:2392 msgid "" "Keep in mind that if the node you're operating on has child nodes you must " "either transform the child nodes yourself or call the :meth:`generic_visit` " "method for the node first." msgstr "" -#: ../../library/ast.rst:2358 +#: ../../library/ast.rst:2396 msgid "" "For nodes that were part of a collection of statements (that applies to all " "statement nodes), the visitor may also return a list of nodes rather than " "just a single node." msgstr "" -#: ../../library/ast.rst:2362 +#: ../../library/ast.rst:2400 msgid "" "If :class:`NodeTransformer` introduces new nodes (that weren't part of " "original tree) without giving them location information (such as :attr:" @@ -1310,11 +1315,11 @@ msgid "" "tree to recalculate the location information::" msgstr "" -#: ../../library/ast.rst:2370 +#: ../../library/ast.rst:2408 msgid "Usually you use the transformer like this::" msgstr "" -#: ../../library/ast.rst:2377 +#: ../../library/ast.rst:2415 msgid "" "Return a formatted dump of the tree in *node*. This is mainly useful for " "debugging purposes. If *annotate_fields* is true (by default), the returned " @@ -1325,7 +1330,7 @@ msgid "" "true." msgstr "" -#: ../../library/ast.rst:2385 +#: ../../library/ast.rst:2423 msgid "" "If *indent* is a non-negative integer or string, then the tree will be " "pretty-printed with that indent level. An indent level of 0, negative, or " @@ -1335,87 +1340,87 @@ msgid "" "string is used to indent each level." msgstr "" -#: ../../library/ast.rst:2392 +#: ../../library/ast.rst:2430 msgid "Added the *indent* option." msgstr "新增 *indent* 選項。" -#: ../../library/ast.rst:2399 +#: ../../library/ast.rst:2437 msgid "Compiler Flags" msgstr "" -#: ../../library/ast.rst:2401 +#: ../../library/ast.rst:2439 msgid "" "The following flags may be passed to :func:`compile` in order to change " "effects on the compilation of a program:" msgstr "" -#: ../../library/ast.rst:2406 +#: ../../library/ast.rst:2444 msgid "" "Enables support for top-level ``await``, ``async for``, ``async with`` and " "async comprehensions." msgstr "" -#: ../../library/ast.rst:2413 +#: ../../library/ast.rst:2451 msgid "" "Generates and returns an abstract syntax tree instead of returning a " "compiled code object." msgstr "" -#: ../../library/ast.rst:2418 +#: ../../library/ast.rst:2456 msgid "" "Enables support for :pep:`484` and :pep:`526` style type comments (``# type: " "``, ``# type: ignore ``)." msgstr "" -#: ../../library/ast.rst:2427 +#: ../../library/ast.rst:2465 msgid "Command-Line Usage" msgstr "" -#: ../../library/ast.rst:2431 +#: ../../library/ast.rst:2469 msgid "" "The :mod:`ast` module can be executed as a script from the command line. It " "is as simple as:" msgstr "" -#: ../../library/ast.rst:2438 +#: ../../library/ast.rst:2476 msgid "The following options are accepted:" msgstr "" -#: ../../library/ast.rst:2444 +#: ../../library/ast.rst:2482 msgid "Show the help message and exit." msgstr "" -#: ../../library/ast.rst:2449 +#: ../../library/ast.rst:2487 msgid "" "Specify what kind of code must be compiled, like the *mode* argument in :" "func:`parse`." msgstr "" -#: ../../library/ast.rst:2454 +#: ../../library/ast.rst:2492 msgid "Don't parse type comments." msgstr "" -#: ../../library/ast.rst:2458 +#: ../../library/ast.rst:2496 msgid "Include attributes such as line numbers and column offsets." msgstr "" -#: ../../library/ast.rst:2463 +#: ../../library/ast.rst:2501 msgid "Indentation of nodes in AST (number of spaces)." msgstr "" -#: ../../library/ast.rst:2465 +#: ../../library/ast.rst:2503 msgid "" "If :file:`infile` is specified its contents are parsed to AST and dumped to " "stdout. Otherwise, the content is read from stdin." msgstr "" -#: ../../library/ast.rst:2471 +#: ../../library/ast.rst:2509 msgid "" "`Green Tree Snakes `_, an external " "documentation resource, has good details on working with Python ASTs." msgstr "" -#: ../../library/ast.rst:2474 +#: ../../library/ast.rst:2512 msgid "" "`ASTTokens `_ " "annotates Python ASTs with the positions of tokens and text in the source " @@ -1423,21 +1428,21 @@ msgid "" "transformations." msgstr "" -#: ../../library/ast.rst:2479 +#: ../../library/ast.rst:2517 msgid "" "`leoAst.py `_ unifies the " "token-based and parse-tree-based views of python programs by inserting two-" "way links between tokens and ast nodes." msgstr "" -#: ../../library/ast.rst:2483 +#: ../../library/ast.rst:2521 msgid "" "`LibCST `_ parses code as a Concrete Syntax " "Tree that looks like an ast tree and keeps all formatting details. It's " "useful for building automated refactoring (codemod) applications and linters." msgstr "" -#: ../../library/ast.rst:2488 +#: ../../library/ast.rst:2526 msgid "" "`Parso `_ is a Python parser that supports " "error recovery and round-trip parsing for different Python versions (in " diff --git a/library/calendar.po b/library/calendar.po index 51a147d790..fc1ca1cc53 100644 --- a/library/calendar.po +++ b/library/calendar.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-26 00:03+0000\n" +"POT-Creation-Date: 2023-09-09 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:40+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -55,21 +55,11 @@ msgstr "" "這個模組定義的函式和類別使用理想化的日曆,也就是公曆 (Gregorian calendar) 無" "限往前後兩個方向延伸。這符合 Dershowitz 和 Reingold 在「Calendrical " "Calculations」這本書定義的「逆推公曆」(proleptic Gregorian),是做所有計算的基" -"礎日曆。0 及負數年份的解讀跟 ISO 8601 標準裡規定的一樣,0 年是公元前 1 年,-1" -" 年是公元前 2 年依此類推。" +"礎日曆。0 及負數年份的解讀跟 ISO 8601 標準裡規定的一樣,0 年是公元前 1 " +"年,-1 年是公元前 2 年依此類推。" #: ../../library/calendar.rst:33 msgid "" -"Enumeration defining the days of the week as integer constants, from 0 to 6." -msgstr "定義一週的每一天的列舉,為 0 到 6 的整數常數。" - -#: ../../library/calendar.rst:54 -msgid "" -"Enumeration defining months of the year as integer constants, from 1 to 12." -msgstr "定義一年中的月份的列舉,為 1 到 12 的整數常數。" - -#: ../../library/calendar.rst:85 -msgid "" "Creates a :class:`Calendar` object. *firstweekday* is an integer specifying " "the first day of the week. :const:`MONDAY` is ``0`` (the default), :const:" "`SUNDAY` is ``6``." @@ -77,7 +67,7 @@ msgstr "" "建立 :class:`Calendar` 物件。*firstweekday* 是一個指定一週第一天的整數,:" "const:`MONDAY` 是 ``0``\\ (預設值),:const:`SUNDAY` 是 ``6``。" -#: ../../library/calendar.rst:88 +#: ../../library/calendar.rst:36 msgid "" "A :class:`Calendar` object provides several methods that can be used for " "preparing the calendar data for formatting. This class doesn't do any " @@ -86,11 +76,11 @@ msgstr "" ":class:`Calendar` 物件提供一些方法來為日曆資料的格式化做準備。這個類別本身不" "做任何格式化,這是子類別的工作。" -#: ../../library/calendar.rst:93 +#: ../../library/calendar.rst:41 msgid ":class:`Calendar` instances have the following methods:" msgstr ":class:`Calendar` 實例有以下方法:" -#: ../../library/calendar.rst:97 +#: ../../library/calendar.rst:45 msgid "" "Return an iterator for the week day numbers that will be used for one week. " "The first value from the iterator will be the same as the value of the :attr:" @@ -99,7 +89,7 @@ msgstr "" "回傳一個以數字代表一週的每一天的疊代器 (iterator)。疊代器的第一個值和 :attr:" "`firstweekday` 屬性的值一樣。" -#: ../../library/calendar.rst:104 +#: ../../library/calendar.rst:52 msgid "" "Return an iterator for the month *month* (1--12) in the year *year*. This " "iterator will return all days (as :class:`datetime.date` objects) for the " @@ -109,7 +99,7 @@ msgstr "" "回傳一個在 *year* 年 *month* (1--12) 月的疊代器。這個疊代器會回傳該月的所有日" "期(:class:`datetime.date` 物件)以及在該月之前及之後用來組成完整一週的日期。" -#: ../../library/calendar.rst:112 +#: ../../library/calendar.rst:60 msgid "" "Return an iterator for the month *month* in the year *year* similar to :meth:" "`itermonthdates`, but not restricted by the :class:`datetime.date` range. " @@ -120,7 +110,7 @@ msgstr "" "限於 :class:`datetime.date` 的範圍。回傳的日期單純是該月當日的數字,對於該月" "之外的日期數字會是 ``0``。" -#: ../../library/calendar.rst:120 +#: ../../library/calendar.rst:68 msgid "" "Return an iterator for the month *month* in the year *year* similar to :meth:" "`itermonthdates`, but not restricted by the :class:`datetime.date` range. " @@ -131,7 +121,7 @@ msgstr "" "限於 :class:`datetime.date` 的範圍。回傳的日期是一個由該月當日的數字及代表週" "幾的數字組成的元組。" -#: ../../library/calendar.rst:128 +#: ../../library/calendar.rst:76 msgid "" "Return an iterator for the month *month* in the year *year* similar to :meth:" "`itermonthdates`, but not restricted by the :class:`datetime.date` range. " @@ -142,7 +132,7 @@ msgstr "" "限於 :class:`datetime.date` 的範圍。回傳的日期是一個由年、月、日的數字組成的" "元組。" -#: ../../library/calendar.rst:138 +#: ../../library/calendar.rst:86 msgid "" "Return an iterator for the month *month* in the year *year* similar to :meth:" "`itermonthdates`, but not restricted by the :class:`datetime.date` range. " @@ -153,7 +143,7 @@ msgstr "" "限於 :class:`datetime.date` 的範圍。回傳的日期是一個由年、月、日及代表週幾的" "數字組成的元組。" -#: ../../library/calendar.rst:148 +#: ../../library/calendar.rst:96 msgid "" "Return a list of the weeks in the month *month* of the *year* as full " "weeks. Weeks are lists of seven :class:`datetime.date` objects." @@ -161,7 +151,7 @@ msgstr "" "回傳一個在 *year* 年 *month* 月每一週組成的串列。每一週是一個串列,包含七個 :" "class:`datetime.date` 物件。" -#: ../../library/calendar.rst:154 +#: ../../library/calendar.rst:102 msgid "" "Return a list of the weeks in the month *month* of the *year* as full " "weeks. Weeks are lists of seven tuples of day numbers and weekday numbers." @@ -169,7 +159,7 @@ msgstr "" "回傳一個在 *year* 年 *month* 月每一週組成的串列。每一週是一個串列,包含七個該" "月當日的數字及代表週幾的數字組成的元組。" -#: ../../library/calendar.rst:161 +#: ../../library/calendar.rst:109 msgid "" "Return a list of the weeks in the month *month* of the *year* as full " "weeks. Weeks are lists of seven day numbers." @@ -177,7 +167,7 @@ msgstr "" "回傳一個在 *year* 年 *month* 月每一週組成的串列。每一週是一個串列,包含七個該" "月當日的數字。" -#: ../../library/calendar.rst:167 +#: ../../library/calendar.rst:115 msgid "" "Return the data for the specified year ready for formatting. The return " "value is a list of month rows. Each month row contains up to *width* months " @@ -188,7 +178,7 @@ msgstr "" "*width* 個月份組成(預設為 3)。每個月份包含四到六週,每一週包含一到七天,每" "一天則是一個 :class:`datetime.date` 物件。" -#: ../../library/calendar.rst:175 +#: ../../library/calendar.rst:123 msgid "" "Return the data for the specified year ready for formatting (similar to :" "meth:`yeardatescalendar`). Entries in the week lists are tuples of day " @@ -197,7 +187,7 @@ msgstr "" "回傳用來格式化的指定年份的資料(類似 :meth:`yeardatescalendar`)。每一天是一" "個該月當日的數字及代表週幾的數字組成的元組,該月外的日期的該月當日數字為 0。" -#: ../../library/calendar.rst:182 +#: ../../library/calendar.rst:130 msgid "" "Return the data for the specified year ready for formatting (similar to :" "meth:`yeardatescalendar`). Entries in the week lists are day numbers. Day " @@ -206,15 +196,15 @@ msgstr "" "回傳用來格式化的指定年份的資料(類似 :meth:`yeardatescalendar`)。每一天是一" "個該月當日的數字,該月外的日期的該月當日數字為 0。" -#: ../../library/calendar.rst:189 +#: ../../library/calendar.rst:137 msgid "This class can be used to generate plain text calendars." msgstr "這個類別用來產生純文字的日曆。" -#: ../../library/calendar.rst:191 +#: ../../library/calendar.rst:139 msgid ":class:`TextCalendar` instances have the following methods:" msgstr ":class:`TextCalendar` 實例有以下方法:" -#: ../../library/calendar.rst:195 +#: ../../library/calendar.rst:143 msgid "" "Return a month's calendar in a multi-line string. If *w* is provided, it " "specifies the width of the date columns, which are centered. If *l* is " @@ -226,11 +216,11 @@ msgstr "" "度。如果給定 *l*,它會指定每一週使用的行數。這個日曆會依據在建構函式中指定或" "者透過 :meth:`setfirstweekday` 方法設定的一週的第一天來輸出。" -#: ../../library/calendar.rst:204 +#: ../../library/calendar.rst:152 msgid "Print a month's calendar as returned by :meth:`formatmonth`." msgstr "印出一個月份的日曆,內容和 :meth:`formatmonth` 回傳的一樣。" -#: ../../library/calendar.rst:209 +#: ../../library/calendar.rst:157 msgid "" "Return a *m*-column calendar for an entire year as a multi-line string. " "Optional parameters *w*, *l*, and *c* are for date column width, lines per " @@ -244,20 +234,20 @@ msgstr "" "者透過 :meth:`setfirstweekday` 方法設定的一週的第一天來輸出。最早可以產生日曆" "的年份會依據平台而不同。" -#: ../../library/calendar.rst:219 +#: ../../library/calendar.rst:167 msgid "" "Print the calendar for an entire year as returned by :meth:`formatyear`." msgstr "印出一整年的日曆,內容和 :meth:`formatyear` 回傳的一樣。" -#: ../../library/calendar.rst:224 +#: ../../library/calendar.rst:172 msgid "This class can be used to generate HTML calendars." msgstr "這個類別用來產生 HTML 日曆。" -#: ../../library/calendar.rst:227 +#: ../../library/calendar.rst:175 msgid ":class:`!HTMLCalendar` instances have the following methods:" msgstr ":class:`!HTMLCalendar` 實例有以下方法:" -#: ../../library/calendar.rst:231 +#: ../../library/calendar.rst:179 msgid "" "Return a month's calendar as an HTML table. If *withyear* is true the year " "will be included in the header, otherwise just the month name will be used." @@ -265,14 +255,14 @@ msgstr "" "以 HTML 表格的形式回傳一個月份的日曆。如果 *withyear* 是 true 則標題會包含年" "份,否則只會有月份名稱。" -#: ../../library/calendar.rst:238 +#: ../../library/calendar.rst:186 msgid "" "Return a year's calendar as an HTML table. *width* (defaulting to 3) " "specifies the number of months per row." msgstr "" "以 HTML 表格的形式回傳一整年的日曆。*width*\\ (預設為 3)指定一列有幾個月。" -#: ../../library/calendar.rst:244 +#: ../../library/calendar.rst:192 msgid "" "Return a year's calendar as a complete HTML page. *width* (defaulting to 3) " "specifies the number of months per row. *css* is the name for the cascading " @@ -284,30 +274,30 @@ msgstr "" "月。*css* 是要使用的 CSS (cascading style sheet) 名稱,可以給 :const:`None` " "表示不使用任何 CSS。*encoding* 指定輸出使用的編碼(預設使用系統預設編碼)。" -#: ../../library/calendar.rst:251 +#: ../../library/calendar.rst:199 msgid "" ":class:`!HTMLCalendar` has the following attributes you can override to " "customize the CSS classes used by the calendar:" msgstr ":class:`!HTMLCalendar` 可以覆寫以下屬性來客製日曆所使用的 CSS 類別:" -#: ../../library/calendar.rst:256 +#: ../../library/calendar.rst:204 msgid "" "A list of CSS classes used for each weekday. The default class list is::" msgstr "對應一週每一天 CSS 類別的串列。預設的串列內容為: ::" -#: ../../library/calendar.rst:260 +#: ../../library/calendar.rst:208 msgid "more styles can be added for each day::" msgstr "可以針對每一天增加更多樣式: ::" -#: ../../library/calendar.rst:264 +#: ../../library/calendar.rst:212 msgid "Note that the length of this list must be seven items." msgstr "注意這個串列的長度必須是七個項目。" -#: ../../library/calendar.rst:269 +#: ../../library/calendar.rst:217 msgid "The CSS class for a weekday occurring in the previous or coming month." msgstr "跟當月為同一週且屬於前一個或下一個月份的日期使用的 CSS 類別。" -#: ../../library/calendar.rst:276 +#: ../../library/calendar.rst:224 msgid "" "A list of CSS classes used for weekday names in the header row. The default " "is the same as :attr:`cssclasses`." @@ -315,7 +305,7 @@ msgstr "" "在標題列中一週每一天名稱的 CSS 類別的串列。預設內容和 :attr:`cssclasses` 相" "同。" -#: ../../library/calendar.rst:284 +#: ../../library/calendar.rst:232 msgid "" "The month's head CSS class (used by :meth:`formatmonthname`). The default " "value is ``\"month\"``." @@ -323,7 +313,7 @@ msgstr "" "月份標題的 CSS 類別(由 :meth:`formatmonthname` 所使用),預設值是 " "``\"month\"``。" -#: ../../library/calendar.rst:292 +#: ../../library/calendar.rst:240 msgid "" "The CSS class for the whole month's table (used by :meth:`formatmonth`). The " "default value is ``\"month\"``." @@ -331,14 +321,14 @@ msgstr "" "整個月份表格的 CSS 類別(由 :meth:`formatmonth` 所使用),預設值是 " "``\"month\"``。" -#: ../../library/calendar.rst:300 +#: ../../library/calendar.rst:248 msgid "" "The CSS class for the whole year's table of tables (used by :meth:" "`formatyear`). The default value is ``\"year\"``." msgstr "" "整年表格的 CSS 類別(由 :meth:`formatyear` 所使用),預設值是 ``\"year\"``。" -#: ../../library/calendar.rst:308 +#: ../../library/calendar.rst:256 msgid "" "The CSS class for the table head for the whole year (used by :meth:" "`formatyear`). The default value is ``\"year\"``." @@ -346,7 +336,7 @@ msgstr "" "整年表格標題的 CSS 類別(由 :meth:`formatyear` 所使用),預設值是 " "``\"year\"``。" -#: ../../library/calendar.rst:314 +#: ../../library/calendar.rst:262 msgid "" "Note that although the naming for the above described class attributes is " "singular (e.g. ``cssclass_month`` ``cssclass_noday``), one can replace the " @@ -356,11 +346,11 @@ msgstr "" "``cssclass_noday``),你可以使用多個以空格隔開的 CSS 類別取代單一 CSS 類別," "例如: ::" -#: ../../library/calendar.rst:320 +#: ../../library/calendar.rst:268 msgid "Here is an example how :class:`!HTMLCalendar` can be customized::" msgstr "以下是客製化 :class:`!HTMLCalendar` 的範例: ::" -#: ../../library/calendar.rst:332 +#: ../../library/calendar.rst:280 msgid "" "This subclass of :class:`TextCalendar` can be passed a locale name in the " "constructor and will return month and weekday names in the specified locale." @@ -368,7 +358,7 @@ msgstr "" ":class:`TextCalendar` 的子類別,可以在建構函式傳入語系名稱,它會回傳指定語系" "的月份及一週每一天的名稱。" -#: ../../library/calendar.rst:338 +#: ../../library/calendar.rst:286 msgid "" "This subclass of :class:`HTMLCalendar` can be passed a locale name in the " "constructor and will return month and weekday names in the specified locale." @@ -376,7 +366,7 @@ msgstr "" ":class:`HTMLCalendar` 的子類別,可以在建構函式傳入語系名稱,它會回傳指定語系" "的月份及一週每一天的名稱。" -#: ../../library/calendar.rst:344 +#: ../../library/calendar.rst:292 msgid "" "The constructor, :meth:`formatweekday` and :meth:`formatmonthname` methods " "of these two classes temporarily change the ``LC_TIME`` locale to the given " @@ -387,11 +377,11 @@ msgstr "" "把 ``LC_TIME`` 語系暫時改成給定的 *locale*。因為目前的語系是屬於整個行程 " "(process-wide) 的設定,它們不是執行緒安全的。" -#: ../../library/calendar.rst:350 +#: ../../library/calendar.rst:298 msgid "For simple text calendars this module provides the following functions." msgstr "這個模組提供以下函式給單純的文字日曆使用。" -#: ../../library/calendar.rst:354 +#: ../../library/calendar.rst:302 msgid "" "Sets the weekday (``0`` is Monday, ``6`` is Sunday) to start each week. The " "values :const:`MONDAY`, :const:`TUESDAY`, :const:`WEDNESDAY`, :const:" @@ -402,26 +392,27 @@ msgstr "" "`TUESDAY`、:const:`WEDNESDAY`、:const:`THURSDAY`、:const:`FRIDAY`、:const:" "`SATURDAY` 及 :const:`SUNDAY` 可以方便設定。例如設定一週的第一天為週日: ::" -#: ../../library/calendar.rst:365 +#: ../../library/calendar.rst:313 msgid "Returns the current setting for the weekday to start each week." msgstr "回傳目前設定的一週的第一天。" -#: ../../library/calendar.rst:370 +#: ../../library/calendar.rst:318 msgid "" "Returns :const:`True` if *year* is a leap year, otherwise :const:`False`." msgstr "如果 *year* 是閏年回傳 :const:`True`,否則回傳 :const:`False`。" -#: ../../library/calendar.rst:375 +#: ../../library/calendar.rst:323 msgid "" "Returns the number of leap years in the range from *y1* to *y2* (exclusive), " "where *y1* and *y2* are years." -msgstr "回傳從 *y1* 到 *y2*\\ (不包含)間有幾個閏年,其中 *y1* 和 *y2* 是年份。" +msgstr "" +"回傳從 *y1* 到 *y2*\\ (不包含)間有幾個閏年,其中 *y1* 和 *y2* 是年份。" -#: ../../library/calendar.rst:378 +#: ../../library/calendar.rst:326 msgid "This function works for ranges spanning a century change." msgstr "這個函式也適用在跨越世紀的時間範圍。" -#: ../../library/calendar.rst:383 +#: ../../library/calendar.rst:331 msgid "" "Returns the day of the week (``0`` is Monday) for *year* (``1970``--...), " "*month* (``1``--``12``), *day* (``1``--``31``)." @@ -429,32 +420,32 @@ msgstr "" "回傳 *year* 年 (``1970``--...) *month* 月 (``1``--``12``) *day* 日 (``1``--" "``31``) 是週幾(``0`` 是星期一)。" -#: ../../library/calendar.rst:389 +#: ../../library/calendar.rst:337 msgid "" "Return a header containing abbreviated weekday names. *n* specifies the " "width in characters for one weekday." msgstr "回傳包含一週每一天的名稱縮寫的標題。*n* 指定每一天的字元寬度。" -#: ../../library/calendar.rst:395 +#: ../../library/calendar.rst:343 msgid "" "Returns weekday of first day of the month and number of days in month, for " "the specified *year* and *month*." msgstr "回傳指定 *year* 年 *month* 月該月第一天代表週幾的數字及該月有多少天。" -#: ../../library/calendar.rst:401 +#: ../../library/calendar.rst:349 msgid "" "Returns a matrix representing a month's calendar. Each row represents a " "week; days outside of the month are represented by zeros. Each week begins " "with Monday unless set by :func:`setfirstweekday`." msgstr "" -"回傳代表一個月份日曆的矩陣。每一列為一週;該月以外的日期以 0 表示。每一週以" -"週一開始,除非有使用 :func:`setfirstweekday` 改變設定。" +"回傳代表一個月份日曆的矩陣。每一列為一週;該月以外的日期以 0 表示。每一週以週" +"一開始,除非有使用 :func:`setfirstweekday` 改變設定。" -#: ../../library/calendar.rst:408 +#: ../../library/calendar.rst:356 msgid "Prints a month's calendar as returned by :func:`month`." msgstr "印出一個月份的日曆,跟 :func:`month` 回傳的內容一樣。" -#: ../../library/calendar.rst:413 +#: ../../library/calendar.rst:361 msgid "" "Returns a month's calendar in a multi-line string using the :meth:" "`formatmonth` of the :class:`TextCalendar` class." @@ -462,12 +453,12 @@ msgstr "" "以多行字串的形式回傳一個月的日曆,使用 :class:`TextCalendar` 類別的 :meth:" "`formatmonth`。" -#: ../../library/calendar.rst:419 +#: ../../library/calendar.rst:367 msgid "" "Prints the calendar for an entire year as returned by :func:`calendar`." msgstr "印出一整年的日曆,跟 :func:`calendar` 回傳的內容一樣。" -#: ../../library/calendar.rst:424 +#: ../../library/calendar.rst:372 msgid "" "Returns a 3-column calendar for an entire year as a multi-line string using " "the :meth:`formatyear` of the :class:`TextCalendar` class." @@ -475,7 +466,7 @@ msgstr "" "以多行字串回傳三欄形式的一整年日曆,使用 :class:`TextCalendar` 類別的 :meth:" "`formatyear`。" -#: ../../library/calendar.rst:430 +#: ../../library/calendar.rst:378 msgid "" "An unrelated but handy function that takes a time tuple such as returned by " "the :func:`~time.gmtime` function in the :mod:`time` module, and returns the " @@ -487,21 +478,34 @@ msgstr "" "gmtime` 函式回傳的元組,並回傳對應的 Unix 時間戳,假設從 1970 開始及 POSIX 編" "碼。事實上,:func:`time.gmtime` 和 :func:`timegm` 是彼此相反的。" -#: ../../library/calendar.rst:437 +#: ../../library/calendar.rst:385 msgid "The :mod:`calendar` module exports the following data attributes:" msgstr ":mod:`calendar` 模組匯出以下資料屬性:" -#: ../../library/calendar.rst:441 +#: ../../library/calendar.rst:389 msgid "An array that represents the days of the week in the current locale." msgstr "以目前語系來表示的一週每一天名稱的陣列。" -#: ../../library/calendar.rst:446 +#: ../../library/calendar.rst:394 msgid "" "An array that represents the abbreviated days of the week in the current " "locale." msgstr "以目前語系來表示的一週每一天縮寫名稱的陣列。" -#: ../../library/calendar.rst:451 +#: ../../library/calendar.rst:405 +msgid "" +"Aliases for the days of the week, where ``MONDAY`` is ``0`` and ``SUNDAY`` " +"is ``6``." +msgstr "一週每一天的別名,其中 ``MONDAY`` 是 ``0`` 而 ``SUNDAY`` 是 ``6``。" + +#: ../../library/calendar.rst:413 +msgid "" +"Enumeration defining days of the week as integer constants. The members of " +"this enumeration are exported to the module scope as :data:`MONDAY` through :" +"data:`SUNDAY`." +msgstr "" + +#: ../../library/calendar.rst:422 msgid "" "An array that represents the months of the year in the current locale. This " "follows normal convention of January being month number 1, so it has a " @@ -510,7 +514,7 @@ msgstr "" "以目前語系來表示的一年每個月份名稱的陣列。它按照一般慣例以數字 1 代表一月,因" "此它的長度為 13,而 ``month_name[0]`` 是空字串。" -#: ../../library/calendar.rst:458 +#: ../../library/calendar.rst:429 msgid "" "An array that represents the abbreviated months of the year in the current " "locale. This follows normal convention of January being month number 1, so " @@ -519,49 +523,153 @@ msgstr "" "以目前語系來表示的一年每個月份縮寫名稱的陣列。它按照一般慣例以數字 1 代表一" "月,因此它的長度為 13,而 ``month_abbr[0]`` 是空字串。" -#: ../../library/calendar.rst:470 +#: ../../library/calendar.rst:447 msgid "" -"Aliases for day numbers, where ``MONDAY`` is ``0`` and ``SUNDAY`` is ``6``." -msgstr "一週每一天的別名,其中 ``MONDAY`` 是 ``0`` 而 ``SUNDAY`` 是 ``6``。" +"Aliases for the months of the year, where ``JANUARY`` is ``1`` and " +"``DECEMBER`` is ``12``." +msgstr "" +"一年內每個月的別名,其中 ``JANUARY`` 是 ``ㄅ`` 而 ``DECEMBER`` 是 ``12``。" -#: ../../library/calendar.rst:473 +#: ../../library/calendar.rst:455 +msgid "" +"Enumeration defining months of the year as integer constants. The members of " +"this enumeration are exported to the module scope as :data:`JANUARY` " +"through :data:`DECEMBER`." +msgstr "" + +#: ../../library/calendar.rst:462 msgid "The :mod:`calendar` module defines the following exceptions:" msgstr "" -#: ../../library/calendar.rst:477 +#: ../../library/calendar.rst:466 msgid "" "A subclass of :exc:`ValueError`, raised when the given month number is " "outside of the range 1-12 (inclusive)." msgstr "" -#: ../../library/calendar.rst:482 +#: ../../library/calendar.rst:471 msgid "The invalid month number." msgstr "" -#: ../../library/calendar.rst:487 +#: ../../library/calendar.rst:476 msgid "" "A subclass of :exc:`ValueError`, raised when the given weekday number is " "outside of the range 0-6 (inclusive)." msgstr "" -#: ../../library/calendar.rst:492 +#: ../../library/calendar.rst:481 msgid "The invalid weekday number." msgstr "" -#: ../../library/calendar.rst:499 +#: ../../library/calendar.rst:488 msgid "Module :mod:`datetime`" msgstr ":mod:`datetime` 模組" -#: ../../library/calendar.rst:498 +#: ../../library/calendar.rst:487 msgid "" "Object-oriented interface to dates and times with similar functionality to " "the :mod:`time` module." msgstr "日期與時間的物件導向介面,和 :mod:`time` 模組有相似的功能。" -#: ../../library/calendar.rst:501 +#: ../../library/calendar.rst:490 msgid "Module :mod:`time`" msgstr ":mod:`time` 模組" -#: ../../library/calendar.rst:502 +#: ../../library/calendar.rst:491 msgid "Low-level time related functions." msgstr "底層的時間相關函式。" + +#: ../../library/calendar.rst:497 +msgid "Command-Line Usage" +msgstr "" + +#: ../../library/calendar.rst:501 +msgid "" +"The :mod:`calendar` module can be executed as a script from the command line " +"to interactively print a calendar." +msgstr "" + +#: ../../library/calendar.rst:511 +msgid "For example, to print a calendar for the year 2000:" +msgstr "" + +#: ../../library/calendar.rst:554 +msgid "The following options are accepted:" +msgstr "" + +#: ../../library/calendar.rst:561 +msgid "Show the help message and exit." +msgstr "" + +#: ../../library/calendar.rst:566 +msgid "The locale to use for month and weekday names. Defaults to English." +msgstr "" + +#: ../../library/calendar.rst:572 +msgid "" +"The encoding to use for output. :option:`--encoding` is required if :option:" +"`--locale` is set." +msgstr "" + +#: ../../library/calendar.rst:578 +msgid "Print the calendar to the terminal as text, or as an HTML document." +msgstr "" + +#: ../../library/calendar.rst:584 +msgid "" +"The year to print the calendar for. Must be a number between 1 and 9999. " +"Defaults to the current year." +msgstr "" + +#: ../../library/calendar.rst:591 +msgid "" +"The month of the specified :option:`year` to print the calendar for. Must be " +"a number between 1 and 12, and may only be used in text mode. Defaults to " +"printing a calendar for the full year." +msgstr "" + +#: ../../library/calendar.rst:597 +msgid "*Text-mode options:*" +msgstr "" + +#: ../../library/calendar.rst:601 +msgid "" +"The width of the date column in terminal columns. The date is printed " +"centred in the column. Any value lower than 2 is ignored. Defaults to 2." +msgstr "" + +#: ../../library/calendar.rst:609 +msgid "" +"The number of lines for each week in terminal rows. The date is printed top-" +"aligned. Any value lower than 1 is ignored. Defaults to 1." +msgstr "" + +#: ../../library/calendar.rst:617 +msgid "" +"The space between months in columns. Any value lower than 2 is ignored. " +"Defaults to 6." +msgstr "" + +#: ../../library/calendar.rst:624 +msgid "The number of months printed per row. Defaults to 3." +msgstr "" + +#: ../../library/calendar.rst:628 +msgid "*HTML-mode options:*" +msgstr "" + +#: ../../library/calendar.rst:632 +msgid "" +"The path of a CSS stylesheet to use for the calendar. This must either be " +"relative to the generated HTML, or an absolute HTTP or ``file:///`` URL." +msgstr "" + +#~ msgid "" +#~ "Enumeration defining the days of the week as integer constants, from 0 to " +#~ "6." +#~ msgstr "定義一週的每一天的列舉,為 0 到 6 的整數常數。" + +#~ msgid "" +#~ "Enumeration defining months of the year as integer constants, from 1 to " +#~ "12." +#~ msgstr "定義一年中的月份的列舉,為 1 到 12 的整數常數。" diff --git a/library/configparser.po b/library/configparser.po index e7185179f7..1fd52352d6 100644 --- a/library/configparser.po +++ b/library/configparser.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-09-09 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:41+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -713,10 +713,12 @@ msgid "" "When *default_section* is given, it specifies the name for the special " "section holding default values for other sections and interpolation purposes " "(normally named ``\"DEFAULT\"``). This value can be retrieved and changed " -"on runtime using the ``default_section`` instance attribute." +"at runtime using the ``default_section`` instance attribute. This won't re-" +"evaluate an already parsed config file, but will be used when writing parsed " +"settings to a new config file." msgstr "" -#: ../../library/configparser.rst:941 +#: ../../library/configparser.rst:943 msgid "" "Interpolation behaviour may be customized by providing a custom handler " "through the *interpolation* argument. ``None`` can be used to turn off " @@ -725,7 +727,7 @@ msgid "" "`dedicated documentation section <#interpolation-of-values>`_." msgstr "" -#: ../../library/configparser.rst:947 +#: ../../library/configparser.rst:949 msgid "" "All option names used in interpolation will be passed through the :meth:" "`optionxform` method just like any other option name reference. For " @@ -734,7 +736,7 @@ msgid "" "%(BAR)s`` are equivalent." msgstr "" -#: ../../library/configparser.rst:953 +#: ../../library/configparser.rst:955 msgid "" "When *converters* is given, it should be a dictionary where each key " "represents the name of a type converter and each value is a callable " @@ -743,44 +745,44 @@ msgid "" "object and section proxies." msgstr "" -#: ../../library/configparser.rst:959 +#: ../../library/configparser.rst:961 msgid "The default *dict_type* is :class:`collections.OrderedDict`." msgstr "" -#: ../../library/configparser.rst:962 +#: ../../library/configparser.rst:964 msgid "" "*allow_no_value*, *delimiters*, *comment_prefixes*, *strict*, " "*empty_lines_in_values*, *default_section* and *interpolation* were added." msgstr "" -#: ../../library/configparser.rst:967 +#: ../../library/configparser.rst:969 msgid "The *converters* argument was added." msgstr "新增 *converters* 引數。" -#: ../../library/configparser.rst:970 +#: ../../library/configparser.rst:972 msgid "" "The *defaults* argument is read with :meth:`read_dict()`, providing " "consistent behavior across the parser: non-string keys and values are " "implicitly converted to strings." msgstr "" -#: ../../library/configparser.rst:975 ../../library/configparser.rst:1238 +#: ../../library/configparser.rst:977 ../../library/configparser.rst:1240 msgid "" "The default *dict_type* is :class:`dict`, since it now preserves insertion " "order." msgstr "" -#: ../../library/configparser.rst:981 +#: ../../library/configparser.rst:983 msgid "Return a dictionary containing the instance-wide defaults." msgstr "" -#: ../../library/configparser.rst:986 +#: ../../library/configparser.rst:988 msgid "" "Return a list of the sections available; the *default section* is not " "included in the list." msgstr "" -#: ../../library/configparser.rst:992 +#: ../../library/configparser.rst:994 msgid "" "Add a section named *section* to the instance. If a section by the given " "name already exists, :exc:`DuplicateSectionError` is raised. If the " @@ -788,34 +790,34 @@ msgid "" "the section must be a string; if not, :exc:`TypeError` is raised." msgstr "" -#: ../../library/configparser.rst:997 +#: ../../library/configparser.rst:999 msgid "Non-string section names raise :exc:`TypeError`." msgstr "" -#: ../../library/configparser.rst:1003 +#: ../../library/configparser.rst:1005 msgid "" "Indicates whether the named *section* is present in the configuration. The " "*default section* is not acknowledged." msgstr "" -#: ../../library/configparser.rst:1009 +#: ../../library/configparser.rst:1011 msgid "Return a list of options available in the specified *section*." msgstr "" -#: ../../library/configparser.rst:1014 +#: ../../library/configparser.rst:1016 msgid "" "If the given *section* exists, and contains the given *option*, return :" "const:`True`; otherwise return :const:`False`. If the specified *section* " "is :const:`None` or an empty string, DEFAULT is assumed." msgstr "" -#: ../../library/configparser.rst:1021 +#: ../../library/configparser.rst:1023 msgid "" "Attempt to read and parse an iterable of filenames, returning a list of " "filenames which were successfully parsed." msgstr "" -#: ../../library/configparser.rst:1024 +#: ../../library/configparser.rst:1026 msgid "" "If *filenames* is a string, a :class:`bytes` object or a :term:`path-like " "object`, it is treated as a single filename. If a file named in *filenames* " @@ -826,7 +828,7 @@ msgid "" "be read." msgstr "" -#: ../../library/configparser.rst:1033 +#: ../../library/configparser.rst:1035 msgid "" "If none of the named files exist, the :class:`ConfigParser` instance will " "contain an empty dataset. An application which requires initial values to " @@ -834,49 +836,49 @@ msgid "" "`read_file` before calling :meth:`read` for any optional files::" msgstr "" -#: ../../library/configparser.rst:1046 +#: ../../library/configparser.rst:1048 msgid "" "The *encoding* parameter. Previously, all files were read using the default " "encoding for :func:`open`." msgstr "" -#: ../../library/configparser.rst:1050 +#: ../../library/configparser.rst:1052 msgid "The *filenames* parameter accepts a :term:`path-like object`." msgstr "" -#: ../../library/configparser.rst:1053 +#: ../../library/configparser.rst:1055 msgid "The *filenames* parameter accepts a :class:`bytes` object." msgstr "" -#: ../../library/configparser.rst:1059 +#: ../../library/configparser.rst:1061 msgid "" "Read and parse configuration data from *f* which must be an iterable " "yielding Unicode strings (for example files opened in text mode)." msgstr "" -#: ../../library/configparser.rst:1062 +#: ../../library/configparser.rst:1064 msgid "" "Optional argument *source* specifies the name of the file being read. If " "not given and *f* has a :attr:`name` attribute, that is used for *source*; " "the default is ``''``." msgstr "" -#: ../../library/configparser.rst:1066 +#: ../../library/configparser.rst:1068 msgid "Replaces :meth:`readfp`." msgstr "" -#: ../../library/configparser.rst:1071 +#: ../../library/configparser.rst:1073 msgid "Parse configuration data from a string." msgstr "" -#: ../../library/configparser.rst:1073 +#: ../../library/configparser.rst:1075 msgid "" "Optional argument *source* specifies a context-specific name of the string " "passed. If not given, ``''`` is used. This should commonly be a " "filesystem path or a URL." msgstr "" -#: ../../library/configparser.rst:1082 +#: ../../library/configparser.rst:1084 msgid "" "Load configuration from any object that provides a dict-like ``items()`` " "method. Keys are section names, values are dictionaries with keys and " @@ -885,17 +887,17 @@ msgid "" "automatically converted to strings." msgstr "" -#: ../../library/configparser.rst:1088 +#: ../../library/configparser.rst:1090 msgid "" "Optional argument *source* specifies a context-specific name of the " "dictionary passed. If not given, ```` is used." msgstr "" -#: ../../library/configparser.rst:1091 +#: ../../library/configparser.rst:1093 msgid "This method can be used to copy state between parsers." msgstr "" -#: ../../library/configparser.rst:1098 +#: ../../library/configparser.rst:1100 msgid "" "Get an *option* value for the named *section*. If *vars* is provided, it " "must be a dictionary. The *option* is looked up in *vars* (if provided), " @@ -904,35 +906,35 @@ msgid "" "provided as a *fallback* value." msgstr "" -#: ../../library/configparser.rst:1104 +#: ../../library/configparser.rst:1106 msgid "" "All the ``'%'`` interpolations are expanded in the return values, unless the " "*raw* argument is true. Values for interpolation keys are looked up in the " "same manner as the option." msgstr "" -#: ../../library/configparser.rst:1108 +#: ../../library/configparser.rst:1110 msgid "" "Arguments *raw*, *vars* and *fallback* are keyword only to protect users " "from trying to use the third argument as the *fallback* fallback (especially " "when using the mapping protocol)." msgstr "" -#: ../../library/configparser.rst:1116 +#: ../../library/configparser.rst:1118 msgid "" "A convenience method which coerces the *option* in the specified *section* " "to an integer. See :meth:`get` for explanation of *raw*, *vars* and " "*fallback*." msgstr "" -#: ../../library/configparser.rst:1123 +#: ../../library/configparser.rst:1125 msgid "" "A convenience method which coerces the *option* in the specified *section* " "to a floating point number. See :meth:`get` for explanation of *raw*, " "*vars* and *fallback*." msgstr "" -#: ../../library/configparser.rst:1130 +#: ../../library/configparser.rst:1132 msgid "" "A convenience method which coerces the *option* in the specified *section* " "to a Boolean value. Note that the accepted values for the option are " @@ -944,34 +946,34 @@ msgid "" "*fallback*." msgstr "" -#: ../../library/configparser.rst:1143 +#: ../../library/configparser.rst:1145 msgid "" "When *section* is not given, return a list of *section_name*, " "*section_proxy* pairs, including DEFAULTSECT." msgstr "" -#: ../../library/configparser.rst:1146 +#: ../../library/configparser.rst:1148 msgid "" "Otherwise, return a list of *name*, *value* pairs for the options in the " "given *section*. Optional arguments have the same meaning as for the :meth:" "`get` method." msgstr "" -#: ../../library/configparser.rst:1150 +#: ../../library/configparser.rst:1152 msgid "" "Items present in *vars* no longer appear in the result. The previous " "behaviour mixed actual parser options with variables provided for " "interpolation." msgstr "" -#: ../../library/configparser.rst:1158 +#: ../../library/configparser.rst:1160 msgid "" "If the given section exists, set the given option to the specified value; " "otherwise raise :exc:`NoSectionError`. *option* and *value* must be " "strings; if not, :exc:`TypeError` is raised." msgstr "" -#: ../../library/configparser.rst:1165 +#: ../../library/configparser.rst:1167 msgid "" "Write a representation of the configuration to the specified :term:`file " "object`, which must be opened in text mode (accepting strings). This " @@ -980,27 +982,27 @@ msgid "" "surrounded by spaces." msgstr "" -#: ../../library/configparser.rst:1173 +#: ../../library/configparser.rst:1175 msgid "" "Comments in the original configuration file are not preserved when writing " "the configuration back. What is considered a comment, depends on the given " "values for *comment_prefix* and *inline_comment_prefix*." msgstr "" -#: ../../library/configparser.rst:1181 +#: ../../library/configparser.rst:1183 msgid "" "Remove the specified *option* from the specified *section*. If the section " "does not exist, raise :exc:`NoSectionError`. If the option existed to be " "removed, return :const:`True`; otherwise return :const:`False`." msgstr "" -#: ../../library/configparser.rst:1189 +#: ../../library/configparser.rst:1191 msgid "" "Remove the specified *section* from the configuration. If the section in " "fact existed, return ``True``. Otherwise return ``False``." msgstr "" -#: ../../library/configparser.rst:1195 +#: ../../library/configparser.rst:1197 msgid "" "Transforms the option name *option* as found in an input file or as passed " "in by client code to the form that should be used in the internal " @@ -1009,7 +1011,7 @@ msgid "" "of this name on instances to affect this behavior." msgstr "" -#: ../../library/configparser.rst:1201 +#: ../../library/configparser.rst:1203 msgid "" "You don't need to subclass the parser to use this method, you can also set " "it on an instance, to a function that takes a string argument and returns a " @@ -1017,24 +1019,24 @@ msgid "" "sensitive::" msgstr "" -#: ../../library/configparser.rst:1209 +#: ../../library/configparser.rst:1211 msgid "" "Note that when reading configuration files, whitespace around the option " "names is stripped before :meth:`optionxform` is called." msgstr "" -#: ../../library/configparser.rst:1215 +#: ../../library/configparser.rst:1217 msgid "" "The maximum depth for recursive interpolation for :meth:`get` when the *raw* " "parameter is false. This is relevant only when the default *interpolation* " "is used." msgstr "" -#: ../../library/configparser.rst:1223 +#: ../../library/configparser.rst:1225 msgid "RawConfigParser Objects" msgstr "RawConfigParser 物件" -#: ../../library/configparser.rst:1233 +#: ../../library/configparser.rst:1235 msgid "" "Legacy variant of the :class:`ConfigParser`. It has interpolation disabled " "by default and allows for non-string section names, option names, and values " @@ -1042,27 +1044,27 @@ msgid "" "``defaults=`` keyword argument handling." msgstr "" -#: ../../library/configparser.rst:1243 +#: ../../library/configparser.rst:1245 msgid "" "Consider using :class:`ConfigParser` instead which checks types of the " "values to be stored internally. If you don't want interpolation, you can " "use ``ConfigParser(interpolation=None)``." msgstr "" -#: ../../library/configparser.rst:1250 +#: ../../library/configparser.rst:1252 msgid "" "Add a section named *section* to the instance. If a section by the given " "name already exists, :exc:`DuplicateSectionError` is raised. If the " "*default section* name is passed, :exc:`ValueError` is raised." msgstr "" -#: ../../library/configparser.rst:1254 +#: ../../library/configparser.rst:1256 msgid "" "Type of *section* is not checked which lets users create non-string named " "sections. This behaviour is unsupported and may cause internal errors." msgstr "" -#: ../../library/configparser.rst:1260 +#: ../../library/configparser.rst:1262 msgid "" "If the given section exists, set the given option to the specified value; " "otherwise raise :exc:`NoSectionError`. While it is possible to use :class:" @@ -1072,7 +1074,7 @@ msgid "" "string values." msgstr "" -#: ../../library/configparser.rst:1267 +#: ../../library/configparser.rst:1269 msgid "" "This method lets users assign non-string values to keys internally. This " "behaviour is unsupported and will cause errors when attempting to write to a " @@ -1080,32 +1082,32 @@ msgid "" "not allow such assignments to take place." msgstr "" -#: ../../library/configparser.rst:1274 +#: ../../library/configparser.rst:1276 msgid "Exceptions" msgstr "例外" -#: ../../library/configparser.rst:1278 +#: ../../library/configparser.rst:1280 msgid "Base class for all other :mod:`configparser` exceptions." msgstr "" -#: ../../library/configparser.rst:1283 +#: ../../library/configparser.rst:1285 msgid "Exception raised when a specified section is not found." msgstr "" -#: ../../library/configparser.rst:1288 +#: ../../library/configparser.rst:1290 msgid "" "Exception raised if :meth:`add_section` is called with the name of a section " "that is already present or in strict parsers when a section if found more " "than once in a single input file, string or dictionary." msgstr "" -#: ../../library/configparser.rst:1292 +#: ../../library/configparser.rst:1294 msgid "" "Optional ``source`` and ``lineno`` attributes and arguments to :meth:" "`__init__` were added." msgstr "" -#: ../../library/configparser.rst:1299 +#: ../../library/configparser.rst:1301 msgid "" "Exception raised by strict parsers if a single option appears twice during " "reading from a single file, string or dictionary. This catches misspellings " @@ -1113,58 +1115,58 @@ msgid "" "representing the same case-insensitive configuration key." msgstr "" -#: ../../library/configparser.rst:1307 +#: ../../library/configparser.rst:1309 msgid "" "Exception raised when a specified option is not found in the specified " "section." msgstr "" -#: ../../library/configparser.rst:1313 +#: ../../library/configparser.rst:1315 msgid "" "Base class for exceptions raised when problems occur performing string " "interpolation." msgstr "" -#: ../../library/configparser.rst:1319 +#: ../../library/configparser.rst:1321 msgid "" "Exception raised when string interpolation cannot be completed because the " "number of iterations exceeds :const:`MAX_INTERPOLATION_DEPTH`. Subclass of :" "exc:`InterpolationError`." msgstr "" -#: ../../library/configparser.rst:1326 +#: ../../library/configparser.rst:1328 msgid "" "Exception raised when an option referenced from a value does not exist. " "Subclass of :exc:`InterpolationError`." msgstr "" -#: ../../library/configparser.rst:1332 +#: ../../library/configparser.rst:1334 msgid "" "Exception raised when the source text into which substitutions are made does " "not conform to the required syntax. Subclass of :exc:`InterpolationError`." msgstr "" -#: ../../library/configparser.rst:1338 +#: ../../library/configparser.rst:1340 msgid "" "Exception raised when attempting to parse a file which has no section " "headers." msgstr "" -#: ../../library/configparser.rst:1344 +#: ../../library/configparser.rst:1346 msgid "Exception raised when errors occur attempting to parse a file." msgstr "" -#: ../../library/configparser.rst:1346 +#: ../../library/configparser.rst:1348 msgid "" "The ``filename`` attribute and :meth:`__init__` constructor argument were " "removed. They have been available using the name ``source`` since 3.2." msgstr "" -#: ../../library/configparser.rst:1351 +#: ../../library/configparser.rst:1353 msgid "Footnotes" msgstr "註解" -#: ../../library/configparser.rst:1352 +#: ../../library/configparser.rst:1354 msgid "" "Config parsers allow for heavy customization. If you are interested in " "changing the behaviour outlined by the footnote reference, consult the " diff --git a/library/datetime.po b/library/datetime.po index a61def35c8..d185585c26 100644 --- a/library/datetime.po +++ b/library/datetime.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-23 00:03+0000\n" +"POT-Creation-Date: 2023-09-03 00:03+0000\n" "PO-Revision-Date: 2023-08-07 10:20+0800\n" "Last-Translator: Griiid \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -66,7 +66,7 @@ msgstr ":mod:`zoneinfo` 模組" msgid "Concrete time zones representing the IANA time zone database." msgstr "" -#: ../../library/datetime.rst:37 +#: ../../library/datetime.rst:38 msgid "Package `dateutil `_" msgstr "" @@ -74,17 +74,27 @@ msgstr "" msgid "Third-party library with expanded time zone and parsing support." msgstr "" -#: ../../library/datetime.rst:43 +#: ../../library/datetime.rst:41 +msgid "Package `DateType `_" +msgstr "" + +#: ../../library/datetime.rst:41 +msgid "" +"Third-party library that introduces distinct static types to e.g. allow " +"static type checkers to differentiate between naive and aware datetimes." +msgstr "" + +#: ../../library/datetime.rst:47 msgid "Aware and Naive Objects" msgstr "" -#: ../../library/datetime.rst:45 +#: ../../library/datetime.rst:49 msgid "" "Date and time objects may be categorized as \"aware\" or \"naive\" depending " "on whether or not they include timezone information." msgstr "" -#: ../../library/datetime.rst:48 +#: ../../library/datetime.rst:52 msgid "" "With sufficient knowledge of applicable algorithmic and political time " "adjustments, such as time zone and daylight saving time information, an " @@ -93,7 +103,7 @@ msgid "" "interpretation. [#]_" msgstr "" -#: ../../library/datetime.rst:54 +#: ../../library/datetime.rst:58 msgid "" "A **naive** object does not contain enough information to unambiguously " "locate itself relative to other date/time objects. Whether a naive object " @@ -104,7 +114,7 @@ msgid "" "some aspects of reality." msgstr "" -#: ../../library/datetime.rst:61 +#: ../../library/datetime.rst:65 msgid "" "For applications requiring aware objects, :class:`.datetime` and :class:`." "time` objects have an optional time zone information attribute, :attr:`!" @@ -114,7 +124,7 @@ msgid "" "is in effect." msgstr "" -#: ../../library/datetime.rst:67 +#: ../../library/datetime.rst:71 msgid "" "Only one concrete :class:`tzinfo` class, the :class:`timezone` class, is " "supplied by the :mod:`datetime` module. The :class:`timezone` class can " @@ -125,42 +135,42 @@ msgid "" "there is no standard suitable for every application aside from UTC." msgstr "" -#: ../../library/datetime.rst:76 +#: ../../library/datetime.rst:80 msgid "Constants" msgstr "常數" -#: ../../library/datetime.rst:78 +#: ../../library/datetime.rst:82 msgid "The :mod:`datetime` module exports the following constants:" msgstr ":mod:`datetime` 模組匯出以下常數:" -#: ../../library/datetime.rst:82 +#: ../../library/datetime.rst:86 msgid "" "The smallest year number allowed in a :class:`date` or :class:`.datetime` " "object. :const:`MINYEAR` is ``1``." msgstr "" -#: ../../library/datetime.rst:88 +#: ../../library/datetime.rst:92 msgid "" "The largest year number allowed in a :class:`date` or :class:`.datetime` " "object. :const:`MAXYEAR` is ``9999``." msgstr "" -#: ../../library/datetime.rst:93 +#: ../../library/datetime.rst:97 msgid "Alias for the UTC timezone singleton :attr:`datetime.timezone.utc`." msgstr "" -#: ../../library/datetime.rst:98 +#: ../../library/datetime.rst:102 msgid "Available Types" msgstr "" -#: ../../library/datetime.rst:103 +#: ../../library/datetime.rst:107 msgid "" "An idealized naive date, assuming the current Gregorian calendar always was, " "and always will be, in effect. Attributes: :attr:`year`, :attr:`month`, and :" "attr:`day`." msgstr "" -#: ../../library/datetime.rst:111 +#: ../../library/datetime.rst:115 msgid "" "An idealized time, independent of any particular day, assuming that every " "day has exactly 24\\*60\\*60 seconds. (There is no notion of \"leap " @@ -168,14 +178,14 @@ msgid "" "attr:`microsecond`, and :attr:`.tzinfo`." msgstr "" -#: ../../library/datetime.rst:120 +#: ../../library/datetime.rst:124 msgid "" "A combination of a date and a time. Attributes: :attr:`year`, :attr:" "`month`, :attr:`day`, :attr:`hour`, :attr:`minute`, :attr:`second`, :attr:" "`microsecond`, and :attr:`.tzinfo`." msgstr "" -#: ../../library/datetime.rst:128 +#: ../../library/datetime.rst:132 msgid "" "A duration expressing the difference between two :class:`date`, :class:`." "time`, or :class:`.datetime` instances to microsecond resolution." @@ -183,7 +193,7 @@ msgstr "" "表示兩個 :class:`date`、:class:`.time` 或 :class:`.datetime` 實例之間時間的差" "異,以微秒為解析度。" -#: ../../library/datetime.rst:135 +#: ../../library/datetime.rst:139 msgid "" "An abstract base class for time zone information objects. These are used by " "the :class:`.datetime` and :class:`.time` classes to provide a customizable " @@ -191,158 +201,158 @@ msgid "" "daylight saving time)." msgstr "" -#: ../../library/datetime.rst:143 +#: ../../library/datetime.rst:147 msgid "" "A class that implements the :class:`tzinfo` abstract base class as a fixed " "offset from the UTC." msgstr "" -#: ../../library/datetime.rst:148 ../../library/datetime.rst:166 +#: ../../library/datetime.rst:152 ../../library/datetime.rst:170 msgid "Objects of these types are immutable." msgstr "" -#: ../../library/datetime.rst:150 +#: ../../library/datetime.rst:154 msgid "Subclass relationships::" msgstr "" -#: ../../library/datetime.rst:161 +#: ../../library/datetime.rst:165 msgid "Common Properties" msgstr "常見屬性" -#: ../../library/datetime.rst:163 +#: ../../library/datetime.rst:167 msgid "" "The :class:`date`, :class:`.datetime`, :class:`.time`, and :class:`timezone` " "types share these common features:" msgstr "" -#: ../../library/datetime.rst:167 +#: ../../library/datetime.rst:171 msgid "" "Objects of these types are :term:`hashable`, meaning that they can be used " "as dictionary keys." msgstr "" -#: ../../library/datetime.rst:169 +#: ../../library/datetime.rst:173 msgid "" "Objects of these types support efficient pickling via the :mod:`pickle` " "module." msgstr "" -#: ../../library/datetime.rst:172 +#: ../../library/datetime.rst:176 msgid "Determining if an Object is Aware or Naive" msgstr "" -#: ../../library/datetime.rst:174 +#: ../../library/datetime.rst:178 msgid "Objects of the :class:`date` type are always naive." msgstr "" -#: ../../library/datetime.rst:176 +#: ../../library/datetime.rst:180 msgid "" "An object of type :class:`.time` or :class:`.datetime` may be aware or naive." msgstr "" -#: ../../library/datetime.rst:178 +#: ../../library/datetime.rst:182 msgid "A :class:`.datetime` object *d* is aware if both of the following hold:" msgstr "" -#: ../../library/datetime.rst:180 +#: ../../library/datetime.rst:184 msgid "``d.tzinfo`` is not ``None``" msgstr "``d.tzinfo`` 不是 ``None``" -#: ../../library/datetime.rst:181 +#: ../../library/datetime.rst:185 msgid "``d.tzinfo.utcoffset(d)`` does not return ``None``" msgstr "``d.tzinfo.utcoffset(d)`` 不會回傳 ``None``" -#: ../../library/datetime.rst:183 +#: ../../library/datetime.rst:187 msgid "Otherwise, *d* is naive." msgstr "否則 *d* 會是 naive 的。" -#: ../../library/datetime.rst:185 +#: ../../library/datetime.rst:189 msgid "A :class:`.time` object *t* is aware if both of the following hold:" msgstr "" -#: ../../library/datetime.rst:187 +#: ../../library/datetime.rst:191 msgid "``t.tzinfo`` is not ``None``" msgstr "``t.tzinfo`` 不是 ``None``" -#: ../../library/datetime.rst:188 +#: ../../library/datetime.rst:192 msgid "``t.tzinfo.utcoffset(None)`` does not return ``None``." msgstr "``t.tzinfo.utcoffset(None)`` 沒有回傳 ``None``\\ 。" -#: ../../library/datetime.rst:190 +#: ../../library/datetime.rst:194 msgid "Otherwise, *t* is naive." msgstr "" -#: ../../library/datetime.rst:192 +#: ../../library/datetime.rst:196 msgid "" "The distinction between aware and naive doesn't apply to :class:`timedelta` " "objects." msgstr "" -#: ../../library/datetime.rst:198 +#: ../../library/datetime.rst:202 msgid ":class:`timedelta` Objects" msgstr ":class:`timedelta` 物件" -#: ../../library/datetime.rst:200 +#: ../../library/datetime.rst:204 msgid "" "A :class:`timedelta` object represents a duration, the difference between " "two dates or times." msgstr "" "一個 :class:`timedelta` 物件代表著一段持續時間,即兩個日期或時間之間的差異。" -#: ../../library/datetime.rst:205 +#: ../../library/datetime.rst:209 msgid "" "All arguments are optional and default to ``0``. Arguments may be integers " "or floats, and may be positive or negative." msgstr "" -#: ../../library/datetime.rst:208 +#: ../../library/datetime.rst:212 msgid "" "Only *days*, *seconds* and *microseconds* are stored internally. Arguments " "are converted to those units:" msgstr "" -#: ../../library/datetime.rst:211 +#: ../../library/datetime.rst:215 msgid "A millisecond is converted to 1000 microseconds." msgstr "一毫秒會被轉換為 1000 微秒。" -#: ../../library/datetime.rst:212 +#: ../../library/datetime.rst:216 msgid "A minute is converted to 60 seconds." msgstr "一分鐘會被轉換為 60 秒。" -#: ../../library/datetime.rst:213 +#: ../../library/datetime.rst:217 msgid "An hour is converted to 3600 seconds." msgstr "一小時會被轉換為 3600 秒。" -#: ../../library/datetime.rst:214 +#: ../../library/datetime.rst:218 msgid "A week is converted to 7 days." msgstr "一週會被轉換為 7 天。" -#: ../../library/datetime.rst:216 +#: ../../library/datetime.rst:220 msgid "" "and days, seconds and microseconds are then normalized so that the " "representation is unique, with" msgstr "" -#: ../../library/datetime.rst:219 +#: ../../library/datetime.rst:223 msgid "``0 <= microseconds < 1000000``" msgstr "``0 <= microseconds < 1000000``" -#: ../../library/datetime.rst:220 +#: ../../library/datetime.rst:224 msgid "``0 <= seconds < 3600*24`` (the number of seconds in one day)" msgstr "" -#: ../../library/datetime.rst:221 +#: ../../library/datetime.rst:225 msgid "``-999999999 <= days <= 999999999``" msgstr "``-999999999 <= days <= 999999999``" -#: ../../library/datetime.rst:223 +#: ../../library/datetime.rst:227 msgid "" "The following example illustrates how any arguments besides *days*, " "*seconds* and *microseconds* are \"merged\" and normalized into those three " "resulting attributes::" msgstr "" -#: ../../library/datetime.rst:241 +#: ../../library/datetime.rst:245 msgid "" "If any argument is a float and there are fractional microseconds, the " "fractional microseconds left over from all arguments are combined and their " @@ -351,281 +361,281 @@ msgid "" "processes are exact (no information is lost)." msgstr "" -#: ../../library/datetime.rst:248 +#: ../../library/datetime.rst:252 msgid "" "If the normalized value of days lies outside the indicated range, :exc:" "`OverflowError` is raised." msgstr "" -#: ../../library/datetime.rst:251 +#: ../../library/datetime.rst:255 msgid "" "Note that normalization of negative values may be surprising at first. For " "example::" msgstr "" -#: ../../library/datetime.rst:260 ../../library/datetime.rst:556 -#: ../../library/datetime.rst:1069 ../../library/datetime.rst:1688 -#: ../../library/datetime.rst:2290 +#: ../../library/datetime.rst:264 ../../library/datetime.rst:560 +#: ../../library/datetime.rst:1073 ../../library/datetime.rst:1692 +#: ../../library/datetime.rst:2294 msgid "Class attributes:" msgstr "類別屬性:" -#: ../../library/datetime.rst:264 +#: ../../library/datetime.rst:268 msgid "The most negative :class:`timedelta` object, ``timedelta(-999999999)``." msgstr "" -#: ../../library/datetime.rst:269 +#: ../../library/datetime.rst:273 msgid "" "The most positive :class:`timedelta` object, ``timedelta(days=999999999, " "hours=23, minutes=59, seconds=59, microseconds=999999)``." msgstr "" -#: ../../library/datetime.rst:275 +#: ../../library/datetime.rst:279 msgid "" "The smallest possible difference between non-equal :class:`timedelta` " "objects, ``timedelta(microseconds=1)``." msgstr "" -#: ../../library/datetime.rst:278 +#: ../../library/datetime.rst:282 msgid "" "Note that, because of normalization, ``timedelta.max`` > ``-timedelta.min``. " "``-timedelta.max`` is not representable as a :class:`timedelta` object." msgstr "" -#: ../../library/datetime.rst:281 ../../library/datetime.rst:574 -#: ../../library/datetime.rst:1089 ../../library/datetime.rst:1708 +#: ../../library/datetime.rst:285 ../../library/datetime.rst:578 +#: ../../library/datetime.rst:1093 ../../library/datetime.rst:1712 msgid "Instance attributes (read-only):" msgstr "" -#: ../../library/datetime.rst:284 +#: ../../library/datetime.rst:288 msgid "Attribute" msgstr "屬性" -#: ../../library/datetime.rst:284 +#: ../../library/datetime.rst:288 msgid "Value" msgstr "" -#: ../../library/datetime.rst:286 +#: ../../library/datetime.rst:290 msgid "``days``" msgstr "``days``" -#: ../../library/datetime.rst:286 +#: ../../library/datetime.rst:290 msgid "Between -999999999 and 999999999 inclusive" msgstr "" -#: ../../library/datetime.rst:288 +#: ../../library/datetime.rst:292 msgid "``seconds``" msgstr "``seconds``" -#: ../../library/datetime.rst:288 +#: ../../library/datetime.rst:292 msgid "Between 0 and 86399 inclusive" msgstr "在 0 到 86399 (含)之間" -#: ../../library/datetime.rst:290 +#: ../../library/datetime.rst:294 msgid "``microseconds``" msgstr "``microseconds``" -#: ../../library/datetime.rst:290 +#: ../../library/datetime.rst:294 msgid "Between 0 and 999999 inclusive" msgstr "在 0 到 999999 (含)之間" -#: ../../library/datetime.rst:293 ../../library/datetime.rst:591 -#: ../../library/datetime.rst:1142 +#: ../../library/datetime.rst:297 ../../library/datetime.rst:595 +#: ../../library/datetime.rst:1146 msgid "Supported operations:" msgstr "" -#: ../../library/datetime.rst:298 ../../library/datetime.rst:594 -#: ../../library/datetime.rst:1145 +#: ../../library/datetime.rst:302 ../../library/datetime.rst:598 +#: ../../library/datetime.rst:1149 msgid "Operation" msgstr "" -#: ../../library/datetime.rst:298 ../../library/datetime.rst:594 -#: ../../library/datetime.rst:1145 +#: ../../library/datetime.rst:302 ../../library/datetime.rst:598 +#: ../../library/datetime.rst:1149 msgid "Result" msgstr "" -#: ../../library/datetime.rst:300 +#: ../../library/datetime.rst:304 msgid "``t1 = t2 + t3``" msgstr "``t1 = t2 + t3``" -#: ../../library/datetime.rst:300 +#: ../../library/datetime.rst:304 msgid "" "Sum of *t2* and *t3*. Afterwards *t1*-*t2* == *t3* and *t1*-*t3* == *t2* are " "true. (1)" msgstr "" -#: ../../library/datetime.rst:303 +#: ../../library/datetime.rst:307 msgid "``t1 = t2 - t3``" msgstr "``t1 = t2 - t3``" -#: ../../library/datetime.rst:303 +#: ../../library/datetime.rst:307 msgid "" "Difference of *t2* and *t3*. Afterwards *t1* == *t2* - *t3* and *t2* == *t1* " "+ *t3* are true. (1)(6)" msgstr "" -#: ../../library/datetime.rst:307 +#: ../../library/datetime.rst:311 msgid "``t1 = t2 * i or t1 = i * t2``" msgstr "``t1 = t2 * i or t1 = i * t2``" -#: ../../library/datetime.rst:307 +#: ../../library/datetime.rst:311 msgid "" "Delta multiplied by an integer. Afterwards *t1* // i == *t2* is true, " "provided ``i != 0``." msgstr "" -#: ../../library/datetime.rst:311 +#: ../../library/datetime.rst:315 msgid "In general, *t1* \\* i == *t1* \\* (i-1) + *t1* is true. (1)" msgstr "" -#: ../../library/datetime.rst:314 +#: ../../library/datetime.rst:318 msgid "``t1 = t2 * f or t1 = f * t2``" msgstr "``t1 = t2 * f or t1 = f * t2``" -#: ../../library/datetime.rst:314 +#: ../../library/datetime.rst:318 msgid "" "Delta multiplied by a float. The result is rounded to the nearest multiple " "of timedelta.resolution using round-half-to-even." msgstr "" -#: ../../library/datetime.rst:318 +#: ../../library/datetime.rst:322 msgid "``f = t2 / t3``" msgstr "``f = t2 / t3``" -#: ../../library/datetime.rst:318 +#: ../../library/datetime.rst:322 msgid "" "Division (3) of overall duration *t2* by interval unit *t3*. Returns a :" "class:`float` object." msgstr "" -#: ../../library/datetime.rst:322 +#: ../../library/datetime.rst:326 msgid "``t1 = t2 / f or t1 = t2 / i``" msgstr "``t1 = t2 / f or t1 = t2 / i``" -#: ../../library/datetime.rst:322 +#: ../../library/datetime.rst:326 msgid "" "Delta divided by a float or an int. The result is rounded to the nearest " "multiple of timedelta.resolution using round-half-to-even." msgstr "" -#: ../../library/datetime.rst:326 +#: ../../library/datetime.rst:330 msgid "``t1 = t2 // i`` or ``t1 = t2 // t3``" msgstr "``t1 = t2 // i`` or ``t1 = t2 // t3``" -#: ../../library/datetime.rst:326 +#: ../../library/datetime.rst:330 msgid "" "The floor is computed and the remainder (if any) is thrown away. In the " "second case, an integer is returned. (3)" msgstr "" -#: ../../library/datetime.rst:330 +#: ../../library/datetime.rst:334 msgid "``t1 = t2 % t3``" msgstr "``t1 = t2 % t3``" -#: ../../library/datetime.rst:330 +#: ../../library/datetime.rst:334 msgid "The remainder is computed as a :class:`timedelta` object. (3)" msgstr "" -#: ../../library/datetime.rst:333 +#: ../../library/datetime.rst:337 msgid "``q, r = divmod(t1, t2)``" msgstr "``q, r = divmod(t1, t2)``" -#: ../../library/datetime.rst:333 +#: ../../library/datetime.rst:337 msgid "" "Computes the quotient and the remainder: ``q = t1 // t2`` (3) and ``r = t1 % " "t2``. q is an integer and r is a :class:`timedelta` object." msgstr "" -#: ../../library/datetime.rst:338 +#: ../../library/datetime.rst:342 msgid "``+t1``" msgstr "``+t1``" -#: ../../library/datetime.rst:338 +#: ../../library/datetime.rst:342 msgid "Returns a :class:`timedelta` object with the same value. (2)" msgstr "" -#: ../../library/datetime.rst:341 +#: ../../library/datetime.rst:345 msgid "``-t1``" msgstr "``-t1``" -#: ../../library/datetime.rst:341 +#: ../../library/datetime.rst:345 msgid "" "equivalent to :class:`timedelta`\\ (-*t1.days*, -*t1.seconds*, -*t1." "microseconds*), and to *t1*\\* -1. (1)(4)" msgstr "" -#: ../../library/datetime.rst:346 +#: ../../library/datetime.rst:350 msgid "``abs(t)``" msgstr "``abs(t)``" -#: ../../library/datetime.rst:346 +#: ../../library/datetime.rst:350 msgid "" "equivalent to +\\ *t* when ``t.days >= 0``, and to -*t* when ``t.days < 0``. " "(2)" msgstr "" -#: ../../library/datetime.rst:349 +#: ../../library/datetime.rst:353 msgid "``str(t)``" msgstr "``str(t)``" -#: ../../library/datetime.rst:349 +#: ../../library/datetime.rst:353 msgid "" "Returns a string in the form ``[D day[s], ][H]H:MM:SS[.UUUUUU]``, where D is " "negative for negative ``t``. (5)" msgstr "" -#: ../../library/datetime.rst:353 +#: ../../library/datetime.rst:357 msgid "``repr(t)``" msgstr "``repr(t)``" -#: ../../library/datetime.rst:353 +#: ../../library/datetime.rst:357 msgid "" "Returns a string representation of the :class:`timedelta` object as a " "constructor call with canonical attribute values." msgstr "" -#: ../../library/datetime.rst:359 ../../library/datetime.rst:608 -#: ../../library/datetime.rst:2521 +#: ../../library/datetime.rst:363 ../../library/datetime.rst:612 +#: ../../library/datetime.rst:2525 msgid "Notes:" msgstr "註解:" -#: ../../library/datetime.rst:362 +#: ../../library/datetime.rst:366 msgid "This is exact but may overflow." msgstr "這是精確的,但可能會溢位。" -#: ../../library/datetime.rst:365 +#: ../../library/datetime.rst:369 msgid "This is exact and cannot overflow." msgstr "這是精確的,且不會溢位。" -#: ../../library/datetime.rst:368 +#: ../../library/datetime.rst:372 msgid "Division by 0 raises :exc:`ZeroDivisionError`." msgstr "" -#: ../../library/datetime.rst:371 +#: ../../library/datetime.rst:375 msgid "-*timedelta.max* is not representable as a :class:`timedelta` object." msgstr "" -#: ../../library/datetime.rst:374 +#: ../../library/datetime.rst:378 msgid "" "String representations of :class:`timedelta` objects are normalized " "similarly to their internal representation. This leads to somewhat unusual " "results for negative timedeltas. For example::" msgstr "" -#: ../../library/datetime.rst:384 +#: ../../library/datetime.rst:388 msgid "" "The expression ``t2 - t3`` will always be equal to the expression ``t2 + (-" "t3)`` except when t3 is equal to ``timedelta.max``; in that case the former " "will produce a result while the latter will overflow." msgstr "" -#: ../../library/datetime.rst:388 +#: ../../library/datetime.rst:392 msgid "" "In addition to the operations listed above, :class:`timedelta` objects " "support certain additions and subtractions with :class:`date` and :class:`." "datetime` objects (see below)." msgstr "" -#: ../../library/datetime.rst:392 +#: ../../library/datetime.rst:396 msgid "" "Floor division and true division of a :class:`timedelta` object by another :" "class:`timedelta` object are now supported, as are remainder operations and " @@ -633,119 +643,119 @@ msgid "" "`timedelta` object by a :class:`float` object are now supported." msgstr "" -#: ../../library/datetime.rst:399 +#: ../../library/datetime.rst:403 msgid "" "Comparisons of :class:`timedelta` objects are supported, with some caveats." msgstr "" -#: ../../library/datetime.rst:401 +#: ../../library/datetime.rst:405 msgid "" "The comparisons ``==`` or ``!=`` *always* return a :class:`bool`, no matter " "the type of the compared object::" msgstr "" -#: ../../library/datetime.rst:412 +#: ../../library/datetime.rst:416 msgid "" "For all other comparisons (such as ``<`` and ``>``), when a :class:" "`timedelta` object is compared to an object of a different type, :exc:" "`TypeError` is raised::" msgstr "" -#: ../../library/datetime.rst:423 +#: ../../library/datetime.rst:427 msgid "" "In Boolean contexts, a :class:`timedelta` object is considered to be true if " "and only if it isn't equal to ``timedelta(0)``." msgstr "" -#: ../../library/datetime.rst:426 ../../library/datetime.rst:637 -#: ../../library/datetime.rst:1216 ../../library/datetime.rst:1816 +#: ../../library/datetime.rst:430 ../../library/datetime.rst:641 +#: ../../library/datetime.rst:1220 ../../library/datetime.rst:1820 msgid "Instance methods:" msgstr "實例方法:" -#: ../../library/datetime.rst:430 +#: ../../library/datetime.rst:434 msgid "" "Return the total number of seconds contained in the duration. Equivalent to " "``td / timedelta(seconds=1)``. For interval units other than seconds, use " "the division form directly (e.g. ``td / timedelta(microseconds=1)``)." msgstr "" -#: ../../library/datetime.rst:434 +#: ../../library/datetime.rst:438 msgid "" "Note that for very large time intervals (greater than 270 years on most " "platforms) this method will lose microsecond accuracy." msgstr "" -#: ../../library/datetime.rst:440 +#: ../../library/datetime.rst:444 msgid "Examples of usage: :class:`timedelta`" msgstr "用法範例:\\ :class:`timedelta`" -#: ../../library/datetime.rst:442 +#: ../../library/datetime.rst:446 msgid "An additional example of normalization::" msgstr "" -#: ../../library/datetime.rst:454 +#: ../../library/datetime.rst:458 msgid "Examples of :class:`timedelta` arithmetic::" msgstr "" -#: ../../library/datetime.rst:473 +#: ../../library/datetime.rst:477 msgid ":class:`date` Objects" msgstr ":class:`date` 物件" -#: ../../library/datetime.rst:475 +#: ../../library/datetime.rst:479 msgid "" "A :class:`date` object represents a date (year, month and day) in an " "idealized calendar, the current Gregorian calendar indefinitely extended in " "both directions." msgstr "" -#: ../../library/datetime.rst:479 +#: ../../library/datetime.rst:483 msgid "" "January 1 of year 1 is called day number 1, January 2 of year 1 is called " "day number 2, and so on. [#]_" msgstr "" -#: ../../library/datetime.rst:484 +#: ../../library/datetime.rst:488 msgid "" "All arguments are required. Arguments must be integers, in the following " "ranges:" msgstr "" -#: ../../library/datetime.rst:487 +#: ../../library/datetime.rst:491 msgid "``MINYEAR <= year <= MAXYEAR``" msgstr "``MINYEAR <= year <= MAXYEAR``" -#: ../../library/datetime.rst:488 +#: ../../library/datetime.rst:492 msgid "``1 <= month <= 12``" msgstr "``1 <= month <= 12``" -#: ../../library/datetime.rst:489 +#: ../../library/datetime.rst:493 msgid "``1 <= day <= number of days in the given month and year``" msgstr "" -#: ../../library/datetime.rst:491 ../../library/datetime.rst:852 +#: ../../library/datetime.rst:495 ../../library/datetime.rst:856 msgid "" "If an argument outside those ranges is given, :exc:`ValueError` is raised." msgstr "" -#: ../../library/datetime.rst:494 ../../library/datetime.rst:857 +#: ../../library/datetime.rst:498 ../../library/datetime.rst:861 msgid "Other constructors, all class methods:" msgstr "" -#: ../../library/datetime.rst:498 +#: ../../library/datetime.rst:502 msgid "Return the current local date." msgstr "回傳目前的本地日期。" -#: ../../library/datetime.rst:500 +#: ../../library/datetime.rst:504 msgid "This is equivalent to ``date.fromtimestamp(time.time())``." msgstr "這等同於 ``date.fromtimestamp(time.time())``。" -#: ../../library/datetime.rst:504 +#: ../../library/datetime.rst:508 msgid "" "Return the local date corresponding to the POSIX timestamp, such as is " "returned by :func:`time.time`." msgstr "" -#: ../../library/datetime.rst:507 +#: ../../library/datetime.rst:511 msgid "" "This may raise :exc:`OverflowError`, if the timestamp is out of the range of " "values supported by the platform C :c:func:`localtime` function, and :exc:" @@ -755,7 +765,7 @@ msgid "" "ignored by :meth:`fromtimestamp`." msgstr "" -#: ../../library/datetime.rst:514 +#: ../../library/datetime.rst:518 msgid "" "Raise :exc:`OverflowError` instead of :exc:`ValueError` if the timestamp is " "out of the range of values supported by the platform C :c:func:`localtime` " @@ -763,96 +773,96 @@ msgid "" "`localtime` failure." msgstr "" -#: ../../library/datetime.rst:523 +#: ../../library/datetime.rst:527 msgid "" "Return the date corresponding to the proleptic Gregorian ordinal, where " "January 1 of year 1 has ordinal 1." msgstr "" -#: ../../library/datetime.rst:526 +#: ../../library/datetime.rst:530 msgid "" ":exc:`ValueError` is raised unless ``1 <= ordinal <= date.max.toordinal()``. " "For any date *d*, ``date.fromordinal(d.toordinal()) == d``." msgstr "" -#: ../../library/datetime.rst:533 +#: ../../library/datetime.rst:537 msgid "" "Return a :class:`date` corresponding to a *date_string* given in any valid " "ISO 8601 format, except ordinal dates (e.g. ``YYYY-DDD``)::" msgstr "" -#: ../../library/datetime.rst:545 +#: ../../library/datetime.rst:549 msgid "Previously, this method only supported the format ``YYYY-MM-DD``." msgstr "" -#: ../../library/datetime.rst:550 +#: ../../library/datetime.rst:554 msgid "" "Return a :class:`date` corresponding to the ISO calendar date specified by " "year, week and day. This is the inverse of the function :meth:`date." "isocalendar`." msgstr "" -#: ../../library/datetime.rst:560 +#: ../../library/datetime.rst:564 msgid "The earliest representable date, ``date(MINYEAR, 1, 1)``." msgstr "" -#: ../../library/datetime.rst:565 +#: ../../library/datetime.rst:569 msgid "The latest representable date, ``date(MAXYEAR, 12, 31)``." msgstr "" -#: ../../library/datetime.rst:570 +#: ../../library/datetime.rst:574 msgid "" "The smallest possible difference between non-equal date objects, " "``timedelta(days=1)``." msgstr "" -#: ../../library/datetime.rst:578 ../../library/datetime.rst:1093 +#: ../../library/datetime.rst:582 ../../library/datetime.rst:1097 msgid "Between :const:`MINYEAR` and :const:`MAXYEAR` inclusive." msgstr "" -#: ../../library/datetime.rst:583 ../../library/datetime.rst:1098 +#: ../../library/datetime.rst:587 ../../library/datetime.rst:1102 msgid "Between 1 and 12 inclusive." msgstr "在 1 到 12 (含)之間。" -#: ../../library/datetime.rst:588 ../../library/datetime.rst:1103 +#: ../../library/datetime.rst:592 ../../library/datetime.rst:1107 msgid "Between 1 and the number of days in the given month of the given year." msgstr "" -#: ../../library/datetime.rst:596 +#: ../../library/datetime.rst:600 msgid "``date2 = date1 + timedelta``" msgstr "``date2 = date1 + timedelta``" -#: ../../library/datetime.rst:596 +#: ../../library/datetime.rst:600 msgid "*date2* will be ``timedelta.days`` days after *date1*. (1)" msgstr "" -#: ../../library/datetime.rst:599 +#: ../../library/datetime.rst:603 msgid "``date2 = date1 - timedelta``" msgstr "``date2 = date1 - timedelta``" -#: ../../library/datetime.rst:599 +#: ../../library/datetime.rst:603 msgid "Computes *date2* such that ``date2 + timedelta == date1``. (2)" msgstr "" -#: ../../library/datetime.rst:602 +#: ../../library/datetime.rst:606 msgid "``timedelta = date1 - date2``" msgstr "``timedelta = date1 - date2``" -#: ../../library/datetime.rst:602 ../../library/datetime.rst:1151 +#: ../../library/datetime.rst:606 ../../library/datetime.rst:1155 msgid "\\(3)" msgstr "\\(3)" -#: ../../library/datetime.rst:604 +#: ../../library/datetime.rst:608 msgid "``date1 < date2``" msgstr "``date1 < date2``" -#: ../../library/datetime.rst:604 +#: ../../library/datetime.rst:608 msgid "" "*date1* is considered less than *date2* when *date1* precedes *date2* in " "time. (4)" msgstr "" -#: ../../library/datetime.rst:611 +#: ../../library/datetime.rst:615 msgid "" "*date2* is moved forward in time if ``timedelta.days > 0``, or backward if " "``timedelta.days < 0``. Afterward ``date2 - date1 == timedelta.days``. " @@ -861,17 +871,17 @@ msgid "" "`MINYEAR` or larger than :const:`MAXYEAR`." msgstr "" -#: ../../library/datetime.rst:618 +#: ../../library/datetime.rst:622 msgid "``timedelta.seconds`` and ``timedelta.microseconds`` are ignored." msgstr "``timedelta.seconds`` 和 ``timedelta.microseconds`` 被忽略。" -#: ../../library/datetime.rst:621 +#: ../../library/datetime.rst:625 msgid "" "This is exact, and cannot overflow. timedelta.seconds and timedelta." "microseconds are 0, and date2 + timedelta == date1 after." msgstr "" -#: ../../library/datetime.rst:625 +#: ../../library/datetime.rst:629 msgid "" "In other words, ``date1 < date2`` if and only if ``date1.toordinal() < date2." "toordinal()``. Date comparison raises :exc:`TypeError` if the other " @@ -884,56 +894,56 @@ msgid "" "`True`, respectively." msgstr "" -#: ../../library/datetime.rst:635 +#: ../../library/datetime.rst:639 msgid "" "In Boolean contexts, all :class:`date` objects are considered to be true." msgstr "" -#: ../../library/datetime.rst:641 +#: ../../library/datetime.rst:645 msgid "" "Return a date with the same value, except for those parameters given new " "values by whichever keyword arguments are specified." msgstr "" -#: ../../library/datetime.rst:644 ../../library/datetime.rst:1859 +#: ../../library/datetime.rst:648 ../../library/datetime.rst:1863 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/datetime.rst:654 ../../library/datetime.rst:1329 +#: ../../library/datetime.rst:658 ../../library/datetime.rst:1333 msgid "" "Return a :class:`time.struct_time` such as returned by :func:`time." "localtime`." msgstr "" "回傳一個 :class:`time.struct_time`,如同 :func:`time.localtime` 所回傳。" -#: ../../library/datetime.rst:656 +#: ../../library/datetime.rst:660 msgid "The hours, minutes and seconds are 0, and the DST flag is -1." msgstr "" -#: ../../library/datetime.rst:658 ../../library/datetime.rst:1331 +#: ../../library/datetime.rst:662 ../../library/datetime.rst:1335 msgid "``d.timetuple()`` is equivalent to::" msgstr "" "``d.timetuple()`` 等價於:\n" "\n" "::" -#: ../../library/datetime.rst:662 +#: ../../library/datetime.rst:666 msgid "" "where ``yday = d.toordinal() - date(d.year, 1, 1).toordinal() + 1`` is the " "day number within the current year starting with ``1`` for January 1st." msgstr "" -#: ../../library/datetime.rst:668 +#: ../../library/datetime.rst:672 msgid "" "Return the proleptic Gregorian ordinal of the date, where January 1 of year " "1 has ordinal 1. For any :class:`date` object *d*, ``date.fromordinal(d." "toordinal()) == d``." msgstr "" -#: ../../library/datetime.rst:675 +#: ../../library/datetime.rst:679 msgid "" "Return the day of the week as an integer, where Monday is 0 and Sunday is 6. " "For example, ``date(2002, 12, 4).weekday() == 2``, a Wednesday. See also :" @@ -942,25 +952,25 @@ msgstr "" "回傳一個代表星期幾的整數,星期一為 0、星期日為 6。例如 ``date(2002, 12, 4)." "weekday() == 2`` 為星期三。也請參考 :meth:`isoweekday`。" -#: ../../library/datetime.rst:682 +#: ../../library/datetime.rst:686 msgid "" "Return the day of the week as an integer, where Monday is 1 and Sunday is 7. " "For example, ``date(2002, 12, 4).isoweekday() == 3``, a Wednesday. See also :" "meth:`weekday`, :meth:`isocalendar`." msgstr "" -#: ../../library/datetime.rst:689 +#: ../../library/datetime.rst:693 msgid "" "Return a :term:`named tuple` object with three components: ``year``, " "``week`` and ``weekday``." msgstr "" -#: ../../library/datetime.rst:692 +#: ../../library/datetime.rst:696 msgid "" "The ISO calendar is a widely used variant of the Gregorian calendar. [#]_" msgstr "" -#: ../../library/datetime.rst:694 +#: ../../library/datetime.rst:698 msgid "" "The ISO year consists of 52 or 53 full weeks, and where a week starts on a " "Monday and ends on a Sunday. The first week of an ISO year is the first " @@ -969,17 +979,17 @@ msgid "" "Gregorian year." msgstr "" -#: ../../library/datetime.rst:699 +#: ../../library/datetime.rst:703 msgid "" "For example, 2004 begins on a Thursday, so the first week of ISO year 2004 " "begins on Monday, 29 Dec 2003 and ends on Sunday, 4 Jan 2004::" msgstr "" -#: ../../library/datetime.rst:708 +#: ../../library/datetime.rst:712 msgid "Result changed from a tuple to a :term:`named tuple`." msgstr "" -#: ../../library/datetime.rst:713 +#: ../../library/datetime.rst:717 msgid "" "Return a string representing the date in ISO 8601 format, ``YYYY-MM-DD``::" msgstr "" @@ -987,29 +997,29 @@ msgstr "" "\n" "::" -#: ../../library/datetime.rst:721 +#: ../../library/datetime.rst:725 msgid "For a date *d*, ``str(d)`` is equivalent to ``d.isoformat()``." msgstr "" -#: ../../library/datetime.rst:726 +#: ../../library/datetime.rst:730 msgid "Return a string representing the date::" msgstr "" -#: ../../library/datetime.rst:732 ../../library/datetime.rst:1515 +#: ../../library/datetime.rst:736 ../../library/datetime.rst:1519 msgid "``d.ctime()`` is equivalent to::" msgstr "" "``d.ctime()`` 等價於:\n" "\n" "::" -#: ../../library/datetime.rst:736 +#: ../../library/datetime.rst:740 msgid "" "on platforms where the native C :c:func:`ctime` function (which :func:`time." "ctime` invokes, but which :meth:`date.ctime` does not invoke) conforms to " "the C standard." msgstr "" -#: ../../library/datetime.rst:743 +#: ../../library/datetime.rst:747 msgid "" "Return a string representing the date, controlled by an explicit format " "string. Format codes referring to hours, minutes or seconds will see 0 " @@ -1017,7 +1027,7 @@ msgid "" "isoformat`." msgstr "" -#: ../../library/datetime.rst:750 +#: ../../library/datetime.rst:754 msgid "" "Same as :meth:`.date.strftime`. This makes it possible to specify a format " "string for a :class:`.date` object in :ref:`formatted string literals 0, or backward if ``timedelta.days`` < 0. " @@ -1447,7 +1457,7 @@ msgid "" "the input is an aware object." msgstr "" -#: ../../library/datetime.rst:1167 +#: ../../library/datetime.rst:1171 msgid "" "Computes the datetime2 such that datetime2 + timedelta == datetime1. As for " "addition, the result has the same :attr:`~.datetime.tzinfo` attribute as the " @@ -1455,14 +1465,14 @@ msgid "" "aware." msgstr "" -#: ../../library/datetime.rst:1172 +#: ../../library/datetime.rst:1176 msgid "" "Subtraction of a :class:`.datetime` from a :class:`.datetime` is defined " "only if both operands are naive, or if both are aware. If one is aware and " "the other is naive, :exc:`TypeError` is raised." msgstr "" -#: ../../library/datetime.rst:1176 +#: ../../library/datetime.rst:1180 msgid "" "If both are naive, or both are aware and have the same :attr:`~.datetime." "tzinfo` attribute, the :attr:`~.datetime.tzinfo` attributes are ignored, and " @@ -1470,7 +1480,7 @@ msgid "" "datetime1``. No time zone adjustments are done in this case." msgstr "" -#: ../../library/datetime.rst:1181 +#: ../../library/datetime.rst:1185 msgid "" "If both are aware and have different :attr:`~.datetime.tzinfo` attributes, " "``a-b`` acts as if *a* and *b* were first converted to naive UTC datetimes " @@ -1479,20 +1489,20 @@ msgid "" "overflows." msgstr "" -#: ../../library/datetime.rst:1187 +#: ../../library/datetime.rst:1191 msgid "" "*datetime1* is considered less than *datetime2* when *datetime1* precedes " "*datetime2* in time." msgstr "" -#: ../../library/datetime.rst:1190 +#: ../../library/datetime.rst:1194 msgid "" "If one comparand is naive and the other is aware, :exc:`TypeError` is raised " "if an order comparison is attempted. For equality comparisons, naive " "instances are never equal to aware instances." msgstr "" -#: ../../library/datetime.rst:1194 +#: ../../library/datetime.rst:1198 msgid "" "If both comparands are aware, and have the same :attr:`~.datetime.tzinfo` " "attribute, the common :attr:`~.datetime.tzinfo` attribute is ignored and the " @@ -1502,13 +1512,13 @@ msgid "" "utcoffset()``)." msgstr "" -#: ../../library/datetime.rst:1200 +#: ../../library/datetime.rst:1204 msgid "" "Equality comparisons between aware and naive :class:`.datetime` instances " "don't raise :exc:`TypeError`." msgstr "" -#: ../../library/datetime.rst:1206 +#: ../../library/datetime.rst:1210 msgid "" "In order to stop comparison from falling back to the default scheme of " "comparing object addresses, datetime comparison normally raises :exc:" @@ -1521,27 +1531,27 @@ msgid "" "cases return :const:`False` or :const:`True`, respectively." msgstr "" -#: ../../library/datetime.rst:1220 +#: ../../library/datetime.rst:1224 msgid "Return :class:`date` object with same year, month and day." msgstr "" -#: ../../library/datetime.rst:1225 +#: ../../library/datetime.rst:1229 msgid "" "Return :class:`.time` object with same hour, minute, second, microsecond and " "fold. :attr:`.tzinfo` is ``None``. See also method :meth:`timetz`." msgstr "" -#: ../../library/datetime.rst:1228 ../../library/datetime.rst:1237 +#: ../../library/datetime.rst:1232 ../../library/datetime.rst:1241 msgid "The fold value is copied to the returned :class:`.time` object." msgstr "" -#: ../../library/datetime.rst:1234 +#: ../../library/datetime.rst:1238 msgid "" "Return :class:`.time` object with same hour, minute, second, microsecond, " "fold, and tzinfo attributes. See also method :meth:`time`." msgstr "" -#: ../../library/datetime.rst:1245 +#: ../../library/datetime.rst:1249 msgid "" "Return a datetime with the same attributes, except for those attributes " "given new values by whichever keyword arguments are specified. Note that " @@ -1549,21 +1559,21 @@ msgid "" "datetime with no conversion of date and time data." msgstr "" -#: ../../library/datetime.rst:1256 +#: ../../library/datetime.rst:1260 msgid "" "Return a :class:`.datetime` object with new :attr:`.tzinfo` attribute *tz*, " "adjusting the date and time data so the result is the same UTC time as " "*self*, but in *tz*'s local time." msgstr "" -#: ../../library/datetime.rst:1260 +#: ../../library/datetime.rst:1264 msgid "" "If provided, *tz* must be an instance of a :class:`tzinfo` subclass, and " "its :meth:`utcoffset` and :meth:`dst` methods must not return ``None``. If " "*self* is naive, it is presumed to represent time in the system timezone." msgstr "" -#: ../../library/datetime.rst:1264 +#: ../../library/datetime.rst:1268 msgid "" "If called without arguments (or with ``tz=None``) the system local timezone " "is assumed for the target timezone. The ``.tzinfo`` attribute of the " @@ -1571,7 +1581,7 @@ msgid "" "with the zone name and offset obtained from the OS." msgstr "" -#: ../../library/datetime.rst:1269 +#: ../../library/datetime.rst:1273 msgid "" "If ``self.tzinfo`` is *tz*, ``self.astimezone(tz)`` is equal to *self*: no " "adjustment of date or time data is performed. Else the result is local time " @@ -1580,7 +1590,7 @@ msgid "" "date and time data as ``dt - dt.utcoffset()``." msgstr "" -#: ../../library/datetime.rst:1275 +#: ../../library/datetime.rst:1279 msgid "" "If you merely want to attach a time zone object *tz* to a datetime *dt* " "without adjustment of date and time data, use ``dt.replace(tzinfo=tz)``. If " @@ -1588,56 +1598,56 @@ msgid "" "without conversion of date and time data, use ``dt.replace(tzinfo=None)``." msgstr "" -#: ../../library/datetime.rst:1280 +#: ../../library/datetime.rst:1284 msgid "" "Note that the default :meth:`tzinfo.fromutc` method can be overridden in a :" "class:`tzinfo` subclass to affect the result returned by :meth:`astimezone`. " "Ignoring error cases, :meth:`astimezone` acts like::" msgstr "" -#: ../../library/datetime.rst:1292 +#: ../../library/datetime.rst:1296 msgid "*tz* now can be omitted." msgstr "" -#: ../../library/datetime.rst:1295 +#: ../../library/datetime.rst:1299 msgid "" "The :meth:`astimezone` method can now be called on naive instances that are " "presumed to represent system local time." msgstr "" -#: ../../library/datetime.rst:1302 +#: ../../library/datetime.rst:1306 msgid "" "If :attr:`.tzinfo` is ``None``, returns ``None``, else returns ``self.tzinfo." "utcoffset(self)``, and raises an exception if the latter doesn't return " "``None`` or a :class:`timedelta` object with magnitude less than one day." msgstr "" -#: ../../library/datetime.rst:1306 ../../library/datetime.rst:1899 -#: ../../library/datetime.rst:2005 ../../library/datetime.rst:2250 -#: ../../library/datetime.rst:2262 ../../library/datetime.rst:2574 +#: ../../library/datetime.rst:1310 ../../library/datetime.rst:1903 +#: ../../library/datetime.rst:2009 ../../library/datetime.rst:2254 +#: ../../library/datetime.rst:2266 ../../library/datetime.rst:2578 msgid "The UTC offset is not restricted to a whole number of minutes." msgstr "" -#: ../../library/datetime.rst:1312 +#: ../../library/datetime.rst:1316 msgid "" "If :attr:`.tzinfo` is ``None``, returns ``None``, else returns ``self.tzinfo." "dst(self)``, and raises an exception if the latter doesn't return ``None`` " "or a :class:`timedelta` object with magnitude less than one day." msgstr "" -#: ../../library/datetime.rst:1316 ../../library/datetime.rst:1909 -#: ../../library/datetime.rst:2059 +#: ../../library/datetime.rst:1320 ../../library/datetime.rst:1913 +#: ../../library/datetime.rst:2063 msgid "The DST offset is not restricted to a whole number of minutes." msgstr "" -#: ../../library/datetime.rst:1322 +#: ../../library/datetime.rst:1326 msgid "" "If :attr:`.tzinfo` is ``None``, returns ``None``, else returns ``self.tzinfo." "tzname(self)``, raises an exception if the latter doesn't return ``None`` or " "a string object," msgstr "" -#: ../../library/datetime.rst:1337 +#: ../../library/datetime.rst:1341 msgid "" "where ``yday = d.toordinal() - date(d.year, 1, 1).toordinal() + 1`` is the " "day number within the current year starting with ``1`` for January 1st. The :" @@ -1647,14 +1657,14 @@ msgid "" "attr:`tm_isdst` is set to ``1``; else :attr:`tm_isdst` is set to ``0``." msgstr "" -#: ../../library/datetime.rst:1348 +#: ../../library/datetime.rst:1352 msgid "" "If :class:`.datetime` instance *d* is naive, this is the same as ``d." "timetuple()`` except that :attr:`tm_isdst` is forced to 0 regardless of what " "``d.dst()`` returns. DST is never in effect for a UTC time." msgstr "" -#: ../../library/datetime.rst:1352 +#: ../../library/datetime.rst:1356 msgid "" "If *d* is aware, *d* is normalized to UTC time, by subtracting ``d." "utcoffset()``, and a :class:`time.struct_time` for the normalized time is " @@ -1663,7 +1673,7 @@ msgid "" "spills over a year boundary." msgstr "" -#: ../../library/datetime.rst:1361 +#: ../../library/datetime.rst:1365 msgid "" "Because naive ``datetime`` objects are treated by many ``datetime`` methods " "as local times, it is preferred to use aware datetimes to represent times in " @@ -1673,20 +1683,20 @@ msgid "" "meth:`.datetime.timetuple`." msgstr "" -#: ../../library/datetime.rst:1370 +#: ../../library/datetime.rst:1374 msgid "" "Return the proleptic Gregorian ordinal of the date. The same as ``self." "date().toordinal()``." msgstr "" -#: ../../library/datetime.rst:1375 +#: ../../library/datetime.rst:1379 msgid "" "Return POSIX timestamp corresponding to the :class:`.datetime` instance. The " "return value is a :class:`float` similar to that returned by :func:`time." "time`." msgstr "" -#: ../../library/datetime.rst:1379 +#: ../../library/datetime.rst:1383 msgid "" "Naive :class:`.datetime` instances are assumed to represent local time and " "this method relies on the platform C :c:func:`mktime` function to perform " @@ -1696,18 +1706,18 @@ msgid "" "future." msgstr "" -#: ../../library/datetime.rst:1386 +#: ../../library/datetime.rst:1390 msgid "" "For aware :class:`.datetime` instances, the return value is computed as::" msgstr "" -#: ../../library/datetime.rst:1393 +#: ../../library/datetime.rst:1397 msgid "" "The :meth:`timestamp` method uses the :attr:`.fold` attribute to " "disambiguate the times during a repeated interval." msgstr "" -#: ../../library/datetime.rst:1399 +#: ../../library/datetime.rst:1403 msgid "" "There is no method to obtain the POSIX timestamp directly from a naive :" "class:`.datetime` instance representing UTC time. If your application uses " @@ -1715,49 +1725,49 @@ msgid "" "the POSIX timestamp by supplying ``tzinfo=timezone.utc``::" msgstr "" -#: ../../library/datetime.rst:1407 +#: ../../library/datetime.rst:1411 msgid "or by calculating the timestamp directly::" msgstr "" -#: ../../library/datetime.rst:1413 +#: ../../library/datetime.rst:1417 msgid "" "Return the day of the week as an integer, where Monday is 0 and Sunday is 6. " "The same as ``self.date().weekday()``. See also :meth:`isoweekday`." msgstr "" -#: ../../library/datetime.rst:1419 +#: ../../library/datetime.rst:1423 msgid "" "Return the day of the week as an integer, where Monday is 1 and Sunday is 7. " "The same as ``self.date().isoweekday()``. See also :meth:`weekday`, :meth:" "`isocalendar`." msgstr "" -#: ../../library/datetime.rst:1426 +#: ../../library/datetime.rst:1430 msgid "" "Return a :term:`named tuple` with three components: ``year``, ``week`` and " "``weekday``. The same as ``self.date().isocalendar()``." msgstr "" -#: ../../library/datetime.rst:1432 +#: ../../library/datetime.rst:1436 msgid "Return a string representing the date and time in ISO 8601 format:" msgstr "" -#: ../../library/datetime.rst:1434 +#: ../../library/datetime.rst:1438 msgid "``YYYY-MM-DDTHH:MM:SS.ffffff``, if :attr:`microsecond` is not 0" msgstr "``YYYY-MM-DDTHH:MM:SS.ffffff``,如果 :attr:`microsecond` 不是 0" -#: ../../library/datetime.rst:1435 +#: ../../library/datetime.rst:1439 msgid "``YYYY-MM-DDTHH:MM:SS``, if :attr:`microsecond` is 0" msgstr "``YYYY-MM-DDTHH:MM:SS``,如果 :attr:`microsecond` 是 0" -#: ../../library/datetime.rst:1437 +#: ../../library/datetime.rst:1441 msgid "" "If :meth:`utcoffset` does not return ``None``, a string is appended, giving " "the UTC offset:" msgstr "" "如果 :meth:`utcoffset` 没有回傳 ``None``,則會附加一个字串,給出 UTC 偏移:" -#: ../../library/datetime.rst:1440 +#: ../../library/datetime.rst:1444 msgid "" "``YYYY-MM-DDTHH:MM:SS.ffffff+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` " "is not 0" @@ -1765,99 +1775,99 @@ msgstr "" "``YYYY-MM-DDTHH:MM:SS.ffffff+HH:MM[:SS[.ffffff]]``,如果 :attr:`microsecond` " "不是 0" -#: ../../library/datetime.rst:1442 +#: ../../library/datetime.rst:1446 msgid "" "``YYYY-MM-DDTHH:MM:SS+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` is 0" msgstr "" "``YYYY-MM-DDTHH:MM:SS+HH:MM[:SS[.ffffff]]``,如果 :attr:`microsecond` 是 0" -#: ../../library/datetime.rst:1452 +#: ../../library/datetime.rst:1456 msgid "" "The optional argument *sep* (default ``'T'``) is a one-character separator, " "placed between the date and time portions of the result. For example::" msgstr "" -#: ../../library/datetime.rst:1466 ../../library/datetime.rst:1839 +#: ../../library/datetime.rst:1470 ../../library/datetime.rst:1843 msgid "" "The optional argument *timespec* specifies the number of additional " "components of the time to include (the default is ``'auto'``). It can be one " "of the following:" msgstr "" -#: ../../library/datetime.rst:1470 ../../library/datetime.rst:1843 +#: ../../library/datetime.rst:1474 ../../library/datetime.rst:1847 msgid "" "``'auto'``: Same as ``'seconds'`` if :attr:`microsecond` is 0, same as " "``'microseconds'`` otherwise." msgstr "" -#: ../../library/datetime.rst:1472 ../../library/datetime.rst:1845 +#: ../../library/datetime.rst:1476 ../../library/datetime.rst:1849 msgid "``'hours'``: Include the :attr:`hour` in the two-digit ``HH`` format." msgstr "" -#: ../../library/datetime.rst:1473 ../../library/datetime.rst:1846 +#: ../../library/datetime.rst:1477 ../../library/datetime.rst:1850 msgid "" "``'minutes'``: Include :attr:`hour` and :attr:`minute` in ``HH:MM`` format." msgstr "" -#: ../../library/datetime.rst:1474 ../../library/datetime.rst:1847 +#: ../../library/datetime.rst:1478 ../../library/datetime.rst:1851 msgid "" "``'seconds'``: Include :attr:`hour`, :attr:`minute`, and :attr:`second` in " "``HH:MM:SS`` format." msgstr "" -#: ../../library/datetime.rst:1476 ../../library/datetime.rst:1849 +#: ../../library/datetime.rst:1480 ../../library/datetime.rst:1853 msgid "" "``'milliseconds'``: Include full time, but truncate fractional second part " "to milliseconds. ``HH:MM:SS.sss`` format." msgstr "" -#: ../../library/datetime.rst:1478 ../../library/datetime.rst:1851 +#: ../../library/datetime.rst:1482 ../../library/datetime.rst:1855 msgid "``'microseconds'``: Include full time in ``HH:MM:SS.ffffff`` format." msgstr "" -#: ../../library/datetime.rst:1482 ../../library/datetime.rst:1855 +#: ../../library/datetime.rst:1486 ../../library/datetime.rst:1859 msgid "Excluded time components are truncated, not rounded." msgstr "" -#: ../../library/datetime.rst:1484 +#: ../../library/datetime.rst:1488 msgid ":exc:`ValueError` will be raised on an invalid *timespec* argument::" msgstr "" -#: ../../library/datetime.rst:1494 ../../library/datetime.rst:1870 +#: ../../library/datetime.rst:1498 ../../library/datetime.rst:1874 msgid "Added the *timespec* argument." msgstr "新增 *timespec* 引數。" -#: ../../library/datetime.rst:1500 +#: ../../library/datetime.rst:1504 msgid "" "For a :class:`.datetime` instance *d*, ``str(d)`` is equivalent to ``d." "isoformat(' ')``." msgstr "" -#: ../../library/datetime.rst:1506 +#: ../../library/datetime.rst:1510 msgid "Return a string representing the date and time::" msgstr "" -#: ../../library/datetime.rst:1512 +#: ../../library/datetime.rst:1516 msgid "" "The output string will *not* include time zone information, regardless of " "whether the input is aware or naive." msgstr "" -#: ../../library/datetime.rst:1519 +#: ../../library/datetime.rst:1523 msgid "" "on platforms where the native C :c:func:`ctime` function (which :func:`time." "ctime` invokes, but which :meth:`datetime.ctime` does not invoke) conforms " "to the C standard." msgstr "" -#: ../../library/datetime.rst:1526 +#: ../../library/datetime.rst:1530 msgid "" "Return a string representing the date and time, controlled by an explicit " "format string. See also :ref:`strftime-strptime-behavior` and :meth:" "`datetime.isoformat`." msgstr "" -#: ../../library/datetime.rst:1533 +#: ../../library/datetime.rst:1537 msgid "" "Same as :meth:`.datetime.strftime`. This makes it possible to specify a " "format string for a :class:`.datetime` object in :ref:`formatted string " @@ -1865,70 +1875,70 @@ msgid "" "`strftime-strptime-behavior` and :meth:`datetime.isoformat`." msgstr "" -#: ../../library/datetime.rst:1540 +#: ../../library/datetime.rst:1544 msgid "Examples of Usage: :class:`.datetime`" msgstr "" -#: ../../library/datetime.rst:1542 +#: ../../library/datetime.rst:1546 msgid "Examples of working with :class:`~datetime.datetime` objects:" msgstr "" -#: ../../library/datetime.rst:1595 +#: ../../library/datetime.rst:1599 msgid "" "The example below defines a :class:`tzinfo` subclass capturing time zone " "information for Kabul, Afghanistan, which used +4 UTC until 1945 and then " "+4:30 UTC thereafter::" msgstr "" -#: ../../library/datetime.rst:1642 +#: ../../library/datetime.rst:1646 msgid "Usage of ``KabulTz`` from above::" msgstr "" -#: ../../library/datetime.rst:1668 +#: ../../library/datetime.rst:1672 msgid ":class:`.time` Objects" msgstr ":class:`.time` 物件" -#: ../../library/datetime.rst:1670 +#: ../../library/datetime.rst:1674 msgid "" "A :class:`time` object represents a (local) time of day, independent of any " "particular day, and subject to adjustment via a :class:`tzinfo` object." msgstr "" -#: ../../library/datetime.rst:1675 +#: ../../library/datetime.rst:1679 msgid "" "All arguments are optional. *tzinfo* may be ``None``, or an instance of a :" "class:`tzinfo` subclass. The remaining arguments must be integers in the " "following ranges:" msgstr "" -#: ../../library/datetime.rst:1685 +#: ../../library/datetime.rst:1689 msgid "" "If an argument outside those ranges is given, :exc:`ValueError` is raised. " "All default to ``0`` except *tzinfo*, which defaults to :const:`None`." msgstr "" -#: ../../library/datetime.rst:1693 +#: ../../library/datetime.rst:1697 msgid "The earliest representable :class:`.time`, ``time(0, 0, 0, 0)``." msgstr "" -#: ../../library/datetime.rst:1698 +#: ../../library/datetime.rst:1702 msgid "The latest representable :class:`.time`, ``time(23, 59, 59, 999999)``." msgstr "" -#: ../../library/datetime.rst:1703 +#: ../../library/datetime.rst:1707 msgid "" "The smallest possible difference between non-equal :class:`.time` objects, " "``timedelta(microseconds=1)``, although note that arithmetic on :class:`." "time` objects is not supported." msgstr "" -#: ../../library/datetime.rst:1732 +#: ../../library/datetime.rst:1736 msgid "" "The object passed as the tzinfo argument to the :class:`.time` constructor, " "or ``None`` if none was passed." msgstr "" -#: ../../library/datetime.rst:1746 +#: ../../library/datetime.rst:1750 msgid "" ":class:`.time` objects support comparison of :class:`.time` to :class:`." "time`, where *a* is considered less than *b* when *a* precedes *b* in time. " @@ -1937,7 +1947,7 @@ msgid "" "instances are never equal to aware instances." msgstr "" -#: ../../library/datetime.rst:1752 +#: ../../library/datetime.rst:1756 msgid "" "If both comparands are aware, and have the same :attr:`~time.tzinfo` " "attribute, the common :attr:`~time.tzinfo` attribute is ignored and the base " @@ -1951,18 +1961,18 @@ msgid "" "respectively." msgstr "" -#: ../../library/datetime.rst:1762 +#: ../../library/datetime.rst:1766 msgid "" "Equality comparisons between aware and naive :class:`~datetime.time` " "instances don't raise :exc:`TypeError`." msgstr "" -#: ../../library/datetime.rst:1766 +#: ../../library/datetime.rst:1770 msgid "" "In Boolean contexts, a :class:`.time` object is always considered to be true." msgstr "" -#: ../../library/datetime.rst:1768 +#: ../../library/datetime.rst:1772 msgid "" "Before Python 3.5, a :class:`.time` object was considered to be false if it " "represented midnight in UTC. This behavior was considered obscure and error-" @@ -1970,35 +1980,35 @@ msgid "" "details." msgstr "" -#: ../../library/datetime.rst:1775 +#: ../../library/datetime.rst:1779 msgid "Other constructor:" msgstr "" -#: ../../library/datetime.rst:1779 +#: ../../library/datetime.rst:1783 msgid "" "Return a :class:`.time` corresponding to a *time_string* in any valid ISO " "8601 format, with the following exceptions:" msgstr "" -#: ../../library/datetime.rst:1783 +#: ../../library/datetime.rst:1787 msgid "" "The leading ``T``, normally required in cases where there may be ambiguity " "between a date and a time, is not required." msgstr "" -#: ../../library/datetime.rst:1785 +#: ../../library/datetime.rst:1789 msgid "" "Fractional seconds may have any number of digits (anything beyond 6 will be " "truncated)." msgstr "" -#: ../../library/datetime.rst:1811 +#: ../../library/datetime.rst:1815 msgid "" "Previously, this method only supported formats that could be emitted by :" "meth:`time.isoformat()`." msgstr "" -#: ../../library/datetime.rst:1821 +#: ../../library/datetime.rst:1825 msgid "" "Return a :class:`.time` with the same value, except for those attributes " "given new values by whichever keyword arguments are specified. Note that " @@ -2006,46 +2016,46 @@ msgid "" "aware :class:`.time`, without conversion of the time data." msgstr "" -#: ../../library/datetime.rst:1832 +#: ../../library/datetime.rst:1836 msgid "Return a string representing the time in ISO 8601 format, one of:" msgstr "" -#: ../../library/datetime.rst:1834 +#: ../../library/datetime.rst:1838 msgid "``HH:MM:SS.ffffff``, if :attr:`microsecond` is not 0" msgstr "" -#: ../../library/datetime.rst:1835 +#: ../../library/datetime.rst:1839 msgid "``HH:MM:SS``, if :attr:`microsecond` is 0" msgstr "" -#: ../../library/datetime.rst:1836 +#: ../../library/datetime.rst:1840 msgid "" "``HH:MM:SS.ffffff+HH:MM[:SS[.ffffff]]``, if :meth:`utcoffset` does not " "return ``None``" msgstr "" -#: ../../library/datetime.rst:1837 +#: ../../library/datetime.rst:1841 msgid "" "``HH:MM:SS+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` is 0 and :meth:" "`utcoffset` does not return ``None``" msgstr "" -#: ../../library/datetime.rst:1857 +#: ../../library/datetime.rst:1861 msgid ":exc:`ValueError` will be raised on an invalid *timespec* argument." msgstr "" -#: ../../library/datetime.rst:1876 +#: ../../library/datetime.rst:1880 msgid "For a time *t*, ``str(t)`` is equivalent to ``t.isoformat()``." msgstr "" -#: ../../library/datetime.rst:1881 +#: ../../library/datetime.rst:1885 msgid "" "Return a string representing the time, controlled by an explicit format " "string. See also :ref:`strftime-strptime-behavior` and :meth:`time." "isoformat`." msgstr "" -#: ../../library/datetime.rst:1887 +#: ../../library/datetime.rst:1891 msgid "" "Same as :meth:`.time.strftime`. This makes it possible to specify a format " "string for a :class:`.time` object in :ref:`formatted string literals ` file there are some examples of :class:`tzinfo` classes:" msgstr "" -#: ../../library/datetime.rst:2142 +#: ../../library/datetime.rst:2146 msgid "" "Note that there are unavoidable subtleties twice per year in a :class:" "`tzinfo` subclass accounting for both standard and daylight time, at the DST " @@ -2315,7 +2325,7 @@ msgid "" "ends the minute after 1:59 (EDT) on the first Sunday in November::" msgstr "" -#: ../../library/datetime.rst:2156 +#: ../../library/datetime.rst:2160 msgid "" "When DST starts (the \"start\" line), the local wall clock leaps from 1:59 " "to 3:00. A wall time of the form 2:MM doesn't really make sense on that day, " @@ -2324,7 +2334,7 @@ msgid "" "get::" msgstr "" -#: ../../library/datetime.rst:2175 +#: ../../library/datetime.rst:2179 msgid "" "When DST ends (the \"end\" line), there's a potentially worse problem: " "there's an hour that can't be spelled unambiguously in local wall time: the " @@ -2339,13 +2349,13 @@ msgid "" "transition of 2016, we get::" msgstr "" -#: ../../library/datetime.rst:2197 +#: ../../library/datetime.rst:2201 msgid "" "Note that the :class:`.datetime` instances that differ only by the value of " "the :attr:`~datetime.fold` attribute are considered equal in comparisons." msgstr "" -#: ../../library/datetime.rst:2200 +#: ../../library/datetime.rst:2204 msgid "" "Applications that can't bear wall-time ambiguities should explicitly check " "the value of the :attr:`~datetime.fold` attribute or avoid using hybrid :" @@ -2355,28 +2365,28 @@ msgid "" "offset -4 hours))." msgstr "" -#: ../../library/datetime.rst:2214 +#: ../../library/datetime.rst:2218 msgid ":mod:`zoneinfo`" msgstr ":mod:`zoneinfo`" -#: ../../library/datetime.rst:2209 +#: ../../library/datetime.rst:2213 msgid "" "The :mod:`datetime` module has a basic :class:`timezone` class (for handling " "arbitrary fixed offsets from UTC) and its :attr:`timezone.utc` attribute (a " "UTC timezone instance)." msgstr "" -#: ../../library/datetime.rst:2213 +#: ../../library/datetime.rst:2217 msgid "" "``zoneinfo`` brings the *IANA timezone database* (also known as the Olson " "database) to Python, and its usage is recommended." msgstr "" -#: ../../library/datetime.rst:2220 +#: ../../library/datetime.rst:2224 msgid "`IANA timezone database `_" msgstr "`IANA 時區資料庫 `_" -#: ../../library/datetime.rst:2217 +#: ../../library/datetime.rst:2221 msgid "" "The Time Zone Database (often called tz, tzdata or zoneinfo) contains code " "and data that represent the history of local time for many representative " @@ -2385,24 +2395,24 @@ msgid "" "saving rules." msgstr "" -#: ../../library/datetime.rst:2227 +#: ../../library/datetime.rst:2231 msgid ":class:`timezone` Objects" msgstr ":class:`timezone` 物件" -#: ../../library/datetime.rst:2229 +#: ../../library/datetime.rst:2233 msgid "" "The :class:`timezone` class is a subclass of :class:`tzinfo`, each instance " "of which represents a timezone defined by a fixed offset from UTC." msgstr "" -#: ../../library/datetime.rst:2233 +#: ../../library/datetime.rst:2237 msgid "" "Objects of this class cannot be used to represent timezone information in " "the locations where different offsets are used in different days of the year " "or where historical changes have been made to civil time." msgstr "" -#: ../../library/datetime.rst:2240 +#: ../../library/datetime.rst:2244 msgid "" "The *offset* argument must be specified as a :class:`timedelta` object " "representing the difference between the local time and UTC. It must be " @@ -2410,25 +2420,25 @@ msgid "" "otherwise :exc:`ValueError` is raised." msgstr "" -#: ../../library/datetime.rst:2245 +#: ../../library/datetime.rst:2249 msgid "" "The *name* argument is optional. If specified it must be a string that will " "be used as the value returned by the :meth:`datetime.tzname` method." msgstr "" -#: ../../library/datetime.rst:2256 ../../library/datetime.rst:2267 +#: ../../library/datetime.rst:2260 ../../library/datetime.rst:2271 msgid "" "Return the fixed value specified when the :class:`timezone` instance is " "constructed." msgstr "" -#: ../../library/datetime.rst:2259 +#: ../../library/datetime.rst:2263 msgid "" "The *dt* argument is ignored. The return value is a :class:`timedelta` " "instance equal to the difference between the local time and UTC." msgstr "" -#: ../../library/datetime.rst:2270 +#: ../../library/datetime.rst:2274 msgid "" "If *name* is not provided in the constructor, the name returned by " "``tzname(dt)`` is generated from the value of the ``offset`` as follows. If " @@ -2437,144 +2447,144 @@ msgid "" "are two digits of ``offset.hours`` and ``offset.minutes`` respectively." msgstr "" -#: ../../library/datetime.rst:2276 +#: ../../library/datetime.rst:2280 msgid "" "Name generated from ``offset=timedelta(0)`` is now plain ``'UTC'``, not " "``'UTC+00:00'``." msgstr "" -#: ../../library/datetime.rst:2283 +#: ../../library/datetime.rst:2287 msgid "Always returns ``None``." msgstr "" -#: ../../library/datetime.rst:2287 +#: ../../library/datetime.rst:2291 msgid "" "Return ``dt + offset``. The *dt* argument must be an aware :class:`." "datetime` instance, with ``tzinfo`` set to ``self``." msgstr "" -#: ../../library/datetime.rst:2294 +#: ../../library/datetime.rst:2298 msgid "The UTC timezone, ``timezone(timedelta(0))``." msgstr "" -#: ../../library/datetime.rst:2303 +#: ../../library/datetime.rst:2307 msgid ":meth:`strftime` and :meth:`strptime` Behavior" msgstr ":meth:`strftime` 與 :meth:`strptime` 的行為" -#: ../../library/datetime.rst:2305 +#: ../../library/datetime.rst:2309 msgid "" ":class:`date`, :class:`.datetime`, and :class:`.time` objects all support a " "``strftime(format)`` method, to create a string representing the time under " "the control of an explicit format string." msgstr "" -#: ../../library/datetime.rst:2309 +#: ../../library/datetime.rst:2313 msgid "" "Conversely, the :meth:`datetime.strptime` class method creates a :class:`." "datetime` object from a string representing a date and time and a " "corresponding format string." msgstr "" -#: ../../library/datetime.rst:2313 +#: ../../library/datetime.rst:2317 msgid "" "The table below provides a high-level comparison of :meth:`strftime` versus :" "meth:`strptime`:" msgstr "" -#: ../../library/datetime.rst:2317 +#: ../../library/datetime.rst:2321 msgid "``strftime``" msgstr "``strftime``" -#: ../../library/datetime.rst:2317 +#: ../../library/datetime.rst:2321 msgid "``strptime``" msgstr "``strptime``" -#: ../../library/datetime.rst:2319 +#: ../../library/datetime.rst:2323 msgid "Usage" msgstr "用法" -#: ../../library/datetime.rst:2319 +#: ../../library/datetime.rst:2323 msgid "Convert object to a string according to a given format" msgstr "" -#: ../../library/datetime.rst:2319 +#: ../../library/datetime.rst:2323 msgid "" "Parse a string into a :class:`.datetime` object given a corresponding format" msgstr "" -#: ../../library/datetime.rst:2321 +#: ../../library/datetime.rst:2325 msgid "Type of method" msgstr "" -#: ../../library/datetime.rst:2321 +#: ../../library/datetime.rst:2325 msgid "Instance method" msgstr "實例方法" -#: ../../library/datetime.rst:2321 +#: ../../library/datetime.rst:2325 msgid "Class method" msgstr "類別方法" -#: ../../library/datetime.rst:2323 +#: ../../library/datetime.rst:2327 msgid "Method of" msgstr "" -#: ../../library/datetime.rst:2323 +#: ../../library/datetime.rst:2327 msgid ":class:`date`; :class:`.datetime`; :class:`.time`" msgstr "" -#: ../../library/datetime.rst:2323 +#: ../../library/datetime.rst:2327 msgid ":class:`.datetime`" msgstr ":class:`.datetime`" -#: ../../library/datetime.rst:2325 +#: ../../library/datetime.rst:2329 msgid "Signature" msgstr "" -#: ../../library/datetime.rst:2325 +#: ../../library/datetime.rst:2329 msgid "``strftime(format)``" msgstr "``strftime(format)``" -#: ../../library/datetime.rst:2325 +#: ../../library/datetime.rst:2329 msgid "``strptime(date_string, format)``" msgstr "``strptime(date_string, format)``" -#: ../../library/datetime.rst:2332 +#: ../../library/datetime.rst:2336 msgid ":meth:`strftime` and :meth:`strptime` Format Codes" msgstr "" -#: ../../library/datetime.rst:2334 +#: ../../library/datetime.rst:2338 msgid "" "These methods accept format codes that can be used to parse and format " "dates::" msgstr "" -#: ../../library/datetime.rst:2342 +#: ../../library/datetime.rst:2346 msgid "" "The following is a list of all the format codes that the 1989 C standard " "requires, and these work on all platforms with a standard C implementation." msgstr "" -#: ../../library/datetime.rst:2346 ../../library/datetime.rst:2449 +#: ../../library/datetime.rst:2350 ../../library/datetime.rst:2453 msgid "Directive" msgstr "" -#: ../../library/datetime.rst:2346 ../../library/datetime.rst:2449 +#: ../../library/datetime.rst:2350 ../../library/datetime.rst:2453 msgid "Meaning" msgstr "" -#: ../../library/datetime.rst:2346 ../../library/datetime.rst:2449 +#: ../../library/datetime.rst:2350 ../../library/datetime.rst:2453 msgid "Example" msgstr "範例" -#: ../../library/datetime.rst:2346 ../../library/datetime.rst:2449 +#: ../../library/datetime.rst:2350 ../../library/datetime.rst:2453 msgid "Notes" msgstr "註解" -#: ../../library/datetime.rst:2348 +#: ../../library/datetime.rst:2352 msgid "``%a``" msgstr "``%a``" -#: ../../library/datetime.rst:2348 +#: ../../library/datetime.rst:2352 msgid "Weekday as locale's abbreviated name." msgstr "" @@ -2586,11 +2596,11 @@ msgstr "" msgid "So, Mo, ..., Sa (de_DE)" msgstr "" -#: ../../library/datetime.rst:2353 +#: ../../library/datetime.rst:2357 msgid "``%A``" msgstr "``%A``" -#: ../../library/datetime.rst:2353 +#: ../../library/datetime.rst:2357 msgid "Weekday as locale's full name." msgstr "" @@ -2602,42 +2612,42 @@ msgstr "" msgid "Sonntag, Montag, ..., Samstag (de_DE)" msgstr "" -#: ../../library/datetime.rst:2358 +#: ../../library/datetime.rst:2362 msgid "``%w``" msgstr "``%w``" -#: ../../library/datetime.rst:2358 +#: ../../library/datetime.rst:2362 msgid "Weekday as a decimal number, where 0 is Sunday and 6 is Saturday." msgstr "" -#: ../../library/datetime.rst:2358 +#: ../../library/datetime.rst:2362 msgid "0, 1, ..., 6" msgstr "0, 1, ..., 6" -#: ../../library/datetime.rst:2362 +#: ../../library/datetime.rst:2366 msgid "``%d``" msgstr "``%d``" -#: ../../library/datetime.rst:2362 +#: ../../library/datetime.rst:2366 msgid "Day of the month as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2362 +#: ../../library/datetime.rst:2366 msgid "01, 02, ..., 31" msgstr "01, 02, ..., 31" -#: ../../library/datetime.rst:2362 ../../library/datetime.rst:2375 -#: ../../library/datetime.rst:2378 ../../library/datetime.rst:2384 -#: ../../library/datetime.rst:2387 ../../library/datetime.rst:2393 -#: ../../library/datetime.rst:2411 +#: ../../library/datetime.rst:2366 ../../library/datetime.rst:2379 +#: ../../library/datetime.rst:2382 ../../library/datetime.rst:2388 +#: ../../library/datetime.rst:2391 ../../library/datetime.rst:2397 +#: ../../library/datetime.rst:2415 msgid "\\(9)" msgstr "\\(9)" -#: ../../library/datetime.rst:2365 +#: ../../library/datetime.rst:2369 msgid "``%b``" msgstr "``%b``" -#: ../../library/datetime.rst:2365 +#: ../../library/datetime.rst:2369 msgid "Month as locale's abbreviated name." msgstr "" @@ -2649,11 +2659,11 @@ msgstr "" msgid "Jan, Feb, ..., Dez (de_DE)" msgstr "" -#: ../../library/datetime.rst:2370 +#: ../../library/datetime.rst:2374 msgid "``%B``" msgstr "``%B``" -#: ../../library/datetime.rst:2370 +#: ../../library/datetime.rst:2374 msgid "Month as locale's full name." msgstr "" @@ -2665,67 +2675,67 @@ msgstr "" msgid "Januar, Februar, ..., Dezember (de_DE)" msgstr "" -#: ../../library/datetime.rst:2375 +#: ../../library/datetime.rst:2379 msgid "``%m``" msgstr "``%m``" -#: ../../library/datetime.rst:2375 +#: ../../library/datetime.rst:2379 msgid "Month as a zero-padded decimal number." msgstr "以零填充的並以十進位數字表示的月份。" -#: ../../library/datetime.rst:2375 ../../library/datetime.rst:2387 +#: ../../library/datetime.rst:2379 ../../library/datetime.rst:2391 msgid "01, 02, ..., 12" msgstr "01, 02, ..., 12" -#: ../../library/datetime.rst:2378 +#: ../../library/datetime.rst:2382 msgid "``%y``" msgstr "``%y``" -#: ../../library/datetime.rst:2378 +#: ../../library/datetime.rst:2382 msgid "Year without century as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2378 +#: ../../library/datetime.rst:2382 msgid "00, 01, ..., 99" msgstr "00, 01, ..., 99" -#: ../../library/datetime.rst:2381 +#: ../../library/datetime.rst:2385 msgid "``%Y``" msgstr "``%Y``" -#: ../../library/datetime.rst:2381 +#: ../../library/datetime.rst:2385 msgid "Year with century as a decimal number." msgstr "" -#: ../../library/datetime.rst:2381 ../../library/datetime.rst:2451 +#: ../../library/datetime.rst:2385 ../../library/datetime.rst:2455 msgid "0001, 0002, ..., 2013, 2014, ..., 9998, 9999" msgstr "0001, 0002, ..., 2013, 2014, ..., 9998, 9999" -#: ../../library/datetime.rst:2384 +#: ../../library/datetime.rst:2388 msgid "``%H``" msgstr "``%H``" -#: ../../library/datetime.rst:2384 +#: ../../library/datetime.rst:2388 msgid "Hour (24-hour clock) as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2384 +#: ../../library/datetime.rst:2388 msgid "00, 01, ..., 23" msgstr "00, 01, ..., 23" -#: ../../library/datetime.rst:2387 +#: ../../library/datetime.rst:2391 msgid "``%I``" msgstr "``%I``" -#: ../../library/datetime.rst:2387 +#: ../../library/datetime.rst:2391 msgid "Hour (12-hour clock) as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2390 +#: ../../library/datetime.rst:2394 msgid "``%p``" msgstr "``%p``" -#: ../../library/datetime.rst:2390 +#: ../../library/datetime.rst:2394 msgid "Locale's equivalent of either AM or PM." msgstr "" @@ -2737,128 +2747,128 @@ msgstr "AM, PM (en_US);" msgid "am, pm (de_DE)" msgstr "am, pm (de_DE)" -#: ../../library/datetime.rst:2390 +#: ../../library/datetime.rst:2394 msgid "\\(1), \\(3)" msgstr "\\(1), \\(3)" -#: ../../library/datetime.rst:2393 +#: ../../library/datetime.rst:2397 msgid "``%M``" msgstr "``%M``" -#: ../../library/datetime.rst:2393 +#: ../../library/datetime.rst:2397 msgid "Minute as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2393 ../../library/datetime.rst:2396 +#: ../../library/datetime.rst:2397 ../../library/datetime.rst:2400 msgid "00, 01, ..., 59" msgstr "00, 01, ..., 59" -#: ../../library/datetime.rst:2396 +#: ../../library/datetime.rst:2400 msgid "``%S``" msgstr "``%S``" -#: ../../library/datetime.rst:2396 +#: ../../library/datetime.rst:2400 msgid "Second as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2396 +#: ../../library/datetime.rst:2400 msgid "\\(4), \\(9)" msgstr "\\(4), \\(9)" -#: ../../library/datetime.rst:2399 +#: ../../library/datetime.rst:2403 msgid "``%f``" msgstr "``%f``" -#: ../../library/datetime.rst:2399 +#: ../../library/datetime.rst:2403 msgid "Microsecond as a decimal number, zero-padded to 6 digits." msgstr "" -#: ../../library/datetime.rst:2399 +#: ../../library/datetime.rst:2403 msgid "000000, 000001, ..., 999999" msgstr "000000, 000001, ..., 999999" -#: ../../library/datetime.rst:2399 +#: ../../library/datetime.rst:2403 msgid "\\(5)" msgstr "\\(5)" -#: ../../library/datetime.rst:2403 ../../library/datetime.rst:2572 +#: ../../library/datetime.rst:2407 ../../library/datetime.rst:2576 msgid "``%z``" msgstr "``%z``" -#: ../../library/datetime.rst:2403 +#: ../../library/datetime.rst:2407 msgid "" "UTC offset in the form ``±HHMM[SS[.ffffff]]`` (empty string if the object is " "naive)." msgstr "" -#: ../../library/datetime.rst:2403 +#: ../../library/datetime.rst:2407 msgid "(empty), +0000, -0400, +1030, +063415, -030712.345216" msgstr "" -#: ../../library/datetime.rst:2403 ../../library/datetime.rst:2408 -#: ../../library/datetime.rst:2465 +#: ../../library/datetime.rst:2407 ../../library/datetime.rst:2412 +#: ../../library/datetime.rst:2469 msgid "\\(6)" msgstr "\\(6)" -#: ../../library/datetime.rst:2408 ../../library/datetime.rst:2600 +#: ../../library/datetime.rst:2412 ../../library/datetime.rst:2604 msgid "``%Z``" msgstr "``%Z``" -#: ../../library/datetime.rst:2408 +#: ../../library/datetime.rst:2412 msgid "Time zone name (empty string if the object is naive)." msgstr "" -#: ../../library/datetime.rst:2408 +#: ../../library/datetime.rst:2412 msgid "(empty), UTC, GMT" msgstr "" -#: ../../library/datetime.rst:2411 +#: ../../library/datetime.rst:2415 msgid "``%j``" msgstr "``%j``" -#: ../../library/datetime.rst:2411 +#: ../../library/datetime.rst:2415 msgid "Day of the year as a zero-padded decimal number." msgstr "" -#: ../../library/datetime.rst:2411 +#: ../../library/datetime.rst:2415 msgid "001, 002, ..., 366" msgstr "001, 002, ..., 366" -#: ../../library/datetime.rst:2414 +#: ../../library/datetime.rst:2418 msgid "``%U``" msgstr "``%U``" -#: ../../library/datetime.rst:2414 +#: ../../library/datetime.rst:2418 msgid "" "Week number of the year (Sunday as the first day of the week) as a zero-" "padded decimal number. All days in a new year preceding the first Sunday are " "considered to be in week 0." msgstr "" -#: ../../library/datetime.rst:2414 ../../library/datetime.rst:2422 +#: ../../library/datetime.rst:2418 ../../library/datetime.rst:2426 msgid "00, 01, ..., 53" msgstr "00, 01, ..., 53" -#: ../../library/datetime.rst:2414 ../../library/datetime.rst:2422 +#: ../../library/datetime.rst:2418 ../../library/datetime.rst:2426 msgid "\\(7), \\(9)" msgstr "\\(7), \\(9)" -#: ../../library/datetime.rst:2422 +#: ../../library/datetime.rst:2426 msgid "``%W``" msgstr "``%W``" -#: ../../library/datetime.rst:2422 +#: ../../library/datetime.rst:2426 msgid "" "Week number of the year (Monday as the first day of the week) as a zero-" "padded decimal number. All days in a new year preceding the first Monday are " "considered to be in week 0." msgstr "" -#: ../../library/datetime.rst:2430 +#: ../../library/datetime.rst:2434 msgid "``%c``" msgstr "``%c``" -#: ../../library/datetime.rst:2430 +#: ../../library/datetime.rst:2434 msgid "Locale's appropriate date and time representation." msgstr "" @@ -2870,11 +2880,11 @@ msgstr "" msgid "Di 16 Aug 21:30:00 1988 (de_DE)" msgstr "" -#: ../../library/datetime.rst:2435 +#: ../../library/datetime.rst:2439 msgid "``%x``" msgstr "``%x``" -#: ../../library/datetime.rst:2435 +#: ../../library/datetime.rst:2439 msgid "Locale's appropriate date representation." msgstr "" @@ -2890,11 +2900,11 @@ msgstr "" msgid "16.08.1988 (de_DE)" msgstr "" -#: ../../library/datetime.rst:2439 +#: ../../library/datetime.rst:2443 msgid "``%X``" msgstr "``%X``" -#: ../../library/datetime.rst:2439 +#: ../../library/datetime.rst:2443 msgid "Locale's appropriate time representation." msgstr "" @@ -2906,83 +2916,83 @@ msgstr "" msgid "21:30:00 (de_DE)" msgstr "" -#: ../../library/datetime.rst:2442 +#: ../../library/datetime.rst:2446 msgid "``%%``" msgstr "``%%``" -#: ../../library/datetime.rst:2442 +#: ../../library/datetime.rst:2446 msgid "A literal ``'%'`` character." msgstr "" -#: ../../library/datetime.rst:2442 +#: ../../library/datetime.rst:2446 msgid "%" msgstr "%" -#: ../../library/datetime.rst:2445 +#: ../../library/datetime.rst:2449 msgid "" "Several additional directives not required by the C89 standard are included " "for convenience. These parameters all correspond to ISO 8601 date values." msgstr "" -#: ../../library/datetime.rst:2451 +#: ../../library/datetime.rst:2455 msgid "``%G``" msgstr "``%G``" -#: ../../library/datetime.rst:2451 +#: ../../library/datetime.rst:2455 msgid "" "ISO 8601 year with century representing the year that contains the greater " "part of the ISO week (``%V``)." msgstr "" -#: ../../library/datetime.rst:2451 +#: ../../library/datetime.rst:2455 msgid "\\(8)" msgstr "\\(8)" -#: ../../library/datetime.rst:2456 +#: ../../library/datetime.rst:2460 msgid "``%u``" msgstr "``%u``" -#: ../../library/datetime.rst:2456 +#: ../../library/datetime.rst:2460 msgid "ISO 8601 weekday as a decimal number where 1 is Monday." msgstr "" -#: ../../library/datetime.rst:2456 +#: ../../library/datetime.rst:2460 msgid "1, 2, ..., 7" msgstr "1, 2, ..., 7" -#: ../../library/datetime.rst:2459 +#: ../../library/datetime.rst:2463 msgid "``%V``" msgstr "``%V``" -#: ../../library/datetime.rst:2459 +#: ../../library/datetime.rst:2463 msgid "" "ISO 8601 week as a decimal number with Monday as the first day of the week. " "Week 01 is the week containing Jan 4." msgstr "" -#: ../../library/datetime.rst:2459 +#: ../../library/datetime.rst:2463 msgid "01, 02, ..., 53" msgstr "01, 02, ..., 53" -#: ../../library/datetime.rst:2459 +#: ../../library/datetime.rst:2463 msgid "\\(8), \\(9)" msgstr "\\(8), \\(9)" -#: ../../library/datetime.rst:2465 ../../library/datetime.rst:2586 +#: ../../library/datetime.rst:2469 ../../library/datetime.rst:2590 msgid "``%:z``" msgstr "``%:z``" -#: ../../library/datetime.rst:2465 +#: ../../library/datetime.rst:2469 msgid "" "UTC offset in the form ``±HH:MM[:SS[.ffffff]]`` (empty string if the object " "is naive)." msgstr "" -#: ../../library/datetime.rst:2465 +#: ../../library/datetime.rst:2469 msgid "(empty), +00:00, -04:00, +10:30, +06:34:15, -03:07:12.345216" msgstr "" -#: ../../library/datetime.rst:2471 +#: ../../library/datetime.rst:2475 msgid "" "These may not be available on all platforms when used with the :meth:" "`strftime` method. The ISO 8601 year and ISO 8601 week directives are not " @@ -2991,7 +3001,7 @@ msgid "" "a :exc:`ValueError`." msgstr "" -#: ../../library/datetime.rst:2476 +#: ../../library/datetime.rst:2480 msgid "" "The full set of format codes supported varies across platforms, because " "Python calls the platform C library's :func:`strftime` function, and " @@ -3001,37 +3011,37 @@ msgid "" "unsupported format specifiers." msgstr "" -#: ../../library/datetime.rst:2482 +#: ../../library/datetime.rst:2486 msgid "``%G``, ``%u`` and ``%V`` were added." msgstr "新增 ``%G``\\ 、\\ ``%u`` 與 ``%V``\\ 。" -#: ../../library/datetime.rst:2485 +#: ../../library/datetime.rst:2489 msgid "``%:z`` was added." msgstr "" -#: ../../library/datetime.rst:2489 +#: ../../library/datetime.rst:2493 msgid "Technical Detail" msgstr "技術細節" -#: ../../library/datetime.rst:2491 +#: ../../library/datetime.rst:2495 msgid "" "Broadly speaking, ``d.strftime(fmt)`` acts like the :mod:`time` module's " "``time.strftime(fmt, d.timetuple())`` although not all objects support a :" "meth:`timetuple` method." msgstr "" -#: ../../library/datetime.rst:2495 +#: ../../library/datetime.rst:2499 msgid "" "For the :meth:`datetime.strptime` class method, the default value is " "``1900-01-01T00:00:00.000``: any components not specified in the format " "string will be pulled from the default value. [#]_" msgstr "" -#: ../../library/datetime.rst:2499 +#: ../../library/datetime.rst:2503 msgid "Using ``datetime.strptime(date_string, format)`` is equivalent to::" msgstr "" -#: ../../library/datetime.rst:2503 +#: ../../library/datetime.rst:2507 msgid "" "except when the format includes sub-second components or timezone offset " "information, which are supported in ``datetime.strptime`` but are discarded " @@ -3039,7 +3049,7 @@ msgid "" msgstr "" # format code 在這份文件第一次出現的地方是 ../../library/datetime.rst:739,應該要改成在那邊註記 (format code) -#: ../../library/datetime.rst:2507 +#: ../../library/datetime.rst:2511 #, fuzzy msgid "" "For :class:`.time` objects, the format codes for year, month, and day should " @@ -3051,7 +3061,7 @@ msgstr "" "為 :class:`time` 物件並沒有這些值。如果使用這些格式碼,年份會以 ``1900`` 代" "替、月及日會以 ``1`` 代替。" -#: ../../library/datetime.rst:2511 +#: ../../library/datetime.rst:2515 msgid "" "For :class:`date` objects, the format codes for hours, minutes, seconds, and " "microseconds should not be used, as :class:`date` objects have no such " @@ -3060,7 +3070,7 @@ msgstr "" "對 :class:`.date` 物件來說,不應該使用時、分、秒、微秒的格式碼,因為 :class:" "`date` 物件並沒有這些值。如果使用這些格式碼,這些值都會以 ``0`` 代替。" -#: ../../library/datetime.rst:2515 +#: ../../library/datetime.rst:2519 msgid "" "For the same reason, handling of format strings containing Unicode code " "points that can't be represented in the charset of the current locale is " @@ -3069,7 +3079,7 @@ msgid "" "`UnicodeError` or return an empty string instead." msgstr "" -#: ../../library/datetime.rst:2524 +#: ../../library/datetime.rst:2528 msgid "" "Because the format depends on the current locale, care should be taken when " "making assumptions about the output value. Field orderings will vary (for " @@ -3077,37 +3087,37 @@ msgid "" "contain non-ASCII characters." msgstr "" -#: ../../library/datetime.rst:2530 +#: ../../library/datetime.rst:2534 msgid "" "The :meth:`strptime` method can parse years in the full [1, 9999] range, but " "years < 1000 must be zero-filled to 4-digit width." msgstr "" -#: ../../library/datetime.rst:2533 +#: ../../library/datetime.rst:2537 msgid "" "In previous versions, :meth:`strftime` method was restricted to years >= " "1900." msgstr "" -#: ../../library/datetime.rst:2537 +#: ../../library/datetime.rst:2541 msgid "" "In version 3.2, :meth:`strftime` method was restricted to years >= 1000." msgstr "" -#: ../../library/datetime.rst:2542 +#: ../../library/datetime.rst:2546 msgid "" "When used with the :meth:`strptime` method, the ``%p`` directive only " "affects the output hour field if the ``%I`` directive is used to parse the " "hour." msgstr "" -#: ../../library/datetime.rst:2546 +#: ../../library/datetime.rst:2550 msgid "" "Unlike the :mod:`time` module, the :mod:`datetime` module does not support " "leap seconds." msgstr "" -#: ../../library/datetime.rst:2550 +#: ../../library/datetime.rst:2554 msgid "" "When used with the :meth:`strptime` method, the ``%f`` directive accepts " "from one to six digits and zero pads on the right. ``%f`` is an extension to " @@ -3115,17 +3125,17 @@ msgid "" "in datetime objects, and therefore always available)." msgstr "" -#: ../../library/datetime.rst:2557 +#: ../../library/datetime.rst:2561 msgid "" "For a naive object, the ``%z``, ``%:z`` and ``%Z`` format codes are replaced " "by empty strings." msgstr "" -#: ../../library/datetime.rst:2560 +#: ../../library/datetime.rst:2564 msgid "For an aware object:" msgstr "" -#: ../../library/datetime.rst:2563 +#: ../../library/datetime.rst:2567 msgid "" ":meth:`utcoffset` is transformed into a string of the form ``±HHMM[SS[." "ffffff]]``, where ``HH`` is a 2-digit string giving the number of UTC offset " @@ -3139,7 +3149,7 @@ msgid "" "``'-0330'``." msgstr "" -#: ../../library/datetime.rst:2577 +#: ../../library/datetime.rst:2581 msgid "" "When the ``%z`` directive is provided to the :meth:`strptime` method, the " "UTC offsets can have a colon as a separator between hours, minutes and " @@ -3147,53 +3157,53 @@ msgid "" "hour. In addition, providing ``'Z'`` is identical to ``'+00:00'``." msgstr "" -#: ../../library/datetime.rst:2585 +#: ../../library/datetime.rst:2589 msgid "" "Behaves exactly as ``%z``, but has a colon separator added between hours, " "minutes and seconds." msgstr "" -#: ../../library/datetime.rst:2589 +#: ../../library/datetime.rst:2593 msgid "" "In :meth:`strftime`, ``%Z`` is replaced by an empty string if :meth:`tzname` " "returns ``None``; otherwise ``%Z`` is replaced by the returned value, which " "must be a string." msgstr "" -#: ../../library/datetime.rst:2593 +#: ../../library/datetime.rst:2597 msgid ":meth:`strptime` only accepts certain values for ``%Z``:" msgstr "" -#: ../../library/datetime.rst:2595 +#: ../../library/datetime.rst:2599 msgid "any value in ``time.tzname`` for your machine's locale" msgstr "" -#: ../../library/datetime.rst:2596 +#: ../../library/datetime.rst:2600 msgid "the hard-coded values ``UTC`` and ``GMT``" msgstr "" -#: ../../library/datetime.rst:2598 +#: ../../library/datetime.rst:2602 msgid "" "So someone living in Japan may have ``JST``, ``UTC``, and ``GMT`` as valid " "values, but probably not ``EST``. It will raise ``ValueError`` for invalid " "values." msgstr "" -#: ../../library/datetime.rst:2602 +#: ../../library/datetime.rst:2606 msgid "" "When the ``%z`` directive is provided to the :meth:`strptime` method, an " "aware :class:`.datetime` object will be produced. The ``tzinfo`` of the " "result will be set to a :class:`timezone` instance." msgstr "" -#: ../../library/datetime.rst:2608 +#: ../../library/datetime.rst:2612 msgid "" "When used with the :meth:`strptime` method, ``%U`` and ``%W`` are only used " "in calculations when the day of the week and the calendar year (``%Y``) are " "specified." msgstr "" -#: ../../library/datetime.rst:2613 +#: ../../library/datetime.rst:2617 msgid "" "Similar to ``%U`` and ``%W``, ``%V`` is only used in calculations when the " "day of the week and the ISO year (``%G``) are specified in a :meth:" @@ -3201,22 +3211,22 @@ msgid "" "interchangeable." msgstr "" -#: ../../library/datetime.rst:2619 +#: ../../library/datetime.rst:2623 msgid "" "When used with the :meth:`strptime` method, the leading zero is optional " "for formats ``%d``, ``%m``, ``%H``, ``%I``, ``%M``, ``%S``, ``%j``, ``%U``, " "``%W``, and ``%V``. Format ``%y`` does require a leading zero." msgstr "" -#: ../../library/datetime.rst:2624 +#: ../../library/datetime.rst:2628 msgid "Footnotes" msgstr "註解" -#: ../../library/datetime.rst:2625 +#: ../../library/datetime.rst:2629 msgid "If, that is, we ignore the effects of Relativity" msgstr "也就是說,我們會忽略相對論的效應" -#: ../../library/datetime.rst:2627 +#: ../../library/datetime.rst:2631 msgid "" "This matches the definition of the \"proleptic Gregorian\" calendar in " "Dershowitz and Reingold's book *Calendrical Calculations*, where it's the " @@ -3225,23 +3235,23 @@ msgid "" "systems." msgstr "" -#: ../../library/datetime.rst:2633 +#: ../../library/datetime.rst:2637 msgid "" "See R. H. van Gent's `guide to the mathematics of the ISO 8601 calendar " "`_ for a good explanation." msgstr "" -#: ../../library/datetime.rst:2637 +#: ../../library/datetime.rst:2641 msgid "" "Passing ``datetime.strptime('Feb 29', '%b %d')`` will fail since ``1900`` is " "not a leap year." msgstr "" -#: ../../library/datetime.rst:2297 +#: ../../library/datetime.rst:2301 msgid "% (percent)" msgstr "% (百分號)" -#: ../../library/datetime.rst:2297 +#: ../../library/datetime.rst:2301 msgid "datetime format" msgstr "datetime format(日期時間格式)" diff --git a/library/dis.po b/library/dis.po index a3c151150f..a8f051c8cc 100644 --- a/library/dis.po +++ b/library/dis.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-31 00:03+0000\n" +"POT-Creation-Date: 2023-08-28 00:04+0000\n" "PO-Revision-Date: 2018-07-27 16:55+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -69,13 +69,13 @@ msgid "" msgstr "" #: ../../library/dis.rst:46 -msgid "Example: Given the function :func:`myfunc`::" +msgid "Example: Given the function :func:`!myfunc`::" msgstr "" #: ../../library/dis.rst:51 msgid "" -"the following command can be used to display the disassembly of :func:" -"`myfunc`:" +"the following command can be used to display the disassembly of :func:`!" +"myfunc`:" msgstr "" #: ../../library/dis.rst:64 @@ -556,9 +556,9 @@ msgstr "" #: ../../library/dis.rst:546 ../../library/dis.rst:554 #: ../../library/dis.rst:566 ../../library/dis.rst:654 #: ../../library/dis.rst:664 ../../library/dis.rst:674 -#: ../../library/dis.rst:894 ../../library/dis.rst:904 -#: ../../library/dis.rst:1003 ../../library/dis.rst:1015 -#: ../../library/dis.rst:1027 +#: ../../library/dis.rst:894 ../../library/dis.rst:905 +#: ../../library/dis.rst:1005 ../../library/dis.rst:1017 +#: ../../library/dis.rst:1029 msgid "Implements::" msgstr "" @@ -756,7 +756,7 @@ msgstr "" #: ../../library/dis.rst:796 msgid "" -"Pushes :func:`builtins.__build_class__` onto the stack. It is later called " +"Pushes :func:`!builtins.__build_class__` onto the stack. It is later called " "to construct a class." msgstr "" @@ -797,7 +797,7 @@ msgid "" "class:`tuple` containing the corresponding values. Otherwise, push ``None``." msgstr "" -#: ../../library/dis.rst:846 ../../library/dis.rst:1465 +#: ../../library/dis.rst:846 ../../library/dis.rst:1467 msgid "" "Previously, this instruction also pushed a boolean value indicating success " "(``True``) or failure (``False``)." @@ -806,14 +806,15 @@ msgstr "" #: ../../library/dis.rst:853 msgid "" "Implements ``name = STACK.pop()``. *namei* is the index of *name* in the " -"attribute :attr:`co_names` of the code object. The compiler tries to use :" -"opcode:`STORE_FAST` or :opcode:`STORE_GLOBAL` if possible." +"attribute :attr:`!co_names` of the :ref:`code object `. The " +"compiler tries to use :opcode:`STORE_FAST` or :opcode:`STORE_GLOBAL` if " +"possible." msgstr "" #: ../../library/dis.rst:860 msgid "" -"Implements ``del name``, where *namei* is the index into :attr:`co_names` " -"attribute of the code object." +"Implements ``del name``, where *namei* is the index into :attr:`!co_names` " +"attribute of the :ref:`code object `." msgstr "" #: ../../library/dis.rst:866 @@ -850,39 +851,43 @@ msgid "" msgstr "" #: ../../library/dis.rst:900 -msgid "where *namei* is the index of name in :attr:`co_names`." +msgid "" +"where *namei* is the index of name in :attr:`!co_names` of the :ref:`code " +"object `." msgstr "" -#: ../../library/dis.rst:909 -msgid "where *namei* is the index of name into :attr:`co_names`." +#: ../../library/dis.rst:910 +msgid "" +"where *namei* is the index of name into :attr:`!co_names` of the :ref:`code " +"object `." msgstr "" -#: ../../library/dis.rst:914 +#: ../../library/dis.rst:916 msgid "Works as :opcode:`STORE_NAME`, but stores the name as a global." msgstr "" -#: ../../library/dis.rst:919 +#: ../../library/dis.rst:921 msgid "Works as :opcode:`DELETE_NAME`, but deletes a global name." msgstr "" -#: ../../library/dis.rst:924 +#: ../../library/dis.rst:926 msgid "Pushes ``co_consts[consti]`` onto the stack." msgstr "" -#: ../../library/dis.rst:929 +#: ../../library/dis.rst:931 msgid "" "Pushes the value associated with ``co_names[namei]`` onto the stack. The " "name is looked up within the locals, then the globals, then the builtins." msgstr "" -#: ../../library/dis.rst:935 +#: ../../library/dis.rst:937 msgid "" "Pushes a reference to the locals dictionary onto the stack. This is used to " "prepare namespace dictionaries for :opcode:`LOAD_FROM_DICT_OR_DEREF` and :" "opcode:`LOAD_FROM_DICT_OR_GLOBALS`." msgstr "" -#: ../../library/dis.rst:944 +#: ../../library/dis.rst:946 msgid "" "Pops a mapping off the stack and looks up the value for ``co_names[namei]``. " "If the name is not found there, looks it up in the globals and then the " @@ -891,69 +896,69 @@ msgid "" "bodies." msgstr "" -#: ../../library/dis.rst:955 +#: ../../library/dis.rst:957 msgid "" "Creates a tuple consuming *count* items from the stack, and pushes the " "resulting tuple onto the stack.::" msgstr "" -#: ../../library/dis.rst:965 +#: ../../library/dis.rst:967 msgid "Works as :opcode:`BUILD_TUPLE`, but creates a list." msgstr "" -#: ../../library/dis.rst:970 +#: ../../library/dis.rst:972 msgid "Works as :opcode:`BUILD_TUPLE`, but creates a set." msgstr "" -#: ../../library/dis.rst:975 +#: ../../library/dis.rst:977 msgid "" "Pushes a new dictionary object onto the stack. Pops ``2 * count`` items so " "that the dictionary holds *count* entries: ``{..., STACK[-4]: STACK[-3], " "STACK[-2]: STACK[-1]}``." msgstr "" -#: ../../library/dis.rst:979 +#: ../../library/dis.rst:981 msgid "" "The dictionary is created from stack items instead of creating an empty " "dictionary pre-sized to hold *count* items." msgstr "" -#: ../../library/dis.rst:986 +#: ../../library/dis.rst:988 msgid "" "The version of :opcode:`BUILD_MAP` specialized for constant keys. Pops the " "top element on the stack which contains a tuple of keys, then starting from " "``STACK[-2]``, pops *count* values to form values in the built dictionary." msgstr "" -#: ../../library/dis.rst:995 +#: ../../library/dis.rst:997 msgid "" "Concatenates *count* strings from the stack and pushes the resulting string " "onto the stack." msgstr "" -#: ../../library/dis.rst:1008 +#: ../../library/dis.rst:1010 msgid "Used to build lists." msgstr "" -#: ../../library/dis.rst:1020 +#: ../../library/dis.rst:1022 msgid "Used to build sets." msgstr "" -#: ../../library/dis.rst:1032 +#: ../../library/dis.rst:1034 msgid "Used to build dicts." msgstr "" -#: ../../library/dis.rst:1039 +#: ../../library/dis.rst:1041 msgid "Like :opcode:`DICT_UPDATE` but raises an exception for duplicate keys." msgstr "" -#: ../../library/dis.rst:1046 +#: ../../library/dis.rst:1048 msgid "" "If the low bit of ``namei`` is not set, this replaces ``STACK[-1]`` with " "``getattr(STACK[-1], co_names[namei>>1])``." msgstr "" -#: ../../library/dis.rst:1049 +#: ../../library/dis.rst:1051 msgid "" "If the low bit of ``namei`` is set, this will attempt to load a method named " "``co_names[namei>>1]`` from the ``STACK[-1]`` object. ``STACK[-1]`` is " @@ -964,13 +969,13 @@ msgid "" "the object returned by the attribute lookup are pushed." msgstr "" -#: ../../library/dis.rst:1057 +#: ../../library/dis.rst:1059 msgid "" "If the low bit of ``namei`` is set, then a ``NULL`` or ``self`` is pushed to " "the stack before the attribute or unbound method respectively." msgstr "" -#: ../../library/dis.rst:1064 +#: ../../library/dis.rst:1066 msgid "" "This opcode implements :func:`super` (e.g. ``super().method()`` and " "``super().attr``). It works the same as :opcode:`LOAD_ATTR`, except that " @@ -980,33 +985,33 @@ msgid "" "class within which the current method was defined), and the global ``super``." msgstr "" -#: ../../library/dis.rst:1071 +#: ../../library/dis.rst:1073 msgid "" "The low bit of ``namei`` signals to attempt a method load, as with :opcode:" "`LOAD_ATTR`." msgstr "" -#: ../../library/dis.rst:1074 +#: ../../library/dis.rst:1076 msgid "" "The second-low bit of ``namei``, if set, means that this was a two-argument " "call to :func:`super` (unset means zero-argument)." msgstr "" -#: ../../library/dis.rst:1082 +#: ../../library/dis.rst:1084 msgid "" "Performs a Boolean operation. The operation name can be found in " "``cmp_op[opname]``." msgstr "" -#: ../../library/dis.rst:1088 +#: ../../library/dis.rst:1090 msgid "Performs ``is`` comparison, or ``is not`` if ``invert`` is 1." msgstr "" -#: ../../library/dis.rst:1095 +#: ../../library/dis.rst:1097 msgid "Performs ``in`` comparison, or ``not in`` if ``invert`` is 1." msgstr "" -#: ../../library/dis.rst:1102 +#: ../../library/dis.rst:1104 msgid "" "Imports the module ``co_names[namei]``. ``STACK[-1]`` and ``STACK[-2]`` are " "popped and provide the *fromlist* and *level* arguments of :func:" @@ -1015,68 +1020,68 @@ msgid "" "opcode:`STORE_FAST` instruction modifies the namespace." msgstr "" -#: ../../library/dis.rst:1110 +#: ../../library/dis.rst:1112 msgid "" "Loads the attribute ``co_names[namei]`` from the module found in " "``STACK[-1]``. The resulting object is pushed onto the stack, to be " "subsequently stored by a :opcode:`STORE_FAST` instruction." msgstr "" -#: ../../library/dis.rst:1117 +#: ../../library/dis.rst:1119 msgid "Increments bytecode counter by *delta*." msgstr "" -#: ../../library/dis.rst:1122 +#: ../../library/dis.rst:1124 msgid "Decrements bytecode counter by *delta*. Checks for interrupts." msgstr "" -#: ../../library/dis.rst:1129 +#: ../../library/dis.rst:1131 msgid "Decrements bytecode counter by *delta*. Does not check for interrupts." msgstr "" -#: ../../library/dis.rst:1136 +#: ../../library/dis.rst:1138 msgid "" "If ``STACK[-1]`` is true, increments the bytecode counter by *delta*. " "``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1139 ../../library/dis.rst:1152 +#: ../../library/dis.rst:1141 ../../library/dis.rst:1154 msgid "" "The oparg is now a relative delta rather than an absolute target. This " "opcode is a pseudo-instruction, replaced in final bytecode by the directed " "versions (forward/backward)." msgstr "" -#: ../../library/dis.rst:1144 ../../library/dis.rst:1157 -#: ../../library/dis.rst:1170 ../../library/dis.rst:1184 +#: ../../library/dis.rst:1146 ../../library/dis.rst:1159 +#: ../../library/dis.rst:1172 ../../library/dis.rst:1186 msgid "This is no longer a pseudo-instruction." msgstr "" -#: ../../library/dis.rst:1149 +#: ../../library/dis.rst:1151 msgid "" "If ``STACK[-1]`` is false, increments the bytecode counter by *delta*. " "``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1162 +#: ../../library/dis.rst:1164 msgid "" "If ``STACK[-1]`` is not ``None``, increments the bytecode counter by " "*delta*. ``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1165 ../../library/dis.rst:1179 +#: ../../library/dis.rst:1167 ../../library/dis.rst:1181 msgid "" "This opcode is a pseudo-instruction, replaced in final bytecode by the " "directed versions (forward/backward)." msgstr "" -#: ../../library/dis.rst:1176 +#: ../../library/dis.rst:1178 msgid "" "If ``STACK[-1]`` is ``None``, increments the bytecode counter by *delta*. " "``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1189 +#: ../../library/dis.rst:1191 msgid "" "``STACK[-1]`` is an :term:`iterator`. Call its :meth:`~iterator.__next__` " "method. If this yields a new value, push it on the stack (leaving the " @@ -1084,83 +1089,83 @@ msgid "" "code counter is incremented by *delta*." msgstr "" -#: ../../library/dis.rst:1194 +#: ../../library/dis.rst:1196 msgid "Up until 3.11 the iterator was popped when it was exhausted." msgstr "" -#: ../../library/dis.rst:1199 +#: ../../library/dis.rst:1201 msgid "Loads the global named ``co_names[namei>>1]`` onto the stack." msgstr "" -#: ../../library/dis.rst:1201 +#: ../../library/dis.rst:1203 msgid "" "If the low bit of ``namei`` is set, then a ``NULL`` is pushed to the stack " "before the global variable." msgstr "" -#: ../../library/dis.rst:1207 +#: ../../library/dis.rst:1209 msgid "" "Pushes a reference to the local ``co_varnames[var_num]`` onto the stack." msgstr "" -#: ../../library/dis.rst:1209 +#: ../../library/dis.rst:1211 msgid "" "This opcode is now only used in situations where the local variable is " "guaranteed to be initialized. It cannot raise :exc:`UnboundLocalError`." msgstr "" -#: ../../library/dis.rst:1215 +#: ../../library/dis.rst:1217 msgid "" "Pushes a reference to the local ``co_varnames[var_num]`` onto the stack, " "raising an :exc:`UnboundLocalError` if the local variable has not been " "initialized." msgstr "" -#: ../../library/dis.rst:1223 +#: ../../library/dis.rst:1225 msgid "" "Pushes a reference to the local ``co_varnames[var_num]`` onto the stack (or " "pushes ``NULL`` onto the stack if the local variable has not been " "initialized) and sets ``co_varnames[var_num]`` to ``NULL``." msgstr "" -#: ../../library/dis.rst:1231 +#: ../../library/dis.rst:1233 msgid "Stores ``STACK.pop()`` into the local ``co_varnames[var_num]``." msgstr "" -#: ../../library/dis.rst:1236 +#: ../../library/dis.rst:1238 msgid "Deletes local ``co_varnames[var_num]``." msgstr "" -#: ../../library/dis.rst:1241 +#: ../../library/dis.rst:1243 msgid "" "Creates a new cell in slot ``i``. If that slot is nonempty then that value " "is stored into the new cell." msgstr "" -#: ../../library/dis.rst:1249 +#: ../../library/dis.rst:1251 msgid "" "Pushes a reference to the cell contained in slot ``i`` of the \"fast " "locals\" storage. The name of the variable is ``co_fastlocalnames[i]``." msgstr "" -#: ../../library/dis.rst:1252 +#: ../../library/dis.rst:1254 msgid "" "Note that ``LOAD_CLOSURE`` is effectively an alias for ``LOAD_FAST``. It " "exists to keep bytecode a little more readable." msgstr "" -#: ../../library/dis.rst:1255 ../../library/dis.rst:1264 -#: ../../library/dis.rst:1286 ../../library/dis.rst:1297 +#: ../../library/dis.rst:1257 ../../library/dis.rst:1266 +#: ../../library/dis.rst:1288 ../../library/dis.rst:1299 msgid "``i`` is no longer offset by the length of ``co_varnames``." msgstr "" -#: ../../library/dis.rst:1261 +#: ../../library/dis.rst:1263 msgid "" "Loads the cell contained in slot ``i`` of the \"fast locals\" storage. " "Pushes a reference to the object the cell contains on the stack." msgstr "" -#: ../../library/dis.rst:1270 +#: ../../library/dis.rst:1272 msgid "" "Pops a mapping off the stack and looks up the name associated with slot " "``i`` of the \"fast locals\" storage in this mapping. If the name is not " @@ -1170,94 +1175,94 @@ msgid "" "scopes ` within class bodies." msgstr "" -#: ../../library/dis.rst:1283 +#: ../../library/dis.rst:1285 msgid "" "Stores ``STACK.pop()`` into the cell contained in slot ``i`` of the \"fast " "locals\" storage." msgstr "" -#: ../../library/dis.rst:1292 +#: ../../library/dis.rst:1294 msgid "" "Empties the cell contained in slot ``i`` of the \"fast locals\" storage. " "Used by the :keyword:`del` statement." msgstr "" -#: ../../library/dis.rst:1303 +#: ../../library/dis.rst:1305 msgid "" "Copies the ``n`` free variables from the closure into the frame. Removes the " "need for special code on the caller's side when calling closures." msgstr "" -#: ../../library/dis.rst:1312 +#: ../../library/dis.rst:1314 msgid "" "Raises an exception using one of the 3 forms of the ``raise`` statement, " "depending on the value of *argc*:" msgstr "" -#: ../../library/dis.rst:1315 +#: ../../library/dis.rst:1317 msgid "0: ``raise`` (re-raise previous exception)" msgstr "" -#: ../../library/dis.rst:1316 +#: ../../library/dis.rst:1318 msgid "" "1: ``raise STACK[-1]`` (raise exception instance or type at ``STACK[-1]``)" msgstr "" -#: ../../library/dis.rst:1317 +#: ../../library/dis.rst:1319 msgid "" "2: ``raise STACK[-2] from STACK[-1]`` (raise exception instance or type at " "``STACK[-2]`` with ``__cause__`` set to ``STACK[-1]``)" msgstr "" -#: ../../library/dis.rst:1323 +#: ../../library/dis.rst:1325 msgid "" "Calls a callable object with the number of arguments specified by ``argc``, " "including the named arguments specified by the preceding :opcode:`KW_NAMES`, " "if any. On the stack are (in ascending order), either:" msgstr "" -#: ../../library/dis.rst:1328 +#: ../../library/dis.rst:1330 msgid "NULL" msgstr "" -#: ../../library/dis.rst:1329 ../../library/dis.rst:1335 +#: ../../library/dis.rst:1331 ../../library/dis.rst:1337 msgid "The callable" msgstr "" -#: ../../library/dis.rst:1330 +#: ../../library/dis.rst:1332 msgid "The positional arguments" msgstr "" -#: ../../library/dis.rst:1331 ../../library/dis.rst:1338 +#: ../../library/dis.rst:1333 ../../library/dis.rst:1340 msgid "The named arguments" msgstr "" -#: ../../library/dis.rst:1333 +#: ../../library/dis.rst:1335 msgid "or:" msgstr "或:" -#: ../../library/dis.rst:1336 +#: ../../library/dis.rst:1338 msgid "``self``" msgstr "``self``" -#: ../../library/dis.rst:1337 +#: ../../library/dis.rst:1339 msgid "The remaining positional arguments" msgstr "" -#: ../../library/dis.rst:1340 +#: ../../library/dis.rst:1342 msgid "" "``argc`` is the total of the positional and named arguments, excluding " "``self`` when a ``NULL`` is not present." msgstr "" -#: ../../library/dis.rst:1343 +#: ../../library/dis.rst:1345 msgid "" "``CALL`` pops all arguments and the callable object off the stack, calls the " "callable object with those arguments, and pushes the return value returned " "by the callable object." msgstr "" -#: ../../library/dis.rst:1352 +#: ../../library/dis.rst:1354 msgid "" "Calls a callable object with variable set of positional and keyword " "arguments. If the lowest bit of *flags* is set, the top of the stack " @@ -1269,70 +1274,70 @@ msgid "" "arguments, and pushes the return value returned by the callable object." msgstr "" -#: ../../library/dis.rst:1367 +#: ../../library/dis.rst:1369 msgid "" "Pushes a ``NULL`` to the stack. Used in the call sequence to match the " "``NULL`` pushed by :opcode:`LOAD_METHOD` for non-method calls." msgstr "" -#: ../../library/dis.rst:1376 +#: ../../library/dis.rst:1378 msgid "" "Prefixes :opcode:`CALL`. Stores a reference to ``co_consts[consti]`` into an " "internal variable for use by :opcode:`CALL`. ``co_consts[consti]`` must be a " "tuple of strings." msgstr "" -#: ../../library/dis.rst:1385 +#: ../../library/dis.rst:1387 msgid "" "Pushes a new function object on the stack. From bottom to top, the consumed " "stack must consist of values if the argument carries a specified flag value" msgstr "" -#: ../../library/dis.rst:1388 +#: ../../library/dis.rst:1390 msgid "" "``0x01`` a tuple of default values for positional-only and positional-or-" "keyword parameters in positional order" msgstr "" -#: ../../library/dis.rst:1390 +#: ../../library/dis.rst:1392 msgid "``0x02`` a dictionary of keyword-only parameters' default values" msgstr "" -#: ../../library/dis.rst:1391 +#: ../../library/dis.rst:1393 msgid "``0x04`` a tuple of strings containing parameters' annotations" msgstr "" -#: ../../library/dis.rst:1392 +#: ../../library/dis.rst:1394 msgid "``0x08`` a tuple containing cells for free variables, making a closure" msgstr "" -#: ../../library/dis.rst:1393 +#: ../../library/dis.rst:1395 msgid "the code associated with the function (at ``STACK[-1]``)" msgstr "" -#: ../../library/dis.rst:1395 +#: ../../library/dis.rst:1397 msgid "Flag value ``0x04`` is a tuple of strings instead of dictionary" msgstr "" -#: ../../library/dis.rst:1398 +#: ../../library/dis.rst:1400 msgid "Qualified name at ``STACK[-1]`` was removed." msgstr "" -#: ../../library/dis.rst:1406 +#: ../../library/dis.rst:1408 msgid "" "Pushes a slice object on the stack. *argc* must be 2 or 3. If it is 2, " "implements::" msgstr "" -#: ../../library/dis.rst:1412 +#: ../../library/dis.rst:1414 msgid "if it is 3, implements::" msgstr "" -#: ../../library/dis.rst:1419 +#: ../../library/dis.rst:1421 msgid "See the :func:`slice` built-in function for more information." msgstr "" -#: ../../library/dis.rst:1424 +#: ../../library/dis.rst:1426 msgid "" "Prefixes any opcode which has an argument too big to fit into the default " "one byte. *ext* holds an additional byte which act as higher bits in the " @@ -1340,54 +1345,54 @@ msgid "" "allowed, forming an argument from two-byte to four-byte." msgstr "" -#: ../../library/dis.rst:1432 +#: ../../library/dis.rst:1434 msgid "" "Used for implementing formatted literal strings (f-strings). Pops an " "optional *fmt_spec* from the stack, then a required *value*. *flags* is " "interpreted as follows:" msgstr "" -#: ../../library/dis.rst:1436 +#: ../../library/dis.rst:1438 msgid "``(flags & 0x03) == 0x00``: *value* is formatted as-is." msgstr "" -#: ../../library/dis.rst:1437 +#: ../../library/dis.rst:1439 msgid "" "``(flags & 0x03) == 0x01``: call :func:`str` on *value* before formatting it." msgstr "" -#: ../../library/dis.rst:1439 +#: ../../library/dis.rst:1441 msgid "" "``(flags & 0x03) == 0x02``: call :func:`repr` on *value* before formatting " "it." msgstr "" -#: ../../library/dis.rst:1441 +#: ../../library/dis.rst:1443 msgid "" "``(flags & 0x03) == 0x03``: call :func:`ascii` on *value* before formatting " "it." msgstr "" -#: ../../library/dis.rst:1443 +#: ../../library/dis.rst:1445 msgid "" "``(flags & 0x04) == 0x04``: pop *fmt_spec* from the stack and use it, else " "use an empty *fmt_spec*." msgstr "" -#: ../../library/dis.rst:1446 +#: ../../library/dis.rst:1448 msgid "" "Formatting is performed using :c:func:`PyObject_Format`. The result is " "pushed on the stack." msgstr "" -#: ../../library/dis.rst:1454 +#: ../../library/dis.rst:1456 msgid "" "``STACK[-1]`` is a tuple of keyword attribute names, ``STACK[-2]`` is the " "class being matched against, and ``STACK[-3]`` is the match subject. " "*count* is the number of positional sub-patterns." msgstr "" -#: ../../library/dis.rst:1458 +#: ../../library/dis.rst:1460 msgid "" "Pop ``STACK[-1]``, ``STACK[-2]``, and ``STACK[-3]``. If ``STACK[-3]`` is an " "instance of ``STACK[-2]`` and has the positional and keyword attributes " @@ -1395,258 +1400,258 @@ msgid "" "Otherwise, push ``None``." msgstr "" -#: ../../library/dis.rst:1472 +#: ../../library/dis.rst:1474 msgid "A no-op. Performs internal tracing, debugging and optimization checks." msgstr "" -#: ../../library/dis.rst:1474 +#: ../../library/dis.rst:1476 msgid "The ``where`` operand marks where the ``RESUME`` occurs:" msgstr "" -#: ../../library/dis.rst:1476 +#: ../../library/dis.rst:1478 msgid "" "``0`` The start of a function, which is neither a generator, coroutine nor " "an async generator" msgstr "" -#: ../../library/dis.rst:1478 +#: ../../library/dis.rst:1480 msgid "``1`` After a ``yield`` expression" msgstr "" -#: ../../library/dis.rst:1479 +#: ../../library/dis.rst:1481 msgid "``2`` After a ``yield from`` expression" msgstr "" -#: ../../library/dis.rst:1480 +#: ../../library/dis.rst:1482 msgid "``3`` After an ``await`` expression" msgstr "" -#: ../../library/dis.rst:1487 +#: ../../library/dis.rst:1489 msgid "" "Create a generator, coroutine, or async generator from the current frame. " "Used as first opcode of in code object for the above mentioned callables. " "Clear the current frame and return the newly created generator." msgstr "" -#: ../../library/dis.rst:1496 +#: ../../library/dis.rst:1498 msgid "" "Equivalent to ``STACK[-1] = STACK[-2].send(STACK[-1])``. Used in ``yield " "from`` and ``await`` statements." msgstr "" -#: ../../library/dis.rst:1499 +#: ../../library/dis.rst:1501 msgid "" "If the call raises :exc:`StopIteration`, pop both items, push the " "exception's ``value`` attribute, and increment the bytecode counter by " "*delta*." msgstr "" -#: ../../library/dis.rst:1508 +#: ../../library/dis.rst:1510 msgid "" "This is not really an opcode. It identifies the dividing line between " "opcodes in the range [0,255] which don't use their argument and those that " "do (``< HAVE_ARGUMENT`` and ``>= HAVE_ARGUMENT``, respectively)." msgstr "" -#: ../../library/dis.rst:1512 +#: ../../library/dis.rst:1514 msgid "" "If your application uses pseudo instructions, use the :data:`hasarg` " "collection instead." msgstr "" -#: ../../library/dis.rst:1515 +#: ../../library/dis.rst:1517 msgid "" "Now every instruction has an argument, but opcodes ``< HAVE_ARGUMENT`` " "ignore it. Before, only opcodes ``>= HAVE_ARGUMENT`` had an argument." msgstr "" -#: ../../library/dis.rst:1519 +#: ../../library/dis.rst:1521 msgid "" "Pseudo instructions were added to the :mod:`dis` module, and for them it is " "not true that comparison with ``HAVE_ARGUMENT`` indicates whether they use " "their arg." msgstr "" -#: ../../library/dis.rst:1527 +#: ../../library/dis.rst:1529 msgid "" "Calls an intrinsic function with one argument. Passes ``STACK[-1]`` as the " "argument and sets ``STACK[-1]`` to the result. Used to implement " "functionality that is necessary but not performance critical." msgstr "" -#: ../../library/dis.rst:1531 ../../library/dis.rst:1581 +#: ../../library/dis.rst:1533 ../../library/dis.rst:1583 msgid "The operand determines which intrinsic function is called:" msgstr "" -#: ../../library/dis.rst:1534 ../../library/dis.rst:1584 +#: ../../library/dis.rst:1536 ../../library/dis.rst:1586 msgid "Operand" msgstr "" -#: ../../library/dis.rst:1534 ../../library/dis.rst:1584 +#: ../../library/dis.rst:1536 ../../library/dis.rst:1586 msgid "Description" msgstr "" -#: ../../library/dis.rst:1536 +#: ../../library/dis.rst:1538 msgid "``INTRINSIC_1_INVALID``" msgstr "``INTRINSIC_1_INVALID``" -#: ../../library/dis.rst:1536 ../../library/dis.rst:1586 +#: ../../library/dis.rst:1538 ../../library/dis.rst:1588 msgid "Not valid" msgstr "" -#: ../../library/dis.rst:1538 +#: ../../library/dis.rst:1540 msgid "``INTRINSIC_PRINT``" msgstr "``INTRINSIC_PRINT``" -#: ../../library/dis.rst:1538 +#: ../../library/dis.rst:1540 msgid "Prints the argument to standard out. Used in the REPL." msgstr "" -#: ../../library/dis.rst:1541 +#: ../../library/dis.rst:1543 msgid "``INTRINSIC_IMPORT_STAR``" msgstr "``INTRINSIC_IMPORT_STAR``" -#: ../../library/dis.rst:1541 +#: ../../library/dis.rst:1543 msgid "Performs ``import *`` for the named module." msgstr "" -#: ../../library/dis.rst:1544 +#: ../../library/dis.rst:1546 msgid "``INTRINSIC_STOPITERATION_ERROR``" msgstr "``INTRINSIC_STOPITERATION_ERROR``" -#: ../../library/dis.rst:1544 +#: ../../library/dis.rst:1546 msgid "Extracts the return value from a ``StopIteration`` exception." msgstr "" -#: ../../library/dis.rst:1547 +#: ../../library/dis.rst:1549 msgid "``INTRINSIC_ASYNC_GEN_WRAP``" msgstr "``INTRINSIC_ASYNC_GEN_WRAP``" -#: ../../library/dis.rst:1547 +#: ../../library/dis.rst:1549 msgid "Wraps an aync generator value" msgstr "" -#: ../../library/dis.rst:1549 +#: ../../library/dis.rst:1551 msgid "``INTRINSIC_UNARY_POSITIVE``" msgstr "``INTRINSIC_UNARY_POSITIVE``" -#: ../../library/dis.rst:1549 +#: ../../library/dis.rst:1551 msgid "Performs the unary ``+`` operation" msgstr "" -#: ../../library/dis.rst:1552 +#: ../../library/dis.rst:1554 msgid "``INTRINSIC_LIST_TO_TUPLE``" msgstr "``INTRINSIC_LIST_TO_TUPLE``" -#: ../../library/dis.rst:1552 +#: ../../library/dis.rst:1554 msgid "Converts a list to a tuple" msgstr "" -#: ../../library/dis.rst:1554 +#: ../../library/dis.rst:1556 msgid "``INTRINSIC_TYPEVAR``" msgstr "``INTRINSIC_TYPEVAR``" -#: ../../library/dis.rst:1554 +#: ../../library/dis.rst:1556 msgid "Creates a :class:`typing.TypeVar`" msgstr "" -#: ../../library/dis.rst:1556 +#: ../../library/dis.rst:1558 msgid "``INTRINSIC_PARAMSPEC``" msgstr "``INTRINSIC_PARAMSPEC``" -#: ../../library/dis.rst:1556 +#: ../../library/dis.rst:1558 msgid "Creates a :class:`typing.ParamSpec`" msgstr "" -#: ../../library/dis.rst:1559 +#: ../../library/dis.rst:1561 msgid "``INTRINSIC_TYPEVARTUPLE``" msgstr "``INTRINSIC_TYPEVARTUPLE``" -#: ../../library/dis.rst:1559 +#: ../../library/dis.rst:1561 msgid "Creates a :class:`typing.TypeVarTuple`" msgstr "" -#: ../../library/dis.rst:1562 +#: ../../library/dis.rst:1564 msgid "``INTRINSIC_SUBSCRIPT_GENERIC``" msgstr "``INTRINSIC_SUBSCRIPT_GENERIC``" -#: ../../library/dis.rst:1562 +#: ../../library/dis.rst:1564 msgid "Returns :class:`typing.Generic` subscripted with the argument" msgstr "" -#: ../../library/dis.rst:1565 +#: ../../library/dis.rst:1567 msgid "``INTRINSIC_TYPEALIAS``" msgstr "``INTRINSIC_TYPEALIAS``" -#: ../../library/dis.rst:1565 +#: ../../library/dis.rst:1567 msgid "" "Creates a :class:`typing.TypeAliasType`; used in the :keyword:`type` " "statement. The argument is a tuple of the type alias's name, type " "parameters, and value." msgstr "" -#: ../../library/dis.rst:1577 +#: ../../library/dis.rst:1579 msgid "" "Calls an intrinsic function with two arguments. Passes ``STACK[-2]``, " "``STACK[-1]`` as the arguments and sets ``STACK[-1]`` to the result. Used to " "implement functionality that is necessary but not performance critical." msgstr "" -#: ../../library/dis.rst:1586 +#: ../../library/dis.rst:1588 msgid "``INTRINSIC_2_INVALID``" msgstr "``INTRINSIC_2_INVALID``" -#: ../../library/dis.rst:1588 +#: ../../library/dis.rst:1590 msgid "``INTRINSIC_PREP_RERAISE_STAR``" msgstr "``INTRINSIC_PREP_RERAISE_STAR``" -#: ../../library/dis.rst:1588 +#: ../../library/dis.rst:1590 msgid "Calculates the :exc:`ExceptionGroup` to raise from a ``try-except*``." msgstr "" -#: ../../library/dis.rst:1592 +#: ../../library/dis.rst:1594 msgid "``INTRINSIC_TYPEVAR_WITH_BOUND``" msgstr "``INTRINSIC_TYPEVAR_WITH_BOUND``" -#: ../../library/dis.rst:1592 +#: ../../library/dis.rst:1594 msgid "Creates a :class:`typing.TypeVar` with a bound." msgstr "" -#: ../../library/dis.rst:1595 +#: ../../library/dis.rst:1597 msgid "``INTRINSIC_TYPEVAR_WITH_CONSTRAINTS``" msgstr "``INTRINSIC_TYPEVAR_WITH_CONSTRAINTS``" -#: ../../library/dis.rst:1595 +#: ../../library/dis.rst:1597 msgid "Creates a :class:`typing.TypeVar` with constraints." msgstr "" -#: ../../library/dis.rst:1599 +#: ../../library/dis.rst:1601 msgid "``INTRINSIC_SET_FUNCTION_TYPE_PARAMS``" msgstr "``INTRINSIC_SET_FUNCTION_TYPE_PARAMS``" -#: ../../library/dis.rst:1599 +#: ../../library/dis.rst:1601 msgid "Sets the ``__type_params__`` attribute of a function." msgstr "" -#: ../../library/dis.rst:1606 +#: ../../library/dis.rst:1608 msgid "**Pseudo-instructions**" msgstr "" -#: ../../library/dis.rst:1608 +#: ../../library/dis.rst:1610 msgid "" "These opcodes do not appear in Python bytecode. They are used by the " "compiler but are replaced by real opcodes or removed before bytecode is " "generated." msgstr "" -#: ../../library/dis.rst:1613 +#: ../../library/dis.rst:1615 msgid "" "Set up an exception handler for the following code block. If an exception " "occurs, the value stack level is restored to its current state and control " "is transferred to the exception handler at ``target``." msgstr "" -#: ../../library/dis.rst:1620 +#: ../../library/dis.rst:1622 msgid "" "Like ``SETUP_FINALLY``, but in case of an exception also pushes the last " "instruction (``lasti``) to the stack so that ``RERAISE`` can restore it. If " @@ -1655,75 +1660,75 @@ msgid "" "exception handler at ``target``." msgstr "" -#: ../../library/dis.rst:1629 +#: ../../library/dis.rst:1631 msgid "" "Like ``SETUP_CLEANUP``, but in case of an exception one more item is popped " "from the stack before control is transferred to the exception handler at " "``target``." msgstr "" -#: ../../library/dis.rst:1633 +#: ../../library/dis.rst:1635 msgid "" "This variant is used in :keyword:`with` and :keyword:`async with` " "constructs, which push the return value of the context manager's :meth:" "`~object.__enter__` or :meth:`~object.__aenter__` to the stack." msgstr "" -#: ../../library/dis.rst:1640 +#: ../../library/dis.rst:1642 msgid "" "Marks the end of the code block associated with the last ``SETUP_FINALLY``, " "``SETUP_CLEANUP`` or ``SETUP_WITH``." msgstr "" -#: ../../library/dis.rst:1646 +#: ../../library/dis.rst:1648 msgid "" "Undirected relative jump instructions which are replaced by their directed " "(forward/backward) counterparts by the assembler." msgstr "" -#: ../../library/dis.rst:1651 +#: ../../library/dis.rst:1653 msgid "" "Optimized unbound method lookup. Emitted as a ``LOAD_ATTR`` opcode with a " "flag set in the arg." msgstr "" -#: ../../library/dis.rst:1658 +#: ../../library/dis.rst:1660 msgid "Opcode collections" msgstr "" -#: ../../library/dis.rst:1660 +#: ../../library/dis.rst:1662 msgid "" "These collections are provided for automatic introspection of bytecode " "instructions:" msgstr "" -#: ../../library/dis.rst:1663 +#: ../../library/dis.rst:1665 msgid "" "The collections now contain pseudo instructions as well. These are opcodes " "with values ``>= MIN_PSEUDO_OPCODE``." msgstr "" -#: ../../library/dis.rst:1669 +#: ../../library/dis.rst:1671 msgid "Sequence of operation names, indexable using the bytecode." msgstr "" -#: ../../library/dis.rst:1674 +#: ../../library/dis.rst:1676 msgid "Dictionary mapping operation names to bytecodes." msgstr "" -#: ../../library/dis.rst:1679 +#: ../../library/dis.rst:1681 msgid "Sequence of all compare operation names." msgstr "" -#: ../../library/dis.rst:1684 +#: ../../library/dis.rst:1686 msgid "Sequence of bytecodes that use their argument." msgstr "" -#: ../../library/dis.rst:1691 +#: ../../library/dis.rst:1693 msgid "Sequence of bytecodes that access a constant." msgstr "" -#: ../../library/dis.rst:1696 +#: ../../library/dis.rst:1698 msgid "" "Sequence of bytecodes that access a free variable. 'free' in this context " "refers to names in the current scope that are referenced by inner scopes or " @@ -1731,34 +1736,34 @@ msgid "" "include references to global or builtin scopes." msgstr "" -#: ../../library/dis.rst:1704 +#: ../../library/dis.rst:1706 msgid "Sequence of bytecodes that access an attribute by name." msgstr "" -#: ../../library/dis.rst:1709 +#: ../../library/dis.rst:1711 msgid "Sequence of bytecodes that have a relative jump target." msgstr "" -#: ../../library/dis.rst:1714 +#: ../../library/dis.rst:1716 msgid "Sequence of bytecodes that have an absolute jump target." msgstr "" -#: ../../library/dis.rst:1719 +#: ../../library/dis.rst:1721 msgid "Sequence of bytecodes that access a local variable." msgstr "" -#: ../../library/dis.rst:1724 +#: ../../library/dis.rst:1726 msgid "Sequence of bytecodes of Boolean operations." msgstr "" -#: ../../library/dis.rst:1728 +#: ../../library/dis.rst:1730 msgid "Sequence of bytecodes that set an exception handler." msgstr "" -#: ../../library/dis.rst:1404 +#: ../../library/dis.rst:1406 msgid "built-in function" msgstr "built-in function(內建函式)" -#: ../../library/dis.rst:1404 +#: ../../library/dis.rst:1406 msgid "slice" msgstr "slice(切片)" diff --git a/library/idle.po b/library/idle.po index 2686b61b6a..521bc73b78 100644 --- a/library/idle.po +++ b/library/idle.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-08-29 12:27+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-" @@ -922,7 +922,7 @@ msgstr "" msgid "" "Any selection becomes a search target. However, only selections within a " "line work because searches are only performed within lines with the terminal " -"newline removed. If ``[x] Regular expresion`` is checked, the target is " +"newline removed. If ``[x] Regular expression`` is checked, the target is " "interpreted according to the Python re module." msgstr "" diff --git a/library/importlib.po b/library/importlib.po index 9ebc47b3d0..ae8037bd2d 100644 --- a/library/importlib.po +++ b/library/importlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 00:03+0000\n" +"POT-Creation-Date: 2023-09-14 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:04+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -728,7 +728,7 @@ msgstr "" msgid "Use :meth:`Loader.exec_module` instead." msgstr "" -#: ../../library/importlib.rst:548 ../../library/importlib.rst:989 +#: ../../library/importlib.rst:548 ../../library/importlib.rst:1143 msgid "Returns :attr:`path`." msgstr "" @@ -855,58 +855,231 @@ msgid "" msgstr "" #: ../../library/importlib.rst:650 -msgid ":mod:`importlib.machinery` -- Importers and path hooks" +msgid "*Superseded by TraversableResources*" +msgstr "" + +#: ../../library/importlib.rst:652 +msgid "" +"An :term:`abstract base class` to provide the ability to read *resources*." msgstr "" #: ../../library/importlib.rst:655 +msgid "" +"From the perspective of this ABC, a *resource* is a binary artifact that is " +"shipped within a package. Typically this is something like a data file that " +"lives next to the ``__init__.py`` file of the package. The purpose of this " +"class is to help abstract out the accessing of such data files so that it " +"does not matter if the package and its data file(s) are stored in a e.g. zip " +"file versus on the file system." +msgstr "" + +#: ../../library/importlib.rst:663 +msgid "" +"For any of methods of this class, a *resource* argument is expected to be a :" +"term:`path-like object` which represents conceptually just a file name. This " +"means that no subdirectory paths should be included in the *resource* " +"argument. This is because the location of the package the reader is for, " +"acts as the \"directory\". Hence the metaphor for directories and file names " +"is packages and resources, respectively. This is also why instances of this " +"class are expected to directly correlate to a specific package (instead of " +"potentially representing multiple packages or a module)." +msgstr "" + +#: ../../library/importlib.rst:674 +msgid "" +"Loaders that wish to support resource reading are expected to provide a " +"method called ``get_resource_reader(fullname)`` which returns an object " +"implementing this ABC's interface. If the module specified by fullname is " +"not a package, this method should return :const:`None`. An object compatible " +"with this ABC should only be returned when the specified module is a package." +msgstr "" + +#: ../../library/importlib.rst:685 ../../library/importlib.rst:795 +msgid "Use :class:`importlib.resources.abc.TraversableResources` instead." +msgstr "" + +#: ../../library/importlib.rst:688 +msgid "" +"Returns an opened, :term:`file-like object` for binary reading of the " +"*resource*." +msgstr "" + +#: ../../library/importlib.rst:691 +msgid "If the resource cannot be found, :exc:`FileNotFoundError` is raised." +msgstr "" + +#: ../../library/importlib.rst:696 +msgid "Returns the file system path to the *resource*." +msgstr "" + +#: ../../library/importlib.rst:698 +msgid "" +"If the resource does not concretely exist on the file system, raise :exc:" +"`FileNotFoundError`." +msgstr "" + +#: ../../library/importlib.rst:703 +msgid "" +"Returns ``True`` if the named *name* is considered a resource. :exc:" +"`FileNotFoundError` is raised if *name* does not exist." +msgstr "" + +#: ../../library/importlib.rst:708 +msgid "" +"Returns an :term:`iterable` of strings over the contents of the package. Do " +"note that it is not required that all names returned by the iterator be " +"actual resources, e.g. it is acceptable to return names for which :meth:" +"`is_resource` would be false." +msgstr "" + +#: ../../library/importlib.rst:714 +msgid "" +"Allowing non-resource names to be returned is to allow for situations where " +"how a package and its resources are stored are known a priori and the non-" +"resource names would be useful. For instance, returning subdirectory names " +"is allowed so that when it is known that the package and resources are " +"stored on the file system then those subdirectory names can be used directly." +msgstr "" + +#: ../../library/importlib.rst:722 +msgid "The abstract method returns an iterable of no items." +msgstr "" + +#: ../../library/importlib.rst:727 +msgid "" +"An object with a subset of :class:`pathlib.Path` methods suitable for " +"traversing directories and opening files." +msgstr "" + +#: ../../library/importlib.rst:730 +msgid "" +"For a representation of the object on the file-system, use :meth:`importlib." +"resources.as_file`." +msgstr "" + +#: ../../library/importlib.rst:737 +msgid "Use :class:`importlib.resources.abc.Traversable` instead." +msgstr "" + +#: ../../library/importlib.rst:740 +msgid "Abstract. The base name of this object without any parent references." +msgstr "" + +#: ../../library/importlib.rst:744 +msgid "Yield ``Traversable`` objects in ``self``." +msgstr "" + +#: ../../library/importlib.rst:748 +msgid "Return ``True`` if ``self`` is a directory." +msgstr "" + +#: ../../library/importlib.rst:752 +msgid "Return ``True`` if ``self`` is a file." +msgstr "" + +#: ../../library/importlib.rst:756 +msgid "Return Traversable child in ``self``." +msgstr "" + +#: ../../library/importlib.rst:760 +msgid "Return ``Traversable`` child in ``self``." +msgstr "" + +#: ../../library/importlib.rst:764 +msgid "" +"*mode* may be 'r' or 'rb' to open as text or binary. Return a handle " +"suitable for reading (same as :attr:`pathlib.Path.open`)." +msgstr "" + +#: ../../library/importlib.rst:767 +msgid "" +"When opening as text, accepts encoding parameters such as those accepted by :" +"attr:`io.TextIOWrapper`." +msgstr "" + +#: ../../library/importlib.rst:772 +msgid "Read contents of ``self`` as bytes." +msgstr "" + +#: ../../library/importlib.rst:776 +msgid "Read contents of ``self`` as text." +msgstr "" + +#: ../../library/importlib.rst:781 +msgid "" +"An abstract base class for resource readers capable of serving the :meth:" +"`importlib.resources.files` interface. Subclasses :class:`importlib." +"resources.abc.ResourceReader` and provides concrete implementations of the :" +"class:`importlib.resources.abc.ResourceReader`'s abstract methods. " +"Therefore, any loader supplying :class:`importlib.abc.TraversableResources` " +"also supplies ResourceReader." +msgstr "" + +#: ../../library/importlib.rst:788 +msgid "" +"Loaders that wish to support resource reading are expected to implement this " +"interface." +msgstr "" + +#: ../../library/importlib.rst:798 +msgid "" +"Returns a :class:`importlib.resources.abc.Traversable` object for the loaded " +"package." +msgstr "" + +#: ../../library/importlib.rst:804 +msgid ":mod:`importlib.machinery` -- Importers and path hooks" +msgstr "" + +#: ../../library/importlib.rst:809 msgid "**Source code:** :source:`Lib/importlib/machinery.py`" msgstr "**原始碼:**\\ :source:`Lib/importlib/machinery.py`" -#: ../../library/importlib.rst:659 +#: ../../library/importlib.rst:813 msgid "" "This module contains the various objects that help :keyword:`import` find " "and load modules." msgstr "" -#: ../../library/importlib.rst:664 +#: ../../library/importlib.rst:818 msgid "" "A list of strings representing the recognized file suffixes for source " "modules." msgstr "" -#: ../../library/importlib.rst:671 +#: ../../library/importlib.rst:825 msgid "" "A list of strings representing the file suffixes for non-optimized bytecode " "modules." msgstr "" -#: ../../library/importlib.rst:676 ../../library/importlib.rst:686 +#: ../../library/importlib.rst:830 ../../library/importlib.rst:840 msgid "Use :attr:`BYTECODE_SUFFIXES` instead." msgstr "" -#: ../../library/importlib.rst:681 +#: ../../library/importlib.rst:835 msgid "" "A list of strings representing the file suffixes for optimized bytecode " "modules." msgstr "" -#: ../../library/importlib.rst:691 +#: ../../library/importlib.rst:845 msgid "" "A list of strings representing the recognized file suffixes for bytecode " "modules (including the leading dot)." msgstr "" -#: ../../library/importlib.rst:696 +#: ../../library/importlib.rst:850 msgid "The value is no longer dependent on ``__debug__``." msgstr "" -#: ../../library/importlib.rst:701 +#: ../../library/importlib.rst:855 msgid "" "A list of strings representing the recognized file suffixes for extension " "modules." msgstr "" -#: ../../library/importlib.rst:708 +#: ../../library/importlib.rst:862 msgid "" "Returns a combined list of strings representing all file suffixes for " "modules recognized by the standard import machinery. This is a helper for " @@ -915,57 +1088,57 @@ msgid "" "`inspect.getmodulename`)." msgstr "" -#: ../../library/importlib.rst:719 +#: ../../library/importlib.rst:873 msgid "" "An :term:`importer` for built-in modules. All known built-in modules are " "listed in :data:`sys.builtin_module_names`. This class implements the :class:" "`importlib.abc.MetaPathFinder` and :class:`importlib.abc.InspectLoader` ABCs." msgstr "" -#: ../../library/importlib.rst:724 ../../library/importlib.rst:738 -#: ../../library/importlib.rst:751 ../../library/importlib.rst:766 +#: ../../library/importlib.rst:878 ../../library/importlib.rst:892 +#: ../../library/importlib.rst:905 ../../library/importlib.rst:920 msgid "" "Only class methods are defined by this class to alleviate the need for " "instantiation." msgstr "" -#: ../../library/importlib.rst:727 +#: ../../library/importlib.rst:881 msgid "" "As part of :pep:`489`, the builtin importer now implements :meth:`Loader." "create_module` and :meth:`Loader.exec_module`" msgstr "" -#: ../../library/importlib.rst:734 +#: ../../library/importlib.rst:888 msgid "" "An :term:`importer` for frozen modules. This class implements the :class:" "`importlib.abc.MetaPathFinder` and :class:`importlib.abc.InspectLoader` ABCs." msgstr "" -#: ../../library/importlib.rst:741 +#: ../../library/importlib.rst:895 msgid "" "Gained :meth:`~Loader.create_module` and :meth:`~Loader.exec_module` methods." msgstr "" -#: ../../library/importlib.rst:748 +#: ../../library/importlib.rst:902 msgid "" ":term:`Finder ` for modules declared in the Windows registry. This " "class implements the :class:`importlib.abc.MetaPathFinder` ABC." msgstr "" -#: ../../library/importlib.rst:756 +#: ../../library/importlib.rst:910 msgid "" "Use :mod:`site` configuration instead. Future versions of Python may not " "enable this finder by default." msgstr "" -#: ../../library/importlib.rst:763 +#: ../../library/importlib.rst:917 msgid "" "A :term:`Finder ` for :data:`sys.path` and package ``__path__`` " "attributes. This class implements the :class:`importlib.abc.MetaPathFinder` " "ABC." msgstr "" -#: ../../library/importlib.rst:771 +#: ../../library/importlib.rst:925 msgid "" "Class method that attempts to find a :term:`spec ` for the " "module specified by *fullname* on :data:`sys.path` or, if defined, on " @@ -979,43 +1152,43 @@ msgid "" "cache and returned." msgstr "" -#: ../../library/importlib.rst:785 +#: ../../library/importlib.rst:939 msgid "" "If the current working directory -- represented by an empty string -- is no " "longer valid then ``None`` is returned but no value is cached in :data:`sys." "path_importer_cache`." msgstr "" -#: ../../library/importlib.rst:792 +#: ../../library/importlib.rst:946 msgid "" "Calls :meth:`importlib.abc.PathEntryFinder.invalidate_caches` on all finders " "stored in :data:`sys.path_importer_cache` that define the method. Otherwise " "entries in :data:`sys.path_importer_cache` set to ``None`` are deleted." msgstr "" -#: ../../library/importlib.rst:797 +#: ../../library/importlib.rst:951 msgid "Entries of ``None`` in :data:`sys.path_importer_cache` are deleted." msgstr "" -#: ../../library/importlib.rst:800 +#: ../../library/importlib.rst:954 msgid "" "Calls objects in :data:`sys.path_hooks` with the current working directory " "for ``''`` (i.e. the empty string)." msgstr "" -#: ../../library/importlib.rst:807 +#: ../../library/importlib.rst:961 msgid "" "A concrete implementation of :class:`importlib.abc.PathEntryFinder` which " "caches results from the file system." msgstr "" -#: ../../library/importlib.rst:810 +#: ../../library/importlib.rst:964 msgid "" "The *path* argument is the directory for which the finder is in charge of " "searching." msgstr "" -#: ../../library/importlib.rst:813 +#: ../../library/importlib.rst:967 msgid "" "The *loader_details* argument is a variable number of 2-item tuples each " "containing a loader and a sequence of file suffixes the loader recognizes. " @@ -1023,7 +1196,7 @@ msgid "" "module's name and the path to the file found." msgstr "" -#: ../../library/importlib.rst:818 +#: ../../library/importlib.rst:972 msgid "" "The finder will cache the directory contents as necessary, making stat calls " "for each module search to verify the cache is not outdated. Because cache " @@ -1036,166 +1209,166 @@ msgid "" "to call :func:`importlib.invalidate_caches`." msgstr "" -#: ../../library/importlib.rst:832 +#: ../../library/importlib.rst:986 msgid "The path the finder will search in." msgstr "" -#: ../../library/importlib.rst:836 +#: ../../library/importlib.rst:990 msgid "Attempt to find the spec to handle *fullname* within :attr:`path`." msgstr "" -#: ../../library/importlib.rst:842 +#: ../../library/importlib.rst:996 msgid "Clear out the internal cache." msgstr "" -#: ../../library/importlib.rst:846 +#: ../../library/importlib.rst:1000 msgid "" "A class method which returns a closure for use on :data:`sys.path_hooks`. An " "instance of :class:`FileFinder` is returned by the closure using the path " "argument given to the closure directly and *loader_details* indirectly." msgstr "" -#: ../../library/importlib.rst:851 +#: ../../library/importlib.rst:1005 msgid "" "If the argument to the closure is not an existing directory, :exc:" "`ImportError` is raised." msgstr "" -#: ../../library/importlib.rst:857 +#: ../../library/importlib.rst:1011 msgid "" "A concrete implementation of :class:`importlib.abc.SourceLoader` by " "subclassing :class:`importlib.abc.FileLoader` and providing some concrete " "implementations of other methods." msgstr "" -#: ../../library/importlib.rst:865 +#: ../../library/importlib.rst:1019 msgid "The name of the module that this loader will handle." msgstr "" -#: ../../library/importlib.rst:869 +#: ../../library/importlib.rst:1023 msgid "The path to the source file." msgstr "" -#: ../../library/importlib.rst:873 +#: ../../library/importlib.rst:1027 msgid "Return ``True`` if :attr:`path` appears to be for a package." msgstr "" -#: ../../library/importlib.rst:877 +#: ../../library/importlib.rst:1031 msgid "" "Concrete implementation of :meth:`importlib.abc.SourceLoader.path_stats`." msgstr "" -#: ../../library/importlib.rst:881 +#: ../../library/importlib.rst:1035 msgid "Concrete implementation of :meth:`importlib.abc.SourceLoader.set_data`." msgstr "" -#: ../../library/importlib.rst:885 ../../library/importlib.rst:928 +#: ../../library/importlib.rst:1039 ../../library/importlib.rst:1082 msgid "" "Concrete implementation of :meth:`importlib.abc.Loader.load_module` where " "specifying the name of the module to load is optional." msgstr "" -#: ../../library/importlib.rst:890 ../../library/importlib.rst:933 +#: ../../library/importlib.rst:1044 ../../library/importlib.rst:1087 msgid "Use :meth:`importlib.abc.Loader.exec_module` instead." msgstr "" -#: ../../library/importlib.rst:895 +#: ../../library/importlib.rst:1049 msgid "" "A concrete implementation of :class:`importlib.abc.FileLoader` which can " "import bytecode files (i.e. no source code files exist)." msgstr "" -#: ../../library/importlib.rst:898 +#: ../../library/importlib.rst:1052 msgid "" "Please note that direct use of bytecode files (and thus not source code " "files) inhibits your modules from being usable by all Python implementations " "or new versions of Python which change the bytecode format." msgstr "" -#: ../../library/importlib.rst:907 +#: ../../library/importlib.rst:1061 msgid "The name of the module the loader will handle." msgstr "" -#: ../../library/importlib.rst:911 +#: ../../library/importlib.rst:1065 msgid "The path to the bytecode file." msgstr "" -#: ../../library/importlib.rst:915 +#: ../../library/importlib.rst:1069 msgid "Determines if the module is a package based on :attr:`path`." msgstr "" -#: ../../library/importlib.rst:919 +#: ../../library/importlib.rst:1073 msgid "Returns the code object for :attr:`name` created from :attr:`path`." msgstr "" -#: ../../library/importlib.rst:923 +#: ../../library/importlib.rst:1077 msgid "" "Returns ``None`` as bytecode files have no source when this loader is used." msgstr "" -#: ../../library/importlib.rst:938 +#: ../../library/importlib.rst:1092 msgid "" "A concrete implementation of :class:`importlib.abc.ExecutionLoader` for " "extension modules." msgstr "" -#: ../../library/importlib.rst:941 +#: ../../library/importlib.rst:1095 msgid "" "The *fullname* argument specifies the name of the module the loader is to " "support. The *path* argument is the path to the extension module's file." msgstr "" -#: ../../library/importlib.rst:944 +#: ../../library/importlib.rst:1098 msgid "" "Note that, by default, importing an extension module will fail in " "subinterpreters if it doesn't implement multi-phase init (see :pep:`489`), " "even if it would otherwise import successfully." msgstr "" -#: ../../library/importlib.rst:950 +#: ../../library/importlib.rst:1104 msgid "Multi-phase init is now required for use in subinterpreters." msgstr "" -#: ../../library/importlib.rst:955 +#: ../../library/importlib.rst:1109 msgid "Name of the module the loader supports." msgstr "" -#: ../../library/importlib.rst:959 +#: ../../library/importlib.rst:1113 msgid "Path to the extension module." msgstr "" -#: ../../library/importlib.rst:963 +#: ../../library/importlib.rst:1117 msgid "" "Creates the module object from the given specification in accordance with :" "pep:`489`." msgstr "" -#: ../../library/importlib.rst:970 +#: ../../library/importlib.rst:1124 msgid "Initializes the given module object in accordance with :pep:`489`." msgstr "" -#: ../../library/importlib.rst:976 +#: ../../library/importlib.rst:1130 msgid "" "Returns ``True`` if the file path points to a package's ``__init__`` module " "based on :attr:`EXTENSION_SUFFIXES`." msgstr "" -#: ../../library/importlib.rst:981 +#: ../../library/importlib.rst:1135 msgid "Returns ``None`` as extension modules lack a code object." msgstr "" -#: ../../library/importlib.rst:985 +#: ../../library/importlib.rst:1139 msgid "Returns ``None`` as extension modules do not have source code." msgstr "" -#: ../../library/importlib.rst:996 +#: ../../library/importlib.rst:1150 msgid "" "A concrete implementation of :class:`importlib.abc.InspectLoader` for " "namespace packages. This is an alias for a private class and is only made " "public for introspecting the ``__loader__`` attribute on namespace packages::" msgstr "" -#: ../../library/importlib.rst:1014 +#: ../../library/importlib.rst:1168 msgid "" "A specification for a module's import-system-related state. This is " "typically exposed as the module's :attr:`__spec__` attribute. In the " @@ -1208,31 +1381,31 @@ msgid "" "reflected in the module's :attr:`__spec__.origin`, and vice versa." msgstr "" -#: ../../library/importlib.rst:1028 +#: ../../library/importlib.rst:1182 msgid "(:attr:`__name__`)" msgstr "(:attr:`__name__`)" -#: ../../library/importlib.rst:1030 +#: ../../library/importlib.rst:1184 msgid "" "The module's fully qualified name. The :term:`finder` should always set this " "attribute to a non-empty string." msgstr "" -#: ../../library/importlib.rst:1035 +#: ../../library/importlib.rst:1189 msgid "(:attr:`__loader__`)" msgstr "(:attr:`__loader__`)" -#: ../../library/importlib.rst:1037 +#: ../../library/importlib.rst:1191 msgid "" "The :term:`loader` used to load the module. The :term:`finder` should always " "set this attribute." msgstr "" -#: ../../library/importlib.rst:1042 +#: ../../library/importlib.rst:1196 msgid "(:attr:`__file__`)" msgstr "(:attr:`__file__`)" -#: ../../library/importlib.rst:1044 +#: ../../library/importlib.rst:1198 msgid "" "The location the :term:`loader` should use to load the module. For example, " "for modules loaded from a .py file this is the filename. The :term:`finder` " @@ -1241,11 +1414,11 @@ msgid "" "namespace packages), it should be set to ``None``." msgstr "" -#: ../../library/importlib.rst:1052 +#: ../../library/importlib.rst:1206 msgid "(:attr:`__path__`)" msgstr "(:attr:`__path__`)" -#: ../../library/importlib.rst:1054 +#: ../../library/importlib.rst:1208 msgid "" "The list of locations where the package's submodules will be found. Most of " "the time this is a single directory. The :term:`finder` should set this " @@ -1255,66 +1428,66 @@ msgid "" "packages." msgstr "" -#: ../../library/importlib.rst:1063 +#: ../../library/importlib.rst:1217 msgid "" "The :term:`finder` may set this attribute to an object containing " "additional, module-specific data to use when loading the module. Otherwise " "it should be set to ``None``." msgstr "" -#: ../../library/importlib.rst:1069 +#: ../../library/importlib.rst:1223 msgid "(:attr:`__cached__`)" msgstr "(:attr:`__cached__`)" -#: ../../library/importlib.rst:1071 +#: ../../library/importlib.rst:1225 msgid "" "The filename of a compiled version of the module's code. The :term:`finder` " "should always set this attribute but it may be ``None`` for modules that do " "not need compiled code stored." msgstr "" -#: ../../library/importlib.rst:1077 +#: ../../library/importlib.rst:1231 msgid "(:attr:`__package__`)" msgstr "(:attr:`__package__`)" -#: ../../library/importlib.rst:1079 +#: ../../library/importlib.rst:1233 msgid "" "(Read-only) The fully qualified name of the package the module is in (or the " "empty string for a top-level module). If the module is a package then this " "is the same as :attr:`name`." msgstr "" -#: ../../library/importlib.rst:1086 +#: ../../library/importlib.rst:1240 msgid "``True`` if the spec's :attr:`origin` refers to a loadable location," msgstr "" -#: ../../library/importlib.rst:1086 +#: ../../library/importlib.rst:1240 msgid "" "``False`` otherwise. This value impacts how :attr:`origin` is interpreted " "and how the module's :attr:`__file__` is populated." msgstr "" -#: ../../library/importlib.rst:1091 +#: ../../library/importlib.rst:1245 msgid ":mod:`importlib.util` -- Utility code for importers" msgstr "" -#: ../../library/importlib.rst:1097 +#: ../../library/importlib.rst:1251 msgid "**Source code:** :source:`Lib/importlib/util.py`" msgstr "**原始碼:**\\ :source:`Lib/importlib/util.py`" -#: ../../library/importlib.rst:1101 +#: ../../library/importlib.rst:1255 msgid "" "This module contains the various objects that help in the construction of " "an :term:`importer`." msgstr "" -#: ../../library/importlib.rst:1106 +#: ../../library/importlib.rst:1260 msgid "" "The bytes which represent the bytecode version number. If you need help with " "loading/writing bytecode then consider :class:`importlib.abc.SourceLoader`." msgstr "" -#: ../../library/importlib.rst:1113 +#: ../../library/importlib.rst:1267 msgid "" "Return the :pep:`3147`/:pep:`488` path to the byte-compiled file associated " "with the source *path*. For example, if *path* is ``/foo/bar/baz.py`` the " @@ -1324,7 +1497,7 @@ msgid "" "`NotImplementedError` will be raised)." msgstr "" -#: ../../library/importlib.rst:1120 +#: ../../library/importlib.rst:1274 msgid "" "The *optimization* parameter is used to specify the optimization level of " "the bytecode file. An empty string represents no optimization, so ``/foo/bar/" @@ -1337,7 +1510,7 @@ msgid "" "be alphanumeric, else :exc:`ValueError` is raised." msgstr "" -#: ../../library/importlib.rst:1130 +#: ../../library/importlib.rst:1284 msgid "" "The *debug_override* parameter is deprecated and can be used to override the " "system's value for ``__debug__``. A ``True`` value is the equivalent of " @@ -1346,18 +1519,18 @@ msgid "" "are not ``None`` then :exc:`TypeError` is raised." msgstr "" -#: ../../library/importlib.rst:1138 +#: ../../library/importlib.rst:1292 msgid "" "The *optimization* parameter was added and the *debug_override* parameter " "was deprecated." msgstr "" -#: ../../library/importlib.rst:1142 ../../library/importlib.rst:1158 -#: ../../library/importlib.rst:1247 +#: ../../library/importlib.rst:1296 ../../library/importlib.rst:1312 +#: ../../library/importlib.rst:1401 msgid "Accepts a :term:`path-like object`." msgstr "" -#: ../../library/importlib.rst:1148 +#: ../../library/importlib.rst:1302 msgid "" "Given the *path* to a :pep:`3147` file name, return the associated source " "code file path. For example, if *path* is ``/foo/bar/__pycache__/baz." @@ -1367,25 +1540,25 @@ msgid "" "cache_tag` is not defined, :exc:`NotImplementedError` is raised." msgstr "" -#: ../../library/importlib.rst:1163 +#: ../../library/importlib.rst:1317 msgid "" "Decode the given bytes representing source code and return it as a string " "with universal newlines (as required by :meth:`importlib.abc.InspectLoader." "get_source`)." msgstr "" -#: ../../library/importlib.rst:1171 +#: ../../library/importlib.rst:1325 msgid "Resolve a relative module name to an absolute one." msgstr "" -#: ../../library/importlib.rst:1173 +#: ../../library/importlib.rst:1327 msgid "" "If **name** has no leading dots, then **name** is simply returned. This " "allows for usage such as ``importlib.util.resolve_name('sys', __spec__." "parent)`` without doing a check to see if the **package** argument is needed." msgstr "" -#: ../../library/importlib.rst:1178 +#: ../../library/importlib.rst:1332 msgid "" ":exc:`ImportError` is raised if **name** is a relative module name but " "**package** is a false value (e.g. ``None`` or the empty string). :exc:" @@ -1393,13 +1566,13 @@ msgid "" "package (e.g. requesting ``..bacon`` from within the ``spam`` package)." msgstr "" -#: ../../library/importlib.rst:1186 +#: ../../library/importlib.rst:1340 msgid "" "To improve consistency with import statements, raise :exc:`ImportError` " "instead of :exc:`ValueError` for invalid relative import attempts." msgstr "" -#: ../../library/importlib.rst:1193 +#: ../../library/importlib.rst:1347 msgid "" "Find the :term:`spec ` for a module, optionally relative to the " "specified **package** name. If the module is in :data:`sys.modules`, then " @@ -1409,30 +1582,30 @@ msgid "" "if no spec is found." msgstr "" -#: ../../library/importlib.rst:1200 +#: ../../library/importlib.rst:1354 msgid "" "If **name** is for a submodule (contains a dot), the parent module is " "automatically imported." msgstr "" -#: ../../library/importlib.rst:1203 +#: ../../library/importlib.rst:1357 msgid "**name** and **package** work the same as for :func:`import_module`." msgstr "" -#: ../../library/importlib.rst:1207 +#: ../../library/importlib.rst:1361 msgid "" "Raises :exc:`ModuleNotFoundError` instead of :exc:`AttributeError` if " "**package** is in fact not a package (i.e. lacks a :attr:`__path__` " "attribute)." msgstr "" -#: ../../library/importlib.rst:1214 +#: ../../library/importlib.rst:1368 msgid "" "Create a new module based on **spec** and :meth:`spec.loader.create_module " "`." msgstr "" -#: ../../library/importlib.rst:1217 +#: ../../library/importlib.rst:1371 msgid "" "If :meth:`spec.loader.create_module ` " "does not return ``None``, then any pre-existing attributes will not be " @@ -1440,14 +1613,14 @@ msgid "" "accessing **spec** or setting an attribute on the module." msgstr "" -#: ../../library/importlib.rst:1222 +#: ../../library/importlib.rst:1376 msgid "" "This function is preferred over using :class:`types.ModuleType` to create a " "new module as **spec** is used to set as many import-controlled attributes " "on the module as possible." msgstr "" -#: ../../library/importlib.rst:1230 +#: ../../library/importlib.rst:1384 msgid "" "A factory function for creating a :class:`~importlib.machinery.ModuleSpec` " "instance based on a loader. The parameters have the same meaning as they do " @@ -1456,7 +1629,7 @@ msgid "" "spec." msgstr "" -#: ../../library/importlib.rst:1240 +#: ../../library/importlib.rst:1394 msgid "" "A factory function for creating a :class:`~importlib.machinery.ModuleSpec` " "instance based on the path to a file. Missing information will be filled in " @@ -1464,14 +1637,14 @@ msgid "" "module will be file-based." msgstr "" -#: ../../library/importlib.rst:1252 +#: ../../library/importlib.rst:1406 msgid "" "Return the hash of *source_bytes* as bytes. A hash-based ``.pyc`` file " "embeds the :func:`source_hash` of the corresponding source file's contents " "in its header." msgstr "" -#: ../../library/importlib.rst:1260 +#: ../../library/importlib.rst:1414 msgid "" "A context manager that can temporarily skip the compatibility check for " "extension modules. By default the check is enabled and will fail when a " @@ -1480,33 +1653,33 @@ msgid "" "interpreter GIL, when imported in an interpreter with its own GIL." msgstr "" -#: ../../library/importlib.rst:1267 +#: ../../library/importlib.rst:1421 msgid "" "Note that this function is meant to accommodate an unusual case; one which " "is likely to eventually go away. There's is a pretty good chance this is " "not what you were looking for." msgstr "" -#: ../../library/importlib.rst:1271 +#: ../../library/importlib.rst:1425 msgid "" "You can get the same effect as this function by implementing the basic " "interface of multi-phase init (:pep:`489`) and lying about support for " -"mulitple interpreters (or per-interpreter GIL)." +"multiple interpreters (or per-interpreter GIL)." msgstr "" -#: ../../library/importlib.rst:1276 +#: ../../library/importlib.rst:1430 msgid "" "Using this function to disable the check can lead to unexpected behavior and " "even crashes. It should only be used during extension module development." msgstr "" -#: ../../library/importlib.rst:1284 +#: ../../library/importlib.rst:1438 msgid "" "A class which postpones the execution of the loader of a module until the " "module has an attribute accessed." msgstr "" -#: ../../library/importlib.rst:1287 +#: ../../library/importlib.rst:1441 msgid "" "This class **only** works with loaders that define :meth:`~importlib.abc." "Loader.exec_module` as control over what module type is used for the module " @@ -1519,7 +1692,7 @@ msgid "" "raised if such a substitution is detected." msgstr "" -#: ../../library/importlib.rst:1298 +#: ../../library/importlib.rst:1452 msgid "" "For projects where startup time is critical, this class allows for " "potentially minimizing the cost of loading a module if it is never used. For " @@ -1528,70 +1701,70 @@ msgid "" "postponed and thus occurring out of context." msgstr "" -#: ../../library/importlib.rst:1306 +#: ../../library/importlib.rst:1460 msgid "" "Began calling :meth:`~importlib.abc.Loader.create_module`, removing the " "compatibility warning for :class:`importlib.machinery.BuiltinImporter` and :" "class:`importlib.machinery.ExtensionFileLoader`." msgstr "" -#: ../../library/importlib.rst:1313 +#: ../../library/importlib.rst:1467 msgid "" "A class method which returns a callable that creates a lazy loader. This is " "meant to be used in situations where the loader is passed by class instead " "of by instance. ::" msgstr "" -#: ../../library/importlib.rst:1326 +#: ../../library/importlib.rst:1480 msgid "Examples" msgstr "範例" -#: ../../library/importlib.rst:1329 +#: ../../library/importlib.rst:1483 msgid "Importing programmatically" msgstr "" -#: ../../library/importlib.rst:1331 +#: ../../library/importlib.rst:1485 msgid "" "To programmatically import a module, use :func:`importlib.import_module`. ::" msgstr "" -#: ../../library/importlib.rst:1340 +#: ../../library/importlib.rst:1494 msgid "Checking if a module can be imported" msgstr "" -#: ../../library/importlib.rst:1342 +#: ../../library/importlib.rst:1496 msgid "" "If you need to find out if a module can be imported without actually doing " "the import, then you should use :func:`importlib.util.find_spec`." msgstr "" -#: ../../library/importlib.rst:1345 +#: ../../library/importlib.rst:1499 msgid "" "Note that if ``name`` is a submodule (contains a dot), :func:`importlib.util." "find_spec` will import the parent module. ::" msgstr "" -#: ../../library/importlib.rst:1368 +#: ../../library/importlib.rst:1522 msgid "Importing a source file directly" msgstr "" -#: ../../library/importlib.rst:1370 +#: ../../library/importlib.rst:1524 msgid "To import a Python source file directly, use the following recipe::" msgstr "" -#: ../../library/importlib.rst:1387 +#: ../../library/importlib.rst:1541 msgid "Implementing lazy imports" msgstr "" -#: ../../library/importlib.rst:1389 +#: ../../library/importlib.rst:1543 msgid "The example below shows how to implement lazy imports::" msgstr "" -#: ../../library/importlib.rst:1411 +#: ../../library/importlib.rst:1565 msgid "Setting up an importer" msgstr "" -#: ../../library/importlib.rst:1413 +#: ../../library/importlib.rst:1567 msgid "" "For deep customizations of import, you typically want to implement an :term:" "`importer`. This means managing both the :term:`finder` and :term:`loader` " @@ -1605,11 +1778,11 @@ msgid "" "for the appropriate classes defined within this package)::" msgstr "" -#: ../../library/importlib.rst:1445 +#: ../../library/importlib.rst:1599 msgid "Approximating :func:`importlib.import_module`" msgstr "" -#: ../../library/importlib.rst:1447 +#: ../../library/importlib.rst:1601 msgid "" "Import itself is implemented in Python code, making it possible to expose " "most of the import machinery through importlib. The following helps " diff --git a/library/importlib.resources.abc.po b/library/importlib.resources.abc.po index c600f6586d..31ba47eca2 100644 --- a/library/importlib.resources.abc.po +++ b/library/importlib.resources.abc.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 10:36+0000\n" +"POT-Creation-Date: 2023-09-14 00:03+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -65,38 +65,37 @@ msgid "" "with this ABC should only be returned when the specified module is a package." msgstr "" -#: ../../library/importlib.resources.abc.rst:50 -#: ../../library/importlib.resources.abc.rst:160 +#: ../../library/importlib.resources.abc.rst:48 msgid "Use :class:`importlib.resources.abc.TraversableResources` instead." msgstr "" -#: ../../library/importlib.resources.abc.rst:53 +#: ../../library/importlib.resources.abc.rst:51 msgid "" "Returns an opened, :term:`file-like object` for binary reading of the " "*resource*." msgstr "" -#: ../../library/importlib.resources.abc.rst:56 +#: ../../library/importlib.resources.abc.rst:54 msgid "If the resource cannot be found, :exc:`FileNotFoundError` is raised." msgstr "" -#: ../../library/importlib.resources.abc.rst:61 +#: ../../library/importlib.resources.abc.rst:59 msgid "Returns the file system path to the *resource*." msgstr "" -#: ../../library/importlib.resources.abc.rst:63 +#: ../../library/importlib.resources.abc.rst:61 msgid "" "If the resource does not concretely exist on the file system, raise :exc:" "`FileNotFoundError`." msgstr "" -#: ../../library/importlib.resources.abc.rst:68 +#: ../../library/importlib.resources.abc.rst:66 msgid "" "Returns ``True`` if the named *name* is considered a resource. :exc:" "`FileNotFoundError` is raised if *name* does not exist." msgstr "" -#: ../../library/importlib.resources.abc.rst:73 +#: ../../library/importlib.resources.abc.rst:71 msgid "" "Returns an :term:`iterable` of strings over the contents of the package. Do " "note that it is not required that all names returned by the iterator be " @@ -104,7 +103,7 @@ msgid "" "`is_resource` would be false." msgstr "" -#: ../../library/importlib.resources.abc.rst:79 +#: ../../library/importlib.resources.abc.rst:77 msgid "" "Allowing non-resource names to be returned is to allow for situations where " "how a package and its resources are stored are known a priori and the non-" @@ -113,68 +112,64 @@ msgid "" "stored on the file system then those subdirectory names can be used directly." msgstr "" -#: ../../library/importlib.resources.abc.rst:87 +#: ../../library/importlib.resources.abc.rst:85 msgid "The abstract method returns an iterable of no items." msgstr "" -#: ../../library/importlib.resources.abc.rst:92 +#: ../../library/importlib.resources.abc.rst:90 msgid "" "An object with a subset of :class:`pathlib.Path` methods suitable for " "traversing directories and opening files." msgstr "" -#: ../../library/importlib.resources.abc.rst:95 +#: ../../library/importlib.resources.abc.rst:93 msgid "" "For a representation of the object on the file-system, use :meth:`importlib." "resources.as_file`." msgstr "" -#: ../../library/importlib.resources.abc.rst:102 -msgid "Use :class:`importlib.resources.abc.Traversable` instead." -msgstr "" - -#: ../../library/importlib.resources.abc.rst:105 +#: ../../library/importlib.resources.abc.rst:98 msgid "Abstract. The base name of this object without any parent references." msgstr "" -#: ../../library/importlib.resources.abc.rst:109 +#: ../../library/importlib.resources.abc.rst:102 msgid "Yield Traversable objects in self." msgstr "" -#: ../../library/importlib.resources.abc.rst:113 +#: ../../library/importlib.resources.abc.rst:106 msgid "Return True if self is a directory." msgstr "" -#: ../../library/importlib.resources.abc.rst:117 +#: ../../library/importlib.resources.abc.rst:110 msgid "Return True if self is a file." msgstr "" -#: ../../library/importlib.resources.abc.rst:121 -#: ../../library/importlib.resources.abc.rst:125 +#: ../../library/importlib.resources.abc.rst:114 +#: ../../library/importlib.resources.abc.rst:118 msgid "Return Traversable child in self." msgstr "" -#: ../../library/importlib.resources.abc.rst:129 +#: ../../library/importlib.resources.abc.rst:122 msgid "" "*mode* may be 'r' or 'rb' to open as text or binary. Return a handle " "suitable for reading (same as :attr:`pathlib.Path.open`)." msgstr "" -#: ../../library/importlib.resources.abc.rst:132 +#: ../../library/importlib.resources.abc.rst:125 msgid "" "When opening as text, accepts encoding parameters such as those accepted by :" "class:`io.TextIOWrapper`." msgstr "" -#: ../../library/importlib.resources.abc.rst:137 +#: ../../library/importlib.resources.abc.rst:130 msgid "Read contents of self as bytes." msgstr "" -#: ../../library/importlib.resources.abc.rst:141 +#: ../../library/importlib.resources.abc.rst:134 msgid "Read contents of self as text." msgstr "" -#: ../../library/importlib.resources.abc.rst:146 +#: ../../library/importlib.resources.abc.rst:139 msgid "" "An abstract base class for resource readers capable of serving the :meth:" "`importlib.resources.files` interface. Subclasses :class:`ResourceReader` " @@ -183,13 +178,13 @@ msgid "" "TraversableResources` also supplies :class:`!ResourceReader`." msgstr "" -#: ../../library/importlib.resources.abc.rst:153 +#: ../../library/importlib.resources.abc.rst:146 msgid "" "Loaders that wish to support resource reading are expected to implement this " "interface." msgstr "" -#: ../../library/importlib.resources.abc.rst:163 +#: ../../library/importlib.resources.abc.rst:151 msgid "" "Returns a :class:`importlib.resources.abc.Traversable` object for the loaded " "package." diff --git a/library/importlib.resources.po b/library/importlib.resources.po index 0ea74a8221..927b9c1463 100644 --- a/library/importlib.resources.po +++ b/library/importlib.resources.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-09-09 00:03+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -116,28 +116,32 @@ msgstr "" #: ../../library/importlib.resources.rst:84 msgid "" "Given a :class:`~importlib.resources.abc.Traversable` object representing a " -"file, typically from :func:`importlib.resources.files`, return a context " -"manager for use in a :keyword:`with` statement. The context manager provides " -"a :class:`pathlib.Path` object." +"file or directory, typically from :func:`importlib.resources.files`, return " +"a context manager for use in a :keyword:`with` statement. The context " +"manager provides a :class:`pathlib.Path` object." msgstr "" #: ../../library/importlib.resources.rst:89 msgid "" -"Exiting the context manager cleans up any temporary file created when the " -"resource was extracted from e.g. a zip file." +"Exiting the context manager cleans up any temporary file or directory " +"created when the resource was extracted from e.g. a zip file." msgstr "" #: ../../library/importlib.resources.rst:92 msgid "" "Use ``as_file`` when the Traversable methods (``read_text``, etc) are " -"insufficient and an actual file on the file system is required." +"insufficient and an actual file or directory on the file system is required." +msgstr "" + +#: ../../library/importlib.resources.rst:98 +msgid "Added support for ``traversable`` representing a directory." msgstr "" -#: ../../library/importlib.resources.rst:100 +#: ../../library/importlib.resources.rst:103 msgid "Deprecated functions" msgstr "已棄用函式" -#: ../../library/importlib.resources.rst:102 +#: ../../library/importlib.resources.rst:105 msgid "" "An older, deprecated set of functions is still available, but is scheduled " "for removal in a future version of Python. The main drawback of these " @@ -145,7 +149,7 @@ msgid "" "are located directly within a *package*." msgstr "" -#: ../../library/importlib.resources.rst:109 +#: ../../library/importlib.resources.rst:112 msgid "" "Whenever a function accepts a ``Package`` argument, you can pass in either " "a :class:`module object ` or a module name as a string. " @@ -153,25 +157,25 @@ msgid "" "submodule_search_locations`` is not ``None``." msgstr "" -#: ../../library/importlib.resources.rst:114 +#: ../../library/importlib.resources.rst:117 msgid "The ``Package`` type is defined as ``Union[str, ModuleType]``." msgstr "" -#: ../../library/importlib.resources.rst:121 +#: ../../library/importlib.resources.rst:124 msgid "" "For *resource* arguments of the functions below, you can pass in the name of " "a resource as a string or a :class:`path-like object `." msgstr "" -#: ../../library/importlib.resources.rst:125 +#: ../../library/importlib.resources.rst:128 msgid "The ``Resource`` type is defined as ``Union[str, os.PathLike]``." msgstr "" -#: ../../library/importlib.resources.rst:130 +#: ../../library/importlib.resources.rst:133 msgid "Open for binary reading the *resource* within *package*." msgstr "" -#: ../../library/importlib.resources.rst:132 +#: ../../library/importlib.resources.rst:135 msgid "" "*package* is either a name or a module object which conforms to the " "``Package`` requirements. *resource* is the name of the resource to open " @@ -180,22 +184,22 @@ msgid "" "BinaryIO`` instance, a binary I/O stream open for reading." msgstr "" -#: ../../library/importlib.resources.rst:140 -#: ../../library/importlib.resources.rst:161 -#: ../../library/importlib.resources.rst:179 -#: ../../library/importlib.resources.rst:198 -#: ../../library/importlib.resources.rst:234 -#: ../../library/importlib.resources.rst:250 +#: ../../library/importlib.resources.rst:143 +#: ../../library/importlib.resources.rst:164 +#: ../../library/importlib.resources.rst:182 +#: ../../library/importlib.resources.rst:201 +#: ../../library/importlib.resources.rst:237 +#: ../../library/importlib.resources.rst:253 msgid "Calls to this function can be replaced by::" msgstr "" -#: ../../library/importlib.resources.rst:147 +#: ../../library/importlib.resources.rst:150 msgid "" "Open for text reading the *resource* within *package*. By default, the " "resource is opened for reading as UTF-8." msgstr "" -#: ../../library/importlib.resources.rst:150 +#: ../../library/importlib.resources.rst:153 msgid "" "*package* is either a name or a module object which conforms to the " "``Package`` requirements. *resource* is the name of the resource to open " @@ -204,18 +208,18 @@ msgid "" "same meaning as with built-in :func:`open`." msgstr "" -#: ../../library/importlib.resources.rst:156 +#: ../../library/importlib.resources.rst:159 msgid "" "This function returns a ``typing.TextIO`` instance, a text I/O stream open " "for reading." msgstr "" -#: ../../library/importlib.resources.rst:168 +#: ../../library/importlib.resources.rst:171 msgid "" "Read and return the contents of the *resource* within *package* as ``bytes``." msgstr "" -#: ../../library/importlib.resources.rst:171 +#: ../../library/importlib.resources.rst:174 msgid "" "*package* is either a name or a module object which conforms to the " "``Package`` requirements. *resource* is the name of the resource to open " @@ -224,13 +228,13 @@ msgid "" "contents of the resource as :class:`bytes`." msgstr "" -#: ../../library/importlib.resources.rst:186 +#: ../../library/importlib.resources.rst:189 msgid "" "Read and return the contents of *resource* within *package* as a ``str``. By " "default, the contents are read as strict UTF-8." msgstr "" -#: ../../library/importlib.resources.rst:189 +#: ../../library/importlib.resources.rst:192 msgid "" "*package* is either a name or a module object which conforms to the " "``Package`` requirements. *resource* is the name of the resource to open " @@ -240,20 +244,20 @@ msgid "" "contents of the resource as :class:`str`." msgstr "" -#: ../../library/importlib.resources.rst:205 +#: ../../library/importlib.resources.rst:208 msgid "" "Return the path to the *resource* as an actual file system path. This " "function returns a context manager for use in a :keyword:`with` statement. " "The context manager provides a :class:`pathlib.Path` object." msgstr "" -#: ../../library/importlib.resources.rst:209 +#: ../../library/importlib.resources.rst:212 msgid "" "Exiting the context manager cleans up any temporary file created when the " "resource needs to be extracted from e.g. a zip file." msgstr "" -#: ../../library/importlib.resources.rst:212 +#: ../../library/importlib.resources.rst:215 msgid "" "*package* is either a name or a module object which conforms to the " "``Package`` requirements. *resource* is the name of the resource to open " @@ -261,11 +265,11 @@ msgid "" "resources (i.e. it cannot be a directory)." msgstr "" -#: ../../library/importlib.resources.rst:219 +#: ../../library/importlib.resources.rst:222 msgid "Calls to this function can be replaced using :func:`as_file`::" msgstr "" -#: ../../library/importlib.resources.rst:226 +#: ../../library/importlib.resources.rst:229 msgid "" "Return ``True`` if there is a resource named *name* in the package, " "otherwise ``False``. This function does not consider directories to be " @@ -273,14 +277,14 @@ msgid "" "the ``Package`` requirements." msgstr "" -#: ../../library/importlib.resources.rst:241 +#: ../../library/importlib.resources.rst:244 msgid "" "Return an iterable over the named items within the package. The iterable " "returns :class:`str` resources (e.g. files) and non-resources (e.g. " "directories). The iterable does not recurse into subdirectories." msgstr "" -#: ../../library/importlib.resources.rst:245 +#: ../../library/importlib.resources.rst:248 msgid "" "*package* is either a name or a module object which conforms to the " "``Package`` requirements." diff --git a/library/inspect.po b/library/inspect.po index 3a1d2173e9..65cac3464a 100644 --- a/library/inspect.po +++ b/library/inspect.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-09-06 16:53+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-" @@ -1027,8 +1027,8 @@ msgstr "" #: ../../library/inspect.rst:733 msgid "" -"Create a new Signature instance based on the instance replace was invoked " -"on. It is possible to pass different ``parameters`` and/or " +"Create a new Signature instance based on the instance :meth:`replace` was " +"invoked on. It is possible to pass different ``parameters`` and/or " "``return_annotation`` to override the corresponding properties of the base " "signature. To remove return_annotation from the copied Signature, pass in :" "attr:`Signature.empty`." diff --git a/library/io.po b/library/io.po index 4c42b73fc0..fba54e7c27 100644 --- a/library/io.po +++ b/library/io.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-23 00:03+0000\n" +"POT-Creation-Date: 2023-08-30 00:04+0000\n" "PO-Revision-Date: 2023-08-01 12:20+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -77,7 +77,7 @@ msgstr "" "原本會引發 :exc:`IOError` 的操作,現在將改成引發 :exc:`OSError`。因為 :exc:" "`IOError` 現在是 :exc:`OSError` 的別名。" -#: ../../library/io.rst:51 ../../library/io.rst:856 ../../library/io.rst:1139 +#: ../../library/io.rst:51 ../../library/io.rst:855 ../../library/io.rst:1149 msgid "Text I/O" msgstr "文字 I/O" @@ -115,7 +115,7 @@ msgid "" "`TextIOBase`." msgstr "文字資料串流 API 的詳細說明在 :class:`TextIOBase` 文件當中。" -#: ../../library/io.rst:72 ../../library/io.rst:1127 +#: ../../library/io.rst:72 ../../library/io.rst:1137 msgid "Binary I/O" msgstr "二進位 (Binary) I/O" @@ -665,54 +665,51 @@ msgstr "" #: ../../library/io.rst:408 msgid "" -"Change the stream position to the given byte *offset*. *offset* is " -"interpreted relative to the position indicated by *whence*. The default " -"value for *whence* is :data:`!SEEK_SET`. Values for *whence* are:" +"Change the stream position to the given byte *offset*, interpreted relative " +"to the position indicated by *whence*, and return the new absolute position. " +"Values for *whence* are:" msgstr "" -#: ../../library/io.rst:412 +#: ../../library/io.rst:413 msgid "" -":data:`!SEEK_SET` or ``0`` -- start of the stream (the default); *offset* " +":data:`os.SEEK_SET` or ``0`` -- start of the stream (the default); *offset* " "should be zero or positive" msgstr "" -#: ../../library/io.rst:414 +#: ../../library/io.rst:415 msgid "" -":data:`!SEEK_CUR` or ``1`` -- current stream position; *offset* may be " +":data:`os.SEEK_CUR` or ``1`` -- current stream position; *offset* may be " "negative" msgstr "" -#: ../../library/io.rst:416 +#: ../../library/io.rst:417 msgid "" -":data:`!SEEK_END` or ``2`` -- end of the stream; *offset* is usually negative" -msgstr "" - -#: ../../library/io.rst:419 -msgid "Return the new absolute position." +":data:`os.SEEK_END` or ``2`` -- end of the stream; *offset* is usually " +"negative" msgstr "" -#: ../../library/io.rst:421 ../../library/io.rst:931 +#: ../../library/io.rst:420 ../../library/io.rst:930 msgid "The :data:`!SEEK_*` constants." msgstr "" -#: ../../library/io.rst:424 +#: ../../library/io.rst:423 msgid "" "Some operating systems could support additional values, like :const:`os." "SEEK_HOLE` or :const:`os.SEEK_DATA`. The valid values for a file could " "depend on it being open in text or binary mode." msgstr "" -#: ../../library/io.rst:431 +#: ../../library/io.rst:430 msgid "" "Return ``True`` if the stream supports random access. If ``False``, :meth:" "`seek`, :meth:`tell` and :meth:`truncate` will raise :exc:`OSError`." msgstr "" -#: ../../library/io.rst:436 +#: ../../library/io.rst:435 msgid "Return the current stream position." msgstr "" -#: ../../library/io.rst:440 +#: ../../library/io.rst:439 msgid "" "Resize the stream to the given *size* in bytes (or the current position if " "*size* is not specified). The current stream position isn't changed. This " @@ -721,34 +718,34 @@ msgid "" "additional bytes are zero-filled). The new file size is returned." msgstr "" -#: ../../library/io.rst:447 +#: ../../library/io.rst:446 msgid "Windows will now zero-fill files when extending." msgstr "" -#: ../../library/io.rst:452 +#: ../../library/io.rst:451 msgid "" "Return ``True`` if the stream supports writing. If ``False``, :meth:`!" "write` and :meth:`truncate` will raise :exc:`OSError`." msgstr "" -#: ../../library/io.rst:457 +#: ../../library/io.rst:456 msgid "" "Write a list of lines to the stream. Line separators are not added, so it " "is usual for each of the lines provided to have a line separator at the end." msgstr "" -#: ../../library/io.rst:463 +#: ../../library/io.rst:462 msgid "" "Prepare for object destruction. :class:`IOBase` provides a default " "implementation of this method that calls the instance's :meth:`~IOBase." "close` method." msgstr "" -#: ../../library/io.rst:470 +#: ../../library/io.rst:469 msgid "Base class for raw binary streams. It inherits :class:`IOBase`." msgstr "" -#: ../../library/io.rst:472 +#: ../../library/io.rst:471 msgid "" "Raw binary streams typically provide low-level access to an underlying OS " "device or API, and do not try to encapsulate it in high-level primitives " @@ -756,13 +753,13 @@ msgid "" "text streams, described later in this page)." msgstr "" -#: ../../library/io.rst:477 +#: ../../library/io.rst:476 msgid "" ":class:`RawIOBase` provides these methods in addition to those from :class:" "`IOBase`:" msgstr "" -#: ../../library/io.rst:482 +#: ../../library/io.rst:481 msgid "" "Read up to *size* bytes from the object and return them. As a convenience, " "if *size* is unspecified or -1, all bytes until EOF are returned. Otherwise, " @@ -770,25 +767,25 @@ msgid "" "if the operating system call returns fewer than *size* bytes." msgstr "" -#: ../../library/io.rst:487 +#: ../../library/io.rst:486 msgid "" "If 0 bytes are returned, and *size* was not 0, this indicates end of file. " "If the object is in non-blocking mode and no bytes are available, ``None`` " "is returned." msgstr "" -#: ../../library/io.rst:491 +#: ../../library/io.rst:490 msgid "" "The default implementation defers to :meth:`readall` and :meth:`readinto`." msgstr "" -#: ../../library/io.rst:496 +#: ../../library/io.rst:495 msgid "" "Read and return all the bytes from the stream until EOF, using multiple " "calls to the stream if necessary." msgstr "" -#: ../../library/io.rst:501 +#: ../../library/io.rst:500 msgid "" "Read bytes into a pre-allocated, writable :term:`bytes-like object` *b*, and " "return the number of bytes read. For example, *b* might be a :class:" @@ -796,7 +793,7 @@ msgid "" "available, ``None`` is returned." msgstr "" -#: ../../library/io.rst:509 +#: ../../library/io.rst:508 msgid "" "Write the given :term:`bytes-like object`, *b*, to the underlying raw " "stream, and return the number of bytes written. This can be less than the " @@ -807,13 +804,13 @@ msgid "" "the implementation should only access *b* during the method call." msgstr "" -#: ../../library/io.rst:522 +#: ../../library/io.rst:521 msgid "" "Base class for binary streams that support some kind of buffering. It " "inherits :class:`IOBase`." msgstr "" -#: ../../library/io.rst:525 +#: ../../library/io.rst:524 msgid "" "The main difference with :class:`RawIOBase` is that methods :meth:`read`, :" "meth:`readinto` and :meth:`write` will try (respectively) to read as much " @@ -821,7 +818,7 @@ msgid "" "perhaps more than one system call." msgstr "" -#: ../../library/io.rst:530 +#: ../../library/io.rst:529 msgid "" "In addition, those methods can raise :exc:`BlockingIOError` if the " "underlying raw stream is in non-blocking mode and cannot take or give enough " @@ -829,55 +826,55 @@ msgid "" "``None``." msgstr "" -#: ../../library/io.rst:535 +#: ../../library/io.rst:534 msgid "" "Besides, the :meth:`read` method does not have a default implementation that " "defers to :meth:`readinto`." msgstr "" -#: ../../library/io.rst:538 +#: ../../library/io.rst:537 msgid "" "A typical :class:`BufferedIOBase` implementation should not inherit from a :" "class:`RawIOBase` implementation, but wrap one, like :class:`BufferedWriter` " "and :class:`BufferedReader` do." msgstr "" -#: ../../library/io.rst:542 +#: ../../library/io.rst:541 msgid "" ":class:`BufferedIOBase` provides or overrides these data attributes and " "methods in addition to those from :class:`IOBase`:" msgstr "" -#: ../../library/io.rst:547 +#: ../../library/io.rst:546 msgid "" "The underlying raw stream (a :class:`RawIOBase` instance) that :class:" "`BufferedIOBase` deals with. This is not part of the :class:" "`BufferedIOBase` API and may not exist on some implementations." msgstr "" -#: ../../library/io.rst:553 +#: ../../library/io.rst:552 msgid "Separate the underlying raw stream from the buffer and return it." msgstr "" -#: ../../library/io.rst:555 +#: ../../library/io.rst:554 msgid "" "After the raw stream has been detached, the buffer is in an unusable state." msgstr "" -#: ../../library/io.rst:558 +#: ../../library/io.rst:557 msgid "" "Some buffers, like :class:`BytesIO`, do not have the concept of a single raw " "stream to return from this method. They raise :exc:`UnsupportedOperation`." msgstr "" -#: ../../library/io.rst:566 +#: ../../library/io.rst:565 msgid "" "Read and return up to *size* bytes. If the argument is omitted, ``None``, " "or negative, data is read and returned until EOF is reached. An empty :" "class:`bytes` object is returned if the stream is already at EOF." msgstr "" -#: ../../library/io.rst:570 +#: ../../library/io.rst:569 msgid "" "If the argument is positive, and the underlying raw stream is not " "interactive, multiple raw reads may be issued to satisfy the byte count " @@ -886,13 +883,13 @@ msgid "" "imminent." msgstr "" -#: ../../library/io.rst:576 ../../library/io.rst:599 ../../library/io.rst:609 +#: ../../library/io.rst:575 ../../library/io.rst:598 ../../library/io.rst:608 msgid "" "A :exc:`BlockingIOError` is raised if the underlying raw stream is in non " "blocking-mode, and has no data available at the moment." msgstr "" -#: ../../library/io.rst:581 +#: ../../library/io.rst:580 msgid "" "Read and return up to *size* bytes, with at most one call to the underlying " "raw stream's :meth:`~RawIOBase.read` (or :meth:`~RawIOBase.readinto`) " @@ -900,26 +897,26 @@ msgid "" "top of a :class:`BufferedIOBase` object." msgstr "" -#: ../../library/io.rst:587 +#: ../../library/io.rst:586 msgid "" "If *size* is ``-1`` (the default), an arbitrary number of bytes are returned " "(more than zero unless EOF is reached)." msgstr "" -#: ../../library/io.rst:592 +#: ../../library/io.rst:591 msgid "" "Read bytes into a pre-allocated, writable :term:`bytes-like object` *b* and " "return the number of bytes read. For example, *b* might be a :class:" "`bytearray`." msgstr "" -#: ../../library/io.rst:596 +#: ../../library/io.rst:595 msgid "" "Like :meth:`read`, multiple reads may be issued to the underlying raw " "stream, unless the latter is interactive." msgstr "" -#: ../../library/io.rst:604 +#: ../../library/io.rst:603 msgid "" "Read bytes into a pre-allocated, writable :term:`bytes-like object` *b*, " "using at most one call to the underlying raw stream's :meth:`~RawIOBase." @@ -927,7 +924,7 @@ msgid "" "read." msgstr "" -#: ../../library/io.rst:616 +#: ../../library/io.rst:615 msgid "" "Write the given :term:`bytes-like object`, *b*, and return the number of " "bytes written (always equal to the length of *b* in bytes, since if the " @@ -936,41 +933,41 @@ msgid "" "or held in a buffer for performance and latency reasons." msgstr "" -#: ../../library/io.rst:623 +#: ../../library/io.rst:622 msgid "" "When in non-blocking mode, a :exc:`BlockingIOError` is raised if the data " "needed to be written to the raw stream but it couldn't accept all the data " "without blocking." msgstr "" -#: ../../library/io.rst:627 +#: ../../library/io.rst:626 msgid "" "The caller may release or mutate *b* after this method returns, so the " "implementation should only access *b* during the method call." msgstr "" -#: ../../library/io.rst:632 +#: ../../library/io.rst:631 msgid "Raw File I/O" msgstr "" -#: ../../library/io.rst:636 +#: ../../library/io.rst:635 msgid "" "A raw binary stream representing an OS-level file containing bytes data. It " "inherits :class:`RawIOBase`." msgstr "" -#: ../../library/io.rst:639 +#: ../../library/io.rst:638 msgid "The *name* can be one of two things:" msgstr "" -#: ../../library/io.rst:641 +#: ../../library/io.rst:640 msgid "" "a character string or :class:`bytes` object representing the path to the " "file which will be opened. In this case closefd must be ``True`` (the " "default) otherwise an error will be raised." msgstr "" -#: ../../library/io.rst:644 +#: ../../library/io.rst:643 msgid "" "an integer representing the number of an existing OS-level file descriptor " "to which the resulting :class:`FileIO` object will give access. When the " @@ -978,7 +975,7 @@ msgid "" "set to ``False``." msgstr "" -#: ../../library/io.rst:649 +#: ../../library/io.rst:648 msgid "" "The *mode* can be ``'r'``, ``'w'``, ``'x'`` or ``'a'`` for reading " "(default), writing, exclusive creation or appending. The file will be " @@ -989,14 +986,14 @@ msgid "" "``'+'`` to the mode to allow simultaneous reading and writing." msgstr "" -#: ../../library/io.rst:657 +#: ../../library/io.rst:656 msgid "" "The :meth:`~RawIOBase.read` (when called with a positive argument), :meth:" "`~RawIOBase.readinto` and :meth:`~RawIOBase.write` methods on this class " "will only make one system call." msgstr "" -#: ../../library/io.rst:661 +#: ../../library/io.rst:660 msgid "" "A custom opener can be used by passing a callable as *opener*. The " "underlying file descriptor for the file object is then obtained by calling " @@ -1005,372 +1002,372 @@ msgid "" "similar to passing ``None``)." msgstr "" -#: ../../library/io.rst:667 +#: ../../library/io.rst:666 msgid "The newly created file is :ref:`non-inheritable `." msgstr "" -#: ../../library/io.rst:669 +#: ../../library/io.rst:668 msgid "" "See the :func:`open` built-in function for examples on using the *opener* " "parameter." msgstr "" -#: ../../library/io.rst:672 +#: ../../library/io.rst:671 msgid "The *opener* parameter was added. The ``'x'`` mode was added." msgstr "" -#: ../../library/io.rst:676 +#: ../../library/io.rst:675 msgid "The file is now non-inheritable." msgstr "" -#: ../../library/io.rst:679 +#: ../../library/io.rst:678 msgid "" ":class:`FileIO` provides these data attributes in addition to those from :" "class:`RawIOBase` and :class:`IOBase`:" msgstr "" -#: ../../library/io.rst:684 +#: ../../library/io.rst:683 msgid "The mode as given in the constructor." msgstr "" -#: ../../library/io.rst:688 +#: ../../library/io.rst:687 msgid "" "The file name. This is the file descriptor of the file when no name is " "given in the constructor." msgstr "" -#: ../../library/io.rst:693 +#: ../../library/io.rst:692 msgid "Buffered Streams" msgstr "" -#: ../../library/io.rst:695 +#: ../../library/io.rst:694 msgid "" "Buffered I/O streams provide a higher-level interface to an I/O device than " "raw I/O does." msgstr "" -#: ../../library/io.rst:700 +#: ../../library/io.rst:699 msgid "" "A binary stream using an in-memory bytes buffer. It inherits :class:" "`BufferedIOBase`. The buffer is discarded when the :meth:`~IOBase.close` " "method is called." msgstr "" -#: ../../library/io.rst:704 +#: ../../library/io.rst:703 msgid "" "The optional argument *initial_bytes* is a :term:`bytes-like object` that " "contains initial data." msgstr "" -#: ../../library/io.rst:707 +#: ../../library/io.rst:706 msgid "" ":class:`BytesIO` provides or overrides these methods in addition to those " "from :class:`BufferedIOBase` and :class:`IOBase`:" msgstr "" -#: ../../library/io.rst:712 +#: ../../library/io.rst:711 msgid "" "Return a readable and writable view over the contents of the buffer without " "copying them. Also, mutating the view will transparently update the " "contents of the buffer::" msgstr "" -#: ../../library/io.rst:723 +#: ../../library/io.rst:722 msgid "" "As long as the view exists, the :class:`BytesIO` object cannot be resized or " "closed." msgstr "" -#: ../../library/io.rst:730 +#: ../../library/io.rst:729 msgid "Return :class:`bytes` containing the entire contents of the buffer." msgstr "" -#: ../../library/io.rst:735 +#: ../../library/io.rst:734 msgid "In :class:`BytesIO`, this is the same as :meth:`~BufferedIOBase.read`." msgstr "" -#: ../../library/io.rst:737 ../../library/io.rst:780 +#: ../../library/io.rst:736 ../../library/io.rst:779 msgid "The *size* argument is now optional." msgstr "" -#: ../../library/io.rst:742 +#: ../../library/io.rst:741 msgid "" "In :class:`BytesIO`, this is the same as :meth:`~BufferedIOBase.readinto`." msgstr "" -#: ../../library/io.rst:748 +#: ../../library/io.rst:747 msgid "" "A buffered binary stream providing higher-level access to a readable, non " "seekable :class:`RawIOBase` raw binary stream. It inherits :class:" "`BufferedIOBase`." msgstr "" -#: ../../library/io.rst:752 +#: ../../library/io.rst:751 msgid "" "When reading data from this object, a larger amount of data may be requested " "from the underlying raw stream, and kept in an internal buffer. The buffered " "data can then be returned directly on subsequent reads." msgstr "" -#: ../../library/io.rst:756 +#: ../../library/io.rst:755 msgid "" "The constructor creates a :class:`BufferedReader` for the given readable " "*raw* stream and *buffer_size*. If *buffer_size* is omitted, :data:" "`DEFAULT_BUFFER_SIZE` is used." msgstr "" -#: ../../library/io.rst:760 +#: ../../library/io.rst:759 msgid "" ":class:`BufferedReader` provides or overrides these methods in addition to " "those from :class:`BufferedIOBase` and :class:`IOBase`:" msgstr "" -#: ../../library/io.rst:765 +#: ../../library/io.rst:764 msgid "" "Return bytes from the stream without advancing the position. At most one " "single read on the raw stream is done to satisfy the call. The number of " "bytes returned may be less or more than requested." msgstr "" -#: ../../library/io.rst:771 +#: ../../library/io.rst:770 msgid "" "Read and return *size* bytes, or if *size* is not given or negative, until " "EOF or if the read call would block in non-blocking mode." msgstr "" -#: ../../library/io.rst:776 +#: ../../library/io.rst:775 msgid "" "Read and return up to *size* bytes with only one call on the raw stream. If " "at least one byte is buffered, only buffered bytes are returned. Otherwise, " "one raw stream read call is made." msgstr "" -#: ../../library/io.rst:786 +#: ../../library/io.rst:785 msgid "" "A buffered binary stream providing higher-level access to a writeable, non " "seekable :class:`RawIOBase` raw binary stream. It inherits :class:" "`BufferedIOBase`." msgstr "" -#: ../../library/io.rst:790 +#: ../../library/io.rst:789 msgid "" "When writing to this object, data is normally placed into an internal " "buffer. The buffer will be written out to the underlying :class:`RawIOBase` " "object under various conditions, including:" msgstr "" -#: ../../library/io.rst:794 +#: ../../library/io.rst:793 msgid "when the buffer gets too small for all pending data;" msgstr "" -#: ../../library/io.rst:795 +#: ../../library/io.rst:794 msgid "when :meth:`flush` is called;" msgstr "" -#: ../../library/io.rst:796 +#: ../../library/io.rst:795 msgid "" "when a :meth:`~IOBase.seek` is requested (for :class:`BufferedRandom` " "objects);" msgstr "" -#: ../../library/io.rst:797 +#: ../../library/io.rst:796 msgid "when the :class:`BufferedWriter` object is closed or destroyed." msgstr "" -#: ../../library/io.rst:799 +#: ../../library/io.rst:798 msgid "" "The constructor creates a :class:`BufferedWriter` for the given writeable " "*raw* stream. If the *buffer_size* is not given, it defaults to :data:" "`DEFAULT_BUFFER_SIZE`." msgstr "" -#: ../../library/io.rst:803 +#: ../../library/io.rst:802 msgid "" ":class:`BufferedWriter` provides or overrides these methods in addition to " "those from :class:`BufferedIOBase` and :class:`IOBase`:" msgstr "" -#: ../../library/io.rst:808 +#: ../../library/io.rst:807 msgid "" "Force bytes held in the buffer into the raw stream. A :exc:" "`BlockingIOError` should be raised if the raw stream blocks." msgstr "" -#: ../../library/io.rst:813 +#: ../../library/io.rst:812 msgid "" "Write the :term:`bytes-like object`, *b*, and return the number of bytes " "written. When in non-blocking mode, a :exc:`BlockingIOError` is raised if " "the buffer needs to be written out but the raw stream blocks." msgstr "" -#: ../../library/io.rst:821 +#: ../../library/io.rst:820 msgid "" "A buffered binary stream providing higher-level access to a seekable :class:" "`RawIOBase` raw binary stream. It inherits :class:`BufferedReader` and :" "class:`BufferedWriter`." msgstr "" -#: ../../library/io.rst:825 +#: ../../library/io.rst:824 msgid "" "The constructor creates a reader and writer for a seekable raw stream, given " "in the first argument. If the *buffer_size* is omitted it defaults to :data:" "`DEFAULT_BUFFER_SIZE`." msgstr "" -#: ../../library/io.rst:829 +#: ../../library/io.rst:828 msgid "" ":class:`BufferedRandom` is capable of anything :class:`BufferedReader` or :" "class:`BufferedWriter` can do. In addition, :meth:`~IOBase.seek` and :meth:" "`~IOBase.tell` are guaranteed to be implemented." msgstr "" -#: ../../library/io.rst:836 +#: ../../library/io.rst:835 msgid "" "A buffered binary stream providing higher-level access to two non seekable :" "class:`RawIOBase` raw binary streams---one readable, the other writeable. It " "inherits :class:`BufferedIOBase`." msgstr "" -#: ../../library/io.rst:840 +#: ../../library/io.rst:839 msgid "" "*reader* and *writer* are :class:`RawIOBase` objects that are readable and " "writeable respectively. If the *buffer_size* is omitted it defaults to :" "data:`DEFAULT_BUFFER_SIZE`." msgstr "" -#: ../../library/io.rst:844 +#: ../../library/io.rst:843 msgid "" ":class:`BufferedRWPair` implements all of :class:`BufferedIOBase`\\'s " "methods except for :meth:`~BufferedIOBase.detach`, which raises :exc:" "`UnsupportedOperation`." msgstr "" -#: ../../library/io.rst:850 +#: ../../library/io.rst:849 msgid "" ":class:`BufferedRWPair` does not attempt to synchronize accesses to its " "underlying raw streams. You should not pass it the same object as reader " "and writer; use :class:`BufferedRandom` instead." msgstr "" -#: ../../library/io.rst:860 +#: ../../library/io.rst:859 msgid "" "Base class for text streams. This class provides a character and line based " "interface to stream I/O. It inherits :class:`IOBase`." msgstr "" -#: ../../library/io.rst:863 +#: ../../library/io.rst:862 msgid "" ":class:`TextIOBase` provides or overrides these data attributes and methods " "in addition to those from :class:`IOBase`:" msgstr "" -#: ../../library/io.rst:868 +#: ../../library/io.rst:867 msgid "" "The name of the encoding used to decode the stream's bytes into strings, and " "to encode strings into bytes." msgstr "" -#: ../../library/io.rst:873 +#: ../../library/io.rst:872 msgid "The error setting of the decoder or encoder." msgstr "" -#: ../../library/io.rst:877 +#: ../../library/io.rst:876 msgid "" "A string, a tuple of strings, or ``None``, indicating the newlines " "translated so far. Depending on the implementation and the initial " "constructor flags, this may not be available." msgstr "" -#: ../../library/io.rst:883 +#: ../../library/io.rst:882 msgid "" "The underlying binary buffer (a :class:`BufferedIOBase` instance) that :" "class:`TextIOBase` deals with. This is not part of the :class:`TextIOBase` " "API and may not exist in some implementations." msgstr "" -#: ../../library/io.rst:889 +#: ../../library/io.rst:888 msgid "" "Separate the underlying binary buffer from the :class:`TextIOBase` and " "return it." msgstr "" -#: ../../library/io.rst:892 +#: ../../library/io.rst:891 msgid "" "After the underlying buffer has been detached, the :class:`TextIOBase` is in " "an unusable state." msgstr "" -#: ../../library/io.rst:895 +#: ../../library/io.rst:894 msgid "" "Some :class:`TextIOBase` implementations, like :class:`StringIO`, may not " "have the concept of an underlying buffer and calling this method will raise :" "exc:`UnsupportedOperation`." msgstr "" -#: ../../library/io.rst:903 +#: ../../library/io.rst:902 msgid "" "Read and return at most *size* characters from the stream as a single :class:" "`str`. If *size* is negative or ``None``, reads until EOF." msgstr "" -#: ../../library/io.rst:908 +#: ../../library/io.rst:907 msgid "" "Read until newline or EOF and return a single :class:`str`. If the stream " "is already at EOF, an empty string is returned." msgstr "" -#: ../../library/io.rst:911 +#: ../../library/io.rst:910 msgid "If *size* is specified, at most *size* characters will be read." msgstr "" -#: ../../library/io.rst:915 +#: ../../library/io.rst:914 msgid "" "Change the stream position to the given *offset*. Behaviour depends on the " "*whence* parameter. The default value for *whence* is :data:`!SEEK_SET`." msgstr "" -#: ../../library/io.rst:919 +#: ../../library/io.rst:918 msgid "" ":data:`!SEEK_SET` or ``0``: seek from the start of the stream (the default); " "*offset* must either be a number returned by :meth:`TextIOBase.tell`, or " "zero. Any other *offset* value produces undefined behaviour." msgstr "" -#: ../../library/io.rst:923 +#: ../../library/io.rst:922 msgid "" ":data:`!SEEK_CUR` or ``1``: \"seek\" to the current position; *offset* must " "be zero, which is a no-operation (all other values are unsupported)." msgstr "" -#: ../../library/io.rst:926 +#: ../../library/io.rst:925 msgid "" ":data:`!SEEK_END` or ``2``: seek to the end of the stream; *offset* must be " "zero (all other values are unsupported)." msgstr "" -#: ../../library/io.rst:929 +#: ../../library/io.rst:928 msgid "Return the new absolute position as an opaque number." msgstr "" -#: ../../library/io.rst:936 +#: ../../library/io.rst:935 msgid "" "Return the current stream position as an opaque number. The number does not " "usually represent a number of bytes in the underlying binary storage." msgstr "" -#: ../../library/io.rst:942 +#: ../../library/io.rst:941 msgid "" "Write the string *s* to the stream and return the number of characters " "written." msgstr "" -#: ../../library/io.rst:949 +#: ../../library/io.rst:948 msgid "" "A buffered text stream providing higher-level access to a :class:" "`BufferedIOBase` buffered binary stream. It inherits :class:`TextIOBase`." msgstr "" -#: ../../library/io.rst:953 +#: ../../library/io.rst:952 msgid "" "*encoding* gives the name of the encoding that the stream will be decoded or " "encoded with. It defaults to :func:`locale.getencoding()`. " @@ -1378,7 +1375,7 @@ msgid "" "explicitly. See :ref:`io-text-encoding` for more information." msgstr "" -#: ../../library/io.rst:958 +#: ../../library/io.rst:957 msgid "" "*errors* is an optional string that specifies how encoding and decoding " "errors are to be handled. Pass ``'strict'`` to raise a :exc:`ValueError` " @@ -1393,13 +1390,13 @@ msgid "" "that has been registered with :func:`codecs.register_error` is also valid." msgstr "" -#: ../../library/io.rst:974 +#: ../../library/io.rst:973 msgid "" "*newline* controls how line endings are handled. It can be ``None``, " "``''``, ``'\\n'``, ``'\\r'``, and ``'\\r\\n'``. It works as follows:" msgstr "" -#: ../../library/io.rst:977 +#: ../../library/io.rst:976 msgid "" "When reading input from the stream, if *newline* is ``None``, :term:" "`universal newlines` mode is enabled. Lines in the input can end in " @@ -1411,7 +1408,7 @@ msgid "" "returned to the caller untranslated." msgstr "" -#: ../../library/io.rst:986 +#: ../../library/io.rst:985 msgid "" "When writing output to the stream, if *newline* is ``None``, any ``'\\n'`` " "characters written are translated to the system default line separator, :" @@ -1420,13 +1417,13 @@ msgid "" "characters written are translated to the given string." msgstr "" -#: ../../library/io.rst:992 +#: ../../library/io.rst:991 msgid "" "If *line_buffering* is ``True``, :meth:`~IOBase.flush` is implied when a " "call to write contains a newline character or a carriage return." msgstr "" -#: ../../library/io.rst:995 +#: ../../library/io.rst:994 msgid "" "If *write_through* is ``True``, calls to :meth:`~BufferedIOBase.write` are " "guaranteed not to be buffered: any data written on the :class:" @@ -1434,11 +1431,11 @@ msgid "" "*buffer*." msgstr "" -#: ../../library/io.rst:999 +#: ../../library/io.rst:998 msgid "The *write_through* argument has been added." msgstr "" -#: ../../library/io.rst:1002 +#: ../../library/io.rst:1001 msgid "" "The default *encoding* is now ``locale.getpreferredencoding(False)`` instead " "of ``locale.getpreferredencoding()``. Don't change temporary the locale " @@ -1446,97 +1443,108 @@ msgid "" "instead of the user preferred encoding." msgstr "" -#: ../../library/io.rst:1008 +#: ../../library/io.rst:1007 msgid "" "The *encoding* argument now supports the ``\"locale\"`` dummy encoding name." msgstr "" -#: ../../library/io.rst:1011 +#: ../../library/io.rst:1010 msgid "" ":class:`TextIOWrapper` provides these data attributes and methods in " "addition to those from :class:`TextIOBase` and :class:`IOBase`:" msgstr "" -#: ../../library/io.rst:1016 +#: ../../library/io.rst:1015 msgid "Whether line buffering is enabled." msgstr "" -#: ../../library/io.rst:1020 +#: ../../library/io.rst:1019 msgid "Whether writes are passed immediately to the underlying binary buffer." msgstr "" -#: ../../library/io.rst:1028 +#: ../../library/io.rst:1027 msgid "" "Reconfigure this text stream using new settings for *encoding*, *errors*, " "*newline*, *line_buffering* and *write_through*." msgstr "" -#: ../../library/io.rst:1031 +#: ../../library/io.rst:1030 msgid "" "Parameters not specified keep current settings, except ``errors='strict'`` " "is used when *encoding* is specified but *errors* is not specified." msgstr "" -#: ../../library/io.rst:1035 +#: ../../library/io.rst:1034 msgid "" "It is not possible to change the encoding or newline if some data has " "already been read from the stream. On the other hand, changing encoding " "after write is possible." msgstr "" -#: ../../library/io.rst:1039 +#: ../../library/io.rst:1038 msgid "" "This method does an implicit stream flush before setting the new parameters." msgstr "" -#: ../../library/io.rst:1044 +#: ../../library/io.rst:1043 msgid "The method supports ``encoding=\"locale\"`` option." msgstr "" -#: ../../library/io.rst:1049 +#: ../../library/io.rst:1048 msgid "" "Set the stream position. Return the new stream position as an :class:`int`." msgstr "" -#: ../../library/io.rst:1052 +#: ../../library/io.rst:1051 msgid "" "Four operations are supported, given by the following argument combinations:" msgstr "" -#: ../../library/io.rst:1055 +#: ../../library/io.rst:1054 msgid "``seek(0, SEEK_SET)``: Rewind to the start of the stream." msgstr "" -#: ../../library/io.rst:1056 +#: ../../library/io.rst:1055 msgid "" "``seek(cookie, SEEK_SET)``: Restore a previous position; *cookie* **must " -"be** a number returned by :meth:`!tell`." +"be** a number returned by :meth:`tell`." msgstr "" -#: ../../library/io.rst:1058 +#: ../../library/io.rst:1057 msgid "``seek(0, SEEK_END)``: Fast-forward to the end of the stream." msgstr "" -#: ../../library/io.rst:1059 +#: ../../library/io.rst:1058 msgid "``seek(0, SEEK_CUR)``: Leave the current stream position unchanged." msgstr "" -#: ../../library/io.rst:1061 +#: ../../library/io.rst:1060 msgid "Any other argument combinations are invalid, and may raise exceptions." msgstr "" -#: ../../library/io.rst:1066 +#: ../../library/io.rst:1065 +msgid ":data:`os.SEEK_SET`, :data:`os.SEEK_CUR`, and :data:`os.SEEK_END`." +msgstr "" + +#: ../../library/io.rst:1069 +msgid "" +"Return the stream position as an opaque number. The return value of :meth:`!" +"tell` can be given as input to :meth:`seek`, to restore a previous stream " +"position." +msgstr "" + +#: ../../library/io.rst:1076 msgid "" "A text stream using an in-memory text buffer. It inherits :class:" "`TextIOBase`." msgstr "" -#: ../../library/io.rst:1069 +#: ../../library/io.rst:1079 msgid "" "The text buffer is discarded when the :meth:`~IOBase.close` method is called." msgstr "" -#: ../../library/io.rst:1072 +#: ../../library/io.rst:1082 msgid "" "The initial value of the buffer can be set by providing *initial_value*. If " "newline translation is enabled, newlines will be encoded as if by :meth:" @@ -1548,50 +1556,50 @@ msgid "" "at the end of the buffer." msgstr "" -#: ../../library/io.rst:1081 +#: ../../library/io.rst:1091 msgid "" "The *newline* argument works like that of :class:`TextIOWrapper`, except " "that when writing output to the stream, if *newline* is ``None``, newlines " "are written as ``\\n`` on all platforms." msgstr "" -#: ../../library/io.rst:1085 +#: ../../library/io.rst:1095 msgid "" ":class:`StringIO` provides this method in addition to those from :class:" "`TextIOBase` and :class:`IOBase`:" msgstr "" -#: ../../library/io.rst:1090 +#: ../../library/io.rst:1100 msgid "" "Return a :class:`str` containing the entire contents of the buffer. Newlines " "are decoded as if by :meth:`~TextIOBase.read`, although the stream position " "is not changed." msgstr "" -#: ../../library/io.rst:1094 +#: ../../library/io.rst:1104 msgid "Example usage::" msgstr "" "使用範例:\n" "\n" "::" -#: ../../library/io.rst:1116 +#: ../../library/io.rst:1126 msgid "" "A helper codec that decodes newlines for :term:`universal newlines` mode. It " "inherits :class:`codecs.IncrementalDecoder`." msgstr "" -#: ../../library/io.rst:1121 +#: ../../library/io.rst:1131 msgid "Performance" msgstr "" -#: ../../library/io.rst:1123 +#: ../../library/io.rst:1133 msgid "" "This section discusses the performance of the provided concrete I/O " "implementations." msgstr "" -#: ../../library/io.rst:1129 +#: ../../library/io.rst:1139 msgid "" "By reading and writing only large chunks of data even when the user asks for " "a single byte, buffered I/O hides any inefficiency in calling and executing " @@ -1604,7 +1612,7 @@ msgid "" "data." msgstr "" -#: ../../library/io.rst:1141 +#: ../../library/io.rst:1151 msgid "" "Text I/O over a binary storage (such as a file) is significantly slower than " "binary I/O over the same storage, because it requires conversions between " @@ -1614,24 +1622,24 @@ msgid "" "the reconstruction algorithm used." msgstr "" -#: ../../library/io.rst:1148 +#: ../../library/io.rst:1158 msgid "" ":class:`StringIO`, however, is a native in-memory unicode container and will " "exhibit similar speed to :class:`BytesIO`." msgstr "" -#: ../../library/io.rst:1152 +#: ../../library/io.rst:1162 msgid "Multi-threading" msgstr "" -#: ../../library/io.rst:1154 +#: ../../library/io.rst:1164 msgid "" ":class:`FileIO` objects are thread-safe to the extent that the operating " "system calls (such as :manpage:`read(2)` under Unix) they wrap are thread-" "safe too." msgstr "" -#: ../../library/io.rst:1157 +#: ../../library/io.rst:1167 msgid "" "Binary buffered objects (instances of :class:`BufferedReader`, :class:" "`BufferedWriter`, :class:`BufferedRandom` and :class:`BufferedRWPair`) " @@ -1639,15 +1647,15 @@ msgid "" "them from multiple threads at once." msgstr "" -#: ../../library/io.rst:1162 +#: ../../library/io.rst:1172 msgid ":class:`TextIOWrapper` objects are not thread-safe." msgstr "" -#: ../../library/io.rst:1165 +#: ../../library/io.rst:1175 msgid "Reentrancy" msgstr "" -#: ../../library/io.rst:1167 +#: ../../library/io.rst:1177 msgid "" "Binary buffered objects (instances of :class:`BufferedReader`, :class:" "`BufferedWriter`, :class:`BufferedRandom` and :class:`BufferedRWPair`) are " @@ -1658,7 +1666,7 @@ msgid "" "from entering the buffered object." msgstr "" -#: ../../library/io.rst:1175 +#: ../../library/io.rst:1185 msgid "" "The above implicitly extends to text files, since the :func:`open()` " "function will wrap a buffered object inside a :class:`TextIOWrapper`. This " @@ -1674,14 +1682,14 @@ msgstr "file object(檔案物件)" msgid "io module" msgstr "io 模組" -#: ../../library/io.rst:971 ../../library/io.rst:1111 +#: ../../library/io.rst:970 ../../library/io.rst:1121 msgid "universal newlines" msgstr "universal newlines" -#: ../../library/io.rst:971 +#: ../../library/io.rst:970 msgid "io.TextIOWrapper class" msgstr "io.TextIOWrapper 類別" -#: ../../library/io.rst:1111 +#: ../../library/io.rst:1121 msgid "io.IncrementalNewlineDecoder class" msgstr "io.IncrementalNewlineDecoder 類別" diff --git a/library/itertools.po b/library/itertools.po index 91e47042bf..1bae04ba61 100644 --- a/library/itertools.po +++ b/library/itertools.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-09-13 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:04+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -889,6 +889,6 @@ msgid "" "term:`generator`\\s which incur interpreter overhead." msgstr "" -#: ../../library/itertools.rst:1025 +#: ../../library/itertools.rst:1022 msgid "The following recipes have a more mathematical flavor:" msgstr "" diff --git a/library/multiprocessing.po b/library/multiprocessing.po index df80d4e10b..2d6e9bd948 100644 --- a/library/multiprocessing.po +++ b/library/multiprocessing.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-08-31 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -3289,7 +3289,7 @@ msgstr "" #: ../../library/multiprocessing.rst:2990 msgid "" "Make sure that the main module can be safely imported by a new Python " -"interpreter without causing unintended side effects (such a starting a new " +"interpreter without causing unintended side effects (such as starting a new " "process)." msgstr "" diff --git a/library/os.po b/library/os.po index bfc519c83b..e7c91a433e 100644 --- a/library/os.po +++ b/library/os.po @@ -302,32 +302,32 @@ msgstr "" #: ../../library/os.rst:703 ../../library/os.rst:712 ../../library/os.rst:719 #: ../../library/os.rst:726 ../../library/os.rst:735 ../../library/os.rst:1161 #: ../../library/os.rst:1345 ../../library/os.rst:1371 -#: ../../library/os.rst:1608 ../../library/os.rst:1647 -#: ../../library/os.rst:1656 ../../library/os.rst:2020 -#: ../../library/os.rst:2109 ../../library/os.rst:2149 -#: ../../library/os.rst:2429 ../../library/os.rst:2451 -#: ../../library/os.rst:4035 ../../library/os.rst:4042 -#: ../../library/os.rst:4049 ../../library/os.rst:4056 -#: ../../library/os.rst:4063 ../../library/os.rst:4070 -#: ../../library/os.rst:4077 ../../library/os.rst:4085 -#: ../../library/os.rst:4093 ../../library/os.rst:4100 -#: ../../library/os.rst:4107 ../../library/os.rst:4116 -#: ../../library/os.rst:4124 ../../library/os.rst:4132 -#: ../../library/os.rst:4139 ../../library/os.rst:4146 -#: ../../library/os.rst:4167 ../../library/os.rst:4184 -#: ../../library/os.rst:4224 ../../library/os.rst:4231 -#: ../../library/os.rst:4261 ../../library/os.rst:4388 -#: ../../library/os.rst:4437 ../../library/os.rst:4674 -#: ../../library/os.rst:4708 ../../library/os.rst:4766 -#: ../../library/os.rst:4780 ../../library/os.rst:4797 -#: ../../library/os.rst:4812 ../../library/os.rst:4823 -#: ../../library/os.rst:4835 ../../library/os.rst:4848 -#: ../../library/os.rst:4857 ../../library/os.rst:4867 -#: ../../library/os.rst:4880 ../../library/os.rst:4931 -#: ../../library/os.rst:4942 ../../library/os.rst:4954 -#: ../../library/os.rst:4961 ../../library/os.rst:4970 -#: ../../library/os.rst:4979 ../../library/os.rst:4988 -#: ../../library/os.rst:4997 +#: ../../library/os.rst:1608 ../../library/os.rst:1628 +#: ../../library/os.rst:1637 ../../library/os.rst:2021 +#: ../../library/os.rst:2110 ../../library/os.rst:2150 +#: ../../library/os.rst:2430 ../../library/os.rst:2452 +#: ../../library/os.rst:4036 ../../library/os.rst:4043 +#: ../../library/os.rst:4050 ../../library/os.rst:4057 +#: ../../library/os.rst:4064 ../../library/os.rst:4071 +#: ../../library/os.rst:4078 ../../library/os.rst:4086 +#: ../../library/os.rst:4094 ../../library/os.rst:4101 +#: ../../library/os.rst:4108 ../../library/os.rst:4117 +#: ../../library/os.rst:4125 ../../library/os.rst:4133 +#: ../../library/os.rst:4140 ../../library/os.rst:4147 +#: ../../library/os.rst:4168 ../../library/os.rst:4185 +#: ../../library/os.rst:4225 ../../library/os.rst:4232 +#: ../../library/os.rst:4262 ../../library/os.rst:4389 +#: ../../library/os.rst:4438 ../../library/os.rst:4675 +#: ../../library/os.rst:4709 ../../library/os.rst:4767 +#: ../../library/os.rst:4781 ../../library/os.rst:4798 +#: ../../library/os.rst:4813 ../../library/os.rst:4824 +#: ../../library/os.rst:4836 ../../library/os.rst:4849 +#: ../../library/os.rst:4858 ../../library/os.rst:4868 +#: ../../library/os.rst:4881 ../../library/os.rst:4932 +#: ../../library/os.rst:4943 ../../library/os.rst:4955 +#: ../../library/os.rst:4962 ../../library/os.rst:4971 +#: ../../library/os.rst:4980 ../../library/os.rst:4989 +#: ../../library/os.rst:4998 msgid ":ref:`Availability `: Unix, not Emscripten, not WASI." msgstr ":ref:`適用 `:Unix、非 Emscripten、非 WASI。" @@ -484,11 +484,11 @@ msgstr "" #: ../../library/os.rst:322 ../../library/os.rst:1086 ../../library/os.rst:1097 #: ../../library/os.rst:1110 ../../library/os.rst:1357 -#: ../../library/os.rst:1628 ../../library/os.rst:1796 -#: ../../library/os.rst:2529 ../../library/os.rst:3374 -#: ../../library/os.rst:3411 ../../library/os.rst:4027 -#: ../../library/os.rst:4525 ../../library/os.rst:4536 -#: ../../library/os.rst:4653 +#: ../../library/os.rst:1649 ../../library/os.rst:1797 +#: ../../library/os.rst:2530 ../../library/os.rst:3375 +#: ../../library/os.rst:3412 ../../library/os.rst:4028 +#: ../../library/os.rst:4526 ../../library/os.rst:4537 +#: ../../library/os.rst:4654 msgid ":ref:`Availability `: Unix, Windows." msgstr ":ref:`適用 `:Unix、Windows。" @@ -513,15 +513,15 @@ msgstr "" #: ../../library/os.rst:1074 ../../library/os.rst:1138 #: ../../library/os.rst:1150 ../../library/os.rst:1396 #: ../../library/os.rst:1411 ../../library/os.rst:1424 -#: ../../library/os.rst:1493 ../../library/os.rst:1707 -#: ../../library/os.rst:1734 ../../library/os.rst:1769 -#: ../../library/os.rst:2092 ../../library/os.rst:2123 -#: ../../library/os.rst:2164 ../../library/os.rst:2177 -#: ../../library/os.rst:2495 ../../library/os.rst:2507 -#: ../../library/os.rst:3240 ../../library/os.rst:3397 -#: ../../library/os.rst:3630 ../../library/os.rst:5143 -#: ../../library/os.rst:5152 ../../library/os.rst:5173 -#: ../../library/os.rst:5183 ../../library/os.rst:5192 +#: ../../library/os.rst:1493 ../../library/os.rst:1708 +#: ../../library/os.rst:1735 ../../library/os.rst:1770 +#: ../../library/os.rst:2093 ../../library/os.rst:2124 +#: ../../library/os.rst:2165 ../../library/os.rst:2178 +#: ../../library/os.rst:2496 ../../library/os.rst:2508 +#: ../../library/os.rst:3241 ../../library/os.rst:3398 +#: ../../library/os.rst:3631 ../../library/os.rst:5144 +#: ../../library/os.rst:5153 ../../library/os.rst:5174 +#: ../../library/os.rst:5184 ../../library/os.rst:5193 msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" @@ -593,10 +593,10 @@ msgid "" "getpwuid(os.getuid())[0]`` to get the login name of the current real user id." msgstr "" -#: ../../library/os.rst:426 ../../library/os.rst:462 ../../library/os.rst:3992 -#: ../../library/os.rst:4208 ../../library/os.rst:4506 -#: ../../library/os.rst:4630 ../../library/os.rst:4746 -#: ../../library/os.rst:4915 +#: ../../library/os.rst:426 ../../library/os.rst:462 ../../library/os.rst:3993 +#: ../../library/os.rst:4209 ../../library/os.rst:4507 +#: ../../library/os.rst:4631 ../../library/os.rst:4747 +#: ../../library/os.rst:4916 msgid "" ":ref:`Availability `: Unix, Windows, not Emscripten, not WASI." msgstr ":ref:`適用 `:Unix、Windows、非 Emscripten、非 WASI。" @@ -894,7 +894,7 @@ msgid "" "or even ``socket.gethostbyaddr(socket.gethostname())``." msgstr "" -#: ../../library/os.rst:789 ../../library/os.rst:4655 +#: ../../library/os.rst:789 ../../library/os.rst:4656 msgid "" "Return type changed from a tuple to a tuple-like object with named " "attributes." @@ -1123,8 +1123,8 @@ msgid "" "this is equivalent to ``os.chmod(fd, mode)``." msgstr "" -#: ../../library/os.rst:1002 ../../library/os.rst:2068 -#: ../../library/os.rst:2162 +#: ../../library/os.rst:1002 ../../library/os.rst:2069 +#: ../../library/os.rst:2163 msgid "" "Raises an :ref:`auditing event ` ``os.chmod`` with arguments " "``path``, ``mode``, ``dir_fd``." @@ -1133,9 +1133,9 @@ msgstr "" "` ``os.chmod``。" #: ../../library/os.rst:1006 ../../library/os.rst:1021 -#: ../../library/os.rst:1112 ../../library/os.rst:1630 -#: ../../library/os.rst:2065 ../../library/os.rst:2094 -#: ../../library/os.rst:3376 +#: ../../library/os.rst:1112 ../../library/os.rst:1651 +#: ../../library/os.rst:2066 ../../library/os.rst:2095 +#: ../../library/os.rst:3377 msgid "" "The function is limited on Emscripten and WASI, see :ref:`wasm-availability` " "for more information." @@ -1148,8 +1148,8 @@ msgid "" "`chown`. As of Python 3.3, this is equivalent to ``os.chown(fd, uid, gid)``." msgstr "" -#: ../../library/os.rst:1017 ../../library/os.rst:2090 -#: ../../library/os.rst:2175 +#: ../../library/os.rst:1017 ../../library/os.rst:2091 +#: ../../library/os.rst:2176 msgid "" "Raises an :ref:`auditing event ` ``os.chown`` with arguments " "``path``, ``uid``, ``gid``, ``dir_fd``." @@ -1178,7 +1178,7 @@ msgid "" "included in that mapping, passing an integer for *name* is also accepted." msgstr "" -#: ../../library/os.rst:1046 ../../library/os.rst:2487 +#: ../../library/os.rst:1046 ../../library/os.rst:2488 msgid "" "If *name* is a string and is not known, :exc:`ValueError` is raised. If a " "specific value for *name* is not supported by the host system, even if it is " @@ -1200,7 +1200,7 @@ msgstr "" msgid "As of Python 3.3, this is equivalent to ``os.stat(fd)``." msgstr "" -#: ../../library/os.rst:1065 ../../library/os.rst:2322 +#: ../../library/os.rst:1065 ../../library/os.rst:2323 msgid "The :func:`.stat` function." msgstr "" @@ -1240,7 +1240,7 @@ msgstr "" "引發一個附帶引數 ``fd``、``length`` 的\\ :ref:`稽核事件 ` ``os." "truncate``。" -#: ../../library/os.rst:1099 ../../library/os.rst:3415 +#: ../../library/os.rst:1099 ../../library/os.rst:3416 msgid "Added support for Windows" msgstr "新增對 Windows 的支援" @@ -1255,11 +1255,11 @@ msgid "See also :func:`set_blocking` and :meth:`socket.socket.setblocking`." msgstr "" "另請參閱 :func:`set_blocking` 與 :meth:`socket.socket.setblocking`\\ 。" -#: ../../library/os.rst:1115 ../../library/os.rst:1633 +#: ../../library/os.rst:1115 ../../library/os.rst:1654 msgid "On Windows, this function is limited to pipes." msgstr "" -#: ../../library/os.rst:1119 ../../library/os.rst:1637 +#: ../../library/os.rst:1119 ../../library/os.rst:1658 msgid "Added support for pipes on Windows." msgstr "新增對 Windows 上的 pipe 支援。" @@ -1437,35 +1437,35 @@ msgid "" "a file descriptor in a file object, use :func:`fdopen`." msgstr "" -#: ../../library/os.rst:1254 ../../library/os.rst:2363 -#: ../../library/os.rst:2431 ../../library/os.rst:2453 -#: ../../library/os.rst:2534 ../../library/os.rst:2565 +#: ../../library/os.rst:1254 ../../library/os.rst:2364 +#: ../../library/os.rst:2432 ../../library/os.rst:2454 +#: ../../library/os.rst:2535 ../../library/os.rst:2566 msgid "The *dir_fd* argument." msgstr "*dir_fd* 引數。" #: ../../library/os.rst:1257 ../../library/os.rst:1576 -#: ../../library/os.rst:1751 ../../library/os.rst:4748 +#: ../../library/os.rst:1752 ../../library/os.rst:4749 msgid "" "If the system call is interrupted and the signal handler does not raise an " "exception, the function now retries the system call instead of raising an :" "exc:`InterruptedError` exception (see :pep:`475` for the rationale)." msgstr "" -#: ../../library/os.rst:1262 ../../library/os.rst:1962 -#: ../../library/os.rst:1994 ../../library/os.rst:2025 -#: ../../library/os.rst:2074 ../../library/os.rst:2111 -#: ../../library/os.rst:2151 ../../library/os.rst:2166 -#: ../../library/os.rst:2179 ../../library/os.rst:2238 -#: ../../library/os.rst:2330 ../../library/os.rst:2366 -#: ../../library/os.rst:2407 ../../library/os.rst:2434 -#: ../../library/os.rst:2456 ../../library/os.rst:2497 -#: ../../library/os.rst:2568 ../../library/os.rst:2587 -#: ../../library/os.rst:2675 ../../library/os.rst:2965 -#: ../../library/os.rst:3254 ../../library/os.rst:3418 -#: ../../library/os.rst:3434 ../../library/os.rst:3474 -#: ../../library/os.rst:3573 ../../library/os.rst:3634 -#: ../../library/os.rst:3818 ../../library/os.rst:3998 -#: ../../library/os.rst:4513 +#: ../../library/os.rst:1262 ../../library/os.rst:1963 +#: ../../library/os.rst:1995 ../../library/os.rst:2026 +#: ../../library/os.rst:2075 ../../library/os.rst:2112 +#: ../../library/os.rst:2152 ../../library/os.rst:2167 +#: ../../library/os.rst:2180 ../../library/os.rst:2239 +#: ../../library/os.rst:2331 ../../library/os.rst:2367 +#: ../../library/os.rst:2408 ../../library/os.rst:2435 +#: ../../library/os.rst:2457 ../../library/os.rst:2498 +#: ../../library/os.rst:2569 ../../library/os.rst:2588 +#: ../../library/os.rst:2676 ../../library/os.rst:2966 +#: ../../library/os.rst:3255 ../../library/os.rst:3419 +#: ../../library/os.rst:3435 ../../library/os.rst:3475 +#: ../../library/os.rst:3574 ../../library/os.rst:3635 +#: ../../library/os.rst:3819 ../../library/os.rst:3999 +#: ../../library/os.rst:4514 msgid "Accepts a :term:`path-like object`." msgstr "" @@ -1605,14 +1605,14 @@ msgstr ":data:`RWF_HIPRI`" msgid ":data:`RWF_NOWAIT`" msgstr ":data:`RWF_NOWAIT`" -#: ../../library/os.rst:1442 ../../library/os.rst:1701 +#: ../../library/os.rst:1442 ../../library/os.rst:1702 msgid "" "Return the total number of bytes actually read which can be less than the " "total capacity of all the objects." msgstr "" #: ../../library/os.rst:1445 ../../library/os.rst:1515 -#: ../../library/os.rst:1704 ../../library/os.rst:1766 +#: ../../library/os.rst:1705 ../../library/os.rst:1767 msgid "" "The operating system may set a limit (:func:`sysconf` value " "``'SC_IOV_MAX'``) on the number of buffers that can be used." @@ -1674,7 +1674,7 @@ msgid "" "*offset*, leaving the file offset unchanged." msgstr "" -#: ../../library/os.rst:1491 ../../library/os.rst:1741 +#: ../../library/os.rst:1491 ../../library/os.rst:1742 msgid "Return the number of bytes actually written." msgstr "" @@ -1805,31 +1805,31 @@ msgstr "" msgid "Parameters *out* and *in* was renamed to *out_fd* and *in_fd*." msgstr "" -#: ../../library/os.rst:1623 -msgid "" -"Set the blocking mode of the specified file descriptor. Set the :data:" -"`O_NONBLOCK` flag if blocking is ``False``, clear the flag otherwise." -msgstr "" - -#: ../../library/os.rst:1626 -msgid "See also :func:`get_blocking` and :meth:`socket.socket.setblocking`." -msgstr "" -"另請參閱 :func:`get_blocking` 與 :meth:`socket.socket.setblocking`\\ 。" - -#: ../../library/os.rst:1644 +#: ../../library/os.rst:1625 msgid "" "Parameters to the :func:`sendfile` function, if the implementation supports " "them." msgstr "" -#: ../../library/os.rst:1653 +#: ../../library/os.rst:1634 msgid "" "Parameter to the :func:`sendfile` function, if the implementation supports " "it. The data won't be cached in the virtual memory and will be freed " "afterwards." msgstr "" -#: ../../library/os.rst:1663 +#: ../../library/os.rst:1644 +msgid "" +"Set the blocking mode of the specified file descriptor. Set the :data:" +"`O_NONBLOCK` flag if blocking is ``False``, clear the flag otherwise." +msgstr "" + +#: ../../library/os.rst:1647 +msgid "See also :func:`get_blocking` and :meth:`socket.socket.setblocking`." +msgstr "" +"另請參閱 :func:`get_blocking` 與 :meth:`socket.socket.setblocking`\\ 。" + +#: ../../library/os.rst:1664 msgid "" "Transfer *count* bytes from file descriptor *src*, starting from offset " "*offset_src*, to file descriptor *dst*, starting from offset *offset_dst*. " @@ -1841,7 +1841,7 @@ msgid "" "`~OSError.errno` set to :const:`errno.EXDEV`." msgstr "" -#: ../../library/os.rst:1672 +#: ../../library/os.rst:1673 msgid "" "This copy is done without the additional cost of transferring data from the " "kernel to user space and then back into the kernel. Additionally, some " @@ -1849,7 +1849,7 @@ msgid "" "files are opened as binary." msgstr "" -#: ../../library/os.rst:1677 +#: ../../library/os.rst:1678 msgid "" "Upon successful completion, returns the number of bytes spliced to or from " "the pipe. A return value of 0 means end of input. If *src* refers to a pipe, " @@ -1858,11 +1858,11 @@ msgid "" "the pipe." msgstr "" -#: ../../library/os.rst:1683 +#: ../../library/os.rst:1684 msgid ":ref:`Availability `: Linux >= 2.6.17 with glibc >= 2.5" msgstr ":ref:`適用 `:Linux 2.6.17 以上且具有 glibc 2.5 以上" -#: ../../library/os.rst:1696 +#: ../../library/os.rst:1697 msgid "" "Read from a file descriptor *fd* into a number of mutable :term:`bytes-like " "objects ` *buffers*. Transfer data into each buffer until " @@ -1870,34 +1870,34 @@ msgid "" "rest of the data." msgstr "" -#: ../../library/os.rst:1714 +#: ../../library/os.rst:1715 msgid "" "Return the process group associated with the terminal given by *fd* (an open " "file descriptor as returned by :func:`os.open`)." msgstr "" -#: ../../library/os.rst:1717 ../../library/os.rst:1725 +#: ../../library/os.rst:1718 ../../library/os.rst:1726 msgid ":ref:`Availability `: Unix, not WASI." msgstr ":ref:`適用 `:Unix、非 WASI。" -#: ../../library/os.rst:1722 +#: ../../library/os.rst:1723 msgid "" "Set the process group associated with the terminal given by *fd* (an open " "file descriptor as returned by :func:`os.open`) to *pg*." msgstr "" -#: ../../library/os.rst:1730 +#: ../../library/os.rst:1731 msgid "" "Return a string which specifies the terminal device associated with file " "descriptor *fd*. If *fd* is not associated with a terminal device, an " "exception is raised." msgstr "" -#: ../../library/os.rst:1739 +#: ../../library/os.rst:1740 msgid "Write the bytestring in *str* to file descriptor *fd*." msgstr "" -#: ../../library/os.rst:1745 +#: ../../library/os.rst:1746 msgid "" "This function is intended for low-level I/O and must be applied to a file " "descriptor as returned by :func:`os.open` or :func:`pipe`. To write a " @@ -1906,7 +1906,7 @@ msgid "" "its :meth:`~file.write` method." msgstr "" -#: ../../library/os.rst:1759 +#: ../../library/os.rst:1760 msgid "" "Write the contents of *buffers* to file descriptor *fd*. *buffers* must be a " "sequence of :term:`bytes-like objects `. Buffers are " @@ -1914,70 +1914,70 @@ msgid "" "before proceeding to the second, and so on." msgstr "" -#: ../../library/os.rst:1764 +#: ../../library/os.rst:1765 msgid "Returns the total number of bytes actually written." msgstr "" -#: ../../library/os.rst:1777 +#: ../../library/os.rst:1778 msgid "Querying the size of a terminal" msgstr "" -#: ../../library/os.rst:1783 +#: ../../library/os.rst:1784 msgid "" "Return the size of the terminal window as ``(columns, lines)``, tuple of " "type :class:`terminal_size`." msgstr "" -#: ../../library/os.rst:1786 +#: ../../library/os.rst:1787 msgid "" "The optional argument ``fd`` (default ``STDOUT_FILENO``, or standard output) " "specifies which file descriptor should be queried." msgstr "" -#: ../../library/os.rst:1789 +#: ../../library/os.rst:1790 msgid "" "If the file descriptor is not connected to a terminal, an :exc:`OSError` is " "raised." msgstr "" -#: ../../library/os.rst:1792 +#: ../../library/os.rst:1793 msgid "" ":func:`shutil.get_terminal_size` is the high-level function which should " "normally be used, ``os.get_terminal_size`` is the low-level implementation." msgstr "" -#: ../../library/os.rst:1800 +#: ../../library/os.rst:1801 msgid "" "A subclass of tuple, holding ``(columns, lines)`` of the terminal window " "size." msgstr "" -#: ../../library/os.rst:1804 +#: ../../library/os.rst:1805 msgid "Width of the terminal window in characters." msgstr "" -#: ../../library/os.rst:1808 +#: ../../library/os.rst:1809 msgid "Height of the terminal window in characters." msgstr "" -#: ../../library/os.rst:1814 +#: ../../library/os.rst:1815 msgid "Inheritance of File Descriptors" msgstr "" -#: ../../library/os.rst:1818 +#: ../../library/os.rst:1819 msgid "" "A file descriptor has an \"inheritable\" flag which indicates if the file " "descriptor can be inherited by child processes. Since Python 3.4, file " "descriptors created by Python are non-inheritable by default." msgstr "" -#: ../../library/os.rst:1822 +#: ../../library/os.rst:1823 msgid "" "On UNIX, non-inheritable file descriptors are closed in child processes at " "the execution of a new program, other file descriptors are inherited." msgstr "" -#: ../../library/os.rst:1825 +#: ../../library/os.rst:1826 msgid "" "On Windows, non-inheritable handles and file descriptors are closed in child " "processes, except for standard streams (file descriptors 0, 1 and 2: stdin, " @@ -1988,46 +1988,46 @@ msgid "" "only inherited if the *close_fds* parameter is ``False``." msgstr "" -#: ../../library/os.rst:1833 +#: ../../library/os.rst:1834 msgid "" "On WebAssembly platforms ``wasm32-emscripten`` and ``wasm32-wasi``, the file " "descriptor cannot be modified." msgstr "" -#: ../../library/os.rst:1838 +#: ../../library/os.rst:1839 msgid "" "Get the \"inheritable\" flag of the specified file descriptor (a boolean)." msgstr "" -#: ../../library/os.rst:1842 +#: ../../library/os.rst:1843 msgid "Set the \"inheritable\" flag of the specified file descriptor." msgstr "" -#: ../../library/os.rst:1846 +#: ../../library/os.rst:1847 msgid "Get the \"inheritable\" flag of the specified handle (a boolean)." msgstr "" -#: ../../library/os.rst:1848 ../../library/os.rst:1854 -#: ../../library/os.rst:3923 ../../library/os.rst:4548 -#: ../../library/os.rst:4593 +#: ../../library/os.rst:1849 ../../library/os.rst:1855 +#: ../../library/os.rst:3924 ../../library/os.rst:4549 +#: ../../library/os.rst:4594 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" -#: ../../library/os.rst:1852 +#: ../../library/os.rst:1853 msgid "Set the \"inheritable\" flag of the specified handle." msgstr "" -#: ../../library/os.rst:1860 +#: ../../library/os.rst:1861 msgid "Files and Directories" msgstr "" -#: ../../library/os.rst:1862 +#: ../../library/os.rst:1863 msgid "" "On some Unix platforms, many of these functions support one or more of these " "features:" msgstr "" -#: ../../library/os.rst:1867 +#: ../../library/os.rst:1868 msgid "" "**specifying a file descriptor:** Normally the *path* argument provided to " "functions in the :mod:`os` module must be a string specifying a file path. " @@ -2038,7 +2038,7 @@ msgid "" "``chdir``).)" msgstr "" -#: ../../library/os.rst:1875 +#: ../../library/os.rst:1876 msgid "" "You can check whether or not *path* can be specified as a file descriptor " "for a particular function on your platform using :data:`os.supports_fd`. If " @@ -2046,13 +2046,13 @@ msgid "" "`NotImplementedError`." msgstr "" -#: ../../library/os.rst:1880 +#: ../../library/os.rst:1881 msgid "" "If the function also supports *dir_fd* or *follow_symlinks* arguments, it's " "an error to specify one of those when supplying *path* as a file descriptor." msgstr "" -#: ../../library/os.rst:1885 +#: ../../library/os.rst:1886 msgid "" "**paths relative to directory descriptors:** If *dir_fd* is not ``None``, it " "should be a file descriptor referring to a directory, and the path to " @@ -2063,14 +2063,14 @@ msgid "" "``access``)." msgstr "" -#: ../../library/os.rst:1892 +#: ../../library/os.rst:1893 msgid "" "You can check whether or not *dir_fd* is supported for a particular function " "on your platform using :data:`os.supports_dir_fd`. If it's unavailable, " "using it will raise a :exc:`NotImplementedError`." msgstr "" -#: ../../library/os.rst:1898 +#: ../../library/os.rst:1899 msgid "" "**not following symlinks:** If *follow_symlinks* is ``False``, and the last " "element of the path to operate on is a symbolic link, the function will " @@ -2079,14 +2079,14 @@ msgid "" "function.)" msgstr "" -#: ../../library/os.rst:1904 +#: ../../library/os.rst:1905 msgid "" "You can check whether or not *follow_symlinks* is supported for a particular " "function on your platform using :data:`os.supports_follow_symlinks`. If it's " "unavailable, using it will raise a :exc:`NotImplementedError`." msgstr "" -#: ../../library/os.rst:1912 +#: ../../library/os.rst:1913 msgid "" "Use the real uid/gid to test for access to *path*. Note that most " "operations will use the effective uid/gid, therefore this routine can be " @@ -2098,13 +2098,13 @@ msgid "" "manpage:`access(2)` for more information." msgstr "" -#: ../../library/os.rst:1921 +#: ../../library/os.rst:1922 msgid "" "This function can support specifying :ref:`paths relative to directory " "descriptors ` and :ref:`not following symlinks `." msgstr "" -#: ../../library/os.rst:1924 +#: ../../library/os.rst:1925 msgid "" "If *effective_ids* is ``True``, :func:`access` will perform its access " "checks using the effective uid/gid instead of the real uid/gid. " @@ -2113,7 +2113,7 @@ msgid "" "unavailable, using it will raise a :exc:`NotImplementedError`." msgstr "" -#: ../../library/os.rst:1932 +#: ../../library/os.rst:1933 msgid "" "Using :func:`access` to check if a user is authorized to e.g. open a file " "before actually doing so using :func:`open` creates a security hole, because " @@ -2122,117 +2122,117 @@ msgid "" "For example::" msgstr "" -#: ../../library/os.rst:1943 +#: ../../library/os.rst:1944 msgid "is better written as::" msgstr "" -#: ../../library/os.rst:1955 +#: ../../library/os.rst:1956 msgid "" "I/O operations may fail even when :func:`access` indicates that they would " "succeed, particularly for operations on network filesystems which may have " "permissions semantics beyond the usual POSIX permission-bit model." msgstr "" -#: ../../library/os.rst:1959 +#: ../../library/os.rst:1960 msgid "Added the *dir_fd*, *effective_ids*, and *follow_symlinks* parameters." msgstr "新增 *dir_fd*\\ 、\\ *effective_ids* 與 *follow_symlinks* 參數。" -#: ../../library/os.rst:1971 +#: ../../library/os.rst:1972 msgid "" "Values to pass as the *mode* parameter of :func:`access` to test the " "existence, readability, writability and executability of *path*, " "respectively." msgstr "" -#: ../../library/os.rst:1980 +#: ../../library/os.rst:1981 msgid "Change the current working directory to *path*." msgstr "" -#: ../../library/os.rst:1982 +#: ../../library/os.rst:1983 msgid "" "This function can support :ref:`specifying a file descriptor `. " "The descriptor must refer to an opened directory, not an open file." msgstr "" -#: ../../library/os.rst:1985 +#: ../../library/os.rst:1986 msgid "" "This function can raise :exc:`OSError` and subclasses such as :exc:" "`FileNotFoundError`, :exc:`PermissionError`, and :exc:`NotADirectoryError`." msgstr "" -#: ../../library/os.rst:1988 ../../library/os.rst:2121 +#: ../../library/os.rst:1989 ../../library/os.rst:2122 msgid "" "Raises an :ref:`auditing event ` ``os.chdir`` with argument " "``path``." msgstr "" "引發一個附帶引數 ``path`` 的\\ :ref:`稽核事件 ` ``os.chdir``。" -#: ../../library/os.rst:1990 +#: ../../library/os.rst:1991 msgid "" "Added support for specifying *path* as a file descriptor on some platforms." msgstr "" -#: ../../library/os.rst:2000 +#: ../../library/os.rst:2001 msgid "" "Set the flags of *path* to the numeric *flags*. *flags* may take a " "combination (bitwise OR) of the following values (as defined in the :mod:" "`stat` module):" msgstr "" -#: ../../library/os.rst:2003 +#: ../../library/os.rst:2004 msgid ":const:`stat.UF_NODUMP`" msgstr ":const:`stat.UF_NODUMP`" -#: ../../library/os.rst:2004 +#: ../../library/os.rst:2005 msgid ":const:`stat.UF_IMMUTABLE`" msgstr ":const:`stat.UF_IMMUTABLE`" -#: ../../library/os.rst:2005 +#: ../../library/os.rst:2006 msgid ":const:`stat.UF_APPEND`" msgstr ":const:`stat.UF_APPEND`" -#: ../../library/os.rst:2006 +#: ../../library/os.rst:2007 msgid ":const:`stat.UF_OPAQUE`" msgstr ":const:`stat.UF_OPAQUE`" -#: ../../library/os.rst:2007 +#: ../../library/os.rst:2008 msgid ":const:`stat.UF_NOUNLINK`" msgstr ":const:`stat.UF_NOUNLINK`" -#: ../../library/os.rst:2008 +#: ../../library/os.rst:2009 msgid ":const:`stat.UF_COMPRESSED`" msgstr ":const:`stat.UF_COMPRESSED`" -#: ../../library/os.rst:2009 +#: ../../library/os.rst:2010 msgid ":const:`stat.UF_HIDDEN`" msgstr ":const:`stat.UF_HIDDEN`" -#: ../../library/os.rst:2010 +#: ../../library/os.rst:2011 msgid ":const:`stat.SF_ARCHIVED`" msgstr ":const:`stat.SF_ARCHIVED`" -#: ../../library/os.rst:2011 +#: ../../library/os.rst:2012 msgid ":const:`stat.SF_IMMUTABLE`" msgstr ":const:`stat.SF_IMMUTABLE`" -#: ../../library/os.rst:2012 +#: ../../library/os.rst:2013 msgid ":const:`stat.SF_APPEND`" msgstr ":const:`stat.SF_APPEND`" -#: ../../library/os.rst:2013 +#: ../../library/os.rst:2014 msgid ":const:`stat.SF_NOUNLINK`" msgstr ":const:`stat.SF_NOUNLINK`" -#: ../../library/os.rst:2014 +#: ../../library/os.rst:2015 msgid ":const:`stat.SF_SNAPSHOT`" msgstr ":const:`stat.SF_SNAPSHOT`" -#: ../../library/os.rst:2016 +#: ../../library/os.rst:2017 msgid "" "This function can support :ref:`not following symlinks `." msgstr "" -#: ../../library/os.rst:2018 ../../library/os.rst:2147 +#: ../../library/os.rst:2019 ../../library/os.rst:2148 msgid "" "Raises an :ref:`auditing event ` ``os.chflags`` with arguments " "``path``, ``flags``." @@ -2240,164 +2240,164 @@ msgstr "" "引發一個附帶引數 ``path``、``flags`` 的\\ :ref:`稽核事件 ` ``os." "chflags``。" -#: ../../library/os.rst:2022 +#: ../../library/os.rst:2023 msgid "The *follow_symlinks* argument." msgstr "*follow_symlinks* 引數。" -#: ../../library/os.rst:2031 +#: ../../library/os.rst:2032 msgid "" "Change the mode of *path* to the numeric *mode*. *mode* may take one of the " "following values (as defined in the :mod:`stat` module) or bitwise ORed " "combinations of them:" msgstr "" -#: ../../library/os.rst:2035 +#: ../../library/os.rst:2036 msgid ":const:`stat.S_ISUID`" msgstr ":const:`stat.S_ISUID`" -#: ../../library/os.rst:2036 +#: ../../library/os.rst:2037 msgid ":const:`stat.S_ISGID`" msgstr ":const:`stat.S_ISGID`" -#: ../../library/os.rst:2037 +#: ../../library/os.rst:2038 msgid ":const:`stat.S_ENFMT`" msgstr ":const:`stat.S_ENFMT`" -#: ../../library/os.rst:2038 +#: ../../library/os.rst:2039 msgid ":const:`stat.S_ISVTX`" msgstr ":const:`stat.S_ISVTX`" -#: ../../library/os.rst:2039 +#: ../../library/os.rst:2040 msgid ":const:`stat.S_IREAD`" msgstr ":const:`stat.S_IREAD`" -#: ../../library/os.rst:2040 +#: ../../library/os.rst:2041 msgid ":const:`stat.S_IWRITE`" msgstr ":const:`stat.S_IWRITE`" -#: ../../library/os.rst:2041 +#: ../../library/os.rst:2042 msgid ":const:`stat.S_IEXEC`" msgstr ":const:`stat.S_IEXEC`" -#: ../../library/os.rst:2042 +#: ../../library/os.rst:2043 msgid ":const:`stat.S_IRWXU`" msgstr ":const:`stat.S_IRWXU`" -#: ../../library/os.rst:2043 +#: ../../library/os.rst:2044 msgid ":const:`stat.S_IRUSR`" msgstr ":const:`stat.S_IRUSR`" -#: ../../library/os.rst:2044 +#: ../../library/os.rst:2045 msgid ":const:`stat.S_IWUSR`" msgstr ":const:`stat.S_IWUSR`" -#: ../../library/os.rst:2045 +#: ../../library/os.rst:2046 msgid ":const:`stat.S_IXUSR`" msgstr ":const:`stat.S_IXUSR`" -#: ../../library/os.rst:2046 +#: ../../library/os.rst:2047 msgid ":const:`stat.S_IRWXG`" msgstr ":const:`stat.S_IRWXG`" -#: ../../library/os.rst:2047 +#: ../../library/os.rst:2048 msgid ":const:`stat.S_IRGRP`" msgstr ":const:`stat.S_IRGRP`" -#: ../../library/os.rst:2048 +#: ../../library/os.rst:2049 msgid ":const:`stat.S_IWGRP`" msgstr ":const:`stat.S_IWGRP`" -#: ../../library/os.rst:2049 +#: ../../library/os.rst:2050 msgid ":const:`stat.S_IXGRP`" msgstr ":const:`stat.S_IXGRP`" -#: ../../library/os.rst:2050 +#: ../../library/os.rst:2051 msgid ":const:`stat.S_IRWXO`" msgstr ":const:`stat.S_IRWXO`" -#: ../../library/os.rst:2051 +#: ../../library/os.rst:2052 msgid ":const:`stat.S_IROTH`" msgstr ":const:`stat.S_IROTH`" -#: ../../library/os.rst:2052 +#: ../../library/os.rst:2053 msgid ":const:`stat.S_IWOTH`" msgstr ":const:`stat.S_IWOTH`" -#: ../../library/os.rst:2053 +#: ../../library/os.rst:2054 msgid ":const:`stat.S_IXOTH`" msgstr ":const:`stat.S_IXOTH`" -#: ../../library/os.rst:2055 ../../library/os.rst:2083 -#: ../../library/os.rst:3464 +#: ../../library/os.rst:2056 ../../library/os.rst:2084 +#: ../../library/os.rst:3465 msgid "" "This function can support :ref:`specifying a file descriptor `, :" "ref:`paths relative to directory descriptors ` and :ref:`not " "following symlinks `." msgstr "" -#: ../../library/os.rst:2061 +#: ../../library/os.rst:2062 msgid "" "Although Windows supports :func:`chmod`, you can only set the file's read-" "only flag with it (via the ``stat.S_IWRITE`` and ``stat.S_IREAD`` constants " "or a corresponding integer value). All other bits are ignored." msgstr "" -#: ../../library/os.rst:2070 ../../library/os.rst:2097 +#: ../../library/os.rst:2071 ../../library/os.rst:2098 msgid "" "Added support for specifying *path* as an open file descriptor, and the " "*dir_fd* and *follow_symlinks* arguments." msgstr "" -#: ../../library/os.rst:2080 +#: ../../library/os.rst:2081 msgid "" "Change the owner and group id of *path* to the numeric *uid* and *gid*. To " "leave one of the ids unchanged, set it to -1." msgstr "" -#: ../../library/os.rst:2087 +#: ../../library/os.rst:2088 msgid "" "See :func:`shutil.chown` for a higher-level function that accepts names in " "addition to numeric ids." msgstr "" -#: ../../library/os.rst:2101 +#: ../../library/os.rst:2102 msgid "Supports a :term:`path-like object`." msgstr "" -#: ../../library/os.rst:2107 +#: ../../library/os.rst:2108 msgid "Change the root directory of the current process to *path*." msgstr "" -#: ../../library/os.rst:2117 +#: ../../library/os.rst:2118 msgid "" "Change the current working directory to the directory represented by the " "file descriptor *fd*. The descriptor must refer to an opened directory, not " "an open file. As of Python 3.3, this is equivalent to ``os.chdir(fd)``." msgstr "" -#: ../../library/os.rst:2128 +#: ../../library/os.rst:2129 msgid "Return a string representing the current working directory." msgstr "" -#: ../../library/os.rst:2133 +#: ../../library/os.rst:2134 msgid "Return a bytestring representing the current working directory." msgstr "" -#: ../../library/os.rst:2135 +#: ../../library/os.rst:2136 msgid "" "The function now uses the UTF-8 encoding on Windows, rather than the ANSI " "code page: see :pep:`529` for the rationale. The function is no longer " "deprecated on Windows." msgstr "" -#: ../../library/os.rst:2143 +#: ../../library/os.rst:2144 msgid "" "Set the flags of *path* to the numeric *flags*, like :func:`chflags`, but do " "not follow symbolic links. As of Python 3.3, this is equivalent to ``os." "chflags(path, flags, follow_symlinks=False)``." msgstr "" -#: ../../library/os.rst:2157 +#: ../../library/os.rst:2158 msgid "" "Change the mode of *path* to the numeric *mode*. If path is a symlink, this " "affects the symlink rather than the target. See the docs for :func:`chmod` " @@ -2405,25 +2405,25 @@ msgid "" "chmod(path, mode, follow_symlinks=False)``." msgstr "" -#: ../../library/os.rst:2171 +#: ../../library/os.rst:2172 msgid "" "Change the owner and group id of *path* to the numeric *uid* and *gid*. " "This function will not follow symbolic links. As of Python 3.3, this is " "equivalent to ``os.chown(path, uid, gid, follow_symlinks=False)``." msgstr "" -#: ../../library/os.rst:2185 +#: ../../library/os.rst:2186 msgid "Create a hard link pointing to *src* named *dst*." msgstr "" -#: ../../library/os.rst:2187 +#: ../../library/os.rst:2188 msgid "" "This function can support specifying *src_dir_fd* and/or *dst_dir_fd* to " "supply :ref:`paths relative to directory descriptors `, and :ref:" "`not following symlinks `." msgstr "" -#: ../../library/os.rst:2191 +#: ../../library/os.rst:2192 msgid "" "Raises an :ref:`auditing event ` ``os.link`` with arguments " "``src``, ``dst``, ``src_dir_fd``, ``dst_dir_fd``." @@ -2431,24 +2431,24 @@ msgstr "" "引發一個附帶引數 ``src``、``dst``、``src_dir_fd``、``dst_dir_fd`` 的\\ :ref:`" "稽核事件 ` ``os.link``。" -#: ../../library/os.rst:2193 +#: ../../library/os.rst:2194 msgid ":ref:`Availability `: Unix, Windows, not Emscripten." msgstr ":ref:`適用 `:Unix、Windows、非 Emscripten。" -#: ../../library/os.rst:2195 +#: ../../library/os.rst:2196 msgid "Added Windows support." msgstr "新支援 Windows。" -#: ../../library/os.rst:2198 +#: ../../library/os.rst:2199 msgid "Added the *src_dir_fd*, *dst_dir_fd*, and *follow_symlinks* arguments." msgstr "增加 *src_dir_fd*\\ 、\\ *dst_dir_fd* 與 *follow_symlinks* 引數。" -#: ../../library/os.rst:2201 ../../library/os.rst:2619 -#: ../../library/os.rst:2656 ../../library/os.rst:3386 +#: ../../library/os.rst:2202 ../../library/os.rst:2620 +#: ../../library/os.rst:2657 ../../library/os.rst:3387 msgid "Accepts a :term:`path-like object` for *src* and *dst*." msgstr "" -#: ../../library/os.rst:2207 +#: ../../library/os.rst:2208 msgid "" "Return a list containing the names of the entries in the directory given by " "*path*. The list is in arbitrary order, and does not include the special " @@ -2457,7 +2457,7 @@ msgid "" "function, whether a name for that file be included is unspecified." msgstr "" -#: ../../library/os.rst:2213 +#: ../../library/os.rst:2214 msgid "" "*path* may be a :term:`path-like object`. If *path* is of type ``bytes`` " "(directly or indirectly through the :class:`PathLike` interface), the " @@ -2465,42 +2465,42 @@ msgid "" "circumstances, they will be of type ``str``." msgstr "" -#: ../../library/os.rst:2218 ../../library/os.rst:2704 +#: ../../library/os.rst:2219 ../../library/os.rst:2705 msgid "" "This function can also support :ref:`specifying a file descriptor " "`; the file descriptor must refer to a directory." msgstr "" -#: ../../library/os.rst:2221 +#: ../../library/os.rst:2222 msgid "" "Raises an :ref:`auditing event ` ``os.listdir`` with argument " "``path``." msgstr "" "引發一個附帶引數 ``path`` 的\\ :ref:`稽核事件 ` ``os.listdir``。" -#: ../../library/os.rst:2224 +#: ../../library/os.rst:2225 msgid "To encode ``str`` filenames to ``bytes``, use :func:`~os.fsencode`." msgstr "" -#: ../../library/os.rst:2228 +#: ../../library/os.rst:2229 msgid "" "The :func:`scandir` function returns directory entries along with file " "attribute information, giving better performance for many common use cases." msgstr "" -#: ../../library/os.rst:2232 +#: ../../library/os.rst:2233 msgid "The *path* parameter became optional." msgstr "" -#: ../../library/os.rst:2235 ../../library/os.rst:3245 +#: ../../library/os.rst:2236 ../../library/os.rst:3246 msgid "Added support for specifying *path* as an open file descriptor." msgstr "" -#: ../../library/os.rst:2244 +#: ../../library/os.rst:2245 msgid "Return a list containing the names of drives on a Windows system." msgstr "" -#: ../../library/os.rst:2246 +#: ../../library/os.rst:2247 msgid "" "A drive name typically looks like ``'C:\\\\'``. Not every drive name will be " "associated with a volume, and some may be inaccessible for a variety of " @@ -2508,27 +2508,27 @@ msgid "" "function does not test for access." msgstr "" -#: ../../library/os.rst:2251 +#: ../../library/os.rst:2252 msgid "May raise :exc:`OSError` if an error occurs collecting the drive names." msgstr "" -#: ../../library/os.rst:2254 +#: ../../library/os.rst:2255 msgid "" "Raises an :ref:`auditing event ` ``os.listdrives`` with no " "arguments." msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``os.listdrives``。" -#: ../../library/os.rst:2256 ../../library/os.rst:2280 -#: ../../library/os.rst:2300 +#: ../../library/os.rst:2257 ../../library/os.rst:2281 +#: ../../library/os.rst:2301 msgid ":ref:`Availability `: Windows" msgstr ":ref:`適用 `:Windows。" -#: ../../library/os.rst:2263 +#: ../../library/os.rst:2264 msgid "" "Return a list containing the mount points for a volume on a Windows system." msgstr "" -#: ../../library/os.rst:2266 +#: ../../library/os.rst:2267 msgid "" "*volume* must be represented as a GUID path, like those returned by :func:" "`os.listvolumes`. Volumes may be mounted in multiple locations or not at " @@ -2536,19 +2536,19 @@ msgid "" "associated with a volume will not be returned by this function." msgstr "" -#: ../../library/os.rst:2272 +#: ../../library/os.rst:2273 msgid "" "The mount points return by this function will be absolute paths, and may be " "longer than the drive name." msgstr "" -#: ../../library/os.rst:2275 +#: ../../library/os.rst:2276 msgid "" "Raises :exc:`OSError` if the volume is not recognized or if an error occurs " "collecting the paths." msgstr "" -#: ../../library/os.rst:2278 +#: ../../library/os.rst:2279 msgid "" "Raises an :ref:`auditing event ` ``os.listmounts`` with argument " "``volume``." @@ -2556,11 +2556,11 @@ msgstr "" "引發一個附帶引數 ``volume`` 的\\ :ref:`稽核事件 ` ``os." "listmounts``。" -#: ../../library/os.rst:2287 +#: ../../library/os.rst:2288 msgid "Return a list containing the volumes in the system." msgstr "" -#: ../../library/os.rst:2289 +#: ../../library/os.rst:2290 msgid "" "Volumes are typically represented as a GUID path that looks like ``\\\\?" "\\Volume{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}\\``. Files can usually be " @@ -2569,53 +2569,53 @@ msgid "" "function is to retrieve mount points using :func:`os.listmounts`." msgstr "" -#: ../../library/os.rst:2296 +#: ../../library/os.rst:2297 msgid "May raise :exc:`OSError` if an error occurs collecting the volumes." msgstr "" -#: ../../library/os.rst:2298 +#: ../../library/os.rst:2299 msgid "" "Raises an :ref:`auditing event ` ``os.listvolumes`` with no " "arguments." msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``os.listvolumes``。" -#: ../../library/os.rst:2307 +#: ../../library/os.rst:2308 msgid "" "Perform the equivalent of an :c:func:`!lstat` system call on the given path. " "Similar to :func:`~os.stat`, but does not follow symbolic links. Return a :" "class:`stat_result` object." msgstr "" -#: ../../library/os.rst:2311 +#: ../../library/os.rst:2312 msgid "" "On platforms that do not support symbolic links, this is an alias for :func:" "`~os.stat`." msgstr "" -#: ../../library/os.rst:2314 +#: ../../library/os.rst:2315 msgid "" "As of Python 3.3, this is equivalent to ``os.stat(path, dir_fd=dir_fd, " "follow_symlinks=False)``." msgstr "" -#: ../../library/os.rst:2317 ../../library/os.rst:2355 -#: ../../library/os.rst:2420 ../../library/os.rst:2448 -#: ../../library/os.rst:2522 +#: ../../library/os.rst:2318 ../../library/os.rst:2356 +#: ../../library/os.rst:2421 ../../library/os.rst:2449 +#: ../../library/os.rst:2523 msgid "" "This function can also support :ref:`paths relative to directory descriptors " "`." msgstr "" -#: ../../library/os.rst:2324 ../../library/os.rst:2531 -#: ../../library/os.rst:3379 +#: ../../library/os.rst:2325 ../../library/os.rst:2532 +#: ../../library/os.rst:3380 msgid "Added support for Windows 6.0 (Vista) symbolic links." msgstr "" -#: ../../library/os.rst:2327 +#: ../../library/os.rst:2328 msgid "Added the *dir_fd* parameter." msgstr "新增 *dir_fd* 參數。" -#: ../../library/os.rst:2333 +#: ../../library/os.rst:2334 msgid "" "On Windows, now opens reparse points that represent another path (name " "surrogates), including symbolic links and directory junctions. Other kinds " @@ -2623,18 +2623,18 @@ msgid "" "stat`." msgstr "" -#: ../../library/os.rst:2342 +#: ../../library/os.rst:2343 msgid "Create a directory named *path* with numeric mode *mode*." msgstr "" -#: ../../library/os.rst:2344 +#: ../../library/os.rst:2345 msgid "" "If the directory already exists, :exc:`FileExistsError` is raised. If a " "parent directory in the path does not exist, :exc:`FileNotFoundError` is " "raised." msgstr "" -#: ../../library/os.rst:2349 +#: ../../library/os.rst:2350 msgid "" "On some systems, *mode* is ignored. Where it is used, the current umask " "value is first masked out. If bits other than the last 9 (i.e. the last 3 " @@ -2643,13 +2643,13 @@ msgid "" "call :func:`chmod` explicitly to set them." msgstr "" -#: ../../library/os.rst:2358 +#: ../../library/os.rst:2359 msgid "" "It is also possible to create temporary directories; see the :mod:`tempfile` " "module's :func:`tempfile.mkdtemp` function." msgstr "" -#: ../../library/os.rst:2361 ../../library/os.rst:2395 +#: ../../library/os.rst:2362 ../../library/os.rst:2396 msgid "" "Raises an :ref:`auditing event ` ``os.mkdir`` with arguments " "``path``, ``mode``, ``dir_fd``." @@ -2657,13 +2657,13 @@ msgstr "" "引發一個附帶引數 ``path``、``mode``、``dir_fd`` 的\\ :ref:`稽核事件 " "` ``os.mkdir``。" -#: ../../library/os.rst:2376 +#: ../../library/os.rst:2377 msgid "" "Recursive directory creation function. Like :func:`mkdir`, but makes all " "intermediate-level directories needed to contain the leaf directory." msgstr "" -#: ../../library/os.rst:2379 +#: ../../library/os.rst:2380 msgid "" "The *mode* parameter is passed to :func:`mkdir` for creating the leaf " "directory; see :ref:`the mkdir() description ` for how it is " @@ -2672,27 +2672,27 @@ msgid "" "file permission bits of existing parent directories are not changed." msgstr "" -#: ../../library/os.rst:2385 +#: ../../library/os.rst:2386 msgid "" "If *exist_ok* is ``False`` (the default), a :exc:`FileExistsError` is raised " "if the target directory already exists." msgstr "" -#: ../../library/os.rst:2390 +#: ../../library/os.rst:2391 msgid "" ":func:`makedirs` will become confused if the path elements to create " "include :data:`pardir` (eg. \"..\" on UNIX systems)." msgstr "" -#: ../../library/os.rst:2393 +#: ../../library/os.rst:2394 msgid "This function handles UNC paths correctly." msgstr "" -#: ../../library/os.rst:2397 +#: ../../library/os.rst:2398 msgid "The *exist_ok* parameter." msgstr "*exist_ok* 參數。" -#: ../../library/os.rst:2402 +#: ../../library/os.rst:2403 msgid "" "Before Python 3.4.1, if *exist_ok* was ``True`` and the directory existed, :" "func:`makedirs` would still raise an error if *mode* did not match the mode " @@ -2700,19 +2700,19 @@ msgid "" "safely, it was removed in Python 3.4.1. See :issue:`21082`." msgstr "" -#: ../../library/os.rst:2410 +#: ../../library/os.rst:2411 msgid "" "The *mode* argument no longer affects the file permission bits of newly " "created intermediate-level directories." msgstr "" -#: ../../library/os.rst:2417 +#: ../../library/os.rst:2418 msgid "" "Create a FIFO (a named pipe) named *path* with numeric mode *mode*. The " "current umask value is first masked out from the mode." msgstr "" -#: ../../library/os.rst:2423 +#: ../../library/os.rst:2424 msgid "" "FIFOs are pipes that can be accessed like regular files. FIFOs exist until " "they are deleted (for example with :func:`os.unlink`). Generally, FIFOs are " @@ -2722,7 +2722,7 @@ msgid "" "rendezvous point." msgstr "" -#: ../../library/os.rst:2440 +#: ../../library/os.rst:2441 msgid "" "Create a filesystem node (file, device special file or named pipe) named " "*path*. *mode* specifies both the permissions to use and the type of node to " @@ -2733,23 +2733,23 @@ msgid "" "`os.makedev`), otherwise it is ignored." msgstr "" -#: ../../library/os.rst:2462 +#: ../../library/os.rst:2463 msgid "" "Extract the device major number from a raw device number (usually the :attr:" "`st_dev` or :attr:`st_rdev` field from :c:struct:`stat`)." msgstr "" -#: ../../library/os.rst:2468 +#: ../../library/os.rst:2469 msgid "" "Extract the device minor number from a raw device number (usually the :attr:" "`st_dev` or :attr:`st_rdev` field from :c:struct:`stat`)." msgstr "" -#: ../../library/os.rst:2474 +#: ../../library/os.rst:2475 msgid "Compose a raw device number from the major and minor device numbers." msgstr "" -#: ../../library/os.rst:2479 +#: ../../library/os.rst:2480 msgid "" "Return system configuration information relevant to a named file. *name* " "specifies the configuration value to retrieve; it may be a string which is " @@ -2760,20 +2760,20 @@ msgid "" "included in that mapping, passing an integer for *name* is also accepted." msgstr "" -#: ../../library/os.rst:2492 ../../library/os.rst:3238 -#: ../../library/os.rst:3407 +#: ../../library/os.rst:2493 ../../library/os.rst:3239 +#: ../../library/os.rst:3408 msgid "" "This function can support :ref:`specifying a file descriptor `." msgstr "" -#: ../../library/os.rst:2503 +#: ../../library/os.rst:2504 msgid "" "Dictionary mapping names accepted by :func:`pathconf` and :func:`fpathconf` " "to the integer values defined for those names by the host operating system. " "This can be used to determine the set of names known to the system." msgstr "" -#: ../../library/os.rst:2512 +#: ../../library/os.rst:2513 msgid "" "Return a string representing the path to which the symbolic link points. " "The result may be either an absolute or relative pathname; if it is " @@ -2781,7 +2781,7 @@ msgid "" "join(os.path.dirname(path), result)``." msgstr "" -#: ../../library/os.rst:2517 +#: ../../library/os.rst:2518 msgid "" "If the *path* is a string object (directly or indirectly through a :class:" "`PathLike` interface), the result will also be a string object, and the call " @@ -2789,42 +2789,42 @@ msgid "" "indirectly), the result will be a bytes object." msgstr "" -#: ../../library/os.rst:2525 +#: ../../library/os.rst:2526 msgid "" "When trying to resolve a path that may contain links, use :func:`~os.path." "realpath` to properly handle recursion and platform differences." msgstr "" -#: ../../library/os.rst:2537 +#: ../../library/os.rst:2538 msgid "Accepts a :term:`path-like object` on Unix." msgstr "" -#: ../../library/os.rst:2540 +#: ../../library/os.rst:2541 msgid "Accepts a :term:`path-like object` and a bytes object on Windows." msgstr "" -#: ../../library/os.rst:2543 +#: ../../library/os.rst:2544 msgid "" "Added support for directory junctions, and changed to return the " "substitution path (which typically includes ``\\\\?\\`` prefix) rather than " "the optional \"print name\" field that was previously returned." msgstr "" -#: ../../library/os.rst:2550 +#: ../../library/os.rst:2551 msgid "" "Remove (delete) the file *path*. If *path* is a directory, an :exc:" "`OSError` is raised. Use :func:`rmdir` to remove directories. If the file " "does not exist, a :exc:`FileNotFoundError` is raised." msgstr "" -#: ../../library/os.rst:2554 ../../library/os.rst:2667 -#: ../../library/os.rst:3358 +#: ../../library/os.rst:2555 ../../library/os.rst:2668 +#: ../../library/os.rst:3359 msgid "" "This function can support :ref:`paths relative to directory descriptors " "`." msgstr "" -#: ../../library/os.rst:2557 +#: ../../library/os.rst:2558 msgid "" "On Windows, attempting to remove a file that is in use causes an exception " "to be raised; on Unix, the directory entry is removed but the storage " @@ -2832,12 +2832,12 @@ msgid "" "longer in use." msgstr "" -#: ../../library/os.rst:2561 +#: ../../library/os.rst:2562 msgid "This function is semantically identical to :func:`unlink`." msgstr "" -#: ../../library/os.rst:2563 ../../library/os.rst:2585 -#: ../../library/os.rst:3429 +#: ../../library/os.rst:2564 ../../library/os.rst:2586 +#: ../../library/os.rst:3430 msgid "" "Raises an :ref:`auditing event ` ``os.remove`` with arguments " "``path``, ``dir_fd``." @@ -2845,7 +2845,7 @@ msgstr "" "引發一個附帶引數 ``path``、``dir_fd`` 的\\ :ref:`稽核事件 ` ``os." "remove``。" -#: ../../library/os.rst:2576 +#: ../../library/os.rst:2577 msgid "" "Remove directories recursively. Works like :func:`rmdir` except that, if " "the leaf directory is successfully removed, :func:`removedirs` tries to " @@ -2857,20 +2857,20 @@ msgid "" "could not be successfully removed." msgstr "" -#: ../../library/os.rst:2593 +#: ../../library/os.rst:2594 msgid "" "Rename the file or directory *src* to *dst*. If *dst* exists, the operation " "will fail with an :exc:`OSError` subclass in a number of cases:" msgstr "" -#: ../../library/os.rst:2596 +#: ../../library/os.rst:2597 msgid "" "On Windows, if *dst* exists a :exc:`FileExistsError` is always raised. The " "operation may fail if *src* and *dst* are on different filesystems. Use :" "func:`shutil.move` to support moves to a different filesystem." msgstr "" -#: ../../library/os.rst:2600 +#: ../../library/os.rst:2601 msgid "" "On Unix, if *src* is a file and *dst* is a directory or vice-versa, an :exc:" "`IsADirectoryError` or a :exc:`NotADirectoryError` will be raised " @@ -2882,20 +2882,20 @@ msgid "" "operation (this is a POSIX requirement)." msgstr "" -#: ../../library/os.rst:2609 ../../library/os.rst:2649 +#: ../../library/os.rst:2610 ../../library/os.rst:2650 msgid "" "This function can support specifying *src_dir_fd* and/or *dst_dir_fd* to " "supply :ref:`paths relative to directory descriptors `." msgstr "" -#: ../../library/os.rst:2612 +#: ../../library/os.rst:2613 msgid "" "If you want cross-platform overwriting of the destination, use :func:" "`replace`." msgstr "" -#: ../../library/os.rst:2614 ../../library/os.rst:2635 -#: ../../library/os.rst:2652 +#: ../../library/os.rst:2615 ../../library/os.rst:2636 +#: ../../library/os.rst:2653 msgid "" "Raises an :ref:`auditing event ` ``os.rename`` with arguments " "``src``, ``dst``, ``src_dir_fd``, ``dst_dir_fd``." @@ -2903,11 +2903,11 @@ msgstr "" "引發一個附帶引數 ``src``、``dst``、``src_dir_fd``、``dst_dir_fd`` 的\\ :ref:`" "稽核事件 ` ``os.rename``。" -#: ../../library/os.rst:2616 +#: ../../library/os.rst:2617 msgid "The *src_dir_fd* and *dst_dir_fd* arguments." msgstr "*src_dir_fd* 與 *dst_dir_fd* 引數。" -#: ../../library/os.rst:2625 +#: ../../library/os.rst:2626 msgid "" "Recursive directory or file renaming function. Works like :func:`rename`, " "except creation of any intermediate directories needed to make the new " @@ -2916,17 +2916,17 @@ msgid "" "using :func:`removedirs`." msgstr "" -#: ../../library/os.rst:2632 +#: ../../library/os.rst:2633 msgid "" "This function can fail with the new directory structure made if you lack " "permissions needed to remove the leaf directory or file." msgstr "" -#: ../../library/os.rst:2637 +#: ../../library/os.rst:2638 msgid "Accepts a :term:`path-like object` for *old* and *new*." msgstr "" -#: ../../library/os.rst:2643 +#: ../../library/os.rst:2644 msgid "" "Rename the file or directory *src* to *dst*. If *dst* is a non-empty " "directory, :exc:`OSError` will be raised. If *dst* exists and is a file, it " @@ -2935,7 +2935,7 @@ msgid "" "renaming will be an atomic operation (this is a POSIX requirement)." msgstr "" -#: ../../library/os.rst:2662 +#: ../../library/os.rst:2663 msgid "" "Remove (delete) the directory *path*. If the directory does not exist or is " "not empty, a :exc:`FileNotFoundError` or an :exc:`OSError` is raised " @@ -2943,7 +2943,7 @@ msgid "" "rmtree` can be used." msgstr "" -#: ../../library/os.rst:2670 +#: ../../library/os.rst:2671 msgid "" "Raises an :ref:`auditing event ` ``os.rmdir`` with arguments " "``path``, ``dir_fd``." @@ -2951,11 +2951,11 @@ msgstr "" "引發一個附帶引數 ``path``、``dir_fd`` 的\\ :ref:`稽核事件 ` ``os." "rmdir``。" -#: ../../library/os.rst:2672 ../../library/os.rst:3431 +#: ../../library/os.rst:2673 ../../library/os.rst:3432 msgid "The *dir_fd* parameter." msgstr "*dir_fd* 參數。" -#: ../../library/os.rst:2681 +#: ../../library/os.rst:2682 msgid "" "Return an iterator of :class:`os.DirEntry` objects corresponding to the " "entries in the directory given by *path*. The entries are yielded in " @@ -2965,7 +2965,7 @@ msgid "" "unspecified." msgstr "" -#: ../../library/os.rst:2688 +#: ../../library/os.rst:2689 msgid "" "Using :func:`scandir` instead of :func:`listdir` can significantly increase " "the performance of code that also needs file type or file attribute " @@ -2977,7 +2977,7 @@ msgid "" "Unix but only requires one for symbolic links on Windows." msgstr "" -#: ../../library/os.rst:2698 +#: ../../library/os.rst:2699 msgid "" "*path* may be a :term:`path-like object`. If *path* is of type ``bytes`` " "(directly or indirectly through the :class:`PathLike` interface), the type " @@ -2986,31 +2986,31 @@ msgid "" "they will be of type ``str``." msgstr "" -#: ../../library/os.rst:2707 +#: ../../library/os.rst:2708 msgid "" "Raises an :ref:`auditing event ` ``os.scandir`` with argument " "``path``." msgstr "" "引發一個附帶引數 ``path`` 的\\ :ref:`稽核事件 ` ``os.scandir``。" -#: ../../library/os.rst:2709 +#: ../../library/os.rst:2710 msgid "" "The :func:`scandir` iterator supports the :term:`context manager` protocol " "and has the following method:" msgstr "" -#: ../../library/os.rst:2714 +#: ../../library/os.rst:2715 msgid "Close the iterator and free acquired resources." msgstr "" -#: ../../library/os.rst:2716 +#: ../../library/os.rst:2717 msgid "" "This is called automatically when the iterator is exhausted or garbage " "collected, or when an error happens during iterating. However it is " "advisable to call it explicitly or use the :keyword:`with` statement." msgstr "" -#: ../../library/os.rst:2723 +#: ../../library/os.rst:2724 msgid "" "The following example shows a simple use of :func:`scandir` to display all " "the files (excluding directories) in the given *path* that don't start with " @@ -3018,7 +3018,7 @@ msgid "" "system call::" msgstr "" -#: ../../library/os.rst:2735 +#: ../../library/os.rst:2736 msgid "" "On Unix-based systems, :func:`scandir` uses the system's `opendir() `_ and " @@ -3029,7 +3029,7 @@ msgid "" "desktop/aa364428(v=vs.85).aspx>`_ functions." msgstr "" -#: ../../library/os.rst:2747 +#: ../../library/os.rst:2748 msgid "" "Added support for the :term:`context manager` protocol and the :func:" "`~scandir.close()` method. If a :func:`scandir` iterator is neither " @@ -3037,28 +3037,28 @@ msgid "" "its destructor." msgstr "" -#: ../../library/os.rst:2753 +#: ../../library/os.rst:2754 msgid "The function accepts a :term:`path-like object`." msgstr "" -#: ../../library/os.rst:2755 +#: ../../library/os.rst:2756 msgid "Added support for :ref:`file descriptors ` on Unix." msgstr "" -#: ../../library/os.rst:2761 +#: ../../library/os.rst:2762 msgid "" "Object yielded by :func:`scandir` to expose the file path and other file " "attributes of a directory entry." msgstr "" -#: ../../library/os.rst:2764 +#: ../../library/os.rst:2765 msgid "" ":func:`scandir` will provide as much of this information as possible without " "making additional system calls. When a ``stat()`` or ``lstat()`` system call " "is made, the ``os.DirEntry`` object will cache the result." msgstr "" -#: ../../library/os.rst:2768 +#: ../../library/os.rst:2769 msgid "" "``os.DirEntry`` instances are not intended to be stored in long-lived data " "structures; if you know the file metadata has changed or if a long time has " @@ -3066,7 +3066,7 @@ msgid "" "up-to-date information." msgstr "" -#: ../../library/os.rst:2773 +#: ../../library/os.rst:2774 msgid "" "Because the ``os.DirEntry`` methods can make operating system calls, they " "may also raise :exc:`OSError`. If you need very fine-grained control over " @@ -3074,29 +3074,29 @@ msgid "" "methods and handle as appropriate." msgstr "" -#: ../../library/os.rst:2778 +#: ../../library/os.rst:2779 msgid "" "To be directly usable as a :term:`path-like object`, ``os.DirEntry`` " "implements the :class:`PathLike` interface." msgstr "" -#: ../../library/os.rst:2781 +#: ../../library/os.rst:2782 msgid "Attributes and methods on a ``os.DirEntry`` instance are as follows:" msgstr "" -#: ../../library/os.rst:2785 +#: ../../library/os.rst:2786 msgid "" "The entry's base filename, relative to the :func:`scandir` *path* argument." msgstr "" -#: ../../library/os.rst:2788 +#: ../../library/os.rst:2789 msgid "" "The :attr:`name` attribute will be ``bytes`` if the :func:`scandir` *path* " "argument is of type ``bytes`` and ``str`` otherwise. Use :func:`~os." "fsdecode` to decode byte filenames." msgstr "" -#: ../../library/os.rst:2794 +#: ../../library/os.rst:2795 msgid "" "The entry's full path name: equivalent to ``os.path.join(scandir_path, entry." "name)`` where *scandir_path* is the :func:`scandir` *path* argument. The " @@ -3106,51 +3106,51 @@ msgid "" "attribute." msgstr "" -#: ../../library/os.rst:2801 +#: ../../library/os.rst:2802 msgid "" "The :attr:`path` attribute will be ``bytes`` if the :func:`scandir` *path* " "argument is of type ``bytes`` and ``str`` otherwise. Use :func:`~os." "fsdecode` to decode byte filenames." msgstr "" -#: ../../library/os.rst:2807 +#: ../../library/os.rst:2808 msgid "Return the inode number of the entry." msgstr "" -#: ../../library/os.rst:2809 +#: ../../library/os.rst:2810 msgid "" "The result is cached on the ``os.DirEntry`` object. Use ``os.stat(entry." "path, follow_symlinks=False).st_ino`` to fetch up-to-date information." msgstr "" -#: ../../library/os.rst:2813 +#: ../../library/os.rst:2814 msgid "" "On the first, uncached call, a system call is required on Windows but not on " "Unix." msgstr "" -#: ../../library/os.rst:2818 +#: ../../library/os.rst:2819 msgid "" "Return ``True`` if this entry is a directory or a symbolic link pointing to " "a directory; return ``False`` if the entry is or points to any other kind of " "file, or if it doesn't exist anymore." msgstr "" -#: ../../library/os.rst:2822 +#: ../../library/os.rst:2823 msgid "" "If *follow_symlinks* is ``False``, return ``True`` only if this entry is a " "directory (without following symlinks); return ``False`` if the entry is any " "other kind of file or if it doesn't exist anymore." msgstr "" -#: ../../library/os.rst:2826 +#: ../../library/os.rst:2827 msgid "" "The result is cached on the ``os.DirEntry`` object, with a separate cache " "for *follow_symlinks* ``True`` and ``False``. Call :func:`os.stat` along " "with :func:`stat.S_ISDIR` to fetch up-to-date information." msgstr "" -#: ../../library/os.rst:2830 +#: ../../library/os.rst:2831 msgid "" "On the first, uncached call, no system call is required in most cases. " "Specifically, for non-symlinks, neither Windows or Unix require a system " @@ -3160,46 +3160,46 @@ msgid "" "is ``False``." msgstr "" -#: ../../library/os.rst:2837 ../../library/os.rst:2867 +#: ../../library/os.rst:2838 ../../library/os.rst:2868 msgid "" "This method can raise :exc:`OSError`, such as :exc:`PermissionError`, but :" "exc:`FileNotFoundError` is caught and not raised." msgstr "" -#: ../../library/os.rst:2842 +#: ../../library/os.rst:2843 msgid "" "Return ``True`` if this entry is a file or a symbolic link pointing to a " "file; return ``False`` if the entry is or points to a directory or other non-" "file entry, or if it doesn't exist anymore." msgstr "" -#: ../../library/os.rst:2846 +#: ../../library/os.rst:2847 msgid "" "If *follow_symlinks* is ``False``, return ``True`` only if this entry is a " "file (without following symlinks); return ``False`` if the entry is a " "directory or other non-file entry, or if it doesn't exist anymore." msgstr "" -#: ../../library/os.rst:2850 +#: ../../library/os.rst:2851 msgid "" "The result is cached on the ``os.DirEntry`` object. Caching, system calls " "made, and exceptions raised are as per :func:`~os.DirEntry.is_dir`." msgstr "" -#: ../../library/os.rst:2855 +#: ../../library/os.rst:2856 msgid "" "Return ``True`` if this entry is a symbolic link (even if broken); return " "``False`` if the entry points to a directory or any kind of file, or if it " "doesn't exist anymore." msgstr "" -#: ../../library/os.rst:2859 +#: ../../library/os.rst:2860 msgid "" "The result is cached on the ``os.DirEntry`` object. Call :func:`os.path." "islink` to fetch up-to-date information." msgstr "" -#: ../../library/os.rst:2862 +#: ../../library/os.rst:2863 msgid "" "On the first, uncached call, no system call is required in most cases. " "Specifically, neither Windows or Unix require a system call, except on " @@ -3207,48 +3207,48 @@ msgid "" "``dirent.d_type == DT_UNKNOWN``." msgstr "" -#: ../../library/os.rst:2872 +#: ../../library/os.rst:2873 msgid "" "Return ``True`` if this entry is a junction (even if broken); return " "``False`` if the entry points to a regular directory, any kind of file, a " "symlink, or if it doesn't exist anymore." msgstr "" -#: ../../library/os.rst:2876 +#: ../../library/os.rst:2877 msgid "" "The result is cached on the ``os.DirEntry`` object. Call :func:`os.path." "isjunction` to fetch up-to-date information." msgstr "" -#: ../../library/os.rst:2883 +#: ../../library/os.rst:2884 msgid "" "Return a :class:`stat_result` object for this entry. This method follows " "symbolic links by default; to stat a symbolic link add the " "``follow_symlinks=False`` argument." msgstr "" -#: ../../library/os.rst:2887 +#: ../../library/os.rst:2888 msgid "" "On Unix, this method always requires a system call. On Windows, it only " "requires a system call if *follow_symlinks* is ``True`` and the entry is a " "reparse point (for example, a symbolic link or directory junction)." msgstr "" -#: ../../library/os.rst:2892 +#: ../../library/os.rst:2893 msgid "" "On Windows, the ``st_ino``, ``st_dev`` and ``st_nlink`` attributes of the :" "class:`stat_result` are always set to zero. Call :func:`os.stat` to get " "these attributes." msgstr "" -#: ../../library/os.rst:2896 +#: ../../library/os.rst:2897 msgid "" "The result is cached on the ``os.DirEntry`` object, with a separate cache " "for *follow_symlinks* ``True`` and ``False``. Call :func:`os.stat` to fetch " "up-to-date information." msgstr "" -#: ../../library/os.rst:2900 +#: ../../library/os.rst:2901 msgid "" "Note that there is a nice correspondence between several attributes and " "methods of ``os.DirEntry`` and of :class:`pathlib.Path`. In particular, the " @@ -3256,13 +3256,13 @@ msgid "" "``is_file()``, ``is_symlink()``, ``is_junction()``, and ``stat()`` methods." msgstr "" -#: ../../library/os.rst:2908 +#: ../../library/os.rst:2909 msgid "" "Added support for the :class:`~os.PathLike` interface. Added support for :" "class:`bytes` paths on Windows." msgstr "" -#: ../../library/os.rst:2912 +#: ../../library/os.rst:2913 msgid "" "The ``st_ctime`` attribute of a stat result is deprecated on Windows. The " "file creation time is properly available as ``st_birthtime``, and in the " @@ -3270,7 +3270,7 @@ msgid "" "time, if available." msgstr "" -#: ../../library/os.rst:2921 +#: ../../library/os.rst:2922 msgid "" "Get the status of a file or a file descriptor. Perform the equivalent of a :" "c:func:`stat` system call on the given path. *path* may be specified as " @@ -3279,21 +3279,21 @@ msgid "" "`stat_result` object." msgstr "" -#: ../../library/os.rst:2927 +#: ../../library/os.rst:2928 msgid "" "This function normally follows symlinks; to stat a symlink add the argument " "``follow_symlinks=False``, or use :func:`lstat`." msgstr "" -#: ../../library/os.rst:2930 ../../library/os.rst:3797 -#: ../../library/os.rst:3813 ../../library/os.rst:3829 -#: ../../library/os.rst:3849 +#: ../../library/os.rst:2931 ../../library/os.rst:3798 +#: ../../library/os.rst:3814 ../../library/os.rst:3830 +#: ../../library/os.rst:3850 msgid "" "This function can support :ref:`specifying a file descriptor ` and :" "ref:`not following symlinks `." msgstr "" -#: ../../library/os.rst:2933 +#: ../../library/os.rst:2934 msgid "" "On Windows, passing ``follow_symlinks=False`` will disable following all " "name-surrogate reparse points, which includes symlinks and directory " @@ -3307,24 +3307,24 @@ msgid "" "junction points, which will raise the usual exceptions." msgstr "" -#: ../../library/os.rst:2946 ../../library/os.rst:3717 +#: ../../library/os.rst:2947 ../../library/os.rst:3718 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/os.rst:2959 +#: ../../library/os.rst:2960 msgid ":func:`fstat` and :func:`lstat` functions." msgstr ":func:`fstat` 和 :func:`lstat` 函式。" -#: ../../library/os.rst:2961 +#: ../../library/os.rst:2962 msgid "" "Added the *dir_fd* and *follow_symlinks* arguments, specifying a file " "descriptor instead of a path." msgstr "" -#: ../../library/os.rst:2968 +#: ../../library/os.rst:2969 msgid "" "On Windows, all reparse points that can be resolved by the operating system " "are now followed, and passing ``follow_symlinks=False`` disables following " @@ -3334,122 +3334,122 @@ msgid "" "of raising an error." msgstr "" -#: ../../library/os.rst:2979 +#: ../../library/os.rst:2980 msgid "" "Object whose attributes correspond roughly to the members of the :c:struct:" "`stat` structure. It is used for the result of :func:`os.stat`, :func:`os." "fstat` and :func:`os.lstat`." msgstr "" -#: ../../library/os.rst:2983 +#: ../../library/os.rst:2984 msgid "Attributes:" msgstr "" -#: ../../library/os.rst:2987 +#: ../../library/os.rst:2988 msgid "File mode: file type and file mode bits (permissions)." msgstr "" -#: ../../library/os.rst:2991 +#: ../../library/os.rst:2992 msgid "" "Platform dependent, but if non-zero, uniquely identifies the file for a " "given value of ``st_dev``. Typically:" msgstr "" -#: ../../library/os.rst:2994 +#: ../../library/os.rst:2995 msgid "the inode number on Unix," msgstr "" -#: ../../library/os.rst:2995 +#: ../../library/os.rst:2996 msgid "" "the `file index `_ on " "Windows" msgstr "" -#: ../../library/os.rst:3001 +#: ../../library/os.rst:3002 msgid "Identifier of the device on which this file resides." msgstr "" -#: ../../library/os.rst:3005 +#: ../../library/os.rst:3006 msgid "Number of hard links." msgstr "" -#: ../../library/os.rst:3009 +#: ../../library/os.rst:3010 msgid "User identifier of the file owner." msgstr "" -#: ../../library/os.rst:3013 +#: ../../library/os.rst:3014 msgid "Group identifier of the file owner." msgstr "" -#: ../../library/os.rst:3017 +#: ../../library/os.rst:3018 msgid "" "Size of the file in bytes, if it is a regular file or a symbolic link. The " "size of a symbolic link is the length of the pathname it contains, without a " "terminating null byte." msgstr "" -#: ../../library/os.rst:3021 +#: ../../library/os.rst:3022 msgid "Timestamps:" msgstr "" -#: ../../library/os.rst:3025 +#: ../../library/os.rst:3026 msgid "Time of most recent access expressed in seconds." msgstr "" -#: ../../library/os.rst:3029 +#: ../../library/os.rst:3030 msgid "Time of most recent content modification expressed in seconds." msgstr "" -#: ../../library/os.rst:3033 +#: ../../library/os.rst:3034 msgid "Time of most recent metadata change expressed in seconds." msgstr "" -#: ../../library/os.rst:3035 +#: ../../library/os.rst:3036 msgid "" "``st_ctime`` is deprecated on Windows. Use ``st_birthtime`` for the file " "creation time. In the future, ``st_ctime`` will contain the time of the most " "recent metadata change, as for other platforms." msgstr "" -#: ../../library/os.rst:3042 +#: ../../library/os.rst:3043 msgid "Time of most recent access expressed in nanoseconds as an integer." msgstr "" -#: ../../library/os.rst:3046 +#: ../../library/os.rst:3047 msgid "" "Time of most recent content modification expressed in nanoseconds as an " "integer." msgstr "" -#: ../../library/os.rst:3051 +#: ../../library/os.rst:3052 msgid "" "Time of most recent metadata change expressed in nanoseconds as an integer." msgstr "" -#: ../../library/os.rst:3054 +#: ../../library/os.rst:3055 msgid "" "``st_ctime_ns`` is deprecated on Windows. Use ``st_birthtime_ns`` for the " "file creation time. In the future, ``st_ctime`` will contain the time of the " "most recent metadata change, as for other platforms." msgstr "" -#: ../../library/os.rst:3061 +#: ../../library/os.rst:3062 msgid "" "Time of file creation expressed in seconds. This attribute is not always " "available, and may raise :exc:`AttributeError`." msgstr "" -#: ../../library/os.rst:3064 +#: ../../library/os.rst:3065 msgid "``st_birthtime`` is now available on Windows." msgstr "" -#: ../../library/os.rst:3069 +#: ../../library/os.rst:3070 msgid "" "Time of file creation expressed in nanoseconds as an integer. This attribute " "is not always available, and may raise :exc:`AttributeError`." msgstr "" -#: ../../library/os.rst:3077 +#: ../../library/os.rst:3078 msgid "" "The exact meaning and resolution of the :attr:`st_atime`, :attr:`st_mtime`, :" "attr:`st_ctime` and :attr:`st_birthtime` attributes depend on the operating " @@ -3459,7 +3459,7 @@ msgid "" "details." msgstr "" -#: ../../library/os.rst:3084 +#: ../../library/os.rst:3085 msgid "" "Similarly, although :attr:`st_atime_ns`, :attr:`st_mtime_ns`, :attr:" "`st_ctime_ns` and :attr:`st_birthtime_ns` are always expressed in " @@ -3472,74 +3472,74 @@ msgid "" "`st_birthtime_ns`." msgstr "" -#: ../../library/os.rst:3094 +#: ../../library/os.rst:3095 msgid "" "On some Unix systems (such as Linux), the following attributes may also be " "available:" msgstr "" -#: ../../library/os.rst:3099 +#: ../../library/os.rst:3100 msgid "" "Number of 512-byte blocks allocated for file. This may be smaller than :attr:" "`st_size`/512 when the file has holes." msgstr "" -#: ../../library/os.rst:3104 +#: ../../library/os.rst:3105 msgid "" "\"Preferred\" blocksize for efficient file system I/O. Writing to a file in " "smaller chunks may cause an inefficient read-modify-rewrite." msgstr "" -#: ../../library/os.rst:3109 +#: ../../library/os.rst:3110 msgid "Type of device if an inode device." msgstr "" -#: ../../library/os.rst:3113 +#: ../../library/os.rst:3114 msgid "User defined flags for file." msgstr "" -#: ../../library/os.rst:3115 +#: ../../library/os.rst:3116 msgid "" "On other Unix systems (such as FreeBSD), the following attributes may be " "available (but may be only filled out if root tries to use them):" msgstr "" -#: ../../library/os.rst:3120 +#: ../../library/os.rst:3121 msgid "File generation number." msgstr "" -#: ../../library/os.rst:3122 +#: ../../library/os.rst:3123 msgid "" "On Solaris and derivatives, the following attributes may also be available:" msgstr "" -#: ../../library/os.rst:3127 +#: ../../library/os.rst:3128 msgid "" "String that uniquely identifies the type of the filesystem that contains the " "file." msgstr "" -#: ../../library/os.rst:3130 +#: ../../library/os.rst:3131 msgid "On macOS systems, the following attributes may also be available:" msgstr "" -#: ../../library/os.rst:3134 +#: ../../library/os.rst:3135 msgid "Real size of the file." msgstr "" -#: ../../library/os.rst:3138 +#: ../../library/os.rst:3139 msgid "Creator of the file." msgstr "" -#: ../../library/os.rst:3142 +#: ../../library/os.rst:3143 msgid "File type." msgstr "" -#: ../../library/os.rst:3144 +#: ../../library/os.rst:3145 msgid "On Windows systems, the following attributes are also available:" msgstr "" -#: ../../library/os.rst:3148 +#: ../../library/os.rst:3149 msgid "" "Windows file attributes: ``dwFileAttributes`` member of the " "``BY_HANDLE_FILE_INFORMATION`` structure returned by :c:func:`!" @@ -3547,7 +3547,7 @@ msgid "" "FILE_ATTRIBUTE_ARCHIVE>` constants in the :mod:`stat` module." msgstr "" -#: ../../library/os.rst:3156 +#: ../../library/os.rst:3157 msgid "" "When :attr:`st_file_attributes` has the :const:`~stat." "FILE_ATTRIBUTE_REPARSE_POINT` set, this field contains the tag identifying " @@ -3555,14 +3555,14 @@ msgid "" "IO_REPARSE_TAG_SYMLINK>` constants in the :mod:`stat` module." msgstr "" -#: ../../library/os.rst:3161 +#: ../../library/os.rst:3162 msgid "" "The standard module :mod:`stat` defines functions and constants that are " "useful for extracting information from a :c:struct:`stat` structure. (On " "Windows, some items are filled with dummy values.)" msgstr "" -#: ../../library/os.rst:3165 +#: ../../library/os.rst:3166 msgid "" "For backward compatibility, a :class:`stat_result` instance is also " "accessible as a tuple of at least 10 integers giving the most important (and " @@ -3574,59 +3574,59 @@ msgid "" "class:`stat_result` as a tuple always returns integers." msgstr "" -#: ../../library/os.rst:3174 +#: ../../library/os.rst:3175 msgid "" "Added the :attr:`st_atime_ns`, :attr:`st_mtime_ns`, and :attr:`st_ctime_ns` " "members." msgstr "" -#: ../../library/os.rst:3178 +#: ../../library/os.rst:3179 msgid "Added the :attr:`st_file_attributes` member on Windows." msgstr "在 Windows 上新增 :attr:`st_file_attributes` 成員。" -#: ../../library/os.rst:3181 +#: ../../library/os.rst:3182 msgid "Windows now returns the file index as :attr:`st_ino` when available." msgstr "" -#: ../../library/os.rst:3185 +#: ../../library/os.rst:3186 msgid "Added the :attr:`st_fstype` member to Solaris/derivatives." msgstr "" -#: ../../library/os.rst:3188 +#: ../../library/os.rst:3189 msgid "Added the :attr:`st_reparse_tag` member on Windows." msgstr "在 Windows 上新增 :attr:`st_reparse_tag` 成員。" -#: ../../library/os.rst:3191 +#: ../../library/os.rst:3192 msgid "" "On Windows, the :attr:`st_mode` member now identifies special files as :" "const:`S_IFCHR`, :const:`S_IFIFO` or :const:`S_IFBLK` as appropriate." msgstr "" -#: ../../library/os.rst:3196 +#: ../../library/os.rst:3197 msgid "" "On Windows, :attr:`st_ctime` is deprecated. Eventually, it will contain the " "last metadata change time, for consistency with other platforms, but for now " "still contains creation time. Use :attr:`st_birthtime` for the creation time." msgstr "" -#: ../../library/os.rst:3202 +#: ../../library/os.rst:3203 msgid "" "On Windows, :attr:`st_ino` may now be up to 128 bits, depending on the file " "system. Previously it would not be above 64 bits, and larger file " "identifiers would be arbitrarily packed." msgstr "" -#: ../../library/os.rst:3207 +#: ../../library/os.rst:3208 msgid "" "On Windows, :attr:`st_rdev` no longer returns a value. Previously it would " "contain the same as :attr:`st_dev`, which was incorrect." msgstr "" -#: ../../library/os.rst:3211 +#: ../../library/os.rst:3212 msgid "Added the :attr:`st_birthtime` member on Windows." msgstr "" -#: ../../library/os.rst:3217 +#: ../../library/os.rst:3218 msgid "" "Perform a :c:func:`!statvfs` system call on the given path. The return " "value is an object whose attributes describe the filesystem on the given " @@ -3636,7 +3636,7 @@ msgid "" "`f_favail`, :attr:`f_flag`, :attr:`f_namemax`, :attr:`f_fsid`." msgstr "" -#: ../../library/os.rst:3224 +#: ../../library/os.rst:3225 msgid "" "Two module-level constants are defined for the :attr:`f_flag` attribute's " "bit-flags: if :const:`ST_RDONLY` is set, the filesystem is mounted read-" @@ -3644,7 +3644,7 @@ msgid "" "are disabled or not supported." msgstr "" -#: ../../library/os.rst:3229 +#: ../../library/os.rst:3230 msgid "" "Additional module-level constants are defined for GNU/glibc based systems. " "These are :const:`ST_NODEV` (disallow access to device special files), :" @@ -3657,11 +3657,11 @@ msgid "" "relative to mtime/ctime)." msgstr "" -#: ../../library/os.rst:3242 +#: ../../library/os.rst:3243 msgid "The :const:`ST_RDONLY` and :const:`ST_NOSUID` constants were added." msgstr "新增 :const:`ST_RDONLY` 與 :const:`ST_NOSUID` 常數。" -#: ../../library/os.rst:3248 +#: ../../library/os.rst:3249 msgid "" "The :const:`ST_NODEV`, :const:`ST_NOEXEC`, :const:`ST_SYNCHRONOUS`, :const:" "`ST_MANDLOCK`, :const:`ST_WRITE`, :const:`ST_APPEND`, :const:" @@ -3669,11 +3669,11 @@ msgid "" "`ST_RELATIME` constants were added." msgstr "" -#: ../../library/os.rst:3257 +#: ../../library/os.rst:3258 msgid "Added :attr:`f_fsid`." msgstr "新增 :attr:`f_fsid`\\ 。" -#: ../../library/os.rst:3263 +#: ../../library/os.rst:3264 msgid "" "A :class:`set` object indicating which functions in the :mod:`os` module " "accept an open file descriptor for their *dir_fd* parameter. Different " @@ -3685,7 +3685,7 @@ msgid "" "(Specifying ``None`` for *dir_fd* is always supported on all platforms.)" msgstr "" -#: ../../library/os.rst:3273 +#: ../../library/os.rst:3274 msgid "" "To check whether a particular function accepts an open file descriptor for " "its *dir_fd* parameter, use the ``in`` operator on ``supports_dir_fd``. As " @@ -3693,13 +3693,13 @@ msgid "" "open file descriptors for *dir_fd* on the local platform::" msgstr "" -#: ../../library/os.rst:3280 +#: ../../library/os.rst:3281 msgid "" "Currently *dir_fd* parameters only work on Unix platforms; none of them work " "on Windows." msgstr "" -#: ../../library/os.rst:3288 +#: ../../library/os.rst:3289 msgid "" "A :class:`set` object indicating whether :func:`os.access` permits " "specifying ``True`` for its *effective_ids* parameter on the local platform. " @@ -3708,19 +3708,19 @@ msgid "" "func:`os.access`; otherwise it will be empty." msgstr "" -#: ../../library/os.rst:3294 +#: ../../library/os.rst:3295 msgid "" "This expression evaluates to ``True`` if :func:`os.access` supports " "``effective_ids=True`` on the local platform::" msgstr "" -#: ../../library/os.rst:3299 +#: ../../library/os.rst:3300 msgid "" "Currently *effective_ids* is only supported on Unix platforms; it does not " "work on Windows." msgstr "" -#: ../../library/os.rst:3307 +#: ../../library/os.rst:3308 msgid "" "A :class:`set` object indicating which functions in the :mod:`os` module " "permit specifying their *path* parameter as an open file descriptor on the " @@ -3729,7 +3729,7 @@ msgid "" "*path* arguments is not available on all platforms Python supports." msgstr "" -#: ../../library/os.rst:3314 +#: ../../library/os.rst:3315 msgid "" "To determine whether a particular function permits specifying an open file " "descriptor for its *path* parameter, use the ``in`` operator on " @@ -3738,7 +3738,7 @@ msgid "" "platform::" msgstr "" -#: ../../library/os.rst:3327 +#: ../../library/os.rst:3328 msgid "" "A :class:`set` object indicating which functions in the :mod:`os` module " "accept ``False`` for their *follow_symlinks* parameter on the local " @@ -3751,7 +3751,7 @@ msgid "" "on all platforms.)" msgstr "" -#: ../../library/os.rst:3337 +#: ../../library/os.rst:3338 msgid "" "To check whether a particular function accepts ``False`` for its " "*follow_symlinks* parameter, use the ``in`` operator on " @@ -3760,11 +3760,11 @@ msgid "" "stat` on the local platform::" msgstr "" -#: ../../library/os.rst:3350 +#: ../../library/os.rst:3351 msgid "Create a symbolic link pointing to *src* named *dst*." msgstr "" -#: ../../library/os.rst:3352 +#: ../../library/os.rst:3353 msgid "" "On Windows, a symlink represents either a file or a directory, and does not " "morph to the target dynamically. If the target is present, the type of the " @@ -3774,7 +3774,7 @@ msgid "" "ignored." msgstr "" -#: ../../library/os.rst:3363 +#: ../../library/os.rst:3364 msgid "" "On newer versions of Windows 10, unprivileged accounts can create symlinks " "if Developer Mode is enabled. When Developer Mode is not available/enabled, " @@ -3782,12 +3782,12 @@ msgid "" "must be run as an administrator." msgstr "" -#: ../../library/os.rst:3369 +#: ../../library/os.rst:3370 msgid "" ":exc:`OSError` is raised when the function is called by an unprivileged user." msgstr "" -#: ../../library/os.rst:3372 +#: ../../library/os.rst:3373 msgid "" "Raises an :ref:`auditing event ` ``os.symlink`` with arguments " "``src``, ``dst``, ``dir_fd``." @@ -3795,27 +3795,27 @@ msgstr "" "引發一個附帶引數 ``src``、``dst``、``dir_fd`` 的\\ :ref:`稽核事件 " "` ``os.symlink``。" -#: ../../library/os.rst:3382 +#: ../../library/os.rst:3383 msgid "" "Added the *dir_fd* argument, and now allow *target_is_directory* on non-" "Windows platforms." msgstr "" -#: ../../library/os.rst:3389 +#: ../../library/os.rst:3390 msgid "Added support for unelevated symlinks on Windows with Developer Mode." msgstr "" -#: ../../library/os.rst:3395 +#: ../../library/os.rst:3396 msgid "Force write of everything to disk." msgstr "" -#: ../../library/os.rst:3404 +#: ../../library/os.rst:3405 msgid "" "Truncate the file corresponding to *path*, so that it is at most *length* " "bytes in size." msgstr "" -#: ../../library/os.rst:3409 +#: ../../library/os.rst:3410 msgid "" "Raises an :ref:`auditing event ` ``os.truncate`` with arguments " "``path``, ``length``." @@ -3823,46 +3823,46 @@ msgstr "" "引發一個附帶引數 ``path``、``length`` 的\\ :ref:`稽核事件 ` ``os." "truncate``。" -#: ../../library/os.rst:3424 +#: ../../library/os.rst:3425 msgid "" "Remove (delete) the file *path*. This function is semantically identical " "to :func:`remove`; the ``unlink`` name is its traditional Unix name. Please " "see the documentation for :func:`remove` for further information." msgstr "" -#: ../../library/os.rst:3440 +#: ../../library/os.rst:3441 msgid "Set the access and modified times of the file specified by *path*." msgstr "" -#: ../../library/os.rst:3442 +#: ../../library/os.rst:3443 msgid "" ":func:`utime` takes two optional parameters, *times* and *ns*. These specify " "the times set on *path* and are used as follows:" msgstr "" -#: ../../library/os.rst:3445 +#: ../../library/os.rst:3446 msgid "" "If *ns* is specified, it must be a 2-tuple of the form ``(atime_ns, " "mtime_ns)`` where each member is an int expressing nanoseconds." msgstr "" -#: ../../library/os.rst:3448 +#: ../../library/os.rst:3449 msgid "" "If *times* is not ``None``, it must be a 2-tuple of the form ``(atime, " "mtime)`` where each member is an int or float expressing seconds." msgstr "" -#: ../../library/os.rst:3451 +#: ../../library/os.rst:3452 msgid "" "If *times* is ``None`` and *ns* is unspecified, this is equivalent to " "specifying ``ns=(atime_ns, mtime_ns)`` where both times are the current time." msgstr "" -#: ../../library/os.rst:3455 +#: ../../library/os.rst:3456 msgid "It is an error to specify tuples for both *times* and *ns*." msgstr "" -#: ../../library/os.rst:3457 +#: ../../library/os.rst:3458 msgid "" "Note that the exact times you set here may not be returned by a subsequent :" "func:`~os.stat` call, depending on the resolution with which your operating " @@ -3872,7 +3872,7 @@ msgid "" "func:`utime`." msgstr "" -#: ../../library/os.rst:3468 +#: ../../library/os.rst:3469 msgid "" "Raises an :ref:`auditing event ` ``os.utime`` with arguments " "``path``, ``times``, ``ns``, ``dir_fd``." @@ -3880,13 +3880,13 @@ msgstr "" "引發一個附帶引數 ``path``、``times``、``ns``、``dir_fd`` 的\\ :ref:`稽核事件 " "` ``os.utime``。" -#: ../../library/os.rst:3470 +#: ../../library/os.rst:3471 msgid "" "Added support for specifying *path* as an open file descriptor, and the " "*dir_fd*, *follow_symlinks*, and *ns* parameters." msgstr "" -#: ../../library/os.rst:3484 +#: ../../library/os.rst:3485 msgid "" "Generate the file names in a directory tree by walking the tree either top-" "down or bottom-up. For each directory in the tree rooted at directory *top* " @@ -3894,7 +3894,7 @@ msgid "" "filenames)``." msgstr "" -#: ../../library/os.rst:3489 +#: ../../library/os.rst:3490 msgid "" "*dirpath* is a string, the path to the directory. *dirnames* is a list of " "the names of the subdirectories in *dirpath* (including symlinks to " @@ -3908,7 +3908,7 @@ msgid "" "unspecified." msgstr "" -#: ../../library/os.rst:3500 +#: ../../library/os.rst:3501 msgid "" "If optional argument *topdown* is ``True`` or not specified, the triple for " "a directory is generated before the triples for any of its subdirectories " @@ -3919,7 +3919,7 @@ msgid "" "its subdirectories are generated." msgstr "" -#: ../../library/os.rst:3508 +#: ../../library/os.rst:3509 msgid "" "When *topdown* is ``True``, the caller can modify the *dirnames* list in-" "place (perhaps using :keyword:`del` or slice assignment), and :func:`walk` " @@ -3932,7 +3932,7 @@ msgid "" "itself is generated." msgstr "" -#: ../../library/os.rst:3517 +#: ../../library/os.rst:3518 msgid "" "By default, errors from the :func:`scandir` call are ignored. If optional " "argument *onerror* is specified, it should be a function; it will be called " @@ -3942,42 +3942,42 @@ msgid "" "object." msgstr "" -#: ../../library/os.rst:3523 +#: ../../library/os.rst:3524 msgid "" "By default, :func:`walk` will not walk down into symbolic links that resolve " "to directories. Set *followlinks* to ``True`` to visit directories pointed " "to by symlinks, on systems that support them." msgstr "" -#: ../../library/os.rst:3529 +#: ../../library/os.rst:3530 msgid "" "Be aware that setting *followlinks* to ``True`` can lead to infinite " "recursion if a link points to a parent directory of itself. :func:`walk` " "does not keep track of the directories it visited already." msgstr "" -#: ../../library/os.rst:3535 +#: ../../library/os.rst:3536 msgid "" "If you pass a relative pathname, don't change the current working directory " "between resumptions of :func:`walk`. :func:`walk` never changes the current " "directory, and assumes that its caller doesn't either." msgstr "" -#: ../../library/os.rst:3539 ../../library/os.rst:3600 +#: ../../library/os.rst:3540 ../../library/os.rst:3601 msgid "" "This example displays the number of bytes taken by non-directory files in " "each directory under the starting directory, except that it doesn't look " "under any CVS subdirectory::" msgstr "" -#: ../../library/os.rst:3552 +#: ../../library/os.rst:3553 msgid "" "In the next example (simple implementation of :func:`shutil.rmtree`), " "walking the tree bottom-up is essential, :func:`rmdir` doesn't allow " "deleting a directory before the directory is empty::" msgstr "" -#: ../../library/os.rst:3567 +#: ../../library/os.rst:3568 msgid "" "Raises an :ref:`auditing event ` ``os.walk`` with arguments " "``top``, ``topdown``, ``onerror``, ``followlinks``." @@ -3985,25 +3985,25 @@ msgstr "" "引發一個附帶引數 ``top``、``topdown``、``onerror``、``followlinks`` 的\\ :" "ref:`稽核事件 ` ``os.walk``。" -#: ../../library/os.rst:3569 +#: ../../library/os.rst:3570 msgid "" "This function now calls :func:`os.scandir` instead of :func:`os.listdir`, " "making it faster by reducing the number of calls to :func:`os.stat`." msgstr "" -#: ../../library/os.rst:3583 +#: ../../library/os.rst:3584 msgid "" "This behaves exactly like :func:`walk`, except that it yields a 4-tuple " "``(dirpath, dirnames, filenames, dirfd)``, and it supports ``dir_fd``." msgstr "" -#: ../../library/os.rst:3586 +#: ../../library/os.rst:3587 msgid "" "*dirpath*, *dirnames* and *filenames* are identical to :func:`walk` output, " "and *dirfd* is a file descriptor referring to the directory *dirpath*." msgstr "" -#: ../../library/os.rst:3589 +#: ../../library/os.rst:3590 msgid "" "This function always supports :ref:`paths relative to directory descriptors " "` and :ref:`not following symlinks `. Note however " @@ -4011,20 +4011,20 @@ msgid "" "*follow_symlinks* is ``False``." msgstr "" -#: ../../library/os.rst:3596 +#: ../../library/os.rst:3597 msgid "" "Since :func:`fwalk` yields file descriptors, those are only valid until the " "next iteration step, so you should duplicate them (e.g. with :func:`dup`) if " "you want to keep them longer." msgstr "" -#: ../../library/os.rst:3613 +#: ../../library/os.rst:3614 msgid "" "In the next example, walking the tree bottom-up is essential: :func:`rmdir` " "doesn't allow deleting a directory before the directory is empty::" msgstr "" -#: ../../library/os.rst:3628 +#: ../../library/os.rst:3629 msgid "" "Raises an :ref:`auditing event ` ``os.fwalk`` with arguments " "``top``, ``topdown``, ``onerror``, ``follow_symlinks``, ``dir_fd``." @@ -4032,11 +4032,11 @@ msgstr "" "引發一個附帶引數 ``top``、``topdown``、``onerror``、``follow_symlinks``、" "``dir_fd`` 的\\ :ref:`稽核事件 ` ``os.fwalk``。" -#: ../../library/os.rst:3637 +#: ../../library/os.rst:3638 msgid "Added support for :class:`bytes` paths." msgstr "" -#: ../../library/os.rst:3643 +#: ../../library/os.rst:3644 msgid "" "Create an anonymous file and return a file descriptor that refers to it. " "*flags* must be one of the ``os.MFD_*`` constants available on the system " @@ -4044,7 +4044,7 @@ msgid "" "descriptor is :ref:`non-inheritable `." msgstr "" -#: ../../library/os.rst:3648 +#: ../../library/os.rst:3649 msgid "" "The name supplied in *name* is used as a filename and will be displayed as " "the target of the corresponding symbolic link in the directory ``/proc/self/" @@ -4054,23 +4054,23 @@ msgid "" "side effects." msgstr "" -#: ../../library/os.rst:3655 +#: ../../library/os.rst:3656 msgid ":ref:`Availability `: Linux >= 3.17 with glibc >= 2.27." msgstr ":ref:`適用 `:Linux 3.17 以上且具有 glibc 2.27 以上。" -#: ../../library/os.rst:3678 +#: ../../library/os.rst:3679 msgid "These flags can be passed to :func:`memfd_create`." msgstr "" -#: ../../library/os.rst:3680 +#: ../../library/os.rst:3681 msgid ":ref:`Availability `: Linux >= 3.17 with glibc >= 2.27" msgstr ":ref:`適用 `:Linux 3.17 以上且具有 glibc 2.27 以上" -#: ../../library/os.rst:3682 +#: ../../library/os.rst:3683 msgid "The ``MFD_HUGE*`` flags are only available since Linux 4.14." msgstr "" -#: ../../library/os.rst:3689 +#: ../../library/os.rst:3690 msgid "" "Create and return an event file descriptor. The file descriptors supports " "raw :func:`read` and :func:`write` with a buffer size of 8, :func:`~select." @@ -4079,7 +4079,7 @@ msgid "" "ref:`non-inheritable `." msgstr "" -#: ../../library/os.rst:3695 +#: ../../library/os.rst:3696 msgid "" "*initval* is the initial value of the event counter. The initial value must " "be an 32 bit unsigned integer. Please note that the initial value is limited " @@ -4087,87 +4087,87 @@ msgid "" "integer with a maximum value of 2\\ :sup:`64`\\ -\\ 2." msgstr "" -#: ../../library/os.rst:3700 +#: ../../library/os.rst:3701 msgid "" "*flags* can be constructed from :const:`EFD_CLOEXEC`, :const:`EFD_NONBLOCK`, " "and :const:`EFD_SEMAPHORE`." msgstr "" -#: ../../library/os.rst:3703 +#: ../../library/os.rst:3704 msgid "" "If :const:`EFD_SEMAPHORE` is specified and the event counter is non-zero, :" "func:`eventfd_read` returns 1 and decrements the counter by one." msgstr "" -#: ../../library/os.rst:3706 +#: ../../library/os.rst:3707 msgid "" "If :const:`EFD_SEMAPHORE` is not specified and the event counter is non-" "zero, :func:`eventfd_read` returns the current event counter value and " "resets the counter to zero." msgstr "" -#: ../../library/os.rst:3710 +#: ../../library/os.rst:3711 msgid "" "If the event counter is zero and :const:`EFD_NONBLOCK` is not specified, :" "func:`eventfd_read` blocks." msgstr "" -#: ../../library/os.rst:3713 +#: ../../library/os.rst:3714 msgid "" ":func:`eventfd_write` increments the event counter. Write blocks if the " "write operation would increment the counter to a value larger than 2\\ :sup:" "`64`\\ -\\ 2." msgstr "" -#: ../../library/os.rst:3734 +#: ../../library/os.rst:3735 msgid ":ref:`Availability `: Linux >= 2.6.27 with glibc >= 2.8" msgstr ":ref:`適用 `:Linux 2.6.27 以上且具有 glibc 2.8 以上" -#: ../../library/os.rst:3740 +#: ../../library/os.rst:3741 msgid "" "Read value from an :func:`eventfd` file descriptor and return a 64 bit " "unsigned int. The function does not verify that *fd* is an :func:`eventfd`." msgstr "" -#: ../../library/os.rst:3743 ../../library/os.rst:3752 -#: ../../library/os.rst:3760 ../../library/os.rst:3769 +#: ../../library/os.rst:3744 ../../library/os.rst:3753 +#: ../../library/os.rst:3761 ../../library/os.rst:3770 msgid ":ref:`Availability `: Linux >= 2.6.27" msgstr ":ref:`適用 `:Linux 2.6.27 以上" -#: ../../library/os.rst:3749 +#: ../../library/os.rst:3750 msgid "" "Add value to an :func:`eventfd` file descriptor. *value* must be a 64 bit " "unsigned int. The function does not verify that *fd* is an :func:`eventfd`." msgstr "" -#: ../../library/os.rst:3758 +#: ../../library/os.rst:3759 msgid "Set close-on-exec flag for new :func:`eventfd` file descriptor." msgstr "" -#: ../../library/os.rst:3766 +#: ../../library/os.rst:3767 msgid "" "Set :const:`O_NONBLOCK` status flag for new :func:`eventfd` file descriptor." msgstr "" -#: ../../library/os.rst:3775 +#: ../../library/os.rst:3776 msgid "" "Provide semaphore-like semantics for reads from a :func:`eventfd` file " "descriptor. On read the internal counter is decremented by one." msgstr "" -#: ../../library/os.rst:3778 +#: ../../library/os.rst:3779 msgid ":ref:`Availability `: Linux >= 2.6.30" msgstr ":ref:`適用 `:Linux 2.6.30 以上" -#: ../../library/os.rst:3784 +#: ../../library/os.rst:3785 msgid "Linux extended attributes" msgstr "" -#: ../../library/os.rst:3788 +#: ../../library/os.rst:3789 msgid "These functions are all available on Linux only." msgstr "" -#: ../../library/os.rst:3792 +#: ../../library/os.rst:3793 msgid "" "Return the value of the extended filesystem attribute *attribute* for " "*path*. *attribute* can be bytes or str (directly or indirectly through the :" @@ -4175,7 +4175,7 @@ msgid "" "encoding." msgstr "" -#: ../../library/os.rst:3800 +#: ../../library/os.rst:3801 msgid "" "Raises an :ref:`auditing event ` ``os.getxattr`` with arguments " "``path``, ``attribute``." @@ -4183,12 +4183,12 @@ msgstr "" "引發一個附帶引數 ``path``、``attribute`` 的\\ :ref:`稽核事件 ` " "``os.getxattr``。" -#: ../../library/os.rst:3802 ../../library/os.rst:3834 -#: ../../library/os.rst:3859 +#: ../../library/os.rst:3803 ../../library/os.rst:3835 +#: ../../library/os.rst:3860 msgid "Accepts a :term:`path-like object` for *path* and *attribute*." msgstr "" -#: ../../library/os.rst:3808 +#: ../../library/os.rst:3809 msgid "" "Return a list of the extended filesystem attributes on *path*. The " "attributes in the list are represented as strings decoded with the " @@ -4196,14 +4196,14 @@ msgid "" "the current directory." msgstr "" -#: ../../library/os.rst:3816 +#: ../../library/os.rst:3817 msgid "" "Raises an :ref:`auditing event ` ``os.listxattr`` with argument " "``path``." msgstr "" "引發一個附帶引數 ``path`` 的\\ :ref:`稽核事件 ` ``os.listxattr``。" -#: ../../library/os.rst:3824 +#: ../../library/os.rst:3825 msgid "" "Removes the extended filesystem attribute *attribute* from *path*. " "*attribute* should be bytes or str (directly or indirectly through the :" @@ -4211,7 +4211,7 @@ msgid "" "`filesystem encoding and error handler`." msgstr "" -#: ../../library/os.rst:3832 +#: ../../library/os.rst:3833 msgid "" "Raises an :ref:`auditing event ` ``os.removexattr`` with arguments " "``path``, ``attribute``." @@ -4219,7 +4219,7 @@ msgstr "" "引發一個附帶引數 ``path``、``attribute`` 的\\ :ref:`稽核事件 ` " "``os.removexattr``。" -#: ../../library/os.rst:3840 +#: ../../library/os.rst:3841 msgid "" "Set the extended filesystem attribute *attribute* on *path* to *value*. " "*attribute* must be a bytes or str with no embedded NULs (directly or " @@ -4231,13 +4231,13 @@ msgid "" "will not be created and ``EEXISTS`` will be raised." msgstr "" -#: ../../library/os.rst:3854 +#: ../../library/os.rst:3855 msgid "" "A bug in Linux kernel versions less than 2.6.39 caused the flags argument to " "be ignored on some filesystems." msgstr "" -#: ../../library/os.rst:3857 +#: ../../library/os.rst:3858 msgid "" "Raises an :ref:`auditing event ` ``os.setxattr`` with arguments " "``path``, ``attribute``, ``value``, ``flags``." @@ -4245,33 +4245,33 @@ msgstr "" "引發一個附帶引數 ``path``、``attribute``、``value``、``flags`` 的\\ :ref:`稽" "核事件 ` ``os.setxattr``。" -#: ../../library/os.rst:3865 +#: ../../library/os.rst:3866 msgid "" "The maximum size the value of an extended attribute can be. Currently, this " "is 64 KiB on Linux." msgstr "" -#: ../../library/os.rst:3871 +#: ../../library/os.rst:3872 msgid "" "This is a possible value for the flags argument in :func:`setxattr`. It " "indicates the operation must create an attribute." msgstr "" -#: ../../library/os.rst:3877 +#: ../../library/os.rst:3878 msgid "" "This is a possible value for the flags argument in :func:`setxattr`. It " "indicates the operation must replace an existing attribute." msgstr "" -#: ../../library/os.rst:3884 +#: ../../library/os.rst:3885 msgid "Process Management" msgstr "" -#: ../../library/os.rst:3886 +#: ../../library/os.rst:3887 msgid "These functions may be used to create and manage processes." msgstr "" -#: ../../library/os.rst:3888 +#: ../../library/os.rst:3889 msgid "" "The various :func:`exec\\* ` functions take a list of arguments for " "the new program loaded into the process. In each case, the first of these " @@ -4282,7 +4282,7 @@ msgid "" "standard output; ``foo`` will seem to be ignored." msgstr "" -#: ../../library/os.rst:3899 +#: ../../library/os.rst:3900 msgid "" "Generate a :const:`SIGABRT` signal to the current process. On Unix, the " "default behavior is to produce a core dump; on Windows, the process " @@ -4291,31 +4291,31 @@ msgid "" "`SIGABRT` with :func:`signal.signal`." msgstr "" -#: ../../library/os.rst:3908 +#: ../../library/os.rst:3909 msgid "Add a path to the DLL search path." msgstr "" -#: ../../library/os.rst:3910 +#: ../../library/os.rst:3911 msgid "" "This search path is used when resolving dependencies for imported extension " "modules (the module itself is resolved through :data:`sys.path`), and also " "by :mod:`ctypes`." msgstr "" -#: ../../library/os.rst:3914 +#: ../../library/os.rst:3915 msgid "" "Remove the directory by calling **close()** on the returned object or using " "it in a :keyword:`with` statement." msgstr "" -#: ../../library/os.rst:3917 +#: ../../library/os.rst:3918 msgid "" "See the `Microsoft documentation `_ for more information about how " "DLLs are loaded." msgstr "" -#: ../../library/os.rst:3921 +#: ../../library/os.rst:3922 msgid "" "Raises an :ref:`auditing event ` ``os.add_dll_directory`` with " "argument ``path``." @@ -4323,7 +4323,7 @@ msgstr "" "引發一個附帶引數 ``path`` 的\\ :ref:`稽核事件 ` ``os." "add_dll_directory``。" -#: ../../library/os.rst:3925 +#: ../../library/os.rst:3926 msgid "" "Previous versions of CPython would resolve DLLs using the default behavior " "for the current process. This led to inconsistencies, such as only sometimes " @@ -4331,14 +4331,14 @@ msgid "" "such as ``AddDllDirectory`` having no effect." msgstr "" -#: ../../library/os.rst:3932 +#: ../../library/os.rst:3933 msgid "" "In 3.8, the two primary ways DLLs are loaded now explicitly override the " "process-wide behavior to ensure consistency. See the :ref:`porting notes " "` for information on updating libraries." msgstr "" -#: ../../library/os.rst:3947 +#: ../../library/os.rst:3948 msgid "" "These functions all execute a new program, replacing the current process; " "they do not return. On Unix, the new executable is loaded into the current " @@ -4346,7 +4346,7 @@ msgid "" "reported as :exc:`OSError` exceptions." msgstr "" -#: ../../library/os.rst:3952 +#: ../../library/os.rst:3953 msgid "" "The current process is replaced immediately. Open file objects and " "descriptors are not flushed, so if there may be data buffered on these open " @@ -4354,7 +4354,7 @@ msgid "" "fsync` before calling an :func:`exec\\* ` function." msgstr "" -#: ../../library/os.rst:3958 +#: ../../library/os.rst:3959 msgid "" "The \"l\" and \"v\" variants of the :func:`exec\\* ` functions differ " "in how command-line arguments are passed. The \"l\" variants are perhaps " @@ -4367,7 +4367,7 @@ msgid "" "enforced." msgstr "" -#: ../../library/os.rst:3967 +#: ../../library/os.rst:3968 msgid "" "The variants which include a \"p\" near the end (:func:`execlp`, :func:" "`execlpe`, :func:`execvp`, and :func:`execvpe`) will use the :envvar:`PATH` " @@ -4381,7 +4381,7 @@ msgid "" "even on Windows, as plain names will not be resolved." msgstr "" -#: ../../library/os.rst:3978 +#: ../../library/os.rst:3979 msgid "" "For :func:`execle`, :func:`execlpe`, :func:`execve`, and :func:`execvpe` " "(note that these all end in \"e\"), the *env* parameter must be a mapping " @@ -4391,7 +4391,7 @@ msgid "" "process to inherit the environment of the current process." msgstr "" -#: ../../library/os.rst:3985 +#: ../../library/os.rst:3986 msgid "" "For :func:`execve` on some platforms, *path* may also be specified as an " "open file descriptor. This functionality may not be supported on your " @@ -4400,7 +4400,7 @@ msgid "" "`NotImplementedError`." msgstr "" -#: ../../library/os.rst:3990 +#: ../../library/os.rst:3991 msgid "" "Raises an :ref:`auditing event ` ``os.exec`` with arguments " "``path``, ``args``, ``env``." @@ -4408,25 +4408,25 @@ msgstr "" "引發一個附帶引數 ``path``、``args``、``env`` 的\\ :ref:`稽核事件 ` " "``os.exec``。" -#: ../../library/os.rst:3994 +#: ../../library/os.rst:3995 msgid "" "Added support for specifying *path* as an open file descriptor for :func:" "`execve`." msgstr "" -#: ../../library/os.rst:4003 +#: ../../library/os.rst:4004 msgid "" "Exit the process with status *n*, without calling cleanup handlers, flushing " "stdio buffers, etc." msgstr "" -#: ../../library/os.rst:4008 +#: ../../library/os.rst:4009 msgid "" "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:4011 +#: ../../library/os.rst:4012 msgid "" "The following exit codes are defined and can be used with :func:`_exit`, " "although they are not required. These are typically used for system " @@ -4434,125 +4434,125 @@ msgid "" "delivery program." msgstr "" -#: ../../library/os.rst:4017 +#: ../../library/os.rst:4018 msgid "" "Some of these may not be available on all Unix platforms, since there is " "some variation. These constants are defined where they are defined by the " "underlying platform." msgstr "" -#: ../../library/os.rst:4024 +#: ../../library/os.rst:4025 msgid "" "Exit code that means no error occurred. May be taken from the defined value " "of ``EXIT_SUCCESS`` on some platforms. Generally has a value of zero." msgstr "" -#: ../../library/os.rst:4032 +#: ../../library/os.rst:4033 msgid "" "Exit code that means the command was used incorrectly, such as when the " "wrong number of arguments are given." msgstr "" -#: ../../library/os.rst:4040 +#: ../../library/os.rst:4041 msgid "Exit code that means the input data was incorrect." msgstr "" -#: ../../library/os.rst:4047 +#: ../../library/os.rst:4048 msgid "Exit code that means an input file did not exist or was not readable." msgstr "" -#: ../../library/os.rst:4054 +#: ../../library/os.rst:4055 msgid "Exit code that means a specified user did not exist." msgstr "" -#: ../../library/os.rst:4061 +#: ../../library/os.rst:4062 msgid "Exit code that means a specified host did not exist." msgstr "" -#: ../../library/os.rst:4068 +#: ../../library/os.rst:4069 msgid "Exit code that means that a required service is unavailable." msgstr "" -#: ../../library/os.rst:4075 +#: ../../library/os.rst:4076 msgid "Exit code that means an internal software error was detected." msgstr "" -#: ../../library/os.rst:4082 +#: ../../library/os.rst:4083 msgid "" "Exit code that means an operating system error was detected, such as the " "inability to fork or create a pipe." msgstr "" -#: ../../library/os.rst:4090 +#: ../../library/os.rst:4091 msgid "" "Exit code that means some system file did not exist, could not be opened, or " "had some other kind of error." msgstr "" -#: ../../library/os.rst:4098 +#: ../../library/os.rst:4099 msgid "Exit code that means a user specified output file could not be created." msgstr "" -#: ../../library/os.rst:4105 +#: ../../library/os.rst:4106 msgid "" "Exit code that means that an error occurred while doing I/O on some file." msgstr "" -#: ../../library/os.rst:4112 +#: ../../library/os.rst:4113 msgid "" "Exit code that means a temporary failure occurred. This indicates something " "that may not really be an error, such as a network connection that couldn't " "be made during a retryable operation." msgstr "" -#: ../../library/os.rst:4121 +#: ../../library/os.rst:4122 msgid "" "Exit code that means that a protocol exchange was illegal, invalid, or not " "understood." msgstr "" -#: ../../library/os.rst:4129 +#: ../../library/os.rst:4130 msgid "" "Exit code that means that there were insufficient permissions to perform the " "operation (but not intended for file system problems)." msgstr "" -#: ../../library/os.rst:4137 +#: ../../library/os.rst:4138 msgid "Exit code that means that some kind of configuration error occurred." msgstr "" -#: ../../library/os.rst:4144 +#: ../../library/os.rst:4145 msgid "Exit code that means something like \"an entry was not found\"." msgstr "" -#: ../../library/os.rst:4151 +#: ../../library/os.rst:4152 msgid "" "Fork a child process. Return ``0`` in the child and the child's process id " "in the parent. If an error occurs :exc:`OSError` is raised." msgstr "" -#: ../../library/os.rst:4154 +#: ../../library/os.rst:4155 msgid "" "Note that some platforms including FreeBSD <= 6.3 and Cygwin have known " "issues when using ``fork()`` from a thread." msgstr "" -#: ../../library/os.rst:4157 +#: ../../library/os.rst:4158 msgid "" "Raises an :ref:`auditing event ` ``os.fork`` with no arguments." msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``os.fork``。" -#: ../../library/os.rst:4159 +#: ../../library/os.rst:4160 msgid "" "Calling ``fork()`` in a subinterpreter is no longer supported (:exc:" "`RuntimeError` is raised)." msgstr "" -#: ../../library/os.rst:4165 +#: ../../library/os.rst:4166 msgid "See :mod:`ssl` for applications that use the SSL module with fork()." msgstr "" -#: ../../library/os.rst:4172 +#: ../../library/os.rst:4173 msgid "" "Fork a child process, using a new pseudo-terminal as the child's controlling " "terminal. Return a pair of ``(pid, fd)``, where *pid* is ``0`` in the child, " @@ -4561,24 +4561,24 @@ msgid "" "the :mod:`pty` module. If an error occurs :exc:`OSError` is raised." msgstr "" -#: ../../library/os.rst:4178 +#: ../../library/os.rst:4179 msgid "" "Raises an :ref:`auditing event ` ``os.forkpty`` with no arguments." msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``os.forkpty``。" -#: ../../library/os.rst:4180 +#: ../../library/os.rst:4181 msgid "" "Calling ``forkpty()`` in a subinterpreter is no longer supported (:exc:" "`RuntimeError` is raised)." msgstr "" -#: ../../library/os.rst:4193 +#: ../../library/os.rst:4194 msgid "" "Send signal *sig* to the process *pid*. Constants for the specific signals " "available on the host platform are defined in the :mod:`signal` module." msgstr "" -#: ../../library/os.rst:4196 +#: ../../library/os.rst:4197 msgid "" "Windows: The :const:`signal.CTRL_C_EVENT` and :const:`signal." "CTRL_BREAK_EVENT` signals are special signals which can only be sent to " @@ -4589,11 +4589,11 @@ msgid "" "process handles to be killed." msgstr "" -#: ../../library/os.rst:4204 +#: ../../library/os.rst:4205 msgid "See also :func:`signal.pthread_kill`." msgstr "另請參閱 :func:`signal.pthread_kill`\\ 。" -#: ../../library/os.rst:4206 +#: ../../library/os.rst:4207 msgid "" "Raises an :ref:`auditing event ` ``os.kill`` with arguments " "``pid``, ``sig``." @@ -4601,15 +4601,15 @@ msgstr "" "引發一個附帶引數 ``pid``、``sig`` 的\\ :ref:`稽核事件 ` ``os." "kill``。" -#: ../../library/os.rst:4210 +#: ../../library/os.rst:4211 msgid "Windows support." msgstr "" -#: ../../library/os.rst:4220 +#: ../../library/os.rst:4221 msgid "Send the signal *sig* to the process group *pgid*." msgstr "" -#: ../../library/os.rst:4222 +#: ../../library/os.rst:4223 msgid "" "Raises an :ref:`auditing event ` ``os.killpg`` with arguments " "``pgid``, ``sig``." @@ -4617,27 +4617,27 @@ msgstr "" "引發一個附帶引數 ``pgid``、``sig`` 的\\ :ref:`稽核事件 ` ``os." "killpg``。" -#: ../../library/os.rst:4229 +#: ../../library/os.rst:4230 msgid "" "Add *increment* to the process's \"niceness\". Return the new niceness." msgstr "" -#: ../../library/os.rst:4236 +#: ../../library/os.rst:4237 msgid "" "Return a file descriptor referring to the process *pid* with *flags* set. " "This descriptor can be used to perform process management without races and " "signals." msgstr "" -#: ../../library/os.rst:4240 +#: ../../library/os.rst:4241 msgid "See the :manpage:`pidfd_open(2)` man page for more details." msgstr "更多細節請見 :manpage:`pidfd_open(2)` 手冊頁。" -#: ../../library/os.rst:4242 +#: ../../library/os.rst:4243 msgid ":ref:`Availability `: Linux >= 5.3" msgstr ":ref:`適用 `:Linux 5.3 以上" -#: ../../library/os.rst:4247 +#: ../../library/os.rst:4248 msgid "" "This flag indicates that the file descriptor will be non-blocking. If the " "process referred to by the file descriptor has not yet terminated, then an " @@ -4645,17 +4645,17 @@ msgid "" "immediately return the error :const:`~errno.EAGAIN` rather than blocking." msgstr "" -#: ../../library/os.rst:4252 +#: ../../library/os.rst:4253 msgid ":ref:`Availability `: Linux >= 5.10" msgstr ":ref:`適用 `:Linux 5.10 以上" -#: ../../library/os.rst:4258 +#: ../../library/os.rst:4259 msgid "" "Lock program segments into memory. The value of *op* (defined in ````) determines which segments are locked." msgstr "" -#: ../../library/os.rst:4266 +#: ../../library/os.rst:4267 msgid "" "Open a pipe to or from command *cmd*. The return value is an open file " "object connected to the pipe, which can be read or written depending on " @@ -4665,7 +4665,7 @@ msgid "" "rather than bytes." msgstr "" -#: ../../library/os.rst:4274 +#: ../../library/os.rst:4275 msgid "" "The ``close`` method returns :const:`None` if the subprocess exited " "successfully, or the subprocess's return code if there was an error. On " @@ -4677,60 +4677,60 @@ msgid "" "contains the signed integer return code from the child process." msgstr "" -#: ../../library/os.rst:4284 +#: ../../library/os.rst:4285 msgid "" "On Unix, :func:`waitstatus_to_exitcode` can be used to convert the ``close`` " "method result (exit status) into an exit code if it is not ``None``. On " "Windows, the ``close`` method result is directly the exit code (or ``None``)." msgstr "" -#: ../../library/os.rst:4289 +#: ../../library/os.rst:4290 msgid "" "This is implemented using :class:`subprocess.Popen`; see that class's " "documentation for more powerful ways to manage and communicate with " "subprocesses." msgstr "" -#: ../../library/os.rst:4293 +#: ../../library/os.rst:4294 msgid ":ref:`Availability `: not Emscripten, not WASI." msgstr ":ref:`適用 `:非 Emscripten、非 WASI。" -#: ../../library/os.rst:4296 +#: ../../library/os.rst:4297 msgid "" "The :ref:`Python UTF-8 Mode ` affects encodings used for *cmd* " "and pipe contents." msgstr "" -#: ../../library/os.rst:4299 +#: ../../library/os.rst:4300 msgid "" ":func:`popen` is a simple wrapper around :class:`subprocess.Popen`. Use :" "class:`subprocess.Popen` or :func:`subprocess.run` to control options like " "encodings." msgstr "" -#: ../../library/os.rst:4308 +#: ../../library/os.rst:4309 msgid "Wraps the :c:func:`!posix_spawn` C library API for use from Python." msgstr "" -#: ../../library/os.rst:4310 +#: ../../library/os.rst:4311 msgid "" "Most users should use :func:`subprocess.run` instead of :func:`posix_spawn`." msgstr "" -#: ../../library/os.rst:4312 +#: ../../library/os.rst:4313 msgid "" "The positional-only arguments *path*, *args*, and *env* are similar to :func:" "`execve`." msgstr "" -#: ../../library/os.rst:4315 +#: ../../library/os.rst:4316 msgid "" "The *path* parameter is the path to the executable file. The *path* should " "contain a directory. Use :func:`posix_spawnp` to pass an executable file " "without directory." msgstr "" -#: ../../library/os.rst:4319 +#: ../../library/os.rst:4320 msgid "" "The *file_actions* argument may be a sequence of tuples describing actions " "to take on specific file descriptors in the child process between the C " @@ -4739,31 +4739,31 @@ msgid "" "describing the remaining tuple elements:" msgstr "" -#: ../../library/os.rst:4327 +#: ../../library/os.rst:4328 msgid "(``os.POSIX_SPAWN_OPEN``, *fd*, *path*, *flags*, *mode*)" msgstr "(``os.POSIX_SPAWN_OPEN``, *fd*, *path*, *flags*, *mode*)" -#: ../../library/os.rst:4329 +#: ../../library/os.rst:4330 msgid "Performs ``os.dup2(os.open(path, flags, mode), fd)``." msgstr "" -#: ../../library/os.rst:4333 +#: ../../library/os.rst:4334 msgid "(``os.POSIX_SPAWN_CLOSE``, *fd*)" msgstr "(``os.POSIX_SPAWN_CLOSE``, *fd*)" -#: ../../library/os.rst:4335 +#: ../../library/os.rst:4336 msgid "Performs ``os.close(fd)``." msgstr "" -#: ../../library/os.rst:4339 +#: ../../library/os.rst:4340 msgid "(``os.POSIX_SPAWN_DUP2``, *fd*, *new_fd*)" msgstr "(``os.POSIX_SPAWN_DUP2``, *fd*, *new_fd*)" -#: ../../library/os.rst:4341 +#: ../../library/os.rst:4342 msgid "Performs ``os.dup2(fd, new_fd)``." msgstr "" -#: ../../library/os.rst:4343 +#: ../../library/os.rst:4344 msgid "" "These tuples correspond to the C library :c:func:`!" "posix_spawn_file_actions_addopen`, :c:func:`!" @@ -4772,7 +4772,7 @@ msgid "" "`!posix_spawn` call itself." msgstr "" -#: ../../library/os.rst:4349 +#: ../../library/os.rst:4350 msgid "" "The *setpgroup* argument will set the process group of the child to the " "value specified. If the value specified is 0, the child's process group ID " @@ -4781,7 +4781,7 @@ msgid "" "corresponds to the C library :c:macro:`!POSIX_SPAWN_SETPGROUP` flag." msgstr "" -#: ../../library/os.rst:4355 +#: ../../library/os.rst:4356 msgid "" "If the *resetids* argument is ``True`` it will reset the effective UID and " "GID of the child to the real UID and GID of the parent process. If the " @@ -4792,7 +4792,7 @@ msgid "" "library :c:macro:`!POSIX_SPAWN_RESETIDS` flag." msgstr "" -#: ../../library/os.rst:4363 +#: ../../library/os.rst:4364 msgid "" "If the *setsid* argument is ``True``, it will create a new session ID for " "``posix_spawn``. *setsid* requires :c:macro:`!POSIX_SPAWN_SETSID` or :c:" @@ -4800,7 +4800,7 @@ msgid "" "is raised." msgstr "" -#: ../../library/os.rst:4368 +#: ../../library/os.rst:4369 msgid "" "The *setsigmask* argument will set the signal mask to the signal set " "specified. If the parameter is not used, then the child inherits the " @@ -4808,14 +4808,14 @@ msgid "" "POSIX_SPAWN_SETSIGMASK` flag." msgstr "" -#: ../../library/os.rst:4373 +#: ../../library/os.rst:4374 msgid "" "The *sigdef* argument will reset the disposition of all signals in the set " "specified. This argument corresponds to the C library :c:macro:`!" "POSIX_SPAWN_SETSIGDEF` flag." msgstr "" -#: ../../library/os.rst:4377 +#: ../../library/os.rst:4378 msgid "" "The *scheduler* argument must be a tuple containing the (optional) scheduler " "policy and an instance of :class:`sched_param` with the scheduler " @@ -4825,7 +4825,7 @@ msgid "" "POSIX_SPAWN_SETSCHEDULER` flags." msgstr "" -#: ../../library/os.rst:4384 ../../library/os.rst:4400 +#: ../../library/os.rst:4385 ../../library/os.rst:4401 msgid "" "Raises an :ref:`auditing event ` ``os.posix_spawn`` with arguments " "``path``, ``argv``, ``env``." @@ -4833,76 +4833,76 @@ msgstr "" "引發一個附帶引數 ``path``、``argv``、``env`` 的\\ :ref:`稽核事件 ` " "``os.posix_spawn``。" -#: ../../library/os.rst:4394 +#: ../../library/os.rst:4395 msgid "Wraps the :c:func:`!posix_spawnp` C library API for use from Python." msgstr "" -#: ../../library/os.rst:4396 +#: ../../library/os.rst:4397 msgid "" "Similar to :func:`posix_spawn` except that the system searches for the " "*executable* file in the list of directories specified by the :envvar:`PATH` " "environment variable (in the same way as for ``execvp(3)``)." msgstr "" -#: ../../library/os.rst:4404 +#: ../../library/os.rst:4405 msgid ":ref:`Availability `: POSIX, not Emscripten, not WASI." msgstr ":ref:`適用 `:POSIX、非 Emscripten、非 WASI。" -#: ../../library/os.rst:4406 +#: ../../library/os.rst:4407 msgid "See :func:`posix_spawn` documentation." msgstr "" -#: ../../library/os.rst:4412 +#: ../../library/os.rst:4413 msgid "" "Register callables to be executed when a new child process is forked using :" "func:`os.fork` or similar process cloning APIs. The parameters are optional " "and keyword-only. Each specifies a different call point." msgstr "" -#: ../../library/os.rst:4417 +#: ../../library/os.rst:4418 msgid "*before* is a function called before forking a child process." msgstr "" -#: ../../library/os.rst:4418 +#: ../../library/os.rst:4419 msgid "" "*after_in_parent* is a function called from the parent process after forking " "a child process." msgstr "" -#: ../../library/os.rst:4420 +#: ../../library/os.rst:4421 msgid "*after_in_child* is a function called from the child process." msgstr "" -#: ../../library/os.rst:4422 +#: ../../library/os.rst:4423 msgid "" "These calls are only made if control is expected to return to the Python " "interpreter. A typical :mod:`subprocess` launch will not trigger them as " "the child is not going to re-enter the interpreter." msgstr "" -#: ../../library/os.rst:4426 +#: ../../library/os.rst:4427 msgid "" "Functions registered for execution before forking are called in reverse " "registration order. Functions registered for execution after forking " "(either in the parent or in the child) are called in registration order." msgstr "" -#: ../../library/os.rst:4431 +#: ../../library/os.rst:4432 msgid "" "Note that :c:func:`fork` calls made by third-party C code may not call those " "functions, unless it explicitly calls :c:func:`PyOS_BeforeFork`, :c:func:" "`PyOS_AfterFork_Parent` and :c:func:`PyOS_AfterFork_Child`." msgstr "" -#: ../../library/os.rst:4435 +#: ../../library/os.rst:4436 msgid "There is no way to unregister a function." msgstr "" -#: ../../library/os.rst:4451 +#: ../../library/os.rst:4452 msgid "Execute the program *path* in a new process." msgstr "" -#: ../../library/os.rst:4453 +#: ../../library/os.rst:4454 msgid "" "(Note that the :mod:`subprocess` module provides more powerful facilities " "for spawning new processes and retrieving their results; using that module " @@ -4910,7 +4910,7 @@ msgid "" "`subprocess-replacements` section.)" msgstr "" -#: ../../library/os.rst:4458 +#: ../../library/os.rst:4459 msgid "" "If *mode* is :const:`P_NOWAIT`, this function returns the process id of the " "new process; if *mode* is :const:`P_WAIT`, returns the process's exit code " @@ -4919,13 +4919,13 @@ msgid "" "handle, so can be used with the :func:`waitpid` function." msgstr "" -#: ../../library/os.rst:4464 +#: ../../library/os.rst:4465 msgid "" "Note on VxWorks, this function doesn't return ``-signal`` when the new " "process is killed. Instead it raises OSError exception." msgstr "" -#: ../../library/os.rst:4467 +#: ../../library/os.rst:4468 msgid "" "The \"l\" and \"v\" variants of the :func:`spawn\\* ` functions " "differ in how command-line arguments are passed. The \"l\" variants are " @@ -4937,7 +4937,7 @@ msgid "" "to the child process must start with the name of the command being run." msgstr "" -#: ../../library/os.rst:4476 +#: ../../library/os.rst:4477 msgid "" "The variants which include a second \"p\" near the end (:func:`spawnlp`, :" "func:`spawnlpe`, :func:`spawnvp`, and :func:`spawnvpe`) will use the :envvar:" @@ -4950,7 +4950,7 @@ msgid "" "appropriate absolute or relative path." msgstr "" -#: ../../library/os.rst:4486 +#: ../../library/os.rst:4487 msgid "" "For :func:`spawnle`, :func:`spawnlpe`, :func:`spawnve`, and :func:`spawnvpe` " "(note that these all end in \"e\"), the *env* parameter must be a mapping " @@ -4962,13 +4962,13 @@ msgid "" "values will cause the function to fail, with a return value of ``127``." msgstr "" -#: ../../library/os.rst:4495 +#: ../../library/os.rst:4496 msgid "" "As an example, the following calls to :func:`spawnlp` and :func:`spawnvpe` " "are equivalent::" msgstr "" -#: ../../library/os.rst:4504 +#: ../../library/os.rst:4505 msgid "" "Raises an :ref:`auditing event ` ``os.spawn`` with arguments " "``mode``, ``path``, ``args``, ``env``." @@ -4976,7 +4976,7 @@ msgstr "" "引發一個附帶引數 ``mode``、``path``、``args``、``env`` 的\\ :ref:`稽核事件 " "` ``os.spawn``。" -#: ../../library/os.rst:4508 +#: ../../library/os.rst:4509 msgid "" ":func:`spawnlp`, :func:`spawnlpe`, :func:`spawnvp` and :func:`spawnvpe` are " "not available on Windows. :func:`spawnle` and :func:`spawnve` are not " @@ -4984,7 +4984,7 @@ msgid "" "instead." msgstr "" -#: ../../library/os.rst:4520 +#: ../../library/os.rst:4521 msgid "" "Possible values for the *mode* parameter to the :func:`spawn\\* ` " "family of functions. If either of these values is given, the :func:" @@ -4992,7 +4992,7 @@ msgid "" "created, with the process id as the return value." msgstr "" -#: ../../library/os.rst:4530 +#: ../../library/os.rst:4531 msgid "" "Possible value for the *mode* parameter to the :func:`spawn\\* ` " "family of functions. If this is given as *mode*, the :func:`spawn\\*` " @@ -5001,7 +5001,7 @@ msgid "" "signal`` if a signal kills the process." msgstr "" -#: ../../library/os.rst:4542 +#: ../../library/os.rst:4543 msgid "" "Possible values for the *mode* parameter to the :func:`spawn\\* ` " "family of functions. These are less portable than those listed above. :" @@ -5011,11 +5011,11 @@ msgid "" "function will not return." msgstr "" -#: ../../library/os.rst:4553 +#: ../../library/os.rst:4554 msgid "Start a file with its associated application." msgstr "" -#: ../../library/os.rst:4555 +#: ../../library/os.rst:4556 msgid "" "When *operation* is not specified, this acts like double-clicking the file " "in Windows Explorer, or giving the file name as an argument to the :program:" @@ -5023,7 +5023,7 @@ msgid "" "whatever application (if any) its extension is associated." msgstr "" -#: ../../library/os.rst:4560 +#: ../../library/os.rst:4561 msgid "" "When another *operation* is given, it must be a \"command verb\" that " "specifies what should be done with the file. Common verbs documented by " @@ -5031,28 +5031,28 @@ msgid "" "as well as ``'explore'`` and ``'find'`` (to be used on directories)." msgstr "" -#: ../../library/os.rst:4565 +#: ../../library/os.rst:4566 msgid "" "When launching an application, specify *arguments* to be passed as a single " "string. This argument may have no effect when using this function to launch " "a document." msgstr "" -#: ../../library/os.rst:4569 +#: ../../library/os.rst:4570 msgid "" "The default working directory is inherited, but may be overridden by the " "*cwd* argument. This should be an absolute path. A relative *path* will be " "resolved against this argument." msgstr "" -#: ../../library/os.rst:4573 +#: ../../library/os.rst:4574 msgid "" "Use *show_cmd* to override the default window style. Whether this has any " "effect will depend on the application being launched. Values are integers as " "supported by the Win32 :c:func:`!ShellExecute` function." msgstr "" -#: ../../library/os.rst:4577 +#: ../../library/os.rst:4578 msgid "" ":func:`startfile` returns as soon as the associated application is launched. " "There is no option to wait for the application to close, and no way to " @@ -5063,14 +5063,14 @@ msgid "" "encoded for Win32." msgstr "" -#: ../../library/os.rst:4585 +#: ../../library/os.rst:4586 msgid "" "To reduce interpreter startup overhead, the Win32 :c:func:`!ShellExecute` " "function is not resolved until this function is first called. If the " "function cannot be resolved, :exc:`NotImplementedError` will be raised." msgstr "" -#: ../../library/os.rst:4589 +#: ../../library/os.rst:4590 msgid "" "Raises an :ref:`auditing event ` ``os.startfile`` with arguments " "``path``, ``operation``." @@ -5078,7 +5078,7 @@ msgstr "" "引發一個附帶引數 ``path``、``operation`` 的\\ :ref:`稽核事件 ` " "``os.startfile``。" -#: ../../library/os.rst:4591 +#: ../../library/os.rst:4592 msgid "" "Raises an :ref:`auditing event ` ``os.startfile/2`` with arguments " "``path``, ``operation``, ``arguments``, ``cwd``, ``show_cmd``." @@ -5086,13 +5086,13 @@ msgstr "" "引發一個附帶引數 ``path``、``operation``、``arguments``、``cwd``、" "``show_cmd`` 的\\ :ref:`稽核事件 ` ``os.startfile/2``。" -#: ../../library/os.rst:4595 +#: ../../library/os.rst:4596 msgid "" "Added the *arguments*, *cwd* and *show_cmd* arguments, and the ``os." "startfile/2`` audit event." msgstr "" -#: ../../library/os.rst:4602 +#: ../../library/os.rst:4603 msgid "" "Execute the command (a string) in a subshell. This is implemented by " "calling the Standard C function :c:func:`system`, and has the same " @@ -5103,13 +5103,13 @@ msgid "" "value of the Python function is system-dependent." msgstr "" -#: ../../library/os.rst:4610 +#: ../../library/os.rst:4611 msgid "" "On Unix, the return value is the exit status of the process encoded in the " "format specified for :func:`wait`." msgstr "" -#: ../../library/os.rst:4613 +#: ../../library/os.rst:4614 msgid "" "On Windows, the return value is that returned by the system shell after " "running *command*. The shell is given by the Windows environment variable :" @@ -5118,7 +5118,7 @@ msgid "" "shell documentation." msgstr "" -#: ../../library/os.rst:4619 +#: ../../library/os.rst:4620 msgid "" "The :mod:`subprocess` module provides more powerful facilities for spawning " "new processes and retrieving their results; using that module is preferable " @@ -5126,54 +5126,54 @@ msgid "" "the :mod:`subprocess` documentation for some helpful recipes." msgstr "" -#: ../../library/os.rst:4624 +#: ../../library/os.rst:4625 msgid "" "On Unix, :func:`waitstatus_to_exitcode` can be used to convert the result " "(exit status) into an exit code. On Windows, the result is directly the exit " "code." msgstr "" -#: ../../library/os.rst:4628 +#: ../../library/os.rst:4629 msgid "" "Raises an :ref:`auditing event ` ``os.system`` with argument " "``command``." msgstr "" "引發一個附帶引數 ``command`` 的\\ :ref:`稽核事件 ` ``os.system``。" -#: ../../library/os.rst:4635 +#: ../../library/os.rst:4636 msgid "" "Returns the current global process times. The return value is an object with " "five attributes:" msgstr "" -#: ../../library/os.rst:4638 +#: ../../library/os.rst:4639 msgid ":attr:`!user` - user time" msgstr "" -#: ../../library/os.rst:4639 +#: ../../library/os.rst:4640 msgid ":attr:`!system` - system time" msgstr ":attr:`!system` - 系統時間" -#: ../../library/os.rst:4640 +#: ../../library/os.rst:4641 msgid ":attr:`!children_user` - user time of all child processes" msgstr "" -#: ../../library/os.rst:4641 +#: ../../library/os.rst:4642 msgid ":attr:`!children_system` - system time of all child processes" msgstr "" -#: ../../library/os.rst:4642 +#: ../../library/os.rst:4643 msgid ":attr:`!elapsed` - elapsed real time since a fixed point in the past" msgstr "" -#: ../../library/os.rst:4644 +#: ../../library/os.rst:4645 msgid "" "For backwards compatibility, this object also behaves like a five-tuple " "containing :attr:`!user`, :attr:`!system`, :attr:`!children_user`, :attr:`!" "children_system`, and :attr:`!elapsed` in that order." msgstr "" -#: ../../library/os.rst:4648 +#: ../../library/os.rst:4649 msgid "" "See the Unix manual page :manpage:`times(2)` and `times(3) `_ manual page on Unix or `the " @@ -5183,7 +5183,7 @@ msgid "" "attributes are zero." msgstr "" -#: ../../library/os.rst:4662 +#: ../../library/os.rst:4663 msgid "" "Wait for completion of a child process, and return a tuple containing its " "pid and exit status indication: a 16-bit number, whose low byte is the " @@ -5192,83 +5192,83 @@ msgid "" "if a core file was produced." msgstr "" -#: ../../library/os.rst:4668 +#: ../../library/os.rst:4669 msgid "" "If there are no children that could be waited for, :exc:`ChildProcessError` " "is raised." msgstr "" -#: ../../library/os.rst:4671 ../../library/os.rst:4743 +#: ../../library/os.rst:4672 ../../library/os.rst:4744 msgid "" ":func:`waitstatus_to_exitcode` can be used to convert the exit status into " "an exit code." msgstr "" -#: ../../library/os.rst:4678 +#: ../../library/os.rst:4679 msgid "" "The other :func:`!wait*` functions documented below can be used to wait for " "the completion of a specific child process and have more options. :func:" "`waitpid` is the only one also available on Windows." msgstr "" -#: ../../library/os.rst:4685 +#: ../../library/os.rst:4686 msgid "Wait for the completion of a child process." msgstr "" -#: ../../library/os.rst:4687 +#: ../../library/os.rst:4688 msgid "" "*idtype* can be :data:`P_PID`, :data:`P_PGID`, :data:`P_ALL`, or (on Linux) :" "data:`P_PIDFD`. The interpretation of *id* depends on it; see their " "individual descriptions." msgstr "" -#: ../../library/os.rst:4690 +#: ../../library/os.rst:4691 msgid "" "*options* is an OR combination of flags. At least one of :data:`WEXITED`, :" "data:`WSTOPPED` or :data:`WCONTINUED` is required; :data:`WNOHANG` and :data:" "`WNOWAIT` are additional optional flags." msgstr "" -#: ../../library/os.rst:4694 +#: ../../library/os.rst:4695 msgid "" "The return value is an object representing the data contained in the :c:type:" "`siginfo_t` structure with the following attributes:" msgstr "" -#: ../../library/os.rst:4697 +#: ../../library/os.rst:4698 msgid ":attr:`!si_pid` (process ID)" msgstr "" -#: ../../library/os.rst:4698 +#: ../../library/os.rst:4699 msgid ":attr:`!si_uid` (real user ID of the child)" msgstr "" -#: ../../library/os.rst:4699 +#: ../../library/os.rst:4700 msgid ":attr:`!si_signo` (always :const:`~signal.SIGCHLD`)" msgstr "" -#: ../../library/os.rst:4700 +#: ../../library/os.rst:4701 msgid "" ":attr:`!si_status` (the exit status or signal number, depending on :attr:`!" "si_code`)" msgstr "" -#: ../../library/os.rst:4701 +#: ../../library/os.rst:4702 msgid ":attr:`!si_code` (see :data:`CLD_EXITED` for possible values)" msgstr "" -#: ../../library/os.rst:4703 +#: ../../library/os.rst:4704 msgid "" "If :data:`WNOHANG` is specified and there are no matching children in the " "requested state, ``None`` is returned. Otherwise, if there are no matching " "children that could be waited for, :exc:`ChildProcessError` is raised." msgstr "" -#: ../../library/os.rst:4715 +#: ../../library/os.rst:4716 msgid "The details of this function differ on Unix and Windows." msgstr "" -#: ../../library/os.rst:4717 +#: ../../library/os.rst:4718 msgid "" "On Unix: Wait for completion of a child process given by process id *pid*, " "and return a tuple containing its process id and exit status indication " @@ -5277,7 +5277,7 @@ msgid "" "operation." msgstr "" -#: ../../library/os.rst:4722 +#: ../../library/os.rst:4723 msgid "" "If *pid* is greater than ``0``, :func:`waitpid` requests status information " "for that specific process. If *pid* is ``0``, the request is for the status " @@ -5287,7 +5287,7 @@ msgid "" "group ``-pid`` (the absolute value of *pid*)." msgstr "" -#: ../../library/os.rst:4729 +#: ../../library/os.rst:4730 msgid "" "*options* is an OR combination of flags. If it contains :data:`WNOHANG` and " "there are no matching children in the requested state, ``(0, 0)`` is " @@ -5296,7 +5296,7 @@ msgid "" "are :data:`WUNTRACED` and :data:`WCONTINUED`." msgstr "" -#: ../../library/os.rst:4735 +#: ../../library/os.rst:4736 msgid "" "On Windows: Wait for completion of a process given by process handle *pid*, " "and return a tuple containing *pid*, and its exit status shifted left by 8 " @@ -5308,7 +5308,7 @@ msgid "" "process handles." msgstr "" -#: ../../library/os.rst:4756 +#: ../../library/os.rst:4757 msgid "" "Similar to :func:`waitpid`, except no process id argument is given and a 3-" "element tuple containing the child's process id, exit status indication, and " @@ -5317,13 +5317,13 @@ msgid "" "same as that provided to :func:`waitpid` and :func:`wait4`." msgstr "" -#: ../../library/os.rst:4763 ../../library/os.rst:4777 +#: ../../library/os.rst:4764 ../../library/os.rst:4778 msgid "" ":func:`waitstatus_to_exitcode` can be used to convert the exit status into " "an exitcode." msgstr "" -#: ../../library/os.rst:4771 +#: ../../library/os.rst:4772 msgid "" "Similar to :func:`waitpid`, except a 3-element tuple, containing the child's " "process id, exit status indication, and resource usage information is " @@ -5332,118 +5332,118 @@ msgid "" "to :func:`waitpid`." msgstr "" -#: ../../library/os.rst:4788 +#: ../../library/os.rst:4789 msgid "" "These are the possible values for *idtype* in :func:`waitid`. They affect " "how *id* is interpreted:" msgstr "" -#: ../../library/os.rst:4791 +#: ../../library/os.rst:4792 msgid ":data:`!P_PID` - wait for the child whose PID is *id*." msgstr "" -#: ../../library/os.rst:4792 +#: ../../library/os.rst:4793 msgid ":data:`!P_PGID` - wait for any child whose progress group ID is *id*." msgstr "" -#: ../../library/os.rst:4793 +#: ../../library/os.rst:4794 msgid ":data:`!P_ALL` - wait for any child; *id* is ignored." msgstr "" -#: ../../library/os.rst:4794 +#: ../../library/os.rst:4795 msgid "" ":data:`!P_PIDFD` - wait for the child identified by the file descriptor *id* " "(a process file descriptor created with :func:`pidfd_open`)." msgstr "" -#: ../../library/os.rst:4799 +#: ../../library/os.rst:4800 msgid ":data:`!P_PIDFD` is only available on Linux >= 5.4." msgstr "" -#: ../../library/os.rst:4802 +#: ../../library/os.rst:4803 msgid "The :data:`!P_PIDFD` constant." msgstr "" -#: ../../library/os.rst:4808 +#: ../../library/os.rst:4809 msgid "" "This *options* flag for :func:`waitpid`, :func:`wait3`, :func:`wait4`, and :" "func:`waitid` causes child processes to be reported if they have been " "continued from a job control stop since they were last reported." msgstr "" -#: ../../library/os.rst:4817 +#: ../../library/os.rst:4818 msgid "" "This *options* flag for :func:`waitid` causes child processes that have " "terminated to be reported." msgstr "" -#: ../../library/os.rst:4820 +#: ../../library/os.rst:4821 msgid "" "The other ``wait*`` functions always report children that have terminated, " "so this option is not available for them." msgstr "" -#: ../../library/os.rst:4830 +#: ../../library/os.rst:4831 msgid "" "This *options* flag for :func:`waitid` causes child processes that have been " "stopped by the delivery of a signal to be reported." msgstr "" -#: ../../library/os.rst:4833 ../../library/os.rst:4865 +#: ../../library/os.rst:4834 ../../library/os.rst:4866 msgid "This option is not available for the other ``wait*`` functions." msgstr "" -#: ../../library/os.rst:4842 +#: ../../library/os.rst:4843 msgid "" "This *options* flag for :func:`waitpid`, :func:`wait3`, and :func:`wait4` " "causes child processes to also be reported if they have been stopped but " "their current state has not been reported since they were stopped." msgstr "" -#: ../../library/os.rst:4846 +#: ../../library/os.rst:4847 msgid "This option is not available for :func:`waitid`." msgstr "" -#: ../../library/os.rst:4853 +#: ../../library/os.rst:4854 msgid "" "This *options* flag causes :func:`waitpid`, :func:`wait3`, :func:`wait4`, " "and :func:`waitid` to return right away if no child process status is " "available immediately." msgstr "" -#: ../../library/os.rst:4862 +#: ../../library/os.rst:4863 msgid "" "This *options* flag causes :func:`waitid` to leave the child in a waitable " "state, so that a later :func:`!wait*` call can be used to retrieve the child " "status information again." msgstr "" -#: ../../library/os.rst:4877 +#: ../../library/os.rst:4878 msgid "" "These are the possible values for :attr:`!si_code` in the result returned " "by :func:`waitid`." msgstr "" -#: ../../library/os.rst:4884 +#: ../../library/os.rst:4885 msgid "Added :data:`CLD_KILLED` and :data:`CLD_STOPPED` values." msgstr "" -#: ../../library/os.rst:4890 +#: ../../library/os.rst:4891 msgid "Convert a wait status to an exit code." msgstr "" -#: ../../library/os.rst:4892 +#: ../../library/os.rst:4893 msgid "On Unix:" msgstr "" -#: ../../library/os.rst:4894 +#: ../../library/os.rst:4895 msgid "" "If the process exited normally (if ``WIFEXITED(status)`` is true), return " "the process exit status (return ``WEXITSTATUS(status)``): result greater " "than or equal to 0." msgstr "" -#: ../../library/os.rst:4897 +#: ../../library/os.rst:4898 msgid "" "If the process was terminated by a signal (if ``WIFSIGNALED(status)`` is " "true), return ``-signum`` where *signum* is the number of the signal that " @@ -5451,15 +5451,15 @@ msgid "" "than 0." msgstr "" -#: ../../library/os.rst:4901 +#: ../../library/os.rst:4902 msgid "Otherwise, raise a :exc:`ValueError`." msgstr "" -#: ../../library/os.rst:4903 +#: ../../library/os.rst:4904 msgid "On Windows, return *status* shifted right by 8 bits." msgstr "" -#: ../../library/os.rst:4905 +#: ../../library/os.rst:4906 msgid "" "On Unix, if the process is being traced or if :func:`waitpid` was called " "with :data:`WUNTRACED` option, the caller must first check if " @@ -5467,217 +5467,217 @@ msgid "" "``WIFSTOPPED(status)`` is true." msgstr "" -#: ../../library/os.rst:4912 +#: ../../library/os.rst:4913 msgid "" ":func:`WIFEXITED`, :func:`WEXITSTATUS`, :func:`WIFSIGNALED`, :func:" "`WTERMSIG`, :func:`WIFSTOPPED`, :func:`WSTOPSIG` functions." msgstr "" -#: ../../library/os.rst:4920 +#: ../../library/os.rst:4921 msgid "" "The following functions take a process status code as returned by :func:" "`system`, :func:`wait`, or :func:`waitpid` as a parameter. They may be used " "to determine the disposition of a process." msgstr "" -#: ../../library/os.rst:4926 +#: ../../library/os.rst:4927 msgid "" "Return ``True`` if a core dump was generated for the process, otherwise " "return ``False``." msgstr "" -#: ../../library/os.rst:4929 ../../library/os.rst:4995 +#: ../../library/os.rst:4930 ../../library/os.rst:4996 msgid "This function should be employed only if :func:`WIFSIGNALED` is true." msgstr "" -#: ../../library/os.rst:4936 +#: ../../library/os.rst:4937 msgid "" "Return ``True`` if a stopped child has been resumed by delivery of :const:" "`~signal.SIGCONT` (if the process has been continued from a job control " "stop), otherwise return ``False``." msgstr "" -#: ../../library/os.rst:4940 +#: ../../library/os.rst:4941 msgid "See :data:`WCONTINUED` option." msgstr "參閱 :data:`WCONTINUED` 選項。" -#: ../../library/os.rst:4947 +#: ../../library/os.rst:4948 msgid "" "Return ``True`` if the process was stopped by delivery of a signal, " "otherwise return ``False``." msgstr "" -#: ../../library/os.rst:4950 +#: ../../library/os.rst:4951 msgid "" ":func:`WIFSTOPPED` only returns ``True`` if the :func:`waitpid` call was " "done using :data:`WUNTRACED` option or when the process is being traced " "(see :manpage:`ptrace(2)`)." msgstr "" -#: ../../library/os.rst:4958 +#: ../../library/os.rst:4959 msgid "" "Return ``True`` if the process was terminated by a signal, otherwise return " "``False``." msgstr "" -#: ../../library/os.rst:4966 +#: ../../library/os.rst:4967 msgid "" "Return ``True`` if the process exited terminated normally, that is, by " "calling ``exit()`` or ``_exit()``, or by returning from ``main()``; " "otherwise return ``False``." msgstr "" -#: ../../library/os.rst:4975 +#: ../../library/os.rst:4976 msgid "Return the process exit status." msgstr "" -#: ../../library/os.rst:4977 +#: ../../library/os.rst:4978 msgid "This function should be employed only if :func:`WIFEXITED` is true." msgstr "" -#: ../../library/os.rst:4984 +#: ../../library/os.rst:4985 msgid "Return the signal which caused the process to stop." msgstr "" -#: ../../library/os.rst:4986 +#: ../../library/os.rst:4987 msgid "This function should be employed only if :func:`WIFSTOPPED` is true." msgstr "" -#: ../../library/os.rst:4993 +#: ../../library/os.rst:4994 msgid "Return the number of the signal that caused the process to terminate." msgstr "" -#: ../../library/os.rst:5001 +#: ../../library/os.rst:5002 msgid "Interface to the scheduler" msgstr "" -#: ../../library/os.rst:5003 +#: ../../library/os.rst:5004 msgid "" "These functions control how a process is allocated CPU time by the operating " "system. They are only available on some Unix platforms. For more detailed " "information, consult your Unix manpages." msgstr "" -#: ../../library/os.rst:5009 +#: ../../library/os.rst:5010 msgid "" "The following scheduling policies are exposed if they are supported by the " "operating system." msgstr "" -#: ../../library/os.rst:5014 +#: ../../library/os.rst:5015 msgid "The default scheduling policy." msgstr "" -#: ../../library/os.rst:5018 +#: ../../library/os.rst:5019 msgid "" "Scheduling policy for CPU-intensive processes that tries to preserve " "interactivity on the rest of the computer." msgstr "" -#: ../../library/os.rst:5023 +#: ../../library/os.rst:5024 msgid "Scheduling policy for extremely low priority background tasks." msgstr "" -#: ../../library/os.rst:5027 +#: ../../library/os.rst:5028 msgid "Scheduling policy for sporadic server programs." msgstr "" -#: ../../library/os.rst:5031 +#: ../../library/os.rst:5032 msgid "A First In First Out scheduling policy." msgstr "" -#: ../../library/os.rst:5035 +#: ../../library/os.rst:5036 msgid "A round-robin scheduling policy." msgstr "" -#: ../../library/os.rst:5039 +#: ../../library/os.rst:5040 msgid "" "This flag can be OR'ed with any other scheduling policy. When a process with " "this flag set forks, its child's scheduling policy and priority are reset to " "the default." msgstr "" -#: ../../library/os.rst:5046 +#: ../../library/os.rst:5047 msgid "" "This class represents tunable scheduling parameters used in :func:" "`sched_setparam`, :func:`sched_setscheduler`, and :func:`sched_getparam`. It " "is immutable." msgstr "" -#: ../../library/os.rst:5050 +#: ../../library/os.rst:5051 msgid "At the moment, there is only one possible parameter:" msgstr "" -#: ../../library/os.rst:5054 +#: ../../library/os.rst:5055 msgid "The scheduling priority for a scheduling policy." msgstr "" -#: ../../library/os.rst:5059 +#: ../../library/os.rst:5060 msgid "" "Get the minimum priority value for *policy*. *policy* is one of the " "scheduling policy constants above." msgstr "" -#: ../../library/os.rst:5065 +#: ../../library/os.rst:5066 msgid "" "Get the maximum priority value for *policy*. *policy* is one of the " "scheduling policy constants above." msgstr "" -#: ../../library/os.rst:5071 +#: ../../library/os.rst:5072 msgid "" "Set the scheduling policy for the process with PID *pid*. A *pid* of 0 means " "the calling process. *policy* is one of the scheduling policy constants " "above. *param* is a :class:`sched_param` instance." msgstr "" -#: ../../library/os.rst:5078 +#: ../../library/os.rst:5079 msgid "" "Return the scheduling policy for the process with PID *pid*. A *pid* of 0 " "means the calling process. The result is one of the scheduling policy " "constants above." msgstr "" -#: ../../library/os.rst:5085 +#: ../../library/os.rst:5086 msgid "" "Set the scheduling parameters for the process with PID *pid*. A *pid* of 0 " "means the calling process. *param* is a :class:`sched_param` instance." msgstr "" -#: ../../library/os.rst:5091 +#: ../../library/os.rst:5092 msgid "" "Return the scheduling parameters as a :class:`sched_param` instance for the " "process with PID *pid*. A *pid* of 0 means the calling process." msgstr "" -#: ../../library/os.rst:5097 +#: ../../library/os.rst:5098 msgid "" "Return the round-robin quantum in seconds for the process with PID *pid*. A " "*pid* of 0 means the calling process." msgstr "" -#: ../../library/os.rst:5103 +#: ../../library/os.rst:5104 msgid "Voluntarily relinquish the CPU." msgstr "" -#: ../../library/os.rst:5108 +#: ../../library/os.rst:5109 msgid "" "Restrict the process with PID *pid* (or the current process if zero) to a " "set of CPUs. *mask* is an iterable of integers representing the set of CPUs " "to which the process should be restricted." msgstr "" -#: ../../library/os.rst:5115 +#: ../../library/os.rst:5116 msgid "" "Return the set of CPUs the process with PID *pid* (or the current process if " "zero) is restricted to." msgstr "" -#: ../../library/os.rst:5122 +#: ../../library/os.rst:5123 msgid "Miscellaneous System Information" msgstr "" -#: ../../library/os.rst:5127 +#: ../../library/os.rst:5128 msgid "" "Return string-valued system configuration values. *name* specifies the " "configuration value to retrieve; it may be a string which is the name of a " @@ -5688,13 +5688,13 @@ msgid "" "included in that mapping, passing an integer for *name* is also accepted." msgstr "" -#: ../../library/os.rst:5135 +#: ../../library/os.rst:5136 msgid "" "If the configuration value specified by *name* isn't defined, ``None`` is " "returned." msgstr "" -#: ../../library/os.rst:5138 +#: ../../library/os.rst:5139 msgid "" "If *name* is a string and is not known, :exc:`ValueError` is raised. If a " "specific value for *name* is not supported by the host system, even if it is " @@ -5702,33 +5702,33 @@ msgid "" "`errno.EINVAL` for the error number." msgstr "" -#: ../../library/os.rst:5148 +#: ../../library/os.rst:5149 msgid "" "Dictionary mapping names accepted by :func:`confstr` to the integer values " "defined for those names by the host operating system. This can be used to " "determine the set of names known to the system." msgstr "" -#: ../../library/os.rst:5157 +#: ../../library/os.rst:5158 msgid "" "Return the number of CPUs in the system. Returns ``None`` if undetermined." msgstr "" -#: ../../library/os.rst:5159 +#: ../../library/os.rst:5160 msgid "" "This number is not equivalent to the number of CPUs the current process can " "use. The number of usable CPUs can be obtained with ``len(os." "sched_getaffinity(0))``" msgstr "" -#: ../../library/os.rst:5169 +#: ../../library/os.rst:5170 msgid "" "Return the number of processes in the system run queue averaged over the " "last 1, 5, and 15 minutes or raises :exc:`OSError` if the load average was " "unobtainable." msgstr "" -#: ../../library/os.rst:5178 +#: ../../library/os.rst:5179 msgid "" "Return integer-valued system configuration values. If the configuration " "value specified by *name* isn't defined, ``-1`` is returned. The comments " @@ -5737,44 +5737,44 @@ msgid "" "``sysconf_names``." msgstr "" -#: ../../library/os.rst:5188 +#: ../../library/os.rst:5189 msgid "" "Dictionary mapping names accepted by :func:`sysconf` to the integer values " "defined for those names by the host operating system. This can be used to " "determine the set of names known to the system." msgstr "" -#: ../../library/os.rst:5194 +#: ../../library/os.rst:5195 msgid "Add ``'SC_MINSIGSTKSZ'`` name." msgstr "" -#: ../../library/os.rst:5197 +#: ../../library/os.rst:5198 msgid "" "The following data values are used to support path manipulation operations. " "These are defined for all platforms." msgstr "" -#: ../../library/os.rst:5200 +#: ../../library/os.rst:5201 msgid "" "Higher-level operations on pathnames are defined in the :mod:`os.path` " "module." msgstr "" -#: ../../library/os.rst:5206 +#: ../../library/os.rst:5207 msgid "" "The constant string used by the operating system to refer to the current " "directory. This is ``'.'`` for Windows and POSIX. Also available via :mod:" "`os.path`." msgstr "" -#: ../../library/os.rst:5214 +#: ../../library/os.rst:5215 msgid "" "The constant string used by the operating system to refer to the parent " "directory. This is ``'..'`` for Windows and POSIX. Also available via :mod:" "`os.path`." msgstr "" -#: ../../library/os.rst:5223 +#: ../../library/os.rst:5224 msgid "" "The character used by the operating system to separate pathname components. " "This is ``'/'`` for POSIX and ``'\\\\'`` for Windows. Note that knowing " @@ -5783,7 +5783,7 @@ msgid "" "useful. Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:5233 +#: ../../library/os.rst:5234 msgid "" "An alternative character used by the operating system to separate pathname " "components, or ``None`` if only one separator character exists. This is set " @@ -5791,27 +5791,27 @@ msgid "" "via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:5242 +#: ../../library/os.rst:5243 msgid "" "The character which separates the base filename from the extension; for " "example, the ``'.'`` in :file:`os.py`. Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:5250 +#: ../../library/os.rst:5251 msgid "" "The character conventionally used by the operating system to separate search " "path components (as in :envvar:`PATH`), such as ``':'`` for POSIX or ``';'`` " "for Windows. Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:5257 +#: ../../library/os.rst:5258 msgid "" "The default search path used by :func:`exec\\*p\\* ` and :func:" "`spawn\\*p\\* ` if the environment doesn't have a ``'PATH'`` key. " "Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:5264 +#: ../../library/os.rst:5265 msgid "" "The string used to separate (or, rather, terminate) lines on the current " "platform. This may be a single character, such as ``'\\n'`` for POSIX, or " @@ -5820,36 +5820,36 @@ msgid "" "default); use a single ``'\\n'`` instead, on all platforms." msgstr "" -#: ../../library/os.rst:5273 +#: ../../library/os.rst:5274 msgid "" "The file path of the null device. For example: ``'/dev/null'`` for POSIX, " "``'nul'`` for Windows. Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:5284 +#: ../../library/os.rst:5285 msgid "" "Flags for use with the :func:`~sys.setdlopenflags` and :func:`~sys." "getdlopenflags` functions. See the Unix manual page :manpage:`dlopen(3)` " "for what the different flags mean." msgstr "" -#: ../../library/os.rst:5292 +#: ../../library/os.rst:5293 msgid "Random numbers" msgstr "" -#: ../../library/os.rst:5297 +#: ../../library/os.rst:5298 msgid "" "Get up to *size* random bytes. The function can return less bytes than " "requested." msgstr "" -#: ../../library/os.rst:5300 +#: ../../library/os.rst:5301 msgid "" "These bytes can be used to seed user-space random number generators or for " "cryptographic purposes." msgstr "" -#: ../../library/os.rst:5303 +#: ../../library/os.rst:5304 msgid "" "``getrandom()`` relies on entropy gathered from device drivers and other " "sources of environmental noise. Unnecessarily reading large quantities of " @@ -5857,36 +5857,36 @@ msgid "" "``/dev/urandom`` devices." msgstr "" -#: ../../library/os.rst:5308 +#: ../../library/os.rst:5309 msgid "" "The flags argument is a bit mask that can contain zero or more of the " "following values ORed together: :py:const:`os.GRND_RANDOM` and :py:data:" "`GRND_NONBLOCK`." msgstr "" -#: ../../library/os.rst:5312 +#: ../../library/os.rst:5313 msgid "" "See also the `Linux getrandom() manual page `_." msgstr "" -#: ../../library/os.rst:5315 +#: ../../library/os.rst:5316 msgid ":ref:`Availability `: Linux >= 3.17." msgstr ":ref:`適用 `:Linux 3.17 以上。" -#: ../../library/os.rst:5321 +#: ../../library/os.rst:5322 msgid "" "Return a bytestring of *size* random bytes suitable for cryptographic use." msgstr "" -#: ../../library/os.rst:5323 +#: ../../library/os.rst:5324 msgid "" "This function returns random bytes from an OS-specific randomness source. " "The returned data should be unpredictable enough for cryptographic " "applications, though its exact quality depends on the OS implementation." msgstr "" -#: ../../library/os.rst:5327 +#: ../../library/os.rst:5328 msgid "" "On Linux, if the ``getrandom()`` syscall is available, it is used in " "blocking mode: block until the system urandom entropy pool is initialized " @@ -5896,63 +5896,63 @@ msgid "" "to poll until the system urandom entropy pool is initialized." msgstr "" -#: ../../library/os.rst:5334 +#: ../../library/os.rst:5335 msgid "" "On a Unix-like system, random bytes are read from the ``/dev/urandom`` " "device. If the ``/dev/urandom`` device is not available or not readable, " "the :exc:`NotImplementedError` exception is raised." msgstr "" -#: ../../library/os.rst:5338 +#: ../../library/os.rst:5339 msgid "On Windows, it will use ``BCryptGenRandom()``." msgstr "" -#: ../../library/os.rst:5341 +#: ../../library/os.rst:5342 msgid "" "The :mod:`secrets` module provides higher level functions. For an easy-to-" "use interface to the random number generator provided by your platform, " "please see :class:`random.SystemRandom`." msgstr "" -#: ../../library/os.rst:5345 +#: ../../library/os.rst:5346 msgid "" "On Linux, ``getrandom()`` is now used in blocking mode to increase the " "security." msgstr "" -#: ../../library/os.rst:5349 +#: ../../library/os.rst:5350 msgid "" "On Linux, if the ``getrandom()`` syscall blocks (the urandom entropy pool is " "not initialized yet), fall back on reading ``/dev/urandom``." msgstr "" -#: ../../library/os.rst:5353 +#: ../../library/os.rst:5354 msgid "" "On Linux 3.17 and newer, the ``getrandom()`` syscall is now used when " "available. On OpenBSD 5.6 and newer, the C ``getentropy()`` function is now " "used. These functions avoid the usage of an internal file descriptor." msgstr "" -#: ../../library/os.rst:5359 +#: ../../library/os.rst:5360 msgid "" "On Windows, ``BCryptGenRandom()`` is used instead of ``CryptGenRandom()`` " "which is deprecated." msgstr "" -#: ../../library/os.rst:5365 +#: ../../library/os.rst:5366 msgid "" "By default, when reading from ``/dev/random``, :func:`getrandom` blocks if " "no random bytes are available, and when reading from ``/dev/urandom``, it " "blocks if the entropy pool has not yet been initialized." msgstr "" -#: ../../library/os.rst:5369 +#: ../../library/os.rst:5370 msgid "" "If the :py:data:`GRND_NONBLOCK` flag is set, then :func:`getrandom` does not " "block in these cases, but instead immediately raises :exc:`BlockingIOError`." msgstr "" -#: ../../library/os.rst:5376 +#: ../../library/os.rst:5377 msgid "" "If this bit is set, then random bytes are drawn from the ``/dev/" "random`` pool instead of the ``/dev/urandom`` pool." @@ -5968,7 +5968,7 @@ msgstr "" #: ../../library/os.rst:372 ../../library/os.rst:438 ../../library/os.rst:447 #: ../../library/os.rst:456 ../../library/os.rst:470 ../../library/os.rst:666 -#: ../../library/os.rst:4189 ../../library/os.rst:4216 +#: ../../library/os.rst:4190 ../../library/os.rst:4217 msgid "process" msgstr "process" @@ -6008,11 +6008,11 @@ msgstr "gethostname()(於 socket 模組)" msgid "gethostbyaddr() (in module socket)" msgstr "gethostbyaddr()(於 socket 模組)" -#: ../../library/os.rst:796 ../../library/os.rst:2574 +#: ../../library/os.rst:796 ../../library/os.rst:2575 msgid "deleting" msgstr "deleting(刪除)" -#: ../../library/os.rst:1338 ../../library/os.rst:2944 +#: ../../library/os.rst:1338 ../../library/os.rst:2945 msgid "module" msgstr "module(模組)" @@ -6020,82 +6020,82 @@ msgstr "module(模組)" msgid "pty" msgstr "pty" -#: ../../library/os.rst:1978 ../../library/os.rst:2372 -#: ../../library/os.rst:2574 ../../library/os.rst:3480 -#: ../../library/os.rst:3579 +#: ../../library/os.rst:1979 ../../library/os.rst:2373 +#: ../../library/os.rst:2575 ../../library/os.rst:3481 +#: ../../library/os.rst:3580 msgid "directory" msgstr "directory(目錄)" -#: ../../library/os.rst:1978 +#: ../../library/os.rst:1979 msgid "changing" msgstr "changing(改變)" -#: ../../library/os.rst:2372 +#: ../../library/os.rst:2373 msgid "creating" msgstr "creating(建立)" -#: ../../library/os.rst:2372 +#: ../../library/os.rst:2373 msgid "UNC paths" msgstr "UNC paths(UNC 路徑)" -#: ../../library/os.rst:2372 +#: ../../library/os.rst:2373 msgid "and os.makedirs()" msgstr "以及 os.makedirs()" -#: ../../library/os.rst:2944 +#: ../../library/os.rst:2945 msgid "stat" msgstr "stat" -#: ../../library/os.rst:3480 ../../library/os.rst:3579 +#: ../../library/os.rst:3481 ../../library/os.rst:3580 msgid "walking" msgstr "" -#: ../../library/os.rst:3480 ../../library/os.rst:3579 +#: ../../library/os.rst:3481 ../../library/os.rst:3580 msgid "traversal" msgstr "traversal(遍歷)" -#: ../../library/os.rst:4189 ../../library/os.rst:4216 +#: ../../library/os.rst:4190 ../../library/os.rst:4217 msgid "killing" msgstr "" -#: ../../library/os.rst:4189 ../../library/os.rst:4216 +#: ../../library/os.rst:4190 ../../library/os.rst:4217 msgid "signalling" msgstr "signalling(信號)" -#: ../../library/os.rst:5203 ../../library/os.rst:5239 +#: ../../library/os.rst:5204 ../../library/os.rst:5240 msgid ". (dot)" msgstr ". (點)" -#: ../../library/os.rst:5203 ../../library/os.rst:5211 -#: ../../library/os.rst:5219 ../../library/os.rst:5230 -#: ../../library/os.rst:5239 +#: ../../library/os.rst:5204 ../../library/os.rst:5212 +#: ../../library/os.rst:5220 ../../library/os.rst:5231 +#: ../../library/os.rst:5240 msgid "in pathnames" msgstr "於 pathnames(路徑名稱)中" -#: ../../library/os.rst:5211 +#: ../../library/os.rst:5212 msgid ".." msgstr ".." -#: ../../library/os.rst:5219 ../../library/os.rst:5230 +#: ../../library/os.rst:5220 ../../library/os.rst:5231 msgid "/ (slash)" msgstr "/ (斜線)" -#: ../../library/os.rst:5220 +#: ../../library/os.rst:5221 msgid "\\ (backslash)" msgstr "\\ (反斜線)" -#: ../../library/os.rst:5220 +#: ../../library/os.rst:5221 msgid "in pathnames (Windows)" msgstr "in pathnames (Windows)(在路徑名稱中 (Windows))" -#: ../../library/os.rst:5246 +#: ../../library/os.rst:5247 msgid ": (colon)" msgstr ": (冒號)" -#: ../../library/os.rst:5246 +#: ../../library/os.rst:5247 msgid "path separator (POSIX)" msgstr "path separator (POSIX)(路徑分隔器 (POSIX))" -#: ../../library/os.rst:5246 +#: ../../library/os.rst:5247 msgid "; (semicolon)" msgstr "; (分號)" diff --git a/library/pickle.po b/library/pickle.po index dfb9a4f3f5..d0cd1ef02a 100644 --- a/library/pickle.po +++ b/library/pickle.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-08-31 00:03+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-" @@ -666,39 +666,41 @@ msgid "The following types can be pickled:" msgstr "" #: ../../library/pickle.rst:497 -msgid "``None``, ``True``, and ``False``;" -msgstr "``None``\\ 、\\ ``True`` 和 ``False``\\ ;" +msgid "" +"built-in constants (``None``, ``True``, ``False``, ``Ellipsis``, and " +"``NotImplemented``);" +msgstr "" -#: ../../library/pickle.rst:499 +#: ../../library/pickle.rst:500 msgid "integers, floating-point numbers, complex numbers;" msgstr "" -#: ../../library/pickle.rst:501 +#: ../../library/pickle.rst:502 msgid "strings, bytes, bytearrays;" msgstr "" -#: ../../library/pickle.rst:503 +#: ../../library/pickle.rst:504 msgid "" "tuples, lists, sets, and dictionaries containing only picklable objects;" msgstr "" -#: ../../library/pickle.rst:505 +#: ../../library/pickle.rst:506 msgid "" "functions (built-in and user-defined) accessible from the top level of a " "module (using :keyword:`def`, not :keyword:`lambda`);" msgstr "" -#: ../../library/pickle.rst:508 +#: ../../library/pickle.rst:509 msgid "classes accessible from the top level of a module;" msgstr "" -#: ../../library/pickle.rst:510 +#: ../../library/pickle.rst:511 msgid "" "instances of such classes whose the result of calling :meth:`__getstate__` " "is picklable (see section :ref:`pickle-inst` for details)." msgstr "" -#: ../../library/pickle.rst:513 +#: ../../library/pickle.rst:514 msgid "" "Attempts to pickle unpicklable objects will raise the :exc:`PicklingError` " "exception; when this happens, an unspecified number of bytes may have " @@ -708,7 +710,7 @@ msgid "" "limit with :func:`sys.setrecursionlimit`." msgstr "" -#: ../../library/pickle.rst:520 +#: ../../library/pickle.rst:521 msgid "" "Note that functions (built-in and user-defined) are pickled by fully :term:" "`qualified name`, not by value. [#]_ This means that only the function name " @@ -719,7 +721,7 @@ msgid "" "exception will be raised. [#]_" msgstr "" -#: ../../library/pickle.rst:527 +#: ../../library/pickle.rst:528 msgid "" "Similarly, classes are pickled by fully qualified name, so the same " "restrictions in the unpickling environment apply. Note that none of the " @@ -727,13 +729,13 @@ msgid "" "attribute ``attr`` is not restored in the unpickling environment::" msgstr "" -#: ../../library/pickle.rst:537 +#: ../../library/pickle.rst:538 msgid "" "These restrictions are why picklable functions and classes must be defined " "at the top level of a module." msgstr "" -#: ../../library/pickle.rst:540 +#: ../../library/pickle.rst:541 msgid "" "Similarly, when class instances are pickled, their class's code and data are " "not pickled along with them. Only the instance data are pickled. This is " @@ -745,17 +747,17 @@ msgid "" "method." msgstr "" -#: ../../library/pickle.rst:552 +#: ../../library/pickle.rst:553 msgid "Pickling Class Instances" msgstr "" -#: ../../library/pickle.rst:556 +#: ../../library/pickle.rst:557 msgid "" "In this section, we describe the general mechanisms available to you to " "define, customize, and control how class instances are pickled and unpickled." msgstr "" -#: ../../library/pickle.rst:559 +#: ../../library/pickle.rst:560 msgid "" "In most cases, no additional code is needed to make instances picklable. By " "default, pickle will retrieve the class and the attributes of an instance " @@ -765,13 +767,13 @@ msgid "" "following code shows an implementation of this behaviour::" msgstr "" -#: ../../library/pickle.rst:574 +#: ../../library/pickle.rst:575 msgid "" "Classes can alter the default behaviour by providing one or several special " "methods:" msgstr "" -#: ../../library/pickle.rst:579 +#: ../../library/pickle.rst:580 msgid "" "In protocols 2 and newer, classes that implements the :meth:" "`__getnewargs_ex__` method can dictate the values passed to the :meth:" @@ -781,37 +783,37 @@ msgid "" "passed to the :meth:`__new__` method upon unpickling." msgstr "" -#: ../../library/pickle.rst:587 +#: ../../library/pickle.rst:588 msgid "" "You should implement this method if the :meth:`__new__` method of your class " "requires keyword-only arguments. Otherwise, it is recommended for " "compatibility to implement :meth:`__getnewargs__`." msgstr "" -#: ../../library/pickle.rst:591 +#: ../../library/pickle.rst:592 msgid ":meth:`__getnewargs_ex__` is now used in protocols 2 and 3." msgstr "" -#: ../../library/pickle.rst:597 +#: ../../library/pickle.rst:598 msgid "" "This method serves a similar purpose as :meth:`__getnewargs_ex__`, but " "supports only positional arguments. It must return a tuple of arguments " "``args`` which will be passed to the :meth:`__new__` method upon unpickling." msgstr "" -#: ../../library/pickle.rst:601 +#: ../../library/pickle.rst:602 msgid "" ":meth:`__getnewargs__` will not be called if :meth:`__getnewargs_ex__` is " "defined." msgstr "" -#: ../../library/pickle.rst:604 +#: ../../library/pickle.rst:605 msgid "" "Before Python 3.6, :meth:`__getnewargs__` was called instead of :meth:" "`__getnewargs_ex__` in protocols 2 and 3." msgstr "" -#: ../../library/pickle.rst:611 +#: ../../library/pickle.rst:612 msgid "" "Classes can further influence how their instances are pickled by overriding " "the method :meth:`__getstate__`. It is called and the returned object is " @@ -819,19 +821,19 @@ msgid "" "are several cases:" msgstr "" -#: ../../library/pickle.rst:616 +#: ../../library/pickle.rst:617 msgid "" "For a class that has no instance :attr:`~object.__dict__` and no :attr:" "`~object.__slots__`, the default state is ``None``." msgstr "" -#: ../../library/pickle.rst:619 +#: ../../library/pickle.rst:620 msgid "" "For a class that has an instance :attr:`~object.__dict__` and no :attr:" "`~object.__slots__`, the default state is ``self.__dict__``." msgstr "" -#: ../../library/pickle.rst:622 +#: ../../library/pickle.rst:623 msgid "" "For a class that has an instance :attr:`~object.__dict__` and :attr:`~object." "__slots__`, the default state is a tuple consisting of two dictionaries: " @@ -839,7 +841,7 @@ msgid "" "slots that have a value are included in the latter." msgstr "" -#: ../../library/pickle.rst:628 +#: ../../library/pickle.rst:629 msgid "" "For a class that has :attr:`~object.__slots__` and no instance :attr:" "`~object.__dict__`, the default state is a tuple whose first item is " @@ -847,13 +849,13 @@ msgid "" "values described in the previous bullet." msgstr "" -#: ../../library/pickle.rst:633 +#: ../../library/pickle.rst:634 msgid "" "Added the default implementation of the ``__getstate__()`` method in the :" "class:`object` class." msgstr "" -#: ../../library/pickle.rst:640 +#: ../../library/pickle.rst:641 msgid "" "Upon unpickling, if the class defines :meth:`__setstate__`, it is called " "with the unpickled state. In that case, there is no requirement for the " @@ -861,19 +863,19 @@ msgid "" "dictionary and its items are assigned to the new instance's dictionary." msgstr "" -#: ../../library/pickle.rst:647 +#: ../../library/pickle.rst:648 msgid "" "If :meth:`__getstate__` returns a false value, the :meth:`__setstate__` " "method will not be called upon unpickling." msgstr "" -#: ../../library/pickle.rst:651 +#: ../../library/pickle.rst:652 msgid "" "Refer to the section :ref:`pickle-state` for more information about how to " "use the methods :meth:`__getstate__` and :meth:`__setstate__`." msgstr "" -#: ../../library/pickle.rst:656 +#: ../../library/pickle.rst:657 msgid "" "At unpickling time, some methods like :meth:`__getattr__`, :meth:" "`__getattribute__`, or :meth:`__setattr__` may be called upon the instance. " @@ -882,7 +884,7 @@ msgid "" "`__init__` is not called when unpickling an instance." msgstr "" -#: ../../library/pickle.rst:665 +#: ../../library/pickle.rst:666 msgid "" "As we shall see, pickle does not use directly the methods described above. " "In fact, these methods are part of the copy protocol which implements the :" @@ -891,7 +893,7 @@ msgid "" "objects. [#]_" msgstr "" -#: ../../library/pickle.rst:671 +#: ../../library/pickle.rst:672 msgid "" "Although powerful, implementing :meth:`__reduce__` directly in your classes " "is error prone. For this reason, class designers should use the high-level " @@ -901,14 +903,14 @@ msgid "" "pickling or both." msgstr "" -#: ../../library/pickle.rst:680 +#: ../../library/pickle.rst:681 msgid "" "The interface is currently defined as follows. The :meth:`__reduce__` " "method takes no argument and shall return either a string or preferably a " "tuple (the returned object is often referred to as the \"reduce value\")." msgstr "" -#: ../../library/pickle.rst:684 +#: ../../library/pickle.rst:685 msgid "" "If a string is returned, the string should be interpreted as the name of a " "global variable. It should be the object's local name relative to its " @@ -916,26 +918,26 @@ msgid "" "object's module. This behaviour is typically useful for singletons." msgstr "" -#: ../../library/pickle.rst:689 +#: ../../library/pickle.rst:690 msgid "" "When a tuple is returned, it must be between two and six items long. " "Optional items can either be omitted, or ``None`` can be provided as their " "value. The semantics of each item are in order:" msgstr "" -#: ../../library/pickle.rst:695 +#: ../../library/pickle.rst:696 msgid "" "A callable object that will be called to create the initial version of the " "object." msgstr "" -#: ../../library/pickle.rst:698 +#: ../../library/pickle.rst:699 msgid "" "A tuple of arguments for the callable object. An empty tuple must be given " "if the callable does not accept any argument." msgstr "" -#: ../../library/pickle.rst:701 +#: ../../library/pickle.rst:702 msgid "" "Optionally, the object's state, which will be passed to the object's :meth:" "`__setstate__` method as previously described. If the object has no such " @@ -943,7 +945,7 @@ msgid "" "object's :attr:`~object.__dict__` attribute." msgstr "" -#: ../../library/pickle.rst:706 +#: ../../library/pickle.rst:707 msgid "" "Optionally, an iterator (and not a sequence) yielding successive items. " "These items will be appended to the object either using ``obj.append(item)`` " @@ -955,7 +957,7 @@ msgid "" "must be supported.)" msgstr "" -#: ../../library/pickle.rst:715 +#: ../../library/pickle.rst:716 msgid "" "Optionally, an iterator (not a sequence) yielding successive key-value " "pairs. These items will be stored to the object using ``obj[key] = " @@ -963,7 +965,7 @@ msgid "" "by other classes as long as they implement :meth:`__setitem__`." msgstr "" -#: ../../library/pickle.rst:720 +#: ../../library/pickle.rst:721 msgid "" "Optionally, a callable with a ``(obj, state)`` signature. This callable " "allows the user to programmatically control the state-updating behavior of a " @@ -972,11 +974,11 @@ msgid "" "meth:`__setstate__`." msgstr "" -#: ../../library/pickle.rst:726 +#: ../../library/pickle.rst:727 msgid "The optional sixth tuple item, ``(obj, state)``, was added." msgstr "" -#: ../../library/pickle.rst:732 +#: ../../library/pickle.rst:733 msgid "" "Alternatively, a :meth:`__reduce_ex__` method may be defined. The only " "difference is this method should take a single integer argument, the " @@ -986,11 +988,11 @@ msgid "" "provide backwards-compatible reduce values for older Python releases." msgstr "" -#: ../../library/pickle.rst:744 +#: ../../library/pickle.rst:745 msgid "Persistence of External Objects" msgstr "" -#: ../../library/pickle.rst:750 +#: ../../library/pickle.rst:751 msgid "" "For the benefit of object persistence, the :mod:`pickle` module supports the " "notion of a reference to an object outside the pickled data stream. Such " @@ -999,7 +1001,7 @@ msgid "" "(for any newer protocol)." msgstr "" -#: ../../library/pickle.rst:756 +#: ../../library/pickle.rst:757 msgid "" "The resolution of such persistent IDs is not defined by the :mod:`pickle` " "module; it will delegate this resolution to the user-defined methods on the " @@ -1007,7 +1009,7 @@ msgid "" "persistent_load` respectively." msgstr "" -#: ../../library/pickle.rst:761 +#: ../../library/pickle.rst:762 msgid "" "To pickle objects that have an external persistent ID, the pickler must have " "a custom :meth:`~Pickler.persistent_id` method that takes an object as an " @@ -1018,67 +1020,67 @@ msgid "" "persistent ID." msgstr "" -#: ../../library/pickle.rst:768 +#: ../../library/pickle.rst:769 msgid "" "To unpickle external objects, the unpickler must have a custom :meth:" "`~Unpickler.persistent_load` method that takes a persistent ID object and " "returns the referenced object." msgstr "" -#: ../../library/pickle.rst:772 +#: ../../library/pickle.rst:773 msgid "" "Here is a comprehensive example presenting how persistent ID can be used to " "pickle external objects by reference." msgstr "" -#: ../../library/pickle.rst:780 +#: ../../library/pickle.rst:781 msgid "Dispatch Tables" msgstr "" -#: ../../library/pickle.rst:782 +#: ../../library/pickle.rst:783 msgid "" "If one wants to customize pickling of some classes without disturbing any " "other code which depends on pickling, then one can create a pickler with a " "private dispatch table." msgstr "" -#: ../../library/pickle.rst:786 +#: ../../library/pickle.rst:787 msgid "" "The global dispatch table managed by the :mod:`copyreg` module is available " "as :data:`copyreg.dispatch_table`. Therefore, one may choose to use a " "modified copy of :data:`copyreg.dispatch_table` as a private dispatch table." msgstr "" -#: ../../library/pickle.rst:791 +#: ../../library/pickle.rst:792 msgid "For example ::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/pickle.rst:798 +#: ../../library/pickle.rst:799 msgid "" "creates an instance of :class:`pickle.Pickler` with a private dispatch table " "which handles the ``SomeClass`` class specially. Alternatively, the code ::" msgstr "" -#: ../../library/pickle.rst:808 +#: ../../library/pickle.rst:809 msgid "" "does the same but all instances of ``MyPickler`` will by default share the " "private dispatch table. On the other hand, the code ::" msgstr "" -#: ../../library/pickle.rst:815 +#: ../../library/pickle.rst:816 msgid "" "modifies the global dispatch table shared by all users of the :mod:`copyreg` " "module." msgstr "" -#: ../../library/pickle.rst:820 +#: ../../library/pickle.rst:821 msgid "Handling Stateful Objects" msgstr "" -#: ../../library/pickle.rst:826 +#: ../../library/pickle.rst:827 msgid "" "Here's an example that shows how to modify pickling behavior for a class. " "The :class:`TextReader` class opens a text file, and returns the line number " @@ -1090,15 +1092,15 @@ msgid "" "behavior. ::" msgstr "" -#: ../../library/pickle.rst:872 +#: ../../library/pickle.rst:873 msgid "A sample usage might be something like this::" msgstr "" -#: ../../library/pickle.rst:886 +#: ../../library/pickle.rst:887 msgid "Custom Reduction for Types, Functions, and Other Objects" msgstr "" -#: ../../library/pickle.rst:890 +#: ../../library/pickle.rst:891 msgid "" "Sometimes, :attr:`~Pickler.dispatch_table` may not be flexible enough. In " "particular we may want to customize pickling based on another criterion than " @@ -1106,7 +1108,7 @@ msgid "" "classes." msgstr "" -#: ../../library/pickle.rst:895 +#: ../../library/pickle.rst:896 msgid "" "For those cases, it is possible to subclass from the :class:`Pickler` class " "and implement a :meth:`~Pickler.reducer_override` method. This method can " @@ -1115,14 +1117,14 @@ msgid "" "behavior." msgstr "" -#: ../../library/pickle.rst:900 +#: ../../library/pickle.rst:901 msgid "" "If both the :attr:`~Pickler.dispatch_table` and :meth:`~Pickler." "reducer_override` are defined, then :meth:`~Pickler.reducer_override` method " "takes priority." msgstr "" -#: ../../library/pickle.rst:905 +#: ../../library/pickle.rst:906 msgid "" "For performance reasons, :meth:`~Pickler.reducer_override` may not be called " "for the following objects: ``None``, ``True``, ``False``, and exact " @@ -1131,17 +1133,17 @@ msgid "" "`tuple`." msgstr "" -#: ../../library/pickle.rst:911 +#: ../../library/pickle.rst:912 msgid "" "Here is a simple example where we allow pickling and reconstructing a given " "class::" msgstr "" -#: ../../library/pickle.rst:946 +#: ../../library/pickle.rst:947 msgid "Out-of-band Buffers" msgstr "" -#: ../../library/pickle.rst:950 +#: ../../library/pickle.rst:951 msgid "" "In some contexts, the :mod:`pickle` module is used to transfer massive " "amounts of data. Therefore, it can be important to minimize the number of " @@ -1151,7 +1153,7 @@ msgid "" "involves copying data to and from the pickle stream." msgstr "" -#: ../../library/pickle.rst:957 +#: ../../library/pickle.rst:958 msgid "" "This constraint can be eschewed if both the *provider* (the implementation " "of the object types to be transferred) and the *consumer* (the " @@ -1159,11 +1161,11 @@ msgid "" "transfer facilities provided by pickle protocol 5 and higher." msgstr "" -#: ../../library/pickle.rst:963 +#: ../../library/pickle.rst:964 msgid "Provider API" msgstr "" -#: ../../library/pickle.rst:965 +#: ../../library/pickle.rst:966 msgid "" "The large data objects to be pickled must implement a :meth:`__reduce_ex__` " "method specialized for protocol 5 and higher, which returns a :class:" @@ -1171,7 +1173,7 @@ msgid "" "large data." msgstr "" -#: ../../library/pickle.rst:970 +#: ../../library/pickle.rst:971 msgid "" "A :class:`PickleBuffer` object *signals* that the underlying buffer is " "eligible for out-of-band data transfer. Those objects remain compatible " @@ -1180,17 +1182,17 @@ msgid "" "themselves." msgstr "" -#: ../../library/pickle.rst:977 +#: ../../library/pickle.rst:978 msgid "Consumer API" msgstr "" -#: ../../library/pickle.rst:979 +#: ../../library/pickle.rst:980 msgid "" "A communications system can enable custom handling of the :class:" "`PickleBuffer` objects generated when serializing an object graph." msgstr "" -#: ../../library/pickle.rst:982 +#: ../../library/pickle.rst:983 msgid "" "On the sending side, it needs to pass a *buffer_callback* argument to :class:" "`Pickler` (or to the :func:`dump` or :func:`dumps` function), which will be " @@ -1199,7 +1201,7 @@ msgid "" "copied into the pickle stream, only a cheap marker will be inserted." msgstr "" -#: ../../library/pickle.rst:989 +#: ../../library/pickle.rst:990 msgid "" "On the receiving side, it needs to pass a *buffers* argument to :class:" "`Unpickler` (or to the :func:`load` or :func:`loads` function), which is an " @@ -1210,7 +1212,7 @@ msgid "" "`PickleBuffer` objects." msgstr "" -#: ../../library/pickle.rst:997 +#: ../../library/pickle.rst:998 msgid "" "Between the sending side and the receiving side, the communications system " "is free to implement its own transfer mechanism for out-of-band buffers. " @@ -1218,36 +1220,36 @@ msgid "" "dependent compression." msgstr "" -#: ../../library/pickle.rst:1003 +#: ../../library/pickle.rst:1004 msgid "Example" msgstr "範例" -#: ../../library/pickle.rst:1005 +#: ../../library/pickle.rst:1006 msgid "" "Here is a trivial example where we implement a :class:`bytearray` subclass " "able to participate in out-of-band buffer pickling::" msgstr "" -#: ../../library/pickle.rst:1029 +#: ../../library/pickle.rst:1030 msgid "" "The reconstructor (the ``_reconstruct`` class method) returns the buffer's " "providing object if it has the right type. This is an easy way to simulate " "zero-copy behaviour on this toy example." msgstr "" -#: ../../library/pickle.rst:1033 +#: ../../library/pickle.rst:1034 msgid "" "On the consumer side, we can pickle those objects the usual way, which when " "unserialized will give us a copy of the original object::" msgstr "" -#: ../../library/pickle.rst:1042 +#: ../../library/pickle.rst:1043 msgid "" "But if we pass a *buffer_callback* and then give back the accumulated " "buffers when unserializing, we are able to get back the original object::" msgstr "" -#: ../../library/pickle.rst:1052 +#: ../../library/pickle.rst:1053 msgid "" "This example is limited by the fact that :class:`bytearray` allocates its " "own memory: you cannot create a :class:`bytearray` instance that is backed " @@ -1257,15 +1259,15 @@ msgid "" "processes or systems." msgstr "" -#: ../../library/pickle.rst:1059 +#: ../../library/pickle.rst:1060 msgid ":pep:`574` -- Pickle protocol 5 with out-of-band data" msgstr "" -#: ../../library/pickle.rst:1065 +#: ../../library/pickle.rst:1066 msgid "Restricting Globals" msgstr "" -#: ../../library/pickle.rst:1070 +#: ../../library/pickle.rst:1071 msgid "" "By default, unpickling will import any class or function that it finds in " "the pickle data. For many applications, this behaviour is unacceptable as " @@ -1273,7 +1275,7 @@ msgid "" "what this hand-crafted pickle data stream does when loaded::" msgstr "" -#: ../../library/pickle.rst:1080 +#: ../../library/pickle.rst:1081 msgid "" "In this example, the unpickler imports the :func:`os.system` function and " "then apply the string argument \"echo hello world\". Although this example " @@ -1281,7 +1283,7 @@ msgid "" "system." msgstr "" -#: ../../library/pickle.rst:1084 +#: ../../library/pickle.rst:1085 msgid "" "For this reason, you may want to control what gets unpickled by customizing :" "meth:`Unpickler.find_class`. Unlike its name suggests, :meth:`Unpickler." @@ -1290,17 +1292,17 @@ msgid "" "restrict them to a safe subset." msgstr "" -#: ../../library/pickle.rst:1090 +#: ../../library/pickle.rst:1091 msgid "" "Here is an example of an unpickler allowing only few safe classes from the :" "mod:`builtins` module to be loaded::" msgstr "" -#: ../../library/pickle.rst:1119 +#: ../../library/pickle.rst:1120 msgid "A sample usage of our unpickler working as intended::" msgstr "" -#: ../../library/pickle.rst:1138 +#: ../../library/pickle.rst:1139 msgid "" "As our examples shows, you have to be careful with what you allow to be " "unpickled. Therefore if security is a concern, you may want to consider " @@ -1308,97 +1310,97 @@ msgid "" "party solutions." msgstr "" -#: ../../library/pickle.rst:1145 +#: ../../library/pickle.rst:1146 msgid "Performance" msgstr "" -#: ../../library/pickle.rst:1147 +#: ../../library/pickle.rst:1148 msgid "" "Recent versions of the pickle protocol (from protocol 2 and upwards) feature " "efficient binary encodings for several common features and built-in types. " "Also, the :mod:`pickle` module has a transparent optimizer written in C." msgstr "" -#: ../../library/pickle.rst:1155 +#: ../../library/pickle.rst:1156 msgid "Examples" msgstr "範例" -#: ../../library/pickle.rst:1157 +#: ../../library/pickle.rst:1158 msgid "" "For the simplest code, use the :func:`dump` and :func:`load` functions. ::" msgstr "" -#: ../../library/pickle.rst:1173 +#: ../../library/pickle.rst:1174 msgid "The following example reads the resulting pickled data. ::" msgstr "" -#: ../../library/pickle.rst:1190 +#: ../../library/pickle.rst:1191 msgid "Module :mod:`copyreg`" msgstr ":mod:`copyreg` 模組" -#: ../../library/pickle.rst:1190 +#: ../../library/pickle.rst:1191 msgid "Pickle interface constructor registration for extension types." msgstr "" -#: ../../library/pickle.rst:1193 +#: ../../library/pickle.rst:1194 msgid "Module :mod:`pickletools`" msgstr ":mod:`pickletools` 模組" -#: ../../library/pickle.rst:1193 +#: ../../library/pickle.rst:1194 msgid "Tools for working with and analyzing pickled data." msgstr "" -#: ../../library/pickle.rst:1196 +#: ../../library/pickle.rst:1197 msgid "Module :mod:`shelve`" msgstr ":mod:`shelve` 模組" -#: ../../library/pickle.rst:1196 +#: ../../library/pickle.rst:1197 msgid "Indexed databases of objects; uses :mod:`pickle`." msgstr "" -#: ../../library/pickle.rst:1199 +#: ../../library/pickle.rst:1200 msgid "Module :mod:`copy`" msgstr ":mod:`copy` 模組" -#: ../../library/pickle.rst:1199 +#: ../../library/pickle.rst:1200 msgid "Shallow and deep object copying." msgstr "" -#: ../../library/pickle.rst:1201 +#: ../../library/pickle.rst:1202 msgid "Module :mod:`marshal`" msgstr ":mod:`marshal` 模組" -#: ../../library/pickle.rst:1202 +#: ../../library/pickle.rst:1203 msgid "High-performance serialization of built-in types." msgstr "" -#: ../../library/pickle.rst:1206 +#: ../../library/pickle.rst:1207 msgid "Footnotes" msgstr "註解" -#: ../../library/pickle.rst:1207 +#: ../../library/pickle.rst:1208 msgid "Don't confuse this with the :mod:`marshal` module" msgstr "" -#: ../../library/pickle.rst:1209 +#: ../../library/pickle.rst:1210 msgid "" "This is why :keyword:`lambda` functions cannot be pickled: all :keyword:`!" "lambda` functions share the same name: ````." msgstr "" -#: ../../library/pickle.rst:1212 +#: ../../library/pickle.rst:1213 msgid "" "The exception raised will likely be an :exc:`ImportError` or an :exc:" "`AttributeError` but it could be something else." msgstr "" -#: ../../library/pickle.rst:1215 +#: ../../library/pickle.rst:1216 msgid "" "The :mod:`copy` module uses this protocol for shallow and deep copying " "operations." msgstr "" -#: ../../library/pickle.rst:1218 +#: ../../library/pickle.rst:1219 msgid "" "The limitation on alphanumeric characters is due to the fact that persistent " "IDs in protocol 0 are delimited by the newline character. Therefore if any " @@ -1438,30 +1440,33 @@ msgstr "pickling" msgid "External Data Representation" msgstr "External Data Representation(外部資料表示法)" -#: ../../library/pickle.rst:663 +#: ../../library/pickle.rst:664 msgid "copy" msgstr "copy(複製)" -#: ../../library/pickle.rst:663 +#: ../../library/pickle.rst:664 msgid "protocol" msgstr "protocol(協定)" -#: ../../library/pickle.rst:746 +#: ../../library/pickle.rst:747 msgid "persistent_id (pickle protocol)" msgstr "persistent_id(pickle 協定)" -#: ../../library/pickle.rst:746 +#: ../../library/pickle.rst:747 msgid "persistent_load (pickle protocol)" msgstr "persistent_load(pickle 協定)" -#: ../../library/pickle.rst:822 +#: ../../library/pickle.rst:823 msgid "__getstate__() (copy protocol)" msgstr "__getstate__()(copy 協定)" -#: ../../library/pickle.rst:822 +#: ../../library/pickle.rst:823 msgid "__setstate__() (copy protocol)" msgstr "__setstate__()(copy 協定)" -#: ../../library/pickle.rst:1067 +#: ../../library/pickle.rst:1068 msgid "find_class() (pickle protocol)" msgstr "find_class()(pickle 協定)" + +#~ msgid "``None``, ``True``, and ``False``;" +#~ msgstr "``None``\\ 、\\ ``True`` 和 ``False``\\ ;" diff --git a/library/socket.po b/library/socket.po index 7875ed07cd..6ef99f085a 100644 --- a/library/socket.po +++ b/library/socket.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-09-09 00:03+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-" @@ -1187,8 +1187,8 @@ msgstr ":ref:`適用 `:非 WASI。" #: ../../library/socket.rst:981 msgid "" -"Translate a host name to IPv4 address format, extended interface. Return a " -"triple ``(hostname, aliaslist, ipaddrlist)`` where *hostname* is the host's " +"Translate a host name to IPv4 address format, extended interface. Return a 3-" +"tuple ``(hostname, aliaslist, ipaddrlist)`` where *hostname* is the host's " "primary host name, *aliaslist* is a (possibly empty) list of alternative " "host names for the same address, and *ipaddrlist* is a list of IPv4 " "addresses for the same interface on the same host (often but not always a " @@ -1218,7 +1218,7 @@ msgstr "" #: ../../library/socket.rst:1010 msgid "" -"Return a triple ``(hostname, aliaslist, ipaddrlist)`` where *hostname* is " +"Return a 3-tuple ``(hostname, aliaslist, ipaddrlist)`` where *hostname* is " "the primary host name responding to the given *ip_address*, *aliaslist* is a " "(possibly empty) list of alternative host names for the same address, and " "*ipaddrlist* is a list of IPv4/v6 addresses for the same interface on the " diff --git a/library/sqlite3.po b/library/sqlite3.po index 0e6a2ccf5f..cacf25b635 100644 --- a/library/sqlite3.po +++ b/library/sqlite3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-08-29 12:27+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-" @@ -1479,7 +1479,7 @@ msgstr "" #: ../../library/sqlite3.rst:1548 msgid "" -"If *sql* contains more than one SQL statement, or is not a DML statment." +"If *sql* contains more than one SQL statement, or is not a DML statement." msgstr "" #: ../../library/sqlite3.rst:1565 diff --git a/library/sys.monitoring.po b/library/sys.monitoring.po new file mode 100644 index 0000000000..58353e1ae7 --- /dev/null +++ b/library/sys.monitoring.po @@ -0,0 +1,540 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2023, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.12\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-09-06 00:03+0000\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: zh_TW\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../../library/sys.monitoring.rst:2 +msgid ":mod:`sys.monitoring` --- Execution event monitoring" +msgstr "" + +#: ../../library/sys.monitoring.rst:11 +msgid "" +"``sys.monitoring`` is a namespace within the ``sys`` module, not an " +"independent module, so there is no need to ``import sys.monitoring``, simply " +"``import sys`` and then use ``sys.monitoring``." +msgstr "" + +#: ../../library/sys.monitoring.rst:17 +msgid "" +"This namespace provides access to the functions and constants necessary to " +"activate and control event monitoring." +msgstr "" + +#: ../../library/sys.monitoring.rst:20 +msgid "" +"As programs execute, events occur that might be of interest to tools that " +"monitor execution. The :mod:`!sys.monitoring` namespace provides means to " +"receive callbacks when events of interest occur." +msgstr "" + +#: ../../library/sys.monitoring.rst:24 +msgid "The monitoring API consists of three components:" +msgstr "" + +#: ../../library/sys.monitoring.rst:26 ../../library/sys.monitoring.rst:31 +msgid "Tool identifiers" +msgstr "" + +#: ../../library/sys.monitoring.rst:27 ../../library/sys.monitoring.rst:74 +msgid "Events" +msgstr "" + +#: ../../library/sys.monitoring.rst:28 +msgid "Callbacks" +msgstr "" + +#: ../../library/sys.monitoring.rst:33 +msgid "" +"A tool identifier is an integer and associated name. Tool identifiers are " +"used to discourage tools from interfering with each other and to allow " +"multiple tools to operate at the same time. Currently tools are completely " +"independent and cannot be used to monitor each other. This restriction may " +"be lifted in the future." +msgstr "" + +#: ../../library/sys.monitoring.rst:39 +msgid "" +"Before registering or activating events, a tool should choose an identifier. " +"Identifiers are integers in the range 0 to 5." +msgstr "" + +#: ../../library/sys.monitoring.rst:43 +msgid "Registering and using tools" +msgstr "" + +#: ../../library/sys.monitoring.rst:47 +msgid "" +"Must be called before ``id`` can be used. ``id`` must be in the range 0 to 5 " +"inclusive. Raises a ``ValueError`` if ``id`` is in use." +msgstr "" + +#: ../../library/sys.monitoring.rst:53 +msgid "Should be called once a tool no longer requires ``id``." +msgstr "" + +#: ../../library/sys.monitoring.rst:57 +msgid "" +"Returns the name of the tool if ``id`` is in use, otherwise it returns " +"``None``. ``id`` must be in the range 0 to 5 inclusive." +msgstr "" + +#: ../../library/sys.monitoring.rst:61 +msgid "" +"All IDs are treated the same by the VM with regard to events, but the " +"following IDs are pre-defined to make co-operation of tools easier::" +msgstr "" + +#: ../../library/sys.monitoring.rst:69 +msgid "" +"There is no obligation to set an ID, nor is there anything preventing a tool " +"from using an ID even it is already in use. However, tools are encouraged to " +"use a unique ID and respect other tools." +msgstr "" + +#: ../../library/sys.monitoring.rst:76 +msgid "The following events are supported:" +msgstr "" + +#: ../../library/sys.monitoring.rst:78 ../../library/sys.monitoring.rst:138 +msgid "BRANCH" +msgstr "" + +#: ../../library/sys.monitoring.rst:79 +msgid "A conditional branch is taken (or not)." +msgstr "" + +#: ../../library/sys.monitoring.rst:80 ../../library/sys.monitoring.rst:134 +msgid "CALL" +msgstr "" + +#: ../../library/sys.monitoring.rst:81 +msgid "A call in Python code (event occurs before the call)." +msgstr "" + +#: ../../library/sys.monitoring.rst:82 ../../library/sys.monitoring.rst:147 +msgid "C_RAISE" +msgstr "" + +#: ../../library/sys.monitoring.rst:83 +msgid "" +"Exception raised from any callable, except Python functions (event occurs " +"after the exit)." +msgstr "" + +#: ../../library/sys.monitoring.rst:84 ../../library/sys.monitoring.rst:148 +msgid "C_RETURN" +msgstr "" + +#: ../../library/sys.monitoring.rst:85 +msgid "" +"Return from any callable, except Python functions (event occurs after the " +"return)." +msgstr "" + +#: ../../library/sys.monitoring.rst:86 ../../library/sys.monitoring.rst:165 +msgid "EXCEPTION_HANDLED" +msgstr "" + +#: ../../library/sys.monitoring.rst:87 +msgid "An exception is handled." +msgstr "" + +#: ../../library/sys.monitoring.rst:88 ../../library/sys.monitoring.rst:136 +msgid "INSTRUCTION" +msgstr "" + +#: ../../library/sys.monitoring.rst:89 +msgid "A VM instruction is about to be executed." +msgstr "" + +#: ../../library/sys.monitoring.rst:90 ../../library/sys.monitoring.rst:137 +msgid "JUMP" +msgstr "" + +#: ../../library/sys.monitoring.rst:91 +msgid "An unconditional jump in the control flow graph is made." +msgstr "" + +#: ../../library/sys.monitoring.rst:92 ../../library/sys.monitoring.rst:135 +msgid "LINE" +msgstr "" + +#: ../../library/sys.monitoring.rst:93 +msgid "" +"An instruction is about to be executed that has a different line number from " +"the preceding instruction." +msgstr "" + +#: ../../library/sys.monitoring.rst:94 ../../library/sys.monitoring.rst:131 +msgid "PY_RESUME" +msgstr "" + +#: ../../library/sys.monitoring.rst:95 +msgid "" +"Resumption of a Python function (for generator and coroutine functions), " +"except for throw() calls." +msgstr "" + +#: ../../library/sys.monitoring.rst:96 ../../library/sys.monitoring.rst:132 +msgid "PY_RETURN" +msgstr "" + +#: ../../library/sys.monitoring.rst:97 +msgid "" +"Return from a Python function (occurs immediately before the return, the " +"callee's frame will be on the stack)." +msgstr "" + +#: ../../library/sys.monitoring.rst:98 ../../library/sys.monitoring.rst:130 +msgid "PY_START" +msgstr "" + +#: ../../library/sys.monitoring.rst:99 +msgid "" +"Start of a Python function (occurs immediately after the call, the callee's " +"frame will be on the stack)" +msgstr "" + +#: ../../library/sys.monitoring.rst:100 ../../library/sys.monitoring.rst:162 +msgid "PY_THROW" +msgstr "" + +#: ../../library/sys.monitoring.rst:101 +msgid "A Python function is resumed by a throw() call." +msgstr "" + +#: ../../library/sys.monitoring.rst:102 ../../library/sys.monitoring.rst:163 +msgid "PY_UNWIND" +msgstr "" + +#: ../../library/sys.monitoring.rst:103 +msgid "Exit from a Python function during exception unwinding." +msgstr "" + +#: ../../library/sys.monitoring.rst:104 ../../library/sys.monitoring.rst:133 +msgid "PY_YIELD" +msgstr "" + +#: ../../library/sys.monitoring.rst:105 +msgid "" +"Yield from a Python function (occurs immediately before the yield, the " +"callee's frame will be on the stack)." +msgstr "" + +#: ../../library/sys.monitoring.rst:106 ../../library/sys.monitoring.rst:164 +msgid "RAISE" +msgstr "" + +#: ../../library/sys.monitoring.rst:107 +msgid "" +"An exception is raised, except those that cause a ``STOP_ITERATION`` event." +msgstr "" + +#: ../../library/sys.monitoring.rst:108 +msgid "RERAISE" +msgstr "" + +#: ../../library/sys.monitoring.rst:109 +msgid "" +"An exception is re-raised, for example at the end of a ``finally`` block." +msgstr "" + +#: ../../library/sys.monitoring.rst:111 ../../library/sys.monitoring.rst:139 +msgid "STOP_ITERATION" +msgstr "" + +#: ../../library/sys.monitoring.rst:111 +msgid "" +"An artificial ``StopIteration`` is raised; see `the STOP_ITERATION event`_." +msgstr "" + +#: ../../library/sys.monitoring.rst:113 +msgid "More events may be added in the future." +msgstr "" + +#: ../../library/sys.monitoring.rst:115 +msgid "" +"These events are attributes of the :mod:`!sys.monitoring.events` namespace. " +"Each event is represented as a power-of-2 integer constant. To define a set " +"of events, simply bitwise or the individual events together. For example, to " +"specify both ``PY_RETURN`` and ``PY_START`` events, use the expression " +"``PY_RETURN | PY_START``." +msgstr "" + +#: ../../library/sys.monitoring.rst:121 +msgid "Events are divided into three groups:" +msgstr "" + +#: ../../library/sys.monitoring.rst:124 +msgid "Local events" +msgstr "" + +#: ../../library/sys.monitoring.rst:126 +msgid "" +"Local events are associated with normal execution of the program and happen " +"at clearly defined locations. All local events can be disabled. The local " +"events are:" +msgstr "" + +#: ../../library/sys.monitoring.rst:142 +msgid "Ancillary events" +msgstr "" + +#: ../../library/sys.monitoring.rst:144 +msgid "" +"Ancillary events can be monitored like other events, but are controlled by " +"another event:" +msgstr "" + +#: ../../library/sys.monitoring.rst:150 +msgid "" +"The ``C_RETURN`` and ``C_RAISE`` events are are controlled by the ``CALL`` " +"event. ``C_RETURN`` and ``C_RAISE`` events will only be seen if the " +"corresponding ``CALL`` event is being monitored." +msgstr "" + +#: ../../library/sys.monitoring.rst:155 +msgid "Other events" +msgstr "" + +#: ../../library/sys.monitoring.rst:157 +msgid "" +"Other events are not necessarily tied to a specific location in the program " +"and cannot be individually disabled." +msgstr "" + +#: ../../library/sys.monitoring.rst:160 +msgid "The other events that can be monitored are:" +msgstr "" + +#: ../../library/sys.monitoring.rst:169 +msgid "The STOP_ITERATION event" +msgstr "" + +#: ../../library/sys.monitoring.rst:171 +msgid "" +":pep:`PEP 380 <380#use-of-stopiteration-to-return-values>` specifies that a " +"``StopIteration`` exception is raised when returning a value from a " +"generator or coroutine. However, this is a very inefficient way to return a " +"value, so some Python implementations, notably CPython 3.12+, do not raise " +"an exception unless it would be visible to other code." +msgstr "" + +#: ../../library/sys.monitoring.rst:177 +msgid "" +"To allow tools to monitor for real exceptions without slowing down " +"generators and coroutines, the ``STOP_ITERATION`` event is provided. " +"``STOP_ITERATION`` can be locally disabled, unlike ``RAISE``." +msgstr "" + +#: ../../library/sys.monitoring.rst:183 +msgid "Turning events on and off" +msgstr "" + +#: ../../library/sys.monitoring.rst:185 +msgid "" +"In order to monitor an event, it must be turned on and a callback " +"registered. Events can be turned on or off by setting the events either " +"globally or for a particular code object." +msgstr "" + +#: ../../library/sys.monitoring.rst:191 +msgid "Setting events globally" +msgstr "" + +#: ../../library/sys.monitoring.rst:193 +msgid "" +"Events can be controlled globally by modifying the set of events being " +"monitored." +msgstr "" + +#: ../../library/sys.monitoring.rst:197 +msgid "Returns the ``int`` representing all the active events." +msgstr "" + +#: ../../library/sys.monitoring.rst:201 +msgid "" +"Activates all events which are set in ``event_set``. Raises a ``ValueError`` " +"if ``tool_id`` is not in use." +msgstr "" + +#: ../../library/sys.monitoring.rst:204 +msgid "No events are active by default." +msgstr "" + +#: ../../library/sys.monitoring.rst:207 +msgid "Per code object events" +msgstr "" + +#: ../../library/sys.monitoring.rst:209 +msgid "Events can also be controlled on a per code object basis." +msgstr "" + +#: ../../library/sys.monitoring.rst:213 +msgid "Returns all the local events for ``code``" +msgstr "" + +#: ../../library/sys.monitoring.rst:217 +msgid "" +"Activates all the local events for ``code`` which are set in ``event_set``. " +"Raises a ``ValueError`` if ``tool_id`` is not in use." +msgstr "" + +#: ../../library/sys.monitoring.rst:220 +msgid "" +"Local events add to global events, but do not mask them. In other words, all " +"global events will trigger for a code object, regardless of the local events." +msgstr "" + +#: ../../library/sys.monitoring.rst:226 +msgid "Disabling events" +msgstr "" + +#: ../../library/sys.monitoring.rst:228 +msgid "" +"Local events can be disabled for a specific code location by returning ``sys." +"monitoring.DISABLE`` from a callback function. This does not change which " +"events are set, or any other code locations for the same event." +msgstr "" + +#: ../../library/sys.monitoring.rst:232 +msgid "" +"Disabling events for specific locations is very important for high " +"performance monitoring. For example, a program can be run under a debugger " +"with no overhead if the debugger disables all monitoring except for a few " +"breakpoints." +msgstr "" + +#: ../../library/sys.monitoring.rst:239 +msgid "Registering callback functions" +msgstr "" + +#: ../../library/sys.monitoring.rst:241 +msgid "To register a callable for events call" +msgstr "" + +#: ../../library/sys.monitoring.rst:245 +msgid "" +"Registers the callable ``func`` for the ``event`` with the given ``tool_id``" +msgstr "" + +#: ../../library/sys.monitoring.rst:247 +msgid "" +"If another callback was registered for the given ``tool_id`` and ``event``, " +"it is unregistered and returned. Otherwise ``register_callback`` returns " +"``None``." +msgstr "" + +#: ../../library/sys.monitoring.rst:252 +msgid "" +"Functions can be unregistered by calling ``sys.monitoring." +"register_callback(tool_id, event, None)``." +msgstr "" + +#: ../../library/sys.monitoring.rst:255 +msgid "Callback functions can be registered and unregistered at any time." +msgstr "" + +#: ../../library/sys.monitoring.rst:257 +msgid "" +"Registering or unregistering a callback function will generate a ``sys." +"audit`` event." +msgstr "" + +#: ../../library/sys.monitoring.rst:261 +msgid "Callback function arguments" +msgstr "" + +#: ../../library/sys.monitoring.rst:263 +msgid "" +"When an active event occurs, the registered callback function is called. " +"Different events will provide the callback function with different " +"arguments, as follows:" +msgstr "" + +#: ../../library/sys.monitoring.rst:266 +msgid "``PY_START`` and ``PY_RESUME``::" +msgstr "" + +#: ../../library/sys.monitoring.rst:270 +msgid "``PY_RETURN`` and ``PY_YIELD``:" +msgstr "" + +#: ../../library/sys.monitoring.rst:272 +msgid "" +"``func(code: CodeType, instruction_offset: int, retval: object) -> DISABLE | " +"Any``" +msgstr "" + +#: ../../library/sys.monitoring.rst:274 +msgid "``CALL``, ``C_RAISE`` and ``C_RETURN``:" +msgstr "" + +#: ../../library/sys.monitoring.rst:276 +msgid "" +"``func(code: CodeType, instruction_offset: int, callable: object, arg0: " +"object | MISSING) -> DISABLE | Any``" +msgstr "" + +#: ../../library/sys.monitoring.rst:278 +msgid "If there are no arguments, ``arg0`` is set to ``MISSING``." +msgstr "" + +#: ../../library/sys.monitoring.rst:280 +msgid "" +"``RAISE``, ``RERAISE``, ``EXCEPTION_HANDLED``, ``PY_UNWIND``, ``PY_THROW`` " +"and ``STOP_ITERATION``:" +msgstr "" + +#: ../../library/sys.monitoring.rst:282 +msgid "" +"``func(code: CodeType, instruction_offset: int, exception: BaseException) -> " +"DISABLE | Any``" +msgstr "" + +#: ../../library/sys.monitoring.rst:284 +msgid "``LINE``:" +msgstr "" + +#: ../../library/sys.monitoring.rst:286 +msgid "``func(code: CodeType, line_number: int) -> DISABLE | Any``" +msgstr "" + +#: ../../library/sys.monitoring.rst:288 +msgid "``BRANCH`` and ``JUMP``:" +msgstr "" + +#: ../../library/sys.monitoring.rst:290 +msgid "" +"``func(code: CodeType, instruction_offset: int, destination_offset: int) -> " +"DISABLE | Any``" +msgstr "" + +#: ../../library/sys.monitoring.rst:292 +msgid "" +"Note that the ``destination_offset`` is where the code will next execute. " +"For an untaken branch this will be the offset of the instruction following " +"the branch." +msgstr "" + +#: ../../library/sys.monitoring.rst:296 +msgid "``INSTRUCTION``:" +msgstr "" + +#: ../../library/sys.monitoring.rst:298 +msgid "``func(code: CodeType, instruction_offset: int) -> DISABLE | Any``" +msgstr "" diff --git a/library/sys.po b/library/sys.po index bf8dcc3cde..0b47041954 100644 --- a/library/sys.po +++ b/library/sys.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-21 00:03+0000\n" +"POT-Creation-Date: 2023-09-09 00:03+0000\n" "PO-Revision-Date: 2023-04-26 02:54+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -471,13 +471,13 @@ msgstr "" #: ../../library/sys.rst:381 msgid "" -"When an exception is raised and uncaught, the interpreter calls ``sys." -"excepthook`` with three arguments, the exception class, exception instance, " -"and a traceback object. In an interactive session this happens just before " -"control is returned to the prompt; in a Python program this happens just " -"before the program exits. The handling of such top-level exceptions can be " -"customized by assigning another three-argument function to ``sys." -"excepthook``." +"When an exception other than :exc:`SystemExit` is raised and uncaught, the " +"interpreter calls ``sys.excepthook`` with three arguments, the exception " +"class, exception instance, and a traceback object. In an interactive " +"session this happens just before control is returned to the prompt; in a " +"Python program this happens just before the program exits. The handling of " +"such top-level exceptions can be customized by assigning another three-" +"argument function to ``sys.excepthook``." msgstr "" #: ../../library/sys.rst:388 @@ -2532,25 +2532,31 @@ msgid "" "has no effect on the registry keys used by Python." msgstr "" -#: ../../library/sys.rst:1958 +#: ../../library/sys.rst:1959 +msgid "" +"Namespace containing functions and constants for register callbacks and " +"controlling monitoring events. See :mod:`sys.monitoring` for details." +msgstr "" + +#: ../../library/sys.rst:1965 msgid "" "A dictionary of the various implementation-specific flags passed through " "the :option:`-X` command-line option. Option names are either mapped to " "their values, if given explicitly, or to :const:`True`. Example:" msgstr "" -#: ../../library/sys.rst:1974 +#: ../../library/sys.rst:1981 msgid "" "This is a CPython-specific way of accessing options passed through :option:`-" "X`. Other implementations may export them through other means, or not at " "all." msgstr "" -#: ../../library/sys.rst:1982 +#: ../../library/sys.rst:1989 msgid "Citations" msgstr "引用" -#: ../../library/sys.rst:1983 +#: ../../library/sys.rst:1990 msgid "" "ISO/IEC 9899:1999. \"Programming languages -- C.\" A public draft of this " "standard is available at https://www.open-std.org/jtc1/sc22/wg14/www/docs/" diff --git a/library/threading.po b/library/threading.po index 992f2849f1..2d8aba54e4 100644 --- a/library/threading.po +++ b/library/threading.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-09-01 00:03+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-" @@ -346,7 +346,7 @@ msgstr "" #: ../../library/threading.rst:274 msgid "" "For more details and extensive examples, see the documentation string of " -"the :mod:`_threading_local` module: :source:`Lib/_threading_local.py`." +"the :mod:`!_threading_local` module: :source:`Lib/_threading_local.py`." msgstr "" #: ../../library/threading.rst:281 @@ -359,8 +359,8 @@ msgid "" "thread of control. There are two ways to specify the activity: by passing a " "callable object to the constructor, or by overriding the :meth:`~Thread.run` " "method in a subclass. No other methods (except for the constructor) should " -"be overridden in a subclass. In other words, *only* override the :meth:" -"`~Thread.__init__` and :meth:`~Thread.run` methods of this class." +"be overridden in a subclass. In other words, *only* override the " +"``__init__()`` and :meth:`~Thread.run` methods of this class." msgstr "" #: ../../library/threading.rst:290 @@ -440,8 +440,8 @@ msgstr "" #: ../../library/threading.rst:339 msgid "" -"*group* should be ``None``; reserved for future extension when a :class:" -"`ThreadGroup` class is implemented." +"*group* should be ``None``; reserved for future extension when a :class:`!" +"ThreadGroup` class is implemented." msgstr "" #: ../../library/threading.rst:342 @@ -1282,11 +1282,11 @@ msgstr "" #: ../../library/threading.rst:1012 msgid "" -"Timers are started, as with threads, by calling their :meth:`~Timer.start` " -"method. The timer can be stopped (before its action has begun) by calling " -"the :meth:`~Timer.cancel` method. The interval the timer will wait before " -"executing its action may not be exactly the same as the interval specified " -"by the user." +"Timers are started, as with threads, by calling their :meth:`Timer.start " +"` method. The timer can be stopped (before its action has " +"begun) by calling the :meth:`~Timer.cancel` method. The interval the timer " +"will wait before executing its action may not be exactly the same as the " +"interval specified by the user." msgstr "" #: ../../library/threading.rst:1018 @@ -1426,11 +1426,11 @@ msgstr "" #: ../../library/threading.rst:1150 msgid "" -"All of the objects provided by this module that have :meth:`acquire` and :" -"meth:`release` methods can be used as context managers for a :keyword:`with` " -"statement. The :meth:`acquire` method will be called when the block is " -"entered, and :meth:`release` will be called when the block is exited. " -"Hence, the following snippet::" +"All of the objects provided by this module that have ``acquire`` and " +"``release`` methods can be used as context managers for a :keyword:`with` " +"statement. The ``acquire`` method will be called when the block is entered, " +"and ``release`` will be called when the block is exited. Hence, the " +"following snippet::" msgstr "" #: ../../library/threading.rst:1159 diff --git a/library/tkinter.po b/library/tkinter.po index 30c7155ee1..8b8ad0bd3e 100644 --- a/library/tkinter.po +++ b/library/tkinter.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-08-29 12:27+0000\n" "PO-Revision-Date: 2018-05-23 16:13+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -650,7 +650,7 @@ msgstr "" msgid "" "When your application uses Tkinter's classes and methods, internally Tkinter " "is assembling strings representing Tcl/Tk commands, and executing those " -"commands in the Tcl interpreter attached to your applicaton's :class:`Tk` " +"commands in the Tcl interpreter attached to your application's :class:`Tk` " "instance." msgstr "" diff --git a/library/traceback.po b/library/traceback.po index 775bdb77a3..98b2965651 100644 --- a/library/traceback.po +++ b/library/traceback.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-09-14 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:13+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -117,7 +117,7 @@ msgid "" "exception." msgstr "" -#: ../../library/traceback.rst:73 ../../library/traceback.rst:165 +#: ../../library/traceback.rst:73 ../../library/traceback.rst:168 msgid "The *etype* argument is ignored and inferred from the type of *value*." msgstr "" @@ -183,11 +183,11 @@ msgstr "" msgid "" "Format the exception part of a traceback using an exception value such as " "given by ``sys.last_value``. The return value is a list of strings, each " -"ending in a newline. Normally, the list contains a single string; however, " -"for :exc:`SyntaxError` exceptions, it contains several lines that (when " -"printed) display detailed information about where the syntax error occurred. " -"The message indicating which exception occurred is the always last string in " -"the list." +"ending in a newline. The list contains the exception's message, which is " +"normally a single string; however, for :exc:`SyntaxError` exceptions, it " +"contains several lines that (when printed) display detailed information " +"about where the syntax error occurred. Following the message, the list " +"contains the exception's :attr:`notes `." msgstr "" #: ../../library/traceback.rst:148 @@ -197,7 +197,11 @@ msgid "" "ignored in order to provide backwards compatibility." msgstr "" -#: ../../library/traceback.rst:159 +#: ../../library/traceback.rst:156 +msgid "The returned list now includes any notes attached to the exception." +msgstr "" + +#: ../../library/traceback.rst:162 msgid "" "Format a stack trace and the exception information. The arguments have the " "same meaning as the corresponding arguments to :func:`print_exception`. The " @@ -206,66 +210,66 @@ msgid "" "printed, exactly the same text is printed as does :func:`print_exception`." msgstr "" -#: ../../library/traceback.rst:168 +#: ../../library/traceback.rst:171 msgid "" "This function's behavior and signature were modified to match :func:" "`print_exception`." msgstr "" -#: ../../library/traceback.rst:175 +#: ../../library/traceback.rst:178 msgid "" "This is like ``print_exc(limit)`` but returns a string instead of printing " "to a file." msgstr "" -#: ../../library/traceback.rst:181 +#: ../../library/traceback.rst:184 msgid "A shorthand for ``format_list(extract_tb(tb, limit))``." msgstr "" -#: ../../library/traceback.rst:186 +#: ../../library/traceback.rst:189 msgid "A shorthand for ``format_list(extract_stack(f, limit))``." msgstr "" -#: ../../library/traceback.rst:190 +#: ../../library/traceback.rst:193 msgid "" "Clears the local variables of all the stack frames in a traceback *tb* by " "calling the :meth:`clear` method of each frame object." msgstr "" -#: ../../library/traceback.rst:197 +#: ../../library/traceback.rst:200 msgid "" "Walk a stack following ``f.f_back`` from the given frame, yielding the frame " "and line number for each frame. If *f* is ``None``, the current stack is " "used. This helper is used with :meth:`StackSummary.extract`." msgstr "" -#: ../../library/traceback.rst:205 +#: ../../library/traceback.rst:208 msgid "" "Walk a traceback following ``tb_next`` yielding the frame and line number " "for each frame. This helper is used with :meth:`StackSummary.extract`." msgstr "" -#: ../../library/traceback.rst:210 +#: ../../library/traceback.rst:213 msgid "The module also defines the following classes:" msgstr "" -#: ../../library/traceback.rst:213 +#: ../../library/traceback.rst:216 msgid ":class:`TracebackException` Objects" msgstr ":class:`TracebackException` 物件" -#: ../../library/traceback.rst:217 +#: ../../library/traceback.rst:220 msgid "" ":class:`TracebackException` objects are created from actual exceptions to " "capture data for later printing in a lightweight fashion." msgstr "" -#: ../../library/traceback.rst:222 ../../library/traceback.rst:310 +#: ../../library/traceback.rst:225 ../../library/traceback.rst:319 msgid "" "Capture an exception for later rendering. *limit*, *lookup_lines* and " "*capture_locals* are as for the :class:`StackSummary` class." msgstr "" -#: ../../library/traceback.rst:225 +#: ../../library/traceback.rst:228 msgid "" "If *compact* is true, only data that is required by :class:" "`TracebackException`'s ``format`` method is saved in the class attributes. " @@ -273,12 +277,12 @@ msgid "" "is ``None`` and ``__suppress_context__`` is false." msgstr "" -#: ../../library/traceback.rst:230 ../../library/traceback.rst:313 +#: ../../library/traceback.rst:233 ../../library/traceback.rst:322 msgid "" "Note that when locals are captured, they are also shown in the traceback." msgstr "" -#: ../../library/traceback.rst:232 +#: ../../library/traceback.rst:235 msgid "" "*max_group_width* and *max_group_depth* control the formatting of exception " "groups (see :exc:`BaseExceptionGroup`). The depth refers to the nesting " @@ -287,140 +291,139 @@ msgid "" "limit is exceeded." msgstr "" -#: ../../library/traceback.rst:240 +#: ../../library/traceback.rst:241 +msgid "Added the *compact* parameter." +msgstr "新增 *compact* 參數。" + +#: ../../library/traceback.rst:244 +msgid "Added the *max_group_width* and *max_group_depth* parameters." +msgstr "新增 *max_group_width* 和 *max_group_depth* 參數。" + +#: ../../library/traceback.rst:249 msgid "A :class:`TracebackException` of the original ``__cause__``." msgstr "" -#: ../../library/traceback.rst:244 +#: ../../library/traceback.rst:253 msgid "A :class:`TracebackException` of the original ``__context__``." msgstr "" -#: ../../library/traceback.rst:248 +#: ../../library/traceback.rst:257 msgid "" "If ``self`` represents an :exc:`ExceptionGroup`, this field holds a list of :" "class:`TracebackException` instances representing the nested exceptions. " "Otherwise it is ``None``." msgstr "" -#: ../../library/traceback.rst:256 +#: ../../library/traceback.rst:265 msgid "The ``__suppress_context__`` value from the original exception." msgstr "" -#: ../../library/traceback.rst:260 +#: ../../library/traceback.rst:269 msgid "" "The ``__notes__`` value from the original exception, or ``None`` if the " "exception does not have any notes. If it is not ``None`` is it formatted in " "the traceback after the exception string." msgstr "" -#: ../../library/traceback.rst:268 +#: ../../library/traceback.rst:277 msgid "A :class:`StackSummary` representing the traceback." msgstr "" -#: ../../library/traceback.rst:272 +#: ../../library/traceback.rst:281 msgid "The class of the original traceback." msgstr "" -#: ../../library/traceback.rst:276 +#: ../../library/traceback.rst:285 msgid "For syntax errors - the file name where the error occurred." msgstr "" -#: ../../library/traceback.rst:280 +#: ../../library/traceback.rst:289 msgid "For syntax errors - the line number where the error occurred." msgstr "" -#: ../../library/traceback.rst:284 +#: ../../library/traceback.rst:293 msgid "" "For syntax errors - the end line number where the error occurred. Can be " "``None`` if not present." msgstr "" -#: ../../library/traceback.rst:291 +#: ../../library/traceback.rst:300 msgid "For syntax errors - the text where the error occurred." msgstr "" -#: ../../library/traceback.rst:295 +#: ../../library/traceback.rst:304 msgid "For syntax errors - the offset into the text where the error occurred." msgstr "" -#: ../../library/traceback.rst:299 +#: ../../library/traceback.rst:308 msgid "" "For syntax errors - the end offset into the text where the error occurred. " "Can be ``None`` if not present." msgstr "" -#: ../../library/traceback.rst:306 +#: ../../library/traceback.rst:315 msgid "For syntax errors - the compiler error message." msgstr "" -#: ../../library/traceback.rst:317 +#: ../../library/traceback.rst:326 msgid "" "Print to *file* (default ``sys.stderr``) the exception information returned " "by :meth:`format`." msgstr "" -#: ../../library/traceback.rst:324 +#: ../../library/traceback.rst:333 msgid "Format the exception." msgstr "" -#: ../../library/traceback.rst:326 +#: ../../library/traceback.rst:335 msgid "" "If *chain* is not ``True``, ``__cause__`` and ``__context__`` will not be " "formatted." msgstr "" -#: ../../library/traceback.rst:329 +#: ../../library/traceback.rst:338 msgid "" "The return value is a generator of strings, each ending in a newline and " "some containing internal newlines. :func:`~traceback.print_exception` is a " "wrapper around this method which just prints the lines to a file." msgstr "" -#: ../../library/traceback.rst:333 ../../library/traceback.rst:347 -msgid "" -"The message indicating which exception occurred is always the last string in " -"the output." -msgstr "" - -#: ../../library/traceback.rst:338 +#: ../../library/traceback.rst:344 msgid "Format the exception part of the traceback." msgstr "" -#: ../../library/traceback.rst:340 +#: ../../library/traceback.rst:346 msgid "The return value is a generator of strings, each ending in a newline." msgstr "" -#: ../../library/traceback.rst:342 +#: ../../library/traceback.rst:348 msgid "" -"Normally, the generator emits a single string; however, for :exc:" -"`SyntaxError` exceptions, it emits several lines that (when printed) display " -"detailed information about where the syntax error occurred." +"The generator emits the exception's message followed by its notes (if it has " +"any). The exception message is normally a single string; however, for :exc:" +"`SyntaxError` exceptions, it consists of several lines that (when printed) " +"display detailed information about where the syntax error occurred." msgstr "" -#: ../../library/traceback.rst:350 -msgid "Added the *compact* parameter." -msgstr "新增 *compact* 參數。" - -#: ../../library/traceback.rst:353 -msgid "Added the *max_group_width* and *max_group_depth* parameters." -msgstr "新增 *max_group_width* 和 *max_group_depth* 參數。" +#: ../../library/traceback.rst:354 +msgid "The exception's notes are now included in the output." +msgstr "" -#: ../../library/traceback.rst:358 +#: ../../library/traceback.rst:360 msgid ":class:`StackSummary` Objects" msgstr ":class:`StackSummary` 物件" -#: ../../library/traceback.rst:362 +#: ../../library/traceback.rst:364 msgid "" ":class:`StackSummary` objects represent a call stack ready for formatting." msgstr "" -#: ../../library/traceback.rst:368 +#: ../../library/traceback.rst:370 msgid "" "Construct a :class:`StackSummary` object from a frame generator (such as is " "returned by :func:`~traceback.walk_stack` or :func:`~traceback.walk_tb`)." msgstr "" -#: ../../library/traceback.rst:372 +#: ../../library/traceback.rst:374 msgid "" "If *limit* is supplied, only this many frames are taken from *frame_gen*. If " "*lookup_lines* is ``False``, the returned :class:`FrameSummary` objects will " @@ -430,20 +433,20 @@ msgid "" "class:`FrameSummary` are captured as object representations." msgstr "" -#: ../../library/traceback.rst:380 +#: ../../library/traceback.rst:382 msgid "" "Exceptions raised from :func:`repr` on a local variable (when " "*capture_locals* is ``True``) are no longer propagated to the caller." msgstr "" -#: ../../library/traceback.rst:386 +#: ../../library/traceback.rst:388 msgid "" "Construct a :class:`StackSummary` object from a supplied list of :class:" "`FrameSummary` objects or old-style list of tuples. Each tuple should be a " "4-tuple with filename, lineno, name, line as the elements." msgstr "" -#: ../../library/traceback.rst:392 +#: ../../library/traceback.rst:394 msgid "" "Returns a list of strings ready for printing. Each string in the resulting " "list corresponds to a single frame from the stack. Each string ends in a " @@ -451,18 +454,18 @@ msgid "" "with source text lines." msgstr "" -#: ../../library/traceback.rst:397 +#: ../../library/traceback.rst:399 msgid "" "For long sequences of the same frame and line, the first few repetitions are " "shown, followed by a summary line stating the exact number of further " "repetitions." msgstr "" -#: ../../library/traceback.rst:401 +#: ../../library/traceback.rst:403 msgid "Long sequences of repeated frames are now abbreviated." msgstr "" -#: ../../library/traceback.rst:406 +#: ../../library/traceback.rst:408 msgid "" "Returns a string for printing one of the frames involved in the stack. This " "method is called for each :class:`FrameSummary` object to be printed by :" @@ -470,16 +473,16 @@ msgid "" "from the output." msgstr "" -#: ../../library/traceback.rst:415 +#: ../../library/traceback.rst:417 msgid ":class:`FrameSummary` Objects" msgstr ":class:`FrameSummary` 物件" -#: ../../library/traceback.rst:419 +#: ../../library/traceback.rst:421 msgid "" "A :class:`FrameSummary` object represents a single frame in a traceback." msgstr "" -#: ../../library/traceback.rst:423 +#: ../../library/traceback.rst:425 msgid "" "Represent a single frame in the traceback or stack that is being formatted " "or printed. It may optionally have a stringified version of the frames " @@ -492,11 +495,11 @@ msgid "" "display." msgstr "" -#: ../../library/traceback.rst:436 +#: ../../library/traceback.rst:438 msgid "Traceback Examples" msgstr "" -#: ../../library/traceback.rst:438 +#: ../../library/traceback.rst:440 msgid "" "This simple example implements a basic read-eval-print loop, similar to (but " "less useful than) the standard Python interactive interpreter loop. For a " @@ -504,23 +507,23 @@ msgid "" "`code` module. ::" msgstr "" -#: ../../library/traceback.rst:460 +#: ../../library/traceback.rst:462 msgid "" "The following example demonstrates the different ways to print and format " "the exception and traceback:" msgstr "" -#: ../../library/traceback.rst:495 +#: ../../library/traceback.rst:497 msgid "The output for the example would look similar to this:" msgstr "" -#: ../../library/traceback.rst:537 +#: ../../library/traceback.rst:539 msgid "" "The following example shows the different ways to print and format the " "stack::" msgstr "" -#: ../../library/traceback.rst:563 +#: ../../library/traceback.rst:565 msgid "This last example demonstrates the final few formatting functions:" msgstr "" diff --git a/library/turtle.po b/library/turtle.po index 6cba6b1450..718deff5da 100644 --- a/library/turtle.po +++ b/library/turtle.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-28 00:03+0000\n" +"POT-Creation-Date: 2023-09-15 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:13+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2117,7 +2117,7 @@ msgstr "" #: ../../library/turtle.rst:2332 msgid "" -"a :class:`tkinter.Canvas`, a :class:`ScrolledCanvas` or a :class:" +"a :class:`!tkinter.Canvas`, a :class:`ScrolledCanvas` or a :class:" "`TurtleScreen`" msgstr "" @@ -2134,7 +2134,7 @@ msgid "" msgstr "" #: ../../library/turtle.rst:2347 -msgid "a :class:`tkinter.Canvas`" +msgid "a :class:`!tkinter.Canvas`" msgstr "" #: ../../library/turtle.rst:2349 @@ -2280,7 +2280,7 @@ msgstr "" msgid "" "``Turtle`` is a subclass of :class:`RawTurtle`, which *doesn't* " "automatically create a drawing surface - a *canvas* will need to be provided " -"or created for it. The *canvas* can be a :class:`tkinter.Canvas`, :class:" +"or created for it. The *canvas* can be a :class:`!tkinter.Canvas`, :class:" "`ScrolledCanvas` or :class:`TurtleScreen`." msgstr "" @@ -2290,7 +2290,7 @@ msgid "" "`Screen` is a subclass of ``TurtleScreen``, and includes :ref:`some " "additional methods ` for managing its appearance (including " "size and title) and behaviour. ``TurtleScreen``'s constructor needs a :class:" -"`tkinter.Canvas` or a :class:`ScrolledCanvas` as an argument." +"`!tkinter.Canvas` or a :class:`ScrolledCanvas` as an argument." msgstr "" #: ../../library/turtle.rst:2442 diff --git a/library/typing.po b/library/typing.po index 3d666e2c27..5a8c520a50 100644 --- a/library/typing.po +++ b/library/typing.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-27 00:19+0000\n" +"POT-Creation-Date: 2023-09-11 00:03+0000\n" "PO-Revision-Date: 2023-09-05 14:49+0800\n" "Last-Translator: RockLeon \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -42,8 +42,8 @@ msgid "" "specification of the typing system, see :pep:`484`. For a simplified " "introduction to type hints, see :pep:`483`." msgstr "" -"這個模組提供可以支援型別提示的 runtime。關於加註型別系統的原有規格" -",請看 :pep:`484`。關於型別提示的簡易介紹,請看 :pep:`483`。" +"這個模組提供可以支援型別提示的 runtime。關於加註型別系統的原有規格,請看 :" +"pep:`484`。關於型別提示的簡易介紹,請看 :pep:`483`。" #: ../../library/typing.rst:31 msgid "" @@ -103,8 +103,8 @@ msgid "" "broadly apply to most Python type checkers. (Some parts may still be " "specific to mypy.)" msgstr "" -"Python 的加註型別系統是基於 PEPs 進行標準化,所以這個參照 (reference) " -"應該在多數 Python 型別檢查器中廣為使用。(某些部分依然是特定給 mypy 使用。)" +"Python 的加註型別系統是基於 PEPs 進行標準化,所以這個參照 (reference) 應該在" +"多數 Python 型別檢查器中廣為使用。(某些部分依然是特定給 mypy 使用。)" #: ../../library/typing.rst:59 msgid "" @@ -437,11 +437,11 @@ msgid "" "Python 3.9." msgstr "" -#: ../../library/typing.rst:249 -msgid "Callable" +#: ../../library/typing.rst:264 +msgid "Annotating callable objects" msgstr "" -#: ../../library/typing.rst:251 +#: ../../library/typing.rst:266 msgid "" "Functions -- or other :term:`callable` objects -- can be annotated using :" "class:`collections.abc.Callable` or :data:`typing.Callable`. " @@ -449,11 +449,12 @@ msgid "" "of type :class:`int` and returns a :class:`str`." msgstr "" -#: ../../library/typing.rst:254 ../../library/typing.rst:2679 +#: ../../library/typing.rst:271 ../../library/typing.rst:2873 +#: ../../library/typing.rst:3015 msgid "For example:" msgstr "舉例來說:" -#: ../../library/typing.rst:272 ../../library/typing.rst:995 +#: ../../library/typing.rst:289 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 " @@ -461,7 +462,22 @@ msgid "" "type must be a single type." msgstr "" -#: ../../library/typing.rst:276 ../../library/typing.rst:1008 +#: ../../library/typing.rst:294 +msgid "" +"If a literal ellipsis ``...`` is given as the argument list, it indicates " +"that a callable with any arbitrary parameter list would be acceptable:" +msgstr "" + +#: ../../library/typing.rst:306 +msgid "" +"``Callable`` cannot express complex signatures such as functions that take a " +"variadic number of arguments, :func:`overloaded functions `, or " +"functions that have keyword-only parameters. However, these signatures can " +"be expressed by defining a :class:`Protocol` class with a :meth:`~object." +"__call__` method:" +msgstr "" + +#: ../../library/typing.rst:333 msgid "" "Callables which take other callables as arguments may indicate that their " "parameter types are dependent on each other using :class:`ParamSpec`. " @@ -472,46 +488,54 @@ msgid "" "ReturnType]`` respectively." msgstr "" -#: ../../library/typing.rst:284 ../../library/typing.rst:1020 +#: ../../library/typing.rst:341 ../../library/typing.rst:3544 msgid "" "``Callable`` now supports :class:`ParamSpec` and :data:`Concatenate`. See :" "pep:`612` for more details." msgstr "" -#: ../../library/typing.rst:289 +#: ../../library/typing.rst:346 msgid "" "The documentation for :class:`ParamSpec` and :class:`Concatenate` provides " "examples of usage in ``Callable``." msgstr "" -#: ../../library/typing.rst:295 +#: ../../library/typing.rst:352 msgid "Generics" msgstr "" -#: ../../library/typing.rst:297 +#: ../../library/typing.rst:354 msgid "" "Since type information about objects kept in containers cannot be statically " "inferred in a generic way, many container classes in the standard library " "support subscription to denote the expected types of container elements." msgstr "" -#: ../../library/typing.rst:314 +#: ../../library/typing.rst:371 msgid "" "Generic functions and classes can be parameterized by using :ref:`type " "parameter syntax `::" msgstr "" -#: ../../library/typing.rst:330 +#: ../../library/typing.rst:379 +msgid "Or by using the :class:`TypeVar` factory directly::" +msgstr "" + +#: ../../library/typing.rst:389 +msgid "Syntactic support for generics is new in Python 3.12." +msgstr "" + +#: ../../library/typing.rst:395 msgid "Annotating tuples" msgstr "" -#: ../../library/typing.rst:332 +#: ../../library/typing.rst:397 msgid "" "For most containers in Python, the typing system assumes that all elements " "in the container will be of the same type. For example::" msgstr "" -#: ../../library/typing.rst:347 +#: ../../library/typing.rst:412 msgid "" ":class:`list` only accepts one type argument, so a type checker would emit " "an error on the ``y`` assignment above. Similarly, :class:`~collections.abc." @@ -519,7 +543,7 @@ msgid "" "the keys, and the second indicates the type of the values." msgstr "" -#: ../../library/typing.rst:353 +#: ../../library/typing.rst:418 msgid "" "Unlike most other Python containers, however, it is common in idiomatic " "Python code for tuples to have elements which are not all of the same type. " @@ -527,7 +551,7 @@ msgid "" "`tuple` accepts *any number* of type arguments::" msgstr "" -#: ../../library/typing.rst:369 +#: ../../library/typing.rst:434 msgid "" "To denote a tuple which could be of *any* length, and in which all elements " "are of the same type ``T``, use ``tuple[T, ...]``. To denote an empty tuple, " @@ -535,11 +559,11 @@ msgid "" "using ``tuple[Any, ...]``::" msgstr "" -#: ../../library/typing.rst:392 +#: ../../library/typing.rst:457 msgid "The type of class objects" msgstr "" -#: ../../library/typing.rst:394 +#: ../../library/typing.rst:459 msgid "" "A variable annotated with ``C`` may accept a value of type ``C``. In " "contrast, a variable annotated with ``type[C]`` (or :class:`typing.Type[C] " @@ -547,85 +571,104 @@ msgid "" "will accept the *class object* of ``C``. For example::" msgstr "" -#: ../../library/typing.rst:404 +#: ../../library/typing.rst:469 msgid "Note that ``type[C]`` is covariant::" msgstr "" -#: ../../library/typing.rst:420 +#: ../../library/typing.rst:485 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:432 +#: ../../library/typing.rst:497 msgid "" "``type[Any]`` is equivalent to :class:`type`, which is the root of Python's :" "ref:`metaclass hierarchy `." msgstr "" -#: ../../library/typing.rst:438 +#: ../../library/typing.rst:503 msgid "User-defined generic types" msgstr "" -#: ../../library/typing.rst:440 +#: ../../library/typing.rst:505 msgid "A user-defined class can be defined as a generic class." msgstr "" -#: ../../library/typing.rst:466 +#: ../../library/typing.rst:528 msgid "" "This syntax indicates that the class ``LoggedVar`` is parameterised around a " "single :class:`type variable ` ``T`` . This also makes ``T`` valid " "as a type within the class body." msgstr "" -#: ../../library/typing.rst:470 +#: ../../library/typing.rst:532 msgid "" "Generic classes implicitly inherit from :class:`Generic`. For compatibility " "with Python 3.11 and lower, it is also possible to inherit explicitly from :" "class:`Generic` to indicate a generic class::" msgstr "" -#: ../../library/typing.rst:479 +#: ../../library/typing.rst:543 +msgid "" +"Generic classes have :meth:`~object.__class_getitem__` methods, meaning they " +"can be parameterised at runtime (e.g. ``LoggedVar[int]`` below)::" +msgstr "" + +#: ../../library/typing.rst:552 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:491 +#: ../../library/typing.rst:567 msgid "" "Each type variable argument to :class:`Generic` must be distinct. This is " "thus invalid::" msgstr "" -#: ../../library/typing.rst:502 -msgid "You can use multiple inheritance with :class:`Generic`::" +#: ../../library/typing.rst:581 +msgid "Generic classes can also inherit from other classes::" msgstr "" -#: ../../library/typing.rst:512 +#: ../../library/typing.rst:588 msgid "" "When inheriting from generic classes, some type parameters could be fixed::" msgstr "" -#: ../../library/typing.rst:522 +#: ../../library/typing.rst:595 msgid "In this case ``MyDict`` has a single parameter, ``T``." msgstr "" -#: ../../library/typing.rst:524 +#: ../../library/typing.rst:597 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:535 +#: ../../library/typing.rst:608 msgid "User-defined generic type aliases are also supported. Examples::" msgstr "" -#: ../../library/typing.rst:552 +#: ../../library/typing.rst:623 +msgid "" +"For backward compatibility, generic type aliases can also be created through " +"a simple assignment::" +msgstr "為了向後相容性,泛型型別別名可以透過簡單的賦值來建立: ::" + +#: ../../library/typing.rst:632 msgid ":class:`Generic` no longer has a custom metaclass." msgstr "" -#: ../../library/typing.rst:555 +#: ../../library/typing.rst:635 +msgid "" +"Syntactic support for generics and type aliases is new in version 3.12. " +"Previously, generic classes had to explicitly inherit from :class:`Generic` " +"or contain a type variable in one of their bases." +msgstr "" + +#: ../../library/typing.rst:640 msgid "" "User-defined generics for parameter expressions are also supported via " "parameter specification variables in the form ``[**P]``. The behavior is " @@ -635,26 +678,35 @@ msgid "" "a :class:`ParamSpec`::" msgstr "" -#: ../../library/typing.rst:571 +#: ../../library/typing.rst:651 msgid "" "Classes generic over a :class:`ParamSpec` can also be created using explicit " "inheritance from :class:`Generic`. In this case, ``**`` is not used::" msgstr "" -#: ../../library/typing.rst:583 +#: ../../library/typing.rst:661 +msgid "" +"Another difference between :class:`TypeVar` and :class:`ParamSpec` is that a " +"generic with only one parameter specification variable will accept parameter " +"lists in the forms ``X[[Type1, Type2, ...]]`` and also ``X[Type1, " +"Type2, ...]`` for aesthetic reasons. Internally, the latter is converted to " +"the former, so the following are equivalent::" +msgstr "" + +#: ../../library/typing.rst:674 msgid "" "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:587 +#: ../../library/typing.rst:678 msgid "" ":class:`Generic` can now be parameterized over parameter expressions. See :" "class:`ParamSpec` and :pep:`612` for more details." msgstr "" -#: ../../library/typing.rst:591 +#: ../../library/typing.rst:682 msgid "" "A user-defined generic class can have ABCs as base classes without a " "metaclass conflict. Generic metaclasses are not supported. The outcome of " @@ -662,24 +714,24 @@ msgid "" "term:`hashable` and comparable for equality." msgstr "" -#: ../../library/typing.rst:598 +#: ../../library/typing.rst:689 msgid "The :data:`Any` type" msgstr ":data:`Any` 型別" -#: ../../library/typing.rst:600 +#: ../../library/typing.rst:691 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:604 +#: ../../library/typing.rst:695 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:622 +#: ../../library/typing.rst:713 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 " @@ -688,19 +740,19 @@ msgid "" "runtime!" msgstr "" -#: ../../library/typing.rst:628 +#: ../../library/typing.rst:719 msgid "" "Furthermore, all functions without a return type or parameter types will " "implicitly default to using :data:`Any`::" msgstr "" -#: ../../library/typing.rst:641 +#: ../../library/typing.rst:732 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:644 +#: ../../library/typing.rst:735 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, " @@ -708,7 +760,7 @@ msgid "" "subtype of every other type." msgstr "" -#: ../../library/typing.rst:649 +#: ../../library/typing.rst:740 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 " @@ -716,24 +768,24 @@ msgid "" "example::" msgstr "" -#: ../../library/typing.rst:671 +#: ../../library/typing.rst:762 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:676 +#: ../../library/typing.rst:767 msgid "Nominal vs structural subtyping" msgstr "" -#: ../../library/typing.rst:678 +#: ../../library/typing.rst:769 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:682 +#: ../../library/typing.rst:773 msgid "" "This requirement previously also applied to abstract base classes, such as :" "class:`~collections.abc.Iterable`. The problem with this approach is that a " @@ -742,7 +794,7 @@ msgid "" "code. For example, this conforms to :pep:`484`::" msgstr "" -#: ../../library/typing.rst:695 +#: ../../library/typing.rst:786 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 " @@ -751,85 +803,92 @@ msgid "" "subtyping* (or static duck-typing)::" msgstr "" -#: ../../library/typing.rst:711 +#: ../../library/typing.rst:802 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:716 +#: ../../library/typing.rst:807 msgid "Module contents" msgstr "模組內容" -#: ../../library/typing.rst:718 +#: ../../library/typing.rst:809 msgid "" "The ``typing`` module defines the following classes, functions and " "decorators." msgstr "" -#: ../../library/typing.rst:721 +#: ../../library/typing.rst:812 msgid "Special typing primitives" msgstr "" -#: ../../library/typing.rst:724 +#: ../../library/typing.rst:815 msgid "Special types" msgstr "" -#: ../../library/typing.rst:726 +#: ../../library/typing.rst:817 msgid "" "These can be used as types in annotations. They do not support subscription " "using ``[]``." msgstr "" -#: ../../library/typing.rst:731 +#: ../../library/typing.rst:822 msgid "Special type indicating an unconstrained type." msgstr "" -#: ../../library/typing.rst:733 +#: ../../library/typing.rst:824 msgid "Every type is compatible with :data:`Any`." msgstr "" -#: ../../library/typing.rst:734 +#: ../../library/typing.rst:825 msgid ":data:`Any` is compatible with every type." msgstr "" -#: ../../library/typing.rst:736 +#: ../../library/typing.rst:827 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:743 +#: ../../library/typing.rst:834 msgid "A :ref:`constrained type variable `." msgstr "" -#: ../../library/typing.rst:745 +#: ../../library/typing.rst:836 msgid "Definition::" msgstr "" -#: ../../library/typing.rst:749 +#: ../../library/typing.rst:840 msgid "" "``AnyStr`` is meant to be used for functions that may accept :class:`str` " "or :class:`bytes` arguments but cannot allow the two to mix." msgstr "" -#: ../../library/typing.rst:752 ../../library/typing.rst:828 -#: ../../library/typing.rst:848 ../../library/typing.rst:894 -#: ../../library/typing.rst:1092 ../../library/typing.rst:1149 -#: ../../library/typing.rst:1357 ../../library/typing.rst:2519 +#: ../../library/typing.rst:843 ../../library/typing.rst:934 +#: ../../library/typing.rst:954 ../../library/typing.rst:1011 +#: ../../library/typing.rst:1180 ../../library/typing.rst:1237 +#: ../../library/typing.rst:1446 ../../library/typing.rst:2813 msgid "For example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/typing.rst:763 +#: ../../library/typing.rst:852 +msgid "" +"Note that, despite its name, ``AnyStr`` has nothing to do with the :class:" +"`Any` type, nor does it mean \"any string\". In particular, ``AnyStr`` and " +"``str | bytes`` are different from each other and have different use cases::" +msgstr "" + +#: ../../library/typing.rst:869 msgid "Special type that includes only literal strings." msgstr "" -#: ../../library/typing.rst:765 +#: ../../library/typing.rst:871 msgid "" "Any string literal is compatible with ``LiteralString``, as is another " "``LiteralString``. However, an object typed as just ``str`` is not. A string " @@ -837,14 +896,14 @@ msgid "" "``LiteralString``." msgstr "" -#: ../../library/typing.rst:771 +#: ../../library/typing.rst:877 ../../library/typing.rst:1957 msgid "Example:" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/typing.rst:787 +#: ../../library/typing.rst:893 msgid "" "``LiteralString`` is useful for sensitive APIs where arbitrary user-" "generated strings could generate problems. For example, the two cases above " @@ -852,33 +911,33 @@ msgid "" "attack." msgstr "" -#: ../../library/typing.rst:792 +#: ../../library/typing.rst:898 msgid "See :pep:`675` for more details." msgstr "更多細節請見 :pep:`675`。" -#: ../../library/typing.rst:798 +#: ../../library/typing.rst:904 msgid "" "The `bottom type `_, a type that " "has no members." msgstr "" -#: ../../library/typing.rst:801 +#: ../../library/typing.rst:907 msgid "" "This can be used to define a function that should never be called, or a " "function that never returns::" msgstr "" -#: ../../library/typing.rst:821 +#: ../../library/typing.rst:927 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:826 +#: ../../library/typing.rst:932 msgid "Special type indicating that a function never returns." msgstr "" -#: ../../library/typing.rst:835 +#: ../../library/typing.rst:941 msgid "" "``NoReturn`` can also be used as a `bottom type `_, a type that has no values. Starting in Python 3.11, " @@ -886,126 +945,142 @@ msgid "" "checkers should treat the two equivalently." msgstr "" -#: ../../library/typing.rst:846 +#: ../../library/typing.rst:952 msgid "Special type to represent the current enclosed class." msgstr "" -#: ../../library/typing.rst:858 +#: ../../library/typing.rst:968 msgid "" "This annotation is semantically equivalent to the following, albeit in a " "more succinct fashion::" msgstr "" -#: ../../library/typing.rst:870 -msgid "In general if something currently follows the pattern of::" -msgstr "" - -#: ../../library/typing.rst:877 +#: ../../library/typing.rst:980 msgid "" -"You should use :data:`Self` as calls to ``SubclassOfFoo.return_self`` would " -"have ``Foo`` as the return type and not ``SubclassOfFoo``." +"In general, if something returns ``self``, as in the above examples, you " +"should use ``Self`` as the return annotation. If ``Foo.return_self`` was " +"annotated as returning ``\"Foo\"``, then the type checker would infer the " +"object returned from ``SubclassOfFoo.return_self`` as being of type ``Foo`` " +"rather than ``SubclassOfFoo``." msgstr "" -#: ../../library/typing.rst:880 +#: ../../library/typing.rst:986 msgid "Other common use cases include:" msgstr "" -#: ../../library/typing.rst:882 +#: ../../library/typing.rst:988 msgid "" ":class:`classmethod`\\s that are used as alternative constructors and return " "instances of the ``cls`` parameter." msgstr "" -#: ../../library/typing.rst:884 +#: ../../library/typing.rst:990 msgid "Annotating an :meth:`~object.__enter__` method which returns self." msgstr "" -#: ../../library/typing.rst:886 +#: ../../library/typing.rst:992 +msgid "" +"You should not use ``Self`` as the return annotation if the method is not " +"guaranteed to return an instance of a subclass when the class is subclassed::" +msgstr "" + +#: ../../library/typing.rst:1003 msgid "See :pep:`673` for more details." msgstr "更多細節請見 :pep:`673`。" -#: ../../library/typing.rst:892 +#: ../../library/typing.rst:1009 msgid "" "Special annotation for explicitly declaring a :ref:`type alias `." msgstr "" -#: ../../library/typing.rst:900 +#: ../../library/typing.rst:1017 msgid "" "``TypeAlias`` is particularly useful on older Python versions for annotating " "aliases that make use of forward references, as it can be hard for type " "checkers to distinguish these from normal variable assignments:" msgstr "" -#: ../../library/typing.rst:920 +#: ../../library/typing.rst:1037 msgid "See :pep:`613` for more details." msgstr "更多細節請見 :pep:`613`。" -#: ../../library/typing.rst:925 +#: ../../library/typing.rst:1041 +msgid "" +":data:`TypeAlias` is deprecated in favor of the :keyword:`type` statement, " +"which creates instances of :class:`TypeAliasType` and which natively " +"supports forward references. Note that while :data:`TypeAlias` and :class:" +"`TypeAliasType` serve similar purposes and have similar names, they are " +"distinct and the latter is not the type of the former. Removal of :data:" +"`TypeAlias` is not currently planned, but users are encouraged to migrate " +"to :keyword:`type` statements." +msgstr "" + +#: ../../library/typing.rst:1052 msgid "Special forms" msgstr "" -#: ../../library/typing.rst:927 +#: ../../library/typing.rst:1054 msgid "" "These can be used as types in annotations. They all support subscription " "using ``[]``, but each has a unique syntax." msgstr "" -#: ../../library/typing.rst:932 +#: ../../library/typing.rst:1059 msgid "" "Union type; ``Union[X, Y]`` is equivalent to ``X | Y`` and means either X or " "Y." msgstr "" -#: ../../library/typing.rst:934 +#: ../../library/typing.rst:1061 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:936 +#: ../../library/typing.rst:1063 msgid "The arguments must be types and there must be at least one." msgstr "" -#: ../../library/typing.rst:938 +#: ../../library/typing.rst:1065 msgid "Unions of unions are flattened, e.g.::" msgstr "" -#: ../../library/typing.rst:942 +#: ../../library/typing.rst:1069 msgid "Unions of a single argument vanish, e.g.::" msgstr "" -#: ../../library/typing.rst:946 +#: ../../library/typing.rst:1073 msgid "Redundant arguments are skipped, e.g.::" msgstr "" -#: ../../library/typing.rst:950 +#: ../../library/typing.rst:1077 msgid "When comparing unions, the argument order is ignored, e.g.::" msgstr "" -#: ../../library/typing.rst:954 +#: ../../library/typing.rst:1081 msgid "You cannot subclass or instantiate a ``Union``." msgstr "" -#: ../../library/typing.rst:956 +#: ../../library/typing.rst:1083 msgid "You cannot write ``Union[X][Y]``." msgstr "你不能寫成 ``Union[X][Y]``。" -#: ../../library/typing.rst:958 +#: ../../library/typing.rst:1085 msgid "Don't remove explicit subclasses from unions at runtime." msgstr "" -#: ../../library/typing.rst:961 +#: ../../library/typing.rst:1088 msgid "" "Unions can now be written as ``X | Y``. See :ref:`union type " "expressions`." msgstr "" -#: ../../library/typing.rst:967 +#: ../../library/typing.rst:1094 msgid "``Optional[X]`` is equivalent to ``X | None`` (or ``Union[X, None]``)." msgstr "" -#: ../../library/typing.rst:969 +#: ../../library/typing.rst:1096 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 " @@ -1013,56 +1088,24 @@ msgid "" "optional. For example::" msgstr "" -#: ../../library/typing.rst:977 +#: ../../library/typing.rst:1104 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:984 +#: ../../library/typing.rst:1111 msgid "" "Optional can now be written as ``X | None``. See :ref:`union type " "expressions`." msgstr "" -#: ../../library/typing.rst:990 -msgid "Deprecated alias to :class:`collections.abc.Callable`." -msgstr "" - -#: ../../library/typing.rst:992 -msgid "" -"``Callable[[int], str]`` signifies a function that takes a single parameter " -"of type :class:`int` and returns a :class:`str`." -msgstr "" - -#: ../../library/typing.rst:1000 -msgid "" -"There is no syntax to indicate optional or keyword arguments; such function " -"types are rarely used as callback types. ``Callable[..., ReturnType]`` " -"(literal ellipsis) can be used to type hint a callable taking any number of " -"arguments and returning ``ReturnType``. A plain :data:`Callable` is " -"equivalent to ``Callable[..., Any]``, and in turn to :class:`collections.abc." -"Callable`." -msgstr "" - -#: ../../library/typing.rst:1016 -msgid "" -":class:`collections.abc.Callable` now supports subscripting (``[]``). See :" -"pep:`585` and :ref:`types-genericalias`." -msgstr "" - -#: ../../library/typing.rst:1025 -msgid "" -"The documentation for :class:`ParamSpec` and :class:`Concatenate` provide " -"examples of usage with ``Callable``." -msgstr "" - -#: ../../library/typing.rst:1030 +#: ../../library/typing.rst:1117 msgid "Special form for annotating higher-order functions." msgstr "" -#: ../../library/typing.rst:1032 +#: ../../library/typing.rst:1119 msgid "" "``Concatenate`` can be used in conjunction with :ref:`Callable ` and :class:`ParamSpec` to annotate a higher-order callable which " @@ -1073,7 +1116,7 @@ msgid "" "``Concatenate`` must be a :class:`ParamSpec` or ellipsis (``...``)." msgstr "" -#: ../../library/typing.rst:1041 +#: ../../library/typing.rst:1128 msgid "" "For example, to annotate a decorator ``with_lock`` which provides a :class:" "`threading.Lock` to the decorated function, ``Concatenate`` can be used to " @@ -1084,34 +1127,38 @@ msgid "" "passed in::" msgstr "" -#: ../../library/typing.rst:1080 ../../library/typing.rst:1736 +#: ../../library/typing.rst:1167 ../../library/typing.rst:1925 msgid "" ":pep:`612` -- Parameter Specification Variables (the PEP which introduced " "``ParamSpec`` and ``Concatenate``)" msgstr "" -#: ../../library/typing.rst:1082 -msgid ":class:`ParamSpec` and :class:`Callable`." -msgstr ":class:`ParamSpec` 和 :class:`Callable`\\ 。" +#: ../../library/typing.rst:1169 +msgid ":class:`ParamSpec`" +msgstr ":class:`ParamSpec`。" + +#: ../../library/typing.rst:1170 ../../library/typing.rst:1928 +msgid ":ref:`annotating-callables`" +msgstr ":ref:`annotating-callables`" -#: ../../library/typing.rst:1086 +#: ../../library/typing.rst:1174 msgid "Special typing form to define \"literal types\"." msgstr "" -#: ../../library/typing.rst:1088 +#: ../../library/typing.rst:1176 msgid "" "``Literal`` can be used to indicate to type checkers that the annotated " "object has a value equivalent to one of the provided literals." msgstr "" -#: ../../library/typing.rst:1104 +#: ../../library/typing.rst:1192 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:1110 +#: ../../library/typing.rst:1198 msgid "" "``Literal`` now de-duplicates parameters. Equality comparisons of " "``Literal`` objects are no longer order dependent. ``Literal`` objects will " @@ -1119,22 +1166,22 @@ msgid "" "their parameters are not :term:`hashable`." msgstr "" -#: ../../library/typing.rst:1118 +#: ../../library/typing.rst:1206 msgid "Special type construct to mark class variables." msgstr "" -#: ../../library/typing.rst:1120 +#: ../../library/typing.rst:1208 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:1128 +#: ../../library/typing.rst:1216 msgid ":data:`ClassVar` accepts only types and cannot be further subscribed." msgstr "" -#: ../../library/typing.rst:1130 +#: ../../library/typing.rst:1218 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 " @@ -1142,27 +1189,27 @@ msgid "" "example, a type checker might flag the following code as an error::" msgstr "" -#: ../../library/typing.rst:1144 +#: ../../library/typing.rst:1232 msgid "Special typing construct to indicate final names to type checkers." msgstr "" -#: ../../library/typing.rst:1146 +#: ../../library/typing.rst:1234 msgid "" "Final names cannot be reassigned in any scope. Final names declared in class " "scopes cannot be overridden in subclasses." msgstr "" -#: ../../library/typing.rst:1160 ../../library/typing.rst:2535 +#: ../../library/typing.rst:1248 ../../library/typing.rst:2829 msgid "" "There is no runtime checking of these properties. See :pep:`591` for more " "details." msgstr "" -#: ../../library/typing.rst:1167 +#: ../../library/typing.rst:1255 msgid "Special typing construct to mark a :class:`TypedDict` key as required." msgstr "" -#: ../../library/typing.rst:1169 +#: ../../library/typing.rst:1257 msgid "" "This is mainly useful for ``total=False`` TypedDicts. See :class:`TypedDict` " "and :pep:`655` for more details." @@ -1170,21 +1217,21 @@ msgstr "" "主要用於 ``total=False`` 的 TypedDict。更多細節請見 :class:`TypedDict` 與 :" "pep:`655`。" -#: ../../library/typing.rst:1176 +#: ../../library/typing.rst:1264 msgid "" "Special typing construct to mark a :class:`TypedDict` key as potentially " "missing." msgstr "" -#: ../../library/typing.rst:1179 +#: ../../library/typing.rst:1267 msgid "See :class:`TypedDict` and :pep:`655` for more details." msgstr "更多細節請見 :class:`TypedDict` 與 :pep:`655`。" -#: ../../library/typing.rst:1185 +#: ../../library/typing.rst:1273 msgid "Special typing form to add context-specific metadata to an annotation." msgstr "" -#: ../../library/typing.rst:1187 +#: ../../library/typing.rst:1275 msgid "" "Add metadata ``x`` to a given type ``T`` by using the annotation " "``Annotated[T, x]``. Metadata added using ``Annotated`` can be used by " @@ -1192,7 +1239,7 @@ msgid "" "a :attr:`!__metadata__` attribute." msgstr "" -#: ../../library/typing.rst:1192 +#: ../../library/typing.rst:1280 msgid "" "If a library or tool encounters an annotation ``Annotated[T, x]`` and has no " "special logic for the metadata, it should ignore the metadata and simply " @@ -1201,7 +1248,7 @@ msgid "" "system." msgstr "" -#: ../../library/typing.rst:1198 +#: ../../library/typing.rst:1286 msgid "" "Using ``Annotated[T, x]`` as an annotation still allows for static " "typechecking of ``T``, as type checkers will simply ignore the metadata " @@ -1211,7 +1258,7 @@ msgid "" "for a function or class." msgstr "" -#: ../../library/typing.rst:1205 +#: ../../library/typing.rst:1293 msgid "" "The responsibility of how to interpret the metadata lies with the the tool " "or library encountering an ``Annotated`` annotation. A tool or library " @@ -1219,108 +1266,108 @@ msgid "" "determine if they are of interest (e.g., using :func:`isinstance`)." msgstr "" -#: ../../library/typing.rst:1213 +#: ../../library/typing.rst:1301 msgid "" "Here is an example of how you might use ``Annotated`` to add metadata to " "type annotations if you were doing range analysis:" msgstr "" -#: ../../library/typing.rst:1226 +#: ../../library/typing.rst:1314 msgid "Details of the syntax:" msgstr "" -#: ../../library/typing.rst:1228 +#: ../../library/typing.rst:1316 msgid "The first argument to ``Annotated`` must be a valid type" msgstr "" -#: ../../library/typing.rst:1230 +#: ../../library/typing.rst:1318 msgid "" "Multiple metadata elements can be supplied (``Annotated`` supports variadic " "arguments)::" msgstr "" -#: ../../library/typing.rst:1239 +#: ../../library/typing.rst:1327 msgid "" "It is up to the tool consuming the annotations to decide whether the client " "is allowed to add multiple metadata elements to one annotation and how to " "merge those annotations." msgstr "" -#: ../../library/typing.rst:1243 +#: ../../library/typing.rst:1331 msgid "" "``Annotated`` must be subscripted with at least two arguments " "( ``Annotated[int]`` is not valid)" msgstr "" -#: ../../library/typing.rst:1246 +#: ../../library/typing.rst:1334 msgid "" "The order of the metadata elements is preserved and matters for equality " "checks::" msgstr "" -#: ../../library/typing.rst:1253 +#: ../../library/typing.rst:1341 msgid "" "Nested ``Annotated`` types are flattened. The order of the metadata elements " "starts with the innermost annotation::" msgstr "" -#: ../../library/typing.rst:1260 +#: ../../library/typing.rst:1348 msgid "Duplicated metadata elements are not removed::" msgstr "" -#: ../../library/typing.rst:1266 +#: ../../library/typing.rst:1354 msgid "``Annotated`` can be used with nested and generic aliases:" msgstr "" -#: ../../library/typing.rst:1279 +#: ../../library/typing.rst:1368 msgid "``Annotated`` cannot be used with an unpacked :class:`TypeVarTuple`::" msgstr "" -#: ../../library/typing.rst:1283 +#: ../../library/typing.rst:1372 msgid "This would be equivalent to::" msgstr "" "這會等價於:\n" "\n" "::" -#: ../../library/typing.rst:1287 +#: ../../library/typing.rst:1376 msgid "" "where ``T1``, ``T2``, etc. are :class:`TypeVars `. This would be " "invalid: only one type should be passed to Annotated." msgstr "" -#: ../../library/typing.rst:1290 +#: ../../library/typing.rst:1379 msgid "" "By default, :func:`get_type_hints` strips the metadata from annotations. " "Pass ``include_extras=True`` to have the metadata preserved:" msgstr "" -#: ../../library/typing.rst:1303 +#: ../../library/typing.rst:1392 msgid "" "At runtime, the metadata associated with an ``Annotated`` type can be " "retrieved via the :attr:`!__metadata__` attribute:" msgstr "" -#: ../../library/typing.rst:1317 +#: ../../library/typing.rst:1406 msgid ":pep:`593` - Flexible function and variable annotations" msgstr "" -#: ../../library/typing.rst:1318 +#: ../../library/typing.rst:1407 msgid "The PEP introducing ``Annotated`` to the standard library." msgstr "" -#: ../../library/typing.rst:1325 +#: ../../library/typing.rst:1414 msgid "Special typing construct for marking user-defined type guard functions." msgstr "" -#: ../../library/typing.rst:1327 +#: ../../library/typing.rst:1416 msgid "" "``TypeGuard`` can be 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:1331 +#: ../../library/typing.rst:1420 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 " @@ -1329,44 +1376,44 @@ msgid "" "conditional expression here is sometimes referred to as a \"type guard\"::" msgstr "" -#: ../../library/typing.rst:1346 +#: ../../library/typing.rst:1435 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:1350 +#: ../../library/typing.rst:1439 msgid "" "Using ``-> TypeGuard`` tells the static type checker that for a given " "function:" msgstr "" -#: ../../library/typing.rst:1353 +#: ../../library/typing.rst:1442 msgid "The return value is a boolean." msgstr "" -#: ../../library/typing.rst:1354 +#: ../../library/typing.rst:1443 msgid "" "If the return value is ``True``, the type of its argument is the type inside " "``TypeGuard``." msgstr "" -#: ../../library/typing.rst:1371 +#: ../../library/typing.rst:1460 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:1375 +#: ../../library/typing.rst:1464 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:1381 +#: ../../library/typing.rst:1470 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]`` " @@ -1375,24 +1422,24 @@ msgid "" "guards is left to the user." msgstr "" -#: ../../library/typing.rst:1387 +#: ../../library/typing.rst:1476 msgid "" "``TypeGuard`` also works with type variables. See :pep:`647` for more " "details." msgstr "" -#: ../../library/typing.rst:1394 +#: ../../library/typing.rst:1483 msgid "Typing operator to conceptually mark an object as having been unpacked." msgstr "" -#: ../../library/typing.rst:1396 +#: ../../library/typing.rst:1485 msgid "" "For example, using the unpack operator ``*`` on a :class:`type variable " "tuple ` is equivalent to using ``Unpack`` to mark the type " "variable tuple as having been unpacked::" msgstr "" -#: ../../library/typing.rst:1405 +#: ../../library/typing.rst:1494 msgid "" "In fact, ``Unpack`` can be used interchangeably with ``*`` in the context " "of :class:`typing.TypeVarTuple ` and :class:`builtins.tuple " @@ -1400,42 +1447,92 @@ msgid "" "versions of Python, where ``*`` couldn't be used in certain places::" msgstr "" -#: ../../library/typing.rst:1422 -msgid "Building generic types" +#: ../../library/typing.rst:1508 +msgid "" +"``Unpack`` can also be used along with :class:`typing.TypedDict` for typing " +"``**kwargs`` in a function signature::" +msgstr "" + +#: ../../library/typing.rst:1521 +msgid "" +"See :pep:`692` for more details on using ``Unpack`` for ``**kwargs`` typing." +msgstr "" + +#: ../../library/typing.rst:1526 +msgid "Building generic types and type aliases" msgstr "" -#: ../../library/typing.rst:1424 +#: ../../library/typing.rst:1528 msgid "" "The following classes should not be used directly as annotations. Their " "intended purpose is to be building blocks for creating generic types and " "type aliases." msgstr "" -#: ../../library/typing.rst:1430 +#: ../../library/typing.rst:1532 +msgid "" +"These objects can be created through special syntax (:ref:`type parameter " +"lists ` and the :keyword:`type` statement). For compatibility " +"with Python 3.11 and earlier, they can also be created without the dedicated " +"syntax, as documented below." +msgstr "" + +#: ../../library/typing.rst:1539 msgid "Abstract base class for generic types." msgstr "" -#: ../../library/typing.rst:1432 +#: ../../library/typing.rst:1541 msgid "" "A generic type is typically declared by adding a list of type parameters " "after the class name::" msgstr "" -#: ../../library/typing.rst:1441 +#: ../../library/typing.rst:1549 +msgid "" +"Such a class implicitly inherits from ``Generic``. The runtime semantics of " +"this syntax are discussed in the :ref:`Language Reference `." +msgstr "" + +#: ../../library/typing.rst:1553 msgid "This class can then be used as follows::" msgstr "" -#: ../../library/typing.rst:1454 +#: ../../library/typing.rst:1561 +msgid "" +"Here the brackets after the function name indicate a :ref:`generic function " +"`." +msgstr "" + +#: ../../library/typing.rst:1564 +msgid "" +"For backwards compatibility, generic classes can also be declared by " +"explicitly inheriting from ``Generic``. In this case, the type parameters " +"must be declared separately::" +msgstr "" + +#: ../../library/typing.rst:1579 msgid "Type variable." msgstr "" -#: ../../library/typing.rst:1456 ../../library/typing.rst:1551 -#: ../../library/typing.rst:1661 ../../library/typing.rst:1774 -#: ../../library/typing.rst:1845 ../../library/typing.rst:2719 -msgid "Usage::" +#: ../../library/typing.rst:1581 +msgid "" +"The preferred way to construct a type variable is via the dedicated syntax " +"for :ref:`generic functions `, :ref:`generic classes " +"`, and :ref:`generic type aliases `::" +msgstr "" + +#: ../../library/typing.rst:1589 +msgid "" +"This syntax can also be used to create bound and constrained type variables::" +msgstr "" + +#: ../../library/typing.rst:1599 +msgid "" +"However, if desired, reusable type variables can also be constructed " +"manually, like so::" msgstr "" -#: ../../library/typing.rst:1462 +#: ../../library/typing.rst:1605 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 " @@ -1443,13 +1540,13 @@ msgid "" "information on generic types. Generic functions work as follows::" msgstr "" -#: ../../library/typing.rst:1483 +#: ../../library/typing.rst:1626 msgid "" "Note that type variables can be *bound*, *constrained*, or neither, but " "cannot be both bound *and* constrained." msgstr "" -#: ../../library/typing.rst:1486 +#: ../../library/typing.rst:1629 msgid "" "The variance of type variables is inferred by type checkers when they are " "created through the :ref:`type parameter syntax ` or when " @@ -1459,56 +1556,92 @@ msgid "" "invariant. See :pep:`484` and :pep:`695` for more details." msgstr "" -#: ../../library/typing.rst:1490 +#: ../../library/typing.rst:1637 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:1505 +#: ../../library/typing.rst:1652 msgid "" "Type variables can be bound to concrete types, abstract types (ABCs or " "protocols), and even unions of types::" msgstr "" -#: ../../library/typing.rst:1513 +#: ../../library/typing.rst:1664 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:1524 +#: ../../library/typing.rst:1675 msgid "At runtime, ``isinstance(x, T)`` will raise :exc:`TypeError`." msgstr "" -#: ../../library/typing.rst:1528 +#: ../../library/typing.rst:1679 msgid "The name of the type variable." msgstr "" -#: ../../library/typing.rst:1532 -msgid "Whether the type var has been marked as covariant." +#: ../../library/typing.rst:1683 +msgid "Whether the type var has been explicitly marked as covariant." +msgstr "" + +#: ../../library/typing.rst:1687 +msgid "Whether the type var has been explicitly marked as contravariant." msgstr "" -#: ../../library/typing.rst:1536 -msgid "Whether the type var has been marked as contravariant." +#: ../../library/typing.rst:1691 +msgid "" +"Whether the type variable's variance should be inferred by type checkers." msgstr "" -#: ../../library/typing.rst:1540 +#: ../../library/typing.rst:1697 msgid "The bound of the type variable, if any." msgstr "" -#: ../../library/typing.rst:1544 +#: ../../library/typing.rst:1701 +msgid "" +"For type variables created through :ref:`type parameter syntax `, the bound is evaluated only when the attribute is accessed, not " +"when the type variable is created (see :ref:`lazy-evaluation`)." +msgstr "" + +#: ../../library/typing.rst:1707 msgid "A tuple containing the constraints of the type variable, if any." msgstr "" -#: ../../library/typing.rst:1548 +#: ../../library/typing.rst:1711 +msgid "" +"For type variables created through :ref:`type parameter syntax `, the constraints are evaluated only when the attribute is accessed, " +"not when the type variable is created (see :ref:`lazy-evaluation`)." +msgstr "" + +#: ../../library/typing.rst:1717 +msgid "" +"Type variables can now be declared using the :ref:`type parameter ` syntax introduced by :pep:`695`. The ``infer_variance`` parameter " +"was added." +msgstr "" + +#: ../../library/typing.rst:1723 msgid "" "Type variable tuple. A specialized form of :class:`type variable ` " "that enables *variadic* generics." msgstr "" -#: ../../library/typing.rst:1559 +#: ../../library/typing.rst:1726 +msgid "" +"Type variable tuples can be declared in :ref:`type parameter lists ` using a single asterisk (``*``) before the name::" +msgstr "" + +#: ../../library/typing.rst:1732 +msgid "Or by explicitly invoking the ``TypeVarTuple`` constructor::" +msgstr "" + +#: ../../library/typing.rst:1740 msgid "" "A normal type variable enables parameterization with a single type. A type " "variable tuple, in contrast, allows parameterization with an *arbitrary* " @@ -1516,7 +1649,7 @@ msgid "" "wrapped in a tuple. For example::" msgstr "" -#: ../../library/typing.rst:1581 +#: ../../library/typing.rst:1762 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, " @@ -1526,36 +1659,36 @@ msgid "" "` instead, as ``Unpack[Ts]``.)" msgstr "" -#: ../../library/typing.rst:1589 +#: ../../library/typing.rst:1770 msgid "" "Type variable tuples must *always* be unpacked. This helps distinguish type " "variable tuples from normal type variables::" msgstr "" -#: ../../library/typing.rst:1596 +#: ../../library/typing.rst:1777 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:1605 +#: ../../library/typing.rst:1785 msgid "" "Type variable tuples can be happily combined with normal type variables:" msgstr "" -#: ../../library/typing.rst:1624 +#: ../../library/typing.rst:1801 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:1631 +#: ../../library/typing.rst:1808 msgid "" "Finally, an unpacked type variable tuple can be used as the type annotation " "of ``*args``::" msgstr "" -#: ../../library/typing.rst:1641 +#: ../../library/typing.rst:1818 msgid "" "In contrast to non-unpacked annotations of ``*args`` - e.g. ``*args: int``, " "which would specify that *all* arguments are ``int`` - ``*args: *Ts`` " @@ -1564,21 +1697,39 @@ msgid "" "``call_soon`` match the types of the (positional) arguments of ``callback``." msgstr "" -#: ../../library/typing.rst:1648 +#: ../../library/typing.rst:1825 msgid "See :pep:`646` for more details on type variable tuples." msgstr "" -#: ../../library/typing.rst:1652 +#: ../../library/typing.rst:1829 msgid "The name of the type variable tuple." msgstr "" -#: ../../library/typing.rst:1658 +#: ../../library/typing.rst:1835 +msgid "" +"Type variable tuples can now be declared using the :ref:`type parameter " +"` syntax introduced by :pep:`695`." +msgstr "" + +#: ../../library/typing.rst:1840 msgid "" "Parameter specification variable. A specialized version of :class:`type " "variables `." msgstr "" -#: ../../library/typing.rst:1665 +#: ../../library/typing.rst:1843 +msgid "" +"In :ref:`type parameter lists `, parameter specifications can " +"be declared with two asterisks (``**``)::" +msgstr "" + +#: ../../library/typing.rst:1848 +msgid "" +"For compatibility with Python 3.11 and earlier, ``ParamSpec`` objects can " +"also be created as follows::" +msgstr "" + +#: ../../library/typing.rst:1853 msgid "" "Parameter specification variables exist primarily for the benefit of static " "type checkers. They are used to forward the parameter types of one callable " @@ -1588,7 +1739,7 @@ msgid "" "See :class:`Generic` for more information on generic types." msgstr "" -#: ../../library/typing.rst:1672 +#: ../../library/typing.rst:1860 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 " @@ -1596,27 +1747,27 @@ msgid "" "new callable returned by it have inter-dependent type parameters::" msgstr "" -#: ../../library/typing.rst:1696 +#: ../../library/typing.rst:1880 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:1700 +#: ../../library/typing.rst:1884 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:1702 +#: ../../library/typing.rst:1886 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:1709 +#: ../../library/typing.rst:1893 msgid "" "Since ``ParamSpec`` captures both positional and keyword parameters, ``P." "args`` and ``P.kwargs`` can be used to split a ``ParamSpec`` into its " @@ -1629,11 +1780,11 @@ msgid "" "`ParamSpecKwargs`." msgstr "" -#: ../../library/typing.rst:1721 +#: ../../library/typing.rst:1905 msgid "The name of the parameter specification." msgstr "" -#: ../../library/typing.rst:1723 +#: ../../library/typing.rst:1907 msgid "" "Parameter specification variables created with ``covariant=True`` or " "``contravariant=True`` can be used to declare covariant or contravariant " @@ -1642,17 +1793,23 @@ msgid "" "decided." msgstr "" -#: ../../library/typing.rst:1732 +#: ../../library/typing.rst:1917 +msgid "" +"Parameter specifications can now be declared using the :ref:`type parameter " +"` syntax introduced by :pep:`695`." +msgstr "" + +#: ../../library/typing.rst:1921 msgid "" "Only parameter specification variables defined in global scope can be " "pickled." msgstr "" -#: ../../library/typing.rst:1738 -msgid ":class:`Callable` and :class:`Concatenate`." -msgstr ":class:`Callable` 和 :class:`Concatenate`\\ 。" +#: ../../library/typing.rst:1927 +msgid ":data:`Concatenate`" +msgstr "" -#: ../../library/typing.rst:1743 +#: ../../library/typing.rst:1933 msgid "" "Arguments and keyword arguments attributes of a :class:`ParamSpec`. The ``P." "args`` attribute of a ``ParamSpec`` is an instance of ``ParamSpecArgs``, and " @@ -1660,45 +1817,75 @@ msgid "" "runtime introspection and have no special meaning to static type checkers." msgstr "" -#: ../../library/typing.rst:1748 +#: ../../library/typing.rst:1938 msgid "" "Calling :func:`get_origin` on either of these objects will return the " "original ``ParamSpec``:" msgstr "" -#: ../../library/typing.rst:1764 +#: ../../library/typing.rst:1955 +msgid "The type of type aliases created through the :keyword:`type` statement." +msgstr "" + +#: ../../library/typing.rst:1969 +msgid "The name of the type alias:" +msgstr "" + +#: ../../library/typing.rst:1979 +msgid "The module in which the type alias was defined::" +msgstr "" + +#: ../../library/typing.rst:1987 +msgid "" +"The type parameters of the type alias, or an empty tuple if the alias is not " +"generic:" +msgstr "" + +#: ../../library/typing.rst:2001 +msgid "" +"The type alias's value. This is :ref:`lazily evaluated `, " +"so names used in the definition of the alias are not resolved until the " +"``__value__`` attribute is accessed:" +msgstr "" + +#: ../../library/typing.rst:2019 msgid "Other special directives" msgstr "" -#: ../../library/typing.rst:1766 +#: ../../library/typing.rst:2021 msgid "" "These functions and classes should not be used directly as annotations. " "Their intended purpose is to be building blocks for creating and declaring " "types." msgstr "" -#: ../../library/typing.rst:1772 +#: ../../library/typing.rst:2027 msgid "Typed version of :func:`collections.namedtuple`." msgstr "" -#: ../../library/typing.rst:1780 +#: ../../library/typing.rst:2029 ../../library/typing.rst:2106 +#: ../../library/typing.rst:3055 +msgid "Usage::" +msgstr "" + +#: ../../library/typing.rst:2035 msgid "This is equivalent to::" msgstr "" "這等價於:\n" "\n" "::" -#: ../../library/typing.rst:1784 +#: ../../library/typing.rst:2039 msgid "" "To give a field a default value, you can assign to it in the class body::" msgstr "" -#: ../../library/typing.rst:1793 +#: ../../library/typing.rst:2048 msgid "" "Fields with a default value must come after any fields without a default." msgstr "" -#: ../../library/typing.rst:1795 +#: ../../library/typing.rst:2050 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 " @@ -1707,83 +1894,83 @@ msgid "" "API.)" msgstr "" -#: ../../library/typing.rst:1801 +#: ../../library/typing.rst:2056 msgid "``NamedTuple`` subclasses can also have docstrings and methods::" msgstr "" -#: ../../library/typing.rst:1811 +#: ../../library/typing.rst:2066 msgid "``NamedTuple`` subclasses can be generic::" msgstr "" -#: ../../library/typing.rst:1817 +#: ../../library/typing.rst:2072 msgid "Backward-compatible usage::" msgstr "" -#: ../../library/typing.rst:1821 +#: ../../library/typing.rst:2082 msgid "Added support for :pep:`526` variable annotation syntax." msgstr "" -#: ../../library/typing.rst:1824 +#: ../../library/typing.rst:2085 msgid "Added support for default values, methods, and docstrings." msgstr "" -#: ../../library/typing.rst:1827 +#: ../../library/typing.rst:2088 msgid "" "The ``_field_types`` and ``__annotations__`` attributes are now regular " "dictionaries instead of instances of ``OrderedDict``." msgstr "" -#: ../../library/typing.rst:1831 +#: ../../library/typing.rst:2092 msgid "" "Removed the ``_field_types`` attribute in favor of the more standard " "``__annotations__`` attribute which has the same information." msgstr "" -#: ../../library/typing.rst:1835 +#: ../../library/typing.rst:2096 msgid "Added support for generic namedtuples." msgstr "" -#: ../../library/typing.rst:1840 +#: ../../library/typing.rst:2101 msgid "Helper class to create low-overhead :ref:`distinct types `." msgstr "" -#: ../../library/typing.rst:1842 +#: ../../library/typing.rst:2103 msgid "" "A ``NewType`` is considered a distinct type by a typechecker. At runtime, " "however, calling a ``NewType`` returns its argument unchanged." msgstr "" -#: ../../library/typing.rst:1852 +#: ../../library/typing.rst:2113 msgid "The module in which the new type is defined." msgstr "" -#: ../../library/typing.rst:1856 +#: ../../library/typing.rst:2117 msgid "The name of the new type." msgstr "" -#: ../../library/typing.rst:1860 +#: ../../library/typing.rst:2121 msgid "The type that the new type is based on." msgstr "" -#: ../../library/typing.rst:1864 +#: ../../library/typing.rst:2125 msgid "``NewType`` is now a class rather than a function." msgstr "" -#: ../../library/typing.rst:1869 +#: ../../library/typing.rst:2130 msgid "Base class for protocol classes." msgstr "" -#: ../../library/typing.rst:1871 +#: ../../library/typing.rst:2132 msgid "Protocol classes are defined like this::" msgstr "" -#: ../../library/typing.rst:1877 +#: ../../library/typing.rst:2138 msgid "" "Such classes are primarily used with static type checkers that recognize " "structural subtyping (static duck-typing), for example::" msgstr "" -#: ../../library/typing.rst:1889 +#: ../../library/typing.rst:2150 msgid "" "See :pep:`544` for more details. Protocol classes decorated with :func:" "`runtime_checkable` (described later) act as simple-minded runtime protocols " @@ -1791,15 +1978,21 @@ msgid "" "signatures." msgstr "" -#: ../../library/typing.rst:1894 +#: ../../library/typing.rst:2155 msgid "Protocol classes can be generic, for example::" msgstr "" -#: ../../library/typing.rst:1906 +#: ../../library/typing.rst:2161 +msgid "" +"In code that needs to be compatible with Python 3.11 or older, generic " +"Protocols can be written as follows::" +msgstr "" + +#: ../../library/typing.rst:2174 msgid "Mark a protocol class as a runtime protocol." msgstr "" -#: ../../library/typing.rst:1908 +#: ../../library/typing.rst:2176 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 " @@ -1808,7 +2001,7 @@ msgid "" "Iterable`. For example::" msgstr "" -#: ../../library/typing.rst:1928 +#: ../../library/typing.rst:2196 msgid "" ":func:`!runtime_checkable` will check only the presence of the required " "methods or attributes, not their type signatures or types. For example, :" @@ -1819,7 +2012,7 @@ msgid "" "(instantiate) :class:`ssl.SSLObject`." msgstr "" -#: ../../library/typing.rst:1939 +#: ../../library/typing.rst:2207 msgid "" "An :func:`isinstance` check against a runtime-checkable protocol can be " "surprisingly slow compared to an ``isinstance()`` check against a non-" @@ -1827,13 +2020,32 @@ msgid "" "calls for structural checks in performance-sensitive code." msgstr "" -#: ../../library/typing.rst:1950 +#: ../../library/typing.rst:2215 +msgid "" +"The internal implementation of :func:`isinstance` checks against runtime-" +"checkable protocols now uses :func:`inspect.getattr_static` to look up " +"attributes (previously, :func:`hasattr` was used). As a result, some objects " +"which used to be considered instances of a runtime-checkable protocol may no " +"longer be considered instances of that protocol on Python 3.12+, and vice " +"versa. Most users are unlikely to be affected by this change." +msgstr "" + +#: ../../library/typing.rst:2224 +msgid "" +"The members of a runtime-checkable protocol are now considered \"frozen\" at " +"runtime as soon as the class has been created. Monkey-patching attributes " +"onto a runtime-checkable protocol will still work, but will have no impact " +"on :func:`isinstance` checks comparing objects to the protocol. See :ref:" +"`\"What's new in Python 3.12\" ` for more details." +msgstr "" + +#: ../../library/typing.rst:2235 msgid "" "Special construct to add type hints to a dictionary. At runtime it is a " "plain :class:`dict`." msgstr "" -#: ../../library/typing.rst:1953 +#: ../../library/typing.rst:2238 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 " @@ -1841,53 +2053,53 @@ msgid "" "enforced by type checkers. Usage::" msgstr "" -#: ../../library/typing.rst:1969 +#: ../../library/typing.rst:2254 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:1973 +#: ../../library/typing.rst:2258 msgid "Using a literal :class:`dict` as the second argument::" msgstr "" -#: ../../library/typing.rst:1977 +#: ../../library/typing.rst:2262 msgid "Using keyword arguments::" msgstr "" -#: ../../library/typing.rst:1984 +#: ../../library/typing.rst:2269 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:1985 +#: ../../library/typing.rst:2270 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:1997 +#: ../../library/typing.rst:2282 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:2008 +#: ../../library/typing.rst:2293 msgid "" "This means that a ``Point2D`` ``TypedDict`` can have the ``label`` key " "omitted." msgstr "" -#: ../../library/typing.rst:2011 +#: ../../library/typing.rst:2296 msgid "" "It is also possible to mark all keys as non-required by default by " "specifying a totality of ``False``::" msgstr "" -#: ../../library/typing.rst:2021 +#: ../../library/typing.rst:2306 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 " @@ -1895,61 +2107,67 @@ msgid "" "and makes all items defined in the class body required." msgstr "" -#: ../../library/typing.rst:2026 +#: ../../library/typing.rst:2311 msgid "" "Individual keys of a ``total=False`` ``TypedDict`` can be marked as required " "using :data:`Required`::" msgstr "" -#: ../../library/typing.rst:2041 +#: ../../library/typing.rst:2326 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:2048 +#: ../../library/typing.rst:2333 msgid "" "``Point3D`` has three items: ``x``, ``y`` and ``z``. It is equivalent to " "this definition::" msgstr "" -#: ../../library/typing.rst:2056 +#: ../../library/typing.rst:2341 msgid "" "A ``TypedDict`` cannot inherit from a non-\\ ``TypedDict`` class, except " "for :class:`Generic`. For example::" msgstr "" -#: ../../library/typing.rst:2074 -msgid "A ``TypedDict`` can be generic:" +#: ../../library/typing.rst:2356 +msgid "A ``TypedDict`` can be generic::" msgstr "" -#: ../../library/typing.rst:2084 +#: ../../library/typing.rst:2362 +msgid "" +"To create a generic ``TypedDict`` that is compatible with Python 3.11 or " +"lower, inherit from :class:`Generic` explicitly:" +msgstr "" + +#: ../../library/typing.rst:2373 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:2090 +#: ../../library/typing.rst:2379 msgid "" "``Point2D.__total__`` gives the value of the ``total`` argument. Example:" msgstr "" -#: ../../library/typing.rst:2112 +#: ../../library/typing.rst:2401 msgid "" "``Point2D.__required_keys__`` and ``Point2D.__optional_keys__`` return :" "class:`frozenset` objects containing required and non-required keys, " "respectively." msgstr "" -#: ../../library/typing.rst:2115 +#: ../../library/typing.rst:2404 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:2118 +#: ../../library/typing.rst:2407 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 " @@ -1958,133 +2176,133 @@ msgid "" "``TypedDict`` with a different value for ``total``:" msgstr "" -#: ../../library/typing.rst:2141 +#: ../../library/typing.rst:2430 msgid "" "See :pep:`589` for more examples and detailed rules of using ``TypedDict``." msgstr "" -#: ../../library/typing.rst:2145 +#: ../../library/typing.rst:2434 msgid "" "Added support for marking individual keys as :data:`Required` or :data:" "`NotRequired`. See :pep:`655`." msgstr "" -#: ../../library/typing.rst:2149 +#: ../../library/typing.rst:2438 msgid "Added support for generic ``TypedDict``\\ s." msgstr "" -#: ../../library/typing.rst:2153 +#: ../../library/typing.rst:2442 msgid "Protocols" msgstr "協定" -#: ../../library/typing.rst:2155 +#: ../../library/typing.rst:2444 msgid "" "The following protocols are provided by the typing module. All are decorated " "with :func:`@runtime_checkable `." msgstr "" -#: ../../library/typing.rst:2160 +#: ../../library/typing.rst:2449 msgid "" "An ABC with one abstract method ``__abs__`` that is covariant in its return " "type." msgstr "" -#: ../../library/typing.rst:2165 +#: ../../library/typing.rst:2454 msgid "An ABC with one abstract method ``__bytes__``." msgstr "一個有抽象方法 ``__bytes__`` 的 ABC。" -#: ../../library/typing.rst:2169 +#: ../../library/typing.rst:2458 msgid "An ABC with one abstract method ``__complex__``." msgstr "一個有抽象方法 ``__complex__`` 的 ABC。" -#: ../../library/typing.rst:2173 +#: ../../library/typing.rst:2462 msgid "An ABC with one abstract method ``__float__``." msgstr "一個有抽象方法 ``__float__`` 的 ABC。" -#: ../../library/typing.rst:2177 +#: ../../library/typing.rst:2466 msgid "An ABC with one abstract method ``__index__``." msgstr "一個有抽象方法 ``__index__`` 的 ABC。" -#: ../../library/typing.rst:2183 +#: ../../library/typing.rst:2472 msgid "An ABC with one abstract method ``__int__``." msgstr "一個有抽象方法 ``__int__`` 的 ABC。" -#: ../../library/typing.rst:2187 +#: ../../library/typing.rst:2476 msgid "" "An ABC with one abstract method ``__round__`` that is covariant in its " "return type." msgstr "" -#: ../../library/typing.rst:2191 +#: ../../library/typing.rst:2480 msgid "ABCs for working with IO" msgstr "" -#: ../../library/typing.rst:2197 +#: ../../library/typing.rst:2486 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:2203 +#: ../../library/typing.rst:2492 msgid "Functions and decorators" msgstr "函式與裝飾器" -#: ../../library/typing.rst:2207 +#: ../../library/typing.rst:2496 msgid "Cast a value to a type." msgstr "" -#: ../../library/typing.rst:2209 +#: ../../library/typing.rst:2498 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:2216 +#: ../../library/typing.rst:2505 msgid "" "Ask a static type checker to confirm that *val* has an inferred type of " "*typ*." msgstr "" -#: ../../library/typing.rst:2218 +#: ../../library/typing.rst:2507 msgid "" "At runtime this does nothing: it returns the first argument unchanged with " "no checks or side effects, no matter the actual type of the argument." msgstr "" -#: ../../library/typing.rst:2221 +#: ../../library/typing.rst:2510 msgid "" "When a static 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:2228 +#: ../../library/typing.rst:2517 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:2242 +#: ../../library/typing.rst:2531 msgid "" "Ask a static type checker to confirm that a line of code is unreachable." msgstr "" -#: ../../library/typing.rst:2244 +#: ../../library/typing.rst:2533 msgid "Example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/typing.rst:2255 +#: ../../library/typing.rst:2544 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`, " "and both options are covered by earlier cases." msgstr "" -#: ../../library/typing.rst:2260 +#: ../../library/typing.rst:2549 msgid "" "If a type checker finds that a call to ``assert_never()`` is reachable, it " "will emit an error. For example, if the type annotation for ``arg`` was " @@ -2094,59 +2312,59 @@ msgid "" "passed in must be the bottom type, :data:`Never`, and nothing else." msgstr "" -#: ../../library/typing.rst:2268 +#: ../../library/typing.rst:2557 msgid "At runtime, this throws an exception when called." msgstr "" -#: ../../library/typing.rst:2271 +#: ../../library/typing.rst:2560 msgid "" "`Unreachable Code and Exhaustiveness Checking `__ has more information about " "exhaustiveness checking with static typing." msgstr "" -#: ../../library/typing.rst:2279 +#: ../../library/typing.rst:2568 msgid "Reveal the inferred static type of an expression." msgstr "" -#: ../../library/typing.rst:2281 +#: ../../library/typing.rst:2570 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:2287 +#: ../../library/typing.rst:2576 msgid "" "This can be useful when you want to debug how your type checker handles a " "particular piece of code." msgstr "" -#: ../../library/typing.rst:2290 +#: ../../library/typing.rst:2579 msgid "" "The function returns its argument unchanged, which allows using it within an " "expression::" msgstr "" -#: ../../library/typing.rst:2295 +#: ../../library/typing.rst:2584 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:2300 +#: ../../library/typing.rst:2589 msgid "" "At runtime, this function prints the runtime type of its argument to stderr " "and returns it unchanged::" msgstr "" -#: ../../library/typing.rst:2312 +#: ../../library/typing.rst:2601 msgid "" "Decorator to mark an object as providing :func:`dataclass `-like behavior." msgstr "" -#: ../../library/typing.rst:2315 +#: ../../library/typing.rst:2604 msgid "" "``dataclass_transform`` may be used to decorate a class, metaclass, or a " "function that is itself a decorator. The presence of " @@ -2155,19 +2373,19 @@ msgid "" "to :func:`@dataclasses.dataclass `." msgstr "" -#: ../../library/typing.rst:2322 +#: ../../library/typing.rst:2611 msgid "Example usage with a decorator function:" msgstr "" -#: ../../library/typing.rst:2338 +#: ../../library/typing.rst:2625 msgid "On a base class::" msgstr "" -#: ../../library/typing.rst:2347 +#: ../../library/typing.rst:2634 msgid "On a metaclass::" msgstr "" -#: ../../library/typing.rst:2358 +#: ../../library/typing.rst:2645 msgid "" "The ``CustomerModel`` classes defined above will be treated by type checkers " "similarly to classes created with :func:`@dataclasses.dataclass `-decorated definitions for " "*func*." msgstr "" -#: ../../library/typing.rst:2489 +#: ../../library/typing.rst:2783 msgid "" "*func* is the function object for the implementation of the overloaded " "function. For example, given the definition of ``process`` in the " @@ -2372,32 +2603,32 @@ msgid "" "returns an empty sequence." msgstr "" -#: ../../library/typing.rst:2496 +#: ../../library/typing.rst:2790 msgid "" "``get_overloads()`` can be used for introspecting an overloaded function at " "runtime." msgstr "" -#: ../../library/typing.rst:2504 +#: ../../library/typing.rst:2798 msgid "Clear all registered overloads in the internal registry." msgstr "" -#: ../../library/typing.rst:2506 +#: ../../library/typing.rst:2800 msgid "This can be used to reclaim the memory used by the registry." msgstr "" -#: ../../library/typing.rst:2513 +#: ../../library/typing.rst:2807 msgid "Decorator to indicate final methods and final classes." msgstr "" -#: ../../library/typing.rst:2515 +#: ../../library/typing.rst:2809 msgid "" "Decorating a method with ``@final`` indicates to a type checker that the " "method cannot be overridden in a subclass. Decorating a class with " "``@final`` indicates that it cannot be subclassed." msgstr "" -#: ../../library/typing.rst:2540 +#: ../../library/typing.rst:2834 msgid "" "The decorator will now attempt to set a ``__final__`` attribute to ``True`` " "on the decorated object. Thus, a check like ``if getattr(obj, \"__final__\", " @@ -2407,11 +2638,11 @@ msgid "" "exception." msgstr "" -#: ../../library/typing.rst:2551 +#: ../../library/typing.rst:2845 msgid "Decorator to indicate that annotations are not type hints." msgstr "" -#: ../../library/typing.rst:2553 +#: ../../library/typing.rst:2847 msgid "" "This works as a class or function :term:`decorator`. With a class, it " "applies recursively to all methods and classes defined in that class (but " @@ -2419,48 +2650,79 @@ msgid "" "will ignore all annotations in a function or class with this decorator." msgstr "" -#: ../../library/typing.rst:2559 +#: ../../library/typing.rst:2853 msgid "``@no_type_check`` mutates the decorated object in place." msgstr "" -#: ../../library/typing.rst:2563 +#: ../../library/typing.rst:2857 msgid "Decorator to give another decorator the :func:`no_type_check` effect." msgstr "" -#: ../../library/typing.rst:2565 +#: ../../library/typing.rst:2859 msgid "" "This wraps the decorator with something that wraps the decorated function " "in :func:`no_type_check`." msgstr "" -#: ../../library/typing.rst:2570 +#: ../../library/typing.rst:2865 +msgid "" +"Decorator to indicate that a method in a subclass is intended to override a " +"method or attribute in a superclass." +msgstr "" + +#: ../../library/typing.rst:2868 +msgid "" +"Type checkers should emit an error if a method decorated with ``@override`` " +"does not, in fact, override anything. This helps prevent bugs that may occur " +"when a base class is changed without an equivalent change to a child class." +msgstr "" + +#: ../../library/typing.rst:2890 +msgid "There is no runtime checking of this property." +msgstr "" + +#: ../../library/typing.rst:2892 +msgid "" +"The decorator will attempt to set an ``__override__`` attribute to ``True`` " +"on the decorated object. Thus, a check like ``if getattr(obj, " +"\"__override__\", False)`` can be used at runtime to determine whether an " +"object ``obj`` has been marked as an override. If the decorated object does " +"not support setting attributes, the decorator returns the object unchanged " +"without raising an exception." +msgstr "" + +#: ../../library/typing.rst:2899 +msgid "See :pep:`698` for more details." +msgstr "更多細節請見 :pep:`698`。" + +#: ../../library/typing.rst:2906 msgid "Decorator to mark a class or function as unavailable at runtime." msgstr "" -#: ../../library/typing.rst:2572 +#: ../../library/typing.rst:2908 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:2583 +#: ../../library/typing.rst:2919 msgid "" "Note that returning instances of private classes is not recommended. It is " "usually preferable to make such classes public." msgstr "" -#: ../../library/typing.rst:2587 +#: ../../library/typing.rst:2923 msgid "Introspection helpers" msgstr "" -#: ../../library/typing.rst:2591 +#: ../../library/typing.rst:2927 msgid "" "Return a dictionary containing type hints for a function, method, module or " "class object." msgstr "" -#: ../../library/typing.rst:2594 +#: ../../library/typing.rst:2930 msgid "" "This is often the same as ``obj.__annotations__``. In addition, forward " "references encoded as string literals are handled by evaluating them in " @@ -2469,21 +2731,21 @@ msgid "" "__mro__`` in reverse order." msgstr "" -#: ../../library/typing.rst:2600 +#: ../../library/typing.rst:2936 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:2617 +#: ../../library/typing.rst:2953 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:2622 +#: ../../library/typing.rst:2958 msgid "" "Added ``include_extras`` parameter as part of :pep:`593`. See the " "documentation on :data:`Annotated` for more information." @@ -2491,20 +2753,20 @@ msgstr "" "新增 ``include_extras`` 參數(如 :pep:`593` 中所述)。更多資訊請見 :data:" "`Annotated` 的文件。" -#: ../../library/typing.rst:2626 +#: ../../library/typing.rst:2962 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:2633 +#: ../../library/typing.rst:2969 msgid "" "Get the unsubscripted version of a type: for a typing object of the form " "``X[Y, Z, ...]`` return ``X``." msgstr "" -#: ../../library/typing.rst:2636 +#: ../../library/typing.rst:2972 msgid "" "If ``X`` is a typing-module alias for a builtin or :mod:`collections` class, " "it will be normalized to the original class. If ``X`` is an instance of :" @@ -2512,17 +2774,17 @@ msgid "" "class:`ParamSpec`. Return ``None`` for unsupported objects." msgstr "" -#: ../../library/typing.rst:2642 ../../library/typing.rst:2665 +#: ../../library/typing.rst:2978 ../../library/typing.rst:3001 msgid "Examples:" msgstr "舉例:" -#: ../../library/typing.rst:2657 +#: ../../library/typing.rst:2993 msgid "" "Get type arguments with all substitutions performed: for a typing object of " "the form ``X[Y, Z, ...]`` return ``(Y, Z, ...)``." msgstr "" -#: ../../library/typing.rst:2660 +#: ../../library/typing.rst:2996 msgid "" "If ``X`` is a union or :class:`Literal` contained in another generic type, " "the order of ``(Y, Z, ...)`` may be different from the order of the original " @@ -2530,40 +2792,40 @@ msgid "" "objects." msgstr "" -#: ../../library/typing.rst:2677 +#: ../../library/typing.rst:3013 msgid "Check if a type is a :class:`TypedDict`." msgstr "" -#: ../../library/typing.rst:2698 +#: ../../library/typing.rst:3034 msgid "" "Class used for internal typing representation of string forward references." msgstr "" -#: ../../library/typing.rst:2700 +#: ../../library/typing.rst:3036 msgid "" "For example, ``List[\"SomeClass\"]`` is implicitly transformed into " "``List[ForwardRef(\"SomeClass\")]``. ``ForwardRef`` should not be " "instantiated by a user, but may be used by introspection tools." msgstr "" -#: ../../library/typing.rst:2705 +#: ../../library/typing.rst:3041 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:2712 +#: ../../library/typing.rst:3048 msgid "Constant" msgstr "常數" -#: ../../library/typing.rst:2716 +#: ../../library/typing.rst:3052 msgid "" "A special constant that is assumed to be ``True`` by 3rd party static type " "checkers. It is ``False`` at runtime." msgstr "" -#: ../../library/typing.rst:2727 +#: ../../library/typing.rst:3063 msgid "" "The first type annotation must be enclosed in quotes, making it a \"forward " "reference\", to hide the ``expensive_mod`` reference from the interpreter " @@ -2571,7 +2833,7 @@ msgid "" "second annotation does not need to be enclosed in quotes." msgstr "" -#: ../../library/typing.rst:2734 +#: ../../library/typing.rst:3070 msgid "" "If ``from __future__ import annotations`` is used, annotations are not " "evaluated at function definition time. Instead, they are stored as strings " @@ -2579,11 +2841,11 @@ msgid "" "annotation (see :pep:`563`)." msgstr "" -#: ../../library/typing.rst:2745 +#: ../../library/typing.rst:3082 msgid "Deprecated aliases" msgstr "棄用的別名" -#: ../../library/typing.rst:2747 +#: ../../library/typing.rst:3084 msgid "" "This module defines several deprecated aliases to pre-existing standard " "library classes. These were originally included in the typing module in " @@ -2592,7 +2854,7 @@ msgid "" "existing classes were enhanced to support ``[]`` (see :pep:`585`)." msgstr "" -#: ../../library/typing.rst:2753 +#: ../../library/typing.rst:3091 msgid "" "The redundant types are deprecated as of Python 3.9. However, while the " "aliases may be removed at some point, removal of these aliases is not " @@ -2600,7 +2862,7 @@ msgid "" "the interpreter for these aliases." msgstr "" -#: ../../library/typing.rst:2758 +#: ../../library/typing.rst:3096 msgid "" "If at some point it is decided to remove these deprecated aliases, a " "deprecation warning will be issued by the interpreter for at least two " @@ -2608,176 +2870,188 @@ msgid "" "typing module without deprecation warnings until at least Python 3.14." msgstr "" -#: ../../library/typing.rst:2765 -msgid "Aliases to built-in types" +#: ../../library/typing.rst:3101 +msgid "" +"Type checkers are encouraged to flag uses of the deprecated types if the " +"program they are checking targets a minimum Python version of 3.9 or newer." msgstr "" -#: ../../library/typing.rst:2769 +#: ../../library/typing.rst:3107 +msgid "Aliases to built-in types" +msgstr "內建型別的別名" + +#: ../../library/typing.rst:3111 msgid "Deprecated alias to :class:`dict`." -msgstr "" +msgstr "棄用 :class:`dict` 的別名。" -#: ../../library/typing.rst:2771 +#: ../../library/typing.rst:3113 msgid "" "Note that to annotate arguments, it is preferred to use an abstract " "collection type such as :class:`Mapping` rather than to use :class:`dict` " "or :class:`!typing.Dict`." msgstr "" -#: ../../library/typing.rst:2775 ../../library/typing.rst:3015 +#: ../../library/typing.rst:3117 ../../library/typing.rst:3359 msgid "This type can be used as follows::" msgstr "" -#: ../../library/typing.rst:2780 +#: ../../library/typing.rst:3122 msgid "" ":class:`builtins.dict ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2786 +#: ../../library/typing.rst:3128 msgid "Deprecated alias to :class:`list`." -msgstr "" +msgstr "棄用 :class:`list` 的別名。" -#: ../../library/typing.rst:2788 +#: ../../library/typing.rst:3130 msgid "" "Note that to annotate arguments, it is preferred to use an abstract " "collection type such as :class:`Sequence` or :class:`Iterable` rather than " "to use :class:`list` or :class:`!typing.List`." msgstr "" -#: ../../library/typing.rst:2792 +#: ../../library/typing.rst:3134 msgid "This type may be used as follows::" msgstr "" -#: ../../library/typing.rst:2802 +#: ../../library/typing.rst:3142 msgid "" ":class:`builtins.list ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2808 +#: ../../library/typing.rst:3148 msgid "Deprecated alias to :class:`builtins.set `." -msgstr "" +msgstr "棄用 :class:`builtins.set ` 的別名。" -#: ../../library/typing.rst:2810 +#: ../../library/typing.rst:3150 msgid "" "Note that to annotate arguments, it is preferred to use an abstract " "collection type such as :class:`AbstractSet` rather than to use :class:`set` " "or :class:`!typing.Set`." msgstr "" -#: ../../library/typing.rst:2814 +#: ../../library/typing.rst:3154 msgid "" ":class:`builtins.set ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2820 +#: ../../library/typing.rst:3160 msgid "Deprecated alias to :class:`builtins.frozenset `." -msgstr "" +msgstr "棄用 :class:`builtins.frozenset ` 的別名。" -#: ../../library/typing.rst:2822 +#: ../../library/typing.rst:3162 msgid "" ":class:`builtins.frozenset ` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2829 +#: ../../library/typing.rst:3169 msgid "Deprecated alias for :class:`tuple`." -msgstr "" +msgstr "棄用 :class:`tuple` 的別名。" -#: ../../library/typing.rst:2831 +#: ../../library/typing.rst:3171 msgid "" ":class:`tuple` and ``Tuple`` are special-cased in the type system; see :ref:" "`annotating-tuples` for more details." msgstr "" -#: ../../library/typing.rst:2834 +#: ../../library/typing.rst:3174 msgid "" ":class:`builtins.tuple ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2840 +#: ../../library/typing.rst:3180 msgid "Deprecated alias to :class:`type`." -msgstr "" +msgstr "棄用 :class:`type` 的別名。" -#: ../../library/typing.rst:2842 +#: ../../library/typing.rst:3182 msgid "" "See :ref:`type-of-class-objects` for details on using :class:`type` or " "``typing.Type`` in type annotations." msgstr "" -#: ../../library/typing.rst:2847 +#: ../../library/typing.rst:3187 msgid "" ":class:`builtins.type ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2854 +#: ../../library/typing.rst:3194 msgid "Aliases to types in :mod:`collections`" -msgstr "" +msgstr ":mod:`collections` 中型別的別名" -#: ../../library/typing.rst:2858 +#: ../../library/typing.rst:3198 msgid "Deprecated alias to :class:`collections.defaultdict`." -msgstr "" +msgstr "棄用 :class:`collections.defaultdict` 的別名。" -#: ../../library/typing.rst:2862 +#: ../../library/typing.rst:3202 msgid "" ":class:`collections.defaultdict` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2868 +#: ../../library/typing.rst:3208 msgid "Deprecated alias to :class:`collections.OrderedDict`." -msgstr "" +msgstr "棄用 :class:`collections.OrderedDict` 的別名。" -#: ../../library/typing.rst:2872 +#: ../../library/typing.rst:3212 msgid "" ":class:`collections.OrderedDict` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2878 +#: ../../library/typing.rst:3218 msgid "Deprecated alias to :class:`collections.ChainMap`." -msgstr "" +msgstr "棄用 :class:`collections.ChainMap` 的別名。" -#: ../../library/typing.rst:2883 +#: ../../library/typing.rst:3223 msgid "" ":class:`collections.ChainMap` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2889 +#: ../../library/typing.rst:3229 msgid "Deprecated alias to :class:`collections.Counter`." -msgstr "" +msgstr "棄用 :class:`collections.Counter` 的別名。" -#: ../../library/typing.rst:2894 +#: ../../library/typing.rst:3234 msgid "" ":class:`collections.Counter` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2900 +#: ../../library/typing.rst:3240 msgid "Deprecated alias to :class:`collections.deque`." -msgstr "" +msgstr "棄用 :class:`collections.deque` 的別名。" -#: ../../library/typing.rst:2905 +#: ../../library/typing.rst:3245 msgid "" ":class:`collections.deque` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2912 +#: ../../library/typing.rst:3252 msgid "Aliases to other concrete types" msgstr "" -#: ../../library/typing.rst:2917 +#: ../../library/typing.rst:3257 +msgid "" +"The ``typing.io`` namespace is deprecated and will be removed. These types " +"should be directly imported from ``typing`` instead." +msgstr "" + +#: ../../library/typing.rst:3261 msgid "" "Deprecated aliases corresponding to the return types from :func:`re.compile` " "and :func:`re.match`." msgstr "" -#: ../../library/typing.rst:2920 +#: ../../library/typing.rst:3264 msgid "" "These types (and the corresponding functions) are generic over :data:" "`AnyStr`. ``Pattern`` can be specialised as ``Pattern[str]`` or " @@ -2785,367 +3059,391 @@ msgid "" "``Match[bytes]``." msgstr "" -#: ../../library/typing.rst:2928 +#: ../../library/typing.rst:3272 msgid "" "The ``typing.re`` namespace is deprecated and will be removed. These types " "should be directly imported from ``typing`` instead." msgstr "" -#: ../../library/typing.rst:2929 +#: ../../library/typing.rst:3273 msgid "" "Classes ``Pattern`` and ``Match`` from :mod:`re` now support ``[]``. See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2935 +#: ../../library/typing.rst:3279 msgid "Deprecated alias for :class:`str`." -msgstr "" +msgstr "棄用 :class:`str` 的別名。" -#: ../../library/typing.rst:2937 +#: ../../library/typing.rst:3281 msgid "" "``Text`` 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:2941 +#: ../../library/typing.rst:3285 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:2949 +#: ../../library/typing.rst:3293 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 " "planned, but users are encouraged to use :class:`str` instead of ``Text``." msgstr "" -#: ../../library/typing.rst:2959 +#: ../../library/typing.rst:3303 msgid "Aliases to container ABCs in :mod:`collections.abc`" -msgstr "" +msgstr ":mod:`collections.abc` 中容器 ABC 的別名" -#: ../../library/typing.rst:2963 +#: ../../library/typing.rst:3307 msgid "Deprecated alias to :class:`collections.abc.Set`." -msgstr "" +msgstr "棄用 :class:`collections.abc.Set` 的別名。" -#: ../../library/typing.rst:2965 +#: ../../library/typing.rst:3309 msgid "" ":class:`collections.abc.Set` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2971 +#: ../../library/typing.rst:3315 msgid "" "This type represents the types :class:`bytes`, :class:`bytearray`, and :" "class:`memoryview` of byte sequences." msgstr "" -#: ../../library/typing.rst:2975 +#: ../../library/typing.rst:3319 msgid "" "Prefer :class:`collections.abc.Buffer`, or a union like ``bytes | bytearray " "| memoryview``." msgstr "" -#: ../../library/typing.rst:2979 +#: ../../library/typing.rst:3323 msgid "Deprecated alias to :class:`collections.abc.Collection`." -msgstr "" +msgstr "棄用 :class:`collections.abc.Collection` 的別名。" -#: ../../library/typing.rst:2983 +#: ../../library/typing.rst:3327 msgid "" ":class:`collections.abc.Collection` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2989 +#: ../../library/typing.rst:3333 msgid "Deprecated alias to :class:`collections.abc.Container`." -msgstr "" +msgstr "棄用 :class:`collections.abc.Container` 的別名。" -#: ../../library/typing.rst:2991 +#: ../../library/typing.rst:3335 msgid "" ":class:`collections.abc.Container` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:2997 +#: ../../library/typing.rst:3341 msgid "Deprecated alias to :class:`collections.abc.ItemsView`." -msgstr "" +msgstr "棄用 :class:`collections.abc.ItemsView` 的別名。" -#: ../../library/typing.rst:2999 +#: ../../library/typing.rst:3343 msgid "" ":class:`collections.abc.ItemsView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3005 +#: ../../library/typing.rst:3349 msgid "Deprecated alias to :class:`collections.abc.KeysView`." -msgstr "" +msgstr "棄用 :class:`collections.abc.KeysView` 的別名。" -#: ../../library/typing.rst:3007 +#: ../../library/typing.rst:3351 msgid "" ":class:`collections.abc.KeysView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3013 +#: ../../library/typing.rst:3357 msgid "Deprecated alias to :class:`collections.abc.Mapping`." -msgstr "" +msgstr "棄用 :class:`collections.abc.Mapping` 的別名。" -#: ../../library/typing.rst:3020 +#: ../../library/typing.rst:3364 msgid "" ":class:`collections.abc.Mapping` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3026 +#: ../../library/typing.rst:3370 msgid "Deprecated alias to :class:`collections.abc.MappingView`." -msgstr "" +msgstr "棄用 :class:`collections.abc.MappingView` 的別名。" -#: ../../library/typing.rst:3028 +#: ../../library/typing.rst:3372 msgid "" ":class:`collections.abc.MappingView` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3034 +#: ../../library/typing.rst:3378 msgid "Deprecated alias to :class:`collections.abc.MutableMapping`." -msgstr "" +msgstr "棄用 :class:`collections.abc.MutableMapping` 的別名。" -#: ../../library/typing.rst:3036 +#: ../../library/typing.rst:3380 msgid "" ":class:`collections.abc.MutableMapping` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3043 +#: ../../library/typing.rst:3387 msgid "Deprecated alias to :class:`collections.abc.MutableSequence`." -msgstr "" +msgstr "棄用 :class:`collections.abc.MutableSequence` 的別名。" -#: ../../library/typing.rst:3045 +#: ../../library/typing.rst:3389 msgid "" ":class:`collections.abc.MutableSequence` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3052 +#: ../../library/typing.rst:3396 msgid "Deprecated alias to :class:`collections.abc.MutableSet`." -msgstr "" +msgstr "棄用 :class:`collections.abc.MutableSet` 的別名。" -#: ../../library/typing.rst:3054 +#: ../../library/typing.rst:3398 msgid "" ":class:`collections.abc.MutableSet` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3060 +#: ../../library/typing.rst:3404 msgid "Deprecated alias to :class:`collections.abc.Sequence`." -msgstr "" +msgstr "棄用 :class:`collections.abc.Sequence` 的別名。" -#: ../../library/typing.rst:3062 +#: ../../library/typing.rst:3406 msgid "" ":class:`collections.abc.Sequence` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3068 +#: ../../library/typing.rst:3412 msgid "Deprecated alias to :class:`collections.abc.ValuesView`." -msgstr "" +msgstr "棄用 :class:`collections.abc.ValuesView` 的別名。" -#: ../../library/typing.rst:3070 +#: ../../library/typing.rst:3414 msgid "" ":class:`collections.abc.ValuesView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3077 +#: ../../library/typing.rst:3421 msgid "Aliases to asynchronous ABCs in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:3081 +#: ../../library/typing.rst:3425 msgid "Deprecated alias to :class:`collections.abc.Coroutine`." -msgstr "" +msgstr "棄用 :class:`collections.abc.Coroutine` 的別名。" -#: ../../library/typing.rst:3083 +#: ../../library/typing.rst:3427 msgid "" "The variance and order of type variables correspond to those of :class:" "`Generator`, for example::" msgstr "" -#: ../../library/typing.rst:3094 +#: ../../library/typing.rst:3438 msgid "" ":class:`collections.abc.Coroutine` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3100 +#: ../../library/typing.rst:3444 msgid "Deprecated alias to :class:`collections.abc.AsyncGenerator`." -msgstr "" +msgstr "棄用 :class:`collections.abc.AsyncGenerator` 的別名。" -#: ../../library/typing.rst:3102 +#: ../../library/typing.rst:3446 msgid "" "An async generator can be annotated by the generic type " "``AsyncGenerator[YieldType, SendType]``. For example::" msgstr "" -#: ../../library/typing.rst:3111 +#: ../../library/typing.rst:3455 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:3115 +#: ../../library/typing.rst:3459 msgid "" "If your generator will only yield values, set the ``SendType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:3123 +#: ../../library/typing.rst:3467 msgid "" "Alternatively, annotate your generator as having a return type of either " "``AsyncIterable[YieldType]`` or ``AsyncIterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:3133 +#: ../../library/typing.rst:3477 msgid "" ":class:`collections.abc.AsyncGenerator` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3140 +#: ../../library/typing.rst:3484 msgid "Deprecated alias to :class:`collections.abc.AsyncIterable`." -msgstr "" +msgstr "棄用 :class:`collections.abc.AsyncIterable` 的別名。" -#: ../../library/typing.rst:3144 +#: ../../library/typing.rst:3488 msgid "" ":class:`collections.abc.AsyncIterable` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3150 +#: ../../library/typing.rst:3494 msgid "Deprecated alias to :class:`collections.abc.AsyncIterator`." -msgstr "" +msgstr "棄用 :class:`collections.abc.AsyncIterator` 的別名。" -#: ../../library/typing.rst:3154 +#: ../../library/typing.rst:3498 msgid "" ":class:`collections.abc.AsyncIterator` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3160 +#: ../../library/typing.rst:3504 msgid "Deprecated alias to :class:`collections.abc.Awaitable`." -msgstr "" +msgstr "棄用 :class:`collections.abc.Awaitable` 的別名。" -#: ../../library/typing.rst:3164 +#: ../../library/typing.rst:3508 msgid "" ":class:`collections.abc.Awaitable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3171 +#: ../../library/typing.rst:3515 msgid "Aliases to other ABCs in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:3175 +#: ../../library/typing.rst:3519 msgid "Deprecated alias to :class:`collections.abc.Iterable`." -msgstr "" +msgstr "棄用 :class:`collections.abc.Iterable` 的別名。" -#: ../../library/typing.rst:3177 +#: ../../library/typing.rst:3521 msgid "" ":class:`collections.abc.Iterable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3183 +#: ../../library/typing.rst:3527 msgid "Deprecated alias to :class:`collections.abc.Iterator`." -msgstr "" +msgstr "棄用 :class:`collections.abc.Iterator` 的別名。" -#: ../../library/typing.rst:3185 +#: ../../library/typing.rst:3529 msgid "" ":class:`collections.abc.Iterator` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3191 -msgid "Deprecated alias to :class:`collections.abc.Generator`." +#: ../../library/typing.rst:3535 +msgid "Deprecated alias to :class:`collections.abc.Callable`." +msgstr "棄用 :class:`collections.abc.Callable` 的別名。" + +#: ../../library/typing.rst:3537 +msgid "" +"See :ref:`annotating-callables` for details on how to use :class:" +"`collections.abc.Callable` and ``typing.Callable`` in type annotations." msgstr "" -#: ../../library/typing.rst:3193 +#: ../../library/typing.rst:3540 +msgid "" +":class:`collections.abc.Callable` now supports subscripting (``[]``). See :" +"pep:`585` and :ref:`types-genericalias`." +msgstr "" + +#: ../../library/typing.rst:3550 +msgid "Deprecated alias to :class:`collections.abc.Generator`." +msgstr "棄用 :class:`collections.abc.Generator` 的別名。" + +#: ../../library/typing.rst:3552 msgid "" "A generator can be annotated by the generic type ``Generator[YieldType, " "SendType, ReturnType]``. For example::" msgstr "" -#: ../../library/typing.rst:3202 +#: ../../library/typing.rst:3561 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:3206 +#: ../../library/typing.rst:3565 msgid "" "If your generator will only yield values, set the ``SendType`` and " "``ReturnType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:3214 +#: ../../library/typing.rst:3573 msgid "" "Alternatively, annotate your generator as having a return type of either " "``Iterable[YieldType]`` or ``Iterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:3222 +#: ../../library/typing.rst:3581 msgid "" ":class:`collections.abc.Generator` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3228 -msgid "Alias to :class:`collections.abc.Hashable`." -msgstr "" +#: ../../library/typing.rst:3587 +msgid "Deprecated alias to :class:`collections.abc.Hashable`." +msgstr "棄用 :class:`collections.abc.Hashable` 的別名。" + +#: ../../library/typing.rst:3589 +msgid "Use :class:`collections.abc.Hashable` directly instead." +msgstr "改為直接使用 :class:`collections.abc.Hashable`。" -#: ../../library/typing.rst:3232 +#: ../../library/typing.rst:3594 msgid "Deprecated alias to :class:`collections.abc.Reversible`." -msgstr "" +msgstr "棄用 :class:`collections.abc.Reversible` 的別名。" -#: ../../library/typing.rst:3234 +#: ../../library/typing.rst:3596 msgid "" ":class:`collections.abc.Reversible` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3240 -msgid "Alias to :class:`collections.abc.Sized`." -msgstr "" +#: ../../library/typing.rst:3602 +msgid "Deprecated alias to :class:`collections.abc.Sized`." +msgstr "棄用 :class:`collections.abc.Sized` 的別名。" -#: ../../library/typing.rst:3245 +#: ../../library/typing.rst:3604 +msgid "Use :class:`collections.abc.Sized` directly instead." +msgstr "改為直接使用 :class:`collections.abc.Sized`。" + +#: ../../library/typing.rst:3610 msgid "Aliases to :mod:`contextlib` ABCs" -msgstr "" +msgstr ":mod:`contextlib` ABC 的別名" -#: ../../library/typing.rst:3249 +#: ../../library/typing.rst:3614 msgid "Deprecated alias to :class:`contextlib.AbstractContextManager`." msgstr "" -#: ../../library/typing.rst:3254 +#: ../../library/typing.rst:3619 msgid "" ":class:`contextlib.AbstractContextManager` now supports subscripting " "(``[]``). See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3261 +#: ../../library/typing.rst:3626 msgid "Deprecated alias to :class:`contextlib.AbstractAsyncContextManager`." msgstr "" -#: ../../library/typing.rst:3266 +#: ../../library/typing.rst:3631 msgid "" ":class:`contextlib.AbstractAsyncContextManager` now supports subscripting " "(``[]``). See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3272 +#: ../../library/typing.rst:3637 msgid "Deprecation Timeline of Major Features" msgstr "" -#: ../../library/typing.rst:3274 +#: ../../library/typing.rst:3639 msgid "" "Certain features in ``typing`` are deprecated and may be removed in a future " "version of Python. The following table summarizes major deprecations for " @@ -3153,74 +3451,99 @@ msgid "" "listed." msgstr "" -#: ../../library/typing.rst:3279 +#: ../../library/typing.rst:3646 msgid "Feature" msgstr "" -#: ../../library/typing.rst:3279 +#: ../../library/typing.rst:3647 msgid "Deprecated in" msgstr "棄用於" -#: ../../library/typing.rst:3279 +#: ../../library/typing.rst:3648 msgid "Projected removal" msgstr "" -#: ../../library/typing.rst:3279 +#: ../../library/typing.rst:3649 msgid "PEP/issue" msgstr "" -#: ../../library/typing.rst:3281 +#: ../../library/typing.rst:3650 msgid "``typing.io`` and ``typing.re`` submodules" -msgstr "" +msgstr "``typing.io`` 和 ``typing.re`` 子模組" -#: ../../library/typing.rst:3281 +#: ../../library/typing.rst:3651 msgid "3.8" msgstr "3.8" -#: ../../library/typing.rst:3281 +#: ../../library/typing.rst:3652 msgid "3.13" msgstr "3.13" -#: ../../library/typing.rst:3281 +#: ../../library/typing.rst:3653 msgid ":issue:`38291`" msgstr ":issue:`38291`" -#: ../../library/typing.rst:3284 +#: ../../library/typing.rst:3654 msgid "``typing`` versions of standard collections" msgstr "" -#: ../../library/typing.rst:3284 ../../library/typing.rst:3287 +#: ../../library/typing.rst:3655 ../../library/typing.rst:3659 msgid "3.9" msgstr "3.9" -#: ../../library/typing.rst:3284 ../../library/typing.rst:3289 -msgid "Undecided" +#: ../../library/typing.rst:3656 +msgid "Undecided (see :ref:`deprecated-aliases` for more information)" msgstr "" -#: ../../library/typing.rst:3284 +#: ../../library/typing.rst:3657 msgid ":pep:`585`" msgstr ":pep:`585`" -#: ../../library/typing.rst:3287 -msgid "``typing.ByteString``" -msgstr "``typing.Text``" +#: ../../library/typing.rst:3658 +msgid ":class:`typing.ByteString`" +msgstr ":class:`typing.ByteString`" -#: ../../library/typing.rst:3287 +#: ../../library/typing.rst:3660 msgid "3.14" msgstr "3.14" -#: ../../library/typing.rst:3287 +#: ../../library/typing.rst:3661 msgid ":gh:`91896`" msgstr ":gh:`91896`" -#: ../../library/typing.rst:3289 -msgid "``typing.Text``" -msgstr "``typing.Text``" +#: ../../library/typing.rst:3662 +msgid ":data:`typing.Text`" +msgstr ":data:`typing.Text`" -#: ../../library/typing.rst:3289 +#: ../../library/typing.rst:3663 msgid "3.11" msgstr "3.11" -#: ../../library/typing.rst:3289 +#: ../../library/typing.rst:3664 ../../library/typing.rst:3668 +#: ../../library/typing.rst:3672 +msgid "Undecided" +msgstr "" + +#: ../../library/typing.rst:3665 msgid ":gh:`92332`" msgstr ":gh:`92332`" + +#: ../../library/typing.rst:3666 +msgid ":class:`typing.Hashable` and :class:`typing.Sized`" +msgstr ":class:`typing.Hashable` 和 :class:`typing.Sized`。" + +#: ../../library/typing.rst:3667 ../../library/typing.rst:3671 +msgid "3.12" +msgstr "" + +#: ../../library/typing.rst:3669 +msgid ":gh:`94309`" +msgstr ":gh:`94309`" + +#: ../../library/typing.rst:3670 +msgid ":data:`typing.TypeAlias`" +msgstr ":data:`typing.TypeAlias`" + +#: ../../library/typing.rst:3673 +msgid ":pep:`695`" +msgstr ":pep:`695`" diff --git a/library/unittest.mock-examples.po b/library/unittest.mock-examples.po index 926c4d8e5e..badb5f9e01 100644 --- a/library/unittest.mock-examples.po +++ b/library/unittest.mock-examples.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-03 00:17+0000\n" +"POT-Creation-Date: 2023-09-09 00:03+0000\n" "PO-Revision-Date: 2016-11-19 00:35+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -310,18 +310,29 @@ msgid "" "*spec_set* instead of *spec*." msgstr "" -#: ../../library/unittest.mock-examples.rst:365 +#: ../../library/unittest.mock-examples.rst:364 +msgid "Using side_effect to return per file content" +msgstr "" + +#: ../../library/unittest.mock-examples.rst:366 +msgid "" +":func:`mock_open` is used to patch :func:`open` method. :attr:`~Mock." +"side_effect` can be used to return a new Mock object per call. This can be " +"used to return different contents per file stored in a dictionary::" +msgstr "" + +#: ../../library/unittest.mock-examples.rst:389 msgid "Patch Decorators" msgstr "" -#: ../../library/unittest.mock-examples.rst:369 +#: ../../library/unittest.mock-examples.rst:393 msgid "" "With :func:`patch` it matters that you patch objects in the namespace where " "they are looked up. This is normally straightforward, but for a quick guide " "read :ref:`where to patch `." msgstr "" -#: ../../library/unittest.mock-examples.rst:374 +#: ../../library/unittest.mock-examples.rst:398 msgid "" "A common need in tests is to patch a class attribute or a module attribute, " "for example patching a builtin or patching a class in a module to test that " @@ -330,7 +341,7 @@ msgid "" "tests and cause hard to diagnose problems." msgstr "" -#: ../../library/unittest.mock-examples.rst:380 +#: ../../library/unittest.mock-examples.rst:404 msgid "" "mock provides three convenient decorators for this: :func:`patch`, :func:" "`patch.object` and :func:`patch.dict`. ``patch`` takes a single string, of " @@ -341,37 +352,37 @@ msgid "" "to patch it with." msgstr "" -#: ../../library/unittest.mock-examples.rst:388 +#: ../../library/unittest.mock-examples.rst:412 msgid "``patch.object``::" msgstr "" -#: ../../library/unittest.mock-examples.rst:405 +#: ../../library/unittest.mock-examples.rst:429 msgid "" "If you are patching a module (including :mod:`builtins`) then use :func:" "`patch` instead of :func:`patch.object`:" msgstr "" -#: ../../library/unittest.mock-examples.rst:415 +#: ../../library/unittest.mock-examples.rst:439 msgid "" "The module name can be 'dotted', in the form ``package.module`` if needed::" msgstr "" -#: ../../library/unittest.mock-examples.rst:424 +#: ../../library/unittest.mock-examples.rst:448 msgid "A nice pattern is to actually decorate test methods themselves:" msgstr "" -#: ../../library/unittest.mock-examples.rst:435 +#: ../../library/unittest.mock-examples.rst:459 msgid "" "If you want to patch with a Mock, you can use :func:`patch` with only one " "argument (or :func:`patch.object` with two arguments). The mock will be " "created for you and passed into the test function / method:" msgstr "" -#: ../../library/unittest.mock-examples.rst:447 +#: ../../library/unittest.mock-examples.rst:471 msgid "You can stack up multiple patch decorators using this pattern::" msgstr "" -#: ../../library/unittest.mock-examples.rst:458 +#: ../../library/unittest.mock-examples.rst:482 msgid "" "When you nest patch decorators the mocks are passed in to the decorated " "function in the same order they applied (the normal *Python* order that " @@ -379,45 +390,45 @@ msgid "" "above the mock for ``test_module.ClassName2`` is passed in first." msgstr "" -#: ../../library/unittest.mock-examples.rst:463 +#: ../../library/unittest.mock-examples.rst:487 msgid "" "There is also :func:`patch.dict` for setting values in a dictionary just " "during a scope and restoring the dictionary to its original state when the " "test ends:" msgstr "" -#: ../../library/unittest.mock-examples.rst:474 +#: ../../library/unittest.mock-examples.rst:498 msgid "" "``patch``, ``patch.object`` and ``patch.dict`` can all be used as context " "managers." msgstr "" -#: ../../library/unittest.mock-examples.rst:476 +#: ../../library/unittest.mock-examples.rst:500 msgid "" "Where you use :func:`patch` to create a mock for you, you can get a " "reference to the mock using the \"as\" form of the with statement:" msgstr "" -#: ../../library/unittest.mock-examples.rst:491 +#: ../../library/unittest.mock-examples.rst:515 msgid "" "As an alternative ``patch``, ``patch.object`` and ``patch.dict`` can be used " "as class decorators. When used in this way it is the same as applying the " "decorator individually to every method whose name starts with \"test\"." msgstr "" -#: ../../library/unittest.mock-examples.rst:499 +#: ../../library/unittest.mock-examples.rst:523 msgid "Further Examples" msgstr "" -#: ../../library/unittest.mock-examples.rst:502 +#: ../../library/unittest.mock-examples.rst:526 msgid "Here are some more examples for some slightly more advanced scenarios." msgstr "" -#: ../../library/unittest.mock-examples.rst:506 +#: ../../library/unittest.mock-examples.rst:530 msgid "Mocking chained calls" msgstr "" -#: ../../library/unittest.mock-examples.rst:508 +#: ../../library/unittest.mock-examples.rst:532 msgid "" "Mocking chained calls is actually straightforward with mock once you " "understand the :attr:`~Mock.return_value` attribute. When a mock is called " @@ -425,31 +436,31 @@ msgid "" "called, a new :class:`Mock` is created." msgstr "" -#: ../../library/unittest.mock-examples.rst:513 +#: ../../library/unittest.mock-examples.rst:537 msgid "" "This means that you can see how the object returned from a call to a mocked " "object has been used by interrogating the ``return_value`` mock:" msgstr "" -#: ../../library/unittest.mock-examples.rst:521 +#: ../../library/unittest.mock-examples.rst:545 msgid "" "From here it is a simple step to configure and then make assertions about " "chained calls. Of course another alternative is writing your code in a more " "testable way in the first place..." msgstr "" -#: ../../library/unittest.mock-examples.rst:525 +#: ../../library/unittest.mock-examples.rst:549 msgid "So, suppose we have some code that looks a little bit like this:" msgstr "" -#: ../../library/unittest.mock-examples.rst:534 +#: ../../library/unittest.mock-examples.rst:558 msgid "" "Assuming that ``BackendProvider`` is already well tested, how do we test " "``method()``? Specifically, we want to test that the code section ``# more " "code`` uses the response object in the correct way." msgstr "" -#: ../../library/unittest.mock-examples.rst:538 +#: ../../library/unittest.mock-examples.rst:562 msgid "" "As this chain of calls is made from an instance attribute we can monkey " "patch the ``backend`` attribute on a ``Something`` instance. In this " @@ -459,26 +470,26 @@ msgid "" "response object uses the builtin :func:`open` as its ``spec``." msgstr "" -#: ../../library/unittest.mock-examples.rst:545 +#: ../../library/unittest.mock-examples.rst:569 msgid "" "To do this we create a mock instance as our mock backend and create a mock " "response object for it. To set the response as the return value for that " "final ``start_call`` we could do this::" msgstr "" -#: ../../library/unittest.mock-examples.rst:551 +#: ../../library/unittest.mock-examples.rst:575 msgid "" "We can do that in a slightly nicer way using the :meth:`~Mock." "configure_mock` method to directly set the return value for us::" msgstr "" -#: ../../library/unittest.mock-examples.rst:560 +#: ../../library/unittest.mock-examples.rst:584 msgid "" "With these we monkey patch the \"mock backend\" in place and can make the " "real call::" msgstr "" -#: ../../library/unittest.mock-examples.rst:566 +#: ../../library/unittest.mock-examples.rst:590 msgid "" "Using :attr:`~Mock.mock_calls` we can check the chained call with a single " "assert. A chained call is several calls in one line of code, so there will " @@ -486,42 +497,42 @@ msgid "" "create this list of calls for us::" msgstr "" -#: ../../library/unittest.mock-examples.rst:577 +#: ../../library/unittest.mock-examples.rst:601 msgid "Partial mocking" msgstr "" -#: ../../library/unittest.mock-examples.rst:579 +#: ../../library/unittest.mock-examples.rst:603 msgid "" "In some tests I wanted to mock out a call to :meth:`datetime.date.today` to " "return a known date, but I didn't want to prevent the code under test from " "creating new date objects. Unfortunately :class:`datetime.date` is written " -"in C, and so I couldn't just monkey-patch out the static :meth:`date.today` " -"method." +"in C, and so I couldn't just monkey-patch out the static :meth:`datetime." +"date.today` method." msgstr "" -#: ../../library/unittest.mock-examples.rst:584 +#: ../../library/unittest.mock-examples.rst:608 msgid "" "I found a simple way of doing this that involved effectively wrapping the " "date class with a mock, but passing through calls to the constructor to the " "real class (and returning real instances)." msgstr "" -#: ../../library/unittest.mock-examples.rst:588 +#: ../../library/unittest.mock-examples.rst:612 msgid "" "The :func:`patch decorator ` is used here to mock out the ``date`` " -"class in the module under test. The :attr:`side_effect` attribute on the " -"mock date class is then set to a lambda function that returns a real date. " -"When the mock date class is called a real date will be constructed and " +"class in the module under test. The :attr:`~Mock.side_effect` attribute on " +"the mock date class is then set to a lambda function that returns a real " +"date. When the mock date class is called a real date will be constructed and " "returned by ``side_effect``. ::" msgstr "" -#: ../../library/unittest.mock-examples.rst:602 +#: ../../library/unittest.mock-examples.rst:626 msgid "" "Note that we don't patch :class:`datetime.date` globally, we patch ``date`` " "in the module that *uses* it. See :ref:`where to patch `." msgstr "" -#: ../../library/unittest.mock-examples.rst:605 +#: ../../library/unittest.mock-examples.rst:629 msgid "" "When ``date.today()`` is called a known date is returned, but calls to the " "``date(...)`` constructor still return normal dates. Without this you can " @@ -529,30 +540,30 @@ msgid "" "algorithm as the code under test, which is a classic testing anti-pattern." msgstr "" -#: ../../library/unittest.mock-examples.rst:610 +#: ../../library/unittest.mock-examples.rst:634 msgid "" "Calls to the date constructor are recorded in the ``mock_date`` attributes " "(``call_count`` and friends) which may also be useful for your tests." msgstr "" -#: ../../library/unittest.mock-examples.rst:613 +#: ../../library/unittest.mock-examples.rst:637 msgid "" "An alternative way of dealing with mocking dates, or other builtin classes, " "is discussed in `this blog entry `_." msgstr "" -#: ../../library/unittest.mock-examples.rst:619 +#: ../../library/unittest.mock-examples.rst:643 msgid "Mocking a Generator Method" msgstr "" -#: ../../library/unittest.mock-examples.rst:621 +#: ../../library/unittest.mock-examples.rst:645 msgid "" "A Python generator is a function or method that uses the :keyword:`yield` " "statement to return a series of values when iterated over [#]_." msgstr "" -#: ../../library/unittest.mock-examples.rst:624 +#: ../../library/unittest.mock-examples.rst:648 msgid "" "A generator method / function is called to return the generator object. It " "is the generator object that is then iterated over. The protocol method for " @@ -560,23 +571,23 @@ msgid "" "`MagicMock`." msgstr "" -#: ../../library/unittest.mock-examples.rst:629 +#: ../../library/unittest.mock-examples.rst:653 msgid "" "Here's an example class with an \"iter\" method implemented as a generator:" msgstr "" -#: ../../library/unittest.mock-examples.rst:641 +#: ../../library/unittest.mock-examples.rst:665 msgid "How would we mock this class, and in particular its \"iter\" method?" msgstr "" -#: ../../library/unittest.mock-examples.rst:643 +#: ../../library/unittest.mock-examples.rst:667 msgid "" "To configure the values returned from the iteration (implicit in the call " "to :class:`list`), we need to configure the object returned by the call to " "``foo.iter()``." msgstr "" -#: ../../library/unittest.mock-examples.rst:651 +#: ../../library/unittest.mock-examples.rst:675 msgid "" "There are also generator expressions and more `advanced uses `_ of generators, but we aren't concerned " @@ -585,11 +596,11 @@ msgid "" "com/generators/>`_." msgstr "" -#: ../../library/unittest.mock-examples.rst:659 +#: ../../library/unittest.mock-examples.rst:683 msgid "Applying the same patch to every test method" msgstr "" -#: ../../library/unittest.mock-examples.rst:661 +#: ../../library/unittest.mock-examples.rst:685 msgid "" "If you want several patches in place for multiple test methods the obvious " "way is to apply the patch decorators to every method. This can feel like " @@ -599,14 +610,14 @@ msgid "" "start with ``test``::" msgstr "" -#: ../../library/unittest.mock-examples.rst:685 +#: ../../library/unittest.mock-examples.rst:709 msgid "" "An alternative way of managing patches is to use the :ref:`start-and-stop`. " "These allow you to move the patching into your ``setUp`` and ``tearDown`` " "methods. ::" msgstr "" -#: ../../library/unittest.mock-examples.rst:702 +#: ../../library/unittest.mock-examples.rst:726 msgid "" "If you use this technique you must ensure that the patching is \"undone\" by " "calling ``stop``. This can be fiddlier than you might think, because if an " @@ -614,11 +625,11 @@ msgid "" "`unittest.TestCase.addCleanup` makes this easier::" msgstr "" -#: ../../library/unittest.mock-examples.rst:720 +#: ../../library/unittest.mock-examples.rst:744 msgid "Mocking Unbound Methods" msgstr "" -#: ../../library/unittest.mock-examples.rst:722 +#: ../../library/unittest.mock-examples.rst:746 msgid "" "Whilst writing tests today I needed to patch an *unbound method* (patching " "the method on the class rather than on the instance). I needed self to be " @@ -632,7 +643,7 @@ msgid "" "becomes a nuisance." msgstr "" -#: ../../library/unittest.mock-examples.rst:733 +#: ../../library/unittest.mock-examples.rst:757 msgid "" "If you pass ``autospec=True`` to patch then it does the patching with a " "*real* function object. This function object has the same signature as the " @@ -644,30 +655,30 @@ msgid "" "exactly what I wanted:" msgstr "" -#: ../../library/unittest.mock-examples.rst:754 +#: ../../library/unittest.mock-examples.rst:778 msgid "" "If we don't use ``autospec=True`` then the unbound method is patched out " "with a Mock instance instead, and isn't called with ``self``." msgstr "" -#: ../../library/unittest.mock-examples.rst:759 +#: ../../library/unittest.mock-examples.rst:783 msgid "Checking multiple calls with mock" msgstr "" -#: ../../library/unittest.mock-examples.rst:761 +#: ../../library/unittest.mock-examples.rst:785 msgid "" "mock has a nice API for making assertions about how your mock objects are " "used." msgstr "" -#: ../../library/unittest.mock-examples.rst:768 +#: ../../library/unittest.mock-examples.rst:792 msgid "" -"If your mock is only being called once you can use the :meth:" -"`assert_called_once_with` method that also asserts that the :attr:" -"`call_count` is one." +"If your mock is only being called once you can use the :meth:`~Mock." +"assert_called_once_with` method that also asserts that the :attr:`~Mock." +"call_count` is one." msgstr "" -#: ../../library/unittest.mock-examples.rst:779 +#: ../../library/unittest.mock-examples.rst:803 msgid "" "Both ``assert_called_with`` and ``assert_called_once_with`` make assertions " "about the *most recent* call. If your mock is going to be called several " @@ -675,7 +686,7 @@ msgid "" "attr:`~Mock.call_args_list`:" msgstr "" -#: ../../library/unittest.mock-examples.rst:791 +#: ../../library/unittest.mock-examples.rst:815 msgid "" "The :data:`call` helper makes it easy to make assertions about these calls. " "You can build up a list of expected calls and compare it to " @@ -683,11 +694,11 @@ msgid "" "``call_args_list``:" msgstr "" -#: ../../library/unittest.mock-examples.rst:801 +#: ../../library/unittest.mock-examples.rst:825 msgid "Coping with mutable arguments" msgstr "" -#: ../../library/unittest.mock-examples.rst:803 +#: ../../library/unittest.mock-examples.rst:827 msgid "" "Another situation is rare, but can bite you, is when your mock is called " "with mutable arguments. ``call_args`` and ``call_args_list`` store " @@ -696,57 +707,58 @@ msgid "" "when the mock was called." msgstr "" -#: ../../library/unittest.mock-examples.rst:808 +#: ../../library/unittest.mock-examples.rst:832 msgid "" "Here's some example code that shows the problem. Imagine the following " "functions defined in 'mymodule'::" msgstr "" -#: ../../library/unittest.mock-examples.rst:819 +#: ../../library/unittest.mock-examples.rst:843 msgid "" "When we try to test that ``grob`` calls ``frob`` with the correct argument " "look what happens::" msgstr "" -#: ../../library/unittest.mock-examples.rst:834 +#: ../../library/unittest.mock-examples.rst:858 msgid "" "One possibility would be for mock to copy the arguments you pass in. This " "could then cause problems if you do assertions that rely on object identity " "for equality." msgstr "" -#: ../../library/unittest.mock-examples.rst:838 +#: ../../library/unittest.mock-examples.rst:862 msgid "" -"Here's one solution that uses the :attr:`side_effect` functionality. If you " -"provide a ``side_effect`` function for a mock then ``side_effect`` will be " -"called with the same args as the mock. This gives us an opportunity to copy " -"the arguments and store them for later assertions. In this example I'm using " -"*another* mock to store the arguments so that I can use the mock methods for " -"doing the assertion. Again a helper function sets this up for me. ::" +"Here's one solution that uses the :attr:`~Mock.side_effect` functionality. " +"If you provide a ``side_effect`` function for a mock then ``side_effect`` " +"will be called with the same args as the mock. This gives us an opportunity " +"to copy the arguments and store them for later assertions. In this example " +"I'm using *another* mock to store the arguments so that I can use the mock " +"methods for doing the assertion. Again a helper function sets this up for " +"me. ::" msgstr "" -#: ../../library/unittest.mock-examples.rst:867 +#: ../../library/unittest.mock-examples.rst:891 msgid "" "``copy_call_args`` is called with the mock that will be called. It returns a " "new mock that we do the assertion on. The ``side_effect`` function makes a " "copy of the args and calls our ``new_mock`` with the copy." msgstr "" -#: ../../library/unittest.mock-examples.rst:873 +#: ../../library/unittest.mock-examples.rst:897 msgid "" "If your mock is only going to be used once there is an easier way of " "checking arguments at the point they are called. You can simply do the " "checking inside a ``side_effect`` function." msgstr "" -#: ../../library/unittest.mock-examples.rst:887 +#: ../../library/unittest.mock-examples.rst:911 msgid "" "An alternative approach is to create a subclass of :class:`Mock` or :class:" "`MagicMock` that copies (using :func:`copy.deepcopy`) the arguments. Here's " "an example implementation:" msgstr "" -#: ../../library/unittest.mock-examples.rst:911 +#: ../../library/unittest.mock-examples.rst:935 msgid "" "When you subclass ``Mock`` or ``MagicMock`` all dynamically created " "attributes, and the ``return_value`` will use your subclass automatically. " @@ -754,18 +766,18 @@ msgid "" "``CopyingMock``." msgstr "" -#: ../../library/unittest.mock-examples.rst:917 +#: ../../library/unittest.mock-examples.rst:941 msgid "Nesting Patches" msgstr "" -#: ../../library/unittest.mock-examples.rst:919 +#: ../../library/unittest.mock-examples.rst:943 msgid "" "Using patch as a context manager is nice, but if you do multiple patches you " "can end up with nested with statements indenting further and further to the " "right::" msgstr "" -#: ../../library/unittest.mock-examples.rst:937 +#: ../../library/unittest.mock-examples.rst:961 msgid "" "With unittest ``cleanup`` functions and the :ref:`start-and-stop` we can " "achieve the same effect without the nested indentation. A simple helper " @@ -773,74 +785,74 @@ msgid "" "mock for us::" msgstr "" -#: ../../library/unittest.mock-examples.rst:965 +#: ../../library/unittest.mock-examples.rst:989 msgid "Mocking a dictionary with MagicMock" msgstr "" -#: ../../library/unittest.mock-examples.rst:967 +#: ../../library/unittest.mock-examples.rst:991 msgid "" "You may want to mock a dictionary, or other container object, recording all " "access to it whilst having it still behave like a dictionary." msgstr "" -#: ../../library/unittest.mock-examples.rst:970 +#: ../../library/unittest.mock-examples.rst:994 msgid "" "We can do this with :class:`MagicMock`, which will behave like a dictionary, " "and using :data:`~Mock.side_effect` to delegate dictionary access to a real " "underlying dictionary that is under our control." msgstr "" -#: ../../library/unittest.mock-examples.rst:974 +#: ../../library/unittest.mock-examples.rst:998 msgid "" -"When the :meth:`__getitem__` and :meth:`__setitem__` methods of our " -"``MagicMock`` are called (normal dictionary access) then ``side_effect`` is " -"called with the key (and in the case of ``__setitem__`` the value too). We " -"can also control what is returned." +"When the :meth:`~object.__getitem__` and :meth:`~object.__setitem__` methods " +"of our ``MagicMock`` are called (normal dictionary access) then " +"``side_effect`` is called with the key (and in the case of ``__setitem__`` " +"the value too). We can also control what is returned." msgstr "" -#: ../../library/unittest.mock-examples.rst:978 +#: ../../library/unittest.mock-examples.rst:1003 msgid "" "After the ``MagicMock`` has been used we can use attributes like :data:" "`~Mock.call_args_list` to assert about how the dictionary was used:" msgstr "" -#: ../../library/unittest.mock-examples.rst:994 +#: ../../library/unittest.mock-examples.rst:1019 msgid "" "An alternative to using ``MagicMock`` is to use ``Mock`` and *only* provide " "the magic methods you specifically want:" msgstr "" -#: ../../library/unittest.mock-examples.rst:1001 +#: ../../library/unittest.mock-examples.rst:1026 msgid "" "A *third* option is to use ``MagicMock`` but passing in ``dict`` as the " "*spec* (or *spec_set*) argument so that the ``MagicMock`` created only has " "dictionary magic methods available:" msgstr "" -#: ../../library/unittest.mock-examples.rst:1009 +#: ../../library/unittest.mock-examples.rst:1034 msgid "" "With these side effect functions in place, the ``mock`` will behave like a " "normal dictionary but recording the access. It even raises a :exc:`KeyError` " "if you try to access a key that doesn't exist." msgstr "" -#: ../../library/unittest.mock-examples.rst:1028 +#: ../../library/unittest.mock-examples.rst:1053 msgid "" "After it has been used you can make assertions about the access using the " "normal mock methods and attributes:" msgstr "" -#: ../../library/unittest.mock-examples.rst:1040 +#: ../../library/unittest.mock-examples.rst:1065 msgid "Mock subclasses and their attributes" msgstr "" -#: ../../library/unittest.mock-examples.rst:1042 +#: ../../library/unittest.mock-examples.rst:1067 msgid "" "There are various reasons why you might want to subclass :class:`Mock`. One " "reason might be to add helper methods. Here's a silly example:" msgstr "" -#: ../../library/unittest.mock-examples.rst:1058 +#: ../../library/unittest.mock-examples.rst:1083 msgid "" "The standard behaviour for ``Mock`` instances is that attributes and the " "return value mocks are of the same type as the mock they are accessed on. " @@ -850,7 +862,7 @@ msgid "" "mock of instances of your subclass." msgstr "" -#: ../../library/unittest.mock-examples.rst:1074 +#: ../../library/unittest.mock-examples.rst:1099 msgid "" "Sometimes this is inconvenient. For example, `one user `_ is subclassing mock to created a `Twisted " @@ -858,7 +870,7 @@ msgid "" "html>`_. Having this applied to attributes too actually causes errors." msgstr "" -#: ../../library/unittest.mock-examples.rst:1080 +#: ../../library/unittest.mock-examples.rst:1105 msgid "" "``Mock`` (in all its flavours) uses a method called ``_get_child_mock`` to " "create these \"sub-mocks\" for attributes and return values. You can prevent " @@ -867,25 +879,25 @@ msgid "" "are then passed onto the mock constructor:" msgstr "" -#: ../../library/unittest.mock-examples.rst:1097 +#: ../../library/unittest.mock-examples.rst:1122 msgid "" "An exception to this rule are the non-callable mocks. Attributes use the " "callable variant because otherwise non-callable mocks couldn't have callable " "methods." msgstr "" -#: ../../library/unittest.mock-examples.rst:1103 +#: ../../library/unittest.mock-examples.rst:1128 msgid "Mocking imports with patch.dict" msgstr "" -#: ../../library/unittest.mock-examples.rst:1105 +#: ../../library/unittest.mock-examples.rst:1130 msgid "" "One situation where mocking can be hard is where you have a local import " "inside a function. These are harder to mock because they aren't using an " "object from the module namespace that we can patch out." msgstr "" -#: ../../library/unittest.mock-examples.rst:1109 +#: ../../library/unittest.mock-examples.rst:1134 msgid "" "Generally local imports are to be avoided. They are sometimes done to " "prevent circular dependencies, for which there is *usually* a much better " @@ -895,7 +907,7 @@ msgid "" "attribute and only do the import on first use)." msgstr "" -#: ../../library/unittest.mock-examples.rst:1116 +#: ../../library/unittest.mock-examples.rst:1141 msgid "" "That aside there is a way to use ``mock`` to affect the results of an " "import. Importing fetches an *object* from the :data:`sys.modules` " @@ -905,7 +917,7 @@ msgid "" "back. This need not be the case however." msgstr "" -#: ../../library/unittest.mock-examples.rst:1123 +#: ../../library/unittest.mock-examples.rst:1148 msgid "" "This means you can use :func:`patch.dict` to *temporarily* put a mock in " "place in :data:`sys.modules`. Any imports whilst this patch is active will " @@ -914,29 +926,29 @@ msgid "" "whatever was there previously will be restored safely." msgstr "" -#: ../../library/unittest.mock-examples.rst:1129 +#: ../../library/unittest.mock-examples.rst:1154 msgid "Here's an example that mocks out the 'fooble' module." msgstr "" -#: ../../library/unittest.mock-examples.rst:1141 +#: ../../library/unittest.mock-examples.rst:1166 msgid "" "As you can see the ``import fooble`` succeeds, but on exit there is no " "'fooble' left in :data:`sys.modules`." msgstr "" -#: ../../library/unittest.mock-examples.rst:1144 +#: ../../library/unittest.mock-examples.rst:1169 msgid "This also works for the ``from module import name`` form:" msgstr "" -#: ../../library/unittest.mock-examples.rst:1154 +#: ../../library/unittest.mock-examples.rst:1179 msgid "With slightly more work you can also mock package imports:" msgstr "" -#: ../../library/unittest.mock-examples.rst:1167 +#: ../../library/unittest.mock-examples.rst:1192 msgid "Tracking order of calls and less verbose call assertions" msgstr "" -#: ../../library/unittest.mock-examples.rst:1169 +#: ../../library/unittest.mock-examples.rst:1194 msgid "" "The :class:`Mock` class allows you to track the *order* of method calls on " "your mock objects through the :attr:`~Mock.method_calls` attribute. This " @@ -944,7 +956,7 @@ msgid "" "however we can use :attr:`~Mock.mock_calls` to achieve the same effect." msgstr "" -#: ../../library/unittest.mock-examples.rst:1174 +#: ../../library/unittest.mock-examples.rst:1199 msgid "" "Because mocks track calls to child mocks in ``mock_calls``, and accessing an " "arbitrary attribute of a mock creates a child mock, we can create our " @@ -952,20 +964,20 @@ msgid "" "recorded, in order, in the ``mock_calls`` of the parent:" msgstr "" -#: ../../library/unittest.mock-examples.rst:1191 +#: ../../library/unittest.mock-examples.rst:1216 msgid "" "We can then assert about the calls, including the order, by comparing with " "the ``mock_calls`` attribute on the manager mock:" msgstr "" -#: ../../library/unittest.mock-examples.rst:1198 +#: ../../library/unittest.mock-examples.rst:1223 msgid "" "If ``patch`` is creating, and putting in place, your mocks then you can " "attach them to a manager mock using the :meth:`~Mock.attach_mock` method. " "After attaching calls will be recorded in ``mock_calls`` of the manager. ::" msgstr "" -#: ../../library/unittest.mock-examples.rst:1217 +#: ../../library/unittest.mock-examples.rst:1242 msgid "" "If many calls have been made, but you're only interested in a particular " "sequence of them then an alternative is to use the :meth:`~Mock." @@ -974,13 +986,13 @@ msgid "" "mock_calls` then the assert succeeds." msgstr "" -#: ../../library/unittest.mock-examples.rst:1231 +#: ../../library/unittest.mock-examples.rst:1256 msgid "" "Even though the chained call ``m.one().two().three()`` aren't the only calls " "that have been made to the mock, the assert still succeeds." msgstr "" -#: ../../library/unittest.mock-examples.rst:1234 +#: ../../library/unittest.mock-examples.rst:1259 msgid "" "Sometimes a mock may have several calls made to it, and you are only " "interested in asserting about *some* of those calls. You may not even care " @@ -988,17 +1000,17 @@ msgid "" "``assert_has_calls``:" msgstr "" -#: ../../library/unittest.mock-examples.rst:1246 +#: ../../library/unittest.mock-examples.rst:1271 msgid "More complex argument matching" msgstr "" -#: ../../library/unittest.mock-examples.rst:1248 +#: ../../library/unittest.mock-examples.rst:1273 msgid "" "Using the same basic concept as :data:`ANY` we can implement matchers to do " "more complex assertions on objects used as arguments to mocks." msgstr "" -#: ../../library/unittest.mock-examples.rst:1251 +#: ../../library/unittest.mock-examples.rst:1276 msgid "" "Suppose we expect some object to be passed to a mock that by default " "compares equal based on object identity (which is the Python default for " @@ -1008,28 +1020,28 @@ msgid "" "attributes for us." msgstr "" -#: ../../library/unittest.mock-examples.rst:1258 +#: ../../library/unittest.mock-examples.rst:1283 msgid "" "You can see in this example how a 'standard' call to ``assert_called_with`` " "isn't sufficient:" msgstr "" -#: ../../library/unittest.mock-examples.rst:1273 +#: ../../library/unittest.mock-examples.rst:1298 msgid "" "A comparison function for our ``Foo`` class might look something like this:" msgstr "" -#: ../../library/unittest.mock-examples.rst:1285 +#: ../../library/unittest.mock-examples.rst:1310 msgid "" "And a matcher object that can use comparison functions like this for its " "equality operation would look something like this:" msgstr "" -#: ../../library/unittest.mock-examples.rst:1296 +#: ../../library/unittest.mock-examples.rst:1321 msgid "Putting all this together:" msgstr "" -#: ../../library/unittest.mock-examples.rst:1301 +#: ../../library/unittest.mock-examples.rst:1326 msgid "" "The ``Matcher`` is instantiated with our compare function and the ``Foo`` " "object we want to compare against. In ``assert_called_with`` the ``Matcher`` " @@ -1039,13 +1051,13 @@ msgid "" "raised:" msgstr "" -#: ../../library/unittest.mock-examples.rst:1314 +#: ../../library/unittest.mock-examples.rst:1339 msgid "" "With a bit of tweaking you could have the comparison function raise the :exc:" "`AssertionError` directly and provide a more useful failure message." msgstr "" -#: ../../library/unittest.mock-examples.rst:1317 +#: ../../library/unittest.mock-examples.rst:1342 msgid "" "As of version 1.5, the Python testing library `PyHamcrest `_ provides similar functionality, that may be " diff --git a/library/unittest.po b/library/unittest.po index daf13a07ff..4d7ca66c6a 100644 --- a/library/unittest.po +++ b/library/unittest.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-08-31 00:03+0000\n" "PO-Revision-Date: 2022-10-16 06:03+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2426,8 +2426,8 @@ msgstr "" #: ../../library/unittest.rst:2020 msgid "" -"A list containing 2-tuples of :class:`TestCase` instances and floats " -"representing the elapsed time of each test which was run." +"A list containing 2-tuples of test case names and floats representing the " +"elapsed time of each test which was run." msgstr "" #: ../../library/unittest.rst:2027 diff --git a/library/uuid.po b/library/uuid.po index f2b28e52d6..9048e97b5b 100644 --- a/library/uuid.po +++ b/library/uuid.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-09-03 00:03+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-" @@ -53,13 +53,14 @@ msgid "" "Depending on support from the underlying platform, :func:`uuid1` may or may " "not return a \"safe\" UUID. A safe UUID is one which is generated using " "synchronization methods that ensure no two processes can obtain the same " -"UUID. All instances of :class:`UUID` have an :attr:`is_safe` attribute " -"which relays any information about the UUID's safety, using this enumeration:" +"UUID. All instances of :class:`UUID` have an :attr:`~UUID.is_safe` " +"attribute which relays any information about the UUID's safety, using this " +"enumeration:" msgstr "" "根據底層平台的支援情況,:func:`uuid1` 可能會也可能不會回傳一個「安全的」" "UUID。安全的 UUID 是使用同步方法生成的,以確保不會有兩個行程獲取到相同的 " -"UUID。所有 :class:`UUID` 的實例都有一個 :attr:`is_safe` 屬性,該屬性使用下面" -"這個列舉來傳遞有關 UUID 安全性的任何資訊:" +"UUID。所有 :class:`UUID` 的實例都有一個 :attr:`~UUID.is_safe` 屬性,該屬性使" +"用下面這個列舉來傳遞有關 UUID 安全性的任何資訊:" #: ../../library/uuid.rst:34 msgid "The UUID was generated by the platform in a multiprocessing-safe way." @@ -154,83 +155,51 @@ msgstr "" "UUID 以 6 個整數欄位所組成的元組表示,也可以看作有 6 個個別屬性和 2 個衍生屬" "性:" -#: ../../library/uuid.rst:99 +#: ../../library/uuid.rst:100 msgid "Field" msgstr "欄位" -#: ../../library/uuid.rst:99 +#: ../../library/uuid.rst:101 msgid "Meaning" msgstr "意義" -#: ../../library/uuid.rst:101 -msgid ":attr:`time_low`" -msgstr ":attr:`time_low`" - -#: ../../library/uuid.rst:101 -msgid "the first 32 bits of the UUID" -msgstr "UUID 的前 32 位元" - -#: ../../library/uuid.rst:103 -msgid ":attr:`time_mid`" -msgstr ":attr:`time_mid`" - -#: ../../library/uuid.rst:103 ../../library/uuid.rst:105 -msgid "the next 16 bits of the UUID" -msgstr "UUID 接下來的 16 位元" - -#: ../../library/uuid.rst:105 -msgid ":attr:`time_hi_version`" -msgstr ":attr:`time_hi_version`" - -#: ../../library/uuid.rst:107 -msgid ":attr:`clock_seq_hi_variant`" -msgstr ":attr:`clock_seq_hi_variant`" +#: ../../library/uuid.rst:104 +msgid "The first 32 bits of the UUID." +msgstr "UUID 的前 32 位元。" -#: ../../library/uuid.rst:107 ../../library/uuid.rst:109 -msgid "the next 8 bits of the UUID" -msgstr "UUID 接下來的 8 位元" +#: ../../library/uuid.rst:107 ../../library/uuid.rst:110 +msgid "The next 16 bits of the UUID." +msgstr "UUID 接下來的 16 位元。" -#: ../../library/uuid.rst:109 -msgid ":attr:`clock_seq_low`" -msgstr ":attr:`clock_seq_low`" +#: ../../library/uuid.rst:113 ../../library/uuid.rst:116 +msgid "The next 8 bits of the UUID." +msgstr "UUID 接下來的 8 位元。" -#: ../../library/uuid.rst:111 -msgid ":attr:`node`" -msgstr ":attr:`node`" +#: ../../library/uuid.rst:119 +msgid "The last 48 bits of the UUID." +msgstr "UUID 最後的 48 位元。" -#: ../../library/uuid.rst:111 -msgid "the last 48 bits of the UUID" -msgstr "UUID 最後的 48 位元" +#: ../../library/uuid.rst:122 +msgid "The 60-bit timestamp." +msgstr "60 位元的時間戳。" -#: ../../library/uuid.rst:113 -msgid ":attr:`time`" -msgstr ":attr:`time`" +#: ../../library/uuid.rst:125 +msgid "The 14-bit sequence number." +msgstr "14 位元的序列號。" -#: ../../library/uuid.rst:113 -msgid "the 60-bit timestamp" -msgstr "60 位元的時間戳" - -#: ../../library/uuid.rst:115 -msgid ":attr:`clock_seq`" -msgstr ":attr:`clock_seq`" - -#: ../../library/uuid.rst:115 -msgid "the 14-bit sequence number" -msgstr "14 位元的序列號" - -#: ../../library/uuid.rst:121 +#: ../../library/uuid.rst:130 msgid "The UUID as a 32-character lowercase hexadecimal string." msgstr "UUID 以 32 個小寫十六進位字元組成的字串表示。" -#: ../../library/uuid.rst:126 +#: ../../library/uuid.rst:135 msgid "The UUID as a 128-bit integer." msgstr "UUID 以 128 位元的整數表示。" -#: ../../library/uuid.rst:131 +#: ../../library/uuid.rst:140 msgid "The UUID as a URN as specified in :rfc:`4122`." msgstr "UUID 以 :rfc:`4122` 中指定的 URN 形式表示。" -#: ../../library/uuid.rst:136 +#: ../../library/uuid.rst:145 msgid "" "The UUID variant, which determines the internal layout of the UUID. This " "will be one of the constants :const:`RESERVED_NCS`, :const:`RFC_4122`, :" @@ -240,23 +209,23 @@ msgstr "" "`RFC_4122`、:const:`RESERVED_MICROSOFT` 或 :const:`RESERVED_FUTURE` 其中一個" "常數。" -#: ../../library/uuid.rst:143 +#: ../../library/uuid.rst:152 msgid "" "The UUID version number (1 through 5, meaningful only when the variant is :" "const:`RFC_4122`)." msgstr "UUID 的版本號(1 到 5,只有當變體是 :const:`RFC_4122` 時才有意義)。" -#: ../../library/uuid.rst:148 +#: ../../library/uuid.rst:157 msgid "" "An enumeration of :class:`SafeUUID` which indicates whether the platform " "generated the UUID in a multiprocessing-safe way." msgstr ":class:`SafeUUID` 的列舉,表示平台是否以多行程安全的方式產生 UUID。" -#: ../../library/uuid.rst:153 +#: ../../library/uuid.rst:162 msgid "The :mod:`uuid` module defines the following functions:" msgstr ":mod:`uuid` 模組定義了以下函式:" -#: ../../library/uuid.rst:158 +#: ../../library/uuid.rst:167 msgid "" "Get the hardware address as a 48-bit positive integer. The first time this " "runs, it may launch a separate program, which could be quite slow. If all " @@ -277,7 +246,7 @@ msgstr "" "*),而不是本地管理 (locally administered) 的 MAC 位址,除此之外不保證任何選" "擇的順序。" -#: ../../library/uuid.rst:168 +#: ../../library/uuid.rst:177 msgid "" "Universally administered MAC addresses are preferred over locally " "administered MAC addresses, since the former are guaranteed to be globally " @@ -286,7 +255,7 @@ msgstr "" "通用管理的 MAC 位址優於本地管理的 MAC 位址,因為前者保證是全球唯一的,而後者" "不是。" -#: ../../library/uuid.rst:178 +#: ../../library/uuid.rst:187 msgid "" "Generate a UUID from a host ID, sequence number, and the current time. If " "*node* is not given, :func:`getnode` is used to obtain the hardware address. " @@ -297,7 +266,7 @@ msgstr "" "`getnode` 獲取硬體位址。如果給定 *clock_seq*,會將其用作序列號;否則將使用一" "個隨機 14 位元的序列號。" -#: ../../library/uuid.rst:188 +#: ../../library/uuid.rst:197 msgid "" "Generate a UUID based on the MD5 hash of a namespace identifier (which is a " "UUID) and a name (which is a :class:`bytes` object or a string that will be " @@ -306,11 +275,11 @@ msgstr "" "基於命名空間識別碼 (namespace identifier)(一個 UUID)和名稱(一個 :class:" "`bytes` 物件或使用 UTF-8 編碼的字串)的 MD5 hash 來生成 UUID。" -#: ../../library/uuid.rst:197 +#: ../../library/uuid.rst:206 msgid "Generate a random UUID." msgstr "生成一個隨機的 UUID。" -#: ../../library/uuid.rst:204 +#: ../../library/uuid.rst:213 msgid "" "Generate a UUID based on the SHA-1 hash of a namespace identifier (which is " "a UUID) and a name (which is a :class:`bytes` object or a string that will " @@ -319,7 +288,7 @@ msgstr "" "基於命名空間識別碼(一個 UUID)和名稱(一個 :class:`bytes` 物件或使用 UTF-8 " "編碼的字串)的 SHA-1 hash 來生成 UUID。" -#: ../../library/uuid.rst:210 +#: ../../library/uuid.rst:219 msgid "" "The :mod:`uuid` module defines the following namespace identifiers for use " "with :func:`uuid3` or :func:`uuid5`." @@ -327,7 +296,7 @@ msgstr "" ":mod:`uuid` 模組為 :func:`uuid3` 或 :func:`uuid5` 定義了以下的命名空間識別" "碼。" -#: ../../library/uuid.rst:216 +#: ../../library/uuid.rst:225 msgid "" "When this namespace is specified, the *name* string is a fully qualified " "domain name." @@ -335,50 +304,50 @@ msgstr "" "當指定這個命名空間時,*name* 字串是一個完整網域名稱 (fully qualified domain " "name)。" -#: ../../library/uuid.rst:222 +#: ../../library/uuid.rst:231 msgid "When this namespace is specified, the *name* string is a URL." msgstr "當指定這個命名空間時,*name* 字串是一個 URL。" -#: ../../library/uuid.rst:227 +#: ../../library/uuid.rst:236 msgid "When this namespace is specified, the *name* string is an ISO OID." msgstr "當指定這個命名空間時,*name* 字串是一個 ISO OID。" -#: ../../library/uuid.rst:232 +#: ../../library/uuid.rst:241 msgid "" "When this namespace is specified, the *name* string is an X.500 DN in DER or " "a text output format." msgstr "" "當指定這個命名空間時,*name* 字串是以 DER 或文字輸出格式表示的 X.500 DN。" -#: ../../library/uuid.rst:235 +#: ../../library/uuid.rst:244 msgid "" "The :mod:`uuid` module defines the following constants for the possible " -"values of the :attr:`variant` attribute:" -msgstr ":mod:`uuid` 模組為 :attr:`variant` 屬性的可能值定義了以下常數:" +"values of the :attr:`~UUID.variant` attribute:" +msgstr ":mod:`uuid` 模組為 :attr:`~UUID.variant` 屬性的可能值定義了以下常數:" -#: ../../library/uuid.rst:241 +#: ../../library/uuid.rst:250 msgid "Reserved for NCS compatibility." msgstr "保留供 NCS 相容性使用。" -#: ../../library/uuid.rst:246 +#: ../../library/uuid.rst:255 msgid "Specifies the UUID layout given in :rfc:`4122`." msgstr "使用在 :rfc:`4122` 中給定的 UUID 佈局。" -#: ../../library/uuid.rst:251 +#: ../../library/uuid.rst:260 msgid "Reserved for Microsoft compatibility." msgstr "保留供 Microsoft 相容性使用。" -#: ../../library/uuid.rst:256 +#: ../../library/uuid.rst:265 msgid "Reserved for future definition." msgstr "保留供未來定義使用。" -#: ../../library/uuid.rst:262 +#: ../../library/uuid.rst:271 msgid ":rfc:`4122` - A Universally Unique IDentifier (UUID) URN Namespace" msgstr "" ":rfc:`4122` - 通用唯一辨識碼 (UUID, Universally Unique IDentifier) 的 URN 命" "名空間" -#: ../../library/uuid.rst:262 +#: ../../library/uuid.rst:271 msgid "" "This specification defines a Uniform Resource Name namespace for UUIDs, the " "internal format of UUIDs, and methods of generating UUIDs." @@ -386,30 +355,30 @@ msgstr "" "這個規範定義了 UUID 的統一資源名稱 (Uniform Resource Name) 命名空間、UUID 的" "內部格式和生成 UUID 的方法。" -#: ../../library/uuid.rst:269 +#: ../../library/uuid.rst:278 msgid "Command-Line Usage" msgstr "命令列的用法" -#: ../../library/uuid.rst:273 +#: ../../library/uuid.rst:282 msgid "" "The :mod:`uuid` module can be executed as a script from the command line." msgstr ":mod:`uuid` 模組可以在命令列下作為腳本來執行。" -#: ../../library/uuid.rst:279 +#: ../../library/uuid.rst:288 msgid "The following options are accepted:" msgstr "可以接受以下選項:" -#: ../../library/uuid.rst:285 +#: ../../library/uuid.rst:294 msgid "Show the help message and exit." msgstr "顯示幫助訊息並退出。" -#: ../../library/uuid.rst:290 +#: ../../library/uuid.rst:299 msgid "" "Specify the function name to use to generate the uuid. By default :func:" "`uuid4` is used." msgstr "指定要用來生成 UUID 的函式名稱。預設使用 :func:`uuid4`。" -#: ../../library/uuid.rst:296 +#: ../../library/uuid.rst:305 msgid "" "The namespace is a ``UUID``, or ``@ns`` where ``ns`` is a well-known " "predefined UUID addressed by namespace name. Such as ``@dns``, ``@url``, " @@ -420,49 +389,73 @@ msgstr "" "空間名稱,例如 ``@dns``、``@url``、``@oid`` 和 ``@x500``。 只有 :func:" "`uuid3` / :func:`uuid5` 函式會需要。" -#: ../../library/uuid.rst:303 +#: ../../library/uuid.rst:312 msgid "" "The name used as part of generating the uuid. Only required for :func:" "`uuid3` / :func:`uuid5` functions." msgstr "用於生成 uuid 的名稱。只有 :func:`uuid3` / :func:`uuid5` 函式會需要。" -#: ../../library/uuid.rst:310 +#: ../../library/uuid.rst:319 msgid "Example" msgstr "範例" -#: ../../library/uuid.rst:312 +#: ../../library/uuid.rst:321 msgid "Here are some examples of typical usage of the :mod:`uuid` module::" msgstr "" "以下是一些 :mod:`uuid` 模組的典型使用範例:\n" "\n" "::" -#: ../../library/uuid.rst:351 +#: ../../library/uuid.rst:360 msgid "Command-Line Example" msgstr "命令列的範例" -#: ../../library/uuid.rst:353 +#: ../../library/uuid.rst:362 msgid "" "Here are some examples of typical usage of the :mod:`uuid` command line " "interface:" msgstr "以下是一些 :mod:`uuid` 命令列介面的典型使用範例:" -#: ../../library/uuid.rst:173 +#: ../../library/uuid.rst:182 msgid "getnode" msgstr "getnode" -#: ../../library/uuid.rst:183 +#: ../../library/uuid.rst:192 msgid "uuid1" msgstr "uuid1" -#: ../../library/uuid.rst:192 +#: ../../library/uuid.rst:201 msgid "uuid3" msgstr "uuid3" -#: ../../library/uuid.rst:199 +#: ../../library/uuid.rst:208 msgid "uuid4" msgstr "uuid4" -#: ../../library/uuid.rst:208 +#: ../../library/uuid.rst:217 msgid "uuid5" msgstr "uuid5" + +#~ msgid ":attr:`time_low`" +#~ msgstr ":attr:`time_low`" + +#~ msgid ":attr:`time_mid`" +#~ msgstr ":attr:`time_mid`" + +#~ msgid ":attr:`time_hi_version`" +#~ msgstr ":attr:`time_hi_version`" + +#~ msgid ":attr:`clock_seq_hi_variant`" +#~ msgstr ":attr:`clock_seq_hi_variant`" + +#~ msgid ":attr:`clock_seq_low`" +#~ msgstr ":attr:`clock_seq_low`" + +#~ msgid ":attr:`node`" +#~ msgstr ":attr:`node`" + +#~ msgid ":attr:`time`" +#~ msgstr ":attr:`time`" + +#~ msgid ":attr:`clock_seq`" +#~ msgstr ":attr:`clock_seq`" diff --git a/library/zipapp.po b/library/zipapp.po index 8d2d45893f..ca5c1d6912 100644 --- a/library/zipapp.po +++ b/library/zipapp.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-09-13 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:16+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -357,25 +357,17 @@ msgid "" msgstr "" #: ../../library/zipapp.rst:284 -msgid "" -"Optionally, delete the ``.dist-info`` directories created by pip in the " -"``myapp`` directory. These hold metadata for pip to manage the packages, and " -"as you won't be making any further use of pip they aren't required - " -"although it won't do any harm if you leave them." -msgstr "" - -#: ../../library/zipapp.rst:289 msgid "Package the application using:" msgstr "" -#: ../../library/zipapp.rst:295 +#: ../../library/zipapp.rst:290 msgid "" "This will produce a standalone executable, which can be run on any machine " "with the appropriate interpreter available. See :ref:`zipapp-specifying-the-" "interpreter` for details. It can be shipped to users as a single file." msgstr "" -#: ../../library/zipapp.rst:299 +#: ../../library/zipapp.rst:294 msgid "" "On Unix, the ``myapp.pyz`` file is executable as it stands. You can rename " "the file to remove the ``.pyz`` extension if you prefer a \"plain\" command " @@ -384,11 +376,11 @@ msgid "" "extensions when installed." msgstr "" -#: ../../library/zipapp.rst:307 +#: ../../library/zipapp.rst:302 msgid "Caveats" msgstr "" -#: ../../library/zipapp.rst:309 +#: ../../library/zipapp.rst:304 msgid "" "If your application depends on a package that includes a C extension, that " "package cannot be run from a zip file (this is an OS limitation, as " @@ -402,11 +394,11 @@ msgid "" "based on the user's machine)." msgstr "" -#: ../../library/zipapp.rst:321 +#: ../../library/zipapp.rst:316 msgid "The Python Zip Application Archive Format" msgstr "" -#: ../../library/zipapp.rst:323 +#: ../../library/zipapp.rst:318 msgid "" "Python has been able to execute zip files which contain a ``__main__.py`` " "file since version 2.6. In order to be executed by Python, an application " @@ -417,18 +409,18 @@ msgid "" "the zip file." msgstr "" -#: ../../library/zipapp.rst:330 +#: ../../library/zipapp.rst:325 msgid "" "The zip file format allows arbitrary data to be prepended to a zip file. " "The zip application format uses this ability to prepend a standard POSIX " "\"shebang\" line to the file (``#!/path/to/interpreter``)." msgstr "" -#: ../../library/zipapp.rst:334 +#: ../../library/zipapp.rst:329 msgid "Formally, the Python zip application format is therefore:" msgstr "" -#: ../../library/zipapp.rst:336 +#: ../../library/zipapp.rst:331 msgid "" "An optional shebang line, containing the characters ``b'#!'`` followed by an " "interpreter name, and then a newline (``b'\\n'``) character. The " @@ -438,7 +430,7 @@ msgid "" "POSIX." msgstr "" -#: ../../library/zipapp.rst:341 +#: ../../library/zipapp.rst:336 msgid "" "Standard zipfile data, as generated by the :mod:`zipfile` module. The " "zipfile content *must* include a file called ``__main__.py`` (which must be " @@ -446,13 +438,13 @@ msgid "" "zipfile data can be compressed or uncompressed." msgstr "" -#: ../../library/zipapp.rst:346 +#: ../../library/zipapp.rst:341 msgid "" "If an application archive has a shebang line, it may have the executable bit " "set on POSIX systems, to allow it to be executed directly." msgstr "" -#: ../../library/zipapp.rst:349 +#: ../../library/zipapp.rst:344 msgid "" "There is no requirement that the tools in this module are used to create " "application archives - the module is a convenience, but archives in the " diff --git a/reference/datamodel.po b/reference/datamodel.po index 45236e1665..984e121885 100644 --- a/reference/datamodel.po +++ b/reference/datamodel.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-26 00:03+0000\n" +"POT-Creation-Date: 2023-08-28 00:04+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1187,7 +1187,7 @@ msgstr "" msgid "Code objects" msgstr "" -#: ../../reference/datamodel.rst:1048 +#: ../../reference/datamodel.rst:1050 msgid "" "Code objects represent *byte-compiled* executable Python code, or :term:" "`bytecode`. The difference between a code object and a function object is " @@ -1199,7 +1199,7 @@ msgid "" "no references (directly or indirectly) to mutable objects." msgstr "" -#: ../../reference/datamodel.rst:1076 +#: ../../reference/datamodel.rst:1078 msgid "" "Special read-only attributes: :attr:`co_name` gives the function name; :attr:" "`co_qualname` gives the fully qualified function name; :attr:`co_argcount` " @@ -1225,7 +1225,7 @@ msgid "" "flags for the interpreter." msgstr "" -#: ../../reference/datamodel.rst:1102 +#: ../../reference/datamodel.rst:1104 msgid "" "The following flag bits are defined for :attr:`co_flags`: bit ``0x04`` is " "set if the function uses the ``*arguments`` syntax to accept an arbitrary " @@ -1234,7 +1234,7 @@ msgid "" "set if the function is a generator." msgstr "" -#: ../../reference/datamodel.rst:1108 +#: ../../reference/datamodel.rst:1110 msgid "" "Future feature declarations (``from __future__ import division``) also use " "bits in :attr:`co_flags` to indicate whether a code object was compiled with " @@ -1243,23 +1243,23 @@ msgid "" "used in earlier versions of Python." msgstr "" -#: ../../reference/datamodel.rst:1114 +#: ../../reference/datamodel.rst:1116 msgid "Other bits in :attr:`co_flags` are reserved for internal use." msgstr "" -#: ../../reference/datamodel.rst:1118 +#: ../../reference/datamodel.rst:1120 msgid "" "If a code object represents a function, the first item in :attr:`co_consts` " "is the documentation string of the function, or ``None`` if undefined." msgstr "" -#: ../../reference/datamodel.rst:1123 +#: ../../reference/datamodel.rst:1125 msgid "" "Returns an iterable over the source code positions of each bytecode " "instruction in the code object." msgstr "" -#: ../../reference/datamodel.rst:1126 +#: ../../reference/datamodel.rst:1128 msgid "" "The iterator returns tuples containing the ``(start_line, end_line, " "start_column, end_column)``. The *i-th* tuple corresponds to the position of " @@ -1267,37 +1267,37 @@ msgid "" "is 0-indexed utf-8 byte offsets on the given source line." msgstr "" -#: ../../reference/datamodel.rst:1132 +#: ../../reference/datamodel.rst:1134 msgid "" "This positional information can be missing. A non-exhaustive lists of cases " "where this may happen:" msgstr "" -#: ../../reference/datamodel.rst:1135 +#: ../../reference/datamodel.rst:1137 msgid "Running the interpreter with :option:`-X` ``no_debug_ranges``." msgstr "" -#: ../../reference/datamodel.rst:1136 +#: ../../reference/datamodel.rst:1138 msgid "" "Loading a pyc file compiled while using :option:`-X` ``no_debug_ranges``." msgstr "" -#: ../../reference/datamodel.rst:1137 +#: ../../reference/datamodel.rst:1139 msgid "Position tuples corresponding to artificial instructions." msgstr "" -#: ../../reference/datamodel.rst:1138 +#: ../../reference/datamodel.rst:1140 msgid "" "Line and column numbers that can't be represented due to implementation " "specific limitations." msgstr "" -#: ../../reference/datamodel.rst:1141 +#: ../../reference/datamodel.rst:1143 msgid "" "When this occurs, some or all of the tuple elements can be :const:`None`." msgstr "" -#: ../../reference/datamodel.rst:1147 +#: ../../reference/datamodel.rst:1149 msgid "" "This feature requires storing column positions in code objects which may " "result in a small increase of disk usage of compiled Python files or " @@ -1307,17 +1307,17 @@ msgid "" "environment variable can be used." msgstr "" -#: ../../reference/datamodel.rst:1158 +#: ../../reference/datamodel.rst:1160 msgid "Frame objects" msgstr "" -#: ../../reference/datamodel.rst:1162 +#: ../../reference/datamodel.rst:1164 msgid "" "Frame objects represent execution frames. They may occur in traceback " "objects (see below), and are also passed to registered trace functions." msgstr "" -#: ../../reference/datamodel.rst:1173 +#: ../../reference/datamodel.rst:1175 msgid "" "Special read-only attributes: :attr:`f_back` is to the previous stack frame " "(towards the caller), or ``None`` if this is the bottom stack frame; :attr:" @@ -1328,7 +1328,7 @@ msgid "" "the bytecode string of the code object)." msgstr "" -#: ../../reference/datamodel.rst:1181 +#: ../../reference/datamodel.rst:1183 msgid "" "Accessing ``f_code`` raises an :ref:`auditing event ` ``object." "__getattr__`` with arguments ``obj`` and ``\"f_code\"``." @@ -1336,7 +1336,7 @@ msgstr "" "存取 ``f_code`` 會引發一個附帶引數 ``obj`` 與 ``\"f_code\"`` 的\\ :ref:`稽核" "事件 ` ``object.__getattr__``。" -#: ../../reference/datamodel.rst:1190 +#: ../../reference/datamodel.rst:1192 msgid "" "Special writable attributes: :attr:`f_trace`, if not ``None``, is a function " "called for various events during code execution (this is used by the " @@ -1344,7 +1344,7 @@ msgid "" "can be disabled by setting :attr:`f_trace_lines` to :const:`False`." msgstr "" -#: ../../reference/datamodel.rst:1195 +#: ../../reference/datamodel.rst:1197 msgid "" "Implementations *may* allow per-opcode events to be requested by setting :" "attr:`f_trace_opcodes` to :const:`True`. Note that this may lead to " @@ -1352,7 +1352,7 @@ msgid "" "escape to the function being traced." msgstr "" -#: ../../reference/datamodel.rst:1200 +#: ../../reference/datamodel.rst:1202 msgid "" ":attr:`f_lineno` is the current line number of the frame --- writing to this " "from within a trace function jumps to the given line (only for the bottom-" @@ -1360,11 +1360,11 @@ msgid "" "Statement) by writing to f_lineno." msgstr "" -#: ../../reference/datamodel.rst:1205 +#: ../../reference/datamodel.rst:1207 msgid "Frame objects support one method:" msgstr "" -#: ../../reference/datamodel.rst:1209 +#: ../../reference/datamodel.rst:1211 msgid "" "This method clears all references to local variables held by the frame. " "Also, if the frame belonged to a generator, the generator is finalized. " @@ -1372,22 +1372,22 @@ msgid "" "catching an exception and storing its traceback for later use)." msgstr "" -#: ../../reference/datamodel.rst:1215 +#: ../../reference/datamodel.rst:1217 msgid ":exc:`RuntimeError` is raised if the frame is currently executing." msgstr "" -#: ../../reference/datamodel.rst:1223 +#: ../../reference/datamodel.rst:1225 msgid "Traceback objects" msgstr "" -#: ../../reference/datamodel.rst:1236 +#: ../../reference/datamodel.rst:1238 msgid "" "Traceback objects represent a stack trace of an exception. A traceback " "object is implicitly created when an exception occurs, and may also be " "explicitly created by calling :class:`types.TracebackType`." msgstr "" -#: ../../reference/datamodel.rst:1240 +#: ../../reference/datamodel.rst:1242 msgid "" "For implicitly created tracebacks, when the search for an exception handler " "unwinds the execution stack, at each unwound level a traceback object is " @@ -1397,21 +1397,21 @@ msgid "" "exc_info()``, and as the ``__traceback__`` attribute of the caught exception." msgstr "" -#: ../../reference/datamodel.rst:1248 +#: ../../reference/datamodel.rst:1250 msgid "" "When the program contains no suitable handler, the stack trace is written " "(nicely formatted) to the standard error stream; if the interpreter is " "interactive, it is also made available to the user as ``sys.last_traceback``." msgstr "" -#: ../../reference/datamodel.rst:1253 +#: ../../reference/datamodel.rst:1255 msgid "" "For explicitly created tracebacks, it is up to the creator of the traceback " "to determine how the ``tb_next`` attributes should be linked to form a full " "stack trace." msgstr "" -#: ../../reference/datamodel.rst:1263 +#: ../../reference/datamodel.rst:1265 msgid "" "Special read-only attributes: :attr:`tb_frame` points to the execution frame " "of the current level; :attr:`tb_lineno` gives the line number where the " @@ -1421,7 +1421,7 @@ msgid "" "statement with no matching except clause or with a finally clause." msgstr "" -#: ../../reference/datamodel.rst:1272 +#: ../../reference/datamodel.rst:1274 msgid "" "Accessing ``tb_frame`` raises an :ref:`auditing event ` ``object." "__getattr__`` with arguments ``obj`` and ``\"tb_frame\"``." @@ -1429,41 +1429,41 @@ msgstr "" "存取 ``tb_frame`` 會引發一個附帶引數 ``obj`` 與 ``\"tb_frame\"`` 的\\ :ref:`" "稽核事件 ` ``object.__getattr__``。" -#: ../../reference/datamodel.rst:1278 +#: ../../reference/datamodel.rst:1280 msgid "" "Special writable attribute: :attr:`tb_next` is the next level in the stack " "trace (towards the frame where the exception occurred), or ``None`` if there " "is no next level." msgstr "" -#: ../../reference/datamodel.rst:1282 +#: ../../reference/datamodel.rst:1284 msgid "" "Traceback objects can now be explicitly instantiated from Python code, and " "the ``tb_next`` attribute of existing instances can be updated." msgstr "" -#: ../../reference/datamodel.rst:1288 +#: ../../reference/datamodel.rst:1290 msgid "Slice objects" msgstr "" -#: ../../reference/datamodel.rst:1292 +#: ../../reference/datamodel.rst:1294 msgid "" "Slice objects are used to represent slices for :meth:`~object.__getitem__` " "methods. They are also created by the built-in :func:`slice` function." msgstr "" -#: ../../reference/datamodel.rst:1301 +#: ../../reference/datamodel.rst:1303 msgid "" "Special read-only attributes: :attr:`~slice.start` is the lower bound; :attr:" "`~slice.stop` is the upper bound; :attr:`~slice.step` is the step value; " "each is ``None`` if omitted. These attributes can have any type." msgstr "" -#: ../../reference/datamodel.rst:1305 +#: ../../reference/datamodel.rst:1307 msgid "Slice objects support one method:" msgstr "" -#: ../../reference/datamodel.rst:1309 +#: ../../reference/datamodel.rst:1311 msgid "" "This method takes a single integer argument *length* and computes " "information about the slice that the slice object would describe if applied " @@ -1473,11 +1473,11 @@ msgid "" "a manner consistent with regular slices." msgstr "" -#: ../../reference/datamodel.rst:1318 +#: ../../reference/datamodel.rst:1320 msgid "Static method objects" msgstr "" -#: ../../reference/datamodel.rst:1320 +#: ../../reference/datamodel.rst:1322 msgid "" "Static method objects provide a way of defeating the transformation of " "function objects to method objects described above. A static method object " @@ -1488,11 +1488,11 @@ msgid "" "method objects are created by the built-in :func:`staticmethod` constructor." msgstr "" -#: ../../reference/datamodel.rst:1330 +#: ../../reference/datamodel.rst:1332 msgid "Class method objects" msgstr "" -#: ../../reference/datamodel.rst:1332 +#: ../../reference/datamodel.rst:1334 msgid "" "A class method object, like a static method object, is a wrapper around " "another object that alters the way in which that object is retrieved from " @@ -1501,11 +1501,11 @@ msgid "" "objects are created by the built-in :func:`classmethod` constructor." msgstr "" -#: ../../reference/datamodel.rst:1342 +#: ../../reference/datamodel.rst:1344 msgid "Special method names" msgstr "" -#: ../../reference/datamodel.rst:1348 +#: ../../reference/datamodel.rst:1350 msgid "" "A class can implement certain operations that are invoked by special syntax " "(such as arithmetic operations or subscripting and slicing) by defining " @@ -1519,7 +1519,7 @@ msgid "" "`TypeError`)." msgstr "" -#: ../../reference/datamodel.rst:1359 +#: ../../reference/datamodel.rst:1361 msgid "" "Setting a special method to ``None`` indicates that the corresponding " "operation is not available. For example, if a class sets :meth:`~object." @@ -1528,7 +1528,7 @@ msgid "" "`~object.__getitem__`). [#]_" msgstr "" -#: ../../reference/datamodel.rst:1365 +#: ../../reference/datamodel.rst:1367 msgid "" "When implementing a class that emulates any built-in type, it is important " "that the emulation only be implemented to the degree that it makes sense for " @@ -1538,11 +1538,11 @@ msgid "" "the W3C's Document Object Model.)" msgstr "" -#: ../../reference/datamodel.rst:1376 +#: ../../reference/datamodel.rst:1378 msgid "Basic customization" msgstr "" -#: ../../reference/datamodel.rst:1382 +#: ../../reference/datamodel.rst:1384 msgid "" "Called to create a new instance of class *cls*. :meth:`__new__` is a static " "method (special-cased so you need not declare it as such) that takes the " @@ -1552,7 +1552,7 @@ msgid "" "new object instance (usually an instance of *cls*)." msgstr "" -#: ../../reference/datamodel.rst:1389 +#: ../../reference/datamodel.rst:1391 msgid "" "Typical implementations create a new instance of the class by invoking the " "superclass's :meth:`__new__` method using ``super().__new__(cls[, ...])`` " @@ -1560,7 +1560,7 @@ msgid "" "necessary before returning it." msgstr "" -#: ../../reference/datamodel.rst:1394 +#: ../../reference/datamodel.rst:1396 msgid "" "If :meth:`__new__` is invoked during object construction and it returns an " "instance of *cls*, then the new instance’s :meth:`__init__` method will be " @@ -1569,13 +1569,13 @@ msgid "" "constructor." msgstr "" -#: ../../reference/datamodel.rst:1399 +#: ../../reference/datamodel.rst:1401 msgid "" "If :meth:`__new__` does not return an instance of *cls*, then the new " "instance's :meth:`__init__` method will not be invoked." msgstr "" -#: ../../reference/datamodel.rst:1402 +#: ../../reference/datamodel.rst:1404 msgid "" ":meth:`__new__` is intended mainly to allow subclasses of immutable types " "(like int, str, or tuple) to customize instance creation. It is also " @@ -1583,7 +1583,7 @@ msgid "" "creation." msgstr "" -#: ../../reference/datamodel.rst:1411 +#: ../../reference/datamodel.rst:1413 msgid "" "Called after the instance has been created (by :meth:`__new__`), but before " "it is returned to the caller. The arguments are those passed to the class " @@ -1593,7 +1593,7 @@ msgid "" "example: ``super().__init__([args...])``." msgstr "" -#: ../../reference/datamodel.rst:1418 +#: ../../reference/datamodel.rst:1420 msgid "" "Because :meth:`__new__` and :meth:`__init__` work together in constructing " "objects (:meth:`__new__` to create it, and :meth:`__init__` to customize " @@ -1601,7 +1601,7 @@ msgid "" "will cause a :exc:`TypeError` to be raised at runtime." msgstr "" -#: ../../reference/datamodel.rst:1431 +#: ../../reference/datamodel.rst:1433 msgid "" "Called when the instance is about to be destroyed. This is also called a " "finalizer or (improperly) a destructor. If a base class has a :meth:" @@ -1610,7 +1610,7 @@ msgid "" "instance." msgstr "" -#: ../../reference/datamodel.rst:1437 +#: ../../reference/datamodel.rst:1439 msgid "" "It is possible (though not recommended!) for the :meth:`__del__` method to " "postpone destruction of the instance by creating a new reference to it. " @@ -1620,20 +1620,20 @@ msgid "" "it once." msgstr "" -#: ../../reference/datamodel.rst:1444 +#: ../../reference/datamodel.rst:1446 msgid "" "It is not guaranteed that :meth:`__del__` methods are called for objects " "that still exist when the interpreter exits." msgstr "" -#: ../../reference/datamodel.rst:1449 +#: ../../reference/datamodel.rst:1451 msgid "" "``del x`` doesn't directly call ``x.__del__()`` --- the former decrements " "the reference count for ``x`` by one, and the latter is only called when " "``x``'s reference count reaches zero." msgstr "" -#: ../../reference/datamodel.rst:1454 +#: ../../reference/datamodel.rst:1456 msgid "" "It is possible for a reference cycle to prevent the reference count of an " "object from going to zero. In this case, the cycle will be later detected " @@ -1644,18 +1644,18 @@ msgid "" "caught in the traceback." msgstr "" -#: ../../reference/datamodel.rst:1464 +#: ../../reference/datamodel.rst:1466 msgid "Documentation for the :mod:`gc` module." msgstr "" -#: ../../reference/datamodel.rst:1468 +#: ../../reference/datamodel.rst:1470 msgid "" "Due to the precarious circumstances under which :meth:`__del__` methods are " "invoked, exceptions that occur during their execution are ignored, and a " "warning is printed to ``sys.stderr`` instead. In particular:" msgstr "" -#: ../../reference/datamodel.rst:1472 +#: ../../reference/datamodel.rst:1474 msgid "" ":meth:`__del__` can be invoked when arbitrary code is being executed, " "including from any arbitrary thread. If :meth:`__del__` needs to take a " @@ -1664,7 +1664,7 @@ msgid "" "`__del__`." msgstr "" -#: ../../reference/datamodel.rst:1478 +#: ../../reference/datamodel.rst:1480 msgid "" ":meth:`__del__` can be executed during interpreter shutdown. As a " "consequence, the global variables it needs to access (including other " @@ -1675,7 +1675,7 @@ msgid "" "still available at the time when the :meth:`__del__` method is called." msgstr "" -#: ../../reference/datamodel.rst:1493 +#: ../../reference/datamodel.rst:1495 msgid "" "Called by the :func:`repr` built-in function to compute the \"official\" " "string representation of an object. If at all possible, this should look " @@ -1687,13 +1687,13 @@ msgid "" "an \"informal\" string representation of instances of that class is required." msgstr "" -#: ../../reference/datamodel.rst:1502 +#: ../../reference/datamodel.rst:1504 msgid "" "This is typically used for debugging, so it is important that the " "representation is information-rich and unambiguous." msgstr "" -#: ../../reference/datamodel.rst:1513 +#: ../../reference/datamodel.rst:1515 msgid "" "Called by :func:`str(object) ` and the built-in functions :func:" "`format` and :func:`print` to compute the \"informal\" or nicely printable " @@ -1701,26 +1701,26 @@ msgid "" "` object." msgstr "" -#: ../../reference/datamodel.rst:1518 +#: ../../reference/datamodel.rst:1520 msgid "" "This method differs from :meth:`object.__repr__` in that there is no " "expectation that :meth:`__str__` return a valid Python expression: a more " "convenient or concise representation can be used." msgstr "" -#: ../../reference/datamodel.rst:1522 +#: ../../reference/datamodel.rst:1524 msgid "" "The default implementation defined by the built-in type :class:`object` " "calls :meth:`object.__repr__`." msgstr "" -#: ../../reference/datamodel.rst:1532 +#: ../../reference/datamodel.rst:1534 msgid "" "Called by :ref:`bytes ` to compute a byte-string representation " "of an object. This should return a :class:`bytes` object." msgstr "" -#: ../../reference/datamodel.rst:1543 +#: ../../reference/datamodel.rst:1545 msgid "" "Called by the :func:`format` built-in function, and by extension, evaluation " "of :ref:`formatted string literals ` and the :meth:`str.format` " @@ -1732,28 +1732,28 @@ msgid "" "formatting option syntax." msgstr "" -#: ../../reference/datamodel.rst:1553 +#: ../../reference/datamodel.rst:1555 msgid "" "See :ref:`formatspec` for a description of the standard formatting syntax." msgstr "" -#: ../../reference/datamodel.rst:1555 +#: ../../reference/datamodel.rst:1557 msgid "The return value must be a string object." msgstr "" -#: ../../reference/datamodel.rst:1557 +#: ../../reference/datamodel.rst:1559 msgid "" "The __format__ method of ``object`` itself raises a :exc:`TypeError` if " "passed any non-empty string." msgstr "" -#: ../../reference/datamodel.rst:1561 +#: ../../reference/datamodel.rst:1563 msgid "" "``object.__format__(x, '')`` is now equivalent to ``str(x)`` rather than " "``format(str(x), '')``." msgstr "" -#: ../../reference/datamodel.rst:1577 +#: ../../reference/datamodel.rst:1579 msgid "" "These are the so-called \"rich comparison\" methods. The correspondence " "between operator symbols and method names is as follows: ``x.__hash__``." msgstr "" -#: ../../reference/datamodel.rst:1666 +#: ../../reference/datamodel.rst:1668 msgid "" "If a class that does not override :meth:`__eq__` wishes to suppress hash " "support, it should include ``__hash__ = None`` in the class definition. A " @@ -1872,7 +1872,7 @@ msgid "" "``isinstance(obj, collections.abc.Hashable)`` call." msgstr "" -#: ../../reference/datamodel.rst:1675 +#: ../../reference/datamodel.rst:1677 msgid "" "By default, the :meth:`__hash__` values of str and bytes objects are " "\"salted\" with an unpredictable random value. Although they remain " @@ -1880,7 +1880,7 @@ msgid "" "between repeated invocations of Python." msgstr "" -#: ../../reference/datamodel.rst:1680 +#: ../../reference/datamodel.rst:1682 msgid "" "This is intended to provide protection against a denial-of-service caused by " "carefully chosen inputs that exploit the worst case performance of a dict " @@ -1888,22 +1888,22 @@ msgid "" "ocert-2011-003.html for details." msgstr "" -#: ../../reference/datamodel.rst:1685 +#: ../../reference/datamodel.rst:1687 msgid "" "Changing hash values affects the iteration order of sets. Python has never " "made guarantees about this ordering (and it typically varies between 32-bit " "and 64-bit builds)." msgstr "" -#: ../../reference/datamodel.rst:1689 +#: ../../reference/datamodel.rst:1691 msgid "See also :envvar:`PYTHONHASHSEED`." msgstr "另請參閱 :envvar:`PYTHONHASHSEED`\\ 。" -#: ../../reference/datamodel.rst:1691 +#: ../../reference/datamodel.rst:1693 msgid "Hash randomization is enabled by default." msgstr "" -#: ../../reference/datamodel.rst:1699 +#: ../../reference/datamodel.rst:1701 msgid "" "Called to implement truth value testing and the built-in operation " "``bool()``; should return ``False`` or ``True``. When this method is not " @@ -1912,18 +1912,18 @@ msgid "" "meth:`!__len__` nor :meth:`!__bool__`, all its instances are considered true." msgstr "" -#: ../../reference/datamodel.rst:1710 +#: ../../reference/datamodel.rst:1712 msgid "Customizing attribute access" msgstr "" -#: ../../reference/datamodel.rst:1712 +#: ../../reference/datamodel.rst:1714 msgid "" "The following methods can be defined to customize the meaning of attribute " "access (use of, assignment to, or deletion of ``x.name``) for class " "instances." msgstr "" -#: ../../reference/datamodel.rst:1720 +#: ../../reference/datamodel.rst:1722 msgid "" "Called when the default attribute access fails with an :exc:`AttributeError` " "(either :meth:`__getattribute__` raises an :exc:`AttributeError` because " @@ -1933,7 +1933,7 @@ msgid "" "attribute value or raise an :exc:`AttributeError` exception." msgstr "" -#: ../../reference/datamodel.rst:1727 +#: ../../reference/datamodel.rst:1729 msgid "" "Note that if the attribute is found through the normal mechanism, :meth:" "`__getattr__` is not called. (This is an intentional asymmetry between :" @@ -1946,7 +1946,7 @@ msgid "" "actually get total control over attribute access." msgstr "" -#: ../../reference/datamodel.rst:1740 +#: ../../reference/datamodel.rst:1742 msgid "" "Called unconditionally to implement attribute accesses for instances of the " "class. If the class also defines :meth:`__getattr__`, the latter will not be " @@ -1958,14 +1958,14 @@ msgid "" "example, ``object.__getattribute__(self, name)``." msgstr "" -#: ../../reference/datamodel.rst:1751 +#: ../../reference/datamodel.rst:1753 msgid "" "This method may still be bypassed when looking up special methods as the " "result of implicit invocation via language syntax or built-in functions. " "See :ref:`special-lookup`." msgstr "" -#: ../../reference/datamodel.rst:1755 +#: ../../reference/datamodel.rst:1757 msgid "" "Raises an :ref:`auditing event ` ``object.__getattr__`` with " "arguments ``obj``, ``name``." @@ -1973,27 +1973,27 @@ msgstr "" "引發一個附帶引數 ``obj``、``name`` 的\\ :ref:`稽核事件 ` ``object." "__getattr__``。" -#: ../../reference/datamodel.rst:1757 +#: ../../reference/datamodel.rst:1759 msgid "" "For certain sensitive attribute accesses, raises an :ref:`auditing event " "` ``object.__getattr__`` with arguments ``obj`` and ``name``." msgstr "" -#: ../../reference/datamodel.rst:1764 +#: ../../reference/datamodel.rst:1766 msgid "" "Called when an attribute assignment is attempted. This is called instead of " "the normal mechanism (i.e. store the value in the instance dictionary). " "*name* is the attribute name, *value* is the value to be assigned to it." msgstr "" -#: ../../reference/datamodel.rst:1768 +#: ../../reference/datamodel.rst:1770 msgid "" "If :meth:`__setattr__` wants to assign to an instance attribute, it should " "call the base class method with the same name, for example, ``object." "__setattr__(self, name, value)``." msgstr "" -#: ../../reference/datamodel.rst:1772 +#: ../../reference/datamodel.rst:1774 msgid "" "Raises an :ref:`auditing event ` ``object.__setattr__`` with " "arguments ``obj``, ``name``, ``value``." @@ -2001,21 +2001,21 @@ msgstr "" "引發一個附帶引數 ``obj``、``name``、``value`` 的\\ :ref:`稽核事件 " "` ``object.__setattr__``。" -#: ../../reference/datamodel.rst:1774 +#: ../../reference/datamodel.rst:1776 msgid "" "For certain sensitive attribute assignments, raises an :ref:`auditing event " "` ``object.__setattr__`` with arguments ``obj``, ``name``, " "``value``." msgstr "" -#: ../../reference/datamodel.rst:1781 +#: ../../reference/datamodel.rst:1783 msgid "" "Like :meth:`__setattr__` but for attribute deletion instead of assignment. " "This should only be implemented if ``del obj.name`` is meaningful for the " "object." msgstr "" -#: ../../reference/datamodel.rst:1784 +#: ../../reference/datamodel.rst:1786 msgid "" "Raises an :ref:`auditing event ` ``object.__delattr__`` with " "arguments ``obj``, ``name``." @@ -2023,23 +2023,23 @@ msgstr "" "引發一個附帶引數 ``obj``、``name`` 的\\ :ref:`稽核事件 ` ``object." "__delattr__``。" -#: ../../reference/datamodel.rst:1786 +#: ../../reference/datamodel.rst:1788 msgid "" "For certain sensitive attribute deletions, raises an :ref:`auditing event " "` ``object.__delattr__`` with arguments ``obj`` and ``name``." msgstr "" -#: ../../reference/datamodel.rst:1793 +#: ../../reference/datamodel.rst:1795 msgid "" "Called when :func:`dir` is called on the object. A sequence must be " "returned. :func:`dir` converts the returned sequence to a list and sorts it." msgstr "" -#: ../../reference/datamodel.rst:1798 +#: ../../reference/datamodel.rst:1800 msgid "Customizing module attribute access" msgstr "" -#: ../../reference/datamodel.rst:1805 +#: ../../reference/datamodel.rst:1807 msgid "" "Special names ``__getattr__`` and ``__dir__`` can be also used to customize " "access to module attributes. The ``__getattr__`` function at the module " @@ -2051,21 +2051,21 @@ msgid "" "with the attribute name and the result is returned." msgstr "" -#: ../../reference/datamodel.rst:1814 +#: ../../reference/datamodel.rst:1816 msgid "" "The ``__dir__`` function should accept no arguments, and return a sequence " "of strings that represents the names accessible on module. If present, this " "function overrides the standard :func:`dir` search on a module." msgstr "" -#: ../../reference/datamodel.rst:1818 +#: ../../reference/datamodel.rst:1820 msgid "" "For a more fine grained customization of the module behavior (setting " "attributes, properties, etc.), one can set the ``__class__`` attribute of a " "module object to a subclass of :class:`types.ModuleType`. For example::" msgstr "" -#: ../../reference/datamodel.rst:1836 +#: ../../reference/datamodel.rst:1838 msgid "" "Defining module ``__getattr__`` and setting module ``__class__`` only affect " "lookups made using the attribute access syntax -- directly accessing the " @@ -2073,27 +2073,27 @@ msgid "" "module's globals dictionary) is unaffected." msgstr "" -#: ../../reference/datamodel.rst:1841 +#: ../../reference/datamodel.rst:1843 msgid "``__class__`` module attribute is now writable." msgstr "" -#: ../../reference/datamodel.rst:1844 +#: ../../reference/datamodel.rst:1846 msgid "``__getattr__`` and ``__dir__`` module attributes." msgstr "" -#: ../../reference/datamodel.rst:1849 +#: ../../reference/datamodel.rst:1851 msgid ":pep:`562` - Module __getattr__ and __dir__" msgstr ":pep:`562` - 模組 __getattr__ 和 __dir__" -#: ../../reference/datamodel.rst:1850 +#: ../../reference/datamodel.rst:1852 msgid "Describes the ``__getattr__`` and ``__dir__`` functions on modules." msgstr "" -#: ../../reference/datamodel.rst:1856 +#: ../../reference/datamodel.rst:1858 msgid "Implementing Descriptors" msgstr "" -#: ../../reference/datamodel.rst:1858 +#: ../../reference/datamodel.rst:1860 msgid "" "The following methods only apply when an instance of the class containing " "the method (a so-called *descriptor* class) appears in an *owner* class (the " @@ -2103,7 +2103,7 @@ msgid "" "the owner class' :attr:`~object.__dict__`." msgstr "" -#: ../../reference/datamodel.rst:1868 +#: ../../reference/datamodel.rst:1870 msgid "" "Called to get the attribute of the owner class (class attribute access) or " "of an instance of that class (instance attribute access). The optional " @@ -2112,13 +2112,13 @@ msgid "" "accessed through the *owner*." msgstr "" -#: ../../reference/datamodel.rst:1874 +#: ../../reference/datamodel.rst:1876 msgid "" "This method should return the computed attribute value or raise an :exc:" "`AttributeError` exception." msgstr "" -#: ../../reference/datamodel.rst:1877 +#: ../../reference/datamodel.rst:1879 msgid "" ":PEP:`252` specifies that :meth:`__get__` is callable with one or two " "arguments. Python's own built-in descriptors support this specification; " @@ -2128,25 +2128,25 @@ msgid "" "not." msgstr "" -#: ../../reference/datamodel.rst:1886 +#: ../../reference/datamodel.rst:1888 msgid "" "Called to set the attribute on an instance *instance* of the owner class to " "a new value, *value*." msgstr "" -#: ../../reference/datamodel.rst:1889 +#: ../../reference/datamodel.rst:1891 msgid "" "Note, adding :meth:`__set__` or :meth:`__delete__` changes the kind of " "descriptor to a \"data descriptor\". See :ref:`descriptor-invocation` for " "more details." msgstr "" -#: ../../reference/datamodel.rst:1895 +#: ../../reference/datamodel.rst:1897 msgid "" "Called to delete the attribute on an instance *instance* of the owner class." msgstr "" -#: ../../reference/datamodel.rst:1898 +#: ../../reference/datamodel.rst:1900 msgid "" "The attribute :attr:`__objclass__` is interpreted by the :mod:`inspect` " "module as specifying the class where this object was defined (setting this " @@ -2157,11 +2157,11 @@ msgid "" "are implemented in C)." msgstr "" -#: ../../reference/datamodel.rst:1909 +#: ../../reference/datamodel.rst:1911 msgid "Invoking Descriptors" msgstr "" -#: ../../reference/datamodel.rst:1911 +#: ../../reference/datamodel.rst:1913 msgid "" "In general, a descriptor is an object attribute with \"binding behavior\", " "one whose attribute access has been overridden by methods in the descriptor " @@ -2170,7 +2170,7 @@ msgid "" "is said to be a descriptor." msgstr "" -#: ../../reference/datamodel.rst:1917 +#: ../../reference/datamodel.rst:1919 msgid "" "The default behavior for attribute access is to get, set, or delete the " "attribute from an object's dictionary. For instance, ``a.x`` has a lookup " @@ -2178,7 +2178,7 @@ msgid "" "continuing through the base classes of ``type(a)`` excluding metaclasses." msgstr "" -#: ../../reference/datamodel.rst:1922 +#: ../../reference/datamodel.rst:1924 msgid "" "However, if the looked-up value is an object defining one of the descriptor " "methods, then Python may override the default behavior and invoke the " @@ -2186,54 +2186,54 @@ msgid "" "depends on which descriptor methods were defined and how they were called." msgstr "" -#: ../../reference/datamodel.rst:1927 +#: ../../reference/datamodel.rst:1929 msgid "" "The starting point for descriptor invocation is a binding, ``a.x``. How the " "arguments are assembled depends on ``a``:" msgstr "" -#: ../../reference/datamodel.rst:1932 +#: ../../reference/datamodel.rst:1934 msgid "Direct Call" msgstr "" -#: ../../reference/datamodel.rst:1931 +#: ../../reference/datamodel.rst:1933 msgid "" "The simplest and least common call is when user code directly invokes a " "descriptor method: ``x.__get__(a)``." msgstr "" -#: ../../reference/datamodel.rst:1936 +#: ../../reference/datamodel.rst:1938 msgid "Instance Binding" msgstr "" -#: ../../reference/datamodel.rst:1935 +#: ../../reference/datamodel.rst:1937 msgid "" "If binding to an object instance, ``a.x`` is transformed into the call: " "``type(a).__dict__['x'].__get__(a, type(a))``." msgstr "" -#: ../../reference/datamodel.rst:1940 +#: ../../reference/datamodel.rst:1942 msgid "Class Binding" msgstr "" -#: ../../reference/datamodel.rst:1939 +#: ../../reference/datamodel.rst:1941 msgid "" "If binding to a class, ``A.x`` is transformed into the call: ``A." "__dict__['x'].__get__(None, A)``." msgstr "" -#: ../../reference/datamodel.rst:1946 +#: ../../reference/datamodel.rst:1948 msgid "Super Binding" msgstr "" -#: ../../reference/datamodel.rst:1943 +#: ../../reference/datamodel.rst:1945 msgid "" "A dotted lookup such as ``super(A, a).x`` searches ``a.__class__.__mro__`` " "for a base class ``B`` following ``A`` and then returns ``B.__dict__['x']." "__get__(a, A)``. If not a descriptor, ``x`` is returned unchanged." msgstr "" -#: ../../reference/datamodel.rst:1980 +#: ../../reference/datamodel.rst:1982 msgid "" "For instance bindings, the precedence of descriptor invocation depends on " "which descriptor methods are defined. A descriptor can define any " @@ -2250,7 +2250,7 @@ msgid "" "can be overridden by instances." msgstr "" -#: ../../reference/datamodel.rst:1994 +#: ../../reference/datamodel.rst:1996 msgid "" "Python methods (including those decorated with :func:`@staticmethod " "` and :func:`@classmethod `) are implemented as " @@ -2259,30 +2259,30 @@ msgid "" "from other instances of the same class." msgstr "" -#: ../../reference/datamodel.rst:2000 +#: ../../reference/datamodel.rst:2002 msgid "" "The :func:`property` function is implemented as a data descriptor. " "Accordingly, instances cannot override the behavior of a property." msgstr "" -#: ../../reference/datamodel.rst:2007 +#: ../../reference/datamodel.rst:2009 msgid "__slots__" msgstr "__slots__" -#: ../../reference/datamodel.rst:2009 +#: ../../reference/datamodel.rst:2011 msgid "" "*__slots__* allow us to explicitly declare data members (like properties) " "and deny the creation of :attr:`~object.__dict__` and *__weakref__* (unless " "explicitly declared in *__slots__* or available in a parent.)" msgstr "" -#: ../../reference/datamodel.rst:2013 +#: ../../reference/datamodel.rst:2015 msgid "" "The space saved over using :attr:`~object.__dict__` can be significant. " "Attribute lookup speed can be significantly improved as well." msgstr "" -#: ../../reference/datamodel.rst:2018 +#: ../../reference/datamodel.rst:2020 msgid "" "This class variable can be assigned a string, iterable, or sequence of " "strings with variable names used by instances. *__slots__* reserves space " @@ -2290,18 +2290,18 @@ msgid "" "`~object.__dict__` and *__weakref__* for each instance." msgstr "" -#: ../../reference/datamodel.rst:2027 +#: ../../reference/datamodel.rst:2029 msgid "Notes on using *__slots__*:" msgstr "" -#: ../../reference/datamodel.rst:2029 +#: ../../reference/datamodel.rst:2031 msgid "" "When inheriting from a class without *__slots__*, the :attr:`~object." "__dict__` and *__weakref__* attribute of the instances will always be " "accessible." msgstr "" -#: ../../reference/datamodel.rst:2033 +#: ../../reference/datamodel.rst:2035 msgid "" "Without a :attr:`~object.__dict__` variable, instances cannot be assigned " "new variables not listed in the *__slots__* definition. Attempts to assign " @@ -2310,7 +2310,7 @@ msgid "" "sequence of strings in the *__slots__* declaration." msgstr "" -#: ../../reference/datamodel.rst:2040 +#: ../../reference/datamodel.rst:2042 msgid "" "Without a *__weakref__* variable for each instance, classes defining " "*__slots__* do not support :mod:`weak references ` to its " @@ -2318,7 +2318,7 @@ msgid "" "to the sequence of strings in the *__slots__* declaration." msgstr "" -#: ../../reference/datamodel.rst:2046 +#: ../../reference/datamodel.rst:2048 msgid "" "*__slots__* are implemented at the class level by creating :ref:`descriptors " "` for each variable name. As a result, class attributes cannot " @@ -2326,7 +2326,7 @@ msgid "" "otherwise, the class attribute would overwrite the descriptor assignment." msgstr "" -#: ../../reference/datamodel.rst:2052 +#: ../../reference/datamodel.rst:2054 msgid "" "The action of a *__slots__* declaration is not limited to the class where it " "is defined. *__slots__* declared in parents are available in child classes. " @@ -2335,7 +2335,7 @@ msgid "" "names of any *additional* slots)." msgstr "" -#: ../../reference/datamodel.rst:2058 +#: ../../reference/datamodel.rst:2060 msgid "" "If a class defines a slot also defined in a base class, the instance " "variable defined by the base class slot is inaccessible (except by " @@ -2344,7 +2344,7 @@ msgid "" "prevent this." msgstr "" -#: ../../reference/datamodel.rst:2063 +#: ../../reference/datamodel.rst:2065 msgid "" ":exc:`TypeError` will be raised if nonempty *__slots__* are defined for a " "class derived from a :c:member:`\"variable-length\" built-in type " @@ -2352,11 +2352,11 @@ msgid "" "`tuple`." msgstr "" -#: ../../reference/datamodel.rst:2068 +#: ../../reference/datamodel.rst:2070 msgid "Any non-string :term:`iterable` may be assigned to *__slots__*." msgstr "" -#: ../../reference/datamodel.rst:2070 +#: ../../reference/datamodel.rst:2072 msgid "" "If a :class:`dictionary ` is used to assign *__slots__*, the " "dictionary keys will be used as the slot names. The values of the dictionary " @@ -2364,13 +2364,13 @@ msgid "" "func:`inspect.getdoc` and displayed in the output of :func:`help`." msgstr "" -#: ../../reference/datamodel.rst:2075 +#: ../../reference/datamodel.rst:2077 msgid "" ":attr:`~instance.__class__` assignment works only if both classes have the " "same *__slots__*." msgstr "" -#: ../../reference/datamodel.rst:2078 +#: ../../reference/datamodel.rst:2080 msgid "" ":ref:`Multiple inheritance ` with multiple slotted parent " "classes can be used, but only one parent is allowed to have attributes " @@ -2378,18 +2378,18 @@ msgid "" "raise :exc:`TypeError`." msgstr "" -#: ../../reference/datamodel.rst:2084 +#: ../../reference/datamodel.rst:2086 msgid "" "If an :term:`iterator` is used for *__slots__* then a :term:`descriptor` is " "created for each of the iterator's values. However, the *__slots__* " "attribute will be an empty iterator." msgstr "" -#: ../../reference/datamodel.rst:2092 +#: ../../reference/datamodel.rst:2094 msgid "Customizing class creation" msgstr "" -#: ../../reference/datamodel.rst:2094 +#: ../../reference/datamodel.rst:2096 msgid "" "Whenever a class inherits from another class, :meth:`~object." "__init_subclass__` is called on the parent class. This way, it is possible " @@ -2399,14 +2399,14 @@ msgid "" "future subclasses of the class defining the method." msgstr "" -#: ../../reference/datamodel.rst:2103 +#: ../../reference/datamodel.rst:2105 msgid "" "This method is called whenever the containing class is subclassed. *cls* is " "then the new subclass. If defined as a normal instance method, this method " "is implicitly converted to a class method." msgstr "" -#: ../../reference/datamodel.rst:2107 +#: ../../reference/datamodel.rst:2109 msgid "" "Keyword arguments which are given to a new class are passed to the parent's " "class ``__init_subclass__``. For compatibility with other classes using " @@ -2414,13 +2414,13 @@ msgid "" "pass the others over to the base class, as in::" msgstr "" -#: ../../reference/datamodel.rst:2121 +#: ../../reference/datamodel.rst:2123 msgid "" "The default implementation ``object.__init_subclass__`` does nothing, but " "raises an error if it is called with any arguments." msgstr "" -#: ../../reference/datamodel.rst:2126 +#: ../../reference/datamodel.rst:2128 msgid "" "The metaclass hint ``metaclass`` is consumed by the rest of the type " "machinery, and is never passed to ``__init_subclass__`` implementations. The " @@ -2428,41 +2428,41 @@ msgid "" "``type(cls)``." msgstr "" -#: ../../reference/datamodel.rst:2134 +#: ../../reference/datamodel.rst:2136 msgid "" "When a class is created, :meth:`type.__new__` scans the class variables and " "makes callbacks to those with a :meth:`~object.__set_name__` hook." msgstr "" -#: ../../reference/datamodel.rst:2139 +#: ../../reference/datamodel.rst:2141 msgid "" "Automatically called at the time the owning class *owner* is created. The " "object has been assigned to *name* in that class::" msgstr "" -#: ../../reference/datamodel.rst:2145 +#: ../../reference/datamodel.rst:2147 msgid "" "If the class variable is assigned after the class is created, :meth:" "`__set_name__` will not be called automatically. If needed, :meth:" "`__set_name__` can be called directly::" msgstr "" -#: ../../reference/datamodel.rst:2156 +#: ../../reference/datamodel.rst:2158 msgid "See :ref:`class-object-creation` for more details." msgstr "更多細節請見 :ref:`class-object-creation`\\ 。" -#: ../../reference/datamodel.rst:2164 +#: ../../reference/datamodel.rst:2166 msgid "Metaclasses" msgstr "" -#: ../../reference/datamodel.rst:2171 +#: ../../reference/datamodel.rst:2173 msgid "" "By default, classes are constructed using :func:`type`. The class body is " "executed in a new namespace and the class name is bound locally to the " "result of ``type(name, bases, namespace)``." msgstr "" -#: ../../reference/datamodel.rst:2175 +#: ../../reference/datamodel.rst:2177 msgid "" "The class creation process can be customized by passing the ``metaclass`` " "keyword argument in the class definition line, or by inheriting from an " @@ -2470,41 +2470,41 @@ msgid "" "both ``MyClass`` and ``MySubclass`` are instances of ``Meta``::" msgstr "" -#: ../../reference/datamodel.rst:2189 +#: ../../reference/datamodel.rst:2191 msgid "" "Any other keyword arguments that are specified in the class definition are " "passed through to all metaclass operations described below." msgstr "" -#: ../../reference/datamodel.rst:2192 +#: ../../reference/datamodel.rst:2194 msgid "When a class definition is executed, the following steps occur:" msgstr "" -#: ../../reference/datamodel.rst:2194 +#: ../../reference/datamodel.rst:2196 msgid "MRO entries are resolved;" msgstr "" -#: ../../reference/datamodel.rst:2195 +#: ../../reference/datamodel.rst:2197 msgid "the appropriate metaclass is determined;" msgstr "" -#: ../../reference/datamodel.rst:2196 +#: ../../reference/datamodel.rst:2198 msgid "the class namespace is prepared;" msgstr "" -#: ../../reference/datamodel.rst:2197 +#: ../../reference/datamodel.rst:2199 msgid "the class body is executed;" msgstr "" -#: ../../reference/datamodel.rst:2198 +#: ../../reference/datamodel.rst:2200 msgid "the class object is created." msgstr "" -#: ../../reference/datamodel.rst:2202 +#: ../../reference/datamodel.rst:2204 msgid "Resolving MRO entries" msgstr "" -#: ../../reference/datamodel.rst:2206 +#: ../../reference/datamodel.rst:2208 msgid "" "If a base that appears in a class definition is not an instance of :class:" "`type`, then an :meth:`!__mro_entries__` method is searched on the base. If " @@ -2516,59 +2516,59 @@ msgid "" "is ignored." msgstr "" -#: ../../reference/datamodel.rst:2218 +#: ../../reference/datamodel.rst:2220 msgid ":func:`types.resolve_bases`" msgstr "" -#: ../../reference/datamodel.rst:2218 +#: ../../reference/datamodel.rst:2220 msgid "Dynamically resolve bases that are not instances of :class:`type`." msgstr "" -#: ../../reference/datamodel.rst:2222 +#: ../../reference/datamodel.rst:2224 msgid ":func:`types.get_original_bases`" msgstr "" -#: ../../reference/datamodel.rst:2221 +#: ../../reference/datamodel.rst:2223 msgid "" "Retrieve a class's \"original bases\" prior to modifications by :meth:" "`~object.__mro_entries__`." msgstr "" -#: ../../reference/datamodel.rst:2224 +#: ../../reference/datamodel.rst:2226 msgid ":pep:`560`" msgstr "" -#: ../../reference/datamodel.rst:2225 +#: ../../reference/datamodel.rst:2227 msgid "Core support for typing module and generic types." msgstr "" -#: ../../reference/datamodel.rst:2229 +#: ../../reference/datamodel.rst:2231 msgid "Determining the appropriate metaclass" msgstr "" -#: ../../reference/datamodel.rst:2233 +#: ../../reference/datamodel.rst:2235 msgid "" "The appropriate metaclass for a class definition is determined as follows:" msgstr "" -#: ../../reference/datamodel.rst:2235 +#: ../../reference/datamodel.rst:2237 msgid "" "if no bases and no explicit metaclass are given, then :func:`type` is used;" msgstr "" -#: ../../reference/datamodel.rst:2236 +#: ../../reference/datamodel.rst:2238 msgid "" "if an explicit metaclass is given and it is *not* an instance of :func:" "`type`, then it is used directly as the metaclass;" msgstr "" -#: ../../reference/datamodel.rst:2238 +#: ../../reference/datamodel.rst:2240 msgid "" "if an instance of :func:`type` is given as the explicit metaclass, or bases " "are defined, then the most derived metaclass is used." msgstr "" -#: ../../reference/datamodel.rst:2241 +#: ../../reference/datamodel.rst:2243 msgid "" "The most derived metaclass is selected from the explicitly specified " "metaclass (if any) and the metaclasses (i.e. ``type(cls)``) of all specified " @@ -2577,11 +2577,11 @@ msgid "" "that criterion, then the class definition will fail with ``TypeError``." msgstr "" -#: ../../reference/datamodel.rst:2251 +#: ../../reference/datamodel.rst:2253 msgid "Preparing the class namespace" msgstr "" -#: ../../reference/datamodel.rst:2256 +#: ../../reference/datamodel.rst:2258 msgid "" "Once the appropriate metaclass has been identified, then the class namespace " "is prepared. If the metaclass has a ``__prepare__`` attribute, it is called " @@ -2593,25 +2593,25 @@ msgid "" "copied into a new ``dict``." msgstr "" -#: ../../reference/datamodel.rst:2265 +#: ../../reference/datamodel.rst:2267 msgid "" "If the metaclass has no ``__prepare__`` attribute, then the class namespace " "is initialised as an empty ordered mapping." msgstr "" -#: ../../reference/datamodel.rst:2270 +#: ../../reference/datamodel.rst:2272 msgid ":pep:`3115` - Metaclasses in Python 3000" msgstr "" -#: ../../reference/datamodel.rst:2271 +#: ../../reference/datamodel.rst:2273 msgid "Introduced the ``__prepare__`` namespace hook" msgstr "" -#: ../../reference/datamodel.rst:2275 +#: ../../reference/datamodel.rst:2277 msgid "Executing the class body" msgstr "" -#: ../../reference/datamodel.rst:2280 +#: ../../reference/datamodel.rst:2282 msgid "" "The class body is executed (approximately) as ``exec(body, globals(), " "namespace)``. The key difference from a normal call to :func:`exec` is that " @@ -2620,7 +2620,7 @@ msgid "" "inside a function." msgstr "" -#: ../../reference/datamodel.rst:2286 +#: ../../reference/datamodel.rst:2288 msgid "" "However, even when the class definition occurs inside the function, methods " "defined inside the class still cannot see names defined at the class scope. " @@ -2629,11 +2629,11 @@ msgid "" "reference described in the next section." msgstr "" -#: ../../reference/datamodel.rst:2295 +#: ../../reference/datamodel.rst:2297 msgid "Creating the class object" msgstr "" -#: ../../reference/datamodel.rst:2302 +#: ../../reference/datamodel.rst:2304 msgid "" "Once the class namespace has been populated by executing the class body, the " "class object is created by calling ``metaclass(name, bases, namespace, " @@ -2641,7 +2641,7 @@ msgid "" "to ``__prepare__``)." msgstr "" -#: ../../reference/datamodel.rst:2307 +#: ../../reference/datamodel.rst:2309 msgid "" "This class object is the one that will be referenced by the zero-argument " "form of :func:`super`. ``__class__`` is an implicit closure reference " @@ -2652,7 +2652,7 @@ msgid "" "is identified based on the first argument passed to the method." msgstr "" -#: ../../reference/datamodel.rst:2317 +#: ../../reference/datamodel.rst:2319 msgid "" "In CPython 3.6 and later, the ``__class__`` cell is passed to the metaclass " "as a ``__classcell__`` entry in the class namespace. If present, this must " @@ -2661,39 +2661,39 @@ msgid "" "in Python 3.8." msgstr "" -#: ../../reference/datamodel.rst:2323 +#: ../../reference/datamodel.rst:2325 msgid "" "When using the default metaclass :class:`type`, or any metaclass that " "ultimately calls ``type.__new__``, the following additional customization " "steps are invoked after creating the class object:" msgstr "" -#: ../../reference/datamodel.rst:2327 +#: ../../reference/datamodel.rst:2329 msgid "" "The ``type.__new__`` method collects all of the attributes in the class " "namespace that define a :meth:`~object.__set_name__` method;" msgstr "" -#: ../../reference/datamodel.rst:2329 +#: ../../reference/datamodel.rst:2331 msgid "" "Those ``__set_name__`` methods are called with the class being defined and " "the assigned name of that particular attribute;" msgstr "" -#: ../../reference/datamodel.rst:2331 +#: ../../reference/datamodel.rst:2333 msgid "" "The :meth:`~object.__init_subclass__` hook is called on the immediate parent " "of the new class in its method resolution order." msgstr "" -#: ../../reference/datamodel.rst:2334 +#: ../../reference/datamodel.rst:2336 msgid "" "After the class object is created, it is passed to the class decorators " "included in the class definition (if any) and the resulting object is bound " "in the local namespace as the defined class." msgstr "" -#: ../../reference/datamodel.rst:2338 +#: ../../reference/datamodel.rst:2340 msgid "" "When a new class is created by ``type.__new__``, the object provided as the " "namespace parameter is copied to a new ordered mapping and the original " @@ -2701,19 +2701,19 @@ msgid "" "becomes the :attr:`~object.__dict__` attribute of the class object." msgstr "" -#: ../../reference/datamodel.rst:2345 +#: ../../reference/datamodel.rst:2347 msgid ":pep:`3135` - New super" msgstr "" -#: ../../reference/datamodel.rst:2346 +#: ../../reference/datamodel.rst:2348 msgid "Describes the implicit ``__class__`` closure reference" msgstr "" -#: ../../reference/datamodel.rst:2350 +#: ../../reference/datamodel.rst:2352 msgid "Uses for metaclasses" msgstr "" -#: ../../reference/datamodel.rst:2352 +#: ../../reference/datamodel.rst:2354 msgid "" "The potential uses for metaclasses are boundless. Some ideas that have been " "explored include enum, logging, interface checking, automatic delegation, " @@ -2721,17 +2721,17 @@ msgid "" "locking/synchronization." msgstr "" -#: ../../reference/datamodel.rst:2359 +#: ../../reference/datamodel.rst:2361 msgid "Customizing instance and subclass checks" msgstr "" -#: ../../reference/datamodel.rst:2361 +#: ../../reference/datamodel.rst:2363 msgid "" "The following methods are used to override the default behavior of the :func:" "`isinstance` and :func:`issubclass` built-in functions." msgstr "" -#: ../../reference/datamodel.rst:2364 +#: ../../reference/datamodel.rst:2366 msgid "" "In particular, the metaclass :class:`abc.ABCMeta` implements these methods " "in order to allow the addition of Abstract Base Classes (ABCs) as \"virtual " @@ -2739,21 +2739,21 @@ msgid "" "other ABCs." msgstr "" -#: ../../reference/datamodel.rst:2371 +#: ../../reference/datamodel.rst:2373 msgid "" "Return true if *instance* should be considered a (direct or indirect) " "instance of *class*. If defined, called to implement ``isinstance(instance, " "class)``." msgstr "" -#: ../../reference/datamodel.rst:2378 +#: ../../reference/datamodel.rst:2380 msgid "" "Return true if *subclass* should be considered a (direct or indirect) " "subclass of *class*. If defined, called to implement ``issubclass(subclass, " "class)``." msgstr "" -#: ../../reference/datamodel.rst:2383 +#: ../../reference/datamodel.rst:2385 msgid "" "Note that these methods are looked up on the type (metaclass) of a class. " "They cannot be defined as class methods in the actual class. This is " @@ -2761,11 +2761,11 @@ msgid "" "only in this case the instance is itself a class." msgstr "" -#: ../../reference/datamodel.rst:2394 +#: ../../reference/datamodel.rst:2396 msgid ":pep:`3119` - Introducing Abstract Base Classes" msgstr "" -#: ../../reference/datamodel.rst:2391 +#: ../../reference/datamodel.rst:2393 msgid "" "Includes the specification for customizing :func:`isinstance` and :func:" "`issubclass` behavior through :meth:`~class.__instancecheck__` and :meth:" @@ -2774,11 +2774,11 @@ msgid "" "language." msgstr "" -#: ../../reference/datamodel.rst:2399 +#: ../../reference/datamodel.rst:2401 msgid "Emulating generic types" msgstr "" -#: ../../reference/datamodel.rst:2401 +#: ../../reference/datamodel.rst:2403 msgid "" "When using :term:`type annotations`, it is often useful to " "*parameterize* a :term:`generic type` using Python's square-brackets " @@ -2786,65 +2786,65 @@ msgid "" "a :class:`list` in which all the elements are of type :class:`int`." msgstr "" -#: ../../reference/datamodel.rst:2409 +#: ../../reference/datamodel.rst:2411 msgid ":pep:`484` - Type Hints" msgstr "" -#: ../../reference/datamodel.rst:2409 +#: ../../reference/datamodel.rst:2411 msgid "Introducing Python's framework for type annotations" msgstr "" -#: ../../reference/datamodel.rst:2412 +#: ../../reference/datamodel.rst:2414 msgid ":ref:`Generic Alias Types`" msgstr "" -#: ../../reference/datamodel.rst:2412 +#: ../../reference/datamodel.rst:2414 msgid "Documentation for objects representing parameterized generic classes" msgstr "" -#: ../../reference/datamodel.rst:2415 +#: ../../reference/datamodel.rst:2417 msgid "" ":ref:`Generics`, :ref:`user-defined generics` and :" "class:`typing.Generic`" msgstr "" -#: ../../reference/datamodel.rst:2415 +#: ../../reference/datamodel.rst:2417 msgid "" "Documentation on how to implement generic classes that can be parameterized " "at runtime and understood by static type-checkers." msgstr "" -#: ../../reference/datamodel.rst:2418 +#: ../../reference/datamodel.rst:2420 msgid "" "A class can *generally* only be parameterized if it defines the special " "class method ``__class_getitem__()``." msgstr "" -#: ../../reference/datamodel.rst:2423 +#: ../../reference/datamodel.rst:2425 msgid "" "Return an object representing the specialization of a generic class by type " "arguments found in *key*." msgstr "" -#: ../../reference/datamodel.rst:2426 +#: ../../reference/datamodel.rst:2428 msgid "" "When defined on a class, ``__class_getitem__()`` is automatically a class " "method. As such, there is no need for it to be decorated with :func:" "`@classmethod` when it is defined." msgstr "" -#: ../../reference/datamodel.rst:2432 +#: ../../reference/datamodel.rst:2434 msgid "The purpose of *__class_getitem__*" msgstr "" -#: ../../reference/datamodel.rst:2434 +#: ../../reference/datamodel.rst:2436 msgid "" "The purpose of :meth:`~object.__class_getitem__` is to allow runtime " "parameterization of standard-library generic classes in order to more easily " "apply :term:`type hints` to these classes." msgstr "" -#: ../../reference/datamodel.rst:2438 +#: ../../reference/datamodel.rst:2440 msgid "" "To implement custom generic classes that can be parameterized at runtime and " "understood by static type-checkers, users should either inherit from a " @@ -2853,7 +2853,7 @@ msgid "" "own implementation of ``__class_getitem__()``." msgstr "" -#: ../../reference/datamodel.rst:2444 +#: ../../reference/datamodel.rst:2446 msgid "" "Custom implementations of :meth:`~object.__class_getitem__` on classes " "defined outside of the standard library may not be understood by third-party " @@ -2861,11 +2861,11 @@ msgid "" "purposes other than type hinting is discouraged." msgstr "" -#: ../../reference/datamodel.rst:2454 +#: ../../reference/datamodel.rst:2456 msgid "*__class_getitem__* versus *__getitem__*" msgstr "" -#: ../../reference/datamodel.rst:2456 +#: ../../reference/datamodel.rst:2458 msgid "" "Usually, the :ref:`subscription` of an object using square " "brackets will call the :meth:`~object.__getitem__` instance method defined " @@ -2875,14 +2875,14 @@ msgid "" "genericalias>` object if it is properly defined." msgstr "" -#: ../../reference/datamodel.rst:2463 +#: ../../reference/datamodel.rst:2465 msgid "" "Presented with the :term:`expression` ``obj[x]``, the Python interpreter " "follows something like the following process to decide whether :meth:" "`~object.__getitem__` or :meth:`~object.__class_getitem__` should be called::" msgstr "" -#: ../../reference/datamodel.rst:2491 +#: ../../reference/datamodel.rst:2493 msgid "" "In Python, all classes are themselves instances of other classes. The class " "of a class is known as that class's :term:`metaclass`, and most classes have " @@ -2892,40 +2892,40 @@ msgid "" "__class_getitem__` being called::" msgstr "" -#: ../../reference/datamodel.rst:2510 +#: ../../reference/datamodel.rst:2512 msgid "" "However, if a class has a custom metaclass that defines :meth:`~object." "__getitem__`, subscribing the class may result in different behaviour. An " "example of this can be found in the :mod:`enum` module::" msgstr "" -#: ../../reference/datamodel.rst:2535 +#: ../../reference/datamodel.rst:2537 msgid ":pep:`560` - Core Support for typing module and generic types" msgstr "" -#: ../../reference/datamodel.rst:2534 +#: ../../reference/datamodel.rst:2536 msgid "" "Introducing :meth:`~object.__class_getitem__`, and outlining when a :ref:" "`subscription` results in ``__class_getitem__()`` being " "called instead of :meth:`~object.__getitem__`" msgstr "" -#: ../../reference/datamodel.rst:2542 +#: ../../reference/datamodel.rst:2544 msgid "Emulating callable objects" msgstr "" -#: ../../reference/datamodel.rst:2549 +#: ../../reference/datamodel.rst:2551 msgid "" "Called when the instance is \"called\" as a function; if this method is " "defined, ``x(arg1, arg2, ...)`` roughly translates to ``type(x).__call__(x, " "arg1, ...)``." msgstr "" -#: ../../reference/datamodel.rst:2556 +#: ../../reference/datamodel.rst:2558 msgid "Emulating container types" msgstr "" -#: ../../reference/datamodel.rst:2558 +#: ../../reference/datamodel.rst:2560 msgid "" "The following methods can be defined to implement container objects. " "Containers usually are :term:`sequences ` (such as :class:`lists " @@ -2961,7 +2961,7 @@ msgid "" "the values." msgstr "" -#: ../../reference/datamodel.rst:2598 +#: ../../reference/datamodel.rst:2600 msgid "" "Called to implement the built-in function :func:`len`. Should return the " "length of the object, an integer ``>=`` 0. Also, an object that doesn't " @@ -2969,7 +2969,7 @@ msgid "" "returns zero is considered to be false in a Boolean context." msgstr "" -#: ../../reference/datamodel.rst:2605 +#: ../../reference/datamodel.rst:2607 msgid "" "In CPython, the length is required to be at most :data:`sys.maxsize`. If the " "length is larger than :data:`!sys.maxsize` some features (such as :func:" @@ -2978,7 +2978,7 @@ msgid "" "`~object.__bool__` method." msgstr "" -#: ../../reference/datamodel.rst:2614 +#: ../../reference/datamodel.rst:2616 msgid "" "Called to implement :func:`operator.length_hint`. Should return an estimated " "length for the object (which may be greater or less than the actual length). " @@ -2988,20 +2988,20 @@ msgid "" "never required for correctness." msgstr "" -#: ../../reference/datamodel.rst:2628 +#: ../../reference/datamodel.rst:2630 msgid "" "Slicing is done exclusively with the following three methods. A call like ::" msgstr "" -#: ../../reference/datamodel.rst:2632 +#: ../../reference/datamodel.rst:2634 msgid "is translated to ::" msgstr "" -#: ../../reference/datamodel.rst:2636 +#: ../../reference/datamodel.rst:2638 msgid "and so forth. Missing slice items are always filled in with ``None``." msgstr "" -#: ../../reference/datamodel.rst:2641 +#: ../../reference/datamodel.rst:2643 msgid "" "Called to implement evaluation of ``self[key]``. For :term:`sequence` types, " "the accepted keys should be integers and slice objects. Note that the " @@ -3014,20 +3014,20 @@ msgid "" "`KeyError` should be raised." msgstr "" -#: ../../reference/datamodel.rst:2653 +#: ../../reference/datamodel.rst:2655 msgid "" ":keyword:`for` loops expect that an :exc:`IndexError` will be raised for " "illegal indexes to allow proper detection of the end of the sequence." msgstr "" -#: ../../reference/datamodel.rst:2658 +#: ../../reference/datamodel.rst:2660 msgid "" "When :ref:`subscripting` a *class*, the special class method :" "meth:`~object.__class_getitem__` may be called instead of ``__getitem__()``. " "See :ref:`classgetitem-versus-getitem` for more details." msgstr "" -#: ../../reference/datamodel.rst:2666 +#: ../../reference/datamodel.rst:2668 msgid "" "Called to implement assignment to ``self[key]``. Same note as for :meth:" "`__getitem__`. This should only be implemented for mappings if the objects " @@ -3036,7 +3036,7 @@ msgid "" "for improper *key* values as for the :meth:`__getitem__` method." msgstr "" -#: ../../reference/datamodel.rst:2675 +#: ../../reference/datamodel.rst:2677 msgid "" "Called to implement deletion of ``self[key]``. Same note as for :meth:" "`__getitem__`. This should only be implemented for mappings if the objects " @@ -3045,13 +3045,13 @@ msgid "" "values as for the :meth:`__getitem__` method." msgstr "" -#: ../../reference/datamodel.rst:2684 +#: ../../reference/datamodel.rst:2686 msgid "" "Called by :class:`dict`\\ .\\ :meth:`__getitem__` to implement ``self[key]`` " "for dict subclasses when key is not in the dictionary." msgstr "" -#: ../../reference/datamodel.rst:2690 +#: ../../reference/datamodel.rst:2692 msgid "" "This method is called when an :term:`iterator` is required for a container. " "This method should return a new iterator object that can iterate over all " @@ -3059,14 +3059,14 @@ msgid "" "of the container." msgstr "" -#: ../../reference/datamodel.rst:2698 +#: ../../reference/datamodel.rst:2700 msgid "" "Called (if present) by the :func:`reversed` built-in to implement reverse " "iteration. It should return a new iterator object that iterates over all " "the objects in the container in reverse order." msgstr "" -#: ../../reference/datamodel.rst:2702 +#: ../../reference/datamodel.rst:2704 msgid "" "If the :meth:`__reversed__` method is not provided, the :func:`reversed` " "built-in will fall back to using the sequence protocol (:meth:`__len__` and :" @@ -3075,7 +3075,7 @@ msgid "" "more efficient than the one provided by :func:`reversed`." msgstr "" -#: ../../reference/datamodel.rst:2709 +#: ../../reference/datamodel.rst:2711 msgid "" "The membership test operators (:keyword:`in` and :keyword:`not in`) are " "normally implemented as an iteration through a container. However, container " @@ -3083,14 +3083,14 @@ msgid "" "implementation, which also does not require the object be iterable." msgstr "" -#: ../../reference/datamodel.rst:2716 +#: ../../reference/datamodel.rst:2718 msgid "" "Called to implement membership test operators. Should return true if *item* " "is in *self*, false otherwise. For mapping objects, this should consider " "the keys of the mapping rather than the values or the key-item pairs." msgstr "" -#: ../../reference/datamodel.rst:2720 +#: ../../reference/datamodel.rst:2722 msgid "" "For objects that don't define :meth:`__contains__`, the membership test " "first tries iteration via :meth:`__iter__`, then the old sequence iteration " @@ -3098,11 +3098,11 @@ msgid "" "reference `." msgstr "" -#: ../../reference/datamodel.rst:2729 +#: ../../reference/datamodel.rst:2731 msgid "Emulating numeric types" msgstr "" -#: ../../reference/datamodel.rst:2731 +#: ../../reference/datamodel.rst:2733 msgid "" "The following methods can be defined to emulate numeric objects. Methods " "corresponding to operations that are not supported by the particular kind of " @@ -3110,7 +3110,7 @@ msgid "" "should be left undefined." msgstr "" -#: ../../reference/datamodel.rst:2757 +#: ../../reference/datamodel.rst:2759 msgid "" "These methods are called to implement the binary arithmetic operations " "(``+``, ``-``, ``*``, ``@``, ``/``, ``//``, ``%``, :func:`divmod`, :func:" @@ -3124,13 +3124,13 @@ msgid "" "function is to be supported." msgstr "" -#: ../../reference/datamodel.rst:2768 +#: ../../reference/datamodel.rst:2770 msgid "" "If one of those methods does not support the operation with the supplied " "arguments, it should return ``NotImplemented``." msgstr "" -#: ../../reference/datamodel.rst:2791 +#: ../../reference/datamodel.rst:2793 msgid "" "These methods are called to implement the binary arithmetic operations " "(``+``, ``-``, ``*``, ``@``, ``/``, ``//``, ``%``, :func:`divmod`, :func:" @@ -3143,13 +3143,13 @@ msgid "" "*NotImplemented*." msgstr "" -#: ../../reference/datamodel.rst:2803 +#: ../../reference/datamodel.rst:2805 msgid "" "Note that ternary :func:`pow` will not try calling :meth:`__rpow__` (the " "coercion rules would become too complicated)." msgstr "" -#: ../../reference/datamodel.rst:2808 +#: ../../reference/datamodel.rst:2810 msgid "" "If the right operand's type is a subclass of the left operand's type and " "that subclass provides a different implementation of the reflected method " @@ -3158,7 +3158,7 @@ msgid "" "ancestors' operations." msgstr "" -#: ../../reference/datamodel.rst:2829 +#: ../../reference/datamodel.rst:2831 msgid "" "These methods are called to implement the augmented arithmetic assignments " "(``+=``, ``-=``, ``*=``, ``@=``, ``/=``, ``//=``, ``%=``, ``**=``, ``<<=``, " @@ -3174,19 +3174,19 @@ msgid "" "fact part of the data model." msgstr "" -#: ../../reference/datamodel.rst:2850 +#: ../../reference/datamodel.rst:2852 msgid "" "Called to implement the unary arithmetic operations (``-``, ``+``, :func:" "`abs` and ``~``)." msgstr "" -#: ../../reference/datamodel.rst:2863 +#: ../../reference/datamodel.rst:2865 msgid "" "Called to implement the built-in functions :func:`complex`, :func:`int` and :" "func:`float`. Should return a value of the appropriate type." msgstr "" -#: ../../reference/datamodel.rst:2870 +#: ../../reference/datamodel.rst:2872 msgid "" "Called to implement :func:`operator.index`, and whenever Python needs to " "losslessly convert the numeric object to an integer object (such as in " @@ -3195,14 +3195,14 @@ msgid "" "integer type. Must return an integer." msgstr "" -#: ../../reference/datamodel.rst:2876 +#: ../../reference/datamodel.rst:2878 msgid "" "If :meth:`__int__`, :meth:`__float__` and :meth:`__complex__` are not " "defined then corresponding built-in functions :func:`int`, :func:`float` " "and :func:`complex` fall back to :meth:`__index__`." msgstr "" -#: ../../reference/datamodel.rst:2888 +#: ../../reference/datamodel.rst:2890 msgid "" "Called to implement the built-in function :func:`round` and :mod:`math` " "functions :func:`~math.trunc`, :func:`~math.floor` and :func:`~math.ceil`. " @@ -3211,21 +3211,21 @@ msgid "" "(typically an :class:`int`)." msgstr "" -#: ../../reference/datamodel.rst:2894 +#: ../../reference/datamodel.rst:2896 msgid "" "The built-in function :func:`int` falls back to :meth:`__trunc__` if " "neither :meth:`__int__` nor :meth:`__index__` is defined." msgstr "" -#: ../../reference/datamodel.rst:2897 +#: ../../reference/datamodel.rst:2899 msgid "The delegation of :func:`int` to :meth:`__trunc__` is deprecated." msgstr "" -#: ../../reference/datamodel.rst:2904 +#: ../../reference/datamodel.rst:2906 msgid "With Statement Context Managers" msgstr "" -#: ../../reference/datamodel.rst:2906 +#: ../../reference/datamodel.rst:2908 msgid "" "A :dfn:`context manager` is an object that defines the runtime context to be " "established when executing a :keyword:`with` statement. The context manager " @@ -3235,32 +3235,32 @@ msgid "" "can also be used by directly invoking their methods." msgstr "" -#: ../../reference/datamodel.rst:2917 +#: ../../reference/datamodel.rst:2919 msgid "" "Typical uses of context managers include saving and restoring various kinds " "of global state, locking and unlocking resources, closing opened files, etc." msgstr "" -#: ../../reference/datamodel.rst:2920 +#: ../../reference/datamodel.rst:2922 msgid "" "For more information on context managers, see :ref:`typecontextmanager`." msgstr "" -#: ../../reference/datamodel.rst:2925 +#: ../../reference/datamodel.rst:2927 msgid "" "Enter the runtime context related to this object. The :keyword:`with` " "statement will bind this method's return value to the target(s) specified in " "the :keyword:`!as` clause of the statement, if any." msgstr "" -#: ../../reference/datamodel.rst:2932 +#: ../../reference/datamodel.rst:2934 msgid "" "Exit the runtime context related to this object. The parameters describe the " "exception that caused the context to be exited. If the context was exited " "without an exception, all three arguments will be :const:`None`." msgstr "" -#: ../../reference/datamodel.rst:2936 +#: ../../reference/datamodel.rst:2938 msgid "" "If an exception is supplied, and the method wishes to suppress the exception " "(i.e., prevent it from being propagated), it should return a true value. " @@ -3268,27 +3268,27 @@ msgid "" "method." msgstr "" -#: ../../reference/datamodel.rst:2940 +#: ../../reference/datamodel.rst:2942 msgid "" "Note that :meth:`__exit__` methods should not reraise the passed-in " "exception; this is the caller's responsibility." msgstr "" -#: ../../reference/datamodel.rst:2947 +#: ../../reference/datamodel.rst:2949 msgid ":pep:`343` - The \"with\" statement" msgstr "" -#: ../../reference/datamodel.rst:2947 +#: ../../reference/datamodel.rst:2949 msgid "" "The specification, background, and examples for the Python :keyword:`with` " "statement." msgstr "" -#: ../../reference/datamodel.rst:2954 +#: ../../reference/datamodel.rst:2956 msgid "Customizing positional arguments in class pattern matching" msgstr "" -#: ../../reference/datamodel.rst:2956 +#: ../../reference/datamodel.rst:2958 msgid "" "When using a class name in a pattern, positional arguments in the pattern " "are not allowed by default, i.e. ``case MyClass(x, y)`` is typically invalid " @@ -3296,7 +3296,7 @@ msgid "" "pattern, the class needs to define a *__match_args__* attribute." msgstr "" -#: ../../reference/datamodel.rst:2963 +#: ../../reference/datamodel.rst:2965 msgid "" "This class variable can be assigned a tuple of strings. When this class is " "used in a class pattern with positional arguments, each positional argument " @@ -3305,7 +3305,7 @@ msgid "" "to setting it to ``()``." msgstr "" -#: ../../reference/datamodel.rst:2969 +#: ../../reference/datamodel.rst:2971 msgid "" "For example, if ``MyClass.__match_args__`` is ``(\"left\", \"center\", " "\"right\")`` that means that ``case MyClass(x, y)`` is equivalent to ``case " @@ -3315,19 +3315,19 @@ msgid "" "exc:`TypeError`." msgstr "" -#: ../../reference/datamodel.rst:2979 +#: ../../reference/datamodel.rst:2981 msgid ":pep:`634` - Structural Pattern Matching" msgstr "" -#: ../../reference/datamodel.rst:2980 +#: ../../reference/datamodel.rst:2982 msgid "The specification for the Python ``match`` statement." msgstr "" -#: ../../reference/datamodel.rst:2986 +#: ../../reference/datamodel.rst:2988 msgid "Emulating buffer types" msgstr "" -#: ../../reference/datamodel.rst:2988 +#: ../../reference/datamodel.rst:2990 msgid "" "The :ref:`buffer protocol ` provides a way for Python objects " "to expose efficient access to a low-level memory array. This protocol is " @@ -3335,13 +3335,13 @@ msgid "" "and third-party libraries may define additional buffer types." msgstr "" -#: ../../reference/datamodel.rst:2993 +#: ../../reference/datamodel.rst:2995 msgid "" "While buffer types are usually implemented in C, it is also possible to " "implement the protocol in Python." msgstr "" -#: ../../reference/datamodel.rst:2998 +#: ../../reference/datamodel.rst:3000 msgid "" "Called when a buffer is requested from *self* (for example, by the :class:" "`memoryview` constructor). The *flags* argument is an integer representing " @@ -3351,7 +3351,7 @@ msgid "" "`memoryview` object." msgstr "" -#: ../../reference/datamodel.rst:3007 +#: ../../reference/datamodel.rst:3009 msgid "" "Called when a buffer is no longer needed. The *buffer* argument is a :class:" "`memoryview` object that was previously returned by :meth:`~object." @@ -3360,28 +3360,28 @@ msgid "" "to perform any cleanup are not required to implement this method." msgstr "" -#: ../../reference/datamodel.rst:3019 +#: ../../reference/datamodel.rst:3021 msgid ":pep:`688` - Making the buffer protocol accessible in Python" msgstr "" -#: ../../reference/datamodel.rst:3019 +#: ../../reference/datamodel.rst:3021 msgid "" "Introduces the Python ``__buffer__`` and ``__release_buffer__`` methods." msgstr "" -#: ../../reference/datamodel.rst:3021 +#: ../../reference/datamodel.rst:3023 msgid ":class:`collections.abc.Buffer`" msgstr "" -#: ../../reference/datamodel.rst:3022 +#: ../../reference/datamodel.rst:3024 msgid "ABC for buffer types." msgstr "" -#: ../../reference/datamodel.rst:3027 +#: ../../reference/datamodel.rst:3029 msgid "Special method lookup" msgstr "" -#: ../../reference/datamodel.rst:3029 +#: ../../reference/datamodel.rst:3031 msgid "" "For custom classes, implicit invocations of special methods are only " "guaranteed to work correctly if defined on an object's type, not in the " @@ -3389,7 +3389,7 @@ msgid "" "following code raises an exception::" msgstr "" -#: ../../reference/datamodel.rst:3044 +#: ../../reference/datamodel.rst:3046 msgid "" "The rationale behind this behaviour lies with a number of special methods " "such as :meth:`~object.__hash__` and :meth:`~object.__repr__` that are " @@ -3398,21 +3398,21 @@ msgid "" "invoked on the type object itself::" msgstr "" -#: ../../reference/datamodel.rst:3058 +#: ../../reference/datamodel.rst:3060 msgid "" "Incorrectly attempting to invoke an unbound method of a class in this way is " "sometimes referred to as 'metaclass confusion', and is avoided by bypassing " "the instance when looking up special methods::" msgstr "" -#: ../../reference/datamodel.rst:3067 +#: ../../reference/datamodel.rst:3069 msgid "" "In addition to bypassing any instance attributes in the interest of " "correctness, implicit special method lookup generally also bypasses the :" "meth:`~object.__getattribute__` method even of the object's metaclass::" msgstr "" -#: ../../reference/datamodel.rst:3093 +#: ../../reference/datamodel.rst:3095 msgid "" "Bypassing the :meth:`~object.__getattribute__` machinery in this fashion " "provides significant scope for speed optimisations within the interpreter, " @@ -3421,36 +3421,36 @@ msgid "" "consistently invoked by the interpreter)." msgstr "" -#: ../../reference/datamodel.rst:3104 +#: ../../reference/datamodel.rst:3106 msgid "Coroutines" msgstr "協程" -#: ../../reference/datamodel.rst:3108 +#: ../../reference/datamodel.rst:3110 msgid "Awaitable Objects" msgstr "" -#: ../../reference/datamodel.rst:3110 +#: ../../reference/datamodel.rst:3112 msgid "" "An :term:`awaitable` object generally implements an :meth:`~object." "__await__` method. :term:`Coroutine objects ` returned from :" "keyword:`async def` functions are awaitable." msgstr "" -#: ../../reference/datamodel.rst:3116 +#: ../../reference/datamodel.rst:3118 msgid "" "The :term:`generator iterator` objects returned from generators decorated " "with :func:`types.coroutine` are also awaitable, but they do not implement :" "meth:`~object.__await__`." msgstr "" -#: ../../reference/datamodel.rst:3122 +#: ../../reference/datamodel.rst:3124 msgid "" "Must return an :term:`iterator`. Should be used to implement :term:" "`awaitable` objects. For instance, :class:`asyncio.Future` implements this " "method to be compatible with the :keyword:`await` expression." msgstr "" -#: ../../reference/datamodel.rst:3128 +#: ../../reference/datamodel.rst:3130 msgid "" "The language doesn't place any restriction on the type or value of the " "objects yielded by the iterator returned by ``__await__``, as this is " @@ -3458,15 +3458,15 @@ msgid "" "g. :mod:`asyncio`) that will be managing the :term:`awaitable` object." msgstr "" -#: ../../reference/datamodel.rst:3136 +#: ../../reference/datamodel.rst:3138 msgid ":pep:`492` for additional information about awaitable objects." msgstr "" -#: ../../reference/datamodel.rst:3142 +#: ../../reference/datamodel.rst:3144 msgid "Coroutine Objects" msgstr "" -#: ../../reference/datamodel.rst:3144 +#: ../../reference/datamodel.rst:3146 msgid "" ":term:`Coroutine objects ` are :term:`awaitable` objects. A " "coroutine's execution can be controlled by calling :meth:`~object.__await__` " @@ -3477,18 +3477,18 @@ msgid "" "should not directly raise unhandled :exc:`StopIteration` exceptions." msgstr "" -#: ../../reference/datamodel.rst:3152 +#: ../../reference/datamodel.rst:3154 msgid "" "Coroutines also have the methods listed below, which are analogous to those " "of generators (see :ref:`generator-methods`). However, unlike generators, " "coroutines do not directly support iteration." msgstr "" -#: ../../reference/datamodel.rst:3156 +#: ../../reference/datamodel.rst:3158 msgid "It is a :exc:`RuntimeError` to await on a coroutine more than once." msgstr "" -#: ../../reference/datamodel.rst:3162 +#: ../../reference/datamodel.rst:3164 msgid "" "Starts or resumes execution of the coroutine. If *value* is ``None``, this " "is equivalent to advancing the iterator returned by :meth:`~object." @@ -3499,7 +3499,7 @@ msgid "" "value, described above." msgstr "" -#: ../../reference/datamodel.rst:3173 +#: ../../reference/datamodel.rst:3175 msgid "" "Raises the specified exception in the coroutine. This method delegates to " "the :meth:`~generator.throw` method of the iterator that caused the " @@ -3510,13 +3510,13 @@ msgid "" "not caught in the coroutine, it propagates back to the caller." msgstr "" -#: ../../reference/datamodel.rst:3184 +#: ../../reference/datamodel.rst:3186 msgid "" "The second signature \\(type\\[, value\\[, traceback\\]\\]\\) is deprecated " "and may be removed in a future version of Python." msgstr "" -#: ../../reference/datamodel.rst:3189 +#: ../../reference/datamodel.rst:3191 msgid "" "Causes the coroutine to clean itself up and exit. If the coroutine is " "suspended, this method first delegates to the :meth:`~generator.close` " @@ -3526,99 +3526,99 @@ msgid "" "is marked as having finished executing, even if it was never started." msgstr "" -#: ../../reference/datamodel.rst:3197 +#: ../../reference/datamodel.rst:3199 msgid "" "Coroutine objects are automatically closed using the above process when they " "are about to be destroyed." msgstr "" -#: ../../reference/datamodel.rst:3203 +#: ../../reference/datamodel.rst:3205 msgid "Asynchronous Iterators" msgstr "" -#: ../../reference/datamodel.rst:3205 +#: ../../reference/datamodel.rst:3207 msgid "" "An *asynchronous iterator* can call asynchronous code in its ``__anext__`` " "method." msgstr "" -#: ../../reference/datamodel.rst:3208 +#: ../../reference/datamodel.rst:3210 msgid "" "Asynchronous iterators can be used in an :keyword:`async for` statement." msgstr "" -#: ../../reference/datamodel.rst:3212 +#: ../../reference/datamodel.rst:3214 msgid "Must return an *asynchronous iterator* object." msgstr "" -#: ../../reference/datamodel.rst:3216 +#: ../../reference/datamodel.rst:3218 msgid "" "Must return an *awaitable* resulting in a next value of the iterator. " "Should raise a :exc:`StopAsyncIteration` error when the iteration is over." msgstr "" -#: ../../reference/datamodel.rst:3219 +#: ../../reference/datamodel.rst:3221 msgid "An example of an asynchronous iterable object::" msgstr "" -#: ../../reference/datamodel.rst:3236 +#: ../../reference/datamodel.rst:3238 msgid "" "Prior to Python 3.7, :meth:`~object.__aiter__` could return an *awaitable* " "that would resolve to an :term:`asynchronous iterator `." msgstr "" -#: ../../reference/datamodel.rst:3241 +#: ../../reference/datamodel.rst:3243 msgid "" "Starting with Python 3.7, :meth:`~object.__aiter__` must return an " "asynchronous iterator object. Returning anything else will result in a :exc:" "`TypeError` error." msgstr "" -#: ../../reference/datamodel.rst:3249 +#: ../../reference/datamodel.rst:3251 msgid "Asynchronous Context Managers" msgstr "" -#: ../../reference/datamodel.rst:3251 +#: ../../reference/datamodel.rst:3253 msgid "" "An *asynchronous context manager* is a *context manager* that is able to " "suspend execution in its ``__aenter__`` and ``__aexit__`` methods." msgstr "" -#: ../../reference/datamodel.rst:3254 +#: ../../reference/datamodel.rst:3256 msgid "" "Asynchronous context managers can be used in an :keyword:`async with` " "statement." msgstr "" -#: ../../reference/datamodel.rst:3258 +#: ../../reference/datamodel.rst:3260 msgid "" "Semantically similar to :meth:`__enter__`, the only difference being that it " "must return an *awaitable*." msgstr "" -#: ../../reference/datamodel.rst:3263 +#: ../../reference/datamodel.rst:3265 msgid "" "Semantically similar to :meth:`__exit__`, the only difference being that it " "must return an *awaitable*." msgstr "" -#: ../../reference/datamodel.rst:3266 +#: ../../reference/datamodel.rst:3268 msgid "An example of an asynchronous context manager class::" msgstr "" -#: ../../reference/datamodel.rst:3279 +#: ../../reference/datamodel.rst:3281 msgid "Footnotes" msgstr "註解" -#: ../../reference/datamodel.rst:3280 +#: ../../reference/datamodel.rst:3282 msgid "" "It *is* possible in some cases to change an object's type, under certain " "controlled conditions. It generally isn't a good idea though, since it can " "lead to some very strange behaviour if it is handled incorrectly." msgstr "" -#: ../../reference/datamodel.rst:3284 +#: ../../reference/datamodel.rst:3286 msgid "" "The :meth:`~object.__hash__`, :meth:`~object.__iter__`, :meth:`~object." "__reversed__`, and :meth:`~object.__contains__` methods have special " @@ -3626,7 +3626,7 @@ msgid "" "by relying on the behavior that ``None`` is not callable." msgstr "" -#: ../../reference/datamodel.rst:3290 +#: ../../reference/datamodel.rst:3292 msgid "" "\"Does not support\" here means that the class has no such method, or the " "method returns ``NotImplemented``. Do not set the method to ``None`` if you " @@ -3634,7 +3634,7 @@ msgid "" "instead have the opposite effect of explicitly *blocking* such fallback." msgstr "" -#: ../../reference/datamodel.rst:3296 +#: ../../reference/datamodel.rst:3298 msgid "" "For operands of the same type, it is assumed that if the non-reflected " "method -- such as :meth:`~object.__add__` -- fails then the overall " @@ -3655,9 +3655,9 @@ msgstr "" #: ../../reference/datamodel.rst:760 ../../reference/datamodel.rst:778 #: ../../reference/datamodel.rst:810 ../../reference/datamodel.rst:891 #: ../../reference/datamodel.rst:959 ../../reference/datamodel.rst:986 -#: ../../reference/datamodel.rst:1042 ../../reference/datamodel.rst:1100 -#: ../../reference/datamodel.rst:1160 ../../reference/datamodel.rst:1225 -#: ../../reference/datamodel.rst:1616 ../../reference/datamodel.rst:2624 +#: ../../reference/datamodel.rst:1048 ../../reference/datamodel.rst:1102 +#: ../../reference/datamodel.rst:1162 ../../reference/datamodel.rst:1227 +#: ../../reference/datamodel.rst:1618 ../../reference/datamodel.rst:2626 msgid "object" msgstr "object(物件)" @@ -3668,13 +3668,13 @@ msgstr "data(資料)" #: ../../reference/datamodel.rst:23 ../../reference/datamodel.rst:292 #: ../../reference/datamodel.rst:336 ../../reference/datamodel.rst:420 #: ../../reference/datamodel.rst:459 ../../reference/datamodel.rst:760 -#: ../../reference/datamodel.rst:1005 ../../reference/datamodel.rst:1290 -#: ../../reference/datamodel.rst:1530 ../../reference/datamodel.rst:1535 -#: ../../reference/datamodel.rst:1616 ../../reference/datamodel.rst:2166 -#: ../../reference/datamodel.rst:2594 ../../reference/datamodel.rst:2752 -#: ../../reference/datamodel.rst:2787 ../../reference/datamodel.rst:2801 -#: ../../reference/datamodel.rst:2848 ../../reference/datamodel.rst:2858 -#: ../../reference/datamodel.rst:2886 +#: ../../reference/datamodel.rst:1005 ../../reference/datamodel.rst:1292 +#: ../../reference/datamodel.rst:1532 ../../reference/datamodel.rst:1537 +#: ../../reference/datamodel.rst:1618 ../../reference/datamodel.rst:2168 +#: ../../reference/datamodel.rst:2596 ../../reference/datamodel.rst:2754 +#: ../../reference/datamodel.rst:2789 ../../reference/datamodel.rst:2803 +#: ../../reference/datamodel.rst:2850 ../../reference/datamodel.rst:2860 +#: ../../reference/datamodel.rst:2888 msgid "built-in function" msgstr "built-in function(內建函式)" @@ -3683,7 +3683,7 @@ msgid "id" msgstr "id" #: ../../reference/datamodel.rst:23 ../../reference/datamodel.rst:122 -#: ../../reference/datamodel.rst:2166 +#: ../../reference/datamodel.rst:2168 msgid "type" msgstr "type(型別)" @@ -3807,12 +3807,12 @@ msgstr "number(數字)" msgid "Java" msgstr "Java" -#: ../../reference/datamodel.rst:279 ../../reference/datamodel.rst:2858 +#: ../../reference/datamodel.rst:279 ../../reference/datamodel.rst:2860 msgid "complex" msgstr "complex(複數)" #: ../../reference/datamodel.rst:292 ../../reference/datamodel.rst:420 -#: ../../reference/datamodel.rst:459 ../../reference/datamodel.rst:2594 +#: ../../reference/datamodel.rst:459 ../../reference/datamodel.rst:2596 msgid "len" msgstr "len" @@ -3845,8 +3845,8 @@ msgstr "immutable sequence(不可變序列)" msgid "immutable" msgstr "immutable(不可變)" -#: ../../reference/datamodel.rst:332 ../../reference/datamodel.rst:1505 -#: ../../reference/datamodel.rst:1535 +#: ../../reference/datamodel.rst:332 ../../reference/datamodel.rst:1507 +#: ../../reference/datamodel.rst:1537 msgid "string" msgstr "string(字串)" @@ -3882,7 +3882,7 @@ msgstr "singleton(單例)" msgid "empty" msgstr "empty(空的)" -#: ../../reference/datamodel.rst:369 ../../reference/datamodel.rst:1530 +#: ../../reference/datamodel.rst:369 ../../reference/datamodel.rst:1532 msgid "bytes" msgstr "bytes(位元組)" @@ -3904,8 +3904,8 @@ msgid "assignment" msgstr "assignment(賦值)" #: ../../reference/datamodel.rst:381 ../../reference/datamodel.rst:810 -#: ../../reference/datamodel.rst:1257 ../../reference/datamodel.rst:1426 -#: ../../reference/datamodel.rst:2913 +#: ../../reference/datamodel.rst:1259 ../../reference/datamodel.rst:1428 +#: ../../reference/datamodel.rst:2915 msgid "statement" msgstr "statement(陳述式)" @@ -3942,7 +3942,7 @@ msgid "mapping" msgstr "mapping(對映)" #: ../../reference/datamodel.rst:476 ../../reference/datamodel.rst:891 -#: ../../reference/datamodel.rst:1616 +#: ../../reference/datamodel.rst:1618 msgid "dictionary" msgstr "dictionary(字典)" @@ -3965,7 +3965,7 @@ msgid "function" msgstr "function (函式)" #: ../../reference/datamodel.rst:512 ../../reference/datamodel.rst:891 -#: ../../reference/datamodel.rst:913 ../../reference/datamodel.rst:2547 +#: ../../reference/datamodel.rst:913 ../../reference/datamodel.rst:2549 msgid "call" msgstr "call(呼叫)" @@ -4065,7 +4065,7 @@ msgstr "__name__ (方法屬性)" msgid "__module__ (method attribute)" msgstr "__module__ (方法屬性)" -#: ../../reference/datamodel.rst:706 ../../reference/datamodel.rst:1100 +#: ../../reference/datamodel.rst:706 ../../reference/datamodel.rst:1102 msgid "generator" msgstr "generator(產生器)" @@ -4073,7 +4073,7 @@ msgstr "generator(產生器)" msgid "iterator" msgstr "itorator(疊代器)" -#: ../../reference/datamodel.rst:724 ../../reference/datamodel.rst:3100 +#: ../../reference/datamodel.rst:724 ../../reference/datamodel.rst:3102 msgid "coroutine" msgstr "coroutine(協程)" @@ -4118,8 +4118,8 @@ msgid "__dict__ (module attribute)" msgstr "__dict__ (模組屬性)" #: ../../reference/datamodel.rst:891 ../../reference/datamodel.rst:908 -#: ../../reference/datamodel.rst:959 ../../reference/datamodel.rst:1409 -#: ../../reference/datamodel.rst:2277 +#: ../../reference/datamodel.rst:959 ../../reference/datamodel.rst:1411 +#: ../../reference/datamodel.rst:2279 msgid "class" msgstr "class(類別)" @@ -4129,7 +4129,7 @@ msgid "class instance" msgstr "class instance(類別實例)" #: ../../reference/datamodel.rst:891 ../../reference/datamodel.rst:959 -#: ../../reference/datamodel.rst:2547 +#: ../../reference/datamodel.rst:2549 msgid "instance" msgstr "instance(實例)" @@ -4225,371 +4225,371 @@ msgstr "internal type(內部型別)" msgid "types, internal" msgstr "types(型別), internal(內部)" -#: ../../reference/datamodel.rst:1042 +#: ../../reference/datamodel.rst:1048 msgid "bytecode" msgstr "bytecode(位元組碼)" -#: ../../reference/datamodel.rst:1042 +#: ../../reference/datamodel.rst:1048 msgid "code" msgstr "code(程式碼)" -#: ../../reference/datamodel.rst:1042 +#: ../../reference/datamodel.rst:1048 msgid "code object" msgstr "code object(程式碼物件)" -#: ../../reference/datamodel.rst:1057 +#: ../../reference/datamodel.rst:1059 msgid "co_argcount (code object attribute)" msgstr "co_argcount (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1057 +#: ../../reference/datamodel.rst:1059 msgid "co_posonlyargcount (code object attribute)" msgstr "co_posonlyargcount (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1057 +#: ../../reference/datamodel.rst:1059 msgid "co_kwonlyargcount (code object attribute)" msgstr "co_kwonlyargcount (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1057 +#: ../../reference/datamodel.rst:1059 msgid "co_code (code object attribute)" msgstr "co_code (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1057 +#: ../../reference/datamodel.rst:1059 msgid "co_consts (code object attribute)" msgstr "co_consts (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1057 +#: ../../reference/datamodel.rst:1059 msgid "co_filename (code object attribute)" msgstr "co_filename (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1057 +#: ../../reference/datamodel.rst:1059 msgid "co_firstlineno (code object attribute)" msgstr "co_firstlineno (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1057 +#: ../../reference/datamodel.rst:1059 msgid "co_flags (code object attribute)" msgstr "co_flags (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1057 +#: ../../reference/datamodel.rst:1059 msgid "co_lnotab (code object attribute)" msgstr "co_lnotab (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1057 +#: ../../reference/datamodel.rst:1059 msgid "co_name (code object attribute)" msgstr "co_name (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1057 +#: ../../reference/datamodel.rst:1059 msgid "co_names (code object attribute)" msgstr "co_names (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1057 +#: ../../reference/datamodel.rst:1059 msgid "co_nlocals (code object attribute)" msgstr "co_nlocals (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1057 +#: ../../reference/datamodel.rst:1059 msgid "co_stacksize (code object attribute)" msgstr "co_stacksize (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1057 +#: ../../reference/datamodel.rst:1059 msgid "co_varnames (code object attribute)" msgstr "co_varnames (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1057 +#: ../../reference/datamodel.rst:1059 msgid "co_cellvars (code object attribute)" msgstr "co_cellvars (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1057 +#: ../../reference/datamodel.rst:1059 msgid "co_freevars (code object attribute)" msgstr "co_freevars (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1057 +#: ../../reference/datamodel.rst:1059 msgid "co_qualname (code object attribute)" msgstr "co_qualname (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1116 +#: ../../reference/datamodel.rst:1118 msgid "documentation string" msgstr "documentation string(文件字串)" -#: ../../reference/datamodel.rst:1160 +#: ../../reference/datamodel.rst:1162 msgid "frame" msgstr "frame" -#: ../../reference/datamodel.rst:1165 +#: ../../reference/datamodel.rst:1167 msgid "f_back (frame attribute)" msgstr "f_back (frame 屬性)" -#: ../../reference/datamodel.rst:1165 +#: ../../reference/datamodel.rst:1167 msgid "f_code (frame attribute)" msgstr "f_code (frame 屬性)" -#: ../../reference/datamodel.rst:1165 +#: ../../reference/datamodel.rst:1167 msgid "f_globals (frame attribute)" msgstr "f_globals (frame 屬性)" -#: ../../reference/datamodel.rst:1165 +#: ../../reference/datamodel.rst:1167 msgid "f_locals (frame attribute)" msgstr "f_locals (frame 屬性)" -#: ../../reference/datamodel.rst:1165 +#: ../../reference/datamodel.rst:1167 msgid "f_lasti (frame attribute)" msgstr "f_lasti (frame 屬性)" -#: ../../reference/datamodel.rst:1165 +#: ../../reference/datamodel.rst:1167 msgid "f_builtins (frame attribute)" msgstr "f_builtins (frame 屬性)" -#: ../../reference/datamodel.rst:1184 +#: ../../reference/datamodel.rst:1186 msgid "f_trace (frame attribute)" msgstr "f_trace (frame 屬性)" -#: ../../reference/datamodel.rst:1184 +#: ../../reference/datamodel.rst:1186 msgid "f_trace_lines (frame attribute)" msgstr "f_trace_lines (frame 屬性)" -#: ../../reference/datamodel.rst:1184 +#: ../../reference/datamodel.rst:1186 msgid "f_trace_opcodes (frame attribute)" msgstr "f_trace_opcodes (frame 屬性)" -#: ../../reference/datamodel.rst:1184 +#: ../../reference/datamodel.rst:1186 msgid "f_lineno (frame attribute)" msgstr "f_lineno (frame 屬性)" -#: ../../reference/datamodel.rst:1225 +#: ../../reference/datamodel.rst:1227 msgid "traceback" msgstr "traceback" -#: ../../reference/datamodel.rst:1225 +#: ../../reference/datamodel.rst:1227 msgid "stack" msgstr "stack(堆疊)" -#: ../../reference/datamodel.rst:1225 +#: ../../reference/datamodel.rst:1227 msgid "trace" msgstr "trace(追蹤)" -#: ../../reference/datamodel.rst:1225 +#: ../../reference/datamodel.rst:1227 msgid "exception" msgstr "exception(例外)" -#: ../../reference/datamodel.rst:1225 +#: ../../reference/datamodel.rst:1227 msgid "handler" msgstr "handler(處理器)" -#: ../../reference/datamodel.rst:1225 +#: ../../reference/datamodel.rst:1227 msgid "execution" msgstr "execution(執行)" -#: ../../reference/datamodel.rst:1225 +#: ../../reference/datamodel.rst:1227 msgid "exc_info (in module sys)" msgstr "exc_info (sys 模組中)" -#: ../../reference/datamodel.rst:1225 +#: ../../reference/datamodel.rst:1227 msgid "last_traceback (in module sys)" msgstr "last_traceback (sys 模組中)" -#: ../../reference/datamodel.rst:1225 +#: ../../reference/datamodel.rst:1227 msgid "sys.exc_info" msgstr "sys.exc_info" -#: ../../reference/datamodel.rst:1225 +#: ../../reference/datamodel.rst:1227 msgid "sys.exception" msgstr "sys.exception" -#: ../../reference/datamodel.rst:1225 +#: ../../reference/datamodel.rst:1227 msgid "sys.last_traceback" msgstr "sys.last_traceback" -#: ../../reference/datamodel.rst:1257 +#: ../../reference/datamodel.rst:1259 msgid "tb_frame (traceback attribute)" msgstr "tb_frame (traceback 屬性)" -#: ../../reference/datamodel.rst:1257 +#: ../../reference/datamodel.rst:1259 msgid "tb_lineno (traceback attribute)" msgstr "tb_lineno (traceback 屬性)" -#: ../../reference/datamodel.rst:1257 +#: ../../reference/datamodel.rst:1259 msgid "tb_lasti (traceback attribute)" msgstr "tb_lasti (traceback 屬性)" -#: ../../reference/datamodel.rst:1257 +#: ../../reference/datamodel.rst:1259 msgid "try" msgstr "try" -#: ../../reference/datamodel.rst:1275 +#: ../../reference/datamodel.rst:1277 msgid "tb_next (traceback attribute)" msgstr "tb_next (traceback 屬性)" -#: ../../reference/datamodel.rst:1290 ../../reference/datamodel.rst:2624 +#: ../../reference/datamodel.rst:1292 ../../reference/datamodel.rst:2626 msgid "slice" msgstr "slice(切片)" -#: ../../reference/datamodel.rst:1296 +#: ../../reference/datamodel.rst:1298 msgid "start (slice object attribute)" msgstr "start (slice 物件屬性)" -#: ../../reference/datamodel.rst:1296 +#: ../../reference/datamodel.rst:1298 msgid "stop (slice object attribute)" msgstr "stop (slice 物件屬性)" -#: ../../reference/datamodel.rst:1296 +#: ../../reference/datamodel.rst:1298 msgid "step (slice object attribute)" msgstr "step (slice 物件屬性)" -#: ../../reference/datamodel.rst:1344 +#: ../../reference/datamodel.rst:1346 msgid "operator" msgstr "operator(運算子)" -#: ../../reference/datamodel.rst:1344 +#: ../../reference/datamodel.rst:1346 msgid "overloading" msgstr "overloading(多載)" -#: ../../reference/datamodel.rst:1344 +#: ../../reference/datamodel.rst:1346 msgid "__getitem__() (mapping object method)" msgstr "__getitem__() (對映物件方法)" -#: ../../reference/datamodel.rst:1380 +#: ../../reference/datamodel.rst:1382 msgid "subclassing" msgstr "subclassing(子類別化)" -#: ../../reference/datamodel.rst:1380 +#: ../../reference/datamodel.rst:1382 msgid "immutable types" msgstr "immutable types(不可變型別)" -#: ../../reference/datamodel.rst:1409 +#: ../../reference/datamodel.rst:1411 msgid "constructor" msgstr "constructor(建構函式)" -#: ../../reference/datamodel.rst:1426 +#: ../../reference/datamodel.rst:1428 msgid "destructor" msgstr "destructor(解構函式)" -#: ../../reference/datamodel.rst:1426 +#: ../../reference/datamodel.rst:1428 msgid "finalizer" msgstr "finalizer(終結函式)" -#: ../../reference/datamodel.rst:1426 +#: ../../reference/datamodel.rst:1428 msgid "del" msgstr "del" -#: ../../reference/datamodel.rst:1488 +#: ../../reference/datamodel.rst:1490 msgid "repr() (built-in function)" msgstr "repr() (內建函式)" -#: ../../reference/datamodel.rst:1488 +#: ../../reference/datamodel.rst:1490 msgid "__repr__() (object method)" msgstr "__repr__() (物件方法)" -#: ../../reference/datamodel.rst:1505 +#: ../../reference/datamodel.rst:1507 msgid "__str__() (object method)" msgstr "__str__() (物件方法)" -#: ../../reference/datamodel.rst:1505 +#: ../../reference/datamodel.rst:1507 msgid "format() (built-in function)" msgstr "format() (內建函式)" -#: ../../reference/datamodel.rst:1505 +#: ../../reference/datamodel.rst:1507 msgid "print() (built-in function)" msgstr "print() (內建函式)" -#: ../../reference/datamodel.rst:1535 +#: ../../reference/datamodel.rst:1537 msgid "__format__() (object method)" msgstr "__format__() (物件方法)" -#: ../../reference/datamodel.rst:1535 +#: ../../reference/datamodel.rst:1537 msgid "conversion" msgstr "conversion" -#: ../../reference/datamodel.rst:1535 +#: ../../reference/datamodel.rst:1537 msgid "print" msgstr "print" -#: ../../reference/datamodel.rst:1574 +#: ../../reference/datamodel.rst:1576 msgid "comparisons" msgstr "comparison(比較)" -#: ../../reference/datamodel.rst:1616 +#: ../../reference/datamodel.rst:1618 msgid "hash" msgstr "hash(雜湊)" -#: ../../reference/datamodel.rst:1697 +#: ../../reference/datamodel.rst:1699 msgid "__len__() (mapping object method)" msgstr "__len__() (對映物件方法)" -#: ../../reference/datamodel.rst:1800 +#: ../../reference/datamodel.rst:1802 msgid "__getattr__ (module attribute)" msgstr "__getattr__ (模組屬性)" -#: ../../reference/datamodel.rst:1800 +#: ../../reference/datamodel.rst:1802 msgid "__dir__ (module attribute)" msgstr "__dir__ (模組屬性)" -#: ../../reference/datamodel.rst:1800 +#: ../../reference/datamodel.rst:1802 msgid "__class__ (module attribute)" msgstr "__class__ (模組屬性)" -#: ../../reference/datamodel.rst:2166 +#: ../../reference/datamodel.rst:2168 msgid "metaclass" msgstr "metaclass(元類別)" -#: ../../reference/datamodel.rst:2166 +#: ../../reference/datamodel.rst:2168 msgid "= (equals)" msgstr "= (等於)" -#: ../../reference/datamodel.rst:2166 +#: ../../reference/datamodel.rst:2168 msgid "class definition" msgstr "class definition(類別定義)" -#: ../../reference/datamodel.rst:2230 +#: ../../reference/datamodel.rst:2232 msgid "metaclass hint" msgstr "metaclass hint(元類別提示)" -#: ../../reference/datamodel.rst:2253 +#: ../../reference/datamodel.rst:2255 msgid "__prepare__ (metaclass method)" msgstr "__prepare__ (元類別方法)" -#: ../../reference/datamodel.rst:2277 +#: ../../reference/datamodel.rst:2279 msgid "body" msgstr "body" -#: ../../reference/datamodel.rst:2297 +#: ../../reference/datamodel.rst:2299 msgid "__class__ (method cell)" msgstr "__class__ (方法 cell)" -#: ../../reference/datamodel.rst:2297 +#: ../../reference/datamodel.rst:2299 msgid "__classcell__ (class namespace entry)" msgstr "__classcell__ (類別命名空間項目)" -#: ../../reference/datamodel.rst:2594 +#: ../../reference/datamodel.rst:2596 msgid "__bool__() (object method)" msgstr "__bool__() (物件方法)" -#: ../../reference/datamodel.rst:2752 ../../reference/datamodel.rst:2787 +#: ../../reference/datamodel.rst:2754 ../../reference/datamodel.rst:2789 msgid "divmod" msgstr "divmod" -#: ../../reference/datamodel.rst:2752 ../../reference/datamodel.rst:2787 -#: ../../reference/datamodel.rst:2801 +#: ../../reference/datamodel.rst:2754 ../../reference/datamodel.rst:2789 +#: ../../reference/datamodel.rst:2803 msgid "pow" msgstr "pow" -#: ../../reference/datamodel.rst:2848 +#: ../../reference/datamodel.rst:2850 msgid "abs" msgstr "abs" -#: ../../reference/datamodel.rst:2858 +#: ../../reference/datamodel.rst:2860 msgid "int" msgstr "int" -#: ../../reference/datamodel.rst:2858 +#: ../../reference/datamodel.rst:2860 msgid "float" msgstr "float" -#: ../../reference/datamodel.rst:2886 +#: ../../reference/datamodel.rst:2888 msgid "round" msgstr "round" -#: ../../reference/datamodel.rst:2913 +#: ../../reference/datamodel.rst:2915 msgid "with" msgstr "with" -#: ../../reference/datamodel.rst:2913 +#: ../../reference/datamodel.rst:2915 msgid "context manager" msgstr "context manager(情境管理器)" diff --git a/sphinx.po b/sphinx.po index 443deb3bf7..3172c142e8 100644 --- a/sphinx.po +++ b/sphinx.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-26 00:03+0000\n" +"POT-Creation-Date: 2023-09-14 00:03+0000\n" "PO-Revision-Date: 2023-03-15 10:19+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -244,6 +244,10 @@ msgstr "Python 的沿革與授權" msgid "Copyright" msgstr "版權" +#: ../../tools/templates/indexcontent.html:65 +msgid "Download the documentation" +msgstr "下載說明文件" + #: ../../tools/templates/indexsidebar.html:1 msgid "Download" msgstr "下載" diff --git a/tutorial/appendix.po b/tutorial/appendix.po index 7ee36c62e6..3ac06d2f35 100644 --- a/tutorial/appendix.po +++ b/tutorial/appendix.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-06-26 18:54+0800\n" +"POT-Creation-Date: 2023-09-03 00:03+0000\n" "PO-Revision-Date: 2021-07-05 14:35+0800\n" "Last-Translator: meowmeowcat \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -163,14 +163,14 @@ msgstr "客製化模組" #: ../../tutorial/appendix.rst:104 msgid "" -"Python provides two hooks to let you customize it: :mod:`sitecustomize` and :" -"mod:`usercustomize`. To see how it works, you need first to find the " +"Python provides two hooks to let you customize it: :index:`sitecustomize` " +"and :index:`usercustomize`. To see how it works, you need first to find the " "location of your user site-packages directory. Start Python and run this " "code::" msgstr "" -"Python 提供了兩個鉤子(hook)讓你可以將它客製化: :mod:`sitecustomize` 和 :" -"mod:`usercustomize` 。要看它是如何運作的,你首先需要找到你的 site-packages 的" -"位置。啟動 Python 並運行這段程式碼:\n" +"Python 提供了兩個鉤子 (hook) 讓你可以將它客製化: :index:`sitecustomize` 和 :" +"index:`usercustomize` 。要看它是如何運作的,你首先需要找到你的 site-packages " +"的位置。啟動 Python 並運行這段程式碼:\n" "\n" "::" @@ -187,14 +187,14 @@ msgstr "" #: ../../tutorial/appendix.rst:116 msgid "" -":mod:`sitecustomize` works in the same way, but is typically created by an " +":index:`sitecustomize` works in the same way, but is typically created by an " "administrator of the computer in the global site-packages directory, and is " -"imported before :mod:`usercustomize`. See the documentation of the :mod:" +"imported before :index:`usercustomize`. See the documentation of the :mod:" "`site` module for more details." msgstr "" -":mod:`sitecustomize` 的運作方式相同,但通常是由電腦的管理員在全域 site-" -"packages 目錄下創建,並在 :mod:`usercustomize` 之前 import 。更多細節請參閱 :" -"mod:`site` 模組的文件。" +":index:`sitecustomize` 的運作方式相同,但通常是由電腦的管理員在全域 site-" +"packages 目錄下創建,並在 :index:`usercustomize` 之前 import 。更多細節請參" +"閱 :mod:`site` 模組的文件。" #: ../../tutorial/appendix.rst:123 msgid "Footnotes" diff --git a/tutorial/classes.po b/tutorial/classes.po index c7e6db0e8f..a00a286b46 100644 --- a/tutorial/classes.po +++ b/tutorial/classes.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-22 00:03+0000\n" +"POT-Creation-Date: 2023-09-02 00:03+0000\n" "PO-Revision-Date: 2022-12-26 23:12+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -475,13 +475,13 @@ msgid "" "then ``MyClass.i`` and ``MyClass.f`` are valid attribute references, " "returning an integer and a function object, respectively. Class attributes " "can also be assigned to, so you can change the value of ``MyClass.i`` by " -"assignment. :attr:`__doc__` is also a valid attribute, returning the " +"assignment. :attr:`!__doc__` is also a valid attribute, returning the " "docstring belonging to the class: ``\"A simple example class\"``." msgstr "" "那麼 ``MyClass.i`` 和 ``MyClass.f`` 都是有效的屬性參照,會分別回傳一個整數和" "一個函式物件。Class 屬性也可以被指派 (assign),所以您可以透過賦值改變 " -"``MyClass.i`` 的值。:attr:`__doc__` 也是一個有效的屬性,會回傳屬於該 class 的" -"說明字串 (docstring):``\"A simple example class\"``。" +"``MyClass.i`` 的值。:attr:`!__doc__` 也是一個有效的屬性,會回傳屬於該 class " +"的說明字串 (docstring):``\"A simple example class\"``。" #: ../../tutorial/classes.rst:282 msgid "" diff --git a/using/configure.po b/using/configure.po index 27dd931962..f461e35107 100644 --- a/using/configure.po +++ b/using/configure.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-18 00:03+0000\n" +"POT-Creation-Date: 2023-09-09 00:03+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-" @@ -64,7 +64,7 @@ msgstr "" #: ../../using/configure.rst:29 msgid "OpenSSL 1.1.1 is now required." -msgstr "" +msgstr "OpenSSL 1.1.1 現在是必要的。" #: ../../using/configure.rst:32 msgid "Thread support and OpenSSL 1.0.2 are now required." @@ -78,7 +78,7 @@ msgstr "" #: ../../using/configure.rst:39 msgid "On Windows, Visual Studio 2015 or later is required." -msgstr "" +msgstr "在 Windows 上需要 Visual Studio 2015 或更新版本。" #: ../../using/configure.rst:42 msgid "" @@ -86,63 +86,88 @@ msgid "" "platform support\"." msgstr "" +#: ../../using/configure.rst:47 +msgid "Generated files" +msgstr "產生的檔案" + #: ../../using/configure.rst:49 -msgid "Configure Options" +msgid "" +"To reduce build dependencies, Python source code contains multiple generated " +"files. Commands to regenerate all generated files::" msgstr "" -#: ../../using/configure.rst:51 +#: ../../using/configure.rst:57 +msgid "" +"The ``Makefile.pre.in`` file documents generated files, their inputs, and " +"tools used to regenerate them. Search for ``regen-*`` make targets." +msgstr "" + +#: ../../using/configure.rst:60 +msgid "" +"The ``make regen-configure`` command runs `tiran/cpython_autoconf `_ container for reproducible build; see " +"container ``entry.sh`` script. The container is optional, the following " +"command can be run locally, the generated files depend on autoconf and " +"aclocal versions::" +msgstr "" + +#: ../../using/configure.rst:72 +msgid "Configure Options" +msgstr "設定選項" + +#: ../../using/configure.rst:74 msgid "List all ``./configure`` script options using::" msgstr "" -#: ../../using/configure.rst:55 +#: ../../using/configure.rst:78 msgid "" "See also the :file:`Misc/SpecialBuilds.txt` in the Python source " "distribution." msgstr "" -#: ../../using/configure.rst:58 +#: ../../using/configure.rst:81 msgid "General Options" -msgstr "" +msgstr "一般選項" -#: ../../using/configure.rst:62 +#: ../../using/configure.rst:85 msgid "" "Support loadable extensions in the :mod:`_sqlite` extension module (default " "is no)." msgstr "" -#: ../../using/configure.rst:65 +#: ../../using/configure.rst:88 msgid "" "See the :meth:`sqlite3.Connection.enable_load_extension` method of the :mod:" "`sqlite3` module." msgstr "" -#: ../../using/configure.rst:72 +#: ../../using/configure.rst:95 msgid "" "Disable IPv6 support (enabled by default if supported), see the :mod:" "`socket` module." msgstr "" -#: ../../using/configure.rst:77 +#: ../../using/configure.rst:100 msgid "Define the size in bits of Python :class:`int` digits: 15 or 30 bits." msgstr "" -#: ../../using/configure.rst:79 +#: ../../using/configure.rst:102 msgid "By default, the digit size is 30." msgstr "" -#: ../../using/configure.rst:81 +#: ../../using/configure.rst:104 msgid "Define the ``PYLONG_BITS_IN_DIGIT`` to ``15`` or ``30``." msgstr "將 ``PYLONG_BITS_IN_DIGIT`` 定義為 ``15`` 或 ``30``\\ 。" -#: ../../using/configure.rst:83 +#: ../../using/configure.rst:106 msgid "See :data:`sys.int_info.bits_per_digit `." msgstr "參閱 :data:`sys.int_info.bits_per_digit `\\ 。" -#: ../../using/configure.rst:87 +#: ../../using/configure.rst:110 msgid "Set the Python executable suffix to *SUFFIX*." msgstr "" -#: ../../using/configure.rst:89 +#: ../../using/configure.rst:112 msgid "" "The default suffix is ``.exe`` on Windows and macOS (``python.exe`` " "executable), ``.js`` on Emscripten node, ``.html`` on Emscripten browser, ``." @@ -150,95 +175,95 @@ msgid "" "executable)." msgstr "" -#: ../../using/configure.rst:94 +#: ../../using/configure.rst:117 msgid "" "The default suffix on WASM platform is one of ``.js``, ``.html`` or ``." "wasm``." msgstr "" -#: ../../using/configure.rst:100 +#: ../../using/configure.rst:123 msgid "" "Select the default time zone search path for :const:`zoneinfo.TZPATH`. See " "the :ref:`Compile-time configuration ` of " "the :mod:`zoneinfo` module." msgstr "" -#: ../../using/configure.rst:104 +#: ../../using/configure.rst:127 msgid "" "Default: ``/usr/share/zoneinfo:/usr/lib/zoneinfo:/usr/share/lib/zoneinfo:/" "etc/zoneinfo``." msgstr "" -#: ../../using/configure.rst:106 +#: ../../using/configure.rst:129 msgid "See :data:`os.pathsep` path separator." msgstr "" -#: ../../using/configure.rst:112 +#: ../../using/configure.rst:135 msgid "" "Build the ``_decimal`` extension module using a thread-local context rather " "than a coroutine-local context (default), see the :mod:`decimal` module." msgstr "" -#: ../../using/configure.rst:115 +#: ../../using/configure.rst:138 msgid "See :const:`decimal.HAVE_CONTEXTVAR` and the :mod:`contextvars` module." msgstr "" -#: ../../using/configure.rst:121 +#: ../../using/configure.rst:144 msgid "Override order to check db backends for the :mod:`dbm` module" msgstr "" -#: ../../using/configure.rst:123 +#: ../../using/configure.rst:146 msgid "" "A valid value is a colon (``:``) separated string with the backend names:" msgstr "" -#: ../../using/configure.rst:125 +#: ../../using/configure.rst:148 msgid "``ndbm``;" -msgstr "" +msgstr "``ndbm``;" -#: ../../using/configure.rst:126 +#: ../../using/configure.rst:149 msgid "``gdbm``;" -msgstr "" +msgstr "``gdbm``;" -#: ../../using/configure.rst:127 +#: ../../using/configure.rst:150 msgid "``bdb``." -msgstr "" +msgstr "``bdb``." -#: ../../using/configure.rst:131 +#: ../../using/configure.rst:154 msgid "Disable C locale coercion to a UTF-8 based locale (enabled by default)." msgstr "" -#: ../../using/configure.rst:133 +#: ../../using/configure.rst:156 msgid "Don't define the ``PY_COERCE_C_LOCALE`` macro." -msgstr "" +msgstr "不要定義 ``PY_COERCE_C_LOCALE`` 巨集。" -#: ../../using/configure.rst:135 +#: ../../using/configure.rst:158 msgid "See :envvar:`PYTHONCOERCECLOCALE` and the :pep:`538`." msgstr "請見 :envvar:`PYTHONCOERCECLOCALE` 與 :pep:`538`。" -#: ../../using/configure.rst:139 +#: ../../using/configure.rst:162 msgid "Disable all freelists except the empty tuple singleton." msgstr "" -#: ../../using/configure.rst:145 +#: ../../using/configure.rst:168 msgid "Python library directory name (default is ``lib``)." msgstr "" -#: ../../using/configure.rst:147 +#: ../../using/configure.rst:170 msgid "Fedora and SuSE use ``lib64`` on 64-bit platforms." -msgstr "" +msgstr "Fedora 和 SuSE 在 64 位元平台上使用 ``lib64``。" -#: ../../using/configure.rst:149 +#: ../../using/configure.rst:172 msgid "See :data:`sys.platlibdir`." msgstr "參閱 :data:`sys.platlibdir`\\ 。" -#: ../../using/configure.rst:155 +#: ../../using/configure.rst:178 msgid "" "Directory of wheel packages used by the :mod:`ensurepip` module (none by " "default)." msgstr "" -#: ../../using/configure.rst:158 +#: ../../using/configure.rst:181 msgid "" "Some Linux distribution packaging policies recommend against bundling " "dependencies. For example, Fedora installs wheel packages in the ``/usr/" @@ -246,201 +271,201 @@ msgid "" "_bundled` package." msgstr "" -#: ../../using/configure.rst:167 +#: ../../using/configure.rst:190 msgid "" "Whether configure should use :program:`pkg-config` to detect build " "dependencies." msgstr "" -#: ../../using/configure.rst:170 +#: ../../using/configure.rst:193 msgid "``check`` (default): :program:`pkg-config` is optional" msgstr "" -#: ../../using/configure.rst:171 +#: ../../using/configure.rst:194 msgid "``yes``: :program:`pkg-config` is mandatory" msgstr "" -#: ../../using/configure.rst:172 +#: ../../using/configure.rst:195 msgid "``no``: configure does not use :program:`pkg-config` even when present" msgstr "" -#: ../../using/configure.rst:178 +#: ../../using/configure.rst:201 msgid "Turn on internal statistics gathering." msgstr "" -#: ../../using/configure.rst:180 +#: ../../using/configure.rst:203 msgid "" "The statistics will be dumped to a arbitrary (probably unique) file in ``/" "tmp/py_stats/``, or ``C:\\temp\\py_stats\\`` on Windows. If that directory " "does not exist, results will be printed on stdout." msgstr "" -#: ../../using/configure.rst:184 +#: ../../using/configure.rst:207 msgid "Use ``Tools/scripts/summarize_stats.py`` to read the stats." -msgstr "" +msgstr "使用 ``Tools/scripts/summarize_stats.py`` 來讀取統計資料。" -#: ../../using/configure.rst:189 +#: ../../using/configure.rst:212 msgid "WebAssembly Options" -msgstr "" +msgstr "WebAssembly 選項" -#: ../../using/configure.rst:193 +#: ../../using/configure.rst:216 msgid "Set build flavor for ``wasm32-emscripten``." msgstr "" -#: ../../using/configure.rst:195 +#: ../../using/configure.rst:218 msgid "``browser`` (default): preload minimal stdlib, default MEMFS." msgstr "" -#: ../../using/configure.rst:196 +#: ../../using/configure.rst:219 msgid "``node``: NODERAWFS and pthread support." msgstr "" -#: ../../using/configure.rst:202 +#: ../../using/configure.rst:225 msgid "Turn on dynamic linking support for WASM." msgstr "" -#: ../../using/configure.rst:204 +#: ../../using/configure.rst:227 msgid "" "Dynamic linking enables ``dlopen``. File size of the executable increases " "due to limited dead code elimination and additional features." msgstr "" -#: ../../using/configure.rst:211 +#: ../../using/configure.rst:234 msgid "Turn on pthreads support for WASM." msgstr "" -#: ../../using/configure.rst:217 +#: ../../using/configure.rst:240 msgid "Install Options" -msgstr "" +msgstr "安裝選項" -#: ../../using/configure.rst:221 +#: ../../using/configure.rst:244 msgid "" "Install architecture-independent files in PREFIX. On Unix, it defaults to :" "file:`/usr/local`." msgstr "" -#: ../../using/configure.rst:224 -msgid "This value can be retrived at runtime using :data:`sys.prefix`." +#: ../../using/configure.rst:247 +msgid "This value can be retrieved at runtime using :data:`sys.prefix`." msgstr "" -#: ../../using/configure.rst:226 +#: ../../using/configure.rst:249 msgid "" "As an example, one can use ``--prefix=\"$HOME/.local/\"`` to install a " "Python in its home directory." msgstr "" -#: ../../using/configure.rst:231 +#: ../../using/configure.rst:254 msgid "" "Install architecture-dependent files in EPREFIX, defaults to :option:`--" "prefix`." msgstr "" -#: ../../using/configure.rst:233 -msgid "This value can be retrived at runtime using :data:`sys.exec_prefix`." +#: ../../using/configure.rst:256 +msgid "This value can be retrieved at runtime using :data:`sys.exec_prefix`." msgstr "" -#: ../../using/configure.rst:237 +#: ../../using/configure.rst:260 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:244 +#: ../../using/configure.rst:267 msgid "Select the :mod:`ensurepip` command run on Python installation:" msgstr "" -#: ../../using/configure.rst:246 +#: ../../using/configure.rst:269 msgid "" "``upgrade`` (default): run ``python -m ensurepip --altinstall --upgrade`` " "command." msgstr "" -#: ../../using/configure.rst:248 +#: ../../using/configure.rst:271 msgid "``install``: run ``python -m ensurepip --altinstall`` command;" msgstr "" -#: ../../using/configure.rst:249 +#: ../../using/configure.rst:272 msgid "``no``: don't run ensurepip;" msgstr "" -#: ../../using/configure.rst:255 +#: ../../using/configure.rst:278 msgid "Performance options" msgstr "" -#: ../../using/configure.rst:257 +#: ../../using/configure.rst:280 msgid "" "Configuring Python using ``--enable-optimizations --with-lto`` (PGO + LTO) " "is recommended for best performance. The experimental ``--enable-bolt`` flag " "can also be used to improve performance." msgstr "" -#: ../../using/configure.rst:263 +#: ../../using/configure.rst:286 msgid "" "Enable Profile Guided Optimization (PGO) using :envvar:`PROFILE_TASK` " "(disabled by default)." msgstr "" -#: ../../using/configure.rst:266 +#: ../../using/configure.rst:289 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:269 +#: ../../using/configure.rst:292 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:275 +#: ../../using/configure.rst:298 msgid "Use ``-fno-semantic-interposition`` on GCC." msgstr "" -#: ../../using/configure.rst:280 +#: ../../using/configure.rst:303 msgid "" "Environment variable used in the Makefile: Python command line arguments for " "the PGO generation task." msgstr "" -#: ../../using/configure.rst:283 +#: ../../using/configure.rst:306 msgid "Default: ``-m test --pgo --timeout=$(TESTTIMEOUT)``." msgstr "" -#: ../../using/configure.rst:289 +#: ../../using/configure.rst:312 msgid "Enable Link Time Optimization (LTO) in any build (disabled by default)." msgstr "" -#: ../../using/configure.rst:291 +#: ../../using/configure.rst:314 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:296 +#: ../../using/configure.rst:319 msgid "To use ThinLTO feature, use ``--with-lto=thin`` on Clang." msgstr "" -#: ../../using/configure.rst:299 +#: ../../using/configure.rst:322 msgid "" "Use ThinLTO as the default optimization policy on Clang if the compiler " "accepts the flag." msgstr "" -#: ../../using/configure.rst:304 +#: ../../using/configure.rst:327 msgid "" "Enable usage of the `BOLT post-link binary optimizer `_ (disabled by default)." msgstr "" -#: ../../using/configure.rst:308 +#: ../../using/configure.rst:331 msgid "" "BOLT is part of the LLVM project but is not always included in their binary " "distributions. This flag requires that ``llvm-bolt`` and ``merge-fdata`` are " "available." msgstr "" -#: ../../using/configure.rst:312 +#: ../../using/configure.rst:335 msgid "" "BOLT is still a fairly new project so this flag should be considered " "experimental for now. Because this tool operates on machine code its success " @@ -451,7 +476,7 @@ msgid "" "encouraged." msgstr "" -#: ../../using/configure.rst:320 +#: ../../using/configure.rst:343 msgid "" "The :envvar:`!BOLT_INSTRUMENT_FLAGS` and :envvar:`!BOLT_APPLY_FLAGS` :" "program:`configure` variables can be defined to override the default set of " @@ -459,101 +484,101 @@ msgid "" "binaries, respectively." msgstr "" -#: ../../using/configure.rst:329 +#: ../../using/configure.rst:352 msgid "" "Enable computed gotos in evaluation loop (enabled by default on supported " "compilers)." msgstr "" -#: ../../using/configure.rst:334 +#: ../../using/configure.rst:357 msgid "" "Disable the specialized Python memory allocator :ref:`pymalloc ` " "(enabled by default)." msgstr "" -#: ../../using/configure.rst:337 +#: ../../using/configure.rst:360 msgid "See also :envvar:`PYTHONMALLOC` environment variable." msgstr "另請參閱 :envvar:`PYTHONMALLOC` 環境變數。" -#: ../../using/configure.rst:341 +#: ../../using/configure.rst:364 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:344 +#: ../../using/configure.rst:367 msgid "Don't define the ``WITH_DOC_STRINGS`` macro." msgstr "" -#: ../../using/configure.rst:346 +#: ../../using/configure.rst:369 msgid "See the ``PyDoc_STRVAR()`` macro." msgstr "" -#: ../../using/configure.rst:350 +#: ../../using/configure.rst:373 msgid "Enable C-level code profiling with ``gprof`` (disabled by default)." msgstr "" -#: ../../using/configure.rst:354 +#: ../../using/configure.rst:377 msgid "" "Add ``-fstrict-overflow`` to the C compiler flags (by default we add ``-fno-" "strict-overflow`` instead)." msgstr "" -#: ../../using/configure.rst:361 +#: ../../using/configure.rst:384 msgid "Python Debug Build" msgstr "" -#: ../../using/configure.rst:363 +#: ../../using/configure.rst:386 msgid "" "A debug build is Python built with the :option:`--with-pydebug` configure " "option." msgstr "" -#: ../../using/configure.rst:366 +#: ../../using/configure.rst:389 msgid "Effects of a debug build:" msgstr "" -#: ../../using/configure.rst:368 +#: ../../using/configure.rst:391 msgid "" "Display all warnings by default: the list of default warning filters is " "empty in the :mod:`warnings` module." msgstr "" -#: ../../using/configure.rst:370 +#: ../../using/configure.rst:393 msgid "Add ``d`` to :data:`sys.abiflags`." msgstr "" -#: ../../using/configure.rst:371 +#: ../../using/configure.rst:394 msgid "Add :func:`sys.gettotalrefcount` function." msgstr "新增 :func:`sys.gettotalrefcount` 函式。" -#: ../../using/configure.rst:372 +#: ../../using/configure.rst:395 msgid "Add :option:`-X showrefcount <-X>` command line option." msgstr "新增 :option:`-X showrefcount <-X>` 命令列選項。" -#: ../../using/configure.rst:373 +#: ../../using/configure.rst:396 msgid "" "Add :option:`-d` command line option and :envvar:`PYTHONDEBUG` environment " "variable to debug the parser." msgstr "" -#: ../../using/configure.rst:375 +#: ../../using/configure.rst:398 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:377 +#: ../../using/configure.rst:400 msgid "" "Install :ref:`debug hooks on memory allocators ` " "to detect buffer overflow and other memory errors." msgstr "" -#: ../../using/configure.rst:379 +#: ../../using/configure.rst:402 msgid "Define ``Py_DEBUG`` and ``Py_REF_DEBUG`` macros." msgstr "定義 ``Py_DEBUG`` 和 ``Py_REF_DEBUG`` 巨集。" -#: ../../using/configure.rst:380 +#: ../../using/configure.rst:403 msgid "" "Add runtime checks: code surrounded by ``#ifdef Py_DEBUG`` and ``#endif``. " "Enable ``assert(...)`` and ``_PyObject_ASSERT(...)`` assertions: don't set " @@ -561,45 +586,45 @@ msgid "" "option). Main runtime checks:" msgstr "" -#: ../../using/configure.rst:385 +#: ../../using/configure.rst:408 msgid "Add sanity checks on the function arguments." msgstr "" -#: ../../using/configure.rst:386 +#: ../../using/configure.rst:409 msgid "" "Unicode and int objects are created with their memory filled with a pattern " "to detect usage of uninitialized objects." msgstr "" -#: ../../using/configure.rst:388 +#: ../../using/configure.rst:411 msgid "" "Ensure that functions which can clear or replace the current exception are " "not called with an exception raised." msgstr "" -#: ../../using/configure.rst:390 +#: ../../using/configure.rst:413 msgid "Check that deallocator functions don't change the current exception." msgstr "" -#: ../../using/configure.rst:391 +#: ../../using/configure.rst:414 msgid "" "The garbage collector (:func:`gc.collect` function) runs some basic checks " "on objects consistency." msgstr "" -#: ../../using/configure.rst:393 +#: ../../using/configure.rst:416 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:396 +#: ../../using/configure.rst:419 msgid "" "See also the :ref:`Python Development Mode ` and the :option:`--" "with-trace-refs` configure option." msgstr "" -#: ../../using/configure.rst:399 +#: ../../using/configure.rst:422 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 :" @@ -607,320 +632,320 @@ msgid "" "incompatibility." msgstr "" -#: ../../using/configure.rst:407 +#: ../../using/configure.rst:430 msgid "Debug options" msgstr "" -#: ../../using/configure.rst:411 +#: ../../using/configure.rst:434 msgid "" ":ref:`Build Python in debug mode `: define the ``Py_DEBUG`` " "macro (disabled by default)." msgstr "" -#: ../../using/configure.rst:416 +#: ../../using/configure.rst:439 msgid "Enable tracing references for debugging purpose (disabled by default)." msgstr "" -#: ../../using/configure.rst:418 +#: ../../using/configure.rst:441 msgid "Effects:" msgstr "" -#: ../../using/configure.rst:420 +#: ../../using/configure.rst:443 msgid "Define the ``Py_TRACE_REFS`` macro." msgstr "定義 ``Py_TRACE_REFS`` 巨集。" -#: ../../using/configure.rst:421 +#: ../../using/configure.rst:444 msgid "Add :func:`sys.getobjects` function." msgstr "新增 :func:`sys.getobjects` 函式。" -#: ../../using/configure.rst:422 +#: ../../using/configure.rst:445 msgid "Add :envvar:`PYTHONDUMPREFS` environment variable." msgstr "新增 :envvar:`PYTHONDUMPREFS` 環境變數。" -#: ../../using/configure.rst:424 +#: ../../using/configure.rst:447 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:431 +#: ../../using/configure.rst:454 msgid "" "Build with C assertions enabled (default is no): ``assert(...);`` and " "``_PyObject_ASSERT(...);``." msgstr "" -#: ../../using/configure.rst:434 +#: ../../using/configure.rst:457 msgid "" "If set, the ``NDEBUG`` macro is not defined in the :envvar:`OPT` compiler " "variable." msgstr "" -#: ../../using/configure.rst:437 +#: ../../using/configure.rst:460 msgid "" "See also the :option:`--with-pydebug` option (:ref:`debug build `) which also enables assertions." msgstr "" -#: ../../using/configure.rst:444 +#: ../../using/configure.rst:467 msgid "Enable Valgrind support (default is no)." msgstr "啟用 Valgrind 支援(預設不啟用)。" -#: ../../using/configure.rst:448 +#: ../../using/configure.rst:471 msgid "Enable DTrace support (default is no)." msgstr "啟用 DTrace 支援(預設不啟用)。" -#: ../../using/configure.rst:450 +#: ../../using/configure.rst:473 msgid "" "See :ref:`Instrumenting CPython with DTrace and SystemTap `." msgstr "" -#: ../../using/configure.rst:457 +#: ../../using/configure.rst:480 msgid "" "Enable AddressSanitizer memory error detector, ``asan`` (default is no)." msgstr "" -#: ../../using/configure.rst:463 +#: ../../using/configure.rst:486 msgid "" "Enable MemorySanitizer allocation error detector, ``msan`` (default is no)." msgstr "" -#: ../../using/configure.rst:469 +#: ../../using/configure.rst:492 msgid "" "Enable UndefinedBehaviorSanitizer undefined behaviour detector, ``ubsan`` " "(default is no)." msgstr "" -#: ../../using/configure.rst:476 +#: ../../using/configure.rst:499 msgid "Linker options" msgstr "" -#: ../../using/configure.rst:480 +#: ../../using/configure.rst:503 msgid "Enable building a shared Python library: ``libpython`` (default is no)." msgstr "" -#: ../../using/configure.rst:484 +#: ../../using/configure.rst:507 msgid "" "Do not build ``libpythonMAJOR.MINOR.a`` and do not install ``python.o`` " "(built and enabled by default)." msgstr "" -#: ../../using/configure.rst:491 +#: ../../using/configure.rst:514 msgid "Libraries options" -msgstr "" +msgstr "函式庫選項" -#: ../../using/configure.rst:495 +#: ../../using/configure.rst:518 msgid "Link against additional libraries (default is no)." msgstr "" -#: ../../using/configure.rst:499 +#: ../../using/configure.rst:522 msgid "" "Build the :mod:`pyexpat` module using an installed ``expat`` library " "(default is no)." msgstr "" -#: ../../using/configure.rst:504 +#: ../../using/configure.rst:527 msgid "" "Build the ``_decimal`` extension module using an installed ``mpdec`` " "library, see the :mod:`decimal` module (default is no)." msgstr "" -#: ../../using/configure.rst:511 +#: ../../using/configure.rst:534 msgid "Use ``editline`` library for backend of the :mod:`readline` module." msgstr "" -#: ../../using/configure.rst:513 +#: ../../using/configure.rst:536 msgid "Define the ``WITH_EDITLINE`` macro." msgstr "定義 ``WITH_EDITLINE`` 巨集。" -#: ../../using/configure.rst:519 +#: ../../using/configure.rst:542 msgid "Don't build the :mod:`readline` module (built by default)." msgstr "" -#: ../../using/configure.rst:521 +#: ../../using/configure.rst:544 msgid "Don't define the ``HAVE_LIBREADLINE`` macro." msgstr "不要定義 ``HAVE_LIBREADLINE`` 巨集。" -#: ../../using/configure.rst:527 +#: ../../using/configure.rst:550 msgid "" "Override ``libm`` math library to *STRING* (default is system-dependent)." msgstr "" -#: ../../using/configure.rst:531 +#: ../../using/configure.rst:554 msgid "Override ``libc`` C library to *STRING* (default is system-dependent)." msgstr "" -#: ../../using/configure.rst:535 +#: ../../using/configure.rst:558 msgid "Root of the OpenSSL directory." msgstr "" -#: ../../using/configure.rst:541 +#: ../../using/configure.rst:564 msgid "Set runtime library directory (rpath) for OpenSSL libraries:" msgstr "" -#: ../../using/configure.rst:543 +#: ../../using/configure.rst:566 msgid "``no`` (default): don't set rpath;" msgstr "" -#: ../../using/configure.rst:544 +#: ../../using/configure.rst:567 msgid "" "``auto``: auto-detect rpath from :option:`--with-openssl` and ``pkg-config``;" msgstr "" -#: ../../using/configure.rst:546 +#: ../../using/configure.rst:569 msgid "*DIR*: set an explicit rpath." msgstr "" -#: ../../using/configure.rst:552 +#: ../../using/configure.rst:575 msgid "Security Options" msgstr "" -#: ../../using/configure.rst:556 +#: ../../using/configure.rst:579 msgid "Select hash algorithm for use in ``Python/pyhash.c``:" msgstr "" -#: ../../using/configure.rst:558 +#: ../../using/configure.rst:581 msgid "``siphash13`` (default);" msgstr "" -#: ../../using/configure.rst:559 +#: ../../using/configure.rst:582 msgid "``siphash24``;" msgstr "``siphash24``;" -#: ../../using/configure.rst:560 +#: ../../using/configure.rst:583 msgid "``fnv``." msgstr "``fnv``。" -#: ../../using/configure.rst:564 +#: ../../using/configure.rst:587 msgid "``siphash13`` is added and it is the new default." msgstr "" -#: ../../using/configure.rst:569 +#: ../../using/configure.rst:592 msgid "Built-in hash modules:" msgstr "內建雜湊模組:" -#: ../../using/configure.rst:571 +#: ../../using/configure.rst:594 msgid "``md5``;" msgstr "``md5``;" -#: ../../using/configure.rst:572 +#: ../../using/configure.rst:595 msgid "``sha1``;" msgstr "``sha1``;" -#: ../../using/configure.rst:573 +#: ../../using/configure.rst:596 msgid "``sha256``;" msgstr "``sha256``;" -#: ../../using/configure.rst:574 +#: ../../using/configure.rst:597 msgid "``sha512``;" msgstr "``sha512``;" -#: ../../using/configure.rst:575 +#: ../../using/configure.rst:598 msgid "``sha3`` (with shake);" msgstr "" -#: ../../using/configure.rst:576 +#: ../../using/configure.rst:599 msgid "``blake2``." msgstr "``blake2``。" -#: ../../using/configure.rst:582 +#: ../../using/configure.rst:605 msgid "Override the OpenSSL default cipher suites string:" msgstr "" -#: ../../using/configure.rst:584 +#: ../../using/configure.rst:607 msgid "``python`` (default): use Python's preferred selection;" msgstr "" -#: ../../using/configure.rst:585 +#: ../../using/configure.rst:608 msgid "``openssl``: leave OpenSSL's defaults untouched;" msgstr "" -#: ../../using/configure.rst:586 +#: ../../using/configure.rst:609 msgid "*STRING*: use a custom string" msgstr "" -#: ../../using/configure.rst:588 +#: ../../using/configure.rst:611 msgid "See the :mod:`ssl` module." msgstr "請見 :mod:`ssl` 模組。" -#: ../../using/configure.rst:594 +#: ../../using/configure.rst:617 msgid "" "The settings ``python`` and *STRING* also set TLS 1.2 as minimum protocol " "version." msgstr "" -#: ../../using/configure.rst:598 +#: ../../using/configure.rst:621 msgid "macOS Options" msgstr "macOS 選項" -#: ../../using/configure.rst:600 +#: ../../using/configure.rst:623 msgid "See ``Mac/README.rst``." msgstr "參閱 ``Mac/README.rst``。" -#: ../../using/configure.rst:605 +#: ../../using/configure.rst:628 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:611 +#: ../../using/configure.rst:634 msgid "" "Create a Python.framework rather than a traditional Unix install. Optional " "*INSTALLDIR* specifies the installation path (default is no)." msgstr "" -#: ../../using/configure.rst:616 +#: ../../using/configure.rst:639 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:619 +#: ../../using/configure.rst:642 msgid "Options:" msgstr "選項:" -#: ../../using/configure.rst:621 +#: ../../using/configure.rst:644 msgid "``universal2``;" msgstr "``universal2``;" -#: ../../using/configure.rst:622 +#: ../../using/configure.rst:645 msgid "``32-bit``;" msgstr "``32-bit``;" -#: ../../using/configure.rst:623 +#: ../../using/configure.rst:646 msgid "``64-bit``;" msgstr "``64-bit``;" -#: ../../using/configure.rst:624 +#: ../../using/configure.rst:647 msgid "``3-way``;" msgstr "``3-way``;" -#: ../../using/configure.rst:625 +#: ../../using/configure.rst:648 msgid "``intel``;" msgstr "``intel``;" -#: ../../using/configure.rst:626 +#: ../../using/configure.rst:649 msgid "``intel-32``;" msgstr "``intel-32``;" -#: ../../using/configure.rst:627 +#: ../../using/configure.rst:650 msgid "``intel-64``;" msgstr "``intel-64``;" -#: ../../using/configure.rst:628 +#: ../../using/configure.rst:651 msgid "``all``." msgstr "``all``。" -#: ../../using/configure.rst:632 +#: ../../using/configure.rst:655 msgid "" "Specify the name for the python framework on macOS only valid when :option:" "`--enable-framework` is set (default: ``Python``)." msgstr "" -#: ../../using/configure.rst:637 +#: ../../using/configure.rst:660 msgid "Cross Compiling Options" msgstr "" -#: ../../using/configure.rst:639 +#: ../../using/configure.rst:662 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 " @@ -928,95 +953,95 @@ msgid "" "match the version of the cross compiled host Python." msgstr "" -#: ../../using/configure.rst:646 +#: ../../using/configure.rst:669 msgid "" "configure for building on BUILD, usually guessed by :program:`config.guess`." msgstr "" -#: ../../using/configure.rst:650 +#: ../../using/configure.rst:673 msgid "cross-compile to build programs to run on HOST (target platform)" msgstr "" -#: ../../using/configure.rst:654 +#: ../../using/configure.rst:677 msgid "path to build ``python`` binary for cross compiling" msgstr "" -#: ../../using/configure.rst:660 +#: ../../using/configure.rst:683 msgid "An environment variable that points to a file with configure overrides." msgstr "" -#: ../../using/configure.rst:662 +#: ../../using/configure.rst:685 msgid "Example *config.site* file::" msgstr "" -#: ../../using/configure.rst:670 +#: ../../using/configure.rst:693 msgid "Cross compiling example::" msgstr "" -#: ../../using/configure.rst:679 +#: ../../using/configure.rst:702 msgid "Python Build System" msgstr "" -#: ../../using/configure.rst:682 +#: ../../using/configure.rst:705 msgid "Main files of the build system" msgstr "" -#: ../../using/configure.rst:684 +#: ../../using/configure.rst:707 msgid ":file:`configure.ac` => :file:`configure`;" msgstr ":file:`configure.ac` => :file:`configure`\\ ;" -#: ../../using/configure.rst:685 +#: ../../using/configure.rst:708 msgid "" ":file:`Makefile.pre.in` => :file:`Makefile` (created by :file:`configure`);" msgstr "" -#: ../../using/configure.rst:686 +#: ../../using/configure.rst:709 msgid ":file:`pyconfig.h` (created by :file:`configure`);" msgstr ":file:`pyconfig.h` (created by :file:`configure`)\\ ;" -#: ../../using/configure.rst:687 +#: ../../using/configure.rst:710 msgid "" ":file:`Modules/Setup`: C extensions built by the Makefile using :file:" "`Module/makesetup` shell script;" msgstr "" -#: ../../using/configure.rst:691 +#: ../../using/configure.rst:714 msgid "Main build steps" -msgstr "" +msgstr "主要建置步驟" -#: ../../using/configure.rst:693 +#: ../../using/configure.rst:716 msgid "C files (``.c``) are built as object files (``.o``)." msgstr "" -#: ../../using/configure.rst:694 +#: ../../using/configure.rst:717 msgid "A static ``libpython`` library (``.a``) is created from objects files." msgstr "" -#: ../../using/configure.rst:695 +#: ../../using/configure.rst:718 msgid "" "``python.o`` and the static ``libpython`` library are linked into the final " "``python`` program." msgstr "" -#: ../../using/configure.rst:697 +#: ../../using/configure.rst:720 msgid "C extensions are built by the Makefile (see :file:`Modules/Setup`)." msgstr "" -#: ../../using/configure.rst:700 +#: ../../using/configure.rst:723 msgid "Main Makefile targets" -msgstr "" +msgstr "主要 Makefile 目標" -#: ../../using/configure.rst:702 +#: ../../using/configure.rst:725 msgid "``make``: Build Python with the standard library." msgstr "" -#: ../../using/configure.rst:703 +#: ../../using/configure.rst:726 msgid "" "``make platform:``: build the ``python`` program, but don't build the " "standard library extension modules." msgstr "" -#: ../../using/configure.rst:705 +#: ../../using/configure.rst:728 msgid "" "``make profile-opt``: build Python using Profile Guided Optimization (PGO). " "You can use the configure :option:`--enable-optimizations` option to make " @@ -1024,53 +1049,53 @@ msgid "" "``make``)." msgstr "" -#: ../../using/configure.rst:709 +#: ../../using/configure.rst:732 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:712 +#: ../../using/configure.rst:735 msgid "``make install``: Build and install Python." msgstr "" -#: ../../using/configure.rst:713 +#: ../../using/configure.rst:736 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:716 +#: ../../using/configure.rst:739 msgid "``make clean``: Remove built files." msgstr "" -#: ../../using/configure.rst:717 +#: ../../using/configure.rst:740 msgid "" "``make distclean``: Same than ``make clean``, but remove also files created " "by the configure script." msgstr "" -#: ../../using/configure.rst:721 +#: ../../using/configure.rst:744 msgid "C extensions" -msgstr "" +msgstr "C 擴充模組" -#: ../../using/configure.rst:723 +#: ../../using/configure.rst:746 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:735 +#: ../../using/configure.rst:758 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:745 +#: ../../using/configure.rst:768 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-" @@ -1078,303 +1103,303 @@ msgid "" "dynamic libraries." msgstr "" -#: ../../using/configure.rst:749 +#: ../../using/configure.rst:772 msgid "" "The :c:macro:`PyAPI_FUNC()`, :c:macro:`PyAPI_DATA()` 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:753 +#: ../../using/configure.rst:776 msgid "Use ``Py_EXPORTED_SYMBOL`` if the ``Py_BUILD_CORE_MODULE`` is defined" -msgstr "" +msgstr "如果定義了 ``Py_BUILD_CORE_MODULE``,則使用 ``Py_EXPORTED_SYMBOL``" -#: ../../using/configure.rst:754 +#: ../../using/configure.rst:777 msgid "Use ``Py_IMPORTED_SYMBOL`` otherwise." -msgstr "" +msgstr "否則使用 ``Py_IMPORTED_SYMBOL``。" -#: ../../using/configure.rst:756 +#: ../../using/configure.rst:779 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:762 +#: ../../using/configure.rst:785 msgid "Compiler and linker flags" msgstr "" -#: ../../using/configure.rst:764 +#: ../../using/configure.rst:787 msgid "" "Options set by the ``./configure`` script and environment variables and used " "by ``Makefile``." msgstr "" -#: ../../using/configure.rst:768 +#: ../../using/configure.rst:791 msgid "Preprocessor flags" msgstr "" -#: ../../using/configure.rst:772 +#: ../../using/configure.rst:795 msgid "" "Value of :envvar:`CPPFLAGS` variable passed to the ``./configure`` script." msgstr "" -#: ../../using/configure.rst:778 +#: ../../using/configure.rst:801 msgid "" "(Objective) C/C++ preprocessor flags, e.g. ``-I`` if you have " "headers in a nonstandard directory ````." msgstr "" -#: ../../using/configure.rst:781 ../../using/configure.rst:971 +#: ../../using/configure.rst:804 ../../using/configure.rst:994 msgid "" "Both :envvar:`CPPFLAGS` and :envvar:`LDFLAGS` need to contain the shell's " "value to be able to build extension modules using the directories specified " "in the environment variables." msgstr "" -#: ../../using/configure.rst:791 +#: ../../using/configure.rst:814 msgid "" "Extra preprocessor flags added for building the interpreter object files." msgstr "" -#: ../../using/configure.rst:793 +#: ../../using/configure.rst:816 msgid "" "Default: ``$(BASECPPFLAGS) -I. -I$(srcdir)/Include $(CONFIGURE_CPPFLAGS) " "$(CPPFLAGS)``." msgstr "" -#: ../../using/configure.rst:798 +#: ../../using/configure.rst:821 msgid "Compiler flags" msgstr "編譯器旗標" -#: ../../using/configure.rst:802 +#: ../../using/configure.rst:825 msgid "C compiler command." msgstr "C 編譯器指令。" -#: ../../using/configure.rst:804 +#: ../../using/configure.rst:827 msgid "Example: ``gcc -pthread``." msgstr "" -#: ../../using/configure.rst:808 +#: ../../using/configure.rst:831 msgid "C++ compiler command." msgstr "C++ 編譯器指令。" -#: ../../using/configure.rst:810 +#: ../../using/configure.rst:833 msgid "Example: ``g++ -pthread``." -msgstr "" +msgstr "範例:``g++ -pthread``。" -#: ../../using/configure.rst:814 +#: ../../using/configure.rst:837 msgid "C compiler flags." msgstr "C 編譯器旗標。" -#: ../../using/configure.rst:818 +#: ../../using/configure.rst:841 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 :envvar:" "`CFLAGS` once Python is installed (:gh:`65320`)." msgstr "" -#: ../../using/configure.rst:822 +#: ../../using/configure.rst:845 msgid "In particular, :envvar:`CFLAGS` should not contain:" msgstr "" -#: ../../using/configure.rst:824 +#: ../../using/configure.rst:847 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:829 +#: ../../using/configure.rst:852 msgid "" "hardening flags such as ``-Werror`` because distributions cannot control " "whether packages installed by users conform to such heightened standards." msgstr "" -#: ../../using/configure.rst:837 +#: ../../using/configure.rst:860 msgid "" "Options passed to the :mod:`compileall` command line when building PYC files " "in ``make install``. Default: ``-j0``." msgstr "" -#: ../../using/configure.rst:844 +#: ../../using/configure.rst:867 msgid "Extra C compiler flags." msgstr "額外的 C 編譯器旗標。" -#: ../../using/configure.rst:848 +#: ../../using/configure.rst:871 msgid "" "Value of :envvar:`CFLAGS` variable passed to the ``./configure`` script." msgstr "" -#: ../../using/configure.rst:855 +#: ../../using/configure.rst:878 msgid "" "Value of :envvar:`CFLAGS_NODIST` variable passed to the ``./configure`` " "script." msgstr "" -#: ../../using/configure.rst:862 +#: ../../using/configure.rst:885 msgid "Base compiler flags." -msgstr "" +msgstr "基本編譯器旗標。" -#: ../../using/configure.rst:866 +#: ../../using/configure.rst:889 msgid "Optimization flags." msgstr "最佳化旗標。" -#: ../../using/configure.rst:870 +#: ../../using/configure.rst:893 msgid "Strict or non-strict aliasing flags used to compile ``Python/dtoa.c``." msgstr "" -#: ../../using/configure.rst:876 +#: ../../using/configure.rst:899 msgid "Compiler flags used to build a shared library." msgstr "" -#: ../../using/configure.rst:878 +#: ../../using/configure.rst:901 msgid "For example, ``-fPIC`` is used on Linux and on BSD." msgstr "例如說 ``-fPIC`` 被使用於 Linux 與 BSD 上。" -#: ../../using/configure.rst:882 +#: ../../using/configure.rst:905 msgid "Extra C flags added for building the interpreter object files." msgstr "" -#: ../../using/configure.rst:884 +#: ../../using/configure.rst:907 msgid "" "Default: ``$(CCSHARED)`` when :option:`--enable-shared` is used, or an empty " "string otherwise." msgstr "" -#: ../../using/configure.rst:889 +#: ../../using/configure.rst:912 msgid "" "Default: ``$(BASECFLAGS) $(OPT) $(CONFIGURE_CFLAGS) $(CFLAGS) " "$(EXTRA_CFLAGS)``." msgstr "" -#: ../../using/configure.rst:893 +#: ../../using/configure.rst:916 msgid "" "Default: ``$(CONFIGURE_CFLAGS_NODIST) $(CFLAGS_NODIST) -I$(srcdir)/Include/" "internal``." msgstr "" -#: ../../using/configure.rst:899 +#: ../../using/configure.rst:922 msgid "C flags used for building the interpreter object files." msgstr "" -#: ../../using/configure.rst:901 +#: ../../using/configure.rst:924 msgid "" "Default: ``$(PY_CFLAGS) $(PY_CFLAGS_NODIST) $(PY_CPPFLAGS) " "$(CFLAGSFORSHARED)``." msgstr "" -#: ../../using/configure.rst:907 +#: ../../using/configure.rst:930 msgid "Default: ``$(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE``." msgstr "" -#: ../../using/configure.rst:913 +#: ../../using/configure.rst:936 msgid "" "Compiler flags to build a standard library extension module as a built-in " "module, like the :mod:`posix` module." msgstr "" -#: ../../using/configure.rst:916 +#: ../../using/configure.rst:939 msgid "Default: ``$(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN``." msgstr "" -#: ../../using/configure.rst:922 +#: ../../using/configure.rst:945 msgid "Purify command. Purify is a memory debugger program." msgstr "" -#: ../../using/configure.rst:924 +#: ../../using/configure.rst:947 msgid "Default: empty string (not used)." msgstr "" -#: ../../using/configure.rst:928 +#: ../../using/configure.rst:951 msgid "Linker flags" msgstr "" -#: ../../using/configure.rst:932 +#: ../../using/configure.rst:955 msgid "" "Linker command used to build programs like ``python`` and ``_testembed``." msgstr "" -#: ../../using/configure.rst:934 +#: ../../using/configure.rst:957 msgid "Default: ``$(PURIFY) $(CC)``." msgstr "" -#: ../../using/configure.rst:938 +#: ../../using/configure.rst:961 msgid "" "Value of :envvar:`LDFLAGS` variable passed to the ``./configure`` script." msgstr "" -#: ../../using/configure.rst:940 +#: ../../using/configure.rst:963 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:948 +#: ../../using/configure.rst:971 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 :envvar:" "`LDFLAGS` once Python is installed (:gh:`65320`)." msgstr "" -#: ../../using/configure.rst:952 +#: ../../using/configure.rst:975 msgid "In particular, :envvar:`LDFLAGS` should not contain:" msgstr "" -#: ../../using/configure.rst:954 +#: ../../using/configure.rst:977 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:961 +#: ../../using/configure.rst:984 msgid "" "Value of :envvar:`LDFLAGS_NODIST` variable passed to the ``./configure`` " "script." msgstr "" -#: ../../using/configure.rst:968 +#: ../../using/configure.rst:991 msgid "" "Linker flags, e.g. ``-L`` if you have libraries in a nonstandard " "directory ````." msgstr "" -#: ../../using/configure.rst:977 +#: ../../using/configure.rst:1000 msgid "" "Linker flags to pass libraries to the linker when linking the Python " "executable." msgstr "" -#: ../../using/configure.rst:980 +#: ../../using/configure.rst:1003 msgid "Example: ``-lrt``." -msgstr "" +msgstr "範例:``-lrt``。" -#: ../../using/configure.rst:984 +#: ../../using/configure.rst:1007 msgid "Command to build a shared library." msgstr "" -#: ../../using/configure.rst:986 +#: ../../using/configure.rst:1009 msgid "Default: ``@LDSHARED@ $(PY_LDFLAGS)``." msgstr "預設值:``@LDSHARED@ $(PY_LDFLAGS)``。" -#: ../../using/configure.rst:990 +#: ../../using/configure.rst:1013 msgid "Command to build ``libpython`` shared library." msgstr "" -#: ../../using/configure.rst:992 +#: ../../using/configure.rst:1015 msgid "Default: ``@BLDSHARED@ $(PY_CORE_LDFLAGS)``." msgstr "預設值:``@BLDSHARED@ $(PY_CORE_LDFLAGS)``。" -#: ../../using/configure.rst:996 +#: ../../using/configure.rst:1019 msgid "Default: ``$(CONFIGURE_LDFLAGS) $(LDFLAGS)``." msgstr "預設值:``$(CONFIGURE_LDFLAGS) $(LDFLAGS)``。" -#: ../../using/configure.rst:1000 +#: ../../using/configure.rst:1023 msgid "Default: ``$(CONFIGURE_LDFLAGS_NODIST) $(LDFLAGS_NODIST)``." msgstr "預設值:``$(CONFIGURE_LDFLAGS_NODIST) $(LDFLAGS_NODIST)``。" -#: ../../using/configure.rst:1006 +#: ../../using/configure.rst:1029 msgid "Linker flags used for building the interpreter object files." msgstr "" diff --git a/whatsnew/3.12.po b/whatsnew/3.12.po index 20e10941bc..0d4fc1eb05 100644 --- a/whatsnew/3.12.po +++ b/whatsnew/3.12.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-23 00:03+0000\n" +"POT-Creation-Date: 2023-09-13 00:03+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -62,8 +62,8 @@ msgid "New grammar features:" msgstr "新增語法特性:" #: ../../whatsnew/3.12.rst:71 -msgid ":pep:`701`: Syntactic formalization of f-strings" -msgstr "" +msgid ":ref:`whatsnew312-pep701`" +msgstr ":ref:`whatsnew312-pep701`" #: ../../whatsnew/3.12.rst:73 msgid "Interpreter improvements:" @@ -71,55 +71,59 @@ msgstr "" #: ../../whatsnew/3.12.rst:75 msgid ":ref:`whatsnew312-pep684`" -msgstr "" +msgstr ":ref:`whatsnew312-pep684`" #: ../../whatsnew/3.12.rst:77 -msgid "New typing features:" -msgstr "新增型別特性:" +msgid ":ref:`whatsnew312-pep669`" +msgstr ":ref:`whatsnew312-pep669`" #: ../../whatsnew/3.12.rst:79 -msgid ":pep:`688`: Making the buffer protocol accessible in Python" -msgstr "" +msgid "New typing features:" +msgstr "新增型別特性:" #: ../../whatsnew/3.12.rst:81 +msgid ":ref:`whatsnew312-pep688`" +msgstr ":ref:`whatsnew312-pep688`" + +#: ../../whatsnew/3.12.rst:83 msgid ":ref:`whatsnew312-pep692`" msgstr ":ref:`whatsnew312-pep692`" -#: ../../whatsnew/3.12.rst:83 +#: ../../whatsnew/3.12.rst:85 msgid ":ref:`whatsnew312-pep695`" msgstr ":ref:`whatsnew312-pep695`" -#: ../../whatsnew/3.12.rst:85 -msgid ":pep:`698`: Override Decorator for Static Typing" -msgstr "" - #: ../../whatsnew/3.12.rst:87 +msgid ":ref:`whatsnew312-pep698`" +msgstr ":ref:`whatsnew312-pep698`" + +#: ../../whatsnew/3.12.rst:89 msgid "Important deprecations, removals or restrictions:" msgstr "" -#: ../../whatsnew/3.12.rst:89 +#: ../../whatsnew/3.12.rst:91 msgid ":pep:`623`: Remove wstr from Unicode" msgstr "" -#: ../../whatsnew/3.12.rst:91 +#: ../../whatsnew/3.12.rst:93 msgid "" ":pep:`632`: Remove the ``distutils`` package. See `the migration guide " "`_ for advice on its " "replacement." msgstr "" -#: ../../whatsnew/3.12.rst:96 +#: ../../whatsnew/3.12.rst:98 msgid "Improved Error Messages" msgstr "" -#: ../../whatsnew/3.12.rst:98 +#: ../../whatsnew/3.12.rst:100 msgid "" "Modules from the standard library are now potentially suggested as part of " "the error messages displayed by the interpreter when a :exc:`NameError` is " "raised to the top level. Contributed by Pablo Galindo in :gh:`98254`." msgstr "" -#: ../../whatsnew/3.12.rst:107 +#: ../../whatsnew/3.12.rst:109 msgid "" "Improve the error suggestion for :exc:`NameError` exceptions for instances. " "Now if a :exc:`NameError` is raised in a method and the instance has an " @@ -128,14 +132,14 @@ msgid "" "scope. Contributed by Pablo Galindo in :gh:`99139`." msgstr "" -#: ../../whatsnew/3.12.rst:128 +#: ../../whatsnew/3.12.rst:130 msgid "" "Improve the :exc:`SyntaxError` error message when the user types ``import x " "from y`` instead of ``from y import x``. Contributed by Pablo Galindo in :gh:" "`98931`." msgstr "" -#: ../../whatsnew/3.12.rst:138 +#: ../../whatsnew/3.12.rst:140 msgid "" ":exc:`ImportError` exceptions raised from failed ``from import " "`` statements now include suggestions for the value of ```` " @@ -143,15 +147,15 @@ msgid "" "in :gh:`91058`." msgstr "" -#: ../../whatsnew/3.12.rst:149 ../../whatsnew/3.12.rst:1652 +#: ../../whatsnew/3.12.rst:151 ../../whatsnew/3.12.rst:1739 msgid "New Features" msgstr "新增特性" -#: ../../whatsnew/3.12.rst:154 +#: ../../whatsnew/3.12.rst:156 msgid "PEP 701: Syntactic formalization of f-strings" msgstr "" -#: ../../whatsnew/3.12.rst:156 +#: ../../whatsnew/3.12.rst:158 msgid "" ":pep:`701` lifts some restrictions on the usage of f-strings. Expression " "components inside f-strings can now be any valid Python expression including " @@ -160,7 +164,7 @@ msgid "" "in detail:" msgstr "" -#: ../../whatsnew/3.12.rst:161 +#: ../../whatsnew/3.12.rst:163 msgid "" "Quote reuse: in Python 3.11, reusing the same quotes as the containing f-" "string raises a :exc:`SyntaxError`, forcing the user to either use other " @@ -168,7 +172,7 @@ msgid "" "uses single quotes). In Python 3.12, you can now do things like this:" msgstr "" -#: ../../whatsnew/3.12.rst:170 +#: ../../whatsnew/3.12.rst:172 msgid "" "Note that before this change there was no explicit limit in how f-strings " "can be nested, but the fact that string quotes cannot be reused inside the " @@ -176,13 +180,13 @@ msgid "" "arbitrarily. In fact, this is the most nested f-string that could be written:" msgstr "" -#: ../../whatsnew/3.12.rst:178 +#: ../../whatsnew/3.12.rst:180 msgid "" "As now f-strings can contain any valid Python expression inside expression " "components, it is now possible to nest f-strings arbitrarily:" msgstr "" -#: ../../whatsnew/3.12.rst:184 +#: ../../whatsnew/3.12.rst:186 msgid "" "Multi-line expressions and comments: In Python 3.11, f-strings expressions " "must be defined in a single line even if outside f-strings expressions could " @@ -191,7 +195,7 @@ msgid "" "spanning multiple lines and include comments on them:" msgstr "" -#: ../../whatsnew/3.12.rst:197 +#: ../../whatsnew/3.12.rst:199 msgid "" "Backslashes and unicode characters: before Python 3.12 f-string expressions " "couldn't contain any ``\\`` character. This also affected unicode escaped " @@ -200,11 +204,11 @@ msgid "" "can define expressions like this:" msgstr "" -#: ../../whatsnew/3.12.rst:210 +#: ../../whatsnew/3.12.rst:212 msgid "See :pep:`701` for more details." msgstr "詳情請見 :pep:`701`。" -#: ../../whatsnew/3.12.rst:212 +#: ../../whatsnew/3.12.rst:214 msgid "" "As a positive side-effect of how this feature has been implemented (by " "parsing f-strings with the PEG parser (see :pep:`617`), now error messages " @@ -213,7 +217,7 @@ msgid "" "`SyntaxError`:" msgstr "" -#: ../../whatsnew/3.12.rst:225 +#: ../../whatsnew/3.12.rst:227 msgid "" "but the error message doesn't include the exact location of the error within " "the line and also has the expression artificially surrounded by parentheses. " @@ -221,25 +225,25 @@ msgid "" "can be more precise and show the entire line:" msgstr "" -#: ../../whatsnew/3.12.rst:237 +#: ../../whatsnew/3.12.rst:239 msgid "" "(Contributed by Pablo Galindo, Batuhan Taskaya, Lysandros Nikolaou, Cristián " "Maureira-Fredes and Marta Gómez in :gh:`102856`. PEP written by Pablo " "Galindo, Batuhan Taskaya, Lysandros Nikolaou and Marta Gómez)." msgstr "" -#: ../../whatsnew/3.12.rst:244 +#: ../../whatsnew/3.12.rst:246 msgid "PEP 709: Comprehension inlining" msgstr "" -#: ../../whatsnew/3.12.rst:246 +#: ../../whatsnew/3.12.rst:248 msgid "" "Dictionary, list, and set comprehensions are now inlined, rather than " "creating a new single-use function object for each execution of the " "comprehension. This speeds up execution of a comprehension by up to 2x." msgstr "" -#: ../../whatsnew/3.12.rst:250 +#: ../../whatsnew/3.12.rst:252 msgid "" "Comprehension iteration variables remain isolated; they don't overwrite a " "variable of the same name in the outer scope, nor are they visible after the " @@ -247,24 +251,31 @@ msgid "" "manipulation, not via separate function scope." msgstr "" -#: ../../whatsnew/3.12.rst:255 +#: ../../whatsnew/3.12.rst:257 msgid "Inlining does result in a few visible behavior changes:" msgstr "" -#: ../../whatsnew/3.12.rst:257 +#: ../../whatsnew/3.12.rst:259 msgid "" "There is no longer a separate frame for the comprehension in tracebacks, and " "tracing/profiling no longer shows the comprehension as a function call." msgstr "" -#: ../../whatsnew/3.12.rst:259 +#: ../../whatsnew/3.12.rst:261 +msgid "" +"The :mod:`symtable` module will no longer produce child symbol tables for " +"each comprehension; instead, the comprehension's locals will be included in " +"the parent function's symbol table." +msgstr "" + +#: ../../whatsnew/3.12.rst:264 msgid "" "Calling :func:`locals` inside a comprehension now includes variables from " "outside the comprehension, and no longer includes the synthetic ``.0`` " "variable for the comprehension \"argument\"." msgstr "" -#: ../../whatsnew/3.12.rst:262 +#: ../../whatsnew/3.12.rst:267 msgid "" "A comprehension iterating directly over ``locals()`` (e.g. ``[k for k in " "locals()]``) may see \"RuntimeError: dictionary changed size during " @@ -274,22 +285,22 @@ msgid "" "[k for k in keys]``." msgstr "" -#: ../../whatsnew/3.12.rst:269 +#: ../../whatsnew/3.12.rst:274 msgid "Contributed by Carl Meyer and Vladimir Matveev in :pep:`709`." msgstr "" -#: ../../whatsnew/3.12.rst:272 +#: ../../whatsnew/3.12.rst:279 msgid "PEP 688: Making the buffer protocol accessible in Python" msgstr "" -#: ../../whatsnew/3.12.rst:274 +#: ../../whatsnew/3.12.rst:281 msgid "" ":pep:`688` introduces a way to use the :ref:`buffer protocol " "` from Python code. Classes that implement the :meth:`~object." "__buffer__` method are now usable as buffer types." msgstr "" -#: ../../whatsnew/3.12.rst:278 +#: ../../whatsnew/3.12.rst:285 msgid "" "The new :class:`collections.abc.Buffer` ABC provides a standard way to " "represent buffer objects, for example in type annotations. The new :class:" @@ -297,76 +308,92 @@ msgid "" "customize buffer creation. (Contributed by Jelle Zijlstra in :gh:`102500`.)" msgstr "" -#: ../../whatsnew/3.12.rst:287 +#: ../../whatsnew/3.12.rst:294 msgid "PEP 684: A Per-Interpreter GIL" msgstr "" -#: ../../whatsnew/3.12.rst:289 +#: ../../whatsnew/3.12.rst:296 msgid "" "Sub-interpreters may now be created with a unique GIL per interpreter. This " "allows Python programs to take full advantage of multiple CPU cores." msgstr "" -#: ../../whatsnew/3.12.rst:293 +#: ../../whatsnew/3.12.rst:300 msgid "" "Use the new :c:func:`Py_NewInterpreterFromConfig` function to create an " "interpreter with its own GIL::" msgstr "" -#: ../../whatsnew/3.12.rst:307 +#: ../../whatsnew/3.12.rst:314 msgid "" "For further examples how to use the C-API for sub-interpreters with a per-" "interpreter GIL, see :source:`Modules/_xxsubinterpretersmodule.c`." msgstr "" -#: ../../whatsnew/3.12.rst:310 +#: ../../whatsnew/3.12.rst:317 msgid "A Python API is anticipated for 3.13. (See :pep:`554`.)" msgstr "" -#: ../../whatsnew/3.12.rst:312 +#: ../../whatsnew/3.12.rst:319 msgid "(Contributed by Eric Snow in :gh:`104210`, etc.)" msgstr "(由 Eric Snow 於 :gh:`104210` 等貢獻。)" -#: ../../whatsnew/3.12.rst:315 +#: ../../whatsnew/3.12.rst:324 +msgid "PEP 669: Low impact monitoring for CPython" +msgstr "" + +#: ../../whatsnew/3.12.rst:326 +msgid "" +"CPython 3.12 now supports the ability to monitor calls, returns, lines, " +"exceptions and other events using instrumentation. This means that you only " +"pay for what you use, providing support for near-zero overhead debuggers and " +"coverage tools." +msgstr "" + +#: ../../whatsnew/3.12.rst:331 +msgid "See :mod:`sys.monitoring` for details." +msgstr "" + +#: ../../whatsnew/3.12.rst:335 msgid "New Features Related to Type Hints" msgstr "" -#: ../../whatsnew/3.12.rst:317 +#: ../../whatsnew/3.12.rst:337 msgid "" "This section covers major changes affecting :pep:`484` type hints and the :" "mod:`typing` module." msgstr "" -#: ../../whatsnew/3.12.rst:323 +#: ../../whatsnew/3.12.rst:343 msgid "PEP 692: Using ``TypedDict`` for more precise ``**kwargs`` typing" msgstr "" -#: ../../whatsnew/3.12.rst:325 +#: ../../whatsnew/3.12.rst:345 msgid "" "Typing ``**kwargs`` in a function signature as introduced by :pep:`484` " "allowed for valid annotations only in cases where all of the ``**kwargs`` " "were of the same type." msgstr "" -#: ../../whatsnew/3.12.rst:329 +#: ../../whatsnew/3.12.rst:349 msgid "" "This PEP specifies a more precise way of typing ``**kwargs`` by relying on " "typed dictionaries::" msgstr "" -#: ../../whatsnew/3.12.rst:340 +#: ../../whatsnew/3.12.rst:360 msgid "See :pep:`692` for more details." msgstr "" -#: ../../whatsnew/3.12.rst:342 +#: ../../whatsnew/3.12.rst:362 msgid "(Contributed by Franek Magiera in :gh:`103629`.)" msgstr "(由 Franek Magiera 於 :gh:`103629` 中貢獻。)" -#: ../../whatsnew/3.12.rst:345 +#: ../../whatsnew/3.12.rst:367 msgid "PEP 698: Override Decorator for Static Typing" msgstr "" -#: ../../whatsnew/3.12.rst:347 +#: ../../whatsnew/3.12.rst:369 msgid "" "A new decorator :func:`typing.override` has been added to the :mod:`typing` " "module. It indicates to type checkers that the method is intended to " @@ -375,51 +402,51 @@ msgid "" "class does not in fact do so." msgstr "" -#: ../../whatsnew/3.12.rst:353 +#: ../../whatsnew/3.12.rst:375 msgid "Example::" msgstr "" -#: ../../whatsnew/3.12.rst:371 +#: ../../whatsnew/3.12.rst:393 msgid "(Contributed by Steven Troxler in :gh:`101561`.)" msgstr "(由 Steven Troxler 於 :gh:`101561` 中貢獻。)" -#: ../../whatsnew/3.12.rst:376 +#: ../../whatsnew/3.12.rst:398 msgid "PEP 695: Type Parameter Syntax" msgstr "" -#: ../../whatsnew/3.12.rst:378 +#: ../../whatsnew/3.12.rst:400 msgid "" "Generic classes and functions under :pep:`484` were declared using a verbose " "syntax that left the scope of type parameters unclear and required explicit " "declarations of variance." msgstr "" -#: ../../whatsnew/3.12.rst:382 +#: ../../whatsnew/3.12.rst:404 msgid "" ":pep:`695` introduces a new, more compact and explicit way to create :ref:" "`generic classes ` and :ref:`functions `::" msgstr "" -#: ../../whatsnew/3.12.rst:395 +#: ../../whatsnew/3.12.rst:417 msgid "" "In addition, the PEP introduces a new way to declare :ref:`type aliases " "` using the :keyword:`type` statement, which creates an " "instance of :class:`~typing.TypeAliasType`::" msgstr "" -#: ../../whatsnew/3.12.rst:401 +#: ../../whatsnew/3.12.rst:423 msgid "Type aliases can also be :ref:`generic `::" msgstr "" -#: ../../whatsnew/3.12.rst:405 +#: ../../whatsnew/3.12.rst:427 msgid "" "The new syntax allows declaring :class:`~typing.TypeVarTuple` and :class:" "`~typing.ParamSpec` parameters, as well as :class:`~typing.TypeVar` " "parameters with bounds or constraints::" msgstr "" -#: ../../whatsnew/3.12.rst:414 +#: ../../whatsnew/3.12.rst:436 msgid "" "The value of type aliases and the bound and constraints of type variables " "created through this syntax are evaluated only on demand (see :ref:`lazy-" @@ -427,7 +454,7 @@ msgid "" "defined later in the file." msgstr "" -#: ../../whatsnew/3.12.rst:419 +#: ../../whatsnew/3.12.rst:441 msgid "" "Type parameters declared through a type parameter list are visible within " "the scope of the declaration and any nested scopes, but not in the outer " @@ -437,7 +464,7 @@ msgid "" "detailed description of the runtime semantics of type parameters." msgstr "" -#: ../../whatsnew/3.12.rst:426 +#: ../../whatsnew/3.12.rst:448 msgid "" "In order to support these scoping semantics, a new kind of scope is " "introduced, the :ref:`annotation scope `. Annotation " @@ -446,21 +473,21 @@ msgid "" "` will also be evaluated in annotation scopes." msgstr "" -#: ../../whatsnew/3.12.rst:432 +#: ../../whatsnew/3.12.rst:454 msgid "See :pep:`695` for more details." msgstr "詳情請見 :pep:`695`。" -#: ../../whatsnew/3.12.rst:434 +#: ../../whatsnew/3.12.rst:456 msgid "" "(PEP written by Eric Traut. Implementation by Jelle Zijlstra, Eric Traut, " "and others in :gh:`103764`.)" msgstr "" -#: ../../whatsnew/3.12.rst:438 +#: ../../whatsnew/3.12.rst:460 msgid "Other Language Changes" msgstr "其他語言更動" -#: ../../whatsnew/3.12.rst:440 +#: ../../whatsnew/3.12.rst:462 msgid "" "Add :ref:`perf_profiling` through the new environment variable :envvar:" "`PYTHONPERFSUPPORT`, the new command-line option :option:`-X perf <-X>`, as " @@ -471,7 +498,7 @@ msgid "" "in :gh:`96123`.)" msgstr "" -#: ../../whatsnew/3.12.rst:450 +#: ../../whatsnew/3.12.rst:472 msgid "" "The extraction methods in :mod:`tarfile`, and :func:`shutil.unpack_archive`, " "have a new a *filter* argument that allows limiting tar features than may be " @@ -481,32 +508,32 @@ msgid "" "`706`.)" msgstr "" -#: ../../whatsnew/3.12.rst:458 +#: ../../whatsnew/3.12.rst:480 msgid "" ":class:`types.MappingProxyType` instances are now hashable if the underlying " "mapping is hashable. (Contributed by Serhiy Storchaka in :gh:`87995`.)" msgstr "" -#: ../../whatsnew/3.12.rst:462 +#: ../../whatsnew/3.12.rst:484 msgid "" ":class:`memoryview` now supports the half-float type (the \"e\" format " "code). (Contributed by Dong-hee Na and Antoine Pitrou in :gh:`90751`.)" msgstr "" -#: ../../whatsnew/3.12.rst:465 +#: ../../whatsnew/3.12.rst:487 msgid "" "The parser now raises :exc:`SyntaxError` when parsing source code containing " "null bytes. (Contributed by Pablo Galindo in :gh:`96670`.)" msgstr "" -#: ../../whatsnew/3.12.rst:468 +#: ../../whatsnew/3.12.rst:490 msgid "" ":func:`ast.parse` now raises :exc:`SyntaxError` instead of :exc:`ValueError` " "when parsing source code containing null bytes. (Contributed by Pablo " "Galindo in :gh:`96670`.)" msgstr "" -#: ../../whatsnew/3.12.rst:472 +#: ../../whatsnew/3.12.rst:494 msgid "" "The Garbage Collector now runs only on the eval breaker mechanism of the " "Python bytecode evaluation loop instead of object allocations. The GC can " @@ -516,7 +543,7 @@ msgid "" "`97922`.)" msgstr "" -#: ../../whatsnew/3.12.rst:479 +#: ../../whatsnew/3.12.rst:501 msgid "" "A backslash-character pair that is not a valid escape sequence now generates " "a :exc:`SyntaxWarning`, instead of :exc:`DeprecationWarning`. For example, " @@ -527,7 +554,7 @@ msgid "" "`SyntaxWarning`. (Contributed by Victor Stinner in :gh:`98401`.)" msgstr "" -#: ../../whatsnew/3.12.rst:488 +#: ../../whatsnew/3.12.rst:510 msgid "" "Octal escapes with value larger than ``0o377`` (ex: ``\"\\477\"``), " "deprecated in Python 3.11, now produce a :exc:`SyntaxWarning`, instead of :" @@ -535,14 +562,14 @@ msgid "" "a :exc:`SyntaxError`. (Contributed by Victor Stinner in :gh:`98401`.)" msgstr "" -#: ../../whatsnew/3.12.rst:494 +#: ../../whatsnew/3.12.rst:516 msgid "" "All builtin and extension callables expecting boolean parameters now accept " "arguments of any type instead of just :class:`bool` and :class:`int`. " "(Contributed by Serhiy Storchaka in :gh:`60203`.)" msgstr "" -#: ../../whatsnew/3.12.rst:498 +#: ../../whatsnew/3.12.rst:520 msgid "" "Variables used in the target part of comprehensions that are not stored to " "can now be used in assignment expressions (``:=``). For example, in ``[(b := " @@ -552,28 +579,28 @@ msgid "" "(Contributed by Nikita Sobolev in :gh:`100581`.)" msgstr "" -#: ../../whatsnew/3.12.rst:505 +#: ../../whatsnew/3.12.rst:527 msgid "" ":class:`slice` objects are now hashable, allowing them to be used as dict " "keys and set items. (Contributed by Will Bradshaw, Furkan Onder, and Raymond " "Hettinger in :gh:`101264`.)" msgstr "" -#: ../../whatsnew/3.12.rst:508 +#: ../../whatsnew/3.12.rst:530 msgid "" ":func:`sum` now uses Neumaier summation to improve accuracy when summing " "floats or mixed ints and floats. (Contributed by Raymond Hettinger in :gh:" "`100425`.)" msgstr "" -#: ../../whatsnew/3.12.rst:512 +#: ../../whatsnew/3.12.rst:534 msgid "" "Exceptions raised in a typeobject's ``__set_name__`` method are no longer " "wrapped by a :exc:`RuntimeError`. Context information is added to the " "exception as a :pep:`678` note. (Contributed by Irit Katriel in :gh:`77757`.)" msgstr "" -#: ../../whatsnew/3.12.rst:516 +#: ../../whatsnew/3.12.rst:538 msgid "" "When a ``try-except*`` construct handles the entire :exc:`ExceptionGroup` " "and raises one other exception, that exception is no longer wrapped in an :" @@ -581,33 +608,33 @@ msgid "" "Katriel in :gh:`103590`.)" msgstr "" -#: ../../whatsnew/3.12.rst:523 +#: ../../whatsnew/3.12.rst:545 msgid "New Modules" msgstr "" -#: ../../whatsnew/3.12.rst:525 +#: ../../whatsnew/3.12.rst:547 msgid "None." msgstr "" -#: ../../whatsnew/3.12.rst:529 +#: ../../whatsnew/3.12.rst:551 msgid "Improved Modules" msgstr "" -#: ../../whatsnew/3.12.rst:532 +#: ../../whatsnew/3.12.rst:554 msgid "array" msgstr "array" -#: ../../whatsnew/3.12.rst:534 +#: ../../whatsnew/3.12.rst:556 msgid "" "The :class:`array.array` class now supports subscripting, making it a :term:" "`generic type`. (Contributed by Jelle Zijlstra in :gh:`98658`.)" msgstr "" -#: ../../whatsnew/3.12.rst:538 +#: ../../whatsnew/3.12.rst:560 msgid "asyncio" msgstr "asyncio" -#: ../../whatsnew/3.12.rst:540 +#: ../../whatsnew/3.12.rst:562 msgid "" "The performance of writing to sockets in :mod:`asyncio` has been " "significantly improved. ``asyncio`` now avoids unnecessary copying when " @@ -615,7 +642,7 @@ msgid "" "supports it. (Contributed by Kumar Aditya in :gh:`91166`.)" msgstr "" -#: ../../whatsnew/3.12.rst:545 +#: ../../whatsnew/3.12.rst:567 msgid "" "Added :func:`asyncio.eager_task_factory` and :func:`asyncio." "create_eager_task_factory` functions to allow opting an event loop in to " @@ -623,7 +650,7 @@ msgid "" "Jacob Bower & Itamar O in :gh:`102853`, :gh:`104140`, and :gh:`104138`)" msgstr "" -#: ../../whatsnew/3.12.rst:550 +#: ../../whatsnew/3.12.rst:572 msgid "" "On Linux, :mod:`asyncio` uses :class:`~asyncio.PidfdChildWatcher` by default " "if :func:`os.pidfd_open` is available and functional instead of :class:" @@ -631,7 +658,7 @@ msgid "" "`98024`.)" msgstr "" -#: ../../whatsnew/3.12.rst:555 +#: ../../whatsnew/3.12.rst:577 msgid "" "The child watcher classes :class:`~asyncio.MultiLoopChildWatcher`, :class:" "`~asyncio.FastChildWatcher`, :class:`~asyncio.AbstractChildWatcher` and :" @@ -643,7 +670,7 @@ msgid "" "`94597`.)" msgstr "" -#: ../../whatsnew/3.12.rst:564 +#: ../../whatsnew/3.12.rst:586 msgid "" ":func:`asyncio.set_child_watcher`, :func:`asyncio.get_child_watcher`, :meth:" "`asyncio.AbstractEventLoopPolicy.set_child_watcher` and :meth:`asyncio." @@ -651,57 +678,57 @@ msgid "" "removed in Python 3.14. (Contributed by Kumar Aditya in :gh:`94597`.)" msgstr "" -#: ../../whatsnew/3.12.rst:570 +#: ../../whatsnew/3.12.rst:592 msgid "" "Add *loop_factory* parameter to :func:`asyncio.run` to allow specifying a " "custom event loop factory. (Contributed by Kumar Aditya in :gh:`99388`.)" msgstr "" -#: ../../whatsnew/3.12.rst:574 +#: ../../whatsnew/3.12.rst:596 msgid "" "Add C implementation of :func:`asyncio.current_task` for 4x-6x speedup. " "(Contributed by Itamar Ostricher and Pranav Thulasiram Bhat in :gh:`100344`.)" msgstr "" -#: ../../whatsnew/3.12.rst:577 +#: ../../whatsnew/3.12.rst:599 msgid "" ":func:`asyncio.iscoroutine` now returns ``False`` for generators as :mod:" "`asyncio` does not support legacy generator-based coroutines. (Contributed " "by Kumar Aditya in :gh:`102748`.)" msgstr "" -#: ../../whatsnew/3.12.rst:581 +#: ../../whatsnew/3.12.rst:603 msgid "" ":func:`asyncio.wait` and :func:`asyncio.as_completed` now accepts generators " "yielding tasks. (Contributed by Kumar Aditya in :gh:`78530`.)" msgstr "" -#: ../../whatsnew/3.12.rst:586 +#: ../../whatsnew/3.12.rst:608 msgid "calendar" msgstr "calendar" -#: ../../whatsnew/3.12.rst:588 +#: ../../whatsnew/3.12.rst:610 msgid "" "Add enums :data:`~calendar.Month` and :data:`~calendar.Day`. (Contributed by " "Prince Roshan in :gh:`103636`.)" msgstr "" -#: ../../whatsnew/3.12.rst:592 +#: ../../whatsnew/3.12.rst:614 msgid "csv" msgstr "csv" -#: ../../whatsnew/3.12.rst:594 +#: ../../whatsnew/3.12.rst:616 msgid "" "Add :const:`~csv.QUOTE_NOTNULL` and :const:`~csv.QUOTE_STRINGS` flags to " "provide finer grained control of ``None`` and empty strings by :class:`~csv." "writer` objects." msgstr "" -#: ../../whatsnew/3.12.rst:599 +#: ../../whatsnew/3.12.rst:621 msgid "dis" msgstr "dis" -#: ../../whatsnew/3.12.rst:601 +#: ../../whatsnew/3.12.rst:623 msgid "" "Pseudo instruction opcodes (which are used by the compiler but do not appear " "in executable bytecode) are now exposed in the :mod:`dis` module. :opcode:" @@ -710,35 +737,45 @@ msgid "" "(Contributed by Irit Katriel in :gh:`94216`.)" msgstr "" -#: ../../whatsnew/3.12.rst:610 +#: ../../whatsnew/3.12.rst:632 msgid "fractions" msgstr "fractions" -#: ../../whatsnew/3.12.rst:612 +#: ../../whatsnew/3.12.rst:634 msgid "" "Objects of type :class:`fractions.Fraction` now support float-style " "formatting. (Contributed by Mark Dickinson in :gh:`100161`.)" msgstr "" -#: ../../whatsnew/3.12.rst:616 +#: ../../whatsnew/3.12.rst:638 +msgid "importlib.resources" +msgstr "" + +#: ../../whatsnew/3.12.rst:640 +msgid "" +":func:`importlib.resources.as_file` now supports resource directories. " +"(Contributed by Jason R. Coombs in :gh:`97930`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:644 msgid "inspect" msgstr "inspect" -#: ../../whatsnew/3.12.rst:618 +#: ../../whatsnew/3.12.rst:646 msgid "" "Add :func:`inspect.markcoroutinefunction` to mark sync functions that return " "a :term:`coroutine` for use with :func:`inspect.iscoroutinefunction`. " "(Contributed Carlton Gibson in :gh:`99247`.)" msgstr "" -#: ../../whatsnew/3.12.rst:622 +#: ../../whatsnew/3.12.rst:650 msgid "" "Add :func:`inspect.getasyncgenstate` and :func:`inspect.getasyncgenlocals` " "for determining the current state of asynchronous generators. (Contributed " "by Thomas Krennwallner in :issue:`35759`.)" msgstr "" -#: ../../whatsnew/3.12.rst:626 +#: ../../whatsnew/3.12.rst:654 msgid "" "The performance of :func:`inspect.getattr_static` has been considerably " "improved. Most calls to the function should be at least 2x faster than they " @@ -746,60 +783,60 @@ msgid "" "Waygood in :gh:`103193`.)" msgstr "" -#: ../../whatsnew/3.12.rst:632 +#: ../../whatsnew/3.12.rst:660 msgid "itertools" msgstr "itertools" -#: ../../whatsnew/3.12.rst:634 +#: ../../whatsnew/3.12.rst:662 msgid "" "Added :class:`itertools.batched()` for collecting into even-sized tuples " "where the last batch may be shorter than the rest. (Contributed by Raymond " "Hettinger in :gh:`98363`.)" msgstr "" -#: ../../whatsnew/3.12.rst:639 +#: ../../whatsnew/3.12.rst:667 msgid "math" msgstr "math" -#: ../../whatsnew/3.12.rst:641 +#: ../../whatsnew/3.12.rst:669 msgid "" "Added :func:`math.sumprod` for computing a sum of products. (Contributed by " "Raymond Hettinger in :gh:`100485`.)" msgstr "" -#: ../../whatsnew/3.12.rst:644 +#: ../../whatsnew/3.12.rst:672 msgid "" "Extended :func:`math.nextafter` to include a *steps* argument for moving up " "or down multiple steps at a time. (By Matthias Goergens, Mark Dickinson, and " "Raymond Hettinger in :gh:`94906`.)" msgstr "" -#: ../../whatsnew/3.12.rst:649 +#: ../../whatsnew/3.12.rst:677 msgid "os" msgstr "os" -#: ../../whatsnew/3.12.rst:651 +#: ../../whatsnew/3.12.rst:679 msgid "" "Add :const:`os.PIDFD_NONBLOCK` to open a file descriptor for a process with :" "func:`os.pidfd_open` in non-blocking mode. (Contributed by Kumar Aditya in :" "gh:`93312`.)" msgstr "" -#: ../../whatsnew/3.12.rst:655 +#: ../../whatsnew/3.12.rst:683 msgid "" ":class:`os.DirEntry` now includes an :meth:`os.DirEntry.is_junction` method " "to check if the entry is a junction. (Contributed by Charles Machalow in :gh:" "`99547`.)" msgstr "" -#: ../../whatsnew/3.12.rst:659 +#: ../../whatsnew/3.12.rst:687 msgid "" "Add :func:`os.listdrives`, :func:`os.listvolumes` and :func:`os.listmounts` " "functions on Windows for enumerating drives, volumes and mount points. " "(Contributed by Steve Dower in :gh:`102519`.)" msgstr "" -#: ../../whatsnew/3.12.rst:663 +#: ../../whatsnew/3.12.rst:691 msgid "" ":func:`os.stat` and :func:`os.lstat` are now more accurate on Windows. The " "``st_birthtime`` field will now be filled with the creation time of the " @@ -812,27 +849,27 @@ msgid "" "`99726`.)" msgstr "" -#: ../../whatsnew/3.12.rst:674 +#: ../../whatsnew/3.12.rst:702 msgid "os.path" msgstr "os.path" -#: ../../whatsnew/3.12.rst:676 +#: ../../whatsnew/3.12.rst:704 msgid "" "Add :func:`os.path.isjunction` to check if a given path is a junction. " "(Contributed by Charles Machalow in :gh:`99547`.)" msgstr "" -#: ../../whatsnew/3.12.rst:679 +#: ../../whatsnew/3.12.rst:707 msgid "" "Add :func:`os.path.splitroot` to split a path into a triad ``(drive, root, " "tail)``. (Contributed by Barney Gale in :gh:`101000`.)" msgstr "" -#: ../../whatsnew/3.12.rst:683 +#: ../../whatsnew/3.12.rst:711 msgid "pathlib" msgstr "pathlib" -#: ../../whatsnew/3.12.rst:685 +#: ../../whatsnew/3.12.rst:713 msgid "" "Add support for subclassing :class:`pathlib.PurePath` and :class:`~pathlib." "Path`, plus their Posix- and Windows-specific variants. Subclasses may " @@ -840,14 +877,14 @@ msgid "" "information between path instances." msgstr "" -#: ../../whatsnew/3.12.rst:690 +#: ../../whatsnew/3.12.rst:718 msgid "" "Add :meth:`~pathlib.Path.walk` for walking the directory trees and " "generating all file or directory names within them, similar to :func:`os." "walk`. (Contributed by Stanislav Zmiev in :gh:`90385`.)" msgstr "" -#: ../../whatsnew/3.12.rst:694 +#: ../../whatsnew/3.12.rst:722 msgid "" "Add *walk_up* optional parameter to :meth:`pathlib.PurePath.relative_to` to " "allow the insertion of ``..`` entries in the result; this behavior is more " @@ -855,13 +892,13 @@ msgid "" "issue:`40358`.)" msgstr "" -#: ../../whatsnew/3.12.rst:699 +#: ../../whatsnew/3.12.rst:727 msgid "" "Add :meth:`pathlib.Path.is_junction` as a proxy to :func:`os.path." "isjunction`. (Contributed by Charles Machalow in :gh:`99547`.)" msgstr "" -#: ../../whatsnew/3.12.rst:702 +#: ../../whatsnew/3.12.rst:730 msgid "" "Add *case_sensitive* optional parameter to :meth:`pathlib.Path.glob`, :meth:" "`pathlib.Path.rglob` and :meth:`pathlib.PurePath.match` for matching the " @@ -869,38 +906,38 @@ msgid "" "process." msgstr "" -#: ../../whatsnew/3.12.rst:707 +#: ../../whatsnew/3.12.rst:735 msgid "pdb" msgstr "pdb" -#: ../../whatsnew/3.12.rst:709 +#: ../../whatsnew/3.12.rst:737 msgid "" "Add convenience variables to hold values temporarily for debug session and " "provide quick access to values like the current frame or the return value. " "(Contributed by Tian Gao in :gh:`103693`.)" msgstr "" -#: ../../whatsnew/3.12.rst:715 +#: ../../whatsnew/3.12.rst:743 msgid "random" msgstr "random" -#: ../../whatsnew/3.12.rst:717 +#: ../../whatsnew/3.12.rst:745 msgid "" "Added :func:`random.binomialvariate`. (Contributed by Raymond Hettinger in :" "gh:`81620`.)" msgstr "" -#: ../../whatsnew/3.12.rst:720 +#: ../../whatsnew/3.12.rst:748 msgid "" "Added a default of ``lamb=1.0`` to :func:`random.expovariate`. (Contributed " "by Raymond Hettinger in :gh:`100234`.)" msgstr "" -#: ../../whatsnew/3.12.rst:724 +#: ../../whatsnew/3.12.rst:752 msgid "shutil" msgstr "shutil" -#: ../../whatsnew/3.12.rst:726 +#: ../../whatsnew/3.12.rst:754 msgid "" ":func:`shutil.make_archive` now passes the *root_dir* argument to custom " "archivers which support it. In this case it no longer temporarily changes " @@ -908,7 +945,7 @@ msgid "" "archiving. (Contributed by Serhiy Storchaka in :gh:`74696`.)" msgstr "" -#: ../../whatsnew/3.12.rst:732 +#: ../../whatsnew/3.12.rst:760 msgid "" ":func:`shutil.rmtree` now accepts a new argument *onexc* which is an error " "handler like *onerror* but which expects an exception instance rather than a " @@ -916,14 +953,14 @@ msgid "" "Python 3.14. (Contributed by Irit Katriel in :gh:`102828`.)" msgstr "" -#: ../../whatsnew/3.12.rst:738 +#: ../../whatsnew/3.12.rst:766 msgid "" ":func:`shutil.which` now consults the *PATHEXT* environment variable to find " "matches within *PATH* on Windows even when the given *cmd* includes a " "directory component. (Contributed by Charles Machalow in :gh:`103179`.)" msgstr "" -#: ../../whatsnew/3.12.rst:743 +#: ../../whatsnew/3.12.rst:771 msgid "" ":func:`shutil.which` will call ``NeedCurrentDirectoryForExePathW`` when " "querying for executables on Windows to determine if the current working " @@ -931,24 +968,24 @@ msgid "" "Machalow in :gh:`103179`.)" msgstr "" -#: ../../whatsnew/3.12.rst:748 +#: ../../whatsnew/3.12.rst:776 msgid "" ":func:`shutil.which` will return a path matching the *cmd* with a component " "from ``PATHEXT`` prior to a direct match elsewhere in the search path on " "Windows. (Contributed by Charles Machalow in :gh:`103179`.)" msgstr "" -#: ../../whatsnew/3.12.rst:754 +#: ../../whatsnew/3.12.rst:782 ../../whatsnew/3.12.rst:1461 msgid "sqlite3" msgstr "sqlite3" -#: ../../whatsnew/3.12.rst:756 +#: ../../whatsnew/3.12.rst:784 msgid "" "Add a :ref:`command-line interface `. (Contributed by Erlend E. " "Aasland in :gh:`77617`.)" msgstr "" -#: ../../whatsnew/3.12.rst:759 +#: ../../whatsnew/3.12.rst:787 msgid "" "Add the :attr:`~sqlite3.Connection.autocommit` attribute to :class:`~sqlite3." "Connection` and the *autocommit* parameter to :func:`~sqlite3.connect` to " @@ -956,36 +993,36 @@ msgid "" "control-autocommit>`. (Contributed by Erlend E. Aasland in :gh:`83638`.)" msgstr "" -#: ../../whatsnew/3.12.rst:766 +#: ../../whatsnew/3.12.rst:794 msgid "" "Add *entrypoint* keyword-only parameter to :meth:`~sqlite3.Connection." "load_extension`, for overriding the SQLite extension entry point. " "(Contributed by Erlend E. Aasland in :gh:`103015`.)" msgstr "" -#: ../../whatsnew/3.12.rst:771 +#: ../../whatsnew/3.12.rst:799 msgid "" "Add :meth:`~sqlite3.Connection.getconfig` and :meth:`~sqlite3.Connection." "setconfig` to :class:`~sqlite3.Connection` to make configuration changes to " "a database connection. (Contributed by Erlend E. Aasland in :gh:`103489`.)" msgstr "" -#: ../../whatsnew/3.12.rst:777 +#: ../../whatsnew/3.12.rst:805 msgid "statistics" msgstr "statistics" -#: ../../whatsnew/3.12.rst:779 +#: ../../whatsnew/3.12.rst:807 msgid "" "Extended :func:`statistics.correlation` to include as a ``ranked`` method " "for computing the Spearman correlation of ranked data. (Contributed by " "Raymond Hettinger in :gh:`95861`.)" msgstr "" -#: ../../whatsnew/3.12.rst:784 +#: ../../whatsnew/3.12.rst:812 msgid "sys" msgstr "sys" -#: ../../whatsnew/3.12.rst:786 +#: ../../whatsnew/3.12.rst:814 msgid "" "Add :func:`sys.activate_stack_trampoline` and :func:`sys." "deactivate_stack_trampoline` for activating and deactivating stack profiler " @@ -995,7 +1032,7 @@ msgid "" "Shannon in :gh:`96123`.)" msgstr "" -#: ../../whatsnew/3.12.rst:795 +#: ../../whatsnew/3.12.rst:823 msgid "" "Add :data:`sys.last_exc` which holds the last unhandled exception that was " "raised (for post-mortem debugging use cases). Deprecate the three fields " @@ -1004,14 +1041,14 @@ msgid "" "Katriel in :gh:`102778`.)" msgstr "" -#: ../../whatsnew/3.12.rst:801 ../../whatsnew/3.12.rst:1560 +#: ../../whatsnew/3.12.rst:829 ../../whatsnew/3.12.rst:1647 msgid "" ":func:`sys._current_exceptions` now returns a mapping from thread-id to an " "exception instance, rather than to a ``(typ, exc, tb)`` tuple. (Contributed " "by Irit Katriel in :gh:`103176`.)" msgstr "" -#: ../../whatsnew/3.12.rst:805 +#: ../../whatsnew/3.12.rst:833 msgid "" ":func:`sys.setrecursionlimit` and :func:`sys.getrecursionlimit`. The " "recursion limit now applies only to Python code. Builtin functions do not " @@ -1019,27 +1056,27 @@ msgid "" "prevents recursion from causing a virtual machine crash." msgstr "" -#: ../../whatsnew/3.12.rst:811 +#: ../../whatsnew/3.12.rst:839 msgid "tempfile" msgstr "tempfile" -#: ../../whatsnew/3.12.rst:813 +#: ../../whatsnew/3.12.rst:841 msgid "" "The :class:`tempfile.NamedTemporaryFile` function has a new optional " "parameter *delete_on_close* (Contributed by Evgeny Zorin in :gh:`58451`.)" msgstr "" -#: ../../whatsnew/3.12.rst:815 +#: ../../whatsnew/3.12.rst:843 msgid "" ":func:`tempfile.mkdtemp` now always returns an absolute path, even if the " "argument provided to the *dir* parameter is a relative path." msgstr "" -#: ../../whatsnew/3.12.rst:821 +#: ../../whatsnew/3.12.rst:849 msgid "threading" msgstr "threading" -#: ../../whatsnew/3.12.rst:823 +#: ../../whatsnew/3.12.rst:851 msgid "" "Add :func:`threading.settrace_all_threads` and :func:`threading." "setprofile_all_threads` that allow to set tracing and profiling functions in " @@ -1047,11 +1084,11 @@ msgid "" "Galindo in :gh:`93503`.)" msgstr "" -#: ../../whatsnew/3.12.rst:829 +#: ../../whatsnew/3.12.rst:857 msgid "tkinter" msgstr "tkinter" -#: ../../whatsnew/3.12.rst:831 +#: ../../whatsnew/3.12.rst:859 msgid "" "``tkinter.Canvas.coords()`` now flattens its arguments. It now accepts not " "only coordinates as separate arguments (``x1, y1, x2, y2, ...``) and a " @@ -1061,11 +1098,11 @@ msgid "" "in :gh:`94473`.)" msgstr "" -#: ../../whatsnew/3.12.rst:840 +#: ../../whatsnew/3.12.rst:868 msgid "tokenize" msgstr "tokenize" -#: ../../whatsnew/3.12.rst:842 +#: ../../whatsnew/3.12.rst:870 msgid "" "The :mod:`tokenize` module includes the changes introduced in :pep:`701`. " "( Contributed by Marta Gómez Macías and Pablo Galindo in :gh:`102856`.) See :" @@ -1073,22 +1110,22 @@ msgid "" "to the :mod:`tokenize` module." msgstr "" -#: ../../whatsnew/3.12.rst:848 +#: ../../whatsnew/3.12.rst:876 msgid "types" msgstr "types" -#: ../../whatsnew/3.12.rst:850 +#: ../../whatsnew/3.12.rst:878 msgid "" "Add :func:`types.get_original_bases` to allow for further introspection of :" "ref:`user-defined-generics` when subclassed. (Contributed by James Hilton-" "Balfe and Alex Waygood in :gh:`101827`.)" msgstr "" -#: ../../whatsnew/3.12.rst:855 +#: ../../whatsnew/3.12.rst:883 msgid "typing" msgstr "typing" -#: ../../whatsnew/3.12.rst:857 +#: ../../whatsnew/3.12.rst:885 msgid "" ":func:`isinstance` checks against :func:`runtime-checkable protocols ` now use :func:`inspect.getattr_static` rather than :func:" @@ -1101,7 +1138,7 @@ msgid "" "affected by this change. (Contributed by Alex Waygood in :gh:`102433`.)" msgstr "" -#: ../../whatsnew/3.12.rst:868 +#: ../../whatsnew/3.12.rst:896 msgid "" "The members of a runtime-checkable protocol are now considered \"frozen\" at " "runtime as soon as the class has been created. Monkey-patching attributes " @@ -1109,13 +1146,13 @@ msgid "" "on :func:`isinstance` checks comparing objects to the protocol. For example::" msgstr "" -#: ../../whatsnew/3.12.rst:890 +#: ../../whatsnew/3.12.rst:918 msgid "" "This change was made in order to speed up ``isinstance()`` checks against " "runtime-checkable protocols." msgstr "" -#: ../../whatsnew/3.12.rst:893 +#: ../../whatsnew/3.12.rst:921 msgid "" "The performance profile of :func:`isinstance` checks against :func:`runtime-" "checkable protocols ` has changed significantly. " @@ -1126,71 +1163,71 @@ msgid "" "in :gh:`74690` and :gh:`103193`.)" msgstr "" -#: ../../whatsnew/3.12.rst:901 +#: ../../whatsnew/3.12.rst:929 msgid "" "All :data:`typing.TypedDict` and :data:`typing.NamedTuple` classes now have " "the ``__orig_bases__`` attribute. (Contributed by Adrian Garcia Badaracco " "in :gh:`103699`.)" msgstr "" -#: ../../whatsnew/3.12.rst:905 +#: ../../whatsnew/3.12.rst:933 msgid "" "Add ``frozen_default`` parameter to :func:`typing.dataclass_transform`. " "(Contributed by Erik De Bonte in :gh:`99957`.)" msgstr "" -#: ../../whatsnew/3.12.rst:909 +#: ../../whatsnew/3.12.rst:937 msgid "unicodedata" msgstr "unicodedata" -#: ../../whatsnew/3.12.rst:911 +#: ../../whatsnew/3.12.rst:939 msgid "" "The Unicode database has been updated to version 15.0.0. (Contributed by " "Benjamin Peterson in :gh:`96734`)." msgstr "" -#: ../../whatsnew/3.12.rst:915 +#: ../../whatsnew/3.12.rst:943 ../../whatsnew/3.12.rst:1502 msgid "unittest" msgstr "unittest" -#: ../../whatsnew/3.12.rst:917 +#: ../../whatsnew/3.12.rst:945 msgid "" "Added ``--durations`` command line option, showing the N slowest test cases::" msgstr "" -#: ../../whatsnew/3.12.rst:933 +#: ../../whatsnew/3.12.rst:961 msgid "(Contributed by Giampaolo Rodola in :issue:`4080`)" msgstr "(由 Giampaolo Rodola 於 :issue:`4080` 中貢獻。)" -#: ../../whatsnew/3.12.rst:936 +#: ../../whatsnew/3.12.rst:964 msgid "uuid" msgstr "uuid" -#: ../../whatsnew/3.12.rst:938 +#: ../../whatsnew/3.12.rst:966 msgid "" "Add a :ref:`command-line interface `. (Contributed by Adam Chhina " "in :gh:`88597`.)" msgstr "" -#: ../../whatsnew/3.12.rst:943 +#: ../../whatsnew/3.12.rst:971 msgid "Optimizations" msgstr "最佳化" -#: ../../whatsnew/3.12.rst:945 +#: ../../whatsnew/3.12.rst:973 msgid "" "Removed ``wstr`` and ``wstr_length`` members from Unicode objects. It " "reduces object size by 8 or 16 bytes on 64bit platform. (:pep:`623`) " "(Contributed by Inada Naoki in :gh:`92536`.)" msgstr "" -#: ../../whatsnew/3.12.rst:949 +#: ../../whatsnew/3.12.rst:977 msgid "" "Added experimental support for using the BOLT binary optimizer in the build " "process, which improves performance by 1-5%. (Contributed by Kevin " "Modzelewski in :gh:`90536` and tuned by Dong-hee Na in :gh:`101525`)" msgstr "" -#: ../../whatsnew/3.12.rst:953 +#: ../../whatsnew/3.12.rst:981 msgid "" "Speed up the regular expression substitution (functions :func:`re.sub` and :" "func:`re.subn` and corresponding :class:`!re.Pattern` methods) for " @@ -1198,13 +1235,13 @@ msgid "" "by Serhiy Storchaka in :gh:`91524`.)" msgstr "" -#: ../../whatsnew/3.12.rst:958 +#: ../../whatsnew/3.12.rst:986 msgid "" "Speed up :class:`asyncio.Task` creation by deferring expensive string " "formatting. (Contributed by Itamar O in :gh:`103793`.)" msgstr "" -#: ../../whatsnew/3.12.rst:961 +#: ../../whatsnew/3.12.rst:989 msgid "" "The :func:`tokenize.tokenize` and :func:`tokenize.generate_tokens` functions " "are up to 64% faster as a side effect of the changes required to cover :pep:" @@ -1212,18 +1249,18 @@ msgid "" "Pablo Galindo in :gh:`102856`.)" msgstr "" -#: ../../whatsnew/3.12.rst:966 +#: ../../whatsnew/3.12.rst:994 msgid "" "Speed up :func:`super` method calls and attribute loads via the new :opcode:" "`LOAD_SUPER_ATTR` instruction. (Contributed by Carl Meyer and Vladimir " "Matveev in :gh:`103497`.)" msgstr "" -#: ../../whatsnew/3.12.rst:972 +#: ../../whatsnew/3.12.rst:1000 msgid "CPython bytecode changes" msgstr "" -#: ../../whatsnew/3.12.rst:974 +#: ../../whatsnew/3.12.rst:1002 msgid "" "Remove the :opcode:`LOAD_METHOD` instruction. It has been merged into :" "opcode:`LOAD_ATTR`. :opcode:`LOAD_ATTR` will now behave like the old :opcode:" @@ -1231,20 +1268,26 @@ msgid "" "by Ken Jin in :gh:`93429`.)" msgstr "" -#: ../../whatsnew/3.12.rst:979 +#: ../../whatsnew/3.12.rst:1007 msgid "" "Remove the :opcode:`!JUMP_IF_FALSE_OR_POP` and :opcode:`!" "JUMP_IF_TRUE_OR_POP` instructions. (Contributed by Irit Katriel in :gh:" "`102859`.)" msgstr "" -#: ../../whatsnew/3.12.rst:982 +#: ../../whatsnew/3.12.rst:1010 +msgid "" +"Removed the :opcode:`!PRECALL` instruction. (Contributed by Mark Shannon in :" +"gh:`92925`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1013 msgid "" "Add the :opcode:`LOAD_FAST_AND_CLEAR` instruction as part of the " "implementation of :pep:`709`. (Contributed by Carl Meyer in :gh:`101441`.)" msgstr "" -#: ../../whatsnew/3.12.rst:985 +#: ../../whatsnew/3.12.rst:1016 msgid "" "Add the :opcode:`LOAD_FROM_DICT_OR_DEREF`, :opcode:" "`LOAD_FROM_DICT_OR_GLOBALS`, and :opcode:`LOAD_LOCALS` opcodes as part of " @@ -1253,35 +1296,35 @@ msgid "" "`LOAD_FROM_DICT_OR_DEREF`. (Contributed by Jelle Zijlstra in :gh:`103764`.)" msgstr "" -#: ../../whatsnew/3.12.rst:991 +#: ../../whatsnew/3.12.rst:1022 msgid "" "Add the :opcode:`LOAD_SUPER_ATTR` instruction. (Contributed by Carl Meyer " "and Vladimir Matveev in :gh:`103497`.)" msgstr "" -#: ../../whatsnew/3.12.rst:995 +#: ../../whatsnew/3.12.rst:1026 msgid "Demos and Tools" msgstr "" -#: ../../whatsnew/3.12.rst:997 +#: ../../whatsnew/3.12.rst:1028 msgid "" "Remove the ``Tools/demo/`` directory which contained old demo scripts. A " "copy can be found in the `old-demos project `_. (Contributed by Victor Stinner in :gh:`97681`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1002 +#: ../../whatsnew/3.12.rst:1033 msgid "" "Remove outdated example scripts of the ``Tools/scripts/`` directory. A copy " "can be found in the `old-demos project `_. (Contributed by Victor Stinner in :gh:`97669`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1009 ../../whatsnew/3.12.rst:1951 +#: ../../whatsnew/3.12.rst:1040 ../../whatsnew/3.12.rst:2038 msgid "Deprecated" msgstr "已棄用" -#: ../../whatsnew/3.12.rst:1011 +#: ../../whatsnew/3.12.rst:1042 msgid "" ":mod:`asyncio`: The :meth:`~asyncio.get_event_loop` method of the default " "event loop policy now emits a :exc:`DeprecationWarning` if there is no " @@ -1289,14 +1332,14 @@ msgid "" "Storchaka and Guido van Rossum in :gh:`100160`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1016 +#: ../../whatsnew/3.12.rst:1047 msgid "" ":mod:`calendar`: ``calendar.January`` and ``calendar.February`` constants " -"are deprecated and replaced by :data:`calendar.Month.JANUARY` and :data:" -"`calendar.Month.FEBRUARY`. (Contributed by Prince Roshan in :gh:`103636`.)" +"are deprecated and replaced by :data:`calendar.JANUARY` and :data:`calendar." +"FEBRUARY`. (Contributed by Prince Roshan in :gh:`103636`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1020 +#: ../../whatsnew/3.12.rst:1051 msgid "" ":mod:`datetime`: :class:`datetime.datetime`'s :meth:`~datetime.datetime." "utcnow` and :meth:`~datetime.datetime.utcfromtimestamp` are deprecated and " @@ -1306,7 +1349,7 @@ msgid "" "set to :const:`datetime.UTC`. (Contributed by Paul Ganssle in :gh:`103857`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1028 +#: ../../whatsnew/3.12.rst:1059 msgid "" ":mod:`os`: The ``st_ctime`` fields return by :func:`os.stat` and :func:`os." "lstat` on Windows are deprecated. In a future release, they will contain the " @@ -1315,25 +1358,25 @@ msgid "" "``st_birthtime`` field. (Contributed by Steve Dower in :gh:`99726`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1034 +#: ../../whatsnew/3.12.rst:1065 msgid "" ":mod:`shutil`: The *onerror* argument of :func:`shutil.rmtree` is deprecated " "as will be removed in Python 3.14. Use *onexc* instead. (Contributed by Irit " "Katriel in :gh:`102828`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1049 +#: ../../whatsnew/3.12.rst:1080 msgid ":mod:`sqlite3`:" msgstr "" -#: ../../whatsnew/3.12.rst:1038 +#: ../../whatsnew/3.12.rst:1069 msgid "" ":ref:`default adapters and converters ` are now " "deprecated. Instead, use the :ref:`sqlite3-adapter-converter-recipes` and " "tailor them to your needs. (Contributed by Erlend E. Aasland in :gh:`90016`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1044 +#: ../../whatsnew/3.12.rst:1075 msgid "" "In :meth:`~sqlite3.Cursor.execute`, :exc:`DeprecationWarning` is now emitted " "when :ref:`named placeholders ` are used together with " @@ -1343,28 +1386,28 @@ msgid "" "Erlend E. Aasland in :gh:`101698`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1051 +#: ../../whatsnew/3.12.rst:1082 msgid "" ":mod:`sys`: The :data:`sys.last_type`, :data:`sys.last_value` and :data:`sys." "last_traceback` fields are deprecated. Use :data:`sys.last_exc` instead. " "(Contributed by Irit Katriel in :gh:`102778`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1055 +#: ../../whatsnew/3.12.rst:1086 msgid "" ":mod:`tarfile`: Extracting tar archives without specifying *filter* is " "deprecated until Python 3.14, when ``'data'`` filter will become the " "default. See :ref:`tarfile-extraction-filter` for details." msgstr "" -#: ../../whatsnew/3.12.rst:1059 +#: ../../whatsnew/3.12.rst:1090 msgid "" ":mod:`typing`: :class:`typing.Hashable` and :class:`typing.Sized` aliases " "for :class:`collections.abc.Hashable` and :class:`collections.abc.Sized`. (:" "gh:`94309`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1062 +#: ../../whatsnew/3.12.rst:1093 msgid "" ":mod:`xml.etree.ElementTree`: The module now emits :exc:`DeprecationWarning` " "when testing the truth value of an :class:`xml.etree.ElementTree.Element`. " @@ -1372,7 +1415,7 @@ msgid "" "implementation emitted nothing." msgstr "" -#: ../../whatsnew/3.12.rst:1067 +#: ../../whatsnew/3.12.rst:1098 msgid "" "The 3-arg signatures (type, value, traceback) of :meth:`~coroutine.throw`, :" "meth:`~generator.throw` and :meth:`~agen.athrow` are deprecated and may be " @@ -1380,14 +1423,14 @@ msgid "" "functions instead. (Contributed by Ofey Chan in :gh:`89874`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1072 +#: ../../whatsnew/3.12.rst:1103 msgid "" ":exc:`DeprecationWarning` is now raised when ``__package__`` on a module " "differs from ``__spec__.parent`` (previously it was :exc:`ImportWarning`). " "(Contributed by Brett Cannon in :gh:`65961`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1077 +#: ../../whatsnew/3.12.rst:1108 msgid "" "In accordance with :pep:`699`, the ``ma_version_tag`` field in :c:type:" "`PyDictObject` is deprecated for extension modules. Accessing this field " @@ -1396,7 +1439,7 @@ msgid "" "PEP by Ken Jin.)" msgstr "" -#: ../../whatsnew/3.12.rst:1082 +#: ../../whatsnew/3.12.rst:1113 msgid "" "The bitwise inversion operator (``~``) on bool is deprecated. It will throw " "an error in Python 3.14. Use ``not`` for logical negation of bools instead. " @@ -1405,156 +1448,156 @@ msgid "" "by Tim Hoffmann in :gh:`103487`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1089 +#: ../../whatsnew/3.12.rst:1120 msgid "Pending Removal in Python 3.13" msgstr "" -#: ../../whatsnew/3.12.rst:1091 +#: ../../whatsnew/3.12.rst:1122 msgid "" "The following modules and APIs have been deprecated in earlier Python " "releases, and will be removed in Python 3.13." msgstr "" -#: ../../whatsnew/3.12.rst:1094 +#: ../../whatsnew/3.12.rst:1125 msgid "Modules (see :pep:`594`):" msgstr "" -#: ../../whatsnew/3.12.rst:1096 +#: ../../whatsnew/3.12.rst:1127 msgid ":mod:`aifc`" msgstr ":mod:`aifc`" -#: ../../whatsnew/3.12.rst:1097 +#: ../../whatsnew/3.12.rst:1128 msgid ":mod:`audioop`" msgstr ":mod:`audioop`" -#: ../../whatsnew/3.12.rst:1098 +#: ../../whatsnew/3.12.rst:1129 msgid ":mod:`cgi`" msgstr ":mod:`cgi`" -#: ../../whatsnew/3.12.rst:1099 +#: ../../whatsnew/3.12.rst:1130 msgid ":mod:`cgitb`" msgstr ":mod:`cgitb`" -#: ../../whatsnew/3.12.rst:1100 +#: ../../whatsnew/3.12.rst:1131 msgid ":mod:`chunk`" msgstr ":mod:`chunk`" -#: ../../whatsnew/3.12.rst:1101 +#: ../../whatsnew/3.12.rst:1132 msgid ":mod:`crypt`" msgstr ":mod:`crypt`" -#: ../../whatsnew/3.12.rst:1102 +#: ../../whatsnew/3.12.rst:1133 msgid ":mod:`imghdr`" msgstr ":mod:`imghdr`" -#: ../../whatsnew/3.12.rst:1103 +#: ../../whatsnew/3.12.rst:1134 msgid ":mod:`mailcap`" msgstr ":mod:`mailcap`" -#: ../../whatsnew/3.12.rst:1104 +#: ../../whatsnew/3.12.rst:1135 msgid ":mod:`msilib`" msgstr ":mod:`msilib`" -#: ../../whatsnew/3.12.rst:1105 +#: ../../whatsnew/3.12.rst:1136 msgid ":mod:`nis`" msgstr ":mod:`nis`" -#: ../../whatsnew/3.12.rst:1106 +#: ../../whatsnew/3.12.rst:1137 msgid ":mod:`nntplib`" msgstr ":mod:`nntplib`" -#: ../../whatsnew/3.12.rst:1107 +#: ../../whatsnew/3.12.rst:1138 msgid ":mod:`ossaudiodev`" msgstr ":mod:`ossaudiodev`" -#: ../../whatsnew/3.12.rst:1108 +#: ../../whatsnew/3.12.rst:1139 msgid ":mod:`pipes`" msgstr ":mod:`pipes`" -#: ../../whatsnew/3.12.rst:1109 +#: ../../whatsnew/3.12.rst:1140 msgid ":mod:`sndhdr`" msgstr ":mod:`sndhdr`" -#: ../../whatsnew/3.12.rst:1110 +#: ../../whatsnew/3.12.rst:1141 msgid ":mod:`spwd`" msgstr ":mod:`spwd`" -#: ../../whatsnew/3.12.rst:1111 +#: ../../whatsnew/3.12.rst:1142 msgid ":mod:`sunau`" msgstr ":mod:`sunau`" -#: ../../whatsnew/3.12.rst:1112 +#: ../../whatsnew/3.12.rst:1143 msgid ":mod:`telnetlib`" msgstr ":mod:`telnetlib`" -#: ../../whatsnew/3.12.rst:1113 +#: ../../whatsnew/3.12.rst:1144 msgid ":mod:`uu`" msgstr ":mod:`uu`" -#: ../../whatsnew/3.12.rst:1114 +#: ../../whatsnew/3.12.rst:1145 msgid ":mod:`xdrlib`" msgstr ":mod:`xdrlib`" -#: ../../whatsnew/3.12.rst:1116 +#: ../../whatsnew/3.12.rst:1147 msgid "Other modules:" msgstr "" -#: ../../whatsnew/3.12.rst:1118 +#: ../../whatsnew/3.12.rst:1149 msgid ":mod:`!lib2to3`, and the :program:`2to3` program (:gh:`84540`)" msgstr "" -#: ../../whatsnew/3.12.rst:1120 +#: ../../whatsnew/3.12.rst:1151 msgid "APIs:" msgstr "" -#: ../../whatsnew/3.12.rst:1122 +#: ../../whatsnew/3.12.rst:1153 msgid ":class:`!configparser.LegacyInterpolation` (:gh:`90765`)" msgstr ":class:`!configparser.LegacyInterpolation` (:gh:`90765`)" -#: ../../whatsnew/3.12.rst:1123 +#: ../../whatsnew/3.12.rst:1154 msgid ":func:`locale.getdefaultlocale` (:gh:`90817`)" msgstr ":func:`locale.getdefaultlocale` (:gh:`90817`)" -#: ../../whatsnew/3.12.rst:1124 +#: ../../whatsnew/3.12.rst:1155 msgid ":meth:`!turtle.RawTurtle.settiltangle` (:gh:`50096`)" msgstr ":meth:`!turtle.RawTurtle.settiltangle` (:gh:`50096`)" -#: ../../whatsnew/3.12.rst:1125 +#: ../../whatsnew/3.12.rst:1156 msgid ":func:`!unittest.findTestCases` (:gh:`50096`)" msgstr ":func:`!unittest.findTestCases` (:gh:`50096`)" -#: ../../whatsnew/3.12.rst:1126 +#: ../../whatsnew/3.12.rst:1157 msgid ":func:`!unittest.getTestCaseNames` (:gh:`50096`)" msgstr ":func:`!unittest.getTestCaseNames` (:gh:`50096`)" -#: ../../whatsnew/3.12.rst:1127 +#: ../../whatsnew/3.12.rst:1158 msgid ":func:`!unittest.makeSuite` (:gh:`50096`)" msgstr ":func:`!unittest.makeSuite` (:gh:`50096`)" -#: ../../whatsnew/3.12.rst:1128 +#: ../../whatsnew/3.12.rst:1159 msgid ":meth:`!unittest.TestProgram.usageExit` (:gh:`67048`)" msgstr ":meth:`!unittest.TestProgram.usageExit` (:gh:`67048`)" -#: ../../whatsnew/3.12.rst:1129 +#: ../../whatsnew/3.12.rst:1160 msgid ":class:`!webbrowser.MacOSX` (:gh:`86421`)" msgstr ":class:`!webbrowser.MacOSX` (:gh:`86421`)" -#: ../../whatsnew/3.12.rst:1130 +#: ../../whatsnew/3.12.rst:1161 msgid ":class:`classmethod` descriptor chaining (:gh:`89519`)" msgstr "" -#: ../../whatsnew/3.12.rst:1133 +#: ../../whatsnew/3.12.rst:1164 msgid "Pending Removal in Python 3.14" msgstr "" -#: ../../whatsnew/3.12.rst:1135 +#: ../../whatsnew/3.12.rst:1166 msgid "" ":mod:`argparse`: The *type*, *choices*, and *metavar* parameters of :class:`!" "argparse.BooleanOptionalAction` are deprecated and will be removed in 3.14. " "(Contributed by Nikita Sobolev in :gh:`92248`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1140 +#: ../../whatsnew/3.12.rst:1171 msgid "" ":mod:`ast`: The following :mod:`ast` features have been deprecated in " "documentation since Python 3.8, now cause a :exc:`DeprecationWarning` to be " @@ -1562,39 +1605,39 @@ msgid "" "Python 3.14:" msgstr "" -#: ../../whatsnew/3.12.rst:1144 +#: ../../whatsnew/3.12.rst:1175 msgid ":class:`!ast.Num`" msgstr ":class:`!ast.Num`" -#: ../../whatsnew/3.12.rst:1145 +#: ../../whatsnew/3.12.rst:1176 msgid ":class:`!ast.Str`" msgstr ":class:`!ast.Str`" -#: ../../whatsnew/3.12.rst:1146 +#: ../../whatsnew/3.12.rst:1177 msgid ":class:`!ast.Bytes`" msgstr ":class:`!ast.Bytes`" -#: ../../whatsnew/3.12.rst:1147 +#: ../../whatsnew/3.12.rst:1178 msgid ":class:`!ast.NameConstant`" msgstr ":class:`!ast.NameConstant`" -#: ../../whatsnew/3.12.rst:1148 +#: ../../whatsnew/3.12.rst:1179 msgid ":class:`!ast.Ellipsis`" msgstr ":class:`!ast.Ellipsis`" -#: ../../whatsnew/3.12.rst:1150 +#: ../../whatsnew/3.12.rst:1181 msgid "" "Use :class:`ast.Constant` instead. (Contributed by Serhiy Storchaka in :gh:" "`90953`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1153 +#: ../../whatsnew/3.12.rst:1184 msgid "" ":mod:`asyncio`: the *msg* parameter of both :meth:`asyncio.Future.cancel` " "and :meth:`asyncio.Task.cancel` (:gh:`90985`)" msgstr "" -#: ../../whatsnew/3.12.rst:1157 +#: ../../whatsnew/3.12.rst:1188 msgid "" ":mod:`collections.abc`: Deprecated :class:`collections.abc.ByteString`. " "Prefer :class:`Sequence` or :class:`collections.abc.Buffer`. For use in " @@ -1602,47 +1645,47 @@ msgid "" "abc.Buffer`. (Contributed by Shantanu Jain in :gh:`91896`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1162 +#: ../../whatsnew/3.12.rst:1193 msgid "" ":mod:`email`: Deprecated the *isdst* parameter in :func:`email.utils." "localtime`. (Contributed by Alan Williams in :gh:`72346`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1165 +#: ../../whatsnew/3.12.rst:1196 msgid "" ":mod:`importlib.abc`: Deprecated the following classes, scheduled for " "removal in Python 3.14:" msgstr "" -#: ../../whatsnew/3.12.rst:1168 +#: ../../whatsnew/3.12.rst:1199 msgid ":class:`!importlib.abc.ResourceReader`" msgstr ":class:`!importlib.abc.ResourceReader`" -#: ../../whatsnew/3.12.rst:1169 +#: ../../whatsnew/3.12.rst:1200 msgid ":class:`!importlib.abc.Traversable`" msgstr ":class:`!importlib.abc.Traversable`" -#: ../../whatsnew/3.12.rst:1170 +#: ../../whatsnew/3.12.rst:1201 msgid ":class:`!importlib.abc.TraversableResources`" msgstr ":class:`!importlib.abc.TraversableResources`" -#: ../../whatsnew/3.12.rst:1172 +#: ../../whatsnew/3.12.rst:1203 msgid "Use :mod:`importlib.resources.abc` classes instead:" msgstr "" -#: ../../whatsnew/3.12.rst:1174 +#: ../../whatsnew/3.12.rst:1205 msgid ":class:`importlib.resources.abc.Traversable`" msgstr ":class:`importlib.resources.abc.Traversable`" -#: ../../whatsnew/3.12.rst:1175 +#: ../../whatsnew/3.12.rst:1206 msgid ":class:`importlib.resources.abc.TraversableResources`" msgstr ":class:`importlib.resources.abc.TraversableResources`" -#: ../../whatsnew/3.12.rst:1177 +#: ../../whatsnew/3.12.rst:1208 msgid "(Contributed by Jason R. Coombs and Hugo van Kemenade in :gh:`93963`.)" msgstr "(由 Jason R. Coombs 和 Hugo van Kemenade 於 :gh:`93963` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1179 +#: ../../whatsnew/3.12.rst:1210 msgid "" ":mod:`itertools`: The module had undocumented, inefficient, historically " "buggy, and inconsistent support for copy, deepcopy, and pickle operations. " @@ -1650,7 +1693,7 @@ msgid "" "maintenance burden. (Contributed by Raymond Hettinger in :gh:`101588`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1185 +#: ../../whatsnew/3.12.rst:1216 msgid "" ":mod:`multiprocessing`: The default :mod:`multiprocessing` start method will " "change to a safer one on Linux, BSDs, and other non-macOS POSIX platforms " @@ -1661,52 +1704,52 @@ msgid "" "code *requires* ``'fork'``. See :ref:`multiprocessing-start-methods`." msgstr "" -#: ../../whatsnew/3.12.rst:1193 +#: ../../whatsnew/3.12.rst:1224 msgid "" ":mod:`pkgutil`: :func:`pkgutil.find_loader` and :func:`pkgutil.get_loader` " "now raise :exc:`DeprecationWarning`; use :func:`importlib.util.find_spec` " "instead. (Contributed by Nikita Sobolev in :gh:`97850`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1198 +#: ../../whatsnew/3.12.rst:1229 msgid "" ":mod:`pty`: The module has two undocumented ``master_open()`` and " "``slave_open()`` functions that have been deprecated since Python 2 but only " "gained a proper :exc:`DeprecationWarning` in 3.12. Remove them in 3.14." msgstr "" -#: ../../whatsnew/3.12.rst:1202 +#: ../../whatsnew/3.12.rst:1233 msgid "" ":mod:`shutil`: The *onerror* argument of :func:`shutil.rmtree` is deprecated " "in 3.12, and will be removed in 3.14." msgstr "" -#: ../../whatsnew/3.12.rst:1205 +#: ../../whatsnew/3.12.rst:1236 msgid "" ":mod:`typing`: :class:`typing.ByteString`, deprecated since Python 3.9, now " "causes a :exc:`DeprecationWarning` to be emitted when it is used." msgstr "" -#: ../../whatsnew/3.12.rst:1208 +#: ../../whatsnew/3.12.rst:1239 msgid "" ":mod:`xml.etree.ElementTree`: Testing the truth value of an :class:`xml." "etree.ElementTree.Element` is deprecated and will raise an exception in " "Python 3.14." msgstr "" -#: ../../whatsnew/3.12.rst:1211 +#: ../../whatsnew/3.12.rst:1242 msgid "" "Creating immutable types (:c:macro:`Py_TPFLAGS_IMMUTABLETYPE`) with mutable " "bases using the C API (:gh:`95388`)." msgstr "" -#: ../../whatsnew/3.12.rst:1214 +#: ../../whatsnew/3.12.rst:1245 msgid "" "``__package__`` and ``__cached__`` will cease to be set or taken into " "consideration by the import system (:gh:`97879`)." msgstr "" -#: ../../whatsnew/3.12.rst:1217 +#: ../../whatsnew/3.12.rst:1248 msgid "" "Accessing ``co_lnotab`` was deprecated in :pep:`626` since 3.10 and was " "planned to be removed in 3.12 but it only got a proper :exc:" @@ -1714,31 +1757,31 @@ msgid "" "Sobolev in :gh:`101866`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1223 +#: ../../whatsnew/3.12.rst:1254 msgid "" "Creating :c:data:`immutable types ` with mutable " "bases using the C API (:gh:`95388`)" msgstr "" -#: ../../whatsnew/3.12.rst:1227 +#: ../../whatsnew/3.12.rst:1258 msgid "Pending Removal in Future Versions" msgstr "" -#: ../../whatsnew/3.12.rst:1229 +#: ../../whatsnew/3.12.rst:1260 msgid "" "The following APIs were deprecated in earlier Python versions and will be " "removed, although there is currently no date scheduled for their removal." msgstr "" -#: ../../whatsnew/3.12.rst:1232 +#: ../../whatsnew/3.12.rst:1263 msgid ":mod:`array`'s ``'u'`` format code (:gh:`57281`)" msgstr "" -#: ../../whatsnew/3.12.rst:1234 +#: ../../whatsnew/3.12.rst:1265 msgid ":class:`typing.Text` (:gh:`92332`)" msgstr ":class:`typing.Text` (:gh:`92332`)" -#: ../../whatsnew/3.12.rst:1236 +#: ../../whatsnew/3.12.rst:1267 msgid "" "Currently Python accepts numeric literals immediately followed by keywords, " "for example ``0in x``, ``1or x``, ``0if 1else 2``. It allows confusing and " @@ -1750,57 +1793,73 @@ msgid "" "syntax error. (:gh:`87999`)" msgstr "" -#: ../../whatsnew/3.12.rst:1247 ../../whatsnew/3.12.rst:2033 +#: ../../whatsnew/3.12.rst:1278 ../../whatsnew/3.12.rst:2120 msgid "Removed" msgstr "已移除" -#: ../../whatsnew/3.12.rst:1249 +#: ../../whatsnew/3.12.rst:1281 +msgid "asynchat and asyncore" +msgstr "" + +#: ../../whatsnew/3.12.rst:1283 msgid "" -"``asynchat`` and ``asyncore``: These two modules have been removed according " -"to the schedule in :pep:`594`, having been deprecated in Python 3.6. Use :" -"mod:`asyncio` instead. (Contributed by Nikita Sobolev in :gh:`96580`.)" +"These two modules have been removed according to the schedule in :pep:`594`, " +"having been deprecated in Python 3.6. Use :mod:`asyncio` instead. " +"(Contributed by Nikita Sobolev in :gh:`96580`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1290 +msgid "configparser" msgstr "" -#: ../../whatsnew/3.12.rst:1255 +#: ../../whatsnew/3.12.rst:1292 msgid "" -":mod:`configparser`: Several names deprecated in the :mod:`configparser` way " -"back in 3.2 have been removed per :gh:`89336`:" +"Several names deprecated in the :mod:`configparser` way back in 3.2 have " +"been removed per :gh:`89336`:" msgstr "" -#: ../../whatsnew/3.12.rst:1258 +#: ../../whatsnew/3.12.rst:1295 msgid "" ":class:`configparser.ParsingError` no longer has a ``filename`` attribute or " "argument. Use the ``source`` attribute and argument instead." msgstr "" -#: ../../whatsnew/3.12.rst:1260 +#: ../../whatsnew/3.12.rst:1297 msgid "" ":mod:`configparser` no longer has a ``SafeConfigParser`` class. Use the " "shorter :class:`~configparser.ConfigParser` name instead." msgstr "" -#: ../../whatsnew/3.12.rst:1262 +#: ../../whatsnew/3.12.rst:1299 msgid "" ":class:`configparser.ConfigParser` no longer has a ``readfp`` method. Use :" "meth:`~configparser.ConfigParser.read_file` instead." msgstr "" -#: ../../whatsnew/3.12.rst:1265 +#: ../../whatsnew/3.12.rst:1303 +msgid "distutils" +msgstr "" + +#: ../../whatsnew/3.12.rst:1305 msgid "" -"``distutils``: Remove the ``distutils`` package. It was deprecated in Python " -"3.10 by :pep:`632` \"Deprecate distutils module\". For projects still using " +"Remove the :py:mod:`!distutils` package. It was deprecated in Python 3.10 " +"by :pep:`632` \"Deprecate distutils module\". For projects still using " "``distutils`` and cannot be updated to something else, the ``setuptools`` " "project can be installed: it still provides ``distutils``. (Contributed by " "Victor Stinner in :gh:`92584`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1271 +#: ../../whatsnew/3.12.rst:1312 +msgid "ensurepip" +msgstr "" + +#: ../../whatsnew/3.12.rst:1314 msgid "" -":mod:`ensurepip`: Remove the bundled setuptools wheel from :mod:`ensurepip`, " -"and stop installing setuptools in environments created by :mod:`venv`." +"Remove the bundled setuptools wheel from :mod:`ensurepip`, and stop " +"installing setuptools in environments created by :mod:`venv`." msgstr "" -#: ../../whatsnew/3.12.rst:1274 +#: ../../whatsnew/3.12.rst:1317 msgid "" "``pip (>= 22.1)`` does not require setuptools to be installed in the " "environment. ``setuptools``-based (and ``distutils``-based) packages can " @@ -1808,7 +1867,7 @@ msgid "" "the build environment it uses for building a package." msgstr "" -#: ../../whatsnew/3.12.rst:1280 +#: ../../whatsnew/3.12.rst:1323 msgid "" "``easy_install``, ``pkg_resources``, ``setuptools`` and ``distutils`` are no " "longer provided by default in environments created with ``venv`` or " @@ -1818,228 +1877,253 @@ msgid "" "(typically, using pip)." msgstr "" -#: ../../whatsnew/3.12.rst:1287 +#: ../../whatsnew/3.12.rst:1330 msgid "(Contributed by Pradyun Gedam in :gh:`95299`.)" msgstr "(由 Pradyun Gedam 於 :gh:`95299` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1289 +#: ../../whatsnew/3.12.rst:1333 +msgid "enum" +msgstr "" + +#: ../../whatsnew/3.12.rst:1335 msgid "" -":mod:`enum`: Remove ``EnumMeta.__getattr__``, which is no longer needed for " +"Remove :mod:`enum`'s ``EnumMeta.__getattr__``, which is no longer needed for " "enum attribute access. (Contributed by Ethan Furman in :gh:`95083`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1293 +#: ../../whatsnew/3.12.rst:1340 +msgid "ftplib" +msgstr "" + +#: ../../whatsnew/3.12.rst:1342 msgid "" -":mod:`ftplib`: Remove the ``FTP_TLS.ssl_version`` class attribute: use the " +"Remove :mod:`ftplib`'s ``FTP_TLS.ssl_version`` class attribute: use the " "*context* parameter instead. (Contributed by Victor Stinner in :gh:`94172`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1297 +#: ../../whatsnew/3.12.rst:1347 +msgid "gzip" +msgstr "" + +#: ../../whatsnew/3.12.rst:1349 msgid "" -":mod:`gzip`: Remove the ``filename`` attribute of :class:`gzip.GzipFile`, " +"Remove the ``filename`` attribute of :mod:`gzip`'s :class:`gzip.GzipFile`, " "deprecated since Python 2.6, use the :attr:`~gzip.GzipFile.name` attribute " "instead. In write mode, the ``filename`` attribute added ``'.gz'`` file " "extension if it was not present. (Contributed by Victor Stinner in :gh:" "`94196`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1303 +#: ../../whatsnew/3.12.rst:1356 +msgid "hashlib" +msgstr "" + +#: ../../whatsnew/3.12.rst:1358 msgid "" -":mod:`hashlib`: Remove the pure Python implementation of :func:`hashlib." +"Remove the pure Python implementation of :mod:`hashlib`'s :func:`hashlib." "pbkdf2_hmac()`, deprecated in Python 3.10. Python 3.10 and newer requires " "OpenSSL 1.1.1 (:pep:`644`): this OpenSSL version provides a C implementation " "of :func:`~hashlib.pbkdf2_hmac()` which is faster. (Contributed by Victor " "Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1309 +#: ../../whatsnew/3.12.rst:1365 ../../whatsnew/3.12.rst:1392 +msgid "importlib" +msgstr "importlib" + +#: ../../whatsnew/3.12.rst:1367 msgid "" -":mod:`importlib`: Many previously deprecated cleanups in :mod:`importlib` " -"have now been completed:" +"Many previously deprecated cleanups in :mod:`importlib` have now been " +"completed:" msgstr "" -#: ../../whatsnew/3.12.rst:1312 +#: ../../whatsnew/3.12.rst:1370 msgid "" "References to, and support for :meth:`!module_repr()` has been removed. " "(Contributed by Barry Warsaw in :gh:`97850`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1315 +#: ../../whatsnew/3.12.rst:1373 msgid "" -"``importlib.util.set_package`` has been removed. (Contributed by Brett " -"Cannon in :gh:`65961`.)" +"``importlib.util.set_package``, ``importlib.util.set_loader`` and " +"``importlib.util.module_for_loader`` have all been removed. (Contributed by " +"Brett Cannon and Nikita Sobolev in :gh:`65961` and :gh:`97850`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1318 +#: ../../whatsnew/3.12.rst:1377 msgid "" "Support for ``find_loader()`` and ``find_module()`` APIs have been removed. " "(Contributed by Barry Warsaw in :gh:`98040`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1321 +#: ../../whatsnew/3.12.rst:1380 msgid "" "``importlib.abc.Finder``, ``pkgutil.ImpImporter``, and ``pkgutil.ImpLoader`` " "have been removed. (Contributed by Barry Warsaw in :gh:`98040`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1324 +#: ../../whatsnew/3.12.rst:1384 ../../whatsnew/3.12.rst:1392 +msgid "imp" +msgstr "imp" + +#: ../../whatsnew/3.12.rst:1386 msgid "" "The :mod:`!imp` module has been removed. (Contributed by Barry Warsaw in :" "gh:`98040`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1327 +#: ../../whatsnew/3.12.rst:1389 msgid "Replace removed :mod:`!imp` functions with :mod:`importlib` functions:" msgstr "" -#: ../../whatsnew/3.12.rst:1330 -msgid "imp" -msgstr "imp" - -#: ../../whatsnew/3.12.rst:1330 -msgid "importlib" -msgstr "importlib" - -#: ../../whatsnew/3.12.rst:1332 +#: ../../whatsnew/3.12.rst:1394 msgid "``imp.NullImporter``" msgstr "``imp.NullImporter``" -#: ../../whatsnew/3.12.rst:1332 +#: ../../whatsnew/3.12.rst:1394 msgid "Insert ``None`` into ``sys.path_importer_cache``" msgstr "" -#: ../../whatsnew/3.12.rst:1333 +#: ../../whatsnew/3.12.rst:1395 msgid "``imp.cache_from_source()``" msgstr "``imp.cache_from_source()``" -#: ../../whatsnew/3.12.rst:1333 +#: ../../whatsnew/3.12.rst:1395 msgid ":func:`importlib.util.cache_from_source`" msgstr ":func:`importlib.util.cache_from_source`" -#: ../../whatsnew/3.12.rst:1334 +#: ../../whatsnew/3.12.rst:1396 msgid "``imp.find_module()``" msgstr "``imp.find_module()``" -#: ../../whatsnew/3.12.rst:1334 +#: ../../whatsnew/3.12.rst:1396 msgid ":func:`importlib.util.find_spec`" msgstr ":func:`importlib.util.find_spec`" -#: ../../whatsnew/3.12.rst:1335 +#: ../../whatsnew/3.12.rst:1397 msgid "``imp.get_magic()``" msgstr "``imp.get_magic()``" -#: ../../whatsnew/3.12.rst:1335 +#: ../../whatsnew/3.12.rst:1397 msgid ":attr:`importlib.util.MAGIC_NUMBER`" msgstr ":attr:`importlib.util.MAGIC_NUMBER`" -#: ../../whatsnew/3.12.rst:1336 +#: ../../whatsnew/3.12.rst:1398 msgid "``imp.get_suffixes()``" msgstr "``imp.get_suffixes()``" -#: ../../whatsnew/3.12.rst:1336 +#: ../../whatsnew/3.12.rst:1398 msgid "" ":attr:`importlib.machinery.SOURCE_SUFFIXES`, :attr:`importlib.machinery." "EXTENSION_SUFFIXES`, and :attr:`importlib.machinery.BYTECODE_SUFFIXES`" msgstr "" -#: ../../whatsnew/3.12.rst:1337 +#: ../../whatsnew/3.12.rst:1399 msgid "``imp.get_tag()``" msgstr "``imp.get_tag()``" -#: ../../whatsnew/3.12.rst:1337 +#: ../../whatsnew/3.12.rst:1399 msgid ":attr:`sys.implementation.cache_tag `" msgstr ":attr:`sys.implementation.cache_tag `" -#: ../../whatsnew/3.12.rst:1338 +#: ../../whatsnew/3.12.rst:1400 msgid "``imp.load_module()``" msgstr "``imp.load_module()``" -#: ../../whatsnew/3.12.rst:1338 +#: ../../whatsnew/3.12.rst:1400 msgid ":func:`importlib.import_module`" msgstr ":func:`importlib.import_module`" -#: ../../whatsnew/3.12.rst:1339 +#: ../../whatsnew/3.12.rst:1401 msgid "``imp.new_module(name)``" msgstr "``imp.new_module(name)``" -#: ../../whatsnew/3.12.rst:1339 +#: ../../whatsnew/3.12.rst:1401 msgid "``types.ModuleType(name)``" msgstr "``types.ModuleType(name)``" -#: ../../whatsnew/3.12.rst:1340 +#: ../../whatsnew/3.12.rst:1402 msgid "``imp.reload()``" msgstr "``imp.reload()``" -#: ../../whatsnew/3.12.rst:1340 +#: ../../whatsnew/3.12.rst:1402 msgid ":func:`importlib.reload`" msgstr ":func:`importlib.reload`" -#: ../../whatsnew/3.12.rst:1341 +#: ../../whatsnew/3.12.rst:1403 msgid "``imp.source_from_cache()``" msgstr "``imp.source_from_cache()``" -#: ../../whatsnew/3.12.rst:1341 +#: ../../whatsnew/3.12.rst:1403 msgid ":func:`importlib.util.source_from_cache`" msgstr ":func:`importlib.util.source_from_cache`" -#: ../../whatsnew/3.12.rst:1344 +#: ../../whatsnew/3.12.rst:1406 msgid "Replace ``imp.load_source()`` with::" msgstr "" -#: ../../whatsnew/3.12.rst:1359 +#: ../../whatsnew/3.12.rst:1421 msgid "Removed :mod:`!imp` functions and attributes with no replacements:" msgstr "" -#: ../../whatsnew/3.12.rst:1361 +#: ../../whatsnew/3.12.rst:1423 msgid "undocumented functions:" msgstr "" -#: ../../whatsnew/3.12.rst:1363 +#: ../../whatsnew/3.12.rst:1425 msgid "``imp.init_builtin()``" msgstr "``imp.init_builtin()``" -#: ../../whatsnew/3.12.rst:1364 +#: ../../whatsnew/3.12.rst:1426 msgid "``imp.load_compiled()``" msgstr "``imp.load_compiled()``" -#: ../../whatsnew/3.12.rst:1365 +#: ../../whatsnew/3.12.rst:1427 msgid "``imp.load_dynamic()``" msgstr "``imp.load_dynamic()``" -#: ../../whatsnew/3.12.rst:1366 +#: ../../whatsnew/3.12.rst:1428 msgid "``imp.load_package()``" msgstr "``imp.load_package()``" -#: ../../whatsnew/3.12.rst:1368 +#: ../../whatsnew/3.12.rst:1430 msgid "" "``imp.lock_held()``, ``imp.acquire_lock()``, ``imp.release_lock()``: the " "locking scheme has changed in Python 3.3 to per-module locks." msgstr "" -#: ../../whatsnew/3.12.rst:1370 +#: ../../whatsnew/3.12.rst:1432 msgid "" "``imp.find_module()`` constants: ``SEARCH_ERROR``, ``PY_SOURCE``, " "``PY_COMPILED``, ``C_EXTENSION``, ``PY_RESOURCE``, ``PKG_DIRECTORY``, " "``C_BUILTIN``, ``PY_FROZEN``, ``PY_CODERESOURCE``, ``IMP_HOOK``." msgstr "" -#: ../../whatsnew/3.12.rst:1374 +#: ../../whatsnew/3.12.rst:1437 +msgid "io" +msgstr "" + +#: ../../whatsnew/3.12.rst:1439 msgid "" -":mod:`io`: Remove ``io.OpenWrapper`` and ``_pyio.OpenWrapper``, deprecated " +"Remove :mod:`io`'s ``io.OpenWrapper`` and ``_pyio.OpenWrapper``, deprecated " "in Python 3.10: just use :func:`open` instead. The :func:`open` (:func:`io." "open`) function is a built-in function. Since Python 3.10, :func:`!_pyio." "open` is also a static method. (Contributed by Victor Stinner in :gh:" "`94169`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1380 +#: ../../whatsnew/3.12.rst:1446 +msgid "locale" +msgstr "" + +#: ../../whatsnew/3.12.rst:1448 msgid "" -":mod:`locale`: Remove the :func:`!locale.format` function, deprecated in " -"Python 3.7: use :func:`locale.format_string` instead. (Contributed by Victor " +"Remove :mod:`locale`'s :func:`!locale.format` function, deprecated in Python " +"3.7: use :func:`locale.format_string` instead. (Contributed by Victor " "Stinner in :gh:`94226`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1384 +#: ../../whatsnew/3.12.rst:1452 msgid "" "``smtpd``: The module has been removed according to the schedule in :pep:" "`594`, having been deprecated in Python 3.4.7 and 3.5.4. Use aiosmtpd_ PyPI " @@ -2047,27 +2131,27 @@ msgid "" "Oleg Iarygin in :gh:`93243`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1392 +#: ../../whatsnew/3.12.rst:1463 msgid "" -":mod:`sqlite3`: The following undocumented :mod:`sqlite3` features, " -"deprecated in Python 3.10, are now removed:" +"The following undocumented :mod:`sqlite3` features, deprecated in Python " +"3.10, are now removed:" msgstr "" -#: ../../whatsnew/3.12.rst:1395 +#: ../../whatsnew/3.12.rst:1466 msgid "``sqlite3.enable_shared_cache()``" msgstr "``sqlite3.enable_shared_cache()``" -#: ../../whatsnew/3.12.rst:1396 +#: ../../whatsnew/3.12.rst:1467 msgid "``sqlite3.OptimizedUnicode``" msgstr "``sqlite3.OptimizedUnicode``" -#: ../../whatsnew/3.12.rst:1398 +#: ../../whatsnew/3.12.rst:1469 msgid "" "If a shared cache must be used, open the database in URI mode using the " "``cache=shared`` query parameter." msgstr "" -#: ../../whatsnew/3.12.rst:1401 +#: ../../whatsnew/3.12.rst:1472 msgid "" "The ``sqlite3.OptimizedUnicode`` text factory has been an alias for :class:" "`str` since Python 3.3. Code that previously set the text factory to " @@ -2075,22 +2159,22 @@ msgid "" "default value which is also ``str``." msgstr "" -#: ../../whatsnew/3.12.rst:1406 +#: ../../whatsnew/3.12.rst:1477 msgid "(Contributed by Erlend E. Aasland in :gh:`92548`.)" msgstr "(由 Erlend E. Aasland 於 :gh:`92548` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1408 -msgid ":mod:`ssl`:" +#: ../../whatsnew/3.12.rst:1480 +msgid "ssl" msgstr "" -#: ../../whatsnew/3.12.rst:1410 +#: ../../whatsnew/3.12.rst:1482 msgid "" -"Remove the :func:`!ssl.RAND_pseudo_bytes` function, deprecated in Python " -"3.6: use :func:`os.urandom` or :func:`ssl.RAND_bytes` instead. (Contributed " -"by Victor Stinner in :gh:`94199`.)" +"Remove :mod:`ssl`'s :func:`!ssl.RAND_pseudo_bytes` function, deprecated in " +"Python 3.6: use :func:`os.urandom` or :func:`ssl.RAND_bytes` instead. " +"(Contributed by Victor Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1414 +#: ../../whatsnew/3.12.rst:1486 msgid "" "Remove the :func:`!ssl.match_hostname` function. It was deprecated in Python " "3.7. OpenSSL performs hostname matching since Python 3.7, Python no longer " @@ -2098,7 +2182,7 @@ msgid "" "Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1420 +#: ../../whatsnew/3.12.rst:1492 msgid "" "Remove the :func:`!ssl.wrap_socket` function, deprecated in Python 3.7: " "instead, create a :class:`ssl.SSLContext` object and call its :class:`ssl." @@ -2109,205 +2193,220 @@ msgid "" "Validation. (Contributed by Victor Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1429 -msgid ":mod:`unittest`: Removed many old deprecated :mod:`unittest` features:" +#: ../../whatsnew/3.12.rst:1504 +msgid "Removed many old deprecated :mod:`unittest` features:" msgstr "" -#: ../../whatsnew/3.12.rst:1431 +#: ../../whatsnew/3.12.rst:1506 msgid "A number of :class:`~unittest.TestCase` method aliases:" msgstr "" -#: ../../whatsnew/3.12.rst:1434 +#: ../../whatsnew/3.12.rst:1509 msgid "Deprecated alias" msgstr "" -#: ../../whatsnew/3.12.rst:1434 +#: ../../whatsnew/3.12.rst:1509 msgid "Method Name" msgstr "" -#: ../../whatsnew/3.12.rst:1434 +#: ../../whatsnew/3.12.rst:1509 msgid "Deprecated in" msgstr "" -#: ../../whatsnew/3.12.rst:1436 +#: ../../whatsnew/3.12.rst:1511 msgid "``failUnless``" msgstr "``failUnless``" -#: ../../whatsnew/3.12.rst:1436 ../../whatsnew/3.12.rst:1443 +#: ../../whatsnew/3.12.rst:1511 ../../whatsnew/3.12.rst:1518 msgid ":meth:`.assertTrue`" msgstr ":meth:`.assertTrue`" -#: ../../whatsnew/3.12.rst:1436 ../../whatsnew/3.12.rst:1437 -#: ../../whatsnew/3.12.rst:1438 ../../whatsnew/3.12.rst:1439 -#: ../../whatsnew/3.12.rst:1440 ../../whatsnew/3.12.rst:1441 -#: ../../whatsnew/3.12.rst:1442 +#: ../../whatsnew/3.12.rst:1511 ../../whatsnew/3.12.rst:1512 +#: ../../whatsnew/3.12.rst:1513 ../../whatsnew/3.12.rst:1514 +#: ../../whatsnew/3.12.rst:1515 ../../whatsnew/3.12.rst:1516 +#: ../../whatsnew/3.12.rst:1517 msgid "3.1" msgstr "3.1" -#: ../../whatsnew/3.12.rst:1437 +#: ../../whatsnew/3.12.rst:1512 msgid "``failIf``" msgstr "``failIf``" -#: ../../whatsnew/3.12.rst:1437 +#: ../../whatsnew/3.12.rst:1512 msgid ":meth:`.assertFalse`" msgstr ":meth:`.assertFalse`" -#: ../../whatsnew/3.12.rst:1438 +#: ../../whatsnew/3.12.rst:1513 msgid "``failUnlessEqual``" msgstr "``failUnlessEqual``" -#: ../../whatsnew/3.12.rst:1438 ../../whatsnew/3.12.rst:1444 +#: ../../whatsnew/3.12.rst:1513 ../../whatsnew/3.12.rst:1519 msgid ":meth:`.assertEqual`" msgstr ":meth:`.assertEqual`" -#: ../../whatsnew/3.12.rst:1439 +#: ../../whatsnew/3.12.rst:1514 msgid "``failIfEqual``" msgstr "``failIfEqual``" -#: ../../whatsnew/3.12.rst:1439 ../../whatsnew/3.12.rst:1445 +#: ../../whatsnew/3.12.rst:1514 ../../whatsnew/3.12.rst:1520 msgid ":meth:`.assertNotEqual`" msgstr ":meth:`.assertNotEqual`" -#: ../../whatsnew/3.12.rst:1440 +#: ../../whatsnew/3.12.rst:1515 msgid "``failUnlessAlmostEqual``" msgstr "``failUnlessAlmostEqual``" -#: ../../whatsnew/3.12.rst:1440 ../../whatsnew/3.12.rst:1446 +#: ../../whatsnew/3.12.rst:1515 ../../whatsnew/3.12.rst:1521 msgid ":meth:`.assertAlmostEqual`" msgstr ":meth:`.assertAlmostEqual`" -#: ../../whatsnew/3.12.rst:1441 +#: ../../whatsnew/3.12.rst:1516 msgid "``failIfAlmostEqual``" msgstr "``failIfAlmostEqual``" -#: ../../whatsnew/3.12.rst:1441 ../../whatsnew/3.12.rst:1447 +#: ../../whatsnew/3.12.rst:1516 ../../whatsnew/3.12.rst:1522 msgid ":meth:`.assertNotAlmostEqual`" msgstr ":meth:`.assertNotAlmostEqual`" -#: ../../whatsnew/3.12.rst:1442 +#: ../../whatsnew/3.12.rst:1517 msgid "``failUnlessRaises``" msgstr "``failUnlessRaises``" -#: ../../whatsnew/3.12.rst:1442 +#: ../../whatsnew/3.12.rst:1517 msgid ":meth:`.assertRaises`" msgstr ":meth:`.assertRaises`" -#: ../../whatsnew/3.12.rst:1443 +#: ../../whatsnew/3.12.rst:1518 msgid "``assert_``" msgstr "``assert_``" -#: ../../whatsnew/3.12.rst:1443 ../../whatsnew/3.12.rst:1444 -#: ../../whatsnew/3.12.rst:1445 ../../whatsnew/3.12.rst:1446 -#: ../../whatsnew/3.12.rst:1447 ../../whatsnew/3.12.rst:1448 -#: ../../whatsnew/3.12.rst:1449 +#: ../../whatsnew/3.12.rst:1518 ../../whatsnew/3.12.rst:1519 +#: ../../whatsnew/3.12.rst:1520 ../../whatsnew/3.12.rst:1521 +#: ../../whatsnew/3.12.rst:1522 ../../whatsnew/3.12.rst:1523 +#: ../../whatsnew/3.12.rst:1524 msgid "3.2" msgstr "3.2" -#: ../../whatsnew/3.12.rst:1444 +#: ../../whatsnew/3.12.rst:1519 msgid "``assertEquals``" msgstr "``assertEquals``" -#: ../../whatsnew/3.12.rst:1445 +#: ../../whatsnew/3.12.rst:1520 msgid "``assertNotEquals``" msgstr "``assertNotEquals``" -#: ../../whatsnew/3.12.rst:1446 +#: ../../whatsnew/3.12.rst:1521 msgid "``assertAlmostEquals``" msgstr "``assertAlmostEquals``" -#: ../../whatsnew/3.12.rst:1447 +#: ../../whatsnew/3.12.rst:1522 msgid "``assertNotAlmostEquals``" msgstr "``assertNotAlmostEquals``" -#: ../../whatsnew/3.12.rst:1448 +#: ../../whatsnew/3.12.rst:1523 msgid "``assertRegexpMatches``" msgstr "``assertRegexpMatches``" -#: ../../whatsnew/3.12.rst:1448 +#: ../../whatsnew/3.12.rst:1523 msgid ":meth:`.assertRegex`" msgstr ":meth:`.assertRegex`" -#: ../../whatsnew/3.12.rst:1449 +#: ../../whatsnew/3.12.rst:1524 msgid "``assertRaisesRegexp``" msgstr "``assertRaisesRegexp``" -#: ../../whatsnew/3.12.rst:1449 +#: ../../whatsnew/3.12.rst:1524 msgid ":meth:`.assertRaisesRegex`" msgstr ":meth:`.assertRaisesRegex`" -#: ../../whatsnew/3.12.rst:1450 +#: ../../whatsnew/3.12.rst:1525 msgid "``assertNotRegexpMatches``" msgstr "``assertNotRegexpMatches``" -#: ../../whatsnew/3.12.rst:1450 +#: ../../whatsnew/3.12.rst:1525 msgid ":meth:`.assertNotRegex`" msgstr ":meth:`.assertNotRegex`" -#: ../../whatsnew/3.12.rst:1450 +#: ../../whatsnew/3.12.rst:1525 msgid "3.5" msgstr "3.5" -#: ../../whatsnew/3.12.rst:1453 +#: ../../whatsnew/3.12.rst:1528 msgid "" "You can use https://github.com/isidentical/teyit to automatically modernise " "your unit tests." msgstr "" -#: ../../whatsnew/3.12.rst:1456 +#: ../../whatsnew/3.12.rst:1531 msgid "" "Undocumented and broken :class:`~unittest.TestCase` method " "``assertDictContainsSubset`` (deprecated in Python 3.2)." msgstr "" -#: ../../whatsnew/3.12.rst:1459 +#: ../../whatsnew/3.12.rst:1534 msgid "" "Undocumented :meth:`TestLoader.loadTestsFromModule ` parameter *use_load_tests* (deprecated and ignored " "since Python 3.2)." msgstr "" -#: ../../whatsnew/3.12.rst:1463 +#: ../../whatsnew/3.12.rst:1538 msgid "" "An alias of the :class:`~unittest.TextTestResult` class: ``_TextTestResult`` " "(deprecated in Python 3.2)." msgstr "" -#: ../../whatsnew/3.12.rst:1466 +#: ../../whatsnew/3.12.rst:1541 msgid "(Contributed by Serhiy Storchaka in :issue:`45162`.)" msgstr "(由 Serhiy Storchaka 於 :issue:`45162` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1468 +#: ../../whatsnew/3.12.rst:1544 +msgid "webbrowser" +msgstr "" + +#: ../../whatsnew/3.12.rst:1546 msgid "" -":mod:`webbrowser`: Remove support for obsolete browsers from :mod:" -"`webbrowser`. Removed browsers include: Grail, Mosaic, Netscape, Galeon, " -"Skipstone, Iceape, Firebird, and Firefox versions 35 and below (:gh:" -"`102871`)." +"Remove support for obsolete browsers from :mod:`webbrowser`. Removed " +"browsers include: Grail, Mosaic, Netscape, Galeon, Skipstone, Iceape, " +"Firebird, and Firefox versions 35 and below (:gh:`102871`)." msgstr "" -#: ../../whatsnew/3.12.rst:1472 +#: ../../whatsnew/3.12.rst:1551 +msgid "xml.etree.ElementTree" +msgstr "" + +#: ../../whatsnew/3.12.rst:1553 msgid "" -":mod:`xml.etree.ElementTree`: Remove the ``ElementTree.Element.copy()`` " -"method of the pure Python implementation, deprecated in Python 3.10, use " -"the :func:`copy.copy` function instead. The C implementation of :mod:`xml." -"etree.ElementTree` has no ``copy()`` method, only a ``__copy__()`` method. " -"(Contributed by Victor Stinner in :gh:`94383`.)" +"Remove the ``ElementTree.Element.copy()`` method of the pure Python " +"implementation, deprecated in Python 3.10, use the :func:`copy.copy` " +"function instead. The C implementation of :mod:`xml.etree.ElementTree` has " +"no ``copy()`` method, only a ``__copy__()`` method. (Contributed by Victor " +"Stinner in :gh:`94383`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1560 +msgid "zipimport" msgstr "" -#: ../../whatsnew/3.12.rst:1478 +#: ../../whatsnew/3.12.rst:1562 msgid "" -":mod:`zipimport`: Remove ``find_loader()`` and ``find_module()`` methods, " +"Remove :mod:`zipimport`'s ``find_loader()`` and ``find_module()`` methods, " "deprecated in Python 3.10: use the ``find_spec()`` method instead. See :pep:" "`451` for the rationale. (Contributed by Victor Stinner in :gh:`94379`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1483 +#: ../../whatsnew/3.12.rst:1568 +msgid "Others" +msgstr "" + +#: ../../whatsnew/3.12.rst:1570 msgid "" "Removed the ``suspicious`` rule from the documentation Makefile, and removed " "``Doc/tools/rstlint.py``, both in favor of `sphinx-lint `_. (Contributed by Julien Palard in :gh:`98179`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1488 +#: ../../whatsnew/3.12.rst:1575 msgid "" "Remove the *keyfile* and *certfile* parameters from the :mod:`ftplib`, :mod:" "`imaplib`, :mod:`poplib` and :mod:`smtplib` modules, and the *key_file*, " @@ -2317,21 +2416,21 @@ msgid "" "in :gh:`94172`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1499 ../../whatsnew/3.12.rst:1811 +#: ../../whatsnew/3.12.rst:1586 ../../whatsnew/3.12.rst:1898 msgid "Porting to Python 3.12" msgstr "" -#: ../../whatsnew/3.12.rst:1501 +#: ../../whatsnew/3.12.rst:1588 msgid "" "This section lists previously described changes and other bugfixes that may " "require changes to your code." msgstr "" -#: ../../whatsnew/3.12.rst:1505 +#: ../../whatsnew/3.12.rst:1592 msgid "Changes in the Python API" msgstr "" -#: ../../whatsnew/3.12.rst:1507 +#: ../../whatsnew/3.12.rst:1594 msgid "" "More strict rules are now applied for numerical group references and group " "names in regular expressions. Only sequence of ASCII digits is now accepted " @@ -2340,7 +2439,7 @@ msgid "" "(Contributed by Serhiy Storchaka in :gh:`91760`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1514 +#: ../../whatsnew/3.12.rst:1601 msgid "" "Removed ``randrange()`` functionality deprecated since Python 3.10. " "Formerly, ``randrange(10.0)`` losslessly converted to ``randrange(10)``. " @@ -2352,7 +2451,7 @@ msgid "" "`86388`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1522 +#: ../../whatsnew/3.12.rst:1609 msgid "" ":class:`argparse.ArgumentParser` changed encoding and error handler for " "reading arguments from file (e.g. ``fromfile_prefix_chars`` option) from " @@ -2362,21 +2461,21 @@ msgid "" "on Windows." msgstr "" -#: ../../whatsnew/3.12.rst:1528 +#: ../../whatsnew/3.12.rst:1615 msgid "" "Removed the ``asyncore``-based ``smtpd`` module deprecated in Python 3.4.7 " "and 3.5.4. A recommended replacement is the :mod:`asyncio`-based aiosmtpd_ " "PyPI module." msgstr "" -#: ../../whatsnew/3.12.rst:1532 +#: ../../whatsnew/3.12.rst:1619 msgid "" ":func:`shlex.split`: Passing ``None`` for *s* argument now raises an " "exception, rather than reading :data:`sys.stdin`. The feature was deprecated " "in Python 3.9. (Contributed by Victor Stinner in :gh:`94352`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1537 +#: ../../whatsnew/3.12.rst:1624 msgid "" "The :mod:`os` module no longer accepts bytes-like paths, like :class:" "`bytearray` and :class:`memoryview` types: only the exact :class:`bytes` " @@ -2384,7 +2483,7 @@ msgid "" "`98393`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1542 +#: ../../whatsnew/3.12.rst:1629 msgid "" ":func:`syslog.openlog` and :func:`syslog.closelog` now fail if used in " "subinterpreters. :func:`syslog.syslog` may still be used in subinterpreters, " @@ -2396,7 +2495,7 @@ msgid "" "(Contributed by Dong-hee Na in :gh:`99127`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1551 +#: ../../whatsnew/3.12.rst:1638 msgid "" "The undocumented locking behavior of :func:`~functools.cached_property` is " "removed, because it locked across all instances of the class, leading to " @@ -2408,64 +2507,64 @@ msgid "" "property getter function or around multi-threaded access points." msgstr "" -#: ../../whatsnew/3.12.rst:1564 +#: ../../whatsnew/3.12.rst:1651 msgid "" "When extracting tar files using :mod:`tarfile` or :func:`shutil." "unpack_archive`, pass the *filter* argument to limit features that may be " "surprising or dangerous. See :ref:`tarfile-extraction-filter` for details." msgstr "" -#: ../../whatsnew/3.12.rst:1569 +#: ../../whatsnew/3.12.rst:1656 msgid "" "The output of the :func:`tokenize.tokenize` and :func:`tokenize." "generate_tokens` functions is now changed due to the changes introduced in :" "pep:`701`. This means that ``STRING`` tokens are not emitted any more for f-" "strings and the tokens described in :pep:`701` are now produced instead: " -"``FSTRING_START``, ``FSRING_MIDDLE`` and ``FSTRING_END`` are now emitted for " -"f-string \"string\" parts in addition to the appropriate tokens for the " +"``FSTRING_START``, ``FSTRING_MIDDLE`` and ``FSTRING_END`` are now emitted " +"for f-string \"string\" parts in addition to the appropriate tokens for the " "tokenization in the expression components. For example for the f-string " "``f\"start {1+1} end\"`` the old version of the tokenizer emitted::" msgstr "" -#: ../../whatsnew/3.12.rst:1580 +#: ../../whatsnew/3.12.rst:1667 msgid "while the new version emits::" msgstr "" -#: ../../whatsnew/3.12.rst:1592 +#: ../../whatsnew/3.12.rst:1679 msgid "" "Additionally, there may be some minor behavioral changes as a consequence of " "the changes required to support :pep:`701`. Some of these changes include:" msgstr "" -#: ../../whatsnew/3.12.rst:1595 +#: ../../whatsnew/3.12.rst:1682 msgid "" "The ``type`` attribute of the tokens emitted when tokenizing some invalid " "Python characters such as ``!`` has changed from ``ERRORTOKEN`` to ``OP``." msgstr "" -#: ../../whatsnew/3.12.rst:1598 +#: ../../whatsnew/3.12.rst:1685 msgid "" "Incomplete single-line strings now also raise :exc:`tokenize.TokenError` as " "incomplete multiline strings do." msgstr "" -#: ../../whatsnew/3.12.rst:1601 +#: ../../whatsnew/3.12.rst:1688 msgid "" "Some incomplete or invalid Python code now raises :exc:`tokenize.TokenError` " "instead of returning arbitrary ``ERRORTOKEN`` tokens when tokenizing it." msgstr "" -#: ../../whatsnew/3.12.rst:1604 +#: ../../whatsnew/3.12.rst:1691 msgid "" "Mixing tabs and spaces as indentation in the same file is not supported " "anymore and will raise a :exc:`TabError`." msgstr "" -#: ../../whatsnew/3.12.rst:1608 +#: ../../whatsnew/3.12.rst:1695 msgid "Build Changes" msgstr "" -#: ../../whatsnew/3.12.rst:1610 +#: ../../whatsnew/3.12.rst:1697 msgid "" "Python no longer uses ``setup.py`` to build shared C extension modules. " "Build parameters like headers and libraries are detected in ``configure`` " @@ -2474,21 +2573,21 @@ msgid "" "in :gh:`93939`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1616 +#: ../../whatsnew/3.12.rst:1703 msgid "" "``va_start()`` with two parameters, like ``va_start(args, format),`` is now " "required to build Python. ``va_start()`` is no longer called with a single " "parameter. (Contributed by Kumar Aditya in :gh:`93207`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1621 +#: ../../whatsnew/3.12.rst:1708 msgid "" "CPython now uses the ThinLTO option as the default link time optimization " "policy if the Clang compiler accepts the flag. (Contributed by Dong-hee Na " "in :gh:`89536`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1625 +#: ../../whatsnew/3.12.rst:1712 msgid "" "Add ``COMPILEALL_OPTS`` variable in Makefile to override :mod:`compileall` " "options (default: ``-j0``) in ``make install``. Also merged the 3 " @@ -2497,46 +2596,46 @@ msgid "" "`99289`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1631 +#: ../../whatsnew/3.12.rst:1718 msgid "Add platform triplets for 64-bit LoongArch:" msgstr "" -#: ../../whatsnew/3.12.rst:1633 +#: ../../whatsnew/3.12.rst:1720 msgid "loongarch64-linux-gnusf" msgstr "loongarch64-linux-gnusf" -#: ../../whatsnew/3.12.rst:1634 +#: ../../whatsnew/3.12.rst:1721 msgid "loongarch64-linux-gnuf32" msgstr "loongarch64-linux-gnuf32" -#: ../../whatsnew/3.12.rst:1635 +#: ../../whatsnew/3.12.rst:1722 msgid "loongarch64-linux-gnu" msgstr "loongarch64-linux-gnu" -#: ../../whatsnew/3.12.rst:1637 +#: ../../whatsnew/3.12.rst:1724 msgid "(Contributed by Zhang Na in :gh:`90656`.)" msgstr "(由 Zhang Na 於 :gh:`90656` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1639 +#: ../../whatsnew/3.12.rst:1726 msgid "``PYTHON_FOR_REGEN`` now require Python 3.10 or newer." msgstr "" -#: ../../whatsnew/3.12.rst:1641 +#: ../../whatsnew/3.12.rst:1728 msgid "" "Autoconf 2.71 and aclocal 1.16.4 is now required to regenerate :file:`!" "configure`. (Contributed by Christian Heimes in :gh:`89886`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1645 +#: ../../whatsnew/3.12.rst:1732 msgid "" "Windows builds and macOS installers from python.org now use OpenSSL 3.0." msgstr "" -#: ../../whatsnew/3.12.rst:1649 +#: ../../whatsnew/3.12.rst:1736 msgid "C API Changes" msgstr "" -#: ../../whatsnew/3.12.rst:1655 +#: ../../whatsnew/3.12.rst:1742 msgid "" ":pep:`697`: Introduced the :ref:`Unstable C API tier `, " "intended for low-level tools like debuggers and JIT compilers. This API may " @@ -2544,84 +2643,84 @@ msgid "" "contents are marked by the ``PyUnstable_`` prefix in names." msgstr "" -#: ../../whatsnew/3.12.rst:1661 +#: ../../whatsnew/3.12.rst:1748 msgid "Code object constructors:" msgstr "" -#: ../../whatsnew/3.12.rst:1663 +#: ../../whatsnew/3.12.rst:1750 msgid "``PyUnstable_Code_New()`` (renamed from ``PyCode_New``)" msgstr "" -#: ../../whatsnew/3.12.rst:1664 +#: ../../whatsnew/3.12.rst:1751 msgid "" "``PyUnstable_Code_NewWithPosOnlyArgs()`` (renamed from " "``PyCode_NewWithPosOnlyArgs``)" msgstr "" -#: ../../whatsnew/3.12.rst:1666 +#: ../../whatsnew/3.12.rst:1753 msgid "Extra storage for code objects (:pep:`523`):" msgstr "" -#: ../../whatsnew/3.12.rst:1668 +#: ../../whatsnew/3.12.rst:1755 msgid "" "``PyUnstable_Eval_RequestCodeExtraIndex()`` (renamed from " "``_PyEval_RequestCodeExtraIndex``)" msgstr "" -#: ../../whatsnew/3.12.rst:1669 +#: ../../whatsnew/3.12.rst:1756 msgid "``PyUnstable_Code_GetExtra()`` (renamed from ``_PyCode_GetExtra``)" msgstr "" -#: ../../whatsnew/3.12.rst:1670 +#: ../../whatsnew/3.12.rst:1757 msgid "``PyUnstable_Code_SetExtra()`` (renamed from ``_PyCode_SetExtra``)" msgstr "" -#: ../../whatsnew/3.12.rst:1672 +#: ../../whatsnew/3.12.rst:1759 msgid "" "The original names will continue to be available until the respective API " "changes." msgstr "" -#: ../../whatsnew/3.12.rst:1675 +#: ../../whatsnew/3.12.rst:1762 msgid "(Contributed by Petr Viktorin in :gh:`101101`.)" msgstr "(由 Petr Viktorin 於 :gh:`101101` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1677 +#: ../../whatsnew/3.12.rst:1764 msgid "" ":pep:`697`: Added API for extending types whose instance memory layout is " "opaque:" msgstr "" -#: ../../whatsnew/3.12.rst:1680 +#: ../../whatsnew/3.12.rst:1767 msgid "" ":c:member:`PyType_Spec.basicsize` can be zero or negative to specify " "inheriting or extending the base class size." msgstr "" -#: ../../whatsnew/3.12.rst:1682 +#: ../../whatsnew/3.12.rst:1769 msgid "" ":c:func:`PyObject_GetTypeData` and :c:func:`PyType_GetTypeDataSize` added to " "allow access to subclass-specific instance data." msgstr "" -#: ../../whatsnew/3.12.rst:1684 +#: ../../whatsnew/3.12.rst:1771 msgid "" ":c:macro:`Py_TPFLAGS_ITEMS_AT_END` and :c:func:`PyObject_GetItemData` added " "to allow safely extending certain variable-sized types, including :c:var:" "`PyType_Type`." msgstr "" -#: ../../whatsnew/3.12.rst:1687 +#: ../../whatsnew/3.12.rst:1774 msgid "" ":c:macro:`Py_RELATIVE_OFFSET` added to allow defining :c:type:`members " "` in terms of a subclass-specific struct." msgstr "" -#: ../../whatsnew/3.12.rst:1690 +#: ../../whatsnew/3.12.rst:1777 msgid "(Contributed by Petr Viktorin in :gh:`103509`.)" msgstr "(由 Petr Viktorin 於 :gh:`103509` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1692 +#: ../../whatsnew/3.12.rst:1779 msgid "" "Added the new :ref:`limited C API ` function :c:func:" "`PyType_FromMetaclass`, which generalizes the existing :c:func:" @@ -2629,29 +2728,29 @@ msgid "" "(Contributed by Wenzel Jakob in :gh:`93012`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1697 +#: ../../whatsnew/3.12.rst:1784 msgid "" "API for creating objects that can be called using :ref:`the vectorcall " "protocol ` was added to the :ref:`Limited API `:" msgstr "" -#: ../../whatsnew/3.12.rst:1701 +#: ../../whatsnew/3.12.rst:1788 msgid ":c:macro:`Py_TPFLAGS_HAVE_VECTORCALL`" msgstr "" -#: ../../whatsnew/3.12.rst:1702 +#: ../../whatsnew/3.12.rst:1789 msgid ":c:func:`PyVectorcall_NARGS`" msgstr ":c:func:`PyVectorcall_NARGS`" -#: ../../whatsnew/3.12.rst:1703 +#: ../../whatsnew/3.12.rst:1790 msgid ":c:func:`PyVectorcall_Call`" msgstr ":c:func:`PyVectorcall_Call`" -#: ../../whatsnew/3.12.rst:1704 +#: ../../whatsnew/3.12.rst:1791 msgid ":c:type:`vectorcallfunc`" msgstr ":c:type:`vectorcallfunc`" -#: ../../whatsnew/3.12.rst:1706 +#: ../../whatsnew/3.12.rst:1793 msgid "" "The :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` flag is now removed from a class " "when the class's :py:meth:`~object.__call__` method is reassigned. This " @@ -2662,7 +2761,7 @@ msgid "" "`93274`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1714 +#: ../../whatsnew/3.12.rst:1801 msgid "" "The :c:macro:`Py_TPFLAGS_MANAGED_DICT` and :c:macro:" "`Py_TPFLAGS_MANAGED_WEAKREF` flags have been added. This allows extensions " @@ -2670,32 +2769,32 @@ msgid "" "using less memory and with faster access." msgstr "" -#: ../../whatsnew/3.12.rst:1719 +#: ../../whatsnew/3.12.rst:1806 msgid "" "API for performing calls using :ref:`the vectorcall protocol ` " "was added to the :ref:`Limited API `:" msgstr "" -#: ../../whatsnew/3.12.rst:1723 +#: ../../whatsnew/3.12.rst:1810 msgid ":c:func:`PyObject_Vectorcall`" msgstr ":c:func:`PyObject_Vectorcall`" -#: ../../whatsnew/3.12.rst:1724 +#: ../../whatsnew/3.12.rst:1811 msgid ":c:func:`PyObject_VectorcallMethod`" msgstr ":c:func:`PyObject_VectorcallMethod`" -#: ../../whatsnew/3.12.rst:1725 +#: ../../whatsnew/3.12.rst:1812 msgid ":c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET`" msgstr "" -#: ../../whatsnew/3.12.rst:1727 +#: ../../whatsnew/3.12.rst:1814 msgid "" "This means that both the incoming and outgoing ends of the vector call " "protocol are now available in the :ref:`Limited API `. (Contributed " "by Wenzel Jakob in :gh:`98586`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1731 +#: ../../whatsnew/3.12.rst:1818 msgid "" "Added two new public functions, :c:func:`PyEval_SetProfileAllThreads` and :c:" "func:`PyEval_SetTraceAllThreads`, that allow to set tracing and profiling " @@ -2703,14 +2802,14 @@ msgid "" "(Contributed by Pablo Galindo in :gh:`93503`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1737 +#: ../../whatsnew/3.12.rst:1824 msgid "" "Added new function :c:func:`PyFunction_SetVectorcall` to the C API which " "sets the vectorcall field of a given :c:type:`PyFunctionObject`. " "(Contributed by Andrew Frost in :gh:`92257`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1741 +#: ../../whatsnew/3.12.rst:1828 msgid "" "The C API now permits registering callbacks via :c:func:" "`PyDict_AddWatcher`, :c:func:`PyDict_Watch` and related APIs to be called " @@ -2719,28 +2818,28 @@ msgid "" "`91052`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1747 +#: ../../whatsnew/3.12.rst:1834 msgid "" "Added :c:func:`PyType_AddWatcher` and :c:func:`PyType_Watch` API to register " "callbacks to receive notification on changes to a type. (Contributed by Carl " "Meyer in :gh:`91051`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1751 +#: ../../whatsnew/3.12.rst:1838 msgid "" "Added :c:func:`PyCode_AddWatcher` and :c:func:`PyCode_ClearWatcher` APIs to " "register callbacks to receive notification on creation and destruction of " "code objects. (Contributed by Itamar Ostricher in :gh:`91054`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1756 +#: ../../whatsnew/3.12.rst:1843 msgid "" "Add :c:func:`PyFrame_GetVar` and :c:func:`PyFrame_GetVarString` functions to " "get a frame variable by its name. (Contributed by Victor Stinner in :gh:" "`91248`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1760 +#: ../../whatsnew/3.12.rst:1847 msgid "" "Add :c:func:`PyErr_GetRaisedException` and :c:func:" "`PyErr_SetRaisedException` for saving and restoring the current exception. " @@ -2750,14 +2849,14 @@ msgid "" "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1768 +#: ../../whatsnew/3.12.rst:1855 msgid "" "Add ``_PyErr_ChainExceptions1``, which takes an exception instance, to " "replace the legacy-API ``_PyErr_ChainExceptions``, which is now deprecated. " "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1772 +#: ../../whatsnew/3.12.rst:1859 msgid "" "Add :c:func:`PyException_GetArgs` and :c:func:`PyException_SetArgs` as " "convenience functions for retrieving and modifying the :attr:`~BaseException." @@ -2765,71 +2864,71 @@ msgid "" "in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1777 +#: ../../whatsnew/3.12.rst:1864 msgid "" "Add :c:func:`PyErr_DisplayException`, which takes an exception instance, to " "replace the legacy-api :c:func:`!PyErr_Display`. (Contributed by Irit " "Katriel in :gh:`102755`)." msgstr "" -#: ../../whatsnew/3.12.rst:1781 +#: ../../whatsnew/3.12.rst:1868 msgid "" ":pep:`683`: Introduced Immortal Objects to Python which allows objects to " "bypass reference counts and introduced changes to the C-API:" msgstr "" -#: ../../whatsnew/3.12.rst:1784 +#: ../../whatsnew/3.12.rst:1871 msgid "``_Py_IMMORTAL_REFCNT``: The reference count that defines an object" msgstr "" -#: ../../whatsnew/3.12.rst:1785 +#: ../../whatsnew/3.12.rst:1872 msgid "as immortal." msgstr "" -#: ../../whatsnew/3.12.rst:1786 +#: ../../whatsnew/3.12.rst:1873 msgid "" "``_Py_IsImmortal`` Checks if an object has the immortal reference count." msgstr "" -#: ../../whatsnew/3.12.rst:1787 +#: ../../whatsnew/3.12.rst:1874 msgid "``PyObject_HEAD_INIT`` This will now initialize reference count to" msgstr "" -#: ../../whatsnew/3.12.rst:1788 +#: ../../whatsnew/3.12.rst:1875 msgid "``_Py_IMMORTAL_REFCNT`` when used with ``Py_BUILD_CORE``." msgstr "" -#: ../../whatsnew/3.12.rst:1789 +#: ../../whatsnew/3.12.rst:1876 msgid "``SSTATE_INTERNED_IMMORTAL`` An identifier for interned unicode objects" msgstr "" -#: ../../whatsnew/3.12.rst:1790 +#: ../../whatsnew/3.12.rst:1877 msgid "that are immortal." msgstr "" -#: ../../whatsnew/3.12.rst:1791 +#: ../../whatsnew/3.12.rst:1878 msgid "``SSTATE_INTERNED_IMMORTAL_STATIC`` An identifier for interned unicode" msgstr "" -#: ../../whatsnew/3.12.rst:1792 +#: ../../whatsnew/3.12.rst:1879 msgid "objects that are immortal and static" msgstr "" -#: ../../whatsnew/3.12.rst:1795 +#: ../../whatsnew/3.12.rst:1882 msgid "``sys.getunicodeinternedsize`` This returns the total number of unicode" msgstr "" -#: ../../whatsnew/3.12.rst:1794 +#: ../../whatsnew/3.12.rst:1881 msgid "" "objects that have been interned. This is now needed for refleak.py to " "correctly track reference counts and allocated blocks" msgstr "" -#: ../../whatsnew/3.12.rst:1797 +#: ../../whatsnew/3.12.rst:1884 msgid "(Contributed by Eddie Elizondo in :gh:`84436`.)" msgstr "(由 Eddie Elizondo 於 :gh:`84436` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1799 +#: ../../whatsnew/3.12.rst:1886 msgid "" ":pep:`684`: Added the new :c:func:`Py_NewInterpreterFromConfig` function " "and :c:type:`PyInterpreterConfig`, which may be used to create sub-" @@ -2837,27 +2936,27 @@ msgid "" "info.) (Contributed by Eric Snow in :gh:`104110`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1805 +#: ../../whatsnew/3.12.rst:1892 msgid "" "In the limited C API version 3.12, :c:func:`Py_INCREF` and :c:func:" "`Py_DECREF` functions are now implemented as opaque function calls to hide " "implementation details. (Contributed by Victor Stinner in :gh:`105387`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1813 +#: ../../whatsnew/3.12.rst:1900 msgid "" "Legacy Unicode APIs based on ``Py_UNICODE*`` representation has been " "removed. Please migrate to APIs based on UTF-8 or ``wchar_t*``." msgstr "" -#: ../../whatsnew/3.12.rst:1816 +#: ../../whatsnew/3.12.rst:1903 msgid "" "Argument parsing functions like :c:func:`PyArg_ParseTuple` doesn't support " "``Py_UNICODE*`` based format (e.g. ``u``, ``Z``) anymore. Please migrate to " "other formats for Unicode like ``s``, ``z``, ``es``, and ``U``." msgstr "" -#: ../../whatsnew/3.12.rst:1820 +#: ../../whatsnew/3.12.rst:1907 msgid "" "``tp_weaklist`` for all static builtin types is always ``NULL``. This is an " "internal-only field on ``PyTypeObject`` but we're pointing out the change in " @@ -2866,7 +2965,7 @@ msgid "" "necessary, the (internal-only) ``_PyObject_GET_WEAKREFS_LISTPTR()`` macro." msgstr "" -#: ../../whatsnew/3.12.rst:1827 +#: ../../whatsnew/3.12.rst:1914 msgid "" "This internal-only :c:member:`PyTypeObject.tp_subclasses` may now not be a " "valid object pointer. Its type was changed to :c:expr:`void *` to reflect " @@ -2874,13 +2973,13 @@ msgid "" "only field directly." msgstr "" -#: ../../whatsnew/3.12.rst:1832 +#: ../../whatsnew/3.12.rst:1919 msgid "" "To get a list of subclasses, call the Python method :py:meth:`~class." "__subclasses__` (using :c:func:`PyObject_CallMethod`, for example)." msgstr "" -#: ../../whatsnew/3.12.rst:1836 +#: ../../whatsnew/3.12.rst:1923 msgid "" "Add support of more formatting options (left aligning, octals, uppercase " "hexadecimals, :c:type:`intmax_t`, :c:type:`ptrdiff_t`, :c:type:`wchar_t` C " @@ -2889,7 +2988,7 @@ msgid "" "`98836`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1842 +#: ../../whatsnew/3.12.rst:1929 msgid "" "An unrecognized format character in :c:func:`PyUnicode_FromFormat` and :c:" "func:`PyUnicode_FromFormatV` now sets a :exc:`SystemError`. In previous " @@ -2898,13 +2997,13 @@ msgid "" "Storchaka in :gh:`95781`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1848 +#: ../../whatsnew/3.12.rst:1935 msgid "" "Fixed wrong sign placement in :c:func:`PyUnicode_FromFormat` and :c:func:" "`PyUnicode_FromFormatV`. (Contributed by Philip Georgi in :gh:`95504`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1852 +#: ../../whatsnew/3.12.rst:1939 msgid "" "Extension classes wanting to add a ``__dict__`` or weak reference slot " "should use :c:macro:`Py_TPFLAGS_MANAGED_DICT` and :c:macro:" @@ -2918,7 +3017,7 @@ msgid "" "func:`PyObject_ClearWeakRefs`, as before." msgstr "" -#: ../../whatsnew/3.12.rst:1864 +#: ../../whatsnew/3.12.rst:1951 msgid "" "The :c:func:`PyUnicode_FSDecoder` function no longer accepts bytes-like " "paths, like :class:`bytearray` and :class:`memoryview` types: only the " @@ -2926,7 +3025,7 @@ msgid "" "Victor Stinner in :gh:`98393`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1869 +#: ../../whatsnew/3.12.rst:1956 msgid "" "The :c:macro:`Py_CLEAR`, :c:macro:`Py_SETREF` and :c:macro:`Py_XSETREF` " "macros now only evaluate their arguments once. If an argument has side " @@ -2934,7 +3033,7 @@ msgid "" "Stinner in :gh:`98724`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1874 +#: ../../whatsnew/3.12.rst:1961 msgid "" "The interpreter's error indicator is now always normalized. This means that :" "c:func:`PyErr_SetObject`, :c:func:`PyErr_SetString` and the other functions " @@ -2942,7 +3041,7 @@ msgid "" "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1879 +#: ../../whatsnew/3.12.rst:1966 msgid "" "``_Py_RefTotal`` is no longer authoritative and only kept around for ABI " "compatibility. Note that it is an internal global and only available on " @@ -2950,25 +3049,25 @@ msgid "" "``_Py_GetGlobalRefTotal()``." msgstr "" -#: ../../whatsnew/3.12.rst:1884 +#: ../../whatsnew/3.12.rst:1971 msgid "" "The following functions now select an appropriate metaclass for the newly " "created type:" msgstr "" -#: ../../whatsnew/3.12.rst:1887 +#: ../../whatsnew/3.12.rst:1974 msgid ":c:func:`PyType_FromSpec`" msgstr ":c:func:`PyType_FromSpec`" -#: ../../whatsnew/3.12.rst:1888 +#: ../../whatsnew/3.12.rst:1975 msgid ":c:func:`PyType_FromSpecWithBases`" msgstr ":c:func:`PyType_FromSpecWithBases`" -#: ../../whatsnew/3.12.rst:1889 +#: ../../whatsnew/3.12.rst:1976 msgid ":c:func:`PyType_FromModuleAndSpec`" msgstr ":c:func:`PyType_FromModuleAndSpec`" -#: ../../whatsnew/3.12.rst:1891 +#: ../../whatsnew/3.12.rst:1978 msgid "" "Creating classes whose metaclass overrides :c:member:`~PyTypeObject.tp_new` " "is deprecated, and in Python 3.14+ it will be disallowed. Note that these " @@ -2976,14 +3075,14 @@ msgid "" "initialization." msgstr "" -#: ../../whatsnew/3.12.rst:1896 +#: ../../whatsnew/3.12.rst:1983 msgid "" "Note that :c:func:`PyType_FromMetaclass` (added in Python 3.12) already " "disallows creating classes whose metaclass overrides ``tp_new`` (:meth:" "`~object.__new__` in Python)." msgstr "" -#: ../../whatsnew/3.12.rst:1900 +#: ../../whatsnew/3.12.rst:1987 msgid "" "Since ``tp_new`` overrides almost everything ``PyType_From*`` functions do, " "the two are incompatible with each other. The existing behavior -- ignoring " @@ -2992,17 +3091,17 @@ msgid "" "general workaround. One of the following may work for you:" msgstr "" -#: ../../whatsnew/3.12.rst:1907 +#: ../../whatsnew/3.12.rst:1994 msgid "If you control the metaclass, avoid using ``tp_new`` in it:" msgstr "" -#: ../../whatsnew/3.12.rst:1909 +#: ../../whatsnew/3.12.rst:1996 msgid "" "If initialization can be skipped, it can be done in :c:member:`~PyTypeObject." "tp_init` instead." msgstr "" -#: ../../whatsnew/3.12.rst:1911 +#: ../../whatsnew/3.12.rst:1998 msgid "" "If the metaclass doesn't need to be instantiated from Python, set its " "``tp_new`` to ``NULL`` using the :c:macro:" @@ -3010,20 +3109,20 @@ msgid "" "``PyType_From*`` functions." msgstr "" -#: ../../whatsnew/3.12.rst:1916 +#: ../../whatsnew/3.12.rst:2003 msgid "" "Avoid ``PyType_From*`` functions: if you don't need C-specific features " "(slots or setting the instance size), create types by :ref:`calling ` " "the metaclass." msgstr "" -#: ../../whatsnew/3.12.rst:1920 +#: ../../whatsnew/3.12.rst:2007 msgid "" "If you *know* the ``tp_new`` can be skipped safely, filter the deprecation " "warning out using :func:`warnings.catch_warnings` from Python." msgstr "" -#: ../../whatsnew/3.12.rst:1923 +#: ../../whatsnew/3.12.rst:2010 msgid "" ":c:var:`PyOS_InputHook` and :c:var:`PyOS_ReadlineFunctionPointer` are no " "longer called in :ref:`subinterpreters `. This is " @@ -3031,14 +3130,14 @@ msgid "" "callbacks have no way of recovering extension module state)." msgstr "" -#: ../../whatsnew/3.12.rst:1928 +#: ../../whatsnew/3.12.rst:2015 msgid "" "This also avoids situations where extensions may find themselves running in " "a subinterpreter that they don't support (or haven't yet been loaded in). " "See :gh:`104668` for more info." msgstr "" -#: ../../whatsnew/3.12.rst:1932 +#: ../../whatsnew/3.12.rst:2019 msgid "" ":c:struct:`PyLongObject` has had its internals changed for better " "performance. Although the internals of :c:struct:`PyLongObject` are private, " @@ -3049,15 +3148,15 @@ msgid "" "a single machine word:" msgstr "" -#: ../../whatsnew/3.12.rst:1940 +#: ../../whatsnew/3.12.rst:2027 msgid ":c:func:`PyUnstable_Long_IsCompact`" msgstr "" -#: ../../whatsnew/3.12.rst:1941 +#: ../../whatsnew/3.12.rst:2028 msgid ":c:func:`PyUnstable_Long_CompactValue`" msgstr "" -#: ../../whatsnew/3.12.rst:1943 +#: ../../whatsnew/3.12.rst:2030 msgid "" "Custom allocators, set via :c:func:`PyMem_SetAllocator`, are now required to " "be thread-safe, regardless of memory domain. Allocators that don't have " @@ -3066,281 +3165,281 @@ msgid "" "create a new GitHub issue and CC ``@ericsnowcurrently``." msgstr "" -#: ../../whatsnew/3.12.rst:1953 +#: ../../whatsnew/3.12.rst:2040 msgid "Deprecate global configuration variable:" msgstr "" -#: ../../whatsnew/3.12.rst:1955 +#: ../../whatsnew/3.12.rst:2042 msgid ":c:var:`Py_DebugFlag`: use :c:member:`PyConfig.parser_debug`" msgstr "" -#: ../../whatsnew/3.12.rst:1956 +#: ../../whatsnew/3.12.rst:2043 msgid ":c:var:`Py_VerboseFlag`: use :c:member:`PyConfig.verbose`" msgstr "" -#: ../../whatsnew/3.12.rst:1957 +#: ../../whatsnew/3.12.rst:2044 msgid ":c:var:`Py_QuietFlag`: use :c:member:`PyConfig.quiet`" msgstr "" -#: ../../whatsnew/3.12.rst:1958 +#: ../../whatsnew/3.12.rst:2045 msgid ":c:var:`Py_InteractiveFlag`: use :c:member:`PyConfig.interactive`" msgstr "" -#: ../../whatsnew/3.12.rst:1959 +#: ../../whatsnew/3.12.rst:2046 msgid ":c:var:`Py_InspectFlag`: use :c:member:`PyConfig.inspect`" msgstr "" -#: ../../whatsnew/3.12.rst:1960 +#: ../../whatsnew/3.12.rst:2047 msgid ":c:var:`Py_OptimizeFlag`: use :c:member:`PyConfig.optimization_level`" msgstr "" -#: ../../whatsnew/3.12.rst:1961 +#: ../../whatsnew/3.12.rst:2048 msgid ":c:var:`Py_NoSiteFlag`: use :c:member:`PyConfig.site_import`" msgstr "" -#: ../../whatsnew/3.12.rst:1962 +#: ../../whatsnew/3.12.rst:2049 msgid ":c:var:`Py_BytesWarningFlag`: use :c:member:`PyConfig.bytes_warning`" msgstr "" -#: ../../whatsnew/3.12.rst:1963 +#: ../../whatsnew/3.12.rst:2050 msgid ":c:var:`Py_FrozenFlag`: use :c:member:`PyConfig.pathconfig_warnings`" msgstr "" -#: ../../whatsnew/3.12.rst:1964 +#: ../../whatsnew/3.12.rst:2051 msgid "" ":c:var:`Py_IgnoreEnvironmentFlag`: use :c:member:`PyConfig.use_environment`" msgstr "" -#: ../../whatsnew/3.12.rst:1965 +#: ../../whatsnew/3.12.rst:2052 msgid "" ":c:var:`Py_DontWriteBytecodeFlag`: use :c:member:`PyConfig.write_bytecode`" msgstr "" -#: ../../whatsnew/3.12.rst:1966 +#: ../../whatsnew/3.12.rst:2053 msgid "" ":c:var:`Py_NoUserSiteDirectory`: use :c:member:`PyConfig.user_site_directory`" msgstr "" -#: ../../whatsnew/3.12.rst:1967 +#: ../../whatsnew/3.12.rst:2054 msgid "" ":c:var:`Py_UnbufferedStdioFlag`: use :c:member:`PyConfig.buffered_stdio`" msgstr "" -#: ../../whatsnew/3.12.rst:1968 +#: ../../whatsnew/3.12.rst:2055 msgid "" ":c:var:`Py_HashRandomizationFlag`: use :c:member:`PyConfig.use_hash_seed` " "and :c:member:`PyConfig.hash_seed`" msgstr "" -#: ../../whatsnew/3.12.rst:1970 +#: ../../whatsnew/3.12.rst:2057 msgid ":c:var:`Py_IsolatedFlag`: use :c:member:`PyConfig.isolated`" msgstr "" -#: ../../whatsnew/3.12.rst:1971 +#: ../../whatsnew/3.12.rst:2058 msgid "" ":c:var:`Py_LegacyWindowsFSEncodingFlag`: use :c:member:`PyPreConfig." "legacy_windows_fs_encoding`" msgstr "" -#: ../../whatsnew/3.12.rst:1972 +#: ../../whatsnew/3.12.rst:2059 msgid "" ":c:var:`Py_LegacyWindowsStdioFlag`: use :c:member:`PyConfig." "legacy_windows_stdio`" msgstr "" -#: ../../whatsnew/3.12.rst:1973 +#: ../../whatsnew/3.12.rst:2060 msgid "" ":c:var:`!Py_FileSystemDefaultEncoding`: use :c:member:`PyConfig." "filesystem_encoding`" msgstr "" -#: ../../whatsnew/3.12.rst:1974 +#: ../../whatsnew/3.12.rst:2061 msgid "" ":c:var:`!Py_HasFileSystemDefaultEncoding`: use :c:member:`PyConfig." "filesystem_encoding`" msgstr "" -#: ../../whatsnew/3.12.rst:1975 +#: ../../whatsnew/3.12.rst:2062 msgid "" ":c:var:`!Py_FileSystemDefaultEncodeErrors`: use :c:member:`PyConfig." "filesystem_errors`" msgstr "" -#: ../../whatsnew/3.12.rst:1976 +#: ../../whatsnew/3.12.rst:2063 msgid "" ":c:var:`!Py_UTF8Mode`: use :c:member:`PyPreConfig.utf8_mode` (see :c:func:" "`Py_PreInitialize`)" msgstr "" -#: ../../whatsnew/3.12.rst:1978 +#: ../../whatsnew/3.12.rst:2065 msgid "" "The :c:func:`Py_InitializeFromConfig` API should be used with :c:type:" "`PyConfig` instead. (Contributed by Victor Stinner in :gh:`77782`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1982 +#: ../../whatsnew/3.12.rst:2069 msgid "" "Creating immutable types (:c:macro:`Py_TPFLAGS_IMMUTABLETYPE`) with mutable " "bases is deprecated and will be disabled in Python 3.14." msgstr "" -#: ../../whatsnew/3.12.rst:1985 +#: ../../whatsnew/3.12.rst:2072 msgid "" "The ``structmember.h`` header is deprecated, though it continues to be " "available and there are no plans to remove it." msgstr "" -#: ../../whatsnew/3.12.rst:1988 +#: ../../whatsnew/3.12.rst:2075 msgid "" "Its contents are now available just by including ``Python.h``, with a ``Py`` " "prefix added if it was missing:" msgstr "" -#: ../../whatsnew/3.12.rst:1991 +#: ../../whatsnew/3.12.rst:2078 msgid "" ":c:struct:`PyMemberDef`, :c:func:`PyMember_GetOne` and :c:func:" "`PyMember_SetOne`" msgstr "" -#: ../../whatsnew/3.12.rst:1993 +#: ../../whatsnew/3.12.rst:2080 msgid "" "Type macros like :c:macro:`Py_T_INT`, :c:macro:`Py_T_DOUBLE`, etc. " "(previously ``T_INT``, ``T_DOUBLE``, etc.)" msgstr "" -#: ../../whatsnew/3.12.rst:1995 +#: ../../whatsnew/3.12.rst:2082 msgid "" "The flags :c:macro:`Py_READONLY` (previously ``READONLY``) and :c:macro:" "`Py_AUDIT_READ` (previously all uppercase)" msgstr "" -#: ../../whatsnew/3.12.rst:1998 +#: ../../whatsnew/3.12.rst:2085 msgid "Several items are not exposed from ``Python.h``:" msgstr "" -#: ../../whatsnew/3.12.rst:2000 +#: ../../whatsnew/3.12.rst:2087 msgid ":c:macro:`T_OBJECT` (use :c:macro:`Py_T_OBJECT_EX`)" msgstr "" -#: ../../whatsnew/3.12.rst:2001 +#: ../../whatsnew/3.12.rst:2088 msgid ":c:macro:`T_NONE` (previously undocumented, and pretty quirky)" msgstr "" -#: ../../whatsnew/3.12.rst:2002 +#: ../../whatsnew/3.12.rst:2089 msgid "The macro ``WRITE_RESTRICTED`` which does nothing." msgstr "" -#: ../../whatsnew/3.12.rst:2003 +#: ../../whatsnew/3.12.rst:2090 msgid "" "The macros ``RESTRICTED`` and ``READ_RESTRICTED``, equivalents of :c:macro:" "`Py_AUDIT_READ`." msgstr "" -#: ../../whatsnew/3.12.rst:2005 +#: ../../whatsnew/3.12.rst:2092 msgid "" "In some configurations, ```` is not included from ``Python.h``. It " "should be included manually when using ``offsetof()``." msgstr "" -#: ../../whatsnew/3.12.rst:2008 +#: ../../whatsnew/3.12.rst:2095 msgid "" "The deprecated header continues to provide its original contents under the " "original names. Your old code can stay unchanged, unless the extra include " "and non-namespaced macros bother you greatly." msgstr "" -#: ../../whatsnew/3.12.rst:2013 +#: ../../whatsnew/3.12.rst:2100 msgid "" "(Contributed in :gh:`47146` by Petr Viktorin, based on earlier work by " "Alexander Belopolsky and Matthias Braun.)" msgstr "" -#: ../../whatsnew/3.12.rst:2016 +#: ../../whatsnew/3.12.rst:2103 msgid "" ":c:func:`PyErr_Fetch` and :c:func:`PyErr_Restore` are deprecated. Use :c:" "func:`PyErr_GetRaisedException` and :c:func:`PyErr_SetRaisedException` " "instead. (Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2021 +#: ../../whatsnew/3.12.rst:2108 msgid "" ":c:func:`!PyErr_Display` is deprecated. Use :c:func:`PyErr_DisplayException` " "instead. (Contributed by Irit Katriel in :gh:`102755`)." msgstr "" -#: ../../whatsnew/3.12.rst:2024 +#: ../../whatsnew/3.12.rst:2111 msgid "" "``_PyErr_ChainExceptions`` is deprecated. Use ``_PyErr_ChainExceptions1`` " "instead. (Contributed by Irit Katriel in :gh:`102192`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2027 +#: ../../whatsnew/3.12.rst:2114 msgid "" "Using :c:func:`PyType_FromSpec`, :c:func:`PyType_FromSpecWithBases` or :c:" "func:`PyType_FromModuleAndSpec` to create a class whose metaclass overrides :" "c:member:`~PyTypeObject.tp_new` is deprecated. Call the metaclass instead." msgstr "" -#: ../../whatsnew/3.12.rst:2035 +#: ../../whatsnew/3.12.rst:2122 msgid "" "Remove the ``token.h`` header file. There was never any public tokenizer C " "API. The ``token.h`` header file was only designed to be used by Python " "internals. (Contributed by Victor Stinner in :gh:`92651`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2040 +#: ../../whatsnew/3.12.rst:2127 msgid "Legacy Unicode APIs have been removed. See :pep:`623` for detail." msgstr "" -#: ../../whatsnew/3.12.rst:2042 +#: ../../whatsnew/3.12.rst:2129 msgid ":c:macro:`!PyUnicode_WCHAR_KIND`" msgstr ":c:macro:`!PyUnicode_WCHAR_KIND`" -#: ../../whatsnew/3.12.rst:2043 +#: ../../whatsnew/3.12.rst:2130 msgid ":c:func:`!PyUnicode_AS_UNICODE`" msgstr ":c:func:`!PyUnicode_AS_UNICODE`" -#: ../../whatsnew/3.12.rst:2044 +#: ../../whatsnew/3.12.rst:2131 msgid ":c:func:`!PyUnicode_AsUnicode`" msgstr ":c:func:`!PyUnicode_AsUnicode`" -#: ../../whatsnew/3.12.rst:2045 +#: ../../whatsnew/3.12.rst:2132 msgid ":c:func:`!PyUnicode_AsUnicodeAndSize`" msgstr ":c:func:`!PyUnicode_AsUnicodeAndSize`" -#: ../../whatsnew/3.12.rst:2046 +#: ../../whatsnew/3.12.rst:2133 msgid ":c:func:`!PyUnicode_AS_DATA`" msgstr ":c:func:`!PyUnicode_AS_DATA`" -#: ../../whatsnew/3.12.rst:2047 +#: ../../whatsnew/3.12.rst:2134 msgid ":c:func:`!PyUnicode_FromUnicode`" msgstr ":c:func:`!PyUnicode_FromUnicode`" -#: ../../whatsnew/3.12.rst:2048 +#: ../../whatsnew/3.12.rst:2135 msgid ":c:func:`!PyUnicode_GET_SIZE`" msgstr ":c:func:`!PyUnicode_GET_SIZE`" -#: ../../whatsnew/3.12.rst:2049 +#: ../../whatsnew/3.12.rst:2136 msgid ":c:func:`!PyUnicode_GetSize`" msgstr ":c:func:`!PyUnicode_GetSize`" -#: ../../whatsnew/3.12.rst:2050 +#: ../../whatsnew/3.12.rst:2137 msgid ":c:func:`!PyUnicode_GET_DATA_SIZE`" msgstr ":c:func:`!PyUnicode_GET_DATA_SIZE`" -#: ../../whatsnew/3.12.rst:2052 +#: ../../whatsnew/3.12.rst:2139 msgid "" "Remove the ``PyUnicode_InternImmortal()`` function macro. (Contributed by " "Victor Stinner in :gh:`85858`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2055 +#: ../../whatsnew/3.12.rst:2142 msgid "" "Remove ``Jython`` compatibility hacks from several stdlib modules and tests. " "(Contributed by Nikita Sobolev in :gh:`99482`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2058 +#: ../../whatsnew/3.12.rst:2145 msgid "" "Remove ``_use_broken_old_ctypes_structure_semantics_`` flag from :mod:" "`ctypes` module. (Contributed by Nikita Sobolev in :gh:`99285`.)" From d24c13843f1a225796c0590ae07ddb3843047471 Mon Sep 17 00:00:00 2001 From: "pydoc-zh-tw[bot]" <90344106+pydoc-zh-tw[bot]@users.noreply.github.com> Date: Sat, 14 Oct 2023 15:33:17 +0000 Subject: [PATCH 02/39] Sync with CPython 3.12 (#664) * sync with cpython c06ac1b4 * fix: resolve fuzzy entries * sync with cpython dbbe0eeb * sync with cpython 27d5ea29 * sync with cpython 0102faf0 * fix: resolve fuzzy entries --------- Co-authored-by: github-actions[bot] Co-authored-by: Matt Wang --- Makefile | 5 +- c-api/exceptions.po | 6 +- c-api/init_config.po | 2 +- c-api/intro.po | 231 +-- c-api/structures.po | 204 +-- c-api/type.po | 79 +- extending/windows.po | 4 +- howto/clinic.po | 2554 +-------------------------- howto/enum.po | 104 +- howto/instrumentation.po | 62 +- howto/logging-cookbook.po | 8 +- howto/logging.po | 4 +- howto/perf_profiling.po | 16 +- howto/urllib2.po | 43 +- library/__main__.po | 10 +- library/asyncio-llapi-index.po | 97 +- library/asyncio-protocol.po | 46 +- library/asyncio-task.po | 18 +- library/asyncio.po | 14 +- library/binascii.po | 56 +- library/cmdline.po | 226 +++ library/codecs.po | 994 +++++------ library/compileall.po | 120 +- library/concurrent.futures.po | 113 +- library/ctypes.po | 426 ++--- library/dataclasses.po | 140 +- library/devmode.po | 57 +- library/difflib.po | 26 +- library/dis.po | 669 +++---- library/ensurepip.po | 9 +- library/exceptions.po | 284 +-- library/functions.po | 4 +- library/gettext.po | 250 ++- library/gzip.po | 54 +- library/html.parser.po | 18 +- library/http.cookiejar.po | 13 +- library/http.server.po | 6 +- library/idle.po | 2 +- library/inspect.po | 86 +- library/json.po | 8 +- library/logging.po | 14 +- library/lzma.po | 67 +- library/multiprocessing.po | 1060 ++++++------ library/os.po | 596 ++++--- library/pickletools.po | 34 +- library/profile.po | 262 +-- library/py_compile.po | 23 +- library/re.po | 7 +- library/shutil.po | 167 +- library/site.po | 104 +- library/socket.po | 4 +- library/socketserver.po | 205 ++- library/sqlite3.po | 7 +- library/statistics.po | 387 +++-- library/symtable.po | 99 +- library/sys.monitoring.po | 4 +- library/sys.po | 8 +- library/sysconfig.po | 471 +++-- library/textwrap.po | 6 +- library/timeit.po | 4 +- library/tty.po | 12 +- library/typing.po | 552 +++--- library/urllib.error.po | 13 +- library/urllib.parse.po | 24 +- library/venv.po | 209 ++- library/weakref.po | 121 +- library/wsgiref.po | 87 +- library/xml.etree.elementtree.po | 198 +-- library/zipimport.po | 4 +- reference/compound_stmts.po | 378 ++-- reference/lexical_analysis.po | 54 +- tutorial/controlflow.po | 22 +- tutorial/floatingpoint.po | 6 +- tutorial/introduction.po | 20 +- using/cmdline.po | 131 +- using/configure.po | 103 +- using/unix.po | 25 +- using/windows.po | 72 +- whatsnew/2.0.po | 12 +- whatsnew/2.3.po | 6 +- whatsnew/2.6.po | 13 +- whatsnew/3.10.po | 30 +- whatsnew/3.11.po | 201 +-- whatsnew/3.12.po | 2792 ++++++++++++++++++------------ whatsnew/3.3.po | 17 +- whatsnew/3.4.po | 33 +- whatsnew/3.7.po | 4 +- whatsnew/3.8.po | 13 +- whatsnew/3.9.po | 773 ++++----- 89 files changed, 7549 insertions(+), 8973 deletions(-) create mode 100644 library/cmdline.po diff --git a/Makefile b/Makefile index 3f9c041ab0..4a097c90e9 100644 --- a/Makefile +++ b/Makefile @@ -105,10 +105,7 @@ endif mkdir -p "$$(dirname "$$PO")";\ if [ -f "$$PO" ];\ then\ - case "$$POT" in\ - *whatsnew*) msgmerge --lang=$(LANGUAGE) --backup=off --force-po --no-fuzzy-matching -U "$$PO" "$$POT" ;;\ - *) msgmerge --lang=$(LANGUAGE) --backup=off --force-po -U "$$PO" "$$POT" ;;\ - esac\ + msgmerge --lang=$(LANGUAGE) --backup=off --force-po -U "$$PO" "$$POT";\ else\ msgcat --lang=$(LANGUAGE) -o "$$PO" "$$POT";\ fi\ diff --git a/c-api/exceptions.po b/c-api/exceptions.po index 5a9c81c291..023dd83533 100644 --- a/c-api/exceptions.po +++ b/c-api/exceptions.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-23 00:03+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2018-05-23 14:05+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -809,8 +809,8 @@ msgstr "" msgid "" "Implement part of the interpreter's implementation of :keyword:`!except*`. " "*orig* is the original exception that was caught, and *excs* is the list of " -"the exceptions that need to be raised. This list contains the the unhandled " -"part of *orig*, if any, as well as the exceptions that were raised from the :" +"the exceptions that need to be raised. This list contains the unhandled part " +"of *orig*, if any, as well as the exceptions that were raised from the :" "keyword:`!except*` clauses (so they have a different traceback from *orig*) " "and those that were reraised (and have the same traceback as *orig*). Return " "the :exc:`ExceptionGroup` that needs to be reraised in the end, or ``None`` " diff --git a/c-api/init_config.po b/c-api/init_config.po index ef69a88c37..b1f04e9889 100644 --- a/c-api/init_config.po +++ b/c-api/init_config.po @@ -662,7 +662,7 @@ msgstr "" #: ../../c-api/init_config.rst:548 msgid "Command line arguments: :data:`sys.argv`." -msgstr "" +msgstr "命令列引數::data:`sys.argv`。" #: ../../c-api/init_config.rst:550 msgid "" diff --git a/c-api/intro.po b/c-api/intro.po index 0808d31558..c755198b70 100644 --- a/c-api/intro.po +++ b/c-api/intro.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-09 00:03+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2023-04-25 18:01+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -200,10 +200,25 @@ msgstr "" "macro:`Py_RETURN_NONE`),其他是更通用的工具程式。以下並不一定是完整的列表。" #: ../../c-api/intro.rst:110 +msgid "" +"Declare an extension module ``PyInit`` initialization function. The function " +"return type is :c:expr:`PyObject*`. The macro declares any special linkage " +"declarations required by the platform, and for C++ declares the function as " +"``extern \"C\"``." +msgstr "" + +#: ../../c-api/intro.rst:115 +msgid "" +"The initialization function must be named :samp:`PyInit_{name}`, where " +"*name* is the name of the module, and should be the only non-\\ ``static`` " +"item defined in the module file. Example::" +msgstr "" + +#: ../../c-api/intro.rst:134 msgid "Return the absolute value of ``x``." msgstr "回傳 ``x`` 的絕對值。" -#: ../../c-api/intro.rst:116 +#: ../../c-api/intro.rst:140 msgid "" "Ask the compiler to always inline a static inline function. The compiler can " "ignore it and decides to not inline the function." @@ -211,7 +226,7 @@ msgstr "" "要求編譯器總是嵌入靜態行內函式 (static inline function),編譯器可以忽略它並決" "定不嵌入該函式。" -#: ../../c-api/intro.rst:119 +#: ../../c-api/intro.rst:143 msgid "" "It can be used to inline performance critical static inline functions when " "building Python in debug mode with function inlining disabled. For example, " @@ -220,7 +235,7 @@ msgstr "" "在禁用函式嵌入的除錯模式下建置 Python 時,它可用於嵌入有性能要求的靜態行內函" "式。例如,MSC 在除錯模式下建置時禁用函式嵌入。" -#: ../../c-api/intro.rst:123 +#: ../../c-api/intro.rst:147 msgid "" "Marking blindly a static inline function with Py_ALWAYS_INLINE can result in " "worse performances (due to increased code size for example). The compiler is " @@ -229,7 +244,7 @@ msgstr "" "盲目地使用 Py_ALWAYS_INLINE 標記靜態行內函式可能會導致更差的性能(例如程式碼" "大小增加)。在成本/收益分析方面,編譯器通常比開發人員更聰明。" -#: ../../c-api/intro.rst:127 +#: ../../c-api/intro.rst:151 msgid "" "If Python is :ref:`built in debug mode ` (if the ``Py_DEBUG`` " "macro is defined), the :c:macro:`Py_ALWAYS_INLINE` macro does nothing." @@ -237,14 +252,14 @@ msgstr "" "如果 Python 是\\ :ref:`在除錯模式下建置 `\\ (如果 ``Py_DEBUG`` " "巨集有被定義),:c:macro:`Py_ALWAYS_INLINE` 巨集就什麼都不會做。" -#: ../../c-api/intro.rst:130 +#: ../../c-api/intro.rst:154 msgid "It must be specified before the function return type. Usage::" msgstr "" "它必須在函式回傳型別之前被指定。用法:\n" "\n" "::" -#: ../../c-api/intro.rst:138 +#: ../../c-api/intro.rst:162 msgid "" "Argument must be a character or an integer in the range [-128, 127] or [0, " "255]. This macro returns ``c`` cast to an ``unsigned char``." @@ -252,25 +267,25 @@ msgstr "" "引數必須是 [-128, 127] 或 [0, 255] 範圍內的字元或整數。這個巨集會將 ``c`` 轉" "換為 ``unsigned char`` 並回傳。" -#: ../../c-api/intro.rst:143 +#: ../../c-api/intro.rst:167 msgid "" "Use this for deprecated declarations. The macro must be placed before the " "symbol name." msgstr "將其用於已棄用的聲明。巨集必須放在符號名稱之前。" -#: ../../c-api/intro.rst:146 ../../c-api/intro.rst:232 -#: ../../c-api/intro.rst:250 +#: ../../c-api/intro.rst:170 ../../c-api/intro.rst:256 +#: ../../c-api/intro.rst:274 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../c-api/intro.rst:150 +#: ../../c-api/intro.rst:174 msgid "MSVC support was added." msgstr "新增了 MSVC 支援。" -#: ../../c-api/intro.rst:155 +#: ../../c-api/intro.rst:179 msgid "" "Like ``getenv(s)``, but returns ``NULL`` if :option:`-E` was passed on the " "command line (see :c:member:`PyConfig.use_environment`)." @@ -278,19 +293,19 @@ msgstr "" "類似於 ``getenv(s)``,但如果在命令列上傳遞了 :option:`-E` 則回傳 ``NULL`` " "(請見 :c:member:`PyConfig.use_environment`)。" -#: ../../c-api/intro.rst:160 +#: ../../c-api/intro.rst:184 msgid "Return the maximum value between ``x`` and ``y``." msgstr "回傳 ``x`` 和 ``y`` 之間的最大值。" -#: ../../c-api/intro.rst:166 +#: ../../c-api/intro.rst:190 msgid "Return the size of a structure (``type``) ``member`` in bytes." msgstr "以位元組為單位回傳結構 (``type``) ``member`` 的大小。" -#: ../../c-api/intro.rst:172 +#: ../../c-api/intro.rst:196 msgid "Return the minimum value between ``x`` and ``y``." msgstr "回傳 ``x`` 和 ``y`` 之間的最小值。" -#: ../../c-api/intro.rst:178 +#: ../../c-api/intro.rst:202 msgid "" "Disable inlining on a function. For example, it reduces the C stack " "consumption: useful on LTO+PGO builds which heavily inline code (see :issue:" @@ -299,20 +314,20 @@ msgstr "" "禁用函式的嵌入。例如,它減少了 C 堆疊的消耗:對大量嵌入程式碼的 LTO+PGO 建置" "很有用(請參閱 :issue:`33720`)。" -#: ../../c-api/intro.rst:182 +#: ../../c-api/intro.rst:206 msgid "Usage::" msgstr "" "用法:\n" "\n" "::" -#: ../../c-api/intro.rst:190 +#: ../../c-api/intro.rst:214 msgid "" "Convert ``x`` to a C string. E.g. ``Py_STRINGIFY(123)`` returns ``\"123\"``." msgstr "" "將 ``x`` 轉換為 C 字串。例如 ``Py_STRINGIFY(123)`` 會回傳 ``\"123\"``。" -#: ../../c-api/intro.rst:197 +#: ../../c-api/intro.rst:221 msgid "" "Use this when you have a code path that cannot be reached by design. For " "example, in the ``default:`` clause in a ``switch`` statement for which all " @@ -323,7 +338,7 @@ msgstr "" "蓋了所有可能值的 ``switch`` 陳述式中的 ``default:`` 子句。在你可能想要呼叫 " "``assert(0)`` 或 ``abort()`` 的地方使用它。" -#: ../../c-api/intro.rst:202 +#: ../../c-api/intro.rst:226 msgid "" "In release mode, the macro helps the compiler to optimize the code, and " "avoids a warning about unreachable code. For example, the macro is " @@ -333,7 +348,7 @@ msgstr "" "程式碼的警告。例如該巨集是在發布模式下於 GCC 使用 " "``__builtin_unreachable()`` 來實作。" -#: ../../c-api/intro.rst:206 +#: ../../c-api/intro.rst:230 msgid "" "A use for ``Py_UNREACHABLE()`` is following a call a function that never " "returns but that is not declared :c:macro:`_Py_NO_RETURN`." @@ -341,7 +356,7 @@ msgstr "" "``Py_UNREACHABLE()`` 的一個用途是,在對一個永不回傳但並未聲明為 :c:macro:" "`_Py_NO_RETURN` 的函式之呼叫後使用。" -#: ../../c-api/intro.rst:209 +#: ../../c-api/intro.rst:233 msgid "" "If a code path is very unlikely code but can be reached under exceptional " "case, this macro must not be used. For example, under low memory condition " @@ -353,7 +368,7 @@ msgstr "" "憶體條件下或系統呼叫回傳了超出預期範圍的值。在這種情況下,最好將錯誤回報給呼" "叫者。如果無法回報錯誤則可以使用 :c:func:`Py_FatalError`。" -#: ../../c-api/intro.rst:219 +#: ../../c-api/intro.rst:243 msgid "" "Use this for unused arguments in a function definition to silence compiler " "warnings. Example: ``int func(int a, int Py_UNUSED(b)) { return a; }``." @@ -361,7 +376,7 @@ msgstr "" "將此用於函式定義中未使用的參數以消除編譯器警告。例如:``int func(int a, int " "Py_UNUSED(b)) { return a; }``。" -#: ../../c-api/intro.rst:226 +#: ../../c-api/intro.rst:250 msgid "" "Creates a variable with name ``name`` that can be used in docstrings. If " "Python is built without docstrings, the value will be empty." @@ -369,7 +384,7 @@ msgstr "" "建立一個名為 ``name`` 的變數,可以在文件字串中使用。如果 Python 是在沒有文件" "字串的情況下建置,則該值將為空。" -#: ../../c-api/intro.rst:229 +#: ../../c-api/intro.rst:253 msgid "" "Use :c:macro:`PyDoc_STRVAR` for docstrings to support building Python " "without docstrings, as specified in :pep:`7`." @@ -377,13 +392,13 @@ msgstr "" "如 :pep:`7` 中所指明,使用 :c:macro:`PyDoc_STRVAR` 作為文件字串可以支援在沒有" "文件字串的情況下建置 Python。" -#: ../../c-api/intro.rst:244 +#: ../../c-api/intro.rst:268 msgid "" "Creates a docstring for the given input string or an empty string if " "docstrings are disabled." msgstr "為給定的輸入字串建立一個文件字串,如果文件字串被禁用則建立空字串。" -#: ../../c-api/intro.rst:247 +#: ../../c-api/intro.rst:271 msgid "" "Use :c:macro:`PyDoc_STR` in specifying docstrings to support building Python " "without docstrings, as specified in :pep:`7`." @@ -391,11 +406,11 @@ msgstr "" "如 :pep:`7` 中所指明,使用 :c:macro:`PyDoc_STR` 指定文件字串以支援在沒有文件" "字串下建置 Python。" -#: ../../c-api/intro.rst:262 +#: ../../c-api/intro.rst:286 msgid "Objects, Types and Reference Counts" msgstr "物件、型別和參照計數" -#: ../../c-api/intro.rst:266 +#: ../../c-api/intro.rst:290 msgid "" "Most Python/C API functions have one or more arguments as well as a return " "value of type :c:expr:`PyObject*`. This type is a pointer to an opaque data " @@ -418,7 +433,7 @@ msgstr "" "別物件;由於它們絕不能被釋放,因此它們通常是靜態 :c:type:`PyTypeObject` 物" "件。" -#: ../../c-api/intro.rst:277 +#: ../../c-api/intro.rst:301 msgid "" "All Python objects (even Python integers) have a :dfn:`type` and a :dfn:" "`reference count`. An object's type determines what kind of object it is (e." @@ -434,11 +449,11 @@ msgstr "" "`types`\\ )。對於每個眾所周知的型別,都有一個巨集來檢查物件是否屬於該型別;" "例如,若(且唯若)*a* 指向的物件是 Python list 時,``PyList_Check(a)`` 為真。" -#: ../../c-api/intro.rst:288 +#: ../../c-api/intro.rst:312 msgid "Reference Counts" msgstr "參照計數" -#: ../../c-api/intro.rst:290 +#: ../../c-api/intro.rst:314 msgid "" "The reference count is important because today's computers have a finite " "(and often severely limited) memory size; it counts how many different " @@ -461,7 +476,7 @@ msgstr "" "則可以依次為那些其他物件解除配置,依此類推。 (此處相互參照物件的存在是個明顯" "的問題;目前,解決方案是「就不要那樣做」。)" -#: ../../c-api/intro.rst:307 +#: ../../c-api/intro.rst:331 msgid "" "Reference counts are always manipulated explicitly. The normal way is to " "use the macro :c:func:`Py_INCREF` to take a new reference to an object (i.e. " @@ -489,7 +504,7 @@ msgstr "" "元會被使用(假設 ``sizeof(Py_ssize_t) >= sizeof(void*)``)。因此參照計數增加" "是一個簡單的操作。" -#: ../../c-api/intro.rst:323 +#: ../../c-api/intro.rst:347 msgid "" "It is not necessary to hold a :term:`strong reference` (i.e. increment the " "reference count) for every local variable that contains a pointer to an " @@ -515,7 +530,7 @@ msgstr "" "種情況的一個重要情況是在從 Python 呼叫的擴充模組中作為引數傳遞給 C 函式的物" "件;呼叫機制保證在呼叫期間保持對每個參數的參照。" -#: ../../c-api/intro.rst:339 +#: ../../c-api/intro.rst:363 msgid "" "However, a common pitfall is to extract an object from a list and hold on to " "it for a while without taking a new reference. Some other operation might " @@ -531,7 +546,7 @@ msgstr "" "程式碼路徑允許控制權從 :c:func:`Py_DECREF` 回歸使用者,因此幾乎任何操作都有潛" "在危險。" -#: ../../c-api/intro.rst:347 +#: ../../c-api/intro.rst:371 msgid "" "A safe approach is to always use the generic operations (functions whose " "name begins with ``PyObject_``, ``PyNumber_``, ``PySequence_`` or " @@ -546,11 +561,11 @@ msgstr "" "計數)。這讓呼叫者有責任在處理完結果後呼叫 :c:func:`Py_DECREF`;這就成為第二" "本質。" -#: ../../c-api/intro.rst:358 +#: ../../c-api/intro.rst:382 msgid "Reference Count Details" msgstr "參照計數詳細資訊" -#: ../../c-api/intro.rst:360 +#: ../../c-api/intro.rst:384 msgid "" "The reference count behavior of functions in the Python/C API is best " "explained in terms of *ownership of references*. Ownership pertains to " @@ -575,7 +590,7 @@ msgstr "" "照。當沒有所有權轉移時,呼叫者被稱為\\ *借用*\\ 參照。如果是\\ :term:`借用參" "照 `\\ 就不需要做任何事情。" -#: ../../c-api/intro.rst:373 +#: ../../c-api/intro.rst:397 msgid "" "Conversely, when a calling function passes in a reference to an object, " "there are two possibilities: the function *steals* a reference to the " @@ -587,7 +602,7 @@ msgstr "" "物件的參照,或者沒有。 *竊取參照*\\ 意味著當你將參照傳遞給函式時,該函式假定" "它現在擁有該參照,並且你不再對它負責。" -#: ../../c-api/intro.rst:383 +#: ../../c-api/intro.rst:407 msgid "" "Few functions steal references; the two notable exceptions are :c:func:" "`PyList_SetItem` and :c:func:`PyTuple_SetItem`, which steal a reference to " @@ -604,7 +619,7 @@ msgstr "" "慣,這些函式旨在竊取參照;例如,建立 tuple ``(1, 2, \"three\")`` 的程式碼可以" "如下所示(先暫時忘記錯誤處理;更好的編寫方式如下所示):" -#: ../../c-api/intro.rst:398 +#: ../../c-api/intro.rst:422 msgid "" "Here, :c:func:`PyLong_FromLong` returns a new reference which is immediately " "stolen by :c:func:`PyTuple_SetItem`. When you want to keep using an object " @@ -615,7 +630,7 @@ msgstr "" "`PyTuple_SetItem` 竊取。如果你想繼續使用一個物件,儘管對它的參照將被竊取,請" "在呼叫參照竊取函式之前使用 :c:func:`Py_INCREF` 來獲取另一個參照。" -#: ../../c-api/intro.rst:403 +#: ../../c-api/intro.rst:427 msgid "" "Incidentally, :c:func:`PyTuple_SetItem` is the *only* way to set tuple " "items; :c:func:`PySequence_SetItem` and :c:func:`PyObject_SetItem` refuse to " @@ -627,7 +642,7 @@ msgstr "" "tuple 是一種不可變 (immutable) 的資料型別。你應該只對你自己建立的 tuple 使" "用 :c:func:`PyTuple_SetItem`。" -#: ../../c-api/intro.rst:408 +#: ../../c-api/intro.rst:432 msgid "" "Equivalent code for populating a list can be written using :c:func:" "`PyList_New` and :c:func:`PyList_SetItem`." @@ -635,7 +650,7 @@ msgstr "" "可以使用 :c:func:`PyList_New` 和 :c:func:`PyList_SetItem` 編寫用於填充列表的" "等效程式碼。" -#: ../../c-api/intro.rst:411 +#: ../../c-api/intro.rst:435 msgid "" "However, in practice, you will rarely use these ways of creating and " "populating a tuple or list. There's a generic function, :c:func:" @@ -650,7 +665,7 @@ msgstr "" "\n" "::" -#: ../../c-api/intro.rst:422 +#: ../../c-api/intro.rst:446 msgid "" "It is much more common to use :c:func:`PyObject_SetItem` and friends with " "items whose references you are only borrowing, like arguments that were " @@ -665,7 +680,7 @@ msgstr "" "穩健,因為你不取得新的一個參照就可以放棄參照(「讓它被竊取」)。例如,此函式" "將 list(實際上是任何可變序列)的所有項目設定於給定項目:" -#: ../../c-api/intro.rst:452 +#: ../../c-api/intro.rst:476 msgid "" "The situation is slightly different for function return values. While " "passing a reference to most functions does not change your ownership " @@ -683,7 +698,7 @@ msgstr "" "照的通用函式,如 :c:func:`PyObject_GetItem` 和 :c:func:`PySequence_GetItem`," "總是回傳一個新的參照(呼叫者成為參照的所有者)。" -#: ../../c-api/intro.rst:461 +#: ../../c-api/intro.rst:485 msgid "" "It is important to realize that whether you own a reference returned by a " "function depends on which function you call only --- *the plumage* (the type " @@ -699,7 +714,7 @@ msgstr "" "如果你使用 :c:func:`PySequence_GetItem` 從同一 list 中獲取相同的項目(且恰好" "使用完全相同的引數),你確實會擁有對回傳物件的參照。" -#: ../../c-api/intro.rst:473 +#: ../../c-api/intro.rst:497 msgid "" "Here is an example of how you could write a function that computes the sum " "of the items in a list of integers; once using :c:func:`PyList_GetItem`, " @@ -710,11 +725,11 @@ msgstr "" "\n" "::" -#: ../../c-api/intro.rst:537 +#: ../../c-api/intro.rst:561 msgid "Types" msgstr "型別" -#: ../../c-api/intro.rst:539 +#: ../../c-api/intro.rst:563 msgid "" "There are few other data types that play a significant role in the Python/C " "API; most are simple C types such as :c:expr:`int`, :c:expr:`long`, :c:expr:" @@ -729,7 +744,7 @@ msgstr "" "一些結構型別被用於描述用於列出模組所匯出的函式或新物件型別的資料屬性的靜態" "表,其他則用於描述複數的值。這些將與使用它們的函式一起討論。" -#: ../../c-api/intro.rst:549 +#: ../../c-api/intro.rst:573 msgid "" "A signed integral type such that ``sizeof(Py_ssize_t) == sizeof(size_t)``. " "C99 doesn't define such a thing directly (size_t is an unsigned integral " @@ -740,11 +755,11 @@ msgstr "" "有直接定義這樣的東西(size_t 是無符號整數型別)。有關詳細資訊,請參閱 :pep:" "`353`。 ``PY_SSIZE_T_MAX`` 是 :c:type:`Py_ssize_t` 型別的最大正值。" -#: ../../c-api/intro.rst:558 +#: ../../c-api/intro.rst:582 msgid "Exceptions" msgstr "例外" -#: ../../c-api/intro.rst:560 +#: ../../c-api/intro.rst:584 msgid "" "The Python programmer only needs to deal with exceptions if specific error " "handling is required; unhandled exceptions are automatically propagated to " @@ -756,7 +771,7 @@ msgstr "" "給呼叫者,然後傳遞給呼叫者的呼叫者,依此類推,直到它們到達頂層直譯器,在那裡" "它們透過堆疊回溯 (stack trace) 回報給使用者。" -#: ../../c-api/intro.rst:568 +#: ../../c-api/intro.rst:592 msgid "" "For C programmers, however, error checking always has to be explicit. All " "functions in the Python/C API can raise exceptions, unless an explicit claim " @@ -778,7 +793,7 @@ msgstr "" "確的錯誤指示器或者有不明確的回傳值,而需要使用 :c:func:`PyErr_Occurred` 明確" "測試錯誤。這些例外都會被明確地記錄於文件。" -#: ../../c-api/intro.rst:583 +#: ../../c-api/intro.rst:607 msgid "" "Exception state is maintained in per-thread storage (this is equivalent to " "using global storage in an unthreaded application). A thread can be in one " @@ -797,7 +812,7 @@ msgstr "" "func:`PyErr_SetString` 是最常見的(儘管不是最通用的)設定例外狀態的函式,而 :" "c:func:`PyErr_Clear` 是用來清除例外狀態。" -#: ../../c-api/intro.rst:593 +#: ../../c-api/intro.rst:617 msgid "" "The full exception state consists of three objects (all of which can be " "``NULL``): the exception type, the corresponding exception value, and the " @@ -816,7 +831,7 @@ msgstr "" "達 Python 位元組碼直譯器的主迴圈,該迴圈負責將它傳遞給 ``sys.exc_info()`` 和" "其系列函式。" -#: ../../c-api/intro.rst:605 +#: ../../c-api/intro.rst:629 msgid "" "Note that starting with Python 1.5, the preferred, thread-safe way to access " "the exception state from Python code is to call the function :func:`sys." @@ -836,7 +851,7 @@ msgstr "" "式碼中的常見錯誤,這些錯誤是由看似無辜的函式覆蓋了正在處理的例外而引起的;它" "還替回溯中被堆疊幀 (stack frame) 參照的物件減少了通常不需要的生命週期延長。" -#: ../../c-api/intro.rst:616 +#: ../../c-api/intro.rst:640 msgid "" "As a general principle, a function that calls another function to perform " "some task should check whether the called function raised an exception, and " @@ -851,7 +866,7 @@ msgstr "" "並回傳一個錯誤指示符,但它\\ *不應該*\\ 設定另一個例外 --- 這將覆蓋剛剛引發的" "例外,並丟失關於錯誤確切原因的重要資訊。" -#: ../../c-api/intro.rst:625 +#: ../../c-api/intro.rst:649 msgid "" "A simple example of detecting exceptions and passing them on is shown in " "the :c:func:`!sum_sequence` example above. It so happens that this example " @@ -865,11 +880,11 @@ msgstr "" "\n" "::" -#: ../../c-api/intro.rst:640 +#: ../../c-api/intro.rst:664 msgid "Here is the corresponding C code, in all its glory::" msgstr "這是相應的 C 程式碼:" -#: ../../c-api/intro.rst:692 +#: ../../c-api/intro.rst:716 msgid "" "This example represents an endorsed use of the ``goto`` statement in C! It " "illustrates the use of :c:func:`PyErr_ExceptionMatches` and :c:func:" @@ -888,11 +903,11 @@ msgstr "" "於保存擁有的參照的變數被初始化為 ``NULL`` 以使其能夠順利作用;同樣地,回傳值" "被初始化為 ``-1``\\ (失敗),並且僅在最後一次呼叫成功後才設定為成功。" -#: ../../c-api/intro.rst:706 +#: ../../c-api/intro.rst:730 msgid "Embedding Python" msgstr "嵌入式Python" -#: ../../c-api/intro.rst:708 +#: ../../c-api/intro.rst:732 msgid "" "The one important task that only embedders (as opposed to extension writers) " "of the Python interpreter have to worry about is the initialization, and " @@ -902,7 +917,7 @@ msgstr "" "只有 Python 直譯器的嵌入者(而不是擴充編寫者)需要擔心的一項重要任務是 " "Python 直譯器的初始化與完成階段。直譯器的大部分功能只能在直譯器初始化後使用。" -#: ../../c-api/intro.rst:721 +#: ../../c-api/intro.rst:745 msgid "" "The basic initialization function is :c:func:`Py_Initialize`. This " "initializes the table of loaded modules, and creates the fundamental " @@ -913,7 +928,7 @@ msgstr "" "立基礎模組 :mod:`builtins`、:mod:`__main__` 和 :mod:`sys`。它還會初始化模組搜" "索路徑 (``sys.path``)。" -#: ../../c-api/intro.rst:726 +#: ../../c-api/intro.rst:750 msgid "" ":c:func:`Py_Initialize` does not set the \"script argument list\" (``sys." "argv``). If this variable is needed by Python code that will be executed " @@ -925,7 +940,7 @@ msgstr "" "`PyConfig.argv` 和 :c:member:`PyConfig.parse_argv`,請見 :ref:`Python 初始化" "配置 `。" -#: ../../c-api/intro.rst:731 +#: ../../c-api/intro.rst:755 msgid "" "On most systems (in particular, on Unix and Windows, although the details " "are slightly different), :c:func:`Py_Initialize` calculates the module " @@ -943,7 +958,7 @@ msgstr "" "file:`python` 的可執行檔案,並在其父目錄中查找一個名為 :file:`lib/python{X.Y}" "` 的目錄的相對位置。" -#: ../../c-api/intro.rst:740 +#: ../../c-api/intro.rst:764 msgid "" "For instance, if the Python executable is found in :file:`/usr/local/bin/" "python`, it will assume that the libraries are in :file:`/usr/local/lib/" @@ -960,7 +975,7 @@ msgstr "" "`PYTHONHOME`,或者透過設定 :envvar:`PYTHONPATH` 在標準路徑前面插入額外的目" "錄。" -#: ../../c-api/intro.rst:755 +#: ../../c-api/intro.rst:779 msgid "" "The embedding application can steer the search by calling " "``Py_SetProgramName(file)`` *before* calling :c:func:`Py_Initialize`. Note " @@ -977,7 +992,7 @@ msgstr "" "`Py_GetExecPrefix` 和 :c:func:`Py_GetProgramFullPath`\\(全部定義在 :file:" "`Modules/getpath.c`)。" -#: ../../c-api/intro.rst:765 +#: ../../c-api/intro.rst:789 msgid "" "Sometimes, it is desirable to \"uninitialize\" Python. For instance, the " "application may want to start over (make another call to :c:func:" @@ -998,11 +1013,11 @@ msgstr "" "`Py_FinalizeEx` *不會*\\ 釋放由 Python 直譯器分配的所有記憶體,例如目前無法釋" "放被擴充模組所分配的記憶體。" -#: ../../c-api/intro.rst:779 +#: ../../c-api/intro.rst:803 msgid "Debugging Builds" msgstr "除錯建置" -#: ../../c-api/intro.rst:781 +#: ../../c-api/intro.rst:805 msgid "" "Python can be built with several macros to enable extra checks of the " "interpreter and extension modules. These checks tend to add a large amount " @@ -1011,7 +1026,7 @@ msgstr "" "Python 可以在建置時使用多個巨集來啟用對直譯器和擴充模組的額外檢查,這些檢查往" "往會在執行環境 (runtime) 增加大量開銷 (overhead),因此預設情況下不啟用它們。" -#: ../../c-api/intro.rst:785 +#: ../../c-api/intro.rst:809 msgid "" "A full list of the various types of debugging builds is in the file :file:" "`Misc/SpecialBuilds.txt` in the Python source distribution. Builds are " @@ -1024,7 +1039,7 @@ msgstr "" "錯構置的完整列表,為支援追蹤參照計數、為記憶體分配器除錯或對主直譯器迴圈進行" "低階分析的建置。本節的其餘部分將僅描述最常用的建置。" -#: ../../c-api/intro.rst:791 +#: ../../c-api/intro.rst:815 msgid "" "Compiling the interpreter with the :c:macro:`Py_DEBUG` macro defined " "produces what is generally meant by :ref:`a debug build of Python `." @@ -1048,7 +1063,7 @@ msgstr "" "除了下面描述的參照計數除錯之外,還會執行額外的檢查,請參閱 :ref:`Python 除錯" "建置 `。" -#: ../../c-api/intro.rst:802 +#: ../../c-api/intro.rst:826 msgid "" "Defining :c:macro:`Py_TRACE_REFS` enables reference tracing (see the :option:" "`configure --with-trace-refs option <--with-trace-refs>`). When defined, a " @@ -1063,7 +1078,7 @@ msgstr "" "linked list)。全體分配也有被追蹤。退出時將印出所有現行參照。(在交互模式下," "這發生在直譯器運行的每個陳述句之後。)" -#: ../../c-api/intro.rst:809 +#: ../../c-api/intro.rst:833 msgid "" "Please refer to :file:`Misc/SpecialBuilds.txt` in the Python source " "distribution for more detailed information." @@ -1071,130 +1086,130 @@ msgstr "" "有關更多詳細資訊,請參閱 Python 原始碼發布版中的 :file:`Misc/SpecialBuilds." "txt`。" -#: ../../c-api/intro.rst:264 +#: ../../c-api/intro.rst:288 msgid "object" msgstr "object(物件)" -#: ../../c-api/intro.rst:264 +#: ../../c-api/intro.rst:288 msgid "type" msgstr "type(型別)" -#: ../../c-api/intro.rst:303 +#: ../../c-api/intro.rst:327 msgid "Py_INCREF()" msgstr "Py_INCREF()" -#: ../../c-api/intro.rst:303 +#: ../../c-api/intro.rst:327 msgid "Py_DECREF()" msgstr "Py_DECREF()" -#: ../../c-api/intro.rst:379 +#: ../../c-api/intro.rst:403 msgid "PyList_SetItem()" msgstr "PyList_SetItem()" -#: ../../c-api/intro.rst:379 +#: ../../c-api/intro.rst:403 msgid "PyTuple_SetItem()" msgstr "PyTuple_SetItem()" -#: ../../c-api/intro.rst:450 +#: ../../c-api/intro.rst:474 msgid "set_all()" msgstr "set_all()" -#: ../../c-api/intro.rst:469 +#: ../../c-api/intro.rst:493 msgid "PyList_GetItem()" msgstr "PyList_GetItem()" -#: ../../c-api/intro.rst:469 +#: ../../c-api/intro.rst:493 msgid "PySequence_GetItem()" msgstr "PySequence_GetItem()" -#: ../../c-api/intro.rst:499 +#: ../../c-api/intro.rst:523 msgid "sum_list()" msgstr "sum_list()" -#: ../../c-api/intro.rst:531 ../../c-api/intro.rst:623 +#: ../../c-api/intro.rst:555 ../../c-api/intro.rst:647 msgid "sum_sequence()" msgstr "sum_sequence()" -#: ../../c-api/intro.rst:566 +#: ../../c-api/intro.rst:590 msgid "PyErr_Occurred()" msgstr "PyErr_Occurred()" -#: ../../c-api/intro.rst:579 +#: ../../c-api/intro.rst:603 msgid "PyErr_SetString()" msgstr "PyErr_SetString()" -#: ../../c-api/intro.rst:579 ../../c-api/intro.rst:687 +#: ../../c-api/intro.rst:603 ../../c-api/intro.rst:711 msgid "PyErr_Clear()" msgstr "PyErr_Clear()" -#: ../../c-api/intro.rst:603 +#: ../../c-api/intro.rst:627 msgid "exc_info() (in module sys)" msgstr "exc_info() (sys 模組中)" -#: ../../c-api/intro.rst:638 ../../c-api/intro.rst:685 +#: ../../c-api/intro.rst:662 ../../c-api/intro.rst:709 msgid "incr_item()" msgstr "incr_item()" -#: ../../c-api/intro.rst:687 +#: ../../c-api/intro.rst:711 msgid "PyErr_ExceptionMatches()" msgstr "PyErr_ExceptionMatches()" -#: ../../c-api/intro.rst:687 +#: ../../c-api/intro.rst:711 msgid "Py_XDECREF()" msgstr "Py_XDECREF()" -#: ../../c-api/intro.rst:713 +#: ../../c-api/intro.rst:737 msgid "Py_Initialize()" msgstr "Py_Initialize()" -#: ../../c-api/intro.rst:713 +#: ../../c-api/intro.rst:737 msgid "module" msgstr "module(模組)" -#: ../../c-api/intro.rst:713 +#: ../../c-api/intro.rst:737 msgid "builtins" msgstr "builtins(內建)" -#: ../../c-api/intro.rst:713 +#: ../../c-api/intro.rst:737 msgid "__main__" msgstr "__main__" -#: ../../c-api/intro.rst:713 +#: ../../c-api/intro.rst:737 msgid "sys" msgstr "sys" -#: ../../c-api/intro.rst:713 +#: ../../c-api/intro.rst:737 msgid "search" msgstr "search(搜尋)" -#: ../../c-api/intro.rst:713 +#: ../../c-api/intro.rst:737 msgid "path" msgstr "path(路徑)" -#: ../../c-api/intro.rst:713 +#: ../../c-api/intro.rst:737 msgid "path (in module sys)" msgstr "path(sys 模組中)" -#: ../../c-api/intro.rst:748 +#: ../../c-api/intro.rst:772 msgid "Py_SetProgramName()" msgstr "Py_SetProgramName()" -#: ../../c-api/intro.rst:748 +#: ../../c-api/intro.rst:772 msgid "Py_GetPath()" msgstr "Py_GetPath()" -#: ../../c-api/intro.rst:748 +#: ../../c-api/intro.rst:772 msgid "Py_GetPrefix()" msgstr "Py_GetPrefix()" -#: ../../c-api/intro.rst:748 +#: ../../c-api/intro.rst:772 msgid "Py_GetExecPrefix()" msgstr "Py_GetExecPrefix()" -#: ../../c-api/intro.rst:748 +#: ../../c-api/intro.rst:772 msgid "Py_GetProgramFullPath()" msgstr "Py_GetProgramFullPath()" -#: ../../c-api/intro.rst:763 +#: ../../c-api/intro.rst:787 msgid "Py_IsInitialized()" msgstr "Py_IsInitialized()" diff --git a/c-api/structures.po b/c-api/structures.po index 5eb3082c9e..d4029f1aec 100644 --- a/c-api/structures.po +++ b/c-api/structures.po @@ -1,5 +1,4 @@ -# 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: @@ -8,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 00:03+0000\n" +"POT-Creation-Date: 2023-10-14 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -414,41 +413,46 @@ msgstr "" #: ../../c-api/structures.rst:408 msgid "" "Structure which describes an attribute of a type which corresponds to a C " -"struct member. Its fields are, in order:" +"struct member. When defining a class, put a NULL-terminated array of these " +"structures in the :c:member:`~PyTypeObject.tp_members` slot." msgstr "" #: ../../c-api/structures.rst:413 +msgid "Its fields are, in order:" +msgstr "" + +#: ../../c-api/structures.rst:417 msgid "" "Name of the member. A NULL value marks the end of a ``PyMemberDef[]`` array." msgstr "" -#: ../../c-api/structures.rst:416 +#: ../../c-api/structures.rst:420 msgid "The string should be static, no copy is made of it." msgstr "" -#: ../../c-api/structures.rst:420 +#: ../../c-api/structures.rst:424 msgid "" "The offset in bytes that the member is located on the type’s object struct." msgstr "" -#: ../../c-api/structures.rst:424 +#: ../../c-api/structures.rst:428 msgid "" "The type of the member in the C struct. See :ref:`PyMemberDef-types` for the " "possible values." msgstr "" -#: ../../c-api/structures.rst:429 +#: ../../c-api/structures.rst:433 msgid "" "Zero or more of the :ref:`PyMemberDef-flags`, combined using bitwise OR." msgstr "" -#: ../../c-api/structures.rst:433 +#: ../../c-api/structures.rst:437 msgid "" "The docstring, or NULL. The string should be static, no copy is made of it. " "Typically, it is defined using :c:macro:`PyDoc_STR`." msgstr "" -#: ../../c-api/structures.rst:437 +#: ../../c-api/structures.rst:441 msgid "" "By default (when :c:member:`~PyMemberDef.flags` is ``0``), members allow " "both read and write access. Use the :c:macro:`Py_READONLY` flag for read-" @@ -457,7 +461,7 @@ msgid "" "`T_OBJECT`) members can be deleted." msgstr "" -#: ../../c-api/structures.rst:446 +#: ../../c-api/structures.rst:450 msgid "" "For heap-allocated types (created using :c:func:`PyType_FromSpec` or " "similar), ``PyMemberDef`` may contain a definition for the special member " @@ -466,11 +470,11 @@ msgid "" "``Py_T_PYSSIZET`` and ``Py_READONLY``, for example::" msgstr "" -#: ../../c-api/structures.rst:458 +#: ../../c-api/structures.rst:462 msgid "(You may need to ``#include `` for :c:func:`!offsetof`.)" msgstr "" -#: ../../c-api/structures.rst:460 +#: ../../c-api/structures.rst:464 msgid "" "The legacy offsets :c:member:`~PyTypeObject.tp_dictoffset` and :c:member:" "`~PyTypeObject.tp_weaklistoffset` can be defined similarly using " @@ -479,77 +483,77 @@ msgid "" "and :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` instead." msgstr "" -#: ../../c-api/structures.rst:468 +#: ../../c-api/structures.rst:472 msgid "" "``PyMemberDef`` is always available. Previously, it required including " "``\"structmember.h\"``." msgstr "" -#: ../../c-api/structures.rst:473 +#: ../../c-api/structures.rst:477 msgid "" "Get an attribute belonging to the object at address *obj_addr*. The " "attribute is described by ``PyMemberDef`` *m*. Returns ``NULL`` on error." msgstr "" -#: ../../c-api/structures.rst:479 +#: ../../c-api/structures.rst:483 msgid "" "``PyMember_GetOne`` is always available. Previously, it required including " "``\"structmember.h\"``." msgstr "" -#: ../../c-api/structures.rst:484 +#: ../../c-api/structures.rst:488 msgid "" "Set an attribute belonging to the object at address *obj_addr* to object " "*o*. The attribute to set is described by ``PyMemberDef`` *m*. Returns " "``0`` if successful and a negative value on failure." msgstr "" -#: ../../c-api/structures.rst:490 +#: ../../c-api/structures.rst:494 msgid "" "``PyMember_SetOne`` is always available. Previously, it required including " "``\"structmember.h\"``." msgstr "" -#: ../../c-api/structures.rst:496 +#: ../../c-api/structures.rst:500 msgid "Member flags" msgstr "" -#: ../../c-api/structures.rst:498 +#: ../../c-api/structures.rst:502 msgid "The following flags can be used with :c:member:`PyMemberDef.flags`:" msgstr "" -#: ../../c-api/structures.rst:502 +#: ../../c-api/structures.rst:506 msgid "Not writable." msgstr "" -#: ../../c-api/structures.rst:506 +#: ../../c-api/structures.rst:510 msgid "" "Emit an ``object.__getattr__`` :ref:`audit event ` before " "reading." msgstr "" -#: ../../c-api/structures.rst:511 +#: ../../c-api/structures.rst:515 msgid "" "Indicates that the :c:member:`~PyMemberDef.offset` of this ``PyMemberDef`` " "entry indicates an offset from the subclass-specific data, rather than from " "``PyObject``." msgstr "" -#: ../../c-api/structures.rst:515 +#: ../../c-api/structures.rst:519 msgid "" "Can only be used as part of :c:member:`Py_tp_members ` :c:type:`slot ` when creating a class using " "negative :c:member:`~PyType_Spec.basicsize`. It is mandatory in that case." msgstr "" -#: ../../c-api/structures.rst:520 +#: ../../c-api/structures.rst:524 msgid "" "This flag is only used in :c:type:`PyTypeSlot`. When setting :c:member:" "`~PyTypeObject.tp_members` during class creation, Python clears it and sets :" "c:member:`PyMemberDef.offset` to the offset from the ``PyObject`` struct." msgstr "" -#: ../../c-api/structures.rst:532 +#: ../../c-api/structures.rst:536 msgid "" "The :c:macro:`!RESTRICTED`, :c:macro:`!READ_RESTRICTED` and :c:macro:`!" "WRITE_RESTRICTED` macros available with ``#include \"structmember.h\"`` are " @@ -558,7 +562,7 @@ msgid "" "nothing." msgstr "" -#: ../../c-api/structures.rst:543 +#: ../../c-api/structures.rst:547 msgid "" "The :c:macro:`!READONLY` macro was renamed to :c:macro:`Py_READONLY`. The :c:" "macro:`!PY_AUDIT_READ` macro was renamed with the ``Py_`` prefix. The new " @@ -567,11 +571,11 @@ msgid "" "names." msgstr "" -#: ../../c-api/structures.rst:552 +#: ../../c-api/structures.rst:556 msgid "Member types" msgstr "" -#: ../../c-api/structures.rst:554 +#: ../../c-api/structures.rst:558 msgid "" ":c:member:`PyMemberDef.type` can be one of the following macros " "corresponding to various C types. When the member is accessed in Python, it " @@ -580,147 +584,147 @@ msgid "" "exception such as :exc:`TypeError` or :exc:`ValueError` is raised." msgstr "" -#: ../../c-api/structures.rst:562 +#: ../../c-api/structures.rst:566 msgid "" "Unless marked (D), attributes defined this way cannot be deleted using e.g. :" "keyword:`del` or :py:func:`delattr`." msgstr "" -#: ../../c-api/structures.rst:566 +#: ../../c-api/structures.rst:570 msgid "Macro name" msgstr "" -#: ../../c-api/structures.rst:566 +#: ../../c-api/structures.rst:570 msgid "C type" msgstr "" -#: ../../c-api/structures.rst:566 +#: ../../c-api/structures.rst:570 msgid "Python type" msgstr "" -#: ../../c-api/structures.rst:568 +#: ../../c-api/structures.rst:572 msgid ":c:expr:`char`" msgstr "" -#: ../../c-api/structures.rst:568 ../../c-api/structures.rst:569 -#: ../../c-api/structures.rst:570 ../../c-api/structures.rst:571 #: ../../c-api/structures.rst:572 ../../c-api/structures.rst:573 #: ../../c-api/structures.rst:574 ../../c-api/structures.rst:575 #: ../../c-api/structures.rst:576 ../../c-api/structures.rst:577 -#: ../../c-api/structures.rst:578 +#: ../../c-api/structures.rst:578 ../../c-api/structures.rst:579 +#: ../../c-api/structures.rst:580 ../../c-api/structures.rst:581 +#: ../../c-api/structures.rst:582 msgid ":py:class:`int`" msgstr ":py:class:`int`" -#: ../../c-api/structures.rst:569 +#: ../../c-api/structures.rst:573 msgid ":c:expr:`short`" msgstr ":c:expr:`short`" -#: ../../c-api/structures.rst:570 +#: ../../c-api/structures.rst:574 msgid ":c:expr:`int`" msgstr ":c:expr:`int`" -#: ../../c-api/structures.rst:571 +#: ../../c-api/structures.rst:575 msgid ":c:expr:`long`" msgstr ":c:expr:`long`" -#: ../../c-api/structures.rst:572 +#: ../../c-api/structures.rst:576 msgid ":c:expr:`long long`" msgstr ":c:expr:`long long`" -#: ../../c-api/structures.rst:573 +#: ../../c-api/structures.rst:577 msgid ":c:expr:`unsigned char`" msgstr ":c:expr:`unsigned char`" -#: ../../c-api/structures.rst:574 +#: ../../c-api/structures.rst:578 msgid ":c:expr:`unsigned int`" msgstr ":c:expr:`unsigned int`" -#: ../../c-api/structures.rst:575 +#: ../../c-api/structures.rst:579 msgid ":c:expr:`unsigned short`" msgstr ":c:expr:`unsigned short`" -#: ../../c-api/structures.rst:576 +#: ../../c-api/structures.rst:580 msgid ":c:expr:`unsigned long`" msgstr ":c:expr:`unsigned long`" -#: ../../c-api/structures.rst:577 +#: ../../c-api/structures.rst:581 msgid ":c:expr:`unsigned long long`" msgstr ":c:expr:`unsigned long long`" -#: ../../c-api/structures.rst:578 +#: ../../c-api/structures.rst:582 msgid ":c:expr:`Py_ssize_t`" msgstr ":c:expr:`Py_ssize_t`" -#: ../../c-api/structures.rst:579 +#: ../../c-api/structures.rst:583 msgid ":c:expr:`float`" msgstr ":c:expr:`float`" -#: ../../c-api/structures.rst:579 ../../c-api/structures.rst:580 +#: ../../c-api/structures.rst:583 ../../c-api/structures.rst:584 msgid ":py:class:`float`" msgstr ":py:class:`float`" -#: ../../c-api/structures.rst:580 +#: ../../c-api/structures.rst:584 msgid ":c:expr:`double`" msgstr ":c:expr:`double`" -#: ../../c-api/structures.rst:581 +#: ../../c-api/structures.rst:585 msgid ":c:expr:`char` (written as 0 or 1)" msgstr ":c:expr:`char` (寫成 0 或 1)" -#: ../../c-api/structures.rst:581 +#: ../../c-api/structures.rst:585 msgid ":py:class:`bool`" msgstr ":py:class:`bool`" -#: ../../c-api/structures.rst:583 +#: ../../c-api/structures.rst:587 msgid ":c:expr:`const char *` (*)" msgstr ":c:expr:`const char *` (*)" -#: ../../c-api/structures.rst:583 ../../c-api/structures.rst:584 +#: ../../c-api/structures.rst:587 ../../c-api/structures.rst:588 msgid ":py:class:`str` (RO)" msgstr ":py:class:`str` (RO)" -#: ../../c-api/structures.rst:584 +#: ../../c-api/structures.rst:588 msgid ":c:expr:`const char[]` (*)" msgstr ":c:expr:`const char[]` (*)" -#: ../../c-api/structures.rst:585 +#: ../../c-api/structures.rst:589 msgid ":c:expr:`char` (0-127)" msgstr ":c:expr:`char` (0-127)" -#: ../../c-api/structures.rst:585 +#: ../../c-api/structures.rst:589 msgid ":py:class:`str` (**)" msgstr ":py:class:`str` (**)" -#: ../../c-api/structures.rst:586 +#: ../../c-api/structures.rst:590 msgid ":c:expr:`PyObject *`" msgstr ":c:expr:`PyObject *`" -#: ../../c-api/structures.rst:586 +#: ../../c-api/structures.rst:590 msgid ":py:class:`object` (D)" msgstr ":py:class:`object` (D)" -#: ../../c-api/structures.rst:589 +#: ../../c-api/structures.rst:593 msgid "" "(*): Zero-terminated, UTF8-encoded C string. With :c:macro:`!Py_T_STRING` " "the C representation is a pointer; with :c:macro:`!Py_T_STRING_INLINE` the " "string is stored directly in the structure." msgstr "" -#: ../../c-api/structures.rst:594 +#: ../../c-api/structures.rst:598 msgid "(**): String of length 1. Only ASCII is accepted." msgstr "" -#: ../../c-api/structures.rst:596 +#: ../../c-api/structures.rst:600 msgid "(RO): Implies :c:macro:`Py_READONLY`." msgstr "" -#: ../../c-api/structures.rst:598 +#: ../../c-api/structures.rst:602 msgid "" "(D): Can be deleted, in which case the pointer is set to ``NULL``. Reading a " "``NULL`` pointer raises :py:exc:`AttributeError`." msgstr "" -#: ../../c-api/structures.rst:624 +#: ../../c-api/structures.rst:628 msgid "" "In previous versions, the macros were only available with ``#include " "\"structmember.h\"`` and were named without the ``Py_`` prefix (e.g. as " @@ -728,69 +732,69 @@ msgid "" "with the following deprecated types:" msgstr "" -#: ../../c-api/structures.rst:632 +#: ../../c-api/structures.rst:636 msgid "" "Like ``Py_T_OBJECT_EX``, but ``NULL`` is converted to ``None``. This results " "in surprising behavior in Python: deleting the attribute effectively sets it " "to ``None``." msgstr "" -#: ../../c-api/structures.rst:638 +#: ../../c-api/structures.rst:642 msgid "Always ``None``. Must be used with :c:macro:`Py_READONLY`." msgstr "" -#: ../../c-api/structures.rst:641 +#: ../../c-api/structures.rst:645 msgid "Defining Getters and Setters" msgstr "" -#: ../../c-api/structures.rst:645 +#: ../../c-api/structures.rst:649 msgid "" "Structure to define property-like access for a type. See also description of " "the :c:member:`PyTypeObject.tp_getset` slot." msgstr "" -#: ../../c-api/structures.rst:650 +#: ../../c-api/structures.rst:654 msgid "attribute name" msgstr "" -#: ../../c-api/structures.rst:654 +#: ../../c-api/structures.rst:658 msgid "C function to get the attribute." msgstr "" -#: ../../c-api/structures.rst:658 +#: ../../c-api/structures.rst:662 msgid "" "Optional C function to set or delete the attribute, if omitted the attribute " "is readonly." msgstr "" -#: ../../c-api/structures.rst:662 +#: ../../c-api/structures.rst:666 msgid "optional docstring" msgstr "" -#: ../../c-api/structures.rst:666 +#: ../../c-api/structures.rst:670 msgid "" "Optional function pointer, providing additional data for getter and setter." msgstr "" -#: ../../c-api/structures.rst:668 +#: ../../c-api/structures.rst:672 msgid "" "The ``get`` function takes one :c:expr:`PyObject*` parameter (the instance) " "and a function pointer (the associated ``closure``)::" msgstr "" -#: ../../c-api/structures.rst:673 +#: ../../c-api/structures.rst:677 msgid "" "It should return a new reference on success or ``NULL`` with a set exception " "on failure." msgstr "" -#: ../../c-api/structures.rst:676 +#: ../../c-api/structures.rst:680 msgid "" "``set`` functions take two :c:expr:`PyObject*` parameters (the instance and " "the value to be set) and a function pointer (the associated ``closure``)::" msgstr "" -#: ../../c-api/structures.rst:681 +#: ../../c-api/structures.rst:685 msgid "" "In case the attribute should be deleted the second parameter is ``NULL``. " "Should return ``0`` on success or ``-1`` with a set exception on failure." @@ -808,94 +812,94 @@ msgstr "classmethod" msgid "staticmethod" msgstr "staticmethod" -#: ../../c-api/structures.rst:525 +#: ../../c-api/structures.rst:529 msgid "READ_RESTRICTED" msgstr "READ_RESTRICTED" -#: ../../c-api/structures.rst:525 +#: ../../c-api/structures.rst:529 msgid "WRITE_RESTRICTED" msgstr "WRITE_RESTRICTED" -#: ../../c-api/structures.rst:525 +#: ../../c-api/structures.rst:529 msgid "RESTRICTED" msgstr "RESTRICTED" -#: ../../c-api/structures.rst:538 +#: ../../c-api/structures.rst:542 msgid "READONLY" msgstr "READONLY" -#: ../../c-api/structures.rst:601 +#: ../../c-api/structures.rst:605 msgid "T_BYTE" msgstr "T_BYTE" -#: ../../c-api/structures.rst:601 +#: ../../c-api/structures.rst:605 msgid "T_SHORT" msgstr "T_SHORT" -#: ../../c-api/structures.rst:601 +#: ../../c-api/structures.rst:605 msgid "T_INT" msgstr "T_INT" -#: ../../c-api/structures.rst:601 +#: ../../c-api/structures.rst:605 msgid "T_LONG" msgstr "T_LONG" -#: ../../c-api/structures.rst:601 +#: ../../c-api/structures.rst:605 msgid "T_LONGLONG" msgstr "T_LONGLONG" -#: ../../c-api/structures.rst:601 +#: ../../c-api/structures.rst:605 msgid "T_UBYTE" msgstr "T_UBYTE" -#: ../../c-api/structures.rst:601 +#: ../../c-api/structures.rst:605 msgid "T_USHORT" msgstr "T_USHORT" -#: ../../c-api/structures.rst:601 +#: ../../c-api/structures.rst:605 msgid "T_UINT" msgstr "T_UINT" -#: ../../c-api/structures.rst:601 +#: ../../c-api/structures.rst:605 msgid "T_ULONG" msgstr "T_ULONG" -#: ../../c-api/structures.rst:601 +#: ../../c-api/structures.rst:605 msgid "T_ULONGULONG" msgstr "T_ULONGULONG" -#: ../../c-api/structures.rst:601 +#: ../../c-api/structures.rst:605 msgid "T_PYSSIZET" msgstr "T_PYSSIZET" -#: ../../c-api/structures.rst:601 +#: ../../c-api/structures.rst:605 msgid "T_FLOAT" msgstr "T_FLOAT" -#: ../../c-api/structures.rst:601 +#: ../../c-api/structures.rst:605 msgid "T_DOUBLE" msgstr "T_DOUBLE" -#: ../../c-api/structures.rst:601 +#: ../../c-api/structures.rst:605 msgid "T_BOOL" msgstr "T_BOOL" -#: ../../c-api/structures.rst:601 +#: ../../c-api/structures.rst:605 msgid "T_CHAR" msgstr "T_CHAR" -#: ../../c-api/structures.rst:601 +#: ../../c-api/structures.rst:605 msgid "T_STRING" msgstr "T_STRING" -#: ../../c-api/structures.rst:601 +#: ../../c-api/structures.rst:605 msgid "T_STRING_INPLACE" msgstr "T_STRING_INPLACE" -#: ../../c-api/structures.rst:601 +#: ../../c-api/structures.rst:605 msgid "T_OBJECT_EX" msgstr "T_OBJECT_EX" -#: ../../c-api/structures.rst:601 +#: ../../c-api/structures.rst:605 msgid "structmember.h" msgstr "structmember.h" diff --git a/c-api/type.po b/c-api/type.po index a9f1005b76..124180d16e 100644 --- a/c-api/type.po +++ b/c-api/type.po @@ -1,5 +1,4 @@ -# 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: @@ -7,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 00:03+0000\n" +"POT-Creation-Date: 2023-10-14 00:03+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -533,77 +532,81 @@ msgstr "" #: ../../c-api/type.rst:464 msgid "" -"The following fields cannot be set at all using :c:type:`PyType_Spec` and :c:" -"type:`PyType_Slot`:" +"The following “offset” fields cannot be set using :c:type:`PyType_Slot`:" msgstr "" -#: ../../c-api/type.rst:467 -msgid ":c:member:`~PyTypeObject.tp_dict`" -msgstr ":c:member:`~PyTypeObject.tp_dict`" +#: ../../c-api/type.rst:466 +msgid "" +":c:member:`~PyTypeObject.tp_weaklistoffset` (use :c:macro:" +"`Py_TPFLAGS_MANAGED_WEAKREF` instead if possible)" +msgstr "" #: ../../c-api/type.rst:468 -msgid ":c:member:`~PyTypeObject.tp_mro`" -msgstr ":c:member:`~PyTypeObject.tp_mro`" - -#: ../../c-api/type.rst:469 -msgid ":c:member:`~PyTypeObject.tp_cache`" -msgstr ":c:member:`~PyTypeObject.tp_cache`" +msgid "" +":c:member:`~PyTypeObject.tp_dictoffset` (use :c:macro:" +"`Py_TPFLAGS_MANAGED_DICT` instead if possible)" +msgstr "" +":c:member:`~PyTypeObject.tp_dictoffset`\\ (如果可能,請改用 :c:macro:" +"`Py_TPFLAGS_MANAGED_DICT`)" #: ../../c-api/type.rst:470 -msgid ":c:member:`~PyTypeObject.tp_subclasses`" -msgstr ":c:member:`~PyTypeObject.tp_subclasses`" - -#: ../../c-api/type.rst:471 -msgid ":c:member:`~PyTypeObject.tp_weaklist`" -msgstr ":c:member:`~PyTypeObject.tp_weaklist`" - -#: ../../c-api/type.rst:472 -msgid ":c:member:`~PyTypeObject.tp_vectorcall`" -msgstr ":c:member:`~PyTypeObject.tp_vectorcall`" +msgid "" +":c:member:`~PyTypeObject.tp_vectorcall_offset` (use " +"``\"__vectorcalloffset__\"`` in :ref:`PyMemberDef `)" +msgstr "" +":c:member:`~PyTypeObject.tp_vectorcall_offset`\\ (請用 :ref:`PyMemberDef " +"` 中的 ``\"__vectorcalloffset__\"``)" -#: ../../c-api/type.rst:473 +#: ../../c-api/type.rst:474 msgid "" -":c:member:`~PyTypeObject.tp_weaklistoffset` (use :c:macro:" -"`Py_TPFLAGS_MANAGED_WEAKREF` instead)" +"If it is not possible to switch to a ``MANAGED`` flag (for example, for " +"vectorcall or to support Python older than 3.12), specify the offset in :c:" +"member:`Py_tp_members `. See :ref:`PyMemberDef " +"documentation ` for details." +msgstr "" + +#: ../../c-api/type.rst:480 +msgid "The following fields cannot be set at all when creating a heap type:" msgstr "" -#: ../../c-api/type.rst:475 +#: ../../c-api/type.rst:482 msgid "" -":c:member:`~PyTypeObject.tp_dictoffset` (use :c:macro:" -"`Py_TPFLAGS_MANAGED_DICT` instead)" +":c:member:`~PyTypeObject.tp_vectorcall` (use :c:member:`~PyTypeObject." +"tp_new` and/or :c:member:`~PyTypeObject.tp_init`)" msgstr "" -#: ../../c-api/type.rst:477 +#: ../../c-api/type.rst:486 msgid "" -":c:member:`~PyTypeObject.tp_vectorcall_offset` (see :ref:`PyMemberDef " -"`)" +"Internal fields: :c:member:`~PyTypeObject.tp_dict`, :c:member:`~PyTypeObject." +"tp_mro`, :c:member:`~PyTypeObject.tp_cache`, :c:member:`~PyTypeObject." +"tp_subclasses`, and :c:member:`~PyTypeObject.tp_weaklist`." msgstr "" -#: ../../c-api/type.rst:480 +#: ../../c-api/type.rst:493 msgid "" "Setting :c:data:`Py_tp_bases` or :c:data:`Py_tp_base` may be problematic on " "some platforms. To avoid issues, use the *bases* argument of :c:func:" "`PyType_FromSpecWithBases` instead." msgstr "" -#: ../../c-api/type.rst:487 +#: ../../c-api/type.rst:500 msgid "Slots in :c:type:`PyBufferProcs` may be set in the unlimited API." msgstr "" -#: ../../c-api/type.rst:489 +#: ../../c-api/type.rst:502 msgid "" ":c:member:`~PyBufferProcs.bf_getbuffer` and :c:member:`~PyBufferProcs." "bf_releasebuffer` are now available under the :ref:`limited API `." msgstr "" -#: ../../c-api/type.rst:496 +#: ../../c-api/type.rst:509 msgid "" "The desired value of the slot. In most cases, this is a pointer to a " "function." msgstr "" -#: ../../c-api/type.rst:499 +#: ../../c-api/type.rst:512 msgid "Slots other than ``Py_tp_doc`` may not be ``NULL``." msgstr "" diff --git a/extending/windows.po b/extending/windows.po index 5e2c101fb5..24a09caf88 100644 --- a/extending/windows.po +++ b/extending/windows.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -185,5 +185,5 @@ msgid "" "Developer Studio will throw in a lot of import libraries that you do not " "really need, adding about 100K to your executable. To get rid of them, use " "the Project Settings dialog, Link tab, to specify *ignore default " -"libraries*. Add the correct :file:`msvcrtxx.lib` to the list of libraries." +"libraries*. Add the correct :file:`msvcrt{xx}.lib` to the list of libraries." msgstr "" diff --git a/howto/clinic.po b/howto/clinic.po index 469e7f45c1..c039a32a4c 100644 --- a/howto/clinic.po +++ b/howto/clinic.po @@ -1,5 +1,5 @@ # 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: @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-08 00:03+0000\n" +"POT-Creation-Date: 2023-10-13 00:03+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-" @@ -18,2550 +18,14 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../howto/clinic.rst:7 +#: ../../howto/clinic.rst:8 msgid "Argument Clinic How-To" -msgstr "" - -#: ../../howto/clinic.rst:0 -msgid "author" -msgstr "作者" - -#: ../../howto/clinic.rst:9 -msgid "Larry Hastings" -msgstr "Larry Hastings" - -#: ../../howto/clinic.rst:11 -msgid "**Source code:** :source:`Tools/clinic/clinic.py`." -msgstr "**原始碼:** :source:`Tools/clinic/clinic.py`。" - -#: ../../howto/clinic.rst:7 -msgid "Abstract" -msgstr "摘要" - -#: ../../howto/clinic.rst:15 -msgid "" -"Argument Clinic is a preprocessor for CPython C files. It was introduced in " -"Python 3.4 with :pep:`436`, in order to provide introspection signatures, " -"and to generate performant and tailor-made boilerplate code for argument " -"parsing in CPython builtins, module level functions, and class methods. This " -"document is divided in four major sections:" -msgstr "" - -#: ../../howto/clinic.rst:23 -msgid "" -":ref:`clinic-background` talks about the basic concepts and goals of " -"Argument Clinic." -msgstr "" - -#: ../../howto/clinic.rst:25 -msgid "" -":ref:`clinic-reference` describes the command-line interface and Argument " -"Clinic terminology." -msgstr "" - -#: ../../howto/clinic.rst:27 -msgid "" -":ref:`clinic-tutorial` guides you through all the steps required to adapt an " -"existing C function to Argument Clinic." -msgstr "" - -#: ../../howto/clinic.rst:29 -msgid ":ref:`clinic-howtos` details how to handle specific tasks." -msgstr "" - -#: ../../howto/clinic.rst:34 -msgid "" -"Argument Clinic is considered internal-only for CPython. Its use is not " -"supported for files outside CPython, and no guarantees are made regarding " -"backwards compatibility for future versions. In other words: if you " -"maintain an external C extension for CPython, you're welcome to experiment " -"with Argument Clinic in your own code. But the version of Argument Clinic " -"that ships with the next version of CPython *could* be totally incompatible " -"and break all your code." -msgstr "" - -#: ../../howto/clinic.rst:47 -msgid "Background" -msgstr "" - -#: ../../howto/clinic.rst:50 -msgid "Basic concepts" -msgstr "" - -#: ../../howto/clinic.rst:52 -msgid "" -"When Argument Clinic is run on a file, either via the :ref:`clinic-cli` or " -"via ``make clinic``, it will scan over the input files looking for :term:" -"`start lines `:" -msgstr "" - -#: ../../howto/clinic.rst:60 -msgid "When it finds one, it reads everything up to the :term:`end line`:" -msgstr "" - -#: ../../howto/clinic.rst:66 -msgid "" -"Everything in between these two lines is Argument Clinic :term:`input`. When " -"Argument Clinic parses input, it generates :term:`output`. The output is " -"rewritten into the C file immediately after the input, followed by a :term:" -"`checksum line`. All of these lines, including the :term:`start line` and :" -"term:`checksum line`, are collectively called an Argument Clinic :term:" -"`block`:" -msgstr "" - -#: ../../howto/clinic.rst:81 -msgid "" -"If you run Argument Clinic on the same file a second time, Argument Clinic " -"will discard the old :term:`output` and write out the new output with a " -"fresh :term:`checksum line`. If the :term:`input` hasn't changed, the output " -"won't change either." -msgstr "" - -#: ../../howto/clinic.rst:88 -msgid "" -"You should never modify the output of an Argument Clinic block, as any " -"change will be lost in future Argument Clinic runs; Argument Clinic will " -"detect an output checksum mismatch and regenerate the correct output. If you " -"are not happy with the generated output, you should instead change the input " -"until it produces the output you want." -msgstr "" - -#: ../../howto/clinic.rst:99 -msgid "Reference" -msgstr "" - -#: ../../howto/clinic.rst:105 -msgid "Terminology" -msgstr "" - -#: ../../howto/clinic.rst:108 -msgid "start line" -msgstr "" - -#: ../../howto/clinic.rst:110 -msgid "" -"The line ``/*[clinic input]``. This line marks the beginning of Argument " -"Clinic input. Note that the *start line* opens a C block comment." -msgstr "" - -#: ../../howto/clinic.rst:113 -msgid "end line" -msgstr "" - -#: ../../howto/clinic.rst:115 -msgid "" -"The line ``[clinic start generated code]*/``. The *end line* marks the _end_ " -"of Argument Clinic :term:`input`, but at the same time marks the _start_ of " -"Argument Clinic :term:`output`, thus the text *\"clinic start start " -"generated code\"* Note that the *end line* closes the C block comment opened " -"by the *start line*." -msgstr "" - -#: ../../howto/clinic.rst:121 -msgid "checksum" -msgstr "" - -#: ../../howto/clinic.rst:123 -msgid "" -"A hash to distinguish unique :term:`inputs ` and :term:`outputs " -"`." -msgstr "" - -#: ../../howto/clinic.rst:125 -msgid "checksum line" -msgstr "" - -#: ../../howto/clinic.rst:127 -msgid "" -"A line that looks like ``/*[clinic end generated code: ...]*/``. The three " -"dots will be replaced by a :term:`checksum` generated from the :term:" -"`input`, and a :term:`checksum` generated from the :term:`output`. The " -"checksum line marks the end of Argument Clinic generated code, and is used " -"by Argument Clinic to determine if it needs to regenerate output." -msgstr "" - -#: ../../howto/clinic.rst:133 -msgid "input" -msgstr "" - -#: ../../howto/clinic.rst:135 -msgid "" -"The text between the :term:`start line` and the :term:`end line`. Note that " -"the start and end lines open and close a C block comment; the *input* is " -"thus a part of that same C block comment." -msgstr "" - -#: ../../howto/clinic.rst:138 -msgid "output" -msgstr "" - -#: ../../howto/clinic.rst:140 -msgid "The text between the :term:`end line` and the :term:`checksum line`." -msgstr "" - -#: ../../howto/clinic.rst:141 -msgid "block" -msgstr "" - -#: ../../howto/clinic.rst:143 -msgid "" -"All text from the :term:`start line` to the :term:`checksum line` " -"inclusively." -msgstr "" - -#: ../../howto/clinic.rst:149 -msgid "Command-line interface" -msgstr "" - -#: ../../howto/clinic.rst:151 -msgid "" -"The Argument Clinic :abbr:`CLI (Command-Line Interface)` is typically used " -"to process a single source file, like this:" -msgstr "" - -#: ../../howto/clinic.rst:158 -msgid "The CLI supports the following options:" -msgstr "" - -#: ../../howto/clinic.rst:165 -msgid "Print CLI usage." -msgstr "" - -#: ../../howto/clinic.rst:169 -msgid "Force output regeneration." -msgstr "" - -#: ../../howto/clinic.rst:173 -msgid "Redirect file output to OUTPUT" -msgstr "" - -#: ../../howto/clinic.rst:177 -msgid "Enable verbose mode." -msgstr "" - -#: ../../howto/clinic.rst:181 -msgid "Print a list of all supported converters and return converters." -msgstr "" - -#: ../../howto/clinic.rst:185 -msgid "Walk :option:`--srcdir` to run over all relevant files." -msgstr "" - -#: ../../howto/clinic.rst:189 -msgid "The directory tree to walk in :option:`--make` mode." -msgstr "" - -#: ../../howto/clinic.rst:193 -msgid "The list of files to process." -msgstr "" - -#: ../../howto/clinic.rst:199 -msgid "Classes for extending Argument Clinic" -msgstr "" - -#: ../../howto/clinic.rst:205 -msgid "" -"The base class for all converters. See :ref:`clinic-howto-custom-converter` " -"for how to subclass this class." -msgstr "" - -#: ../../howto/clinic.rst:210 -msgid "" -"The C type to use for this variable. :attr:`!type` should be a Python string " -"specifying the type, e.g. ``'int'``. If this is a pointer type, the type " -"string should end with ``' *'``." -msgstr "" - -#: ../../howto/clinic.rst:217 -msgid "" -"The Python default value for this parameter, as a Python value. Or the magic " -"value ``unspecified`` if there is no default." -msgstr "" - -#: ../../howto/clinic.rst:222 -msgid "" -":attr:`!default` as it should appear in Python code, as a string. Or " -"``None`` if there is no default." -msgstr "" - -#: ../../howto/clinic.rst:228 -msgid "" -":attr:`!default` as it should appear in C code, as a string. Or ``None`` if " -"there is no default." -msgstr "" - -#: ../../howto/clinic.rst:234 -msgid "" -"The default value used to initialize the C variable when there is no " -"default, but not specifying a default may result in an \"uninitialized " -"variable\" warning. This can easily happen when using option groups—" -"although properly written code will never actually use this value, the " -"variable does get passed in to the impl, and the C compiler will complain " -"about the \"use\" of the uninitialized value. This value should always be a " -"non-empty string." -msgstr "" - -#: ../../howto/clinic.rst:246 -msgid "The name of the C converter function, as a string." -msgstr "" - -#: ../../howto/clinic.rst:250 -msgid "" -"A boolean value. If true, Argument Clinic will add a ``&`` in front of the " -"name of the variable when passing it into the impl function." -msgstr "" - -#: ../../howto/clinic.rst:256 -msgid "" -"A boolean value. If true, Argument Clinic will add a ``&`` in front of the " -"name of the variable when passing it into :c:func:`PyArg_ParseTuple`." -msgstr "" - -#: ../../howto/clinic.rst:264 -msgid "Tutorial" -msgstr "" - -#: ../../howto/clinic.rst:266 -msgid "" -"The best way to get a sense of how Argument Clinic works is to convert a " -"function to work with it. Here, then, are the bare minimum steps you'd need " -"to follow to convert a function to work with Argument Clinic. Note that for " -"code you plan to check in to CPython, you really should take the conversion " -"farther, using some of the :ref:`advanced concepts ` you'll " -"see later on in the document, like :ref:`clinic-howto-return-converters` " -"and :ref:`clinic-howto-self-converter`. But we'll keep it simple for this " -"walkthrough so you can learn." -msgstr "" - -#: ../../howto/clinic.rst:277 -msgid "" -"First, make sure you're working with a freshly updated checkout of the " -"CPython trunk." -msgstr "" - -#: ../../howto/clinic.rst:280 -msgid "" -"Next, find a Python builtin that calls either :c:func:`PyArg_ParseTuple` or :" -"c:func:`PyArg_ParseTupleAndKeywords`, and hasn't been converted to work with " -"Argument Clinic yet. For this tutorial, we'll be using :py:meth:`_pickle." -"Pickler.dump `." -msgstr "" - -#: ../../howto/clinic.rst:286 -msgid "" -"If the call to the :c:func:`!PyArg_Parse*` function uses any of the " -"following format units...:" -msgstr "" - -#: ../../howto/clinic.rst:298 -msgid "" -"... or if it has multiple calls to :c:func:`PyArg_ParseTuple`, you should " -"choose a different function. (See :ref:`clinic-howto-advanced-converters` " -"for those scenarios.)" -msgstr "" - -#: ../../howto/clinic.rst:302 -msgid "" -"Also, if the function has multiple calls to :c:func:`!PyArg_ParseTuple` or :" -"c:func:`PyArg_ParseTupleAndKeywords` where it supports different types for " -"the same argument, or if the function uses something besides :c:func:`!" -"PyArg_Parse*` functions to parse its arguments, it probably isn't suitable " -"for conversion to Argument Clinic. Argument Clinic doesn't support generic " -"functions or polymorphic parameters." -msgstr "" - -#: ../../howto/clinic.rst:309 -msgid "" -"Next, add the following boilerplate above the function, creating our input " -"block::" -msgstr "" - -#: ../../howto/clinic.rst:315 -msgid "" -"Cut the docstring and paste it in between the ``[clinic]`` lines, removing " -"all the junk that makes it a properly quoted C string. When you're done you " -"should have just the text, based at the left margin, with no line wider than " -"80 characters. Argument Clinic will preserve indents inside the docstring." -msgstr "" - -#: ../../howto/clinic.rst:321 -msgid "" -"If the old docstring had a first line that looked like a function signature, " -"throw that line away; The docstring doesn't need it anymore --- when you " -"use :py:func:`help` on your builtin in the future, the first line will be " -"built automatically based on the function's signature." -msgstr "" - -#: ../../howto/clinic.rst:326 -msgid "Example docstring summary line::" -msgstr "" - -#: ../../howto/clinic.rst:332 -msgid "" -"If your docstring doesn't have a \"summary\" line, Argument Clinic will " -"complain, so let's make sure it has one. The \"summary\" line should be a " -"paragraph consisting of a single 80-column line at the beginning of the " -"docstring. (See :pep:`257` regarding docstring conventions.)" -msgstr "" - -#: ../../howto/clinic.rst:338 -msgid "" -"Our example docstring consists solely of a summary line, so the sample code " -"doesn't have to change for this step." -msgstr "" - -#: ../../howto/clinic.rst:341 -msgid "" -"Now, above the docstring, enter the name of the function, followed by a " -"blank line. This should be the Python name of the function, and should be " -"the full dotted path to the function --- it should start with the name of " -"the module, include any sub-modules, and if the function is a method on a " -"class it should include the class name too." -msgstr "" - -#: ../../howto/clinic.rst:348 -msgid "" -"In our example, :mod:`!_pickle` is the module, :py:class:`!Pickler` is the " -"class, and :py:meth:`!dump` is the method, so the name becomes :py:meth:`!" -"_pickle.Pickler.dump`::" -msgstr "" - -#: ../../howto/clinic.rst:358 -msgid "" -"If this is the first time that module or class has been used with Argument " -"Clinic in this C file, you must declare the module and/or class. Proper " -"Argument Clinic hygiene prefers declaring these in a separate block " -"somewhere near the top of the C file, in the same way that include files and " -"statics go at the top. In our sample code we'll just show the two blocks " -"next to each other." -msgstr "" - -#: ../../howto/clinic.rst:366 -msgid "" -"The name of the class and module should be the same as the one seen by " -"Python. Check the name defined in the :c:type:`PyModuleDef` or :c:type:" -"`PyTypeObject` as appropriate." -msgstr "" - -#: ../../howto/clinic.rst:370 -msgid "" -"When you declare a class, you must also specify two aspects of its type in " -"C: the type declaration you'd use for a pointer to an instance of this " -"class, and a pointer to the :c:type:`!PyTypeObject` for this class::" -msgstr "" - -#: ../../howto/clinic.rst:385 -msgid "" -"Declare each of the parameters to the function. Each parameter should get " -"its own line. All the parameter lines should be indented from the function " -"name and the docstring. The general form of these parameter lines is as " -"follows:" -msgstr "" - -#: ../../howto/clinic.rst:394 -msgid "If the parameter has a default value, add that after the converter:" -msgstr "" - -#: ../../howto/clinic.rst:401 -msgid "" -"Argument Clinic's support for \"default values\" is quite sophisticated; " -"see :ref:`clinic-howto-default-values` for more information." -msgstr "" - -#: ../../howto/clinic.rst:404 -msgid "Next, add a blank line below the parameters." -msgstr "" - -#: ../../howto/clinic.rst:406 -msgid "" -"What's a \"converter\"? It establishes both the type of the variable used in " -"C, and the method to convert the Python value into a C value at runtime. For " -"now you're going to use what's called a \"legacy converter\" --- a " -"convenience syntax intended to make porting old code into Argument Clinic " -"easier." -msgstr "" - -#: ../../howto/clinic.rst:413 -msgid "" -"For each parameter, copy the \"format unit\" for that parameter from the :c:" -"func:`PyArg_Parse` format argument and specify *that* as its converter, as a " -"quoted string. The \"format unit\" is the formal name for the one-to-three " -"character substring of the *format* parameter that tells the argument " -"parsing function what the type of the variable is and how to convert it. For " -"more on format units please see :ref:`arg-parsing`." -msgstr "" - -#: ../../howto/clinic.rst:422 -msgid "" -"For multicharacter format units like ``z#``, use the entire two-or-three " -"character string." -msgstr "" - -#: ../../howto/clinic.rst:425 ../../howto/clinic.rst:460 -#: ../../howto/clinic.rst:488 ../../howto/clinic.rst:594 -#: ../../howto/clinic.rst:647 -msgid "Sample::" -msgstr "" - -#: ../../howto/clinic.rst:440 -msgid "" -"If your function has ``|`` in the format string, meaning some parameters " -"have default values, you can ignore it. Argument Clinic infers which " -"parameters are optional based on whether or not they have default values." -msgstr "" - -#: ../../howto/clinic.rst:445 -msgid "" -"If your function has ``$`` in the format string, meaning it takes keyword-" -"only arguments, specify ``*`` on a line by itself before the first keyword-" -"only argument, indented the same as the parameter lines." -msgstr "" - -#: ../../howto/clinic.rst:450 -msgid "" -":py:meth:`!_pickle.Pickler.dump` has neither, so our sample is unchanged." -msgstr "" - -#: ../../howto/clinic.rst:452 -msgid "" -"Next, if the existing C function calls :c:func:`PyArg_ParseTuple` (as " -"opposed to :c:func:`PyArg_ParseTupleAndKeywords`), then all its arguments " -"are positional-only." -msgstr "" - -#: ../../howto/clinic.rst:456 -msgid "" -"To mark parameters as positional-only in Argument Clinic, add a ``/`` on a " -"line by itself after the last positional-only parameter, indented the same " -"as the parameter lines." -msgstr "" - -#: ../../howto/clinic.rst:476 -msgid "" -"It can be helpful to write a per-parameter docstring for each parameter. " -"Since per-parameter docstrings are optional, you can skip this step if you " -"prefer." -msgstr "" - -#: ../../howto/clinic.rst:480 -msgid "" -"Nevertheless, here's how to add a per-parameter docstring. The first line of " -"the per-parameter docstring must be indented further than the parameter " -"definition. The left margin of this first line establishes the left margin " -"for the whole per-parameter docstring; all the text you write will be " -"outdented by this amount. You can write as much text as you like, across " -"multiple lines if you wish." -msgstr "" - -#: ../../howto/clinic.rst:505 -msgid "" -"Save and close the file, then run ``Tools/clinic/clinic.py`` on it. With " -"luck everything worked---your block now has output, and a :file:`.c.h` file " -"has been generated! Reload the file in your text editor to see the generated " -"code::" -msgstr "" - -#: ../../howto/clinic.rst:524 -msgid "" -"Obviously, if Argument Clinic didn't produce any output, it's because it " -"found an error in your input. Keep fixing your errors and retrying until " -"Argument Clinic processes your file without complaint." -msgstr "" - -#: ../../howto/clinic.rst:529 -msgid "" -"For readability, most of the glue code has been generated to a :file:`.c.h` " -"file. You'll need to include that in your original :file:`.c` file, " -"typically right after the clinic module block::" -msgstr "" - -#: ../../howto/clinic.rst:535 -msgid "" -"Double-check that the argument-parsing code Argument Clinic generated looks " -"basically the same as the existing code." -msgstr "" - -#: ../../howto/clinic.rst:538 -msgid "" -"First, ensure both places use the same argument-parsing function. The " -"existing code must call either :c:func:`PyArg_ParseTuple` or :c:func:" -"`PyArg_ParseTupleAndKeywords`; ensure that the code generated by Argument " -"Clinic calls the *exact* same function." -msgstr "" - -#: ../../howto/clinic.rst:544 -msgid "" -"Second, the format string passed in to :c:func:`!PyArg_ParseTuple` or :c:" -"func:`!PyArg_ParseTupleAndKeywords` should be *exactly* the same as the hand-" -"written one in the existing function, up to the colon or semi-colon." -msgstr "" - -#: ../../howto/clinic.rst:549 -msgid "" -"Argument Clinic always generates its format strings with a ``:`` followed by " -"the name of the function. If the existing code's format string ends with ``;" -"``, to provide usage help, this change is harmless --- don't worry about it." -msgstr "" - -#: ../../howto/clinic.rst:554 -msgid "" -"Third, for parameters whose format units require two arguments, like a " -"length variable, an encoding string, or a pointer to a conversion function, " -"ensure that the second argument is *exactly* the same between the two " -"invocations." -msgstr "" - -#: ../../howto/clinic.rst:559 -msgid "" -"Fourth, inside the output portion of the block, you'll find a preprocessor " -"macro defining the appropriate static :c:type:`PyMethodDef` structure for " -"this builtin::" -msgstr "" - -#: ../../howto/clinic.rst:566 -msgid "" -"This static structure should be *exactly* the same as the existing static :c:" -"type:`!PyMethodDef` structure for this builtin." -msgstr "" - -#: ../../howto/clinic.rst:569 -msgid "" -"If any of these items differ in *any way*, adjust your Argument Clinic " -"function specification and rerun ``Tools/clinic/clinic.py`` until they *are* " -"the same." -msgstr "" - -#: ../../howto/clinic.rst:573 -msgid "" -"Notice that the last line of its output is the declaration of your \"impl\" " -"function. This is where the builtin's implementation goes. Delete the " -"existing prototype of the function you're modifying, but leave the opening " -"curly brace. Now delete its argument parsing code and the declarations of " -"all the variables it dumps the arguments into. Notice how the Python " -"arguments are now arguments to this impl function; if the implementation " -"used different names for these variables, fix it." -msgstr "" - -#: ../../howto/clinic.rst:581 -msgid "" -"Let's reiterate, just because it's kind of weird. Your code should now look " -"like this::" -msgstr "" - -#: ../../howto/clinic.rst:590 -msgid "" -"Argument Clinic generated the checksum line and the function prototype just " -"above it. You should write the opening and closing curly braces for the " -"function, and the implementation inside." -msgstr "" - -#: ../../howto/clinic.rst:636 -msgid "" -"Remember the macro with the :c:type:`PyMethodDef` structure for this " -"function? Find the existing :c:type:`!PyMethodDef` structure for this " -"function and replace it with a reference to the macro. If the builtin is at " -"module scope, this will probably be very near the end of the file; if the " -"builtin is a class method, this will probably be below but relatively near " -"to the implementation." -msgstr "" - -#: ../../howto/clinic.rst:643 -msgid "" -"Note that the body of the macro contains a trailing comma; when you replace " -"the existing static :c:type:`!PyMethodDef` structure with the macro, *don't* " -"add a comma to the end." -msgstr "" - -#: ../../howto/clinic.rst:655 -msgid "Argument Clinic may generate new instances of ``_Py_ID``. For example::" -msgstr "" - -#: ../../howto/clinic.rst:659 -msgid "" -"If it does, you'll have to run ``make regen-global-objects`` to regenerate " -"the list of precompiled identifiers at this point." -msgstr "" - -#: ../../howto/clinic.rst:662 -msgid "" -"Finally, compile, then run the relevant portions of the regression-test " -"suite. This change should not introduce any new compile-time warnings or " -"errors, and there should be no externally visible change to Python's " -"behavior, except for one difference: :py:func:`inspect.signature` run on " -"your function should now provide a valid signature!" -msgstr "" - -#: ../../howto/clinic.rst:668 -msgid "" -"Congratulations, you've ported your first function to work with Argument " -"Clinic!" -msgstr "" - -#: ../../howto/clinic.rst:674 -msgid "How-to guides" -msgstr "" - -#: ../../howto/clinic.rst:678 -msgid "How to rename C functions and variables generated by Argument Clinic" -msgstr "" - -#: ../../howto/clinic.rst:680 -msgid "" -"Argument Clinic automatically names the functions it generates for you. " -"Occasionally this may cause a problem, if the generated name collides with " -"the name of an existing C function. There's an easy solution: override the " -"names used for the C functions. Just add the keyword ``\"as\"`` to your " -"function declaration line, followed by the function name you wish to use. " -"Argument Clinic will use that function name for the base (generated) " -"function, then add ``\"_impl\"`` to the end and use that for the name of the " -"impl function." -msgstr "" - -#: ../../howto/clinic.rst:688 -msgid "" -"For example, if we wanted to rename the C function names generated for :py:" -"meth:`pickle.Pickler.dump`, it'd look like this::" -msgstr "" - -#: ../../howto/clinic.rst:696 -msgid "" -"The base function would now be named :c:func:`!pickler_dumper`, and the impl " -"function would now be named :c:func:`!pickler_dumper_impl`." -msgstr "" - -#: ../../howto/clinic.rst:700 -msgid "" -"Similarly, you may have a problem where you want to give a parameter a " -"specific Python name, but that name may be inconvenient in C. Argument " -"Clinic allows you to give a parameter different names in Python and in C, " -"using the same ``\"as\"`` syntax::" -msgstr "" - -#: ../../howto/clinic.rst:714 -msgid "" -"Here, the name used in Python (in the signature and the ``keywords`` array) " -"would be *file*, but the C variable would be named ``file_obj``." -msgstr "" - -#: ../../howto/clinic.rst:717 -msgid "You can use this to rename the *self* parameter too!" -msgstr "" - -#: ../../howto/clinic.rst:721 -msgid "How to convert functions using ``PyArg_UnpackTuple``" -msgstr "" - -#: ../../howto/clinic.rst:723 -msgid "" -"To convert a function parsing its arguments with :c:func:" -"`PyArg_UnpackTuple`, simply write out all the arguments, specifying each as " -"an ``object``. You may specify the *type* argument to cast the type as " -"appropriate. All arguments should be marked positional-only (add a ``/`` on " -"a line by itself after the last argument)." -msgstr "" - -#: ../../howto/clinic.rst:729 -msgid "" -"Currently the generated code will use :c:func:`PyArg_ParseTuple`, but this " -"will change soon." -msgstr "" - -#: ../../howto/clinic.rst:734 -msgid "How to use optional groups" -msgstr "" - -#: ../../howto/clinic.rst:736 -msgid "" -"Some legacy functions have a tricky approach to parsing their arguments: " -"they count the number of positional arguments, then use a ``switch`` " -"statement to call one of several different :c:func:`PyArg_ParseTuple` calls " -"depending on how many positional arguments there are. (These functions " -"cannot accept keyword-only arguments.) This approach was used to simulate " -"optional arguments back before :c:func:`PyArg_ParseTupleAndKeywords` was " -"created." -msgstr "" - -#: ../../howto/clinic.rst:743 -msgid "" -"While functions using this approach can often be converted to use :c:func:`!" -"PyArg_ParseTupleAndKeywords`, optional arguments, and default values, it's " -"not always possible. Some of these legacy functions have behaviors :c:func:" -"`!PyArg_ParseTupleAndKeywords` doesn't directly support. The most obvious " -"example is the builtin function :py:func:`range`, which has an optional " -"argument on the *left* side of its required argument! Another example is :py:" -"meth:`curses.window.addch`, which has a group of two arguments that must " -"always be specified together. (The arguments are called *x* and *y*; if you " -"call the function passing in *x*, you must also pass in *y* — and if you " -"don't pass in *x* you may not pass in *y* either.)" -msgstr "" - -#: ../../howto/clinic.rst:755 -msgid "" -"In any case, the goal of Argument Clinic is to support argument parsing for " -"all existing CPython builtins without changing their semantics. Therefore " -"Argument Clinic supports this alternate approach to parsing, using what are " -"called *optional groups*. Optional groups are groups of arguments that must " -"all be passed in together. They can be to the left or the right of the " -"required arguments. They can *only* be used with positional-only parameters." -msgstr "" - -#: ../../howto/clinic.rst:763 -msgid "" -"Optional groups are *only* intended for use when converting functions that " -"make multiple calls to :c:func:`PyArg_ParseTuple`! Functions that use *any* " -"other approach for parsing arguments should *almost never* be converted to " -"Argument Clinic using optional groups. Functions using optional groups " -"currently cannot have accurate signatures in Python, because Python just " -"doesn't understand the concept. Please avoid using optional groups wherever " -"possible." -msgstr "" - -#: ../../howto/clinic.rst:772 -msgid "" -"To specify an optional group, add a ``[`` on a line by itself before the " -"parameters you wish to group together, and a ``]`` on a line by itself after " -"these parameters. As an example, here's how :py:meth:`curses.window.addch` " -"uses optional groups to make the first two parameters and the last parameter " -"optional::" -msgstr "" - -#: ../../howto/clinic.rst:801 -msgid "Notes:" -msgstr "註解:" - -#: ../../howto/clinic.rst:803 -msgid "" -"For every optional group, one additional parameter will be passed into the " -"impl function representing the group. The parameter will be an int named " -"``group_{direction}_{number}``, where ``{direction}`` is either ``right`` or " -"``left`` depending on whether the group is before or after the required " -"parameters, and ``{number}`` is a monotonically increasing number (starting " -"at 1) indicating how far away the group is from the required parameters. " -"When the impl is called, this parameter will be set to zero if this group " -"was unused, and set to non-zero if this group was used. (By used or unused, " -"I mean whether or not the parameters received arguments in this invocation.)" -msgstr "" - -#: ../../howto/clinic.rst:814 -msgid "" -"If there are no required arguments, the optional groups will behave as if " -"they're to the right of the required arguments." -msgstr "" - -#: ../../howto/clinic.rst:817 -msgid "" -"In the case of ambiguity, the argument parsing code favors parameters on the " -"left (before the required parameters)." -msgstr "" - -#: ../../howto/clinic.rst:820 -msgid "Optional groups can only contain positional-only parameters." -msgstr "" - -#: ../../howto/clinic.rst:822 -msgid "" -"Optional groups are *only* intended for legacy code. Please do not use " -"optional groups for new code." -msgstr "" - -#: ../../howto/clinic.rst:827 -msgid "" -"How to use real Argument Clinic converters, instead of \"legacy converters\"" -msgstr "" - -#: ../../howto/clinic.rst:829 -msgid "" -"To save time, and to minimize how much you need to learn to achieve your " -"first port to Argument Clinic, the walkthrough above tells you to use " -"\"legacy converters\". \"Legacy converters\" are a convenience, designed " -"explicitly to make porting existing code to Argument Clinic easier. And to " -"be clear, their use is acceptable when porting code for Python 3.4." -msgstr "" - -#: ../../howto/clinic.rst:836 -msgid "" -"However, in the long term we probably want all our blocks to use Argument " -"Clinic's real syntax for converters. Why? A couple reasons:" -msgstr "" - -#: ../../howto/clinic.rst:840 -msgid "" -"The proper converters are far easier to read and clearer in their intent." -msgstr "" - -#: ../../howto/clinic.rst:841 -msgid "" -"There are some format units that are unsupported as \"legacy converters\", " -"because they require arguments, and the legacy converter syntax doesn't " -"support specifying arguments." -msgstr "" - -#: ../../howto/clinic.rst:844 -msgid "" -"In the future we may have a new argument parsing library that isn't " -"restricted to what :c:func:`PyArg_ParseTuple` supports; this flexibility " -"won't be available to parameters using legacy converters." -msgstr "" - -#: ../../howto/clinic.rst:848 -msgid "" -"Therefore, if you don't mind a little extra effort, please use the normal " -"converters instead of legacy converters." -msgstr "" - -#: ../../howto/clinic.rst:851 -msgid "" -"In a nutshell, the syntax for Argument Clinic (non-legacy) converters looks " -"like a Python function call. However, if there are no explicit arguments to " -"the function (all functions take their default values), you may omit the " -"parentheses. Thus ``bool`` and ``bool()`` are exactly the same converters." -msgstr "" - -#: ../../howto/clinic.rst:857 -msgid "" -"All arguments to Argument Clinic converters are keyword-only. All Argument " -"Clinic converters accept the following arguments:" -msgstr "" - -#: ../../howto/clinic.rst:865 -msgid "*c_default*" -msgstr "*c_default*" - -#: ../../howto/clinic.rst:861 -msgid "" -"The default value for this parameter when defined in C. Specifically, this " -"will be the initializer for the variable declared in the \"parse " -"function\". See :ref:`the section on default values ` for " -"how to use this. Specified as a string." -msgstr "" - -#: ../../howto/clinic.rst:870 -msgid "*annotation*" -msgstr "*annotation*" - -#: ../../howto/clinic.rst:868 -msgid "" -"The annotation value for this parameter. Not currently supported, because :" -"pep:`8` mandates that the Python library may not use annotations." -msgstr "" - -#: ../../howto/clinic.rst:873 -msgid "*unused*" -msgstr "*unused*" - -#: ../../howto/clinic.rst:873 -msgid "" -"Wrap the argument with :c:macro:`Py_UNUSED` in the impl function signature." -msgstr "" - -#: ../../howto/clinic.rst:875 -msgid "" -"In addition, some converters accept additional arguments. Here is a list of " -"these arguments, along with their meanings:" -msgstr "" - -#: ../../howto/clinic.rst:884 -msgid "*accept*" -msgstr "*accept*" - -#: ../../howto/clinic.rst:879 -msgid "" -"A set of Python types (and possibly pseudo-types); this restricts the " -"allowable Python argument to values of these types. (This is not a general-" -"purpose facility; as a rule it only supports specific lists of types as " -"shown in the legacy converter table.)" -msgstr "" - -#: ../../howto/clinic.rst:884 -msgid "To accept ``None``, add ``NoneType`` to this set." -msgstr "" - -#: ../../howto/clinic.rst:889 -msgid "*bitwise*" -msgstr "*bitwise*" - -#: ../../howto/clinic.rst:887 -msgid "" -"Only supported for unsigned integers. The native integer value of this " -"Python argument will be written to the parameter without any range checking, " -"even for negative values." -msgstr "" - -#: ../../howto/clinic.rst:894 -msgid "*converter*" -msgstr "*converter*" - -#: ../../howto/clinic.rst:892 -msgid "" -"Only supported by the ``object`` converter. Specifies the name of a :ref:`C " -"\"converter function\" ` to use to convert this object to a " -"native type." -msgstr "" - -#: ../../howto/clinic.rst:899 -msgid "*encoding*" -msgstr "*encoding*" - -#: ../../howto/clinic.rst:897 -msgid "" -"Only supported for strings. Specifies the encoding to use when converting " -"this string from a Python str (Unicode) value into a C ``char *`` value." -msgstr "" - -#: ../../howto/clinic.rst:903 -msgid "*subclass_of*" -msgstr "*subclass_of*" - -#: ../../howto/clinic.rst:902 -msgid "" -"Only supported for the ``object`` converter. Requires that the Python value " -"be a subclass of a Python type, as expressed in C." -msgstr "" - -#: ../../howto/clinic.rst:908 -msgid "*type*" -msgstr "" - -#: ../../howto/clinic.rst:906 -msgid "" -"Only supported for the ``object`` and ``self`` converters. Specifies the C " -"type that will be used to declare the variable. Default value is " -"``\"PyObject *\"``." -msgstr "" - -#: ../../howto/clinic.rst:914 -msgid "*zeroes*" -msgstr "*zeroes*" - -#: ../../howto/clinic.rst:911 -msgid "" -"Only supported for strings. If true, embedded NUL bytes (``'\\\\0'``) are " -"permitted inside the value. The length of the string will be passed in to " -"the impl function, just after the string parameter, as a parameter named " -"``_length``." -msgstr "" - -#: ../../howto/clinic.rst:916 -msgid "" -"Please note, not every possible combination of arguments will work. Usually " -"these arguments are implemented by specific :c:func:`PyArg_ParseTuple` " -"*format units*, with specific behavior. For example, currently you cannot " -"call ``unsigned_short`` without also specifying ``bitwise=True``. Although " -"it's perfectly reasonable to think this would work, these semantics don't " -"map to any existing format unit. So Argument Clinic doesn't support it. " -"(Or, at least, not yet.)" -msgstr "" - -#: ../../howto/clinic.rst:924 -msgid "" -"Below is a table showing the mapping of legacy converters into real Argument " -"Clinic converters. On the left is the legacy converter, on the right is the " -"text you'd replace it with." -msgstr "" - -#: ../../howto/clinic.rst:929 -msgid "``'B'``" -msgstr "``'B'``" - -#: ../../howto/clinic.rst:929 -msgid "``unsigned_char(bitwise=True)``" -msgstr "``unsigned_char(bitwise=True)``" - -#: ../../howto/clinic.rst:930 -msgid "``'b'``" -msgstr "``'b'``" - -#: ../../howto/clinic.rst:930 -msgid "``unsigned_char``" -msgstr "``unsigned_char``" - -#: ../../howto/clinic.rst:931 -msgid "``'c'``" -msgstr "``'c'``" - -#: ../../howto/clinic.rst:931 -msgid "``char``" -msgstr "``char``" - -#: ../../howto/clinic.rst:932 -msgid "``'C'``" -msgstr "``'C'``" - -#: ../../howto/clinic.rst:932 -msgid "``int(accept={str})``" -msgstr "``int(accept={str})``" - -#: ../../howto/clinic.rst:933 -msgid "``'d'``" -msgstr "``'d'``" - -#: ../../howto/clinic.rst:933 -msgid "``double``" -msgstr "``double``" - -#: ../../howto/clinic.rst:934 -msgid "``'D'``" -msgstr "``'D'``" - -#: ../../howto/clinic.rst:934 -msgid "``Py_complex``" -msgstr "``Py_complex``" - -#: ../../howto/clinic.rst:935 -msgid "``'es'``" -msgstr "``'es'``" - -#: ../../howto/clinic.rst:935 -msgid "``str(encoding='name_of_encoding')``" -msgstr "``str(encoding='name_of_encoding')``" - -#: ../../howto/clinic.rst:936 -msgid "``'es#'``" -msgstr "``'es#'``" - -#: ../../howto/clinic.rst:936 -msgid "``str(encoding='name_of_encoding', zeroes=True)``" -msgstr "``str(encoding='name_of_encoding', zeroes=True)``" - -#: ../../howto/clinic.rst:937 -msgid "``'et'``" -msgstr "``'et'``" - -#: ../../howto/clinic.rst:937 -msgid "``str(encoding='name_of_encoding', accept={bytes, bytearray, str})``" -msgstr "``str(encoding='name_of_encoding', accept={bytes, bytearray, str})``" - -#: ../../howto/clinic.rst:938 -msgid "``'et#'``" -msgstr "``'et#'``" - -#: ../../howto/clinic.rst:938 -msgid "" -"``str(encoding='name_of_encoding', accept={bytes, bytearray, str}, " -"zeroes=True)``" -msgstr "" - -#: ../../howto/clinic.rst:939 -msgid "``'f'``" -msgstr "``'f'``" - -#: ../../howto/clinic.rst:939 -msgid "``float``" -msgstr "``float``" - -#: ../../howto/clinic.rst:940 -msgid "``'h'``" -msgstr "``'h'``" - -#: ../../howto/clinic.rst:940 -msgid "``short``" -msgstr "``short``" - -#: ../../howto/clinic.rst:941 -msgid "``'H'``" -msgstr "``'H'``" - -#: ../../howto/clinic.rst:941 -msgid "``unsigned_short(bitwise=True)``" -msgstr "``unsigned_short(bitwise=True)``" - -#: ../../howto/clinic.rst:942 -msgid "``'i'``" -msgstr "``'i'``" - -#: ../../howto/clinic.rst:942 -msgid "``int``" -msgstr "``int``" - -#: ../../howto/clinic.rst:943 -msgid "``'I'``" -msgstr "``'I'``" - -#: ../../howto/clinic.rst:943 -msgid "``unsigned_int(bitwise=True)``" -msgstr "``unsigned_int(bitwise=True)``" - -#: ../../howto/clinic.rst:944 -msgid "``'k'``" -msgstr "``'k'``" - -#: ../../howto/clinic.rst:944 -msgid "``unsigned_long(bitwise=True)``" -msgstr "``unsigned_long(bitwise=True)``" - -#: ../../howto/clinic.rst:945 -msgid "``'K'``" -msgstr "``'K'``" - -#: ../../howto/clinic.rst:945 -msgid "``unsigned_long_long(bitwise=True)``" -msgstr "``unsigned_long_long(bitwise=True)``" - -#: ../../howto/clinic.rst:946 -msgid "``'l'``" -msgstr "``'l'``" - -#: ../../howto/clinic.rst:946 -msgid "``long``" -msgstr "``long``" - -#: ../../howto/clinic.rst:947 -msgid "``'L'``" -msgstr "``'L'``" - -#: ../../howto/clinic.rst:947 -msgid "``long long``" -msgstr "``long long``" - -#: ../../howto/clinic.rst:948 -msgid "``'n'``" -msgstr "``'n'``" - -#: ../../howto/clinic.rst:948 -msgid "``Py_ssize_t``" -msgstr "``Py_ssize_t``" - -#: ../../howto/clinic.rst:949 -msgid "``'O'``" -msgstr "``'O'``" - -#: ../../howto/clinic.rst:949 -msgid "``object``" -msgstr "``object``" - -#: ../../howto/clinic.rst:950 -msgid "``'O!'``" -msgstr "``'O!'``" - -#: ../../howto/clinic.rst:950 -msgid "``object(subclass_of='&PySomething_Type')``" -msgstr "``object(subclass_of='&PySomething_Type')``" - -#: ../../howto/clinic.rst:951 -msgid "``'O&'``" -msgstr "``'O&'``" - -#: ../../howto/clinic.rst:951 -msgid "``object(converter='name_of_c_function')``" -msgstr "``object(converter='name_of_c_function')``" - -#: ../../howto/clinic.rst:952 -msgid "``'p'``" -msgstr "``'p'``" - -#: ../../howto/clinic.rst:952 -msgid "``bool``" -msgstr "``bool``" - -#: ../../howto/clinic.rst:953 -msgid "``'S'``" -msgstr "``'S'``" - -#: ../../howto/clinic.rst:953 -msgid "``PyBytesObject``" -msgstr "``PyBytesObject``" - -#: ../../howto/clinic.rst:954 -msgid "``'s'``" -msgstr "``'s'``" - -#: ../../howto/clinic.rst:954 -msgid "``str``" -msgstr "``str``" - -#: ../../howto/clinic.rst:955 -msgid "``'s#'``" -msgstr "``'s#'``" - -#: ../../howto/clinic.rst:955 -msgid "``str(zeroes=True)``" -msgstr "``str(zeroes=True)``" - -#: ../../howto/clinic.rst:956 -msgid "``'s*'``" -msgstr "``'s*'``" - -#: ../../howto/clinic.rst:956 -msgid "``Py_buffer(accept={buffer, str})``" -msgstr "``Py_buffer(accept={buffer, str})``" - -#: ../../howto/clinic.rst:957 -msgid "``'U'``" -msgstr "``'U'``" - -#: ../../howto/clinic.rst:957 -msgid "``unicode``" -msgstr "``unicode``" - -#: ../../howto/clinic.rst:958 -msgid "``'u'``" -msgstr "``'u'``" - -#: ../../howto/clinic.rst:958 -msgid "``wchar_t``" -msgstr "``wchar_t``" - -#: ../../howto/clinic.rst:959 -msgid "``'u#'``" -msgstr "``'u#'``" - -#: ../../howto/clinic.rst:959 -msgid "``wchar_t(zeroes=True)``" -msgstr "``wchar_t(zeroes=True)``" - -#: ../../howto/clinic.rst:960 -msgid "``'w*'``" -msgstr "``'w*'``" - -#: ../../howto/clinic.rst:960 -msgid "``Py_buffer(accept={rwbuffer})``" -msgstr "``Py_buffer(accept={rwbuffer})``" - -#: ../../howto/clinic.rst:961 -msgid "``'Y'``" -msgstr "``'Y'``" - -#: ../../howto/clinic.rst:961 -msgid "``PyByteArrayObject``" -msgstr "``PyByteArrayObject``" - -#: ../../howto/clinic.rst:962 -msgid "``'y'``" -msgstr "``'y'``" - -#: ../../howto/clinic.rst:962 -msgid "``str(accept={bytes})``" -msgstr "``str(accept={bytes})``" - -#: ../../howto/clinic.rst:963 -msgid "``'y#'``" -msgstr "``'y#'``" - -#: ../../howto/clinic.rst:963 -msgid "``str(accept={robuffer}, zeroes=True)``" -msgstr "``str(accept={robuffer}, zeroes=True)``" - -#: ../../howto/clinic.rst:964 -msgid "``'y*'``" -msgstr "``'y*'``" - -#: ../../howto/clinic.rst:964 -msgid "``Py_buffer``" -msgstr "``Py_buffer``" - -#: ../../howto/clinic.rst:965 -msgid "``'Z'``" -msgstr "``'Z'``" - -#: ../../howto/clinic.rst:965 -msgid "``wchar_t(accept={str, NoneType})``" -msgstr "``wchar_t(accept={str, NoneType})``" - -#: ../../howto/clinic.rst:966 -msgid "``'Z#'``" -msgstr "``'Z#'``" - -#: ../../howto/clinic.rst:966 -msgid "``wchar_t(accept={str, NoneType}, zeroes=True)``" -msgstr "``wchar_t(accept={str, NoneType}, zeroes=True)``" - -#: ../../howto/clinic.rst:967 -msgid "``'z'``" -msgstr "``'z'``" - -#: ../../howto/clinic.rst:967 -msgid "``str(accept={str, NoneType})``" -msgstr "``str(accept={str, NoneType})``" - -#: ../../howto/clinic.rst:968 -msgid "``'z#'``" -msgstr "``'z#'``" - -#: ../../howto/clinic.rst:968 -msgid "``str(accept={str, NoneType}, zeroes=True)``" -msgstr "``str(accept={str, NoneType}, zeroes=True)``" - -#: ../../howto/clinic.rst:969 -msgid "``'z*'``" -msgstr "``'z*'``" - -#: ../../howto/clinic.rst:969 -msgid "``Py_buffer(accept={buffer, str, NoneType})``" -msgstr "``Py_buffer(accept={buffer, str, NoneType})``" - -#: ../../howto/clinic.rst:972 -msgid "" -"As an example, here's our sample ``pickle.Pickler.dump`` using the proper " -"converter::" -msgstr "" - -#: ../../howto/clinic.rst:985 -msgid "" -"One advantage of real converters is that they're more flexible than legacy " -"converters. For example, the ``unsigned_int`` converter (and all the " -"``unsigned_`` converters) can be specified without ``bitwise=True``. Their " -"default behavior performs range checking on the value, and they won't accept " -"negative numbers. You just can't do that with a legacy converter!" -msgstr "" - -#: ../../howto/clinic.rst:991 -msgid "" -"Argument Clinic will show you all the converters it has available. For each " -"converter it'll show you all the parameters it accepts, along with the " -"default value for each parameter. Just run ``Tools/clinic/clinic.py --" -"converters`` to see the full list." -msgstr "" - -#: ../../howto/clinic.rst:998 -msgid "How to use the ``Py_buffer`` converter" -msgstr "" - -#: ../../howto/clinic.rst:1000 -msgid "" -"When using the ``Py_buffer`` converter (or the ``'s*'``, ``'w*'``, ``'*y'``, " -"or ``'z*'`` legacy converters), you *must* not call :c:func:" -"`PyBuffer_Release` on the provided buffer. Argument Clinic generates code " -"that does it for you (in the parsing function)." -msgstr "" - -#: ../../howto/clinic.rst:1009 -msgid "How to use advanced converters" -msgstr "" - -#: ../../howto/clinic.rst:1011 -msgid "" -"Remember those format units you skipped for your first time because they " -"were advanced? Here's how to handle those too." -msgstr "" - -#: ../../howto/clinic.rst:1014 -msgid "" -"The trick is, all those format units take arguments—either conversion " -"functions, or types, or strings specifying an encoding. (But \"legacy " -"converters\" don't support arguments. That's why we skipped them for your " -"first function.) The argument you specified to the format unit is now an " -"argument to the converter; this argument is either *converter* (for ``O&``), " -"*subclass_of* (for ``O!``), or *encoding* (for all the format units that " -"start with ``e``)." -msgstr "" - -#: ../../howto/clinic.rst:1022 -msgid "" -"When using *subclass_of*, you may also want to use the other custom argument " -"for ``object()``: *type*, which lets you set the type actually used for the " -"parameter. For example, if you want to ensure that the object is a subclass " -"of :c:var:`PyUnicode_Type`, you probably want to use the converter " -"``object(type='PyUnicodeObject *', subclass_of='&PyUnicode_Type')``." -msgstr "" - -#: ../../howto/clinic.rst:1028 -msgid "" -"One possible problem with using Argument Clinic: it takes away some possible " -"flexibility for the format units starting with ``e``. When writing a :c:" -"func:`!PyArg_Parse*` call by hand, you could theoretically decide at runtime " -"what encoding string to pass to that call. But now this string must be " -"hard-coded at Argument-Clinic-preprocessing-time. This limitation is " -"deliberate; it made supporting this format unit much easier, and may allow " -"for future optimizations. This restriction doesn't seem unreasonable; " -"CPython itself always passes in static hard-coded encoding strings for " -"parameters whose format units start with ``e``." -msgstr "" - -#: ../../howto/clinic.rst:1042 -msgid "How to assign default values to parameter" -msgstr "" - -#: ../../howto/clinic.rst:1044 -msgid "" -"Default values for parameters can be any of a number of values. At their " -"simplest, they can be string, int, or float literals:" -msgstr "" - -#: ../../howto/clinic.rst:1053 -msgid "They can also use any of Python's built-in constants:" -msgstr "" - -#: ../../howto/clinic.rst:1061 -msgid "" -"There's also special support for a default value of ``NULL``, and for simple " -"expressions, documented in the following sections." -msgstr "" - -#: ../../howto/clinic.rst:1066 -msgid "The ``NULL`` default value" -msgstr "" - -#: ../../howto/clinic.rst:1068 -msgid "" -"For string and object parameters, you can set them to ``None`` to indicate " -"that there's no default. However, that means the C variable will be " -"initialized to ``Py_None``. For convenience's sakes, there's a special " -"value called ``NULL`` for just this reason: from Python's perspective it " -"behaves like a default value of ``None``, but the C variable is initialized " -"with ``NULL``." -msgstr "" - -#: ../../howto/clinic.rst:1077 -msgid "Symbolic default values" -msgstr "" - -#: ../../howto/clinic.rst:1079 -msgid "" -"The default value you provide for a parameter can't be any arbitrary " -"expression. Currently the following are explicitly supported:" -msgstr "" - -#: ../../howto/clinic.rst:1082 -msgid "Numeric constants (integer and float)" -msgstr "" - -#: ../../howto/clinic.rst:1083 -msgid "String constants" -msgstr "" - -#: ../../howto/clinic.rst:1084 -msgid "``True``, ``False``, and ``None``" -msgstr "``True``、``False`` 和 ``None``" - -#: ../../howto/clinic.rst:1085 -msgid "" -"Simple symbolic constants like :py:data:`sys.maxsize`, which must start with " -"the name of the module" -msgstr "" - -#: ../../howto/clinic.rst:1088 -msgid "" -"(In the future, this may need to get even more elaborate, to allow full " -"expressions like ``CONSTANT - 1``.)" -msgstr "" - -#: ../../howto/clinic.rst:1093 -msgid "Expressions as default values" -msgstr "" - -#: ../../howto/clinic.rst:1095 -msgid "" -"The default value for a parameter can be more than just a literal value. It " -"can be an entire expression, using math operators and looking up attributes " -"on objects. However, this support isn't exactly simple, because of some non-" -"obvious semantics." -msgstr "" - -#: ../../howto/clinic.rst:1100 -msgid "Consider the following example:" -msgstr "" - -#: ../../howto/clinic.rst:1106 -msgid "" -":py:data:`sys.maxsize` can have different values on different platforms. " -"Therefore Argument Clinic can't simply evaluate that expression locally and " -"hard-code it in C. So it stores the default in such a way that it will get " -"evaluated at runtime, when the user asks for the function's signature." -msgstr "" - -#: ../../howto/clinic.rst:1111 -msgid "" -"What namespace is available when the expression is evaluated? It's " -"evaluated in the context of the module the builtin came from. So, if your " -"module has an attribute called :py:attr:`!max_widgets`, you may simply use " -"it:" -msgstr "" - -#: ../../howto/clinic.rst:1119 -msgid "" -"If the symbol isn't found in the current module, it fails over to looking " -"in :py:data:`sys.modules`. That's how it can find :py:data:`sys.maxsize` " -"for example. (Since you don't know in advance what modules the user will " -"load into their interpreter, it's best to restrict yourself to modules that " -"are preloaded by Python itself.)" -msgstr "" - -#: ../../howto/clinic.rst:1124 -msgid "" -"Evaluating default values only at runtime means Argument Clinic can't " -"compute the correct equivalent C default value. So you need to tell it " -"explicitly. When you use an expression, you must also specify the equivalent " -"expression in C, using the *c_default* parameter to the converter:" -msgstr "" - -#: ../../howto/clinic.rst:1133 -msgid "" -"Another complication: Argument Clinic can't know in advance whether or not " -"the expression you supply is valid. It parses it to make sure it looks " -"legal, but it can't *actually* know. You must be very careful when using " -"expressions to specify values that are guaranteed to be valid at runtime!" -msgstr "" - -#: ../../howto/clinic.rst:1138 -msgid "" -"Finally, because expressions must be representable as static C values, there " -"are many restrictions on legal expressions. Here's a list of Python " -"features you're not permitted to use:" -msgstr "" - -#: ../../howto/clinic.rst:1142 -msgid "Function calls." -msgstr "" - -#: ../../howto/clinic.rst:1143 -msgid "Inline if statements (``3 if foo else 5``)." -msgstr "" - -#: ../../howto/clinic.rst:1144 -msgid "Automatic sequence unpacking (``*[1, 2, 3]``)." -msgstr "" - -#: ../../howto/clinic.rst:1145 -msgid "List/set/dict comprehensions and generator expressions." -msgstr "" - -#: ../../howto/clinic.rst:1146 -msgid "Tuple/list/set/dict literals." -msgstr "" - -#: ../../howto/clinic.rst:1152 -msgid "How to use return converters" -msgstr "" - -#: ../../howto/clinic.rst:1154 -msgid "" -"By default, the impl function Argument Clinic generates for you returns :c:" -"type:`PyObject * `. But your C function often computes some C " -"type, then converts it into the :c:type:`!PyObject *` at the last moment. " -"Argument Clinic handles converting your inputs from Python types into native " -"C types—why not have it convert your return value from a native C type into " -"a Python type too?" -msgstr "" - -#: ../../howto/clinic.rst:1162 -msgid "" -"That's what a \"return converter\" does. It changes your impl function to " -"return some C type, then adds code to the generated (non-impl) function to " -"handle converting that value into the appropriate :c:type:`!PyObject *`." -msgstr "" - -#: ../../howto/clinic.rst:1166 -msgid "" -"The syntax for return converters is similar to that of parameter converters. " -"You specify the return converter like it was a return annotation on the " -"function itself, using ``->`` notation." -msgstr "" - -#: ../../howto/clinic.rst:1170 -msgid "For example:" -msgstr "" - -#: ../../howto/clinic.rst:1183 -msgid "" -"Return converters behave much the same as parameter converters; they take " -"arguments, the arguments are all keyword-only, and if you're not changing " -"any of the default arguments you can omit the parentheses." -msgstr "" - -#: ../../howto/clinic.rst:1187 -msgid "" -"(If you use both ``\"as\"`` *and* a return converter for your function, the " -"``\"as\"`` should come before the return converter.)" -msgstr "" - -#: ../../howto/clinic.rst:1190 -msgid "" -"There's one additional complication when using return converters: how do you " -"indicate an error has occurred? Normally, a function returns a valid (non-" -"``NULL``) pointer for success, and ``NULL`` for failure. But if you use an " -"integer return converter, all integers are valid. How can Argument Clinic " -"detect an error? Its solution: each return converter implicitly looks for a " -"special value that indicates an error. If you return that value, and an " -"error has been set (c:func:`PyErr_Occurred` returns a true value), then the " -"generated code will propagate the error. Otherwise it will encode the value " -"you return like normal." -msgstr "" - -#: ../../howto/clinic.rst:1199 -msgid "Currently Argument Clinic supports only a few return converters:" -msgstr "" - -#: ../../howto/clinic.rst:1213 -msgid "" -"None of these take parameters. For all of these, return ``-1`` to indicate " -"error." -msgstr "" - -#: ../../howto/clinic.rst:1216 -msgid "" -"To see all the return converters Argument Clinic supports, along with their " -"parameters (if any), just run ``Tools/clinic/clinic.py --converters`` for " -"the full list." -msgstr "" - -#: ../../howto/clinic.rst:1222 -msgid "How to clone existing functions" -msgstr "" - -#: ../../howto/clinic.rst:1224 -msgid "" -"If you have a number of functions that look similar, you may be able to use " -"Clinic's \"clone\" feature. When you clone an existing function, you reuse:" -msgstr "" - -#: ../../howto/clinic.rst:1228 -msgid "its parameters, including" -msgstr "" - -#: ../../howto/clinic.rst:1230 -msgid "their names," -msgstr "" - -#: ../../howto/clinic.rst:1232 -msgid "their converters, with all parameters," -msgstr "" - -#: ../../howto/clinic.rst:1234 -msgid "their default values," -msgstr "" - -#: ../../howto/clinic.rst:1236 -msgid "their per-parameter docstrings," -msgstr "" - -#: ../../howto/clinic.rst:1238 -msgid "" -"their *kind* (whether they're positional only, positional or keyword, or " -"keyword only), and" -msgstr "" - -#: ../../howto/clinic.rst:1241 -msgid "its return converter." -msgstr "" - -#: ../../howto/clinic.rst:1243 -msgid "" -"The only thing not copied from the original function is its docstring; the " -"syntax allows you to specify a new docstring." -msgstr "" - -#: ../../howto/clinic.rst:1246 -msgid "Here's the syntax for cloning a function::" -msgstr "" - -#: ../../howto/clinic.rst:1254 -msgid "" -"(The functions can be in different modules or classes. I wrote ``module." -"class`` in the sample just to illustrate that you must use the full path to " -"*both* functions.)" -msgstr "" - -#: ../../howto/clinic.rst:1258 -msgid "" -"Sorry, there's no syntax for partially cloning a function, or cloning a " -"function then modifying it. Cloning is an all-or nothing proposition." -msgstr "" - -#: ../../howto/clinic.rst:1261 -msgid "" -"Also, the function you are cloning from must have been previously defined in " -"the current file." -msgstr "" - -#: ../../howto/clinic.rst:1266 -msgid "How to call Python code" -msgstr "" - -#: ../../howto/clinic.rst:1268 -msgid "" -"The rest of the advanced topics require you to write Python code which lives " -"inside your C file and modifies Argument Clinic's runtime state. This is " -"simple: you simply define a Python block." -msgstr "" - -#: ../../howto/clinic.rst:1272 -msgid "" -"A Python block uses different delimiter lines than an Argument Clinic " -"function block. It looks like this::" -msgstr "" - -#: ../../howto/clinic.rst:1279 -msgid "" -"All the code inside the Python block is executed at the time it's parsed. " -"All text written to stdout inside the block is redirected into the " -"\"output\" after the block." -msgstr "" - -#: ../../howto/clinic.rst:1283 -msgid "" -"As an example, here's a Python block that adds a static integer variable to " -"the C code::" -msgstr "" - -#: ../../howto/clinic.rst:1296 -msgid "How to use the \"self converter\"" -msgstr "" - -#: ../../howto/clinic.rst:1298 -msgid "" -"Argument Clinic automatically adds a \"self\" parameter for you using a " -"default converter. It automatically sets the ``type`` of this parameter to " -"the \"pointer to an instance\" you specified when you declared the type. " -"However, you can override Argument Clinic's converter and specify one " -"yourself. Just add your own *self* parameter as the first parameter in a " -"block, and ensure that its converter is an instance of :class:`!" -"self_converter` or a subclass thereof." -msgstr "" - -#: ../../howto/clinic.rst:1307 -msgid "" -"What's the point? This lets you override the type of ``self``, or give it a " -"different default name." -msgstr "" - -#: ../../howto/clinic.rst:1310 -msgid "" -"How do you specify the custom type you want to cast ``self`` to? If you only " -"have one or two functions with the same type for ``self``, you can directly " -"use Argument Clinic's existing ``self`` converter, passing in the type you " -"want to use as the *type* parameter::" -msgstr "" - -#: ../../howto/clinic.rst:1326 -msgid "" -"On the other hand, if you have a lot of functions that will use the same " -"type for ``self``, it's best to create your own converter, subclassing :" -"class:`!self_converter` but overwriting the :py:attr:`!type` member::" -msgstr "" - -#: ../../howto/clinic.rst:1348 -msgid "How to use the \"defining class\" converter" -msgstr "" - -#: ../../howto/clinic.rst:1350 -msgid "" -"Argument Clinic facilitates gaining access to the defining class of a " -"method. This is useful for :ref:`heap type ` methods that need " -"to fetch module level state. Use :c:func:`PyType_FromModuleAndSpec` to " -"associate a new heap type with a module. You can now use :c:func:" -"`PyType_GetModuleState` on the defining class to fetch the module state, for " -"example from a module method." -msgstr "" - -#: ../../howto/clinic.rst:1356 -msgid "" -"Example from :source:`Modules/zlibmodule.c`. First, ``defining_class`` is " -"added to the clinic input::" -msgstr "" - -#: ../../howto/clinic.rst:1368 -msgid "" -"After running the Argument Clinic tool, the following function signature is " -"generated::" -msgstr "" - -#: ../../howto/clinic.rst:1378 -msgid "" -"The following code can now use ``PyType_GetModuleState(cls)`` to fetch the " -"module state::" -msgstr "" - -#: ../../howto/clinic.rst:1384 -msgid "" -"Each method may only have one argument using this converter, and it must " -"appear after ``self``, or, if ``self`` is not used, as the first argument. " -"The argument will be of type ``PyTypeObject *``. The argument will not " -"appear in the :py:attr:`!__text_signature__`." -msgstr "" - -#: ../../howto/clinic.rst:1389 -msgid "" -"The ``defining_class`` converter is not compatible with :py:meth:`!__init__` " -"and :py:meth:`!__new__` methods, which cannot use the :c:macro:`METH_METHOD` " -"convention." -msgstr "" - -#: ../../howto/clinic.rst:1393 -msgid "" -"It is not possible to use ``defining_class`` with slot methods. In order to " -"fetch the module state from such methods, use :c:func:" -"`PyType_GetModuleByDef` to look up the module and then :c:func:" -"`PyModule_GetState` to fetch the module state. Example from the " -"``setattro`` slot method in :source:`Modules/_threadmodule.c`::" -msgstr "" - -#: ../../howto/clinic.rst:1408 -msgid "See also :pep:`573`." -msgstr "也請見 :pep:`573`\\ 。" - -#: ../../howto/clinic.rst:1414 -msgid "How to write a custom converter" -msgstr "" - -#: ../../howto/clinic.rst:1416 -msgid "" -"A converter is a Python class that inherits from :py:class:`CConverter`. The " -"main purpose of a custom converter, is for parameters parsed with the ``O&`` " -"format unit --- parsing such a parameter means calling a :c:func:" -"`PyArg_ParseTuple` \"converter function\"." -msgstr "" - -#: ../../howto/clinic.rst:1421 -msgid "" -"Your converter class should be named :samp:`{ConverterName}_converter`. By " -"following this convention, your converter class will be automatically " -"registered with Argument Clinic, with its *converter name* being the name of " -"your converter class with the ``_converter`` suffix stripped off." -msgstr "" - -#: ../../howto/clinic.rst:1426 -msgid "" -"Instead of subclassing :py:meth:`!CConverter.__init__`, write a :py:meth:`!" -"converter_init` method. :py:meth:`!converter_init` always accepts a *self* " -"parameter. After *self*, all additional parameters **must** be keyword-only. " -"Any arguments passed to the converter in Argument Clinic will be passed " -"along to your :py:meth:`!converter_init` method. See :py:class:`CConverter` " -"for a list of members you may wish to specify in your subclass." -msgstr "" - -#: ../../howto/clinic.rst:1435 -msgid "" -"Here's the simplest example of a custom converter, from :source:`Modules/" -"zlibmodule.c`::" -msgstr "" - -#: ../../howto/clinic.rst:1446 -msgid "" -"This block adds a converter named ``ssize_t`` to Argument Clinic. Parameters " -"declared as ``ssize_t`` will be declared with type :c:type:`Py_ssize_t`, and " -"will be parsed by the ``'O&'`` format unit, which will call the :c:func:`!" -"ssize_t_converter` converter C function. ``ssize_t`` variables automatically " -"support default values." -msgstr "" - -#: ../../howto/clinic.rst:1452 -msgid "" -"More sophisticated custom converters can insert custom C code to handle " -"initialization and cleanup. You can see more examples of custom converters " -"in the CPython source tree; grep the C files for the string ``CConverter``." -msgstr "" - -#: ../../howto/clinic.rst:1459 -msgid "How to write a custom return converter" -msgstr "" +msgstr "Argument Clinic 指南" -#: ../../howto/clinic.rst:1461 +#: ../../howto/clinic.rst:13 msgid "" -"Writing a custom return converter is much like writing a custom converter. " -"Except it's somewhat simpler, because return converters are themselves much " -"simpler." +"The Argument Clinic How-TO has been moved to the `Python Developer's Guide " +"`__." msgstr "" - -#: ../../howto/clinic.rst:1465 -msgid "" -"Return converters must subclass :py:class:`!CReturnConverter`. There are no " -"examples yet of custom return converters, because they are not widely used " -"yet. If you wish to write your own return converter, please read :source:" -"`Tools/clinic/clinic.py`, specifically the implementation of :py:class:`!" -"CReturnConverter` and all its subclasses." -msgstr "" - -#: ../../howto/clinic.rst:1474 -msgid "How to convert ``METH_O`` and ``METH_NOARGS`` functions" -msgstr "" - -#: ../../howto/clinic.rst:1476 -msgid "" -"To convert a function using :c:macro:`METH_O`, make sure the function's " -"single argument is using the ``object`` converter, and mark the arguments as " -"positional-only::" -msgstr "" - -#: ../../howto/clinic.rst:1488 -msgid "" -"To convert a function using :c:macro:`METH_NOARGS`, just don't specify any " -"arguments." -msgstr "" - -#: ../../howto/clinic.rst:1491 -msgid "" -"You can still use a self converter, a return converter, and specify a *type* " -"argument to the object converter for :c:macro:`METH_O`." -msgstr "" - -#: ../../howto/clinic.rst:1496 -msgid "How to convert ``tp_new`` and ``tp_init`` functions" -msgstr "" - -#: ../../howto/clinic.rst:1498 -msgid "" -"You can convert :c:member:`~PyTypeObject.tp_new` and :c:member:" -"`~PyTypeObject.tp_init` functions. Just name them ``__new__`` or " -"``__init__`` as appropriate. Notes:" -msgstr "" - -#: ../../howto/clinic.rst:1502 -msgid "" -"The function name generated for ``__new__`` doesn't end in ``__new__`` like " -"it would by default. It's just the name of the class, converted into a " -"valid C identifier." -msgstr "" - -#: ../../howto/clinic.rst:1506 -msgid "No :c:type:`PyMethodDef` ``#define`` is generated for these functions." -msgstr "" - -#: ../../howto/clinic.rst:1508 -msgid "``__init__`` functions return ``int``, not ``PyObject *``." -msgstr "" - -#: ../../howto/clinic.rst:1510 -msgid "Use the docstring as the class docstring." -msgstr "" - -#: ../../howto/clinic.rst:1512 -msgid "" -"Although ``__new__`` and ``__init__`` functions must always accept both the " -"``args`` and ``kwargs`` objects, when converting you may specify any " -"signature for these functions that you like. (If your function doesn't " -"support keywords, the parsing function generated will throw an exception if " -"it receives any.)" -msgstr "" - -#: ../../howto/clinic.rst:1520 -msgid "How to change and redirect Clinic's output" -msgstr "" - -#: ../../howto/clinic.rst:1522 -msgid "" -"It can be inconvenient to have Clinic's output interspersed with your " -"conventional hand-edited C code. Luckily, Clinic is configurable: you can " -"buffer up its output for printing later (or earlier!), or write its output " -"to a separate file. You can also add a prefix or suffix to every line of " -"Clinic's generated output." -msgstr "" - -#: ../../howto/clinic.rst:1528 -msgid "" -"While changing Clinic's output in this manner can be a boon to readability, " -"it may result in Clinic code using types before they are defined, or your " -"code attempting to use Clinic-generated code before it is defined. These " -"problems can be easily solved by rearranging the declarations in your file, " -"or moving where Clinic's generated code goes. (This is why the default " -"behavior of Clinic is to output everything into the current block; while " -"many people consider this hampers readability, it will never require " -"rearranging your code to fix definition-before-use problems.)" -msgstr "" - -#: ../../howto/clinic.rst:1537 -msgid "Let's start with defining some terminology:" -msgstr "" - -#: ../../howto/clinic.rst:1564 -msgid "*field*" -msgstr "" - -#: ../../howto/clinic.rst:1540 -msgid "" -"A field, in this context, is a subsection of Clinic's output. For example, " -"the ``#define`` for the :c:type:`PyMethodDef` structure is a field, called " -"``methoddef_define``. Clinic has seven different fields it can output per " -"function definition:" -msgstr "" - -#: ../../howto/clinic.rst:1555 -msgid "" -"All the names are of the form ``\"_\"``, where ``\"\"`` is the " -"semantic object represented (the parsing function, the impl function, the " -"docstring, or the methoddef structure) and ``\"\"`` represents what kind " -"of statement the field is. Field names that end in ``\"_prototype\"`` " -"represent forward declarations of that thing, without the actual body/data " -"of the thing; field names that end in ``\"_definition\"`` represent the " -"actual definition of the thing, with the body/data of the thing. " -"(``\"methoddef\"`` is special, it's the only one that ends with " -"``\"_define\"``, representing that it's a preprocessor #define.)" -msgstr "" - -#: ../../howto/clinic.rst:1598 -msgid "*destination*" -msgstr "" - -#: ../../howto/clinic.rst:1567 -msgid "" -"A destination is a place Clinic can write output to. There are five built-" -"in destinations:" -msgstr "" - -#: ../../howto/clinic.rst:1572 ../../howto/clinic.rst:1647 -#: ../../howto/clinic.rst:1725 -msgid "``block``" -msgstr "``block``" - -#: ../../howto/clinic.rst:1571 -msgid "" -"The default destination: printed in the output section of the current Clinic " -"block." -msgstr "" - -#: ../../howto/clinic.rst:1578 ../../howto/clinic.rst:1674 -#: ../../howto/clinic.rst:1728 -msgid "``buffer``" -msgstr "``buffer``" - -#: ../../howto/clinic.rst:1575 -msgid "" -"A text buffer where you can save text for later. Text sent here is appended " -"to the end of any existing text. It's an error to have any text left in the " -"buffer when Clinic finishes processing a file." -msgstr "" - -#: ../../howto/clinic.rst:1589 ../../howto/clinic.rst:1660 -#: ../../howto/clinic.rst:1754 -msgid "``file``" -msgstr "``file``" - -#: ../../howto/clinic.rst:1581 -msgid "" -"A separate \"clinic file\" that will be created automatically by Clinic. The " -"filename chosen for the file is ``{basename}.clinic{extension}``, where " -"``basename`` and ``extension`` were assigned the output from ``os.path." -"splitext()`` run on the current file. (Example: the ``file`` destination " -"for :file:`_pickle.c` would be written to :file:`_pickle.clinic.c`.)" -msgstr "" - -#: ../../howto/clinic.rst:1588 -msgid "" -"**Important: When using a** ``file`` **destination, you** *must check in* " -"**the generated file!**" -msgstr "" - -#: ../../howto/clinic.rst:1594 ../../howto/clinic.rst:1687 -#: ../../howto/clinic.rst:1758 -msgid "``two-pass``" -msgstr "``two-pass``" - -#: ../../howto/clinic.rst:1592 -msgid "" -"A buffer like ``buffer``. However, a two-pass buffer can only be dumped " -"once, and it prints out all text sent to it during all processing, even from " -"Clinic blocks *after* the dumping point." -msgstr "" - -#: ../../howto/clinic.rst:1598 ../../howto/clinic.rst:1721 -msgid "``suppress``" -msgstr "``suppress``" - -#: ../../howto/clinic.rst:1597 -msgid "The text is suppressed—thrown away." -msgstr "" - -#: ../../howto/clinic.rst:1600 -msgid "Clinic defines five new directives that let you reconfigure its output." -msgstr "" - -#: ../../howto/clinic.rst:1602 -msgid "The first new directive is ``dump``:" -msgstr "" - -#: ../../howto/clinic.rst:1608 -msgid "" -"This dumps the current contents of the named destination into the output of " -"the current block, and empties it. This only works with ``buffer`` and " -"``two-pass`` destinations." -msgstr "" - -#: ../../howto/clinic.rst:1612 -msgid "" -"The second new directive is ``output``. The most basic form of ``output`` " -"is like this:" -msgstr "" - -#: ../../howto/clinic.rst:1619 -msgid "" -"This tells Clinic to output *field* to *destination*. ``output`` also " -"supports a special meta-destination, called ``everything``, which tells " -"Clinic to output *all* fields to that *destination*." -msgstr "" - -#: ../../howto/clinic.rst:1623 -msgid "``output`` has a number of other functions:" -msgstr "" - -#: ../../howto/clinic.rst:1632 -msgid "" -"``output push`` and ``output pop`` allow you to push and pop configurations " -"on an internal configuration stack, so that you can temporarily modify the " -"output configuration, then easily restore the previous configuration. " -"Simply push before your change to save the current configuration, then pop " -"when you wish to restore the previous configuration." -msgstr "" - -#: ../../howto/clinic.rst:1639 -msgid "" -"``output preset`` sets Clinic's output to one of several built-in preset " -"configurations, as follows:" -msgstr "" - -#: ../../howto/clinic.rst:1643 -msgid "" -"Clinic's original starting configuration. Writes everything immediately " -"after the input block." -msgstr "" - -#: ../../howto/clinic.rst:1646 -msgid "" -"Suppress the ``parser_prototype`` and ``docstring_prototype``, write " -"everything else to ``block``." -msgstr "" - -#: ../../howto/clinic.rst:1650 -msgid "" -"Designed to write everything to the \"clinic file\" that it can. You then " -"``#include`` this file near the top of your file. You may need to rearrange " -"your file to make this work, though usually this just means creating forward " -"declarations for various ``typedef`` and ``PyTypeObject`` definitions." -msgstr "" - -#: ../../howto/clinic.rst:1656 -msgid "" -"Suppress the ``parser_prototype`` and ``docstring_prototype``, write the " -"``impl_definition`` to ``block``, and write everything else to ``file``." -msgstr "" - -#: ../../howto/clinic.rst:1660 -msgid "The default filename is ``\"{dirname}/clinic/{basename}.h\"``." -msgstr "" - -#: ../../howto/clinic.rst:1663 -msgid "" -"Save up most of the output from Clinic, to be written into your file near " -"the end. For Python files implementing modules or builtin types, it's " -"recommended that you dump the buffer just above the static structures for " -"your module or builtin type; these are normally very near the end. Using " -"``buffer`` may require even more editing than ``file``, if your file has " -"static ``PyMethodDef`` arrays defined in the middle of the file." -msgstr "" - -#: ../../howto/clinic.rst:1672 -msgid "" -"Suppress the ``parser_prototype``, ``impl_prototype``, and " -"``docstring_prototype``, write the ``impl_definition`` to ``block``, and " -"write everything else to ``file``." -msgstr "" - -#: ../../howto/clinic.rst:1677 -msgid "" -"Similar to the ``buffer`` preset, but writes forward declarations to the " -"``two-pass`` buffer, and definitions to the ``buffer``. This is similar to " -"the ``buffer`` preset, but may require less editing than ``buffer``. Dump " -"the ``two-pass`` buffer near the top of your file, and dump the ``buffer`` " -"near the end just like you would when using the ``buffer`` preset." -msgstr "" - -#: ../../howto/clinic.rst:1684 -msgid "" -"Suppresses the ``impl_prototype``, write the ``impl_definition`` to " -"``block``, write ``docstring_prototype``, ``methoddef_define``, and " -"``parser_prototype`` to ``two-pass``, write everything else to ``buffer``." -msgstr "" - -#: ../../howto/clinic.rst:1698 -msgid "``partial-buffer``" -msgstr "``partial-buffer``" - -#: ../../howto/clinic.rst:1690 -msgid "" -"Similar to the ``buffer`` preset, but writes more things to ``block``, only " -"writing the really big chunks of generated code to ``buffer``. This avoids " -"the definition-before-use problem of ``buffer`` completely, at the small " -"cost of having slightly more stuff in the block's output. Dump the " -"``buffer`` near the end, just like you would when using the ``buffer`` " -"preset." -msgstr "" - -#: ../../howto/clinic.rst:1697 -msgid "" -"Suppresses the ``impl_prototype``, write the ``docstring_definition`` and " -"``parser_definition`` to ``buffer``, write everything else to ``block``." -msgstr "" - -#: ../../howto/clinic.rst:1700 -msgid "The third new directive is ``destination``:" -msgstr "" - -#: ../../howto/clinic.rst:1706 -msgid "This performs an operation on the destination named ``name``." -msgstr "" - -#: ../../howto/clinic.rst:1708 -msgid "There are two defined subcommands: ``new`` and ``clear``." -msgstr "" - -#: ../../howto/clinic.rst:1710 -msgid "The ``new`` subcommand works like this:" -msgstr "" - -#: ../../howto/clinic.rst:1716 -msgid "" -"This creates a new destination with name ```` and type ````." -msgstr "" - -#: ../../howto/clinic.rst:1718 -msgid "There are five destination types:" -msgstr "" - -#: ../../howto/clinic.rst:1721 -msgid "Throws the text away." -msgstr "" - -#: ../../howto/clinic.rst:1724 -msgid "" -"Writes the text to the current block. This is what Clinic originally did." -msgstr "" - -#: ../../howto/clinic.rst:1728 -msgid "A simple text buffer, like the \"buffer\" builtin destination above." -msgstr "" - -#: ../../howto/clinic.rst:1731 -msgid "" -"A text file. The file destination takes an extra argument, a template to " -"use for building the filename, like so:" -msgstr "" - -#: ../../howto/clinic.rst:1734 -msgid "destination new " -msgstr "" - -#: ../../howto/clinic.rst:1736 -msgid "" -"The template can use three strings internally that will be replaced by bits " -"of the filename:" -msgstr "" - -#: ../../howto/clinic.rst:1739 -msgid "{path}" -msgstr "{path}" - -#: ../../howto/clinic.rst:1740 -msgid "The full path to the file, including directory and full filename." -msgstr "" - -#: ../../howto/clinic.rst:1741 -msgid "{dirname}" -msgstr "{dirname}" - -#: ../../howto/clinic.rst:1742 -msgid "The name of the directory the file is in." -msgstr "" - -#: ../../howto/clinic.rst:1743 -msgid "{basename}" -msgstr "{basename}" - -#: ../../howto/clinic.rst:1744 -msgid "Just the name of the file, not including the directory." -msgstr "" - -#: ../../howto/clinic.rst:1746 -msgid "{basename_root}" -msgstr "{basename_root}" - -#: ../../howto/clinic.rst:1746 -msgid "" -"Basename with the extension clipped off (everything up to but not including " -"the last '.')." -msgstr "" - -#: ../../howto/clinic.rst:1750 -msgid "{basename_extension}" -msgstr "{basename_extension}" - -#: ../../howto/clinic.rst:1749 -msgid "" -"The last '.' and everything after it. If the basename does not contain a " -"period, this will be the empty string." -msgstr "" - -#: ../../howto/clinic.rst:1752 -msgid "" -"If there are no periods in the filename, {basename} and {filename} are the " -"same, and {extension} is empty. \"{basename}{extension}\" is always exactly " -"the same as \"{filename}\".\"" -msgstr "" - -#: ../../howto/clinic.rst:1757 -msgid "A two-pass buffer, like the \"two-pass\" builtin destination above." -msgstr "" - -#: ../../howto/clinic.rst:1760 -msgid "The ``clear`` subcommand works like this:" -msgstr "" - -#: ../../howto/clinic.rst:1766 -msgid "" -"It removes all the accumulated text up to this point in the destination. (I " -"don't know what you'd need this for, but I thought maybe it'd be useful " -"while someone's experimenting.)" -msgstr "" - -#: ../../howto/clinic.rst:1770 -msgid "The fourth new directive is ``set``:" -msgstr "" - -#: ../../howto/clinic.rst:1777 -msgid "" -"``set`` lets you set two internal variables in Clinic. ``line_prefix`` is a " -"string that will be prepended to every line of Clinic's output; " -"``line_suffix`` is a string that will be appended to every line of Clinic's " -"output." -msgstr "" - -#: ../../howto/clinic.rst:1781 -msgid "Both of these support two format strings:" -msgstr "" - -#: ../../howto/clinic.rst:1784 -msgid "``{block comment start}``" -msgstr "``{block comment start}``" - -#: ../../howto/clinic.rst:1784 -msgid "" -"Turns into the string ``/*``, the start-comment text sequence for C files." -msgstr "" - -#: ../../howto/clinic.rst:1787 -msgid "``{block comment end}``" -msgstr "``{block comment end}``" - -#: ../../howto/clinic.rst:1787 -msgid "" -"Turns into the string ``*/``, the end-comment text sequence for C files." -msgstr "" - -#: ../../howto/clinic.rst:1789 -msgid "" -"The final new directive is one you shouldn't need to use directly, called " -"``preserve``:" -msgstr "" - -#: ../../howto/clinic.rst:1796 -msgid "" -"This tells Clinic that the current contents of the output should be kept, " -"unmodified. This is used internally by Clinic when dumping output into " -"``file`` files; wrapping it in a Clinic block lets Clinic use its existing " -"checksum functionality to ensure the file was not modified by hand before it " -"gets overwritten." -msgstr "" - -#: ../../howto/clinic.rst:1803 -msgid "How to use the ``#ifdef`` trick" -msgstr "" - -#: ../../howto/clinic.rst:1805 -msgid "" -"If you're converting a function that isn't available on all platforms, " -"there's a trick you can use to make life a little easier. The existing code " -"probably looks like this::" -msgstr "" - -#: ../../howto/clinic.rst:1816 -msgid "" -"And then in the ``PyMethodDef`` structure at the bottom the existing code " -"will have:" -msgstr "" - -#: ../../howto/clinic.rst:1825 -msgid "" -"In this scenario, you should enclose the body of your impl function inside " -"the ``#ifdef``, like so::" -msgstr "" - -#: ../../howto/clinic.rst:1839 -msgid "" -"Then, remove those three lines from the :c:type:`PyMethodDef` structure, " -"replacing them with the macro Argument Clinic generated:" -msgstr "" - -#: ../../howto/clinic.rst:1846 -msgid "" -"(You can find the real name for this macro inside the generated code. Or you " -"can calculate it yourself: it's the name of your function as defined on the " -"first line of your block, but with periods changed to underscores, " -"uppercased, and ``\"_METHODDEF\"`` added to the end.)" -msgstr "" - -#: ../../howto/clinic.rst:1851 -msgid "" -"Perhaps you're wondering: what if ``HAVE_FUNCTIONNAME`` isn't defined? The " -"``MODULE_FUNCTIONNAME_METHODDEF`` macro won't be defined either!" -msgstr "" - -#: ../../howto/clinic.rst:1854 -msgid "" -"Here's where Argument Clinic gets very clever. It actually detects that the " -"Argument Clinic block might be deactivated by the ``#ifdef``. When that " -"happens, it generates a little extra code that looks like this::" -msgstr "" - -#: ../../howto/clinic.rst:1862 -msgid "" -"That means the macro always works. If the function is defined, this turns " -"into the correct structure, including the trailing comma. If the function " -"is undefined, this turns into nothing." -msgstr "" - -#: ../../howto/clinic.rst:1866 -msgid "" -"However, this causes one ticklish problem: where should Argument Clinic put " -"this extra code when using the \"block\" output preset? It can't go in the " -"output block, because that could be deactivated by the ``#ifdef``. (That's " -"the whole point!)" -msgstr "" - -#: ../../howto/clinic.rst:1870 -msgid "" -"In this situation, Argument Clinic writes the extra code to the \"buffer\" " -"destination. This may mean that you get a complaint from Argument Clinic:" -msgstr "" - -#: ../../howto/clinic.rst:1878 -msgid "" -"When this happens, just open your file, find the ``dump buffer`` block that " -"Argument Clinic added to your file (it'll be at the very bottom), then move " -"it above the :c:type:`PyMethodDef` structure where that macro is used." -msgstr "" - -#: ../../howto/clinic.rst:1884 -msgid "How to use Argument Clinic in Python files" -msgstr "" - -#: ../../howto/clinic.rst:1886 -msgid "" -"It's actually possible to use Argument Clinic to preprocess Python files. " -"There's no point to using Argument Clinic blocks, of course, as the output " -"wouldn't make any sense to the Python interpreter. But using Argument " -"Clinic to run Python blocks lets you use Python as a Python preprocessor!" -msgstr "" - -#: ../../howto/clinic.rst:1891 -msgid "" -"Since Python comments are different from C comments, Argument Clinic blocks " -"embedded in Python files look slightly different. They look like this:" -msgstr "" - -#~ msgid "``type``" -#~ msgstr "``type``" - -#~ msgid "``default``" -#~ msgstr "``default``" - -#~ msgid "``py_default``" -#~ msgstr "``py_default``" - -#~ msgid "``c_ignored_default``" -#~ msgstr "``c_ignored_default``" - -#~ msgid "``impl_by_reference``" -#~ msgstr "``impl_by_reference``" - -#~ msgid "``parse_by_reference``" -#~ msgstr "``parse_by_reference``" - -#~ msgid "Py_buffer" -#~ msgstr "Py_buffer" +"Argument Clinic 操作方法已移至「`Python 開發人員指南 `__」。" diff --git a/howto/enum.po b/howto/enum.po index b8dfcac179..d581267153 100644 --- a/howto/enum.po +++ b/howto/enum.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-09-01 00:03+0000\n" +"POT-Creation-Date: 2023-10-12 00:03+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1030,44 +1030,44 @@ msgstr "" msgid "EJECT --> lose Flag status and become a normal int with the given value" msgstr "" -#: ../../howto/enum.rst:1165 +#: ../../howto/enum.rst:1162 msgid "KEEP --> keep the extra bits" msgstr "" -#: ../../howto/enum.rst:1163 +#: ../../howto/enum.rst:1164 msgid "keeps Flag status and extra bits" msgstr "" -#: ../../howto/enum.rst:1164 +#: ../../howto/enum.rst:1165 msgid "extra bits do not show up in iteration" msgstr "" -#: ../../howto/enum.rst:1165 +#: ../../howto/enum.rst:1166 msgid "extra bits do show up in repr() and str()" msgstr "" -#: ../../howto/enum.rst:1167 +#: ../../howto/enum.rst:1168 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:1175 +#: ../../howto/enum.rst:1176 msgid "How are Enums and Flags different?" msgstr "" -#: ../../howto/enum.rst:1177 +#: ../../howto/enum.rst:1178 msgid "" "Enums have a custom metaclass that affects many aspects of both derived :" "class:`Enum` classes and their instances (members)." msgstr "" -#: ../../howto/enum.rst:1182 +#: ../../howto/enum.rst:1183 msgid "Enum Classes" msgstr "" -#: ../../howto/enum.rst:1184 +#: ../../howto/enum.rst:1185 msgid "" "The :class:`EnumType` metaclass is responsible for providing the :meth:" "`__contains__`, :meth:`__dir__`, :meth:`__iter__` and other methods that " @@ -1078,11 +1078,11 @@ msgid "" "`__getnewargs__`, :meth:`__str__` and :meth:`__repr__`)." msgstr "" -#: ../../howto/enum.rst:1193 +#: ../../howto/enum.rst:1194 msgid "Flag Classes" msgstr "" -#: ../../howto/enum.rst:1195 +#: ../../howto/enum.rst:1196 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 " @@ -1091,11 +1091,11 @@ msgid "" "considered an alias." msgstr "" -#: ../../howto/enum.rst:1201 +#: ../../howto/enum.rst:1202 msgid "Enum Members (aka instances)" msgstr "" -#: ../../howto/enum.rst:1203 +#: ../../howto/enum.rst:1204 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 " @@ -1104,37 +1104,37 @@ msgid "" "instances." msgstr "" -#: ../../howto/enum.rst:1209 +#: ../../howto/enum.rst:1210 msgid "Flag Members" msgstr "" -#: ../../howto/enum.rst:1211 +#: ../../howto/enum.rst:1212 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:1217 +#: ../../howto/enum.rst:1218 msgid "(Note that ``BLACK``, ``PURPLE``, and ``WHITE`` do not show up.)" msgstr "" -#: ../../howto/enum.rst:1219 +#: ../../howto/enum.rst:1220 msgid "" "Inverting a flag member returns the corresponding positive value, rather " "than a negative value --- for example::" msgstr "" -#: ../../howto/enum.rst:1225 +#: ../../howto/enum.rst:1226 msgid "" "Flag members have a length corresponding to the number of power-of-two " "values they contain. For example::" msgstr "" -#: ../../howto/enum.rst:1235 +#: ../../howto/enum.rst:1236 msgid "Enum Cookbook" msgstr "" -#: ../../howto/enum.rst:1238 +#: ../../howto/enum.rst:1239 msgid "" "While :class:`Enum`, :class:`IntEnum`, :class:`StrEnum`, :class:`Flag`, and :" "class:`IntFlag` are expected to cover the majority of use-cases, they cannot " @@ -1142,155 +1142,155 @@ msgid "" "that can be used directly, or as examples for creating one's own." msgstr "" -#: ../../howto/enum.rst:1245 +#: ../../howto/enum.rst:1246 msgid "Omitting values" msgstr "" -#: ../../howto/enum.rst:1247 +#: ../../howto/enum.rst:1248 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:1250 +#: ../../howto/enum.rst:1251 msgid "use instances of :class:`auto` for the value" msgstr "" -#: ../../howto/enum.rst:1251 +#: ../../howto/enum.rst:1252 msgid "use instances of :class:`object` as the value" msgstr "" -#: ../../howto/enum.rst:1252 +#: ../../howto/enum.rst:1253 msgid "use a descriptive string as the value" msgstr "" -#: ../../howto/enum.rst:1253 +#: ../../howto/enum.rst:1254 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:1256 +#: ../../howto/enum.rst:1257 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:1262 +#: ../../howto/enum.rst:1263 msgid "Using :class:`auto`" msgstr "" -#: ../../howto/enum.rst:1264 +#: ../../howto/enum.rst:1265 msgid "Using :class:`auto` would look like::" msgstr "" -#: ../../howto/enum.rst:1276 +#: ../../howto/enum.rst:1277 msgid "Using :class:`object`" msgstr "" -#: ../../howto/enum.rst:1278 +#: ../../howto/enum.rst:1279 msgid "Using :class:`object` would look like::" msgstr "" -#: ../../howto/enum.rst:1288 +#: ../../howto/enum.rst:1289 msgid "" "This is also a good example of why you might want to write your own :meth:" "`__repr__`::" msgstr "" -#: ../../howto/enum.rst:1304 +#: ../../howto/enum.rst:1305 msgid "Using a descriptive string" msgstr "" -#: ../../howto/enum.rst:1306 +#: ../../howto/enum.rst:1307 msgid "Using a string as the value would look like::" msgstr "" -#: ../../howto/enum.rst:1318 +#: ../../howto/enum.rst:1319 msgid "Using a custom :meth:`__new__`" msgstr "" -#: ../../howto/enum.rst:1320 +#: ../../howto/enum.rst:1321 msgid "Using an auto-numbering :meth:`__new__` would look like::" msgstr "" -#: ../../howto/enum.rst:1337 +#: ../../howto/enum.rst:1338 msgid "" "To make a more general purpose ``AutoNumber``, add ``*args`` to the " "signature::" msgstr "" -#: ../../howto/enum.rst:1347 +#: ../../howto/enum.rst:1348 msgid "" "Then when you inherit from ``AutoNumber`` you can write your own " "``__init__`` to handle any extra arguments::" msgstr "" -#: ../../howto/enum.rst:1366 +#: ../../howto/enum.rst:1367 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:1372 +#: ../../howto/enum.rst:1373 msgid "" "*Do not* call ``super().__new__()``, as the lookup-only ``__new__`` is the " "one that is found; instead, use the data type directly -- e.g.::" msgstr "" -#: ../../howto/enum.rst:1379 +#: ../../howto/enum.rst:1380 msgid "OrderedEnum" msgstr "" -#: ../../howto/enum.rst:1381 +#: ../../howto/enum.rst:1382 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:1415 +#: ../../howto/enum.rst:1416 msgid "DuplicateFreeEnum" msgstr "" -#: ../../howto/enum.rst:1417 +#: ../../howto/enum.rst:1418 msgid "" "Raises an error if a duplicate member value is found instead of creating an " "alias::" msgstr "" -#: ../../howto/enum.rst:1442 +#: ../../howto/enum.rst:1443 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:1448 +#: ../../howto/enum.rst:1449 msgid "Planet" msgstr "" -#: ../../howto/enum.rst:1450 +#: ../../howto/enum.rst:1451 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:1479 +#: ../../howto/enum.rst:1480 msgid "TimePeriod" msgstr "" -#: ../../howto/enum.rst:1481 +#: ../../howto/enum.rst:1482 msgid "An example to show the :attr:`_ignore_` attribute in use::" msgstr "" -#: ../../howto/enum.rst:1500 +#: ../../howto/enum.rst:1501 msgid "Subclassing EnumType" msgstr "" -#: ../../howto/enum.rst:1502 +#: ../../howto/enum.rst:1503 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/instrumentation.po b/howto/instrumentation.po index 29a7b4d68f..0850e3c94d 100644 --- a/howto/instrumentation.po +++ b/howto/instrumentation.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-24 00:03+0000\n" +"POT-Creation-Date: 2023-10-12 00:03+0000\n" "PO-Revision-Date: 2023-08-17 22:17+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -193,20 +193,20 @@ msgstr "其中的行 (column) 是:" msgid "time in microseconds since start of script" msgstr "自腳本開始以來的時間(以微秒為單位)" -#: ../../howto/instrumentation.rst:251 +#: ../../howto/instrumentation.rst:250 msgid "name of executable" msgstr "可執行檔案的名稱" -#: ../../howto/instrumentation.rst:253 +#: ../../howto/instrumentation.rst:251 msgid "PID of process" msgstr "行程的 PID" -#: ../../howto/instrumentation.rst:255 +#: ../../howto/instrumentation.rst:253 msgid "" "and the remainder indicates the call/return hierarchy as the script executes." msgstr "其餘部分表示腳本執行時的呼叫/回傳階層結構。" -#: ../../howto/instrumentation.rst:257 +#: ../../howto/instrumentation.rst:255 msgid "" "For a :option:`--enable-shared` build of CPython, the markers are contained " "within the libpython shared library, and the probe's dotted path needs to " @@ -216,26 +216,26 @@ msgstr "" "函式庫中,並且探針的帶點路徑 (dotted path) 需要反映這一點。例如,上面範例中的" "這一列:" -#: ../../howto/instrumentation.rst:265 +#: ../../howto/instrumentation.rst:263 msgid "should instead read:" msgstr "應該改為讀取:" -#: ../../howto/instrumentation.rst:271 +#: ../../howto/instrumentation.rst:269 msgid "(assuming a :ref:`debug build ` of CPython 3.6)" msgstr "(假設 CPython 3.6 的\\ :ref:`除錯建置版本 `)" -#: ../../howto/instrumentation.rst:275 +#: ../../howto/instrumentation.rst:273 msgid "Available static markers" msgstr "可用的靜態標記" -#: ../../howto/instrumentation.rst:279 +#: ../../howto/instrumentation.rst:277 msgid "" "This marker indicates that execution of a Python function has begun. It is " "only triggered for pure-Python (bytecode) functions." msgstr "" "該標記表示 Python 函式的執行已經開始。它僅針對純 Python(位元組碼)函式觸發。" -#: ../../howto/instrumentation.rst:282 +#: ../../howto/instrumentation.rst:280 msgid "" "The filename, function name, and line number are provided back to the " "tracing script as positional arguments, which must be accessed using " @@ -244,25 +244,25 @@ msgstr "" "檔案名稱、函式名稱和列號作為位置引數提供給追蹤腳本,必須使用 ``$arg1``、" "``$arg2``、``$arg3`` 來存取:" -#: ../../howto/instrumentation.rst:286 +#: ../../howto/instrumentation.rst:284 msgid "" "``$arg1`` : ``(const char *)`` filename, accessible using " "``user_string($arg1)``" msgstr "" "``$arg1`` : ``(const char *)`` 檔案名稱,可使用 ``user_string($arg1)`` 存取" -#: ../../howto/instrumentation.rst:288 +#: ../../howto/instrumentation.rst:286 msgid "" "``$arg2`` : ``(const char *)`` function name, accessible using " "``user_string($arg2)``" msgstr "" "``$arg2`` :``(const char *)`` 函式名稱,可使用 ``user_string($arg2)`` 存取" -#: ../../howto/instrumentation.rst:291 +#: ../../howto/instrumentation.rst:289 msgid "``$arg3`` : ``int`` line number" msgstr "``$arg3`` : ``int`` 列號" -#: ../../howto/instrumentation.rst:295 +#: ../../howto/instrumentation.rst:293 msgid "" "This marker is the converse of :c:func:`!function__entry`, and indicates " "that execution of a Python function has ended (either via ``return``, or via " @@ -271,11 +271,11 @@ msgstr "" "該標記與 :c:func:`!function__entry` 相反,表示 Python 函式的執行已結束(透過 " "``return`` 或透過例外)。它僅針對純 Python(位元組碼)函式觸發。" -#: ../../howto/instrumentation.rst:299 +#: ../../howto/instrumentation.rst:297 msgid "The arguments are the same as for :c:func:`!function__entry`" msgstr "引數與 :c:func:`!function__entry` 相同" -#: ../../howto/instrumentation.rst:303 +#: ../../howto/instrumentation.rst:301 msgid "" "This marker indicates a Python line is about to be executed. It is the " "equivalent of line-by-line tracing with a Python profiler. It is not " @@ -284,11 +284,11 @@ msgstr "" "該標記表示一列 Python 即將被執行。它相當於使用 Python 分析器來逐行追蹤。它不" "在 C 函式內觸發。" -#: ../../howto/instrumentation.rst:307 +#: ../../howto/instrumentation.rst:305 msgid "The arguments are the same as for :c:func:`!function__entry`." msgstr "引數與 :c:func:`!function__entry` 相同。" -#: ../../howto/instrumentation.rst:311 +#: ../../howto/instrumentation.rst:309 msgid "" "Fires when the Python interpreter starts a garbage collection cycle. " "``arg0`` is the generation to scan, like :func:`gc.collect()`." @@ -296,19 +296,19 @@ msgstr "" "當 Python 直譯器開始垃圾回收 (garbage collection) 週期時觸發。``arg0`` 是要掃" "描的一代 (generation),如 :func:`gc.collect()`。" -#: ../../howto/instrumentation.rst:316 +#: ../../howto/instrumentation.rst:314 msgid "" "Fires when the Python interpreter finishes a garbage collection cycle. " "``arg0`` is the number of collected objects." msgstr "當 Python 直譯器完成垃圾回收週期時觸發。``arg0`` 是收集到的物件數量。" -#: ../../howto/instrumentation.rst:321 +#: ../../howto/instrumentation.rst:319 msgid "" "Fires before :mod:`importlib` attempts to find and load the module. ``arg0`` " "is the module name." msgstr "在 :mod:`importlib` 嘗試查找並載入模組之前觸發。``arg0`` 是模組名稱。" -#: ../../howto/instrumentation.rst:328 +#: ../../howto/instrumentation.rst:326 msgid "" "Fires after :mod:`importlib`'s find_and_load function is called. ``arg0`` is " "the module name, ``arg1`` indicates if module was successfully loaded." @@ -316,7 +316,7 @@ msgstr "" "在呼叫 :mod:`importlib` 的 find_and_load 函式後觸發。 ``arg0`` 是模組名稱," "``arg1`` 代表模組是否已成功載入。" -#: ../../howto/instrumentation.rst:337 +#: ../../howto/instrumentation.rst:335 msgid "" "Fires when :func:`sys.audit` or :c:func:`PySys_Audit` is called. ``arg0`` is " "the event name as C string, ``arg1`` is a :c:type:`PyObject` pointer to a " @@ -325,11 +325,11 @@ msgstr "" "當呼叫 :func:`sys.audit` 或 :c:func:`PySys_Audit` 時觸發。``arg0`` 是 C 字串" "形式的事件名稱,``arg1`` 是指向元組 (tuple) 物件的 :c:type:`PyObject` 指標。" -#: ../../howto/instrumentation.rst:345 +#: ../../howto/instrumentation.rst:343 msgid "SystemTap Tapsets" msgstr "SystemTap Tapsets" -#: ../../howto/instrumentation.rst:347 +#: ../../howto/instrumentation.rst:345 msgid "" "The higher-level way to use the SystemTap integration is to use a " "\"tapset\": SystemTap's equivalent of a library, which hides some of the " @@ -338,11 +338,11 @@ msgstr "" "使用 SystemTap 整合的高階方法是使用 \"tapset\":SystemTap 相當於一個函式庫," "它隱藏了靜態標記的一些低階詳細資訊。" -#: ../../howto/instrumentation.rst:351 +#: ../../howto/instrumentation.rst:349 msgid "Here is a tapset file, based on a non-shared build of CPython:" msgstr "這是一個 tapset 檔案,是基於 CPython 的非共享建置版本:" -#: ../../howto/instrumentation.rst:374 +#: ../../howto/instrumentation.rst:372 msgid "" "If this file is installed in SystemTap's tapset directory (e.g. ``/usr/share/" "systemtap/tapset``), then these additional probepoints become available:" @@ -350,7 +350,7 @@ msgstr "" "如果此檔案是安裝在 SystemTap 的 tapset 目錄中(例如 ``/usr/share/systemtap/" "tapset``),則這些額外的探測點將可被使用:" -#: ../../howto/instrumentation.rst:380 +#: ../../howto/instrumentation.rst:378 msgid "" "This probe point indicates that execution of a Python function has begun. It " "is only triggered for pure-Python (bytecode) functions." @@ -358,7 +358,7 @@ msgstr "" "該探測點表示 Python 函式的執行已經開始。它僅針對純 Python(位元組碼)函式觸" "發。" -#: ../../howto/instrumentation.rst:385 +#: ../../howto/instrumentation.rst:383 msgid "" "This probe point is the converse of ``python.function.return``, and " "indicates that execution of a Python function has ended (either via " @@ -368,11 +368,11 @@ msgstr "" "這個探測點與 ``python.function.return`` 相反,表示 Python 函式的執行已經結束" "(透過 ``return`` 或者透過例外)。它僅針對純 Python(位元組碼)函式觸發。" -#: ../../howto/instrumentation.rst:392 +#: ../../howto/instrumentation.rst:390 msgid "Examples" msgstr "範例" -#: ../../howto/instrumentation.rst:393 +#: ../../howto/instrumentation.rst:391 msgid "" "This SystemTap script uses the tapset above to more cleanly implement the " "example given above of tracing the Python function-call hierarchy, without " @@ -381,7 +381,7 @@ msgstr "" "此 SystemTap 腳本使用上面的 tapset 來更清晰地實作上面給出的追蹤 Python 函式呼" "叫階層結構的範例,而無需直接命名靜態標記:" -#: ../../howto/instrumentation.rst:412 +#: ../../howto/instrumentation.rst:410 msgid "" "The following script uses the tapset above to provide a top-like view of all " "running CPython code, showing the top 20 most frequently entered bytecode " diff --git a/howto/logging-cookbook.po b/howto/logging-cookbook.po index 31e89a4211..677327880d 100644 --- a/howto/logging-cookbook.po +++ b/howto/logging-cookbook.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-31 00:03+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+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-" @@ -915,7 +915,7 @@ msgid "" "a log by a handler. So the only slightly unusual thing which might trip you " "up is that the parentheses go around the format string and the arguments, " "not just the format string. That's because the __ notation is just syntax " -"sugar for a constructor call to one of the XXXMessage classes." +"sugar for a constructor call to one of the :samp:`{XXX}Message` classes." msgstr "" #: ../../howto/logging-cookbook.rst:1733 @@ -1446,8 +1446,8 @@ msgid "" "a log by a handler. So the only slightly unusual thing which might trip you " "up is that the parentheses go around the format string and the arguments, " "not just the format string. That’s because the __ notation is just syntax " -"sugar for a constructor call to one of the ``XXXMessage`` classes shown " -"above." +"sugar for a constructor call to one of the :samp:`{XXX}Message` classes " +"shown above." msgstr "" #: ../../howto/logging-cookbook.rst:2655 diff --git a/howto/logging.po b/howto/logging.po index 56e0345614..72076c0c96 100644 --- a/howto/logging.po +++ b/howto/logging.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-10-11 17:13+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-" @@ -1237,7 +1237,7 @@ msgstr "" msgid "" ":class:`NullHandler` instances do nothing with error messages. They are used " "by library developers who want to use logging, but want to avoid the 'No " -"handlers could be found for logger XXX' message which can be displayed if " +"handlers could be found for logger *XXX*' message which can be displayed if " "the library user has not configured logging. See :ref:`library-config` for " "more information." msgstr "" diff --git a/howto/perf_profiling.po b/howto/perf_profiling.po index 3fb4ec18fe..4964959d41 100644 --- a/howto/perf_profiling.po +++ b/howto/perf_profiling.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -112,23 +112,23 @@ msgstr "" msgid "Example, using the environment variable::" msgstr "" -#: ../../howto/perf_profiling.rst:169 +#: ../../howto/perf_profiling.rst:168 msgid "Example, using the :option:`!-X` option::" msgstr "" -#: ../../howto/perf_profiling.rst:174 +#: ../../howto/perf_profiling.rst:173 msgid "Example, using the :mod:`sys` APIs in file :file:`example.py`:" msgstr "" -#: ../../howto/perf_profiling.rst:186 +#: ../../howto/perf_profiling.rst:185 msgid "...then::" msgstr "" -#: ../../howto/perf_profiling.rst:193 +#: ../../howto/perf_profiling.rst:192 msgid "How to obtain the best results" msgstr "" -#: ../../howto/perf_profiling.rst:195 +#: ../../howto/perf_profiling.rst:194 msgid "" "For best results, Python should be compiled with ``CFLAGS=\"-fno-omit-frame-" "pointer -mno-omit-leaf-frame-pointer\"`` as this allows profilers to unwind " @@ -138,12 +138,12 @@ msgid "" "available." msgstr "" -#: ../../howto/perf_profiling.rst:202 +#: ../../howto/perf_profiling.rst:201 msgid "" "You can check if your system has been compiled with this flag by running::" msgstr "" -#: ../../howto/perf_profiling.rst:206 +#: ../../howto/perf_profiling.rst:205 msgid "" "If you don't see any output it means that your interpreter has not been " "compiled with frame pointers and therefore it may not be able to show Python " diff --git a/howto/urllib2.po b/howto/urllib2.po index 38983936ff..64aac1a827 100644 --- a/howto/urllib2.po +++ b/howto/urllib2.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-23 00:16+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2022-06-27 09:36+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -226,15 +226,15 @@ msgstr "" #: ../../howto/urllib2.rst:197 msgid "" -"*urlopen* raises :exc:`URLError` when it cannot handle a response (though as " -"usual with Python APIs, built-in exceptions such as :exc:`ValueError`, :exc:" -"`TypeError` etc. may also be raised)." +"*urlopen* raises :exc:`~urllib.error.URLError` when it cannot handle a " +"response (though as usual with Python APIs, built-in exceptions such as :exc:" +"`ValueError`, :exc:`TypeError` etc. may also be raised)." msgstr "" #: ../../howto/urllib2.rst:201 msgid "" -":exc:`HTTPError` is the subclass of :exc:`URLError` raised in the specific " -"case of HTTP URLs." +":exc:`~urllib.error.HTTPError` is the subclass of :exc:`~urllib.error." +"URLError` raised in the specific case of HTTP URLs." msgstr "" #: ../../howto/urllib2.rst:204 @@ -268,9 +268,9 @@ msgid "" "request. The default handlers will handle some of these responses for you " "(for example, if the response is a \"redirection\" that requests the client " "fetch the document from a different URL, urllib will handle that for you). " -"For those it can't handle, urlopen will raise an :exc:`HTTPError`. Typical " -"errors include '404' (page not found), '403' (request forbidden), and " -"'401' (authentication required)." +"For those it can't handle, urlopen will raise an :exc:`~urllib.error." +"HTTPError`. Typical errors include '404' (page not found), '403' (request " +"forbidden), and '401' (authentication required)." msgstr "" #: ../../howto/urllib2.rst:235 @@ -280,8 +280,8 @@ msgstr "" #: ../../howto/urllib2.rst:237 msgid "" -"The :exc:`HTTPError` instance raised will have an integer 'code' attribute, " -"which corresponds to the error sent by the server." +"The :exc:`~urllib.error.HTTPError` instance raised will have an integer " +"'code' attribute, which corresponds to the error sent by the server." msgstr "" #: ../../howto/urllib2.rst:241 @@ -305,10 +305,10 @@ msgstr "" #: ../../howto/urllib2.rst:319 msgid "" "When an error is raised the server responds by returning an HTTP error code " -"*and* an error page. You can use the :exc:`HTTPError` instance as a response " -"on the page returned. This means that as well as the code attribute, it also " -"has read, geturl, and info, methods as returned by the ``urllib.response`` " -"module::" +"*and* an error page. You can use the :exc:`~urllib.error.HTTPError` instance " +"as a response on the page returned. This means that as well as the code " +"attribute, it also has read, geturl, and info, methods as returned by the " +"``urllib.response`` module::" msgstr "" #: ../../howto/urllib2.rst:339 @@ -317,8 +317,9 @@ msgstr "" #: ../../howto/urllib2.rst:341 msgid "" -"So if you want to be prepared for :exc:`HTTPError` *or* :exc:`URLError` " -"there are two basic approaches. I prefer the second approach." +"So if you want to be prepared for :exc:`~urllib.error.HTTPError` *or* :exc:" +"`~urllib.error.URLError` there are two basic approaches. I prefer the second " +"approach." msgstr "" #: ../../howto/urllib2.rst:345 @@ -328,7 +329,7 @@ msgstr "" #: ../../howto/urllib2.rst:367 msgid "" "The ``except HTTPError`` *must* come first, otherwise ``except URLError`` " -"will *also* catch an :exc:`HTTPError`." +"will *also* catch an :exc:`~urllib.error.HTTPError`." msgstr "" #: ../../howto/urllib2.rst:371 @@ -341,9 +342,9 @@ msgstr "" #: ../../howto/urllib2.rst:394 msgid "" -"The response returned by urlopen (or the :exc:`HTTPError` instance) has two " -"useful methods :meth:`info` and :meth:`geturl` and is defined in the module :" -"mod:`urllib.response`.." +"The response returned by urlopen (or the :exc:`~urllib.error.HTTPError` " +"instance) has two useful methods :meth:`info` and :meth:`geturl` and is " +"defined in the module :mod:`urllib.response`.." msgstr "" #: ../../howto/urllib2.rst:398 diff --git a/library/__main__.po b/library/__main__.po index c369e52fc2..d5bf9aa3ad 100644 --- a/library/__main__.po +++ b/library/__main__.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -254,10 +254,10 @@ msgstr "" #: ../../library/__main__.rst:241 msgid "" -"The contents of ``__main__.py`` typically isn't fenced with ``if __name__ == " -"'__main__'`` blocks. Instead, those files are kept short, functions to " -"execute from other modules. Those other modules can then be easily unit-" -"tested and are properly reusable." +"The content of ``__main__.py`` typically isn't fenced with an ``if __name__ " +"== '__main__'`` block. Instead, those files are kept short and import " +"functions to execute from other modules. Those other modules can then be " +"easily unit-tested and are properly reusable." msgstr "" #: ../../library/__main__.rst:246 diff --git a/library/asyncio-llapi-index.po b/library/asyncio-llapi-index.po index 7e8bd669a4..b073cb620a 100644 --- a/library/asyncio-llapi-index.po +++ b/library/asyncio-llapi-index.po @@ -1,15 +1,15 @@ -# 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.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-07 00:17+0000\n" -"PO-Revision-Date: 2022-02-09 11:27+0800\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" +"PO-Revision-Date: 2023-10-12 11:27+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -70,7 +70,7 @@ msgstr "範例" #: ../../library/asyncio-llapi-index.rst:33 msgid ":ref:`Using asyncio.get_running_loop() `." -msgstr ":ref:`使用 asyncio.get_running_loop() `\\ 。" +msgstr ":ref:`使用 asyncio.get_running_loop() `。" #: ../../library/asyncio-llapi-index.rst:37 msgid "Event Loop Methods" @@ -124,7 +124,7 @@ msgstr ":meth:`loop.is_running()`" #: ../../library/asyncio-llapi-index.rst:60 msgid "Return ``True`` if the event loop is running." -msgstr "如果事件迴圈正在執行則回傳 ``True``\\ 。" +msgstr "如果事件迴圈正在執行則回傳 ``True``。" #: ../../library/asyncio-llapi-index.rst:62 msgid ":meth:`loop.is_closed()`" @@ -132,7 +132,7 @@ msgstr ":meth:`loop.is_closed()`" #: ../../library/asyncio-llapi-index.rst:63 msgid "Return ``True`` if the event loop is closed." -msgstr "如果事件迴圈已經被關閉則回傳 ``True``\\ ,。" +msgstr "如果事件迴圈已經被關閉則回傳 ``True``。" #: ../../library/asyncio-llapi-index.rst:65 msgid "``await`` :meth:`loop.shutdown_asyncgens`" @@ -275,7 +275,7 @@ msgstr "``await`` :meth:`loop.getaddrinfo`" #: ../../library/asyncio-llapi-index.rst:138 msgid "Asynchronous version of :meth:`socket.getaddrinfo`." -msgstr "非同步版本的 :meth:`socket.getaddrinfo`\\ 。" +msgstr "非同步版本的 :meth:`socket.getaddrinfo`。" #: ../../library/asyncio-llapi-index.rst:140 msgid "``await`` :meth:`loop.getnameinfo`" @@ -283,7 +283,7 @@ msgstr "``await`` :meth:`loop.getnameinfo`" #: ../../library/asyncio-llapi-index.rst:141 msgid "Asynchronous version of :meth:`socket.getnameinfo`." -msgstr "非同步版本的 :meth:`socket.getnameinfo`\\ 。" +msgstr "非同步版本的 :meth:`socket.getnameinfo`。" #: ../../library/asyncio-llapi-index.rst:144 msgid "Networking and IPC" @@ -327,7 +327,7 @@ msgstr "``await`` :meth:`loop.connect_accepted_socket`" #: ../../library/asyncio-llapi-index.rst:162 msgid "Wrap a :class:`~socket.socket` into a ``(transport, protocol)`` pair." -msgstr "將 :class:`~socket.socket` 包裝成 ``(transport, protocol)``\\ 。" +msgstr "將 :class:`~socket.socket` 包裝成 ``(transport, protocol)``。" #: ../../library/asyncio-llapi-index.rst:165 msgid "``await`` :meth:`loop.create_datagram_endpoint`" @@ -359,7 +359,7 @@ msgstr "``await`` :meth:`loop.connect_read_pipe`" #: ../../library/asyncio-llapi-index.rst:175 msgid "Wrap a read end of a pipe into a ``(transport, protocol)`` pair." -msgstr "將 pipe(管道)讀取端包裝成 ``(transport, protocol)``\\ 。" +msgstr "將 pipe(管道)讀取端包裝成 ``(transport, protocol)``。" #: ../../library/asyncio-llapi-index.rst:177 msgid "``await`` :meth:`loop.connect_write_pipe`" @@ -367,7 +367,7 @@ msgstr "``await`` :meth:`loop.connect_write_pipe`" #: ../../library/asyncio-llapi-index.rst:178 msgid "Wrap a write end of a pipe into a ``(transport, protocol)`` pair." -msgstr "將 pipe 寫入端包裝成 ``(transport, protocol)``\\ 。" +msgstr "將 pipe 寫入端包裝成 ``(transport, protocol)``。" #: ../../library/asyncio-llapi-index.rst:181 msgid "Sockets" @@ -412,7 +412,7 @@ msgstr "``await`` :meth:`loop.sock_sendall`" #: ../../library/asyncio-llapi-index.rst:199 msgid "Send data to the :class:`~socket.socket`." -msgstr "傳送資料到 :class:`~socket.socket`\\ 。" +msgstr "傳送資料到 :class:`~socket.socket`。" #: ../../library/asyncio-llapi-index.rst:201 msgid "``await`` :meth:`loop.sock_sendto`" @@ -428,7 +428,7 @@ msgstr "``await`` :meth:`loop.sock_connect`" #: ../../library/asyncio-llapi-index.rst:205 msgid "Connect the :class:`~socket.socket`." -msgstr "連接 :class:`~socket.socket`\\ 。" +msgstr "連接 :class:`~socket.socket`。" #: ../../library/asyncio-llapi-index.rst:207 msgid "``await`` :meth:`loop.sock_accept`" @@ -560,11 +560,11 @@ msgid "" "`." msgstr "" ":ref:`使用 asyncio.new_event_loop() 和 loop.run_forever() " -"`\\ 。" +"`。" #: ../../library/asyncio-llapi-index.rst:273 msgid ":ref:`Using loop.call_later() `." -msgstr ":ref:`使用 loop.call_later() `\\ 。" +msgstr ":ref:`使用 loop.call_later() `。" #: ../../library/asyncio-llapi-index.rst:275 msgid "" @@ -572,7 +572,7 @@ msgid "" "`." msgstr "" "使用 ``loop.create_connection()`` 以實作\\ :ref:`一個 echo 客戶端 " -"`\\ 。" +"`。" #: ../../library/asyncio-llapi-index.rst:278 msgid "" @@ -580,24 +580,23 @@ msgid "" "`." msgstr "" "使用 ``loop.create_connection()`` 來\\ :ref:`連接 socket " -"`\\ 。" +"`。" #: ../../library/asyncio-llapi-index.rst:281 msgid "" ":ref:`Using add_reader() to watch an FD for read events " "`." msgstr "" -":ref:`使用 add_reader() 監控 FD 的讀取事件 `\\ 。" +":ref:`使用 add_reader() 監控 FD 的讀取事件 `。" #: ../../library/asyncio-llapi-index.rst:284 msgid ":ref:`Using loop.add_signal_handler() `." -msgstr "" -":ref:`使用 loop.add_signal_handler() `\\ 。" +msgstr ":ref:`使用 loop.add_signal_handler() `。" #: ../../library/asyncio-llapi-index.rst:286 msgid ":ref:`Using loop.subprocess_exec() `." msgstr "" -":ref:`使用 loop.add_signal_handler() `\\ 。" +":ref:`使用 loop.add_signal_handler() `。" #: ../../library/asyncio-llapi-index.rst:290 msgid "Transports" @@ -621,7 +620,7 @@ msgstr ":meth:`transport.is_closing() `" #: ../../library/asyncio-llapi-index.rst:302 msgid "Return ``True`` if the transport is closing or is closed." -msgstr "如果傳輸正在關閉或已經關閉則回傳 ``True``\\ 。" +msgstr "如果傳輸正在關閉或已經關閉則回傳 ``True``。" #: ../../library/asyncio-llapi-index.rst:304 msgid ":meth:`transport.get_extra_info() `" @@ -654,8 +653,8 @@ msgid "" "create_unix_connection`, :meth:`loop.connect_read_pipe`, etc:" msgstr "" "可以接收資料(TCP 和 Unix 連線、pipe 等)的傳輸。它由 :meth:`loop." -"create_connection`\\ 、\\ :meth:`loop.create_unix_connection`\\ 、\\ :meth:" -"`loop.connect_read_pipe` 等方法回傳:" +"create_connection`、:meth:`loop.create_unix_connection`、:meth:`loop." +"connect_read_pipe` 等方法回傳:" #: ../../library/asyncio-llapi-index.rst:319 msgid "Read Transports" @@ -667,7 +666,7 @@ msgstr ":meth:`transport.is_reading() `" #: ../../library/asyncio-llapi-index.rst:325 msgid "Return ``True`` if the transport is receiving." -msgstr "如果傳輸正在接收則回傳 ``True``\\ 。" +msgstr "如果傳輸正在接收則回傳 ``True``。" #: ../../library/asyncio-llapi-index.rst:327 msgid ":meth:`transport.pause_reading() `" @@ -692,8 +691,8 @@ msgid "" "create_unix_connection`, :meth:`loop.connect_write_pipe`, etc:" msgstr "" "可以傳送資料(TCP 和 Unix 連線、pipe 等)的傳輸。它由 :meth:`loop." -"create_connection`\\ 、\\ :meth:`loop.create_unix_connection`\\ 、\\ :meth:" -"`loop.connect_write_pipe` 等方法回傳:" +"create_connection`、:meth:`loop.create_unix_connection`、:meth:`loop." +"connect_write_pipe` 等方法回傳:" #: ../../library/asyncio-llapi-index.rst:339 msgid "Write Transports" @@ -721,7 +720,7 @@ msgstr ":meth:`transport.can_write_eof() `" #: ../../library/asyncio-llapi-index.rst:351 msgid "Return :const:`True` if the transport supports sending EOF." -msgstr "如果傳輸支援傳送 EOF 則回傳 :const:`True`\\ 。" +msgstr "如果傳輸支援傳送 EOF 則回傳 :const:`True`。" #: ../../library/asyncio-llapi-index.rst:353 msgid ":meth:`transport.write_eof() `" @@ -830,8 +829,7 @@ msgstr "" msgid "" "Return the transport for the requested communication pipe (*stdin*, " "*stdout*, or *stderr*)." -msgstr "" -"回傳被請求用於通訊 pipe (*stdin*\\ 、\\ *stdout* 或 *stderr*)的傳輸。" +msgstr "回傳被請求用於通訊 pipe (*stdin*、*stdout* 或 *stderr*)的傳輸。" #: ../../library/asyncio-llapi-index.rst:403 msgid ":meth:`transport.get_returncode() `" @@ -989,40 +987,37 @@ msgid "Subprocess Protocols" msgstr "子行程協定" #: ../../library/asyncio-llapi-index.rst:487 -msgid "" -"``callback`` :meth:`pipe_data_received() `" -msgstr "" -"``callback`` :meth:`pipe_data_received() `" +msgid "``callback`` :meth:`~SubprocessProtocol.pipe_data_received`" +msgstr "``callback`` :meth:`~SubprocessProtocol.pipe_data_received`" -#: ../../library/asyncio-llapi-index.rst:489 +#: ../../library/asyncio-llapi-index.rst:488 msgid "" "Called when the child process writes data into its *stdout* or *stderr* pipe." msgstr "在子行程向 *stdout* 或 *stderr* pipe 寫入資料時被呼叫。" -#: ../../library/asyncio-llapi-index.rst:492 -msgid "" -"``callback`` :meth:`pipe_connection_lost() `" -msgstr "" -"``callback`` :meth:`pipe_connection_lost() `" +#: ../../library/asyncio-llapi-index.rst:491 +msgid "``callback`` :meth:`~SubprocessProtocol.pipe_connection_lost`" +msgstr "``callback`` :meth:`~SubprocessProtocol.pipe_connection_lost`" -#: ../../library/asyncio-llapi-index.rst:494 +#: ../../library/asyncio-llapi-index.rst:492 msgid "" "Called when one of the pipes communicating with the child process is closed." msgstr "在與子行程通訊的其中一個 pipes 關閉時被呼叫。" -#: ../../library/asyncio-llapi-index.rst:497 +#: ../../library/asyncio-llapi-index.rst:495 msgid "" "``callback`` :meth:`process_exited() `" msgstr "" "``callback`` :meth:`process_exited() `" -#: ../../library/asyncio-llapi-index.rst:499 -msgid "Called when the child process has exited." -msgstr "在子行程退出後被呼叫。" +#: ../../library/asyncio-llapi-index.rst:497 +msgid "" +"Called when the child process has exited. It can be called before :meth:" +"`~SubprocessProtocol.pipe_data_received` and :meth:`~SubprocessProtocol." +"pipe_connection_lost` methods." +msgstr "" +"在子行程退出時呼叫。它可以在 :meth:`~SubprocessProtocol.pipe_data_received` " +"和 :meth:`~SubprocessProtocol.pipe_connection_lost` 方法之前呼叫。" #: ../../library/asyncio-llapi-index.rst:503 msgid "Event Loop Policies" @@ -1035,7 +1030,7 @@ msgid "" "` for more details." msgstr "" "Policy 是改變 :func:`asyncio.get_event_loop` 這類函式行為的一個低階機制。更多" -"細節請見 :ref:`Policy 相關段落 `\\ 。" +"細節請見 :ref:`Policy 相關段落 `。" #: ../../library/asyncio-llapi-index.rst:511 msgid "Accessing Policies" diff --git a/library/asyncio-protocol.po b/library/asyncio-protocol.po index 971caf4c1e..c9cf7bfefb 100644 --- a/library/asyncio-protocol.po +++ b/library/asyncio-protocol.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+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-" @@ -931,101 +931,107 @@ msgstr "" msgid "Called when the child process has exited." msgstr "" -#: ../../library/asyncio-protocol.rst:713 +#: ../../library/asyncio-protocol.rst:711 +msgid "" +"It can be called before :meth:`~SubprocessProtocol.pipe_data_received` and :" +"meth:`~SubprocessProtocol.pipe_connection_lost` methods." +msgstr "" + +#: ../../library/asyncio-protocol.rst:716 msgid "Examples" msgstr "範例" -#: ../../library/asyncio-protocol.rst:718 +#: ../../library/asyncio-protocol.rst:721 msgid "TCP Echo Server" msgstr "" -#: ../../library/asyncio-protocol.rst:720 +#: ../../library/asyncio-protocol.rst:723 msgid "" "Create a TCP echo server using the :meth:`loop.create_server` method, send " "back received data, and close the connection::" msgstr "" -#: ../../library/asyncio-protocol.rst:761 +#: ../../library/asyncio-protocol.rst:764 msgid "" "The :ref:`TCP echo server using streams ` " "example uses the high-level :func:`asyncio.start_server` function." msgstr "" -#: ../../library/asyncio-protocol.rst:767 +#: ../../library/asyncio-protocol.rst:770 msgid "TCP Echo Client" msgstr "" -#: ../../library/asyncio-protocol.rst:769 +#: ../../library/asyncio-protocol.rst:772 msgid "" "A TCP echo client using the :meth:`loop.create_connection` method, sends " "data, and waits until the connection is closed::" msgstr "" -#: ../../library/asyncio-protocol.rst:817 +#: ../../library/asyncio-protocol.rst:820 msgid "" "The :ref:`TCP echo client using streams ` " "example uses the high-level :func:`asyncio.open_connection` function." msgstr "" -#: ../../library/asyncio-protocol.rst:824 +#: ../../library/asyncio-protocol.rst:827 msgid "UDP Echo Server" msgstr "" -#: ../../library/asyncio-protocol.rst:826 +#: ../../library/asyncio-protocol.rst:829 msgid "" "A UDP echo server, using the :meth:`loop.create_datagram_endpoint` method, " "sends back received data::" msgstr "" -#: ../../library/asyncio-protocol.rst:868 +#: ../../library/asyncio-protocol.rst:871 msgid "UDP Echo Client" msgstr "" -#: ../../library/asyncio-protocol.rst:870 +#: ../../library/asyncio-protocol.rst:873 msgid "" "A UDP echo client, using the :meth:`loop.create_datagram_endpoint` method, " "sends data and closes the transport when it receives the answer::" msgstr "" -#: ../../library/asyncio-protocol.rst:925 +#: ../../library/asyncio-protocol.rst:928 msgid "Connecting Existing Sockets" msgstr "" -#: ../../library/asyncio-protocol.rst:927 +#: ../../library/asyncio-protocol.rst:930 msgid "" "Wait until a socket receives data using the :meth:`loop.create_connection` " "method with a protocol::" msgstr "" -#: ../../library/asyncio-protocol.rst:981 +#: ../../library/asyncio-protocol.rst:984 msgid "" "The :ref:`watch a file descriptor for read events " "` example uses the low-level :meth:`loop." "add_reader` method to register an FD." msgstr "" -#: ../../library/asyncio-protocol.rst:985 +#: ../../library/asyncio-protocol.rst:988 msgid "" "The :ref:`register an open socket to wait for data using streams " "` example uses high-level streams " "created by the :func:`open_connection` function in a coroutine." msgstr "" -#: ../../library/asyncio-protocol.rst:992 +#: ../../library/asyncio-protocol.rst:995 msgid "loop.subprocess_exec() and SubprocessProtocol" msgstr "" -#: ../../library/asyncio-protocol.rst:994 +#: ../../library/asyncio-protocol.rst:997 msgid "" "An example of a subprocess protocol used to get the output of a subprocess " "and to wait for the subprocess exit." msgstr "" -#: ../../library/asyncio-protocol.rst:997 +#: ../../library/asyncio-protocol.rst:1000 msgid "The subprocess is created by the :meth:`loop.subprocess_exec` method::" msgstr "" -#: ../../library/asyncio-protocol.rst:1043 +#: ../../library/asyncio-protocol.rst:1060 msgid "" "See also the :ref:`same example ` " "written using high-level APIs." diff --git a/library/asyncio-task.po b/library/asyncio-task.po index 20eded89b3..6c96adc696 100644 --- a/library/asyncio-task.po +++ b/library/asyncio-task.po @@ -1,5 +1,4 @@ -# 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: @@ -7,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-20 00:03+0000\n" +"POT-Creation-Date: 2023-10-14 00:03+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-" @@ -305,7 +304,7 @@ msgstr "" #: ../../library/asyncio-task.rst:338 ../../library/asyncio-task.rst:472 #: ../../library/asyncio-task.rst:645 ../../library/asyncio-task.rst:703 -#: ../../library/asyncio-task.rst:729 ../../library/asyncio-task.rst:772 +#: ../../library/asyncio-task.rst:729 ../../library/asyncio-task.rst:769 #: ../../library/asyncio-task.rst:869 msgid "Example::" msgstr "" @@ -395,9 +394,8 @@ msgid "" msgstr "" #: ../../library/asyncio-task.rst:426 ../../library/asyncio-task.rst:521 -#: ../../library/asyncio-task.rst:620 ../../library/asyncio-task.rst:767 -#: ../../library/asyncio-task.rst:797 ../../library/asyncio-task.rst:849 -#: ../../library/asyncio-task.rst:875 +#: ../../library/asyncio-task.rst:620 ../../library/asyncio-task.rst:794 +#: ../../library/asyncio-task.rst:849 ../../library/asyncio-task.rst:875 msgid "Removed the *loop* parameter." msgstr "移除 *loop* 參數。" @@ -723,12 +721,16 @@ msgstr "" msgid "If the wait is cancelled, the future *aw* is also cancelled." msgstr "" -#: ../../library/asyncio-task.rst:792 +#: ../../library/asyncio-task.rst:789 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:797 +msgid "Raises :exc:`TimeoutError` instead of :exc:`asyncio.TimeoutError`." +msgstr "引發 :exc:`TimeoutError` 而不是 :exc:`asyncio.TimeoutError`。" + #: ../../library/asyncio-task.rst:802 msgid "Waiting Primitives" msgstr "" diff --git a/library/asyncio.po b/library/asyncio.po index b1deae96b2..c05bfecad4 100644 --- a/library/asyncio.po +++ b/library/asyncio.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:17+0000\n" +"POT-Creation-Date: 2023-10-12 00:03+0000\n" "PO-Revision-Date: 2021-11-23 12:40+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -21,15 +21,15 @@ msgstr "" "Plural-Forms: nplurals=1; plural=0;\n" "X-Generator: Poedit 3.0\n" -#: ../../library/asyncio.rst:78 +#: ../../library/asyncio.rst:80 msgid "High-level APIs" msgstr "高階 API" -#: ../../library/asyncio.rst:90 +#: ../../library/asyncio.rst:92 msgid "Low-level APIs" msgstr "低階 API" -#: ../../library/asyncio.rst:101 +#: ../../library/asyncio.rst:103 msgid "Guides and Tutorials" msgstr "指南與教學" @@ -127,7 +127,7 @@ msgstr "" "透過 async/await 語法來\\ :ref:`橋接 `\\ 基於回呼 (callback-" "based) 的函式庫與程式碼。" -#: ../../library/asyncio.rst:59 +#: ../../library/asyncio.rst:61 msgid "You can experiment with an ``asyncio`` concurrent context in the REPL:" msgstr "你能在 REPL 中對一個 ``asyncio`` 的並行情境 (context) 進行實驗:" @@ -144,10 +144,10 @@ msgstr "" "此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上不起作用" "或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" -#: ../../library/asyncio.rst:77 +#: ../../library/asyncio.rst:79 msgid "Reference" msgstr "參閱" -#: ../../library/asyncio.rst:110 +#: ../../library/asyncio.rst:112 msgid "The source code for asyncio can be found in :source:`Lib/asyncio/`." msgstr "asyncio 的原始碼可以在 :source:`Lib/asyncio/` 中找到。" diff --git a/library/binascii.po b/library/binascii.po index 2a454d8619..8528897275 100644 --- a/library/binascii.po +++ b/library/binascii.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-10-12 00:03+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-" @@ -79,51 +79,51 @@ msgid "" "base64 data will raise :exc:`binascii.Error`." msgstr "" -#: ../../library/binascii.rst:64 +#: ../../library/binascii.rst:60 msgid "Valid base64:" msgstr "" -#: ../../library/binascii.rst:61 +#: ../../library/binascii.rst:62 msgid "Conforms to :rfc:`3548`." msgstr "" -#: ../../library/binascii.rst:62 +#: ../../library/binascii.rst:63 msgid "Contains only characters from the base64 alphabet." msgstr "" -#: ../../library/binascii.rst:63 +#: ../../library/binascii.rst:64 msgid "" "Contains no excess data after padding (including excess padding, newlines, " "etc.)." msgstr "" -#: ../../library/binascii.rst:64 +#: ../../library/binascii.rst:65 msgid "Does not start with a padding." msgstr "" -#: ../../library/binascii.rst:66 +#: ../../library/binascii.rst:67 msgid "Added the *strict_mode* parameter." msgstr "新增 *strict_mode* 參數。" -#: ../../library/binascii.rst:72 +#: ../../library/binascii.rst:73 msgid "" "Convert binary data to a line of ASCII characters in base64 coding. The " "return value is the converted line, including a newline char if *newline* is " "true. The output of this function conforms to :rfc:`3548`." msgstr "" -#: ../../library/binascii.rst:76 +#: ../../library/binascii.rst:77 msgid "Added the *newline* parameter." msgstr "新增 *newline* 參數。" -#: ../../library/binascii.rst:82 +#: ../../library/binascii.rst:83 msgid "" "Convert a block of quoted-printable data back to binary and return the " "binary data. More than one line may be passed at a time. If the optional " "argument *header* is present and true, underscores will be decoded as spaces." msgstr "" -#: ../../library/binascii.rst:89 +#: ../../library/binascii.rst:90 msgid "" "Convert binary data to a line(s) of ASCII characters in quoted-printable " "encoding. The return value is the converted line(s). If the optional " @@ -136,7 +136,7 @@ msgid "" "might corrupt the binary data stream." msgstr "" -#: ../../library/binascii.rst:102 +#: ../../library/binascii.rst:103 msgid "" "Compute a 16-bit CRC value of *data*, starting with *value* as the initial " "CRC, and return the result. This uses the CRC-CCITT polynomial *x*:sup:`16` " @@ -144,7 +144,7 @@ msgid "" "used in the binhex4 format." msgstr "" -#: ../../library/binascii.rst:110 +#: ../../library/binascii.rst:111 msgid "" "Compute CRC-32, the unsigned 32-bit checksum of *data*, starting with an " "initial CRC of *value*. The default initial CRC is zero. The algorithm is " @@ -153,24 +153,24 @@ msgid "" "algorithm. Use as follows::" msgstr "" -#: ../../library/binascii.rst:122 +#: ../../library/binascii.rst:123 msgid "The result is always unsigned." msgstr "" -#: ../../library/binascii.rst:128 +#: ../../library/binascii.rst:129 msgid "" "Return the hexadecimal representation of the binary *data*. Every byte of " "*data* is converted into the corresponding 2-digit hex representation. The " "returned bytes object is therefore twice as long as the length of *data*." msgstr "" -#: ../../library/binascii.rst:132 +#: ../../library/binascii.rst:133 msgid "" "Similar functionality (but returning a text string) is also conveniently " "accessible using the :meth:`bytes.hex` method." msgstr "" -#: ../../library/binascii.rst:135 +#: ../../library/binascii.rst:136 msgid "" "If *sep* is specified, it must be a single character str or bytes object. It " "will be inserted in the output after every *bytes_per_sep* input bytes. " @@ -178,11 +178,11 @@ msgid "" "if you wish to count from the left, supply a negative *bytes_per_sep* value." msgstr "" -#: ../../library/binascii.rst:150 +#: ../../library/binascii.rst:151 msgid "The *sep* and *bytes_per_sep* parameters were added." msgstr "新增 *sep* 與 *bytes_per_sep* 參數。" -#: ../../library/binascii.rst:156 +#: ../../library/binascii.rst:157 msgid "" "Return the binary data represented by the hexadecimal string *hexstr*. This " "function is the inverse of :func:`b2a_hex`. *hexstr* must contain an even " @@ -190,45 +190,45 @@ msgid "" "an :exc:`Error` exception is raised." msgstr "" -#: ../../library/binascii.rst:161 +#: ../../library/binascii.rst:162 msgid "" "Similar functionality (accepting only text string arguments, but more " "liberal towards whitespace) is also accessible using the :meth:`bytes." "fromhex` class method." msgstr "" -#: ../../library/binascii.rst:167 +#: ../../library/binascii.rst:168 msgid "Exception raised on errors. These are usually programming errors." msgstr "" -#: ../../library/binascii.rst:172 +#: ../../library/binascii.rst:173 msgid "" "Exception raised on incomplete data. These are usually not programming " "errors, but may be handled by reading a little more data and trying again." msgstr "" -#: ../../library/binascii.rst:180 +#: ../../library/binascii.rst:181 msgid "Module :mod:`base64`" msgstr ":mod:`base64` 模組" -#: ../../library/binascii.rst:179 +#: ../../library/binascii.rst:180 msgid "" "Support for RFC compliant base64-style encoding in base 16, 32, 64, and 85." msgstr "" -#: ../../library/binascii.rst:183 +#: ../../library/binascii.rst:184 msgid "Module :mod:`uu`" msgstr ":mod:`uu` 模組" -#: ../../library/binascii.rst:183 +#: ../../library/binascii.rst:184 msgid "Support for UU encoding used on Unix." msgstr "" -#: ../../library/binascii.rst:185 +#: ../../library/binascii.rst:186 msgid "Module :mod:`quopri`" msgstr ":mod:`quopri` 模組" -#: ../../library/binascii.rst:186 +#: ../../library/binascii.rst:187 msgid "Support for quoted-printable encoding used in MIME email messages." msgstr "" diff --git a/library/cmdline.po b/library/cmdline.po new file mode 100644 index 0000000000..5f894724f8 --- /dev/null +++ b/library/cmdline.po @@ -0,0 +1,226 @@ +# Copyright (C) 2001-2023, Python Software Foundation +# This file is distributed under the same license as the Python package. +# +# Translators: +# Matt Wang , 2023 +msgid "" +msgstr "" +"Project-Id-Version: Python 3.12\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-10-12 00:03+0000\n" +"PO-Revision-Date: 2023-10-14 16:03+0800\n" +"Last-Translator: Matt Wang \n" +"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" +"tw)\n" +"Language: zh_TW\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../../library/cmdline.rst:3 +msgid "Modules command-line interface (CLI)" +msgstr "模組命令列介面" + +#: ../../library/cmdline.rst:5 +msgid "The following modules have a command-line interface." +msgstr "以下模組具有命令列介面。" + +#: ../../library/cmdline.rst:7 +msgid ":ref:`ast `" +msgstr ":ref:`ast `" + +#: ../../library/cmdline.rst:8 +msgid ":ref:`asyncio `" +msgstr ":ref:`asyncio `" + +#: ../../library/cmdline.rst:9 +msgid ":mod:`base64`" +msgstr ":mod:`base64`" + +#: ../../library/cmdline.rst:10 +msgid ":ref:`calendar `" +msgstr ":ref:`calendar `" + +#: ../../library/cmdline.rst:11 +msgid ":mod:`code`" +msgstr ":mod:`code`" + +#: ../../library/cmdline.rst:12 +msgid ":ref:`compileall `" +msgstr ":ref:`compileall `" + +#: ../../library/cmdline.rst:13 +msgid ":mod:`cProfile`: see :ref:`profile `" +msgstr ":mod:`cProfile`: 請見 :ref:`profile `" + +#: ../../library/cmdline.rst:14 +msgid ":ref:`difflib `" +msgstr ":ref:`difflib `" + +#: ../../library/cmdline.rst:15 +msgid ":ref:`dis `" +msgstr ":ref:`dis `" + +#: ../../library/cmdline.rst:16 +msgid ":mod:`doctest`" +msgstr ":mod:`doctest`" + +#: ../../library/cmdline.rst:17 +msgid ":mod:`!encodings.rot_13`" +msgstr ":mod:`!encodings.rot_13`" + +#: ../../library/cmdline.rst:18 +msgid ":mod:`ensurepip`" +msgstr ":mod:`ensurepip`" + +#: ../../library/cmdline.rst:19 +msgid ":mod:`filecmp`" +msgstr ":mod:`filecmp`" + +#: ../../library/cmdline.rst:20 +msgid ":mod:`fileinput`" +msgstr ":mod:`fileinput`" + +#: ../../library/cmdline.rst:21 +msgid ":mod:`ftplib`" +msgstr ":mod:`ftplib`" + +#: ../../library/cmdline.rst:22 +msgid ":ref:`gzip `" +msgstr ":ref:`gzip `" + +#: ../../library/cmdline.rst:23 +msgid ":ref:`http.server `" +msgstr ":ref:`http.server `" + +#: ../../library/cmdline.rst:24 +msgid ":mod:`!idlelib`" +msgstr ":mod:`!idlelib`" + +#: ../../library/cmdline.rst:25 +msgid ":ref:`inspect `" +msgstr ":ref:`inspect `" + +#: ../../library/cmdline.rst:26 +msgid ":ref:`json.tool `" +msgstr ":ref:`json.tool `" + +#: ../../library/cmdline.rst:27 +msgid ":mod:`mimetypes`" +msgstr ":mod:`mimetypes`" + +#: ../../library/cmdline.rst:28 +msgid ":mod:`pdb`" +msgstr ":mod:`pdb`" + +#: ../../library/cmdline.rst:29 +msgid ":mod:`pickle`" +msgstr ":mod:`pickle`" + +#: ../../library/cmdline.rst:30 +msgid ":ref:`pickletools `" +msgstr ":ref:`pickletools `" + +#: ../../library/cmdline.rst:31 +msgid ":mod:`platform`" +msgstr ":mod:`platform`" + +#: ../../library/cmdline.rst:32 +msgid ":mod:`poplib`" +msgstr ":mod:`poplib`" + +#: ../../library/cmdline.rst:33 +msgid ":ref:`profile `" +msgstr ":ref:`profile `" + +#: ../../library/cmdline.rst:34 +msgid ":mod:`pstats`" +msgstr ":mod:`pstats`" + +#: ../../library/cmdline.rst:35 +msgid ":ref:`py_compile `" +msgstr ":ref:`py_compile `" + +#: ../../library/cmdline.rst:36 +msgid ":mod:`pyclbr`" +msgstr ":mod:`pyclbr`" + +#: ../../library/cmdline.rst:37 +msgid ":mod:`pydoc`" +msgstr ":mod:`pydoc`" + +#: ../../library/cmdline.rst:38 +msgid ":mod:`quopri`" +msgstr ":mod:`quopri`" + +#: ../../library/cmdline.rst:39 +msgid ":mod:`runpy`" +msgstr ":mod:`runpy`" + +#: ../../library/cmdline.rst:40 +msgid ":ref:`site `" +msgstr ":ref:`site `" + +#: ../../library/cmdline.rst:41 +msgid ":ref:`sqlite3 `" +msgstr ":ref:`sqlite3 `" + +#: ../../library/cmdline.rst:42 +msgid ":ref:`sysconfig `" +msgstr ":ref:`sysconfig `" + +#: ../../library/cmdline.rst:43 +msgid ":mod:`tabnanny`" +msgstr ":mod:`tabnanny`" + +#: ../../library/cmdline.rst:44 +msgid ":ref:`tarfile `" +msgstr ":ref:`tarfile `" + +#: ../../library/cmdline.rst:45 +msgid ":mod:`!this`" +msgstr ":mod:`!this`" + +#: ../../library/cmdline.rst:46 +msgid ":ref:`timeit `" +msgstr ":ref:`timeit `" + +#: ../../library/cmdline.rst:47 +msgid ":ref:`tokenize `" +msgstr ":ref:`tokenize `" + +#: ../../library/cmdline.rst:48 +msgid ":ref:`trace `" +msgstr ":ref:`trace `" + +#: ../../library/cmdline.rst:49 +msgid ":mod:`turtledemo`" +msgstr ":mod:`turtledemo`" + +#: ../../library/cmdline.rst:50 +msgid ":ref:`unittest `" +msgstr ":ref:`unittest `" + +#: ../../library/cmdline.rst:51 +msgid ":ref:`uuid `" +msgstr ":ref:`uuid `" + +#: ../../library/cmdline.rst:52 +msgid ":mod:`venv`" +msgstr ":mod:`venv`" + +#: ../../library/cmdline.rst:53 +msgid ":mod:`webbrowser`" +msgstr ":mod:`webbrowser`" + +#: ../../library/cmdline.rst:54 +msgid ":ref:`zipapp `" +msgstr ":ref:`zipapp `" + +#: ../../library/cmdline.rst:55 +msgid ":ref:`zipfile `" +msgstr ":ref:`zipfile `" + +#: ../../library/cmdline.rst:57 +msgid "See also the :ref:`Python command-line interface `." +msgstr "另請見 :ref:`Python 命令列介面 `。" diff --git a/library/codecs.po b/library/codecs.po index 80c52869c2..c619a48de8 100644 --- a/library/codecs.po +++ b/library/codecs.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2018-05-23 14:40+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -363,14 +363,14 @@ msgid "" "encodings` codecs:" msgstr "" -#: ../../library/codecs.rst:330 ../../library/codecs.rst:372 -#: ../../library/codecs.rst:391 +#: ../../library/codecs.rst:330 ../../library/codecs.rst:373 +#: ../../library/codecs.rst:393 msgid "Value" msgstr "" -#: ../../library/codecs.rst:330 ../../library/codecs.rst:372 -#: ../../library/codecs.rst:391 ../../library/codecs.rst:1324 -#: ../../library/codecs.rst:1391 ../../library/codecs.rst:1446 +#: ../../library/codecs.rst:330 ../../library/codecs.rst:373 +#: ../../library/codecs.rst:393 ../../library/codecs.rst:1327 +#: ../../library/codecs.rst:1395 ../../library/codecs.rst:1450 msgid "Meaning" msgstr "" @@ -412,16 +412,16 @@ msgstr "``'backslashreplace'``" #: ../../library/codecs.rst:346 msgid "" "Replace with backslashed escape sequences. On encoding, use hexadecimal form " -"of Unicode code point with formats ``\\xhh`` ``\\uxxxx`` ``\\Uxxxxxxxx``. On " -"decoding, use hexadecimal form of byte value with format ``\\xhh``. " -"Implemented in :func:`backslashreplace_errors`." +"of Unicode code point with formats :samp:`\\\\x{hh}` :samp:`\\\\u{xxxx}` :" +"samp:`\\\\U{xxxxxxxx}`. On decoding, use hexadecimal form of byte value with " +"format :samp:`\\\\x{hh}`. Implemented in :func:`backslashreplace_errors`." msgstr "" -#: ../../library/codecs.rst:354 +#: ../../library/codecs.rst:355 msgid "``'surrogateescape'``" msgstr "``'surrogateescape'``" -#: ../../library/codecs.rst:354 +#: ../../library/codecs.rst:355 msgid "" "On decoding, replace byte with individual surrogate code ranging from " "``U+DC80`` to ``U+DCFF``. This code will then be turned back into the same " @@ -429,92 +429,92 @@ msgid "" "data. (See :pep:`383` for more.)" msgstr "" -#: ../../library/codecs.rst:368 +#: ../../library/codecs.rst:369 msgid "" "The following error handlers are only applicable to encoding (within :term:" "`text encodings `):" msgstr "" -#: ../../library/codecs.rst:374 +#: ../../library/codecs.rst:375 msgid "``'xmlcharrefreplace'``" msgstr "``'xmlcharrefreplace'``" -#: ../../library/codecs.rst:374 +#: ../../library/codecs.rst:375 msgid "" "Replace with XML/HTML numeric character reference, which is a decimal form " -"of Unicode code point with format ``&#num;`` Implemented in :func:" +"of Unicode code point with format :samp:`&#{num};`. Implemented in :func:" "`xmlcharrefreplace_errors`." msgstr "" -#: ../../library/codecs.rst:379 +#: ../../library/codecs.rst:381 msgid "``'namereplace'``" msgstr "``'namereplace'``" -#: ../../library/codecs.rst:379 +#: ../../library/codecs.rst:381 msgid "" "Replace with ``\\N{...}`` escape sequences, what appears in the braces is " "the Name property from Unicode Character Database. Implemented in :func:" "`namereplace_errors`." msgstr "" -#: ../../library/codecs.rst:388 +#: ../../library/codecs.rst:390 msgid "" "In addition, the following error handler is specific to the given codecs:" msgstr "" -#: ../../library/codecs.rst:13 ../../library/codecs.rst:391 +#: ../../library/codecs.rst:13 ../../library/codecs.rst:393 msgid "Codecs" msgstr "" -#: ../../library/codecs.rst:393 +#: ../../library/codecs.rst:395 msgid "``'surrogatepass'``" msgstr "``'surrogatepass'``" -#: ../../library/codecs.rst:393 +#: ../../library/codecs.rst:395 msgid "utf-8, utf-16, utf-32, utf-16-be, utf-16-le, utf-32-be, utf-32-le" msgstr "utf-8, utf-16, utf-32, utf-16-be, utf-16-le, utf-32-be, utf-32-le" -#: ../../library/codecs.rst:393 +#: ../../library/codecs.rst:395 msgid "" "Allow encoding and decoding surrogate code point (``U+D800`` - ``U+DFFF``) " "as normal code point. Otherwise these codecs treat the presence of surrogate " "code point in :class:`str` as an error." msgstr "" -#: ../../library/codecs.rst:400 +#: ../../library/codecs.rst:402 msgid "The ``'surrogateescape'`` and ``'surrogatepass'`` error handlers." msgstr "" -#: ../../library/codecs.rst:403 +#: ../../library/codecs.rst:405 msgid "" "The ``'surrogatepass'`` error handler now works with utf-16\\* and utf-32\\* " "codecs." msgstr "" -#: ../../library/codecs.rst:407 +#: ../../library/codecs.rst:409 msgid "The ``'namereplace'`` error handler." msgstr "" -#: ../../library/codecs.rst:410 +#: ../../library/codecs.rst:412 msgid "" "The ``'backslashreplace'`` error handler now works with decoding and " "translating." msgstr "" -#: ../../library/codecs.rst:414 +#: ../../library/codecs.rst:416 msgid "" "The set of allowed values can be extended by registering a new named error " "handler:" msgstr "" -#: ../../library/codecs.rst:419 +#: ../../library/codecs.rst:421 msgid "" "Register the error handling function *error_handler* under the name *name*. " "The *error_handler* argument will be called during encoding and decoding in " "case of an error, when *name* is specified as the errors parameter." msgstr "" -#: ../../library/codecs.rst:423 +#: ../../library/codecs.rst:425 msgid "" "For encoding, *error_handler* will be called with a :exc:" "`UnicodeEncodeError` instance, which contains information about the location " @@ -529,97 +529,97 @@ msgid "" "position is out of bound an :exc:`IndexError` will be raised." msgstr "" -#: ../../library/codecs.rst:435 +#: ../../library/codecs.rst:437 msgid "" "Decoding and translating works similarly, except :exc:`UnicodeDecodeError` " "or :exc:`UnicodeTranslateError` will be passed to the handler and that the " "replacement from the error handler will be put into the output directly." msgstr "" -#: ../../library/codecs.rst:440 +#: ../../library/codecs.rst:442 msgid "" "Previously registered error handlers (including the standard error handlers) " "can be looked up by name:" msgstr "" -#: ../../library/codecs.rst:445 +#: ../../library/codecs.rst:447 msgid "Return the error handler previously registered under the name *name*." msgstr "" -#: ../../library/codecs.rst:447 +#: ../../library/codecs.rst:449 msgid "Raises a :exc:`LookupError` in case the handler cannot be found." msgstr "" -#: ../../library/codecs.rst:449 +#: ../../library/codecs.rst:451 msgid "" "The following standard error handlers are also made available as module " "level functions:" msgstr "" -#: ../../library/codecs.rst:454 +#: ../../library/codecs.rst:456 msgid "Implements the ``'strict'`` error handling." msgstr "" -#: ../../library/codecs.rst:456 +#: ../../library/codecs.rst:458 msgid "Each encoding or decoding error raises a :exc:`UnicodeError`." msgstr "" -#: ../../library/codecs.rst:461 +#: ../../library/codecs.rst:463 msgid "Implements the ``'ignore'`` error handling." msgstr "" -#: ../../library/codecs.rst:463 +#: ../../library/codecs.rst:465 msgid "" "Malformed data is ignored; encoding or decoding is continued without further " "notice." msgstr "" -#: ../../library/codecs.rst:469 +#: ../../library/codecs.rst:471 msgid "Implements the ``'replace'`` error handling." msgstr "" -#: ../../library/codecs.rst:471 +#: ../../library/codecs.rst:473 msgid "" "Substitutes ``?`` (ASCII character) for encoding errors or ``�`` (U+FFFD, " "the official REPLACEMENT CHARACTER) for decoding errors." msgstr "" -#: ../../library/codecs.rst:477 +#: ../../library/codecs.rst:479 msgid "Implements the ``'backslashreplace'`` error handling." msgstr "" -#: ../../library/codecs.rst:479 +#: ../../library/codecs.rst:481 msgid "" "Malformed data is replaced by a backslashed escape sequence. On encoding, " -"use the hexadecimal form of Unicode code point with formats ``\\xhh`` " -"``\\uxxxx`` ``\\Uxxxxxxxx``. On decoding, use the hexadecimal form of byte " -"value with format ``\\xhh``." +"use the hexadecimal form of Unicode code point with formats :samp:`\\\\x{hh}" +"` :samp:`\\\\u{xxxx}` :samp:`\\\\U{xxxxxxxx}`. On decoding, use the " +"hexadecimal form of byte value with format :samp:`\\\\x{hh}`." msgstr "" -#: ../../library/codecs.rst:484 +#: ../../library/codecs.rst:487 msgid "Works with decoding and translating." msgstr "" -#: ../../library/codecs.rst:490 +#: ../../library/codecs.rst:493 msgid "" "Implements the ``'xmlcharrefreplace'`` error handling (for encoding within :" "term:`text encoding` only)." msgstr "" -#: ../../library/codecs.rst:493 +#: ../../library/codecs.rst:496 msgid "" "The unencodable character is replaced by an appropriate XML/HTML numeric " "character reference, which is a decimal form of Unicode code point with " -"format ``&#num;`` ." +"format :samp:`&#{num};` ." msgstr "" -#: ../../library/codecs.rst:500 +#: ../../library/codecs.rst:503 msgid "" "Implements the ``'namereplace'`` error handling (for encoding within :term:" "`text encoding` only)." msgstr "" -#: ../../library/codecs.rst:503 +#: ../../library/codecs.rst:506 msgid "" "The unencodable character is replaced by a ``\\N{...}`` escape sequence. The " "set of characters that appear in the braces is the Name property from " @@ -627,17 +627,17 @@ msgid "" "will be converted to byte sequence ``\\N{LATIN SMALL LETTER SHARP S}`` ." msgstr "" -#: ../../library/codecs.rst:514 +#: ../../library/codecs.rst:517 msgid "Stateless Encoding and Decoding" msgstr "" -#: ../../library/codecs.rst:516 +#: ../../library/codecs.rst:519 msgid "" "The base :class:`Codec` class defines these methods which also define the " "function interfaces of the stateless encoder and decoder:" msgstr "" -#: ../../library/codecs.rst:522 +#: ../../library/codecs.rst:525 msgid "" "Encodes the object *input* and returns a tuple (output object, length " "consumed). For instance, :term:`text encoding` converts a string object to a " @@ -645,26 +645,26 @@ msgid "" "``iso-8859-1``)." msgstr "" -#: ../../library/codecs.rst:527 ../../library/codecs.rst:549 +#: ../../library/codecs.rst:530 ../../library/codecs.rst:552 msgid "" "The *errors* argument defines the error handling to apply. It defaults to " "``'strict'`` handling." msgstr "" -#: ../../library/codecs.rst:530 +#: ../../library/codecs.rst:533 msgid "" "The method may not store state in the :class:`Codec` instance. Use :class:" "`StreamWriter` for codecs which have to keep state in order to make encoding " "efficient." msgstr "" -#: ../../library/codecs.rst:534 +#: ../../library/codecs.rst:537 msgid "" "The encoder must be able to handle zero length input and return an empty " "object of the output object type in this situation." msgstr "" -#: ../../library/codecs.rst:540 +#: ../../library/codecs.rst:543 msgid "" "Decodes the object *input* and returns a tuple (output object, length " "consumed). For instance, for a :term:`text encoding`, decoding converts a " @@ -672,31 +672,31 @@ msgid "" "object." msgstr "" -#: ../../library/codecs.rst:545 +#: ../../library/codecs.rst:548 msgid "" "For text encodings and bytes-to-bytes codecs, *input* must be a bytes object " "or one which provides the read-only buffer interface -- for example, buffer " "objects and memory mapped files." msgstr "" -#: ../../library/codecs.rst:552 +#: ../../library/codecs.rst:555 msgid "" "The method may not store state in the :class:`Codec` instance. Use :class:" "`StreamReader` for codecs which have to keep state in order to make decoding " "efficient." msgstr "" -#: ../../library/codecs.rst:556 +#: ../../library/codecs.rst:559 msgid "" "The decoder must be able to handle zero length input and return an empty " "object of the output object type in this situation." msgstr "" -#: ../../library/codecs.rst:561 +#: ../../library/codecs.rst:564 msgid "Incremental Encoding and Decoding" msgstr "" -#: ../../library/codecs.rst:563 +#: ../../library/codecs.rst:566 msgid "" "The :class:`IncrementalEncoder` and :class:`IncrementalDecoder` classes " "provide the basic interface for incremental encoding and decoding. Encoding/" @@ -707,7 +707,7 @@ msgid "" "during method calls." msgstr "" -#: ../../library/codecs.rst:571 +#: ../../library/codecs.rst:574 msgid "" "The joined output of calls to the :meth:`~IncrementalEncoder.encode`/:meth:" "`~IncrementalDecoder.decode` method is the same as if all the single inputs " @@ -715,36 +715,36 @@ msgid "" "encoder/decoder." msgstr "" -#: ../../library/codecs.rst:580 +#: ../../library/codecs.rst:583 msgid "IncrementalEncoder Objects" msgstr "IncrementalEncoder 物件" -#: ../../library/codecs.rst:582 +#: ../../library/codecs.rst:585 msgid "" "The :class:`IncrementalEncoder` class is used for encoding an input in " "multiple steps. It defines the following methods which every incremental " "encoder must define in order to be compatible with the Python codec registry." msgstr "" -#: ../../library/codecs.rst:589 +#: ../../library/codecs.rst:592 msgid "Constructor for an :class:`IncrementalEncoder` instance." msgstr "" -#: ../../library/codecs.rst:591 +#: ../../library/codecs.rst:594 msgid "" "All incremental encoders must provide this constructor interface. They are " "free to add additional keyword arguments, but only the ones defined here are " "used by the Python codec registry." msgstr "" -#: ../../library/codecs.rst:595 +#: ../../library/codecs.rst:598 msgid "" "The :class:`IncrementalEncoder` may implement different error handling " "schemes by providing the *errors* keyword argument. See :ref:`error-" "handlers` for possible values." msgstr "" -#: ../../library/codecs.rst:599 +#: ../../library/codecs.rst:602 msgid "" "The *errors* argument will be assigned to an attribute of the same name. " "Assigning to this attribute makes it possible to switch between different " @@ -752,21 +752,21 @@ msgid "" "`IncrementalEncoder` object." msgstr "" -#: ../../library/codecs.rst:607 +#: ../../library/codecs.rst:610 msgid "" "Encodes *object* (taking the current state of the encoder into account) and " "returns the resulting encoded object. If this is the last call to :meth:" "`encode` *final* must be true (the default is false)." msgstr "" -#: ../../library/codecs.rst:614 +#: ../../library/codecs.rst:617 msgid "" "Reset the encoder to the initial state. The output is discarded: call ``." "encode(object, final=True)``, passing an empty byte or text string if " "necessary, to reset the encoder and to get the output." msgstr "" -#: ../../library/codecs.rst:621 +#: ../../library/codecs.rst:624 msgid "" "Return the current state of the encoder which must be an integer. The " "implementation should make sure that ``0`` is the most common state. (States " @@ -775,42 +775,42 @@ msgid "" "into an integer.)" msgstr "" -#: ../../library/codecs.rst:630 +#: ../../library/codecs.rst:633 msgid "" "Set the state of the encoder to *state*. *state* must be an encoder state " "returned by :meth:`getstate`." msgstr "" -#: ../../library/codecs.rst:637 +#: ../../library/codecs.rst:640 msgid "IncrementalDecoder Objects" msgstr "IncrementalDecoder 物件" -#: ../../library/codecs.rst:639 +#: ../../library/codecs.rst:642 msgid "" "The :class:`IncrementalDecoder` class is used for decoding an input in " "multiple steps. It defines the following methods which every incremental " "decoder must define in order to be compatible with the Python codec registry." msgstr "" -#: ../../library/codecs.rst:646 +#: ../../library/codecs.rst:649 msgid "Constructor for an :class:`IncrementalDecoder` instance." msgstr "" -#: ../../library/codecs.rst:648 +#: ../../library/codecs.rst:651 msgid "" "All incremental decoders must provide this constructor interface. They are " "free to add additional keyword arguments, but only the ones defined here are " "used by the Python codec registry." msgstr "" -#: ../../library/codecs.rst:652 +#: ../../library/codecs.rst:655 msgid "" "The :class:`IncrementalDecoder` may implement different error handling " "schemes by providing the *errors* keyword argument. See :ref:`error-" "handlers` for possible values." msgstr "" -#: ../../library/codecs.rst:656 +#: ../../library/codecs.rst:659 msgid "" "The *errors* argument will be assigned to an attribute of the same name. " "Assigning to this attribute makes it possible to switch between different " @@ -818,7 +818,7 @@ msgid "" "`IncrementalDecoder` object." msgstr "" -#: ../../library/codecs.rst:664 +#: ../../library/codecs.rst:667 msgid "" "Decodes *object* (taking the current state of the decoder into account) and " "returns the resulting decoded object. If this is the last call to :meth:" @@ -829,11 +829,11 @@ msgid "" "(which might raise an exception)." msgstr "" -#: ../../library/codecs.rst:675 +#: ../../library/codecs.rst:678 msgid "Reset the decoder to the initial state." msgstr "" -#: ../../library/codecs.rst:680 +#: ../../library/codecs.rst:683 msgid "" "Return the current state of the decoder. This must be a tuple with two " "items, the first must be the buffer containing the still undecoded input. " @@ -848,59 +848,59 @@ msgid "" "bytes of the resulting string into an integer.)" msgstr "" -#: ../../library/codecs.rst:695 +#: ../../library/codecs.rst:698 msgid "" "Set the state of the decoder to *state*. *state* must be a decoder state " "returned by :meth:`getstate`." msgstr "" -#: ../../library/codecs.rst:700 +#: ../../library/codecs.rst:703 msgid "Stream Encoding and Decoding" msgstr "" -#: ../../library/codecs.rst:703 +#: ../../library/codecs.rst:706 msgid "" "The :class:`StreamWriter` and :class:`StreamReader` classes provide generic " "working interfaces which can be used to implement new encoding submodules " "very easily. See :mod:`encodings.utf_8` for an example of how this is done." msgstr "" -#: ../../library/codecs.rst:711 +#: ../../library/codecs.rst:714 msgid "StreamWriter Objects" msgstr "StreamWriter 物件" -#: ../../library/codecs.rst:713 +#: ../../library/codecs.rst:716 msgid "" "The :class:`StreamWriter` class is a subclass of :class:`Codec` and defines " "the following methods which every stream writer must define in order to be " "compatible with the Python codec registry." msgstr "" -#: ../../library/codecs.rst:720 +#: ../../library/codecs.rst:723 msgid "Constructor for a :class:`StreamWriter` instance." msgstr "" -#: ../../library/codecs.rst:722 +#: ../../library/codecs.rst:725 msgid "" "All stream writers must provide this constructor interface. They are free to " "add additional keyword arguments, but only the ones defined here are used by " "the Python codec registry." msgstr "" -#: ../../library/codecs.rst:726 +#: ../../library/codecs.rst:729 msgid "" "The *stream* argument must be a file-like object open for writing text or " "binary data, as appropriate for the specific codec." msgstr "" -#: ../../library/codecs.rst:729 +#: ../../library/codecs.rst:732 msgid "" "The :class:`StreamWriter` may implement different error handling schemes by " "providing the *errors* keyword argument. See :ref:`error-handlers` for the " "standard error handlers the underlying stream codec may support." msgstr "" -#: ../../library/codecs.rst:733 +#: ../../library/codecs.rst:736 msgid "" "The *errors* argument will be assigned to an attribute of the same name. " "Assigning to this attribute makes it possible to switch between different " @@ -908,70 +908,70 @@ msgid "" "object." msgstr "" -#: ../../library/codecs.rst:739 +#: ../../library/codecs.rst:742 msgid "Writes the object's contents encoded to the stream." msgstr "" -#: ../../library/codecs.rst:744 +#: ../../library/codecs.rst:747 msgid "" "Writes the concatenated iterable of strings to the stream (possibly by " "reusing the :meth:`write` method). Infinite or very large iterables are not " "supported. The standard bytes-to-bytes codecs do not support this method." msgstr "" -#: ../../library/codecs.rst:752 ../../library/codecs.rst:847 +#: ../../library/codecs.rst:755 ../../library/codecs.rst:850 msgid "Resets the codec buffers used for keeping internal state." msgstr "" -#: ../../library/codecs.rst:754 +#: ../../library/codecs.rst:757 msgid "" "Calling this method should ensure that the data on the output is put into a " "clean state that allows appending of new fresh data without having to rescan " "the whole stream to recover state." msgstr "" -#: ../../library/codecs.rst:759 +#: ../../library/codecs.rst:762 msgid "" "In addition to the above methods, the :class:`StreamWriter` must also " "inherit all other methods and attributes from the underlying stream." msgstr "" -#: ../../library/codecs.rst:766 +#: ../../library/codecs.rst:769 msgid "StreamReader Objects" msgstr "StreamReader 物件" -#: ../../library/codecs.rst:768 +#: ../../library/codecs.rst:771 msgid "" "The :class:`StreamReader` class is a subclass of :class:`Codec` and defines " "the following methods which every stream reader must define in order to be " "compatible with the Python codec registry." msgstr "" -#: ../../library/codecs.rst:775 +#: ../../library/codecs.rst:778 msgid "Constructor for a :class:`StreamReader` instance." msgstr "" -#: ../../library/codecs.rst:777 +#: ../../library/codecs.rst:780 msgid "" "All stream readers must provide this constructor interface. They are free to " "add additional keyword arguments, but only the ones defined here are used by " "the Python codec registry." msgstr "" -#: ../../library/codecs.rst:781 +#: ../../library/codecs.rst:784 msgid "" "The *stream* argument must be a file-like object open for reading text or " "binary data, as appropriate for the specific codec." msgstr "" -#: ../../library/codecs.rst:784 +#: ../../library/codecs.rst:787 msgid "" "The :class:`StreamReader` may implement different error handling schemes by " "providing the *errors* keyword argument. See :ref:`error-handlers` for the " "standard error handlers the underlying stream codec may support." msgstr "" -#: ../../library/codecs.rst:788 +#: ../../library/codecs.rst:791 msgid "" "The *errors* argument will be assigned to an attribute of the same name. " "Assigning to this attribute makes it possible to switch between different " @@ -979,24 +979,24 @@ msgid "" "object." msgstr "" -#: ../../library/codecs.rst:792 +#: ../../library/codecs.rst:795 msgid "" "The set of allowed values for the *errors* argument can be extended with :" "func:`register_error`." msgstr "" -#: ../../library/codecs.rst:798 +#: ../../library/codecs.rst:801 msgid "Decodes data from the stream and returns the resulting object." msgstr "" -#: ../../library/codecs.rst:800 +#: ../../library/codecs.rst:803 msgid "" "The *chars* argument indicates the number of decoded code points or bytes to " "return. The :func:`read` method will never return more data than requested, " "but it might return less, if there is not enough available." msgstr "" -#: ../../library/codecs.rst:805 +#: ../../library/codecs.rst:808 msgid "" "The *size* argument indicates the approximate maximum number of encoded " "bytes or code points to read for decoding. The decoder can modify this " @@ -1005,13 +1005,13 @@ msgid "" "huge files in one step." msgstr "" -#: ../../library/codecs.rst:812 +#: ../../library/codecs.rst:815 msgid "" "The *firstline* flag indicates that it would be sufficient to only return " "the first line, if there are decoding errors on later lines." msgstr "" -#: ../../library/codecs.rst:816 +#: ../../library/codecs.rst:819 msgid "" "The method should use a greedy read strategy meaning that it should read as " "much data as is allowed within the definition of the encoding and the given " @@ -1019,68 +1019,68 @@ msgid "" "the stream, these should be read too." msgstr "" -#: ../../library/codecs.rst:824 +#: ../../library/codecs.rst:827 msgid "Read one line from the input stream and return the decoded data." msgstr "" -#: ../../library/codecs.rst:826 +#: ../../library/codecs.rst:829 msgid "" "*size*, if given, is passed as size argument to the stream's :meth:`read` " "method." msgstr "" -#: ../../library/codecs.rst:829 +#: ../../library/codecs.rst:832 msgid "" "If *keepends* is false line-endings will be stripped from the lines returned." msgstr "" -#: ../../library/codecs.rst:835 +#: ../../library/codecs.rst:838 msgid "" "Read all lines available on the input stream and return them as a list of " "lines." msgstr "" -#: ../../library/codecs.rst:838 +#: ../../library/codecs.rst:841 msgid "" "Line-endings are implemented using the codec's :meth:`decode` method and are " "included in the list entries if *keepends* is true." msgstr "" -#: ../../library/codecs.rst:841 +#: ../../library/codecs.rst:844 msgid "" "*sizehint*, if given, is passed as the *size* argument to the stream's :meth:" "`read` method." msgstr "" -#: ../../library/codecs.rst:849 +#: ../../library/codecs.rst:852 msgid "" "Note that no stream repositioning should take place. This method is " "primarily intended to be able to recover from decoding errors." msgstr "" -#: ../../library/codecs.rst:853 +#: ../../library/codecs.rst:856 msgid "" "In addition to the above methods, the :class:`StreamReader` must also " "inherit all other methods and attributes from the underlying stream." msgstr "" -#: ../../library/codecs.rst:859 +#: ../../library/codecs.rst:862 msgid "StreamReaderWriter Objects" msgstr "StreamReaderWriter 物件" -#: ../../library/codecs.rst:861 +#: ../../library/codecs.rst:864 msgid "" "The :class:`StreamReaderWriter` is a convenience class that allows wrapping " "streams which work in both read and write modes." msgstr "" -#: ../../library/codecs.rst:864 ../../library/codecs.rst:888 +#: ../../library/codecs.rst:867 ../../library/codecs.rst:891 msgid "" "The design is such that one can use the factory functions returned by the :" "func:`lookup` function to construct the instance." msgstr "" -#: ../../library/codecs.rst:870 +#: ../../library/codecs.rst:873 msgid "" "Creates a :class:`StreamReaderWriter` instance. *stream* must be a file-like " "object. *Reader* and *Writer* must be factory functions or classes providing " @@ -1089,24 +1089,24 @@ msgid "" "writers." msgstr "" -#: ../../library/codecs.rst:875 +#: ../../library/codecs.rst:878 msgid "" ":class:`StreamReaderWriter` instances define the combined interfaces of :" "class:`StreamReader` and :class:`StreamWriter` classes. They inherit all " "other methods and attributes from the underlying stream." msgstr "" -#: ../../library/codecs.rst:883 +#: ../../library/codecs.rst:886 msgid "StreamRecoder Objects" msgstr "StreamRecoder 物件" -#: ../../library/codecs.rst:885 +#: ../../library/codecs.rst:888 msgid "" "The :class:`StreamRecoder` translates data from one encoding to another, " "which is sometimes useful when dealing with different encoding environments." msgstr "" -#: ../../library/codecs.rst:894 +#: ../../library/codecs.rst:897 msgid "" "Creates a :class:`StreamRecoder` instance which implements a two-way " "conversion: *encode* and *decode* work on the frontend — the data visible to " @@ -1114,17 +1114,17 @@ msgid "" "work on the backend — the data in *stream*." msgstr "" -#: ../../library/codecs.rst:899 +#: ../../library/codecs.rst:902 msgid "" "You can use these objects to do transparent transcodings, e.g., from Latin-1 " "to UTF-8 and back." msgstr "" -#: ../../library/codecs.rst:902 +#: ../../library/codecs.rst:905 msgid "The *stream* argument must be a file-like object." msgstr "" -#: ../../library/codecs.rst:904 +#: ../../library/codecs.rst:907 msgid "" "The *encode* and *decode* arguments must adhere to the :class:`Codec` " "interface. *Reader* and *Writer* must be factory functions or classes " @@ -1132,24 +1132,24 @@ msgid "" "interface respectively." msgstr "" -#: ../../library/codecs.rst:909 +#: ../../library/codecs.rst:912 msgid "" "Error handling is done in the same way as defined for the stream readers and " "writers." msgstr "" -#: ../../library/codecs.rst:913 +#: ../../library/codecs.rst:916 msgid "" ":class:`StreamRecoder` instances define the combined interfaces of :class:" "`StreamReader` and :class:`StreamWriter` classes. They inherit all other " "methods and attributes from the underlying stream." msgstr "" -#: ../../library/codecs.rst:921 +#: ../../library/codecs.rst:924 msgid "Encodings and Unicode" msgstr "" -#: ../../library/codecs.rst:923 +#: ../../library/codecs.rst:926 msgid "" "Strings are stored internally as sequences of code points in range " "``U+0000``--``U+10FFFF``. (See :pep:`393` for more details about the " @@ -1161,7 +1161,7 @@ msgid "" "which are collectivity referred to as :term:`text encodings `." msgstr "" -#: ../../library/codecs.rst:933 +#: ../../library/codecs.rst:936 msgid "" "The simplest text encoding (called ``'latin-1'`` or ``'iso-8859-1'``) maps " "the code points 0--255 to the bytes ``0x0``--``0xff``, which means that a " @@ -1172,7 +1172,7 @@ msgid "" "position 3: ordinal not in range(256)``." msgstr "" -#: ../../library/codecs.rst:941 +#: ../../library/codecs.rst:944 msgid "" "There's another group of encodings (the so called charmap encodings) that " "choose a different subset of all Unicode code points and how these code " @@ -1182,7 +1182,7 @@ msgid "" "that shows you which character is mapped to which byte value." msgstr "" -#: ../../library/codecs.rst:948 +#: ../../library/codecs.rst:951 msgid "" "All of these encodings can only encode 256 of the 1114112 code points " "defined in Unicode. A simple and straightforward way that can store each " @@ -1212,7 +1212,7 @@ msgid "" "normal character that will be decoded like any other." msgstr "" -#: ../../library/codecs.rst:974 +#: ../../library/codecs.rst:977 msgid "" "There's another encoding that is able to encode the full range of Unicode " "characters: UTF-8. UTF-8 is an 8-bit encoding, which means there are no " @@ -1223,59 +1223,59 @@ msgid "" "which when concatenated give the Unicode character):" msgstr "" -#: ../../library/codecs.rst:983 +#: ../../library/codecs.rst:986 msgid "Range" msgstr "" -#: ../../library/codecs.rst:983 +#: ../../library/codecs.rst:986 msgid "Encoding" msgstr "" -#: ../../library/codecs.rst:985 +#: ../../library/codecs.rst:988 msgid "``U-00000000`` ... ``U-0000007F``" msgstr "``U-00000000`` ... ``U-0000007F``" -#: ../../library/codecs.rst:985 +#: ../../library/codecs.rst:988 msgid "0xxxxxxx" msgstr "0xxxxxxx" -#: ../../library/codecs.rst:987 +#: ../../library/codecs.rst:990 msgid "``U-00000080`` ... ``U-000007FF``" msgstr "``U-00000080`` ... ``U-000007FF``" -#: ../../library/codecs.rst:987 +#: ../../library/codecs.rst:990 msgid "110xxxxx 10xxxxxx" msgstr "110xxxxx 10xxxxxx" -#: ../../library/codecs.rst:989 +#: ../../library/codecs.rst:992 msgid "``U-00000800`` ... ``U-0000FFFF``" msgstr "``U-00000800`` ... ``U-0000FFFF``" -#: ../../library/codecs.rst:989 +#: ../../library/codecs.rst:992 msgid "1110xxxx 10xxxxxx 10xxxxxx" msgstr "1110xxxx 10xxxxxx 10xxxxxx" -#: ../../library/codecs.rst:991 +#: ../../library/codecs.rst:994 msgid "``U-00010000`` ... ``U-0010FFFF``" msgstr "``U-00010000`` ... ``U-0010FFFF``" -#: ../../library/codecs.rst:991 +#: ../../library/codecs.rst:994 msgid "11110xxx 10xxxxxx 10xxxxxx 10xxxxxx" msgstr "11110xxx 10xxxxxx 10xxxxxx 10xxxxxx" -#: ../../library/codecs.rst:994 +#: ../../library/codecs.rst:997 msgid "" "The least significant bit of the Unicode character is the rightmost x bit." msgstr "" -#: ../../library/codecs.rst:996 +#: ../../library/codecs.rst:999 msgid "" "As UTF-8 is an 8-bit encoding no BOM is required and any ``U+FEFF`` " "character in the decoded string (even if it's the first character) is " "treated as a ``ZERO WIDTH NO-BREAK SPACE``." msgstr "" -#: ../../library/codecs.rst:1000 +#: ../../library/codecs.rst:1003 msgid "" "Without external information it's impossible to reliably determine which " "encoding was used for encoding a string. Each charmap encoding can decode " @@ -1301,7 +1301,7 @@ msgstr "" msgid "INVERTED QUESTION MARK" msgstr "" -#: ../../library/codecs.rst:1016 +#: ../../library/codecs.rst:1019 msgid "" "in iso-8859-1), this increases the probability that a ``utf-8-sig`` encoding " "can be correctly guessed from the byte sequence. So here the BOM is not used " @@ -1313,11 +1313,11 @@ msgid "" "the use of the BOM is discouraged and should generally be avoided." msgstr "" -#: ../../library/codecs.rst:1029 +#: ../../library/codecs.rst:1032 msgid "Standard Encodings" msgstr "" -#: ../../library/codecs.rst:1031 +#: ../../library/codecs.rst:1034 msgid "" "Python comes with a number of codecs built-in, either implemented as C " "functions or with dictionaries as mapping tables. The following table lists " @@ -1329,7 +1329,7 @@ msgid "" "alias for the ``'utf_8'`` codec." msgstr "" -#: ../../library/codecs.rst:1041 +#: ../../library/codecs.rst:1044 msgid "" "Some common encodings can bypass the codecs lookup machinery to improve " "performance. These optimization opportunities are only recognized by CPython " @@ -1339,11 +1339,11 @@ msgid "" "Using alternative aliases for these encodings may result in slower execution." msgstr "" -#: ../../library/codecs.rst:1049 +#: ../../library/codecs.rst:1052 msgid "Optimization opportunity recognized for us-ascii." msgstr "" -#: ../../library/codecs.rst:1052 +#: ../../library/codecs.rst:1055 msgid "" "Many of the character sets support the same languages. They vary in " "individual characters (e.g. whether the EURO SIGN is supported or not), and " @@ -1351,504 +1351,504 @@ msgid "" "languages in particular, the following variants typically exist:" msgstr "" -#: ../../library/codecs.rst:1057 +#: ../../library/codecs.rst:1060 msgid "an ISO 8859 codeset" msgstr "" -#: ../../library/codecs.rst:1059 +#: ../../library/codecs.rst:1062 msgid "" "a Microsoft Windows code page, which is typically derived from an 8859 " "codeset, but replaces control characters with additional graphic characters" msgstr "" -#: ../../library/codecs.rst:1062 +#: ../../library/codecs.rst:1065 msgid "an IBM EBCDIC code page" msgstr "" -#: ../../library/codecs.rst:1064 +#: ../../library/codecs.rst:1067 msgid "an IBM PC code page, which is ASCII compatible" msgstr "" -#: ../../library/codecs.rst:1069 ../../library/codecs.rst:1324 -#: ../../library/codecs.rst:1391 ../../library/codecs.rst:1446 +#: ../../library/codecs.rst:1072 ../../library/codecs.rst:1327 +#: ../../library/codecs.rst:1395 ../../library/codecs.rst:1450 msgid "Codec" msgstr "" -#: ../../library/codecs.rst:1069 ../../library/codecs.rst:1324 -#: ../../library/codecs.rst:1391 ../../library/codecs.rst:1446 +#: ../../library/codecs.rst:1072 ../../library/codecs.rst:1327 +#: ../../library/codecs.rst:1395 ../../library/codecs.rst:1450 msgid "Aliases" msgstr "" -#: ../../library/codecs.rst:1069 +#: ../../library/codecs.rst:1072 msgid "Languages" msgstr "語言" -#: ../../library/codecs.rst:1071 +#: ../../library/codecs.rst:1074 msgid "ascii" msgstr "ascii" -#: ../../library/codecs.rst:1071 +#: ../../library/codecs.rst:1074 msgid "646, us-ascii" msgstr "646, us-ascii" -#: ../../library/codecs.rst:1071 ../../library/codecs.rst:1077 -#: ../../library/codecs.rst:1085 +#: ../../library/codecs.rst:1074 ../../library/codecs.rst:1080 +#: ../../library/codecs.rst:1088 msgid "English" msgstr "英文" -#: ../../library/codecs.rst:1073 +#: ../../library/codecs.rst:1076 msgid "big5" msgstr "big5" -#: ../../library/codecs.rst:1073 +#: ../../library/codecs.rst:1076 msgid "big5-tw, csbig5" msgstr "big5-tw, csbig5" -#: ../../library/codecs.rst:1073 ../../library/codecs.rst:1075 -#: ../../library/codecs.rst:1133 +#: ../../library/codecs.rst:1076 ../../library/codecs.rst:1078 +#: ../../library/codecs.rst:1136 msgid "Traditional Chinese" msgstr "繁體中文" -#: ../../library/codecs.rst:1075 +#: ../../library/codecs.rst:1078 msgid "big5hkscs" msgstr "big5hkscs" -#: ../../library/codecs.rst:1075 +#: ../../library/codecs.rst:1078 msgid "big5-hkscs, hkscs" msgstr "big5-hkscs, hkscs" -#: ../../library/codecs.rst:1077 +#: ../../library/codecs.rst:1080 msgid "cp037" msgstr "cp037" -#: ../../library/codecs.rst:1077 +#: ../../library/codecs.rst:1080 msgid "IBM037, IBM039" msgstr "IBM037, IBM039" -#: ../../library/codecs.rst:1079 +#: ../../library/codecs.rst:1082 msgid "cp273" msgstr "cp273" -#: ../../library/codecs.rst:1079 +#: ../../library/codecs.rst:1082 msgid "273, IBM273, csIBM273" msgstr "273, IBM273, csIBM273" -#: ../../library/codecs.rst:1079 +#: ../../library/codecs.rst:1082 msgid "German" msgstr "德文" -#: ../../library/codecs.rst:1083 +#: ../../library/codecs.rst:1086 msgid "cp424" msgstr "cp424" -#: ../../library/codecs.rst:1083 +#: ../../library/codecs.rst:1086 msgid "EBCDIC-CP-HE, IBM424" msgstr "EBCDIC-CP-HE, IBM424" -#: ../../library/codecs.rst:1083 ../../library/codecs.rst:1103 -#: ../../library/codecs.rst:1113 ../../library/codecs.rst:1156 -#: ../../library/codecs.rst:1219 +#: ../../library/codecs.rst:1086 ../../library/codecs.rst:1106 +#: ../../library/codecs.rst:1116 ../../library/codecs.rst:1159 +#: ../../library/codecs.rst:1222 msgid "Hebrew" msgstr "希伯來文" -#: ../../library/codecs.rst:1085 +#: ../../library/codecs.rst:1088 msgid "cp437" msgstr "cp437" -#: ../../library/codecs.rst:1085 +#: ../../library/codecs.rst:1088 msgid "437, IBM437" msgstr "437, IBM437" -#: ../../library/codecs.rst:1087 +#: ../../library/codecs.rst:1090 msgid "cp500" msgstr "cp500" -#: ../../library/codecs.rst:1087 +#: ../../library/codecs.rst:1090 msgid "EBCDIC-CP-BE, EBCDIC-CP-CH, IBM500" msgstr "EBCDIC-CP-BE, EBCDIC-CP-CH, IBM500" -#: ../../library/codecs.rst:1087 ../../library/codecs.rst:1096 -#: ../../library/codecs.rst:1107 ../../library/codecs.rst:1143 -#: ../../library/codecs.rst:1150 ../../library/codecs.rst:1203 -#: ../../library/codecs.rst:1231 ../../library/codecs.rst:1259 +#: ../../library/codecs.rst:1090 ../../library/codecs.rst:1099 +#: ../../library/codecs.rst:1110 ../../library/codecs.rst:1146 +#: ../../library/codecs.rst:1153 ../../library/codecs.rst:1206 +#: ../../library/codecs.rst:1234 ../../library/codecs.rst:1262 msgid "Western Europe" msgstr "" -#: ../../library/codecs.rst:1090 +#: ../../library/codecs.rst:1093 msgid "cp720" msgstr "cp720" -#: ../../library/codecs.rst:1090 ../../library/codecs.rst:1117 -#: ../../library/codecs.rst:1158 ../../library/codecs.rst:1215 +#: ../../library/codecs.rst:1093 ../../library/codecs.rst:1120 +#: ../../library/codecs.rst:1161 ../../library/codecs.rst:1218 msgid "Arabic" msgstr "阿拉伯文" -#: ../../library/codecs.rst:1092 +#: ../../library/codecs.rst:1095 msgid "cp737" msgstr "cp737" -#: ../../library/codecs.rst:1092 ../../library/codecs.rst:1123 -#: ../../library/codecs.rst:1127 ../../library/codecs.rst:1152 -#: ../../library/codecs.rst:1217 ../../library/codecs.rst:1252 +#: ../../library/codecs.rst:1095 ../../library/codecs.rst:1126 +#: ../../library/codecs.rst:1130 ../../library/codecs.rst:1155 +#: ../../library/codecs.rst:1220 ../../library/codecs.rst:1255 msgid "Greek" msgstr "希臘文" -#: ../../library/codecs.rst:1094 +#: ../../library/codecs.rst:1097 msgid "cp775" msgstr "cp775" -#: ../../library/codecs.rst:1094 +#: ../../library/codecs.rst:1097 msgid "IBM775" msgstr "IBM775" -#: ../../library/codecs.rst:1094 ../../library/codecs.rst:1160 -#: ../../library/codecs.rst:1210 ../../library/codecs.rst:1227 +#: ../../library/codecs.rst:1097 ../../library/codecs.rst:1163 +#: ../../library/codecs.rst:1213 ../../library/codecs.rst:1230 msgid "Baltic languages" msgstr "" -#: ../../library/codecs.rst:1096 +#: ../../library/codecs.rst:1099 msgid "cp850" msgstr "cp850" -#: ../../library/codecs.rst:1096 +#: ../../library/codecs.rst:1099 msgid "850, IBM850" msgstr "850, IBM850" -#: ../../library/codecs.rst:1098 +#: ../../library/codecs.rst:1101 msgid "cp852" msgstr "cp852" -#: ../../library/codecs.rst:1098 +#: ../../library/codecs.rst:1101 msgid "852, IBM852" msgstr "852, IBM852" -#: ../../library/codecs.rst:1098 ../../library/codecs.rst:1145 -#: ../../library/codecs.rst:1206 ../../library/codecs.rst:1256 +#: ../../library/codecs.rst:1101 ../../library/codecs.rst:1148 +#: ../../library/codecs.rst:1209 ../../library/codecs.rst:1259 msgid "Central and Eastern Europe" msgstr "" -#: ../../library/codecs.rst:1100 +#: ../../library/codecs.rst:1103 msgid "cp855" msgstr "cp855" -#: ../../library/codecs.rst:1100 +#: ../../library/codecs.rst:1103 msgid "855, IBM855" msgstr "855, IBM855" -#: ../../library/codecs.rst:1100 ../../library/codecs.rst:1147 -#: ../../library/codecs.rst:1212 ../../library/codecs.rst:1249 +#: ../../library/codecs.rst:1103 ../../library/codecs.rst:1150 +#: ../../library/codecs.rst:1215 ../../library/codecs.rst:1252 msgid "Bulgarian, Byelorussian, Macedonian, Russian, Serbian" msgstr "" -#: ../../library/codecs.rst:1103 +#: ../../library/codecs.rst:1106 msgid "cp856" msgstr "cp856" -#: ../../library/codecs.rst:1105 +#: ../../library/codecs.rst:1108 msgid "cp857" msgstr "cp857" -#: ../../library/codecs.rst:1105 +#: ../../library/codecs.rst:1108 msgid "857, IBM857" msgstr "857, IBM857" -#: ../../library/codecs.rst:1105 ../../library/codecs.rst:1137 -#: ../../library/codecs.rst:1154 ../../library/codecs.rst:1221 -#: ../../library/codecs.rst:1261 +#: ../../library/codecs.rst:1108 ../../library/codecs.rst:1140 +#: ../../library/codecs.rst:1157 ../../library/codecs.rst:1224 +#: ../../library/codecs.rst:1264 msgid "Turkish" msgstr "土耳其文" -#: ../../library/codecs.rst:1107 +#: ../../library/codecs.rst:1110 msgid "cp858" msgstr "cp858" -#: ../../library/codecs.rst:1107 +#: ../../library/codecs.rst:1110 msgid "858, IBM858" msgstr "858, IBM858" -#: ../../library/codecs.rst:1109 +#: ../../library/codecs.rst:1112 msgid "cp860" msgstr "cp860" -#: ../../library/codecs.rst:1109 +#: ../../library/codecs.rst:1112 msgid "860, IBM860" msgstr "860, IBM860" -#: ../../library/codecs.rst:1109 +#: ../../library/codecs.rst:1112 msgid "Portuguese" msgstr "" -#: ../../library/codecs.rst:1111 +#: ../../library/codecs.rst:1114 msgid "cp861" msgstr "cp861" -#: ../../library/codecs.rst:1111 +#: ../../library/codecs.rst:1114 msgid "861, CP-IS, IBM861" msgstr "861, CP-IS, IBM861" -#: ../../library/codecs.rst:1111 ../../library/codecs.rst:1254 +#: ../../library/codecs.rst:1114 ../../library/codecs.rst:1257 msgid "Icelandic" msgstr "" -#: ../../library/codecs.rst:1113 +#: ../../library/codecs.rst:1116 msgid "cp862" msgstr "cp862" -#: ../../library/codecs.rst:1113 +#: ../../library/codecs.rst:1116 msgid "862, IBM862" msgstr "862, IBM862" -#: ../../library/codecs.rst:1115 +#: ../../library/codecs.rst:1118 msgid "cp863" msgstr "cp863" -#: ../../library/codecs.rst:1115 +#: ../../library/codecs.rst:1118 msgid "863, IBM863" msgstr "863, IBM863" -#: ../../library/codecs.rst:1115 +#: ../../library/codecs.rst:1118 msgid "Canadian" msgstr "" -#: ../../library/codecs.rst:1117 +#: ../../library/codecs.rst:1120 msgid "cp864" msgstr "cp864" -#: ../../library/codecs.rst:1117 +#: ../../library/codecs.rst:1120 msgid "IBM864" msgstr "IBM864" -#: ../../library/codecs.rst:1119 +#: ../../library/codecs.rst:1122 msgid "cp865" msgstr "cp865" -#: ../../library/codecs.rst:1119 +#: ../../library/codecs.rst:1122 msgid "865, IBM865" msgstr "865, IBM865" -#: ../../library/codecs.rst:1119 +#: ../../library/codecs.rst:1122 msgid "Danish, Norwegian" msgstr "" -#: ../../library/codecs.rst:1121 +#: ../../library/codecs.rst:1124 msgid "cp866" msgstr "cp866" -#: ../../library/codecs.rst:1121 +#: ../../library/codecs.rst:1124 msgid "866, IBM866" msgstr "866, IBM866" -#: ../../library/codecs.rst:1121 ../../library/codecs.rst:1237 +#: ../../library/codecs.rst:1124 ../../library/codecs.rst:1240 msgid "Russian" msgstr "俄羅斯文" -#: ../../library/codecs.rst:1123 +#: ../../library/codecs.rst:1126 msgid "cp869" msgstr "cp869" -#: ../../library/codecs.rst:1123 +#: ../../library/codecs.rst:1126 msgid "869, CP-GR, IBM869" msgstr "869, CP-GR, IBM869" -#: ../../library/codecs.rst:1125 +#: ../../library/codecs.rst:1128 msgid "cp874" msgstr "cp874" -#: ../../library/codecs.rst:1125 +#: ../../library/codecs.rst:1128 msgid "Thai" msgstr "泰文" -#: ../../library/codecs.rst:1127 +#: ../../library/codecs.rst:1130 msgid "cp875" msgstr "cp875" -#: ../../library/codecs.rst:1129 +#: ../../library/codecs.rst:1132 msgid "cp932" msgstr "cp932" -#: ../../library/codecs.rst:1129 +#: ../../library/codecs.rst:1132 msgid "932, ms932, mskanji, ms-kanji" msgstr "932, ms932, mskanji, ms-kanji" -#: ../../library/codecs.rst:1129 ../../library/codecs.rst:1164 -#: ../../library/codecs.rst:1166 ../../library/codecs.rst:1168 -#: ../../library/codecs.rst:1185 ../../library/codecs.rst:1188 -#: ../../library/codecs.rst:1193 ../../library/codecs.rst:1196 -#: ../../library/codecs.rst:1198 ../../library/codecs.rst:1266 -#: ../../library/codecs.rst:1269 ../../library/codecs.rst:1272 +#: ../../library/codecs.rst:1132 ../../library/codecs.rst:1167 +#: ../../library/codecs.rst:1169 ../../library/codecs.rst:1171 +#: ../../library/codecs.rst:1188 ../../library/codecs.rst:1191 +#: ../../library/codecs.rst:1196 ../../library/codecs.rst:1199 +#: ../../library/codecs.rst:1201 ../../library/codecs.rst:1269 +#: ../../library/codecs.rst:1272 ../../library/codecs.rst:1275 msgid "Japanese" msgstr "日文" -#: ../../library/codecs.rst:1131 +#: ../../library/codecs.rst:1134 msgid "cp949" msgstr "cp949" -#: ../../library/codecs.rst:1131 +#: ../../library/codecs.rst:1134 msgid "949, ms949, uhc" msgstr "949, ms949, uhc" -#: ../../library/codecs.rst:1131 ../../library/codecs.rst:1170 -#: ../../library/codecs.rst:1200 ../../library/codecs.rst:1235 +#: ../../library/codecs.rst:1134 ../../library/codecs.rst:1173 +#: ../../library/codecs.rst:1203 ../../library/codecs.rst:1238 msgid "Korean" msgstr "韓文" -#: ../../library/codecs.rst:1133 +#: ../../library/codecs.rst:1136 msgid "cp950" msgstr "cp950" -#: ../../library/codecs.rst:1133 +#: ../../library/codecs.rst:1136 msgid "950, ms950" msgstr "950, ms950" -#: ../../library/codecs.rst:1135 +#: ../../library/codecs.rst:1138 msgid "cp1006" msgstr "cp1006" -#: ../../library/codecs.rst:1135 +#: ../../library/codecs.rst:1138 msgid "Urdu" msgstr "" -#: ../../library/codecs.rst:1137 +#: ../../library/codecs.rst:1140 msgid "cp1026" msgstr "cp1026" -#: ../../library/codecs.rst:1137 +#: ../../library/codecs.rst:1140 msgid "ibm1026" msgstr "ibm1026" -#: ../../library/codecs.rst:1139 +#: ../../library/codecs.rst:1142 msgid "cp1125" msgstr "cp1125" -#: ../../library/codecs.rst:1139 +#: ../../library/codecs.rst:1142 msgid "1125, ibm1125, cp866u, ruscii" msgstr "1125, ibm1125, cp866u, ruscii" -#: ../../library/codecs.rst:1139 ../../library/codecs.rst:1243 +#: ../../library/codecs.rst:1142 ../../library/codecs.rst:1246 msgid "Ukrainian" msgstr "烏克蘭文" -#: ../../library/codecs.rst:1143 +#: ../../library/codecs.rst:1146 msgid "cp1140" msgstr "cp1140" -#: ../../library/codecs.rst:1143 +#: ../../library/codecs.rst:1146 msgid "ibm1140" msgstr "ibm1140" -#: ../../library/codecs.rst:1145 +#: ../../library/codecs.rst:1148 msgid "cp1250" msgstr "cp1250" -#: ../../library/codecs.rst:1145 +#: ../../library/codecs.rst:1148 msgid "windows-1250" msgstr "windows-1250" -#: ../../library/codecs.rst:1147 +#: ../../library/codecs.rst:1150 msgid "cp1251" msgstr "cp1251" -#: ../../library/codecs.rst:1147 +#: ../../library/codecs.rst:1150 msgid "windows-1251" msgstr "windows-1251" -#: ../../library/codecs.rst:1150 +#: ../../library/codecs.rst:1153 msgid "cp1252" msgstr "cp1252" -#: ../../library/codecs.rst:1150 +#: ../../library/codecs.rst:1153 msgid "windows-1252" msgstr "windows-1252" -#: ../../library/codecs.rst:1152 +#: ../../library/codecs.rst:1155 msgid "cp1253" msgstr "cp1253" -#: ../../library/codecs.rst:1152 +#: ../../library/codecs.rst:1155 msgid "windows-1253" msgstr "windows-1253" -#: ../../library/codecs.rst:1154 +#: ../../library/codecs.rst:1157 msgid "cp1254" msgstr "cp1254" -#: ../../library/codecs.rst:1154 +#: ../../library/codecs.rst:1157 msgid "windows-1254" msgstr "windows-1254" -#: ../../library/codecs.rst:1156 +#: ../../library/codecs.rst:1159 msgid "cp1255" msgstr "cp1255" -#: ../../library/codecs.rst:1156 +#: ../../library/codecs.rst:1159 msgid "windows-1255" msgstr "windows-1255" -#: ../../library/codecs.rst:1158 +#: ../../library/codecs.rst:1161 msgid "cp1256" msgstr "cp1256" -#: ../../library/codecs.rst:1158 +#: ../../library/codecs.rst:1161 msgid "windows-1256" msgstr "windows-1256" -#: ../../library/codecs.rst:1160 +#: ../../library/codecs.rst:1163 msgid "cp1257" msgstr "cp1257" -#: ../../library/codecs.rst:1160 +#: ../../library/codecs.rst:1163 msgid "windows-1257" msgstr "windows-1257" -#: ../../library/codecs.rst:1162 +#: ../../library/codecs.rst:1165 msgid "cp1258" msgstr "cp1258" -#: ../../library/codecs.rst:1162 +#: ../../library/codecs.rst:1165 msgid "windows-1258" msgstr "windows-1258" -#: ../../library/codecs.rst:1162 +#: ../../library/codecs.rst:1165 msgid "Vietnamese" msgstr "越南文" -#: ../../library/codecs.rst:1164 +#: ../../library/codecs.rst:1167 msgid "euc_jp" msgstr "euc_jp" -#: ../../library/codecs.rst:1164 +#: ../../library/codecs.rst:1167 msgid "eucjp, ujis, u-jis" msgstr "eucjp, ujis, u-jis" -#: ../../library/codecs.rst:1166 +#: ../../library/codecs.rst:1169 msgid "euc_jis_2004" msgstr "euc_jis_2004" -#: ../../library/codecs.rst:1166 +#: ../../library/codecs.rst:1169 msgid "jisx0213, eucjis2004" msgstr "jisx0213, eucjis2004" -#: ../../library/codecs.rst:1168 +#: ../../library/codecs.rst:1171 msgid "euc_jisx0213" msgstr "euc_jisx0213" -#: ../../library/codecs.rst:1168 +#: ../../library/codecs.rst:1171 msgid "eucjisx0213" msgstr "eucjisx0213" -#: ../../library/codecs.rst:1170 +#: ../../library/codecs.rst:1173 msgid "euc_kr" msgstr "euc_kr" -#: ../../library/codecs.rst:1170 +#: ../../library/codecs.rst:1173 msgid "euckr, korean, ksc5601, ks_c-5601, ks_c-5601-1987, ksx1001, ks_x-1001" msgstr "euckr, korean, ksc5601, ks_c-5601, ks_c-5601-1987, ksx1001, ks_x-1001" -#: ../../library/codecs.rst:1174 +#: ../../library/codecs.rst:1177 msgid "gb2312" msgstr "gb2312" -#: ../../library/codecs.rst:1174 +#: ../../library/codecs.rst:1177 msgid "" "chinese, csiso58gb231280, euc-cn, euccn, eucgb2312-cn, gb2312-1980, " "gb2312-80, iso-ir-58" @@ -1856,446 +1856,446 @@ msgstr "" "chinese, csiso58gb231280, euc-cn, euccn, eucgb2312-cn, gb2312-1980, " "gb2312-80, iso-ir-58" -#: ../../library/codecs.rst:1174 ../../library/codecs.rst:1183 +#: ../../library/codecs.rst:1177 ../../library/codecs.rst:1186 msgid "Simplified Chinese" msgstr "簡體中文" -#: ../../library/codecs.rst:1179 +#: ../../library/codecs.rst:1182 msgid "gbk" msgstr "gbk" -#: ../../library/codecs.rst:1179 +#: ../../library/codecs.rst:1182 msgid "936, cp936, ms936" msgstr "936, cp936, ms936" -#: ../../library/codecs.rst:1179 ../../library/codecs.rst:1181 +#: ../../library/codecs.rst:1182 ../../library/codecs.rst:1184 msgid "Unified Chinese" msgstr "" -#: ../../library/codecs.rst:1181 +#: ../../library/codecs.rst:1184 msgid "gb18030" msgstr "gb18030" -#: ../../library/codecs.rst:1181 +#: ../../library/codecs.rst:1184 msgid "gb18030-2000" msgstr "gb18030-2000" -#: ../../library/codecs.rst:1183 +#: ../../library/codecs.rst:1186 msgid "hz" msgstr "" -#: ../../library/codecs.rst:1183 +#: ../../library/codecs.rst:1186 msgid "hzgb, hz-gb, hz-gb-2312" msgstr "hzgb, hz-gb, hz-gb-2312" -#: ../../library/codecs.rst:1185 +#: ../../library/codecs.rst:1188 msgid "iso2022_jp" msgstr "iso2022_jp" -#: ../../library/codecs.rst:1185 +#: ../../library/codecs.rst:1188 msgid "csiso2022jp, iso2022jp, iso-2022-jp" msgstr "csiso2022jp, iso2022jp, iso-2022-jp" -#: ../../library/codecs.rst:1188 +#: ../../library/codecs.rst:1191 msgid "iso2022_jp_1" msgstr "iso2022_jp_1" -#: ../../library/codecs.rst:1188 +#: ../../library/codecs.rst:1191 msgid "iso2022jp-1, iso-2022-jp-1" msgstr "iso2022jp-1, iso-2022-jp-1" -#: ../../library/codecs.rst:1190 +#: ../../library/codecs.rst:1193 msgid "iso2022_jp_2" msgstr "iso2022_jp_2" -#: ../../library/codecs.rst:1190 +#: ../../library/codecs.rst:1193 msgid "iso2022jp-2, iso-2022-jp-2" msgstr "iso2022jp-2, iso-2022-jp-2" -#: ../../library/codecs.rst:1190 +#: ../../library/codecs.rst:1193 msgid "Japanese, Korean, Simplified Chinese, Western Europe, Greek" msgstr "" -#: ../../library/codecs.rst:1193 +#: ../../library/codecs.rst:1196 msgid "iso2022_jp_2004" msgstr "iso2022_jp_2004" -#: ../../library/codecs.rst:1193 +#: ../../library/codecs.rst:1196 msgid "iso2022jp-2004, iso-2022-jp-2004" msgstr "iso2022jp-2004, iso-2022-jp-2004" -#: ../../library/codecs.rst:1196 +#: ../../library/codecs.rst:1199 msgid "iso2022_jp_3" msgstr "iso2022_jp_3" -#: ../../library/codecs.rst:1196 +#: ../../library/codecs.rst:1199 msgid "iso2022jp-3, iso-2022-jp-3" msgstr "iso2022jp-3, iso-2022-jp-3" -#: ../../library/codecs.rst:1198 +#: ../../library/codecs.rst:1201 msgid "iso2022_jp_ext" msgstr "iso2022_jp_ext" -#: ../../library/codecs.rst:1198 +#: ../../library/codecs.rst:1201 msgid "iso2022jp-ext, iso-2022-jp-ext" msgstr "iso2022jp-ext, iso-2022-jp-ext" -#: ../../library/codecs.rst:1200 +#: ../../library/codecs.rst:1203 msgid "iso2022_kr" msgstr "iso2022_kr" -#: ../../library/codecs.rst:1200 +#: ../../library/codecs.rst:1203 msgid "csiso2022kr, iso2022kr, iso-2022-kr" msgstr "csiso2022kr, iso2022kr, iso-2022-kr" -#: ../../library/codecs.rst:1203 +#: ../../library/codecs.rst:1206 msgid "latin_1" msgstr "latin_1" -#: ../../library/codecs.rst:1203 +#: ../../library/codecs.rst:1206 msgid "iso-8859-1, iso8859-1, 8859, cp819, latin, latin1, L1" msgstr "iso-8859-1, iso8859-1, 8859, cp819, latin, latin1, L1" -#: ../../library/codecs.rst:1206 +#: ../../library/codecs.rst:1209 msgid "iso8859_2" msgstr "iso8859_2" -#: ../../library/codecs.rst:1206 +#: ../../library/codecs.rst:1209 msgid "iso-8859-2, latin2, L2" msgstr "iso-8859-2, latin2, L2" -#: ../../library/codecs.rst:1208 +#: ../../library/codecs.rst:1211 msgid "iso8859_3" msgstr "iso8859_3" -#: ../../library/codecs.rst:1208 +#: ../../library/codecs.rst:1211 msgid "iso-8859-3, latin3, L3" msgstr "iso-8859-3, latin3, L3" -#: ../../library/codecs.rst:1208 +#: ../../library/codecs.rst:1211 msgid "Esperanto, Maltese" msgstr "" -#: ../../library/codecs.rst:1210 +#: ../../library/codecs.rst:1213 msgid "iso8859_4" msgstr "iso8859_4" -#: ../../library/codecs.rst:1210 +#: ../../library/codecs.rst:1213 msgid "iso-8859-4, latin4, L4" msgstr "iso-8859-4, latin4, L4" -#: ../../library/codecs.rst:1212 +#: ../../library/codecs.rst:1215 msgid "iso8859_5" msgstr "iso8859_5" -#: ../../library/codecs.rst:1212 +#: ../../library/codecs.rst:1215 msgid "iso-8859-5, cyrillic" msgstr "iso-8859-5, cyrillic" -#: ../../library/codecs.rst:1215 +#: ../../library/codecs.rst:1218 msgid "iso8859_6" msgstr "iso8859_6" -#: ../../library/codecs.rst:1215 +#: ../../library/codecs.rst:1218 msgid "iso-8859-6, arabic" msgstr "iso-8859-6, arabic" -#: ../../library/codecs.rst:1217 +#: ../../library/codecs.rst:1220 msgid "iso8859_7" msgstr "iso8859_7" -#: ../../library/codecs.rst:1217 +#: ../../library/codecs.rst:1220 msgid "iso-8859-7, greek, greek8" msgstr "iso-8859-7, greek, greek8" -#: ../../library/codecs.rst:1219 +#: ../../library/codecs.rst:1222 msgid "iso8859_8" msgstr "iso8859_8" -#: ../../library/codecs.rst:1219 +#: ../../library/codecs.rst:1222 msgid "iso-8859-8, hebrew" msgstr "iso-8859-8, hebrew" -#: ../../library/codecs.rst:1221 +#: ../../library/codecs.rst:1224 msgid "iso8859_9" msgstr "iso8859_9" -#: ../../library/codecs.rst:1221 +#: ../../library/codecs.rst:1224 msgid "iso-8859-9, latin5, L5" msgstr "iso-8859-9, latin5, L5" -#: ../../library/codecs.rst:1223 +#: ../../library/codecs.rst:1226 msgid "iso8859_10" msgstr "iso8859_10" -#: ../../library/codecs.rst:1223 +#: ../../library/codecs.rst:1226 msgid "iso-8859-10, latin6, L6" msgstr "iso-8859-10, latin6, L6" -#: ../../library/codecs.rst:1223 +#: ../../library/codecs.rst:1226 msgid "Nordic languages" msgstr "" -#: ../../library/codecs.rst:1225 +#: ../../library/codecs.rst:1228 msgid "iso8859_11" msgstr "iso8859_11" -#: ../../library/codecs.rst:1225 +#: ../../library/codecs.rst:1228 msgid "iso-8859-11, thai" msgstr "iso-8859-11, thai" -#: ../../library/codecs.rst:1225 +#: ../../library/codecs.rst:1228 msgid "Thai languages" msgstr "" -#: ../../library/codecs.rst:1227 +#: ../../library/codecs.rst:1230 msgid "iso8859_13" msgstr "iso8859_13" -#: ../../library/codecs.rst:1227 +#: ../../library/codecs.rst:1230 msgid "iso-8859-13, latin7, L7" msgstr "iso-8859-13, latin7, L7" -#: ../../library/codecs.rst:1229 +#: ../../library/codecs.rst:1232 msgid "iso8859_14" msgstr "iso8859_14" -#: ../../library/codecs.rst:1229 +#: ../../library/codecs.rst:1232 msgid "iso-8859-14, latin8, L8" msgstr "iso-8859-14, latin8, L8" -#: ../../library/codecs.rst:1229 +#: ../../library/codecs.rst:1232 msgid "Celtic languages" msgstr "" -#: ../../library/codecs.rst:1231 +#: ../../library/codecs.rst:1234 msgid "iso8859_15" msgstr "iso8859_15" -#: ../../library/codecs.rst:1231 +#: ../../library/codecs.rst:1234 msgid "iso-8859-15, latin9, L9" msgstr "iso-8859-15, latin9, L9" -#: ../../library/codecs.rst:1233 +#: ../../library/codecs.rst:1236 msgid "iso8859_16" msgstr "iso8859_16" -#: ../../library/codecs.rst:1233 +#: ../../library/codecs.rst:1236 msgid "iso-8859-16, latin10, L10" msgstr "iso-8859-16, latin10, L10" -#: ../../library/codecs.rst:1233 +#: ../../library/codecs.rst:1236 msgid "South-Eastern Europe" msgstr "" -#: ../../library/codecs.rst:1235 +#: ../../library/codecs.rst:1238 msgid "johab" msgstr "" -#: ../../library/codecs.rst:1235 +#: ../../library/codecs.rst:1238 msgid "cp1361, ms1361" msgstr "cp1361, ms1361" -#: ../../library/codecs.rst:1237 +#: ../../library/codecs.rst:1240 msgid "koi8_r" msgstr "koi8_r" -#: ../../library/codecs.rst:1239 +#: ../../library/codecs.rst:1242 msgid "koi8_t" msgstr "koi8_t" -#: ../../library/codecs.rst:1239 +#: ../../library/codecs.rst:1242 msgid "Tajik" msgstr "" -#: ../../library/codecs.rst:1243 +#: ../../library/codecs.rst:1246 msgid "koi8_u" msgstr "koi8_u" -#: ../../library/codecs.rst:1245 +#: ../../library/codecs.rst:1248 msgid "kz1048" msgstr "kz1048" -#: ../../library/codecs.rst:1245 +#: ../../library/codecs.rst:1248 msgid "kz_1048, strk1048_2002, rk1048" msgstr "kz_1048, strk1048_2002, rk1048" -#: ../../library/codecs.rst:1245 ../../library/codecs.rst:1263 +#: ../../library/codecs.rst:1248 ../../library/codecs.rst:1266 msgid "Kazakh" msgstr "" -#: ../../library/codecs.rst:1249 +#: ../../library/codecs.rst:1252 msgid "mac_cyrillic" msgstr "mac_cyrillic" -#: ../../library/codecs.rst:1249 +#: ../../library/codecs.rst:1252 msgid "maccyrillic" msgstr "" -#: ../../library/codecs.rst:1252 +#: ../../library/codecs.rst:1255 msgid "mac_greek" msgstr "mac_greek" -#: ../../library/codecs.rst:1252 +#: ../../library/codecs.rst:1255 msgid "macgreek" msgstr "" -#: ../../library/codecs.rst:1254 +#: ../../library/codecs.rst:1257 msgid "mac_iceland" msgstr "mac_iceland" -#: ../../library/codecs.rst:1254 +#: ../../library/codecs.rst:1257 msgid "maciceland" msgstr "" -#: ../../library/codecs.rst:1256 +#: ../../library/codecs.rst:1259 msgid "mac_latin2" msgstr "mac_latin2" -#: ../../library/codecs.rst:1256 +#: ../../library/codecs.rst:1259 msgid "maclatin2, maccentraleurope, mac_centeuro" msgstr "maclatin2, maccentraleurope, mac_centeuro" -#: ../../library/codecs.rst:1259 +#: ../../library/codecs.rst:1262 msgid "mac_roman" msgstr "mac_roman" -#: ../../library/codecs.rst:1259 +#: ../../library/codecs.rst:1262 msgid "macroman, macintosh" msgstr "macroman, macintosh" -#: ../../library/codecs.rst:1261 +#: ../../library/codecs.rst:1264 msgid "mac_turkish" msgstr "mac_turkish" -#: ../../library/codecs.rst:1261 +#: ../../library/codecs.rst:1264 msgid "macturkish" msgstr "" -#: ../../library/codecs.rst:1263 +#: ../../library/codecs.rst:1266 msgid "ptcp154" msgstr "ptcp154" -#: ../../library/codecs.rst:1263 +#: ../../library/codecs.rst:1266 msgid "csptcp154, pt154, cp154, cyrillic-asian" msgstr "csptcp154, pt154, cp154, cyrillic-asian" -#: ../../library/codecs.rst:1266 +#: ../../library/codecs.rst:1269 msgid "shift_jis" msgstr "shift_jis" -#: ../../library/codecs.rst:1266 +#: ../../library/codecs.rst:1269 msgid "csshiftjis, shiftjis, sjis, s_jis" msgstr "csshiftjis, shiftjis, sjis, s_jis" -#: ../../library/codecs.rst:1269 +#: ../../library/codecs.rst:1272 msgid "shift_jis_2004" msgstr "shift_jis_2004" -#: ../../library/codecs.rst:1269 +#: ../../library/codecs.rst:1272 msgid "shiftjis2004, sjis_2004, sjis2004" msgstr "shiftjis2004, sjis_2004, sjis2004" -#: ../../library/codecs.rst:1272 +#: ../../library/codecs.rst:1275 msgid "shift_jisx0213" msgstr "shift_jisx0213" -#: ../../library/codecs.rst:1272 +#: ../../library/codecs.rst:1275 msgid "shiftjisx0213, sjisx0213, s_jisx0213" msgstr "shiftjisx0213, sjisx0213, s_jisx0213" -#: ../../library/codecs.rst:1275 +#: ../../library/codecs.rst:1278 msgid "utf_32" msgstr "utf_32" -#: ../../library/codecs.rst:1275 +#: ../../library/codecs.rst:1278 msgid "U32, utf32" msgstr "U32, utf32" -#: ../../library/codecs.rst:1275 ../../library/codecs.rst:1277 -#: ../../library/codecs.rst:1279 ../../library/codecs.rst:1281 -#: ../../library/codecs.rst:1283 ../../library/codecs.rst:1285 -#: ../../library/codecs.rst:1287 ../../library/codecs.rst:1289 -#: ../../library/codecs.rst:1291 +#: ../../library/codecs.rst:1278 ../../library/codecs.rst:1280 +#: ../../library/codecs.rst:1282 ../../library/codecs.rst:1284 +#: ../../library/codecs.rst:1286 ../../library/codecs.rst:1288 +#: ../../library/codecs.rst:1290 ../../library/codecs.rst:1292 +#: ../../library/codecs.rst:1294 msgid "all languages" msgstr "" -#: ../../library/codecs.rst:1277 +#: ../../library/codecs.rst:1280 msgid "utf_32_be" msgstr "utf_32_be" -#: ../../library/codecs.rst:1277 +#: ../../library/codecs.rst:1280 msgid "UTF-32BE" msgstr "UTF-32BE" -#: ../../library/codecs.rst:1279 +#: ../../library/codecs.rst:1282 msgid "utf_32_le" msgstr "utf_32_le" -#: ../../library/codecs.rst:1279 +#: ../../library/codecs.rst:1282 msgid "UTF-32LE" msgstr "UTF-32LE" -#: ../../library/codecs.rst:1281 +#: ../../library/codecs.rst:1284 msgid "utf_16" msgstr "utf_16" -#: ../../library/codecs.rst:1281 +#: ../../library/codecs.rst:1284 msgid "U16, utf16" msgstr "U16, utf16" -#: ../../library/codecs.rst:1283 +#: ../../library/codecs.rst:1286 msgid "utf_16_be" msgstr "utf_16_be" -#: ../../library/codecs.rst:1283 +#: ../../library/codecs.rst:1286 msgid "UTF-16BE" msgstr "UTF-16BE" -#: ../../library/codecs.rst:1285 +#: ../../library/codecs.rst:1288 msgid "utf_16_le" msgstr "utf_16_le" -#: ../../library/codecs.rst:1285 +#: ../../library/codecs.rst:1288 msgid "UTF-16LE" msgstr "UTF-16LE" -#: ../../library/codecs.rst:1287 +#: ../../library/codecs.rst:1290 msgid "utf_7" msgstr "utf_7" -#: ../../library/codecs.rst:1287 +#: ../../library/codecs.rst:1290 msgid "U7, unicode-1-1-utf-7" msgstr "U7, unicode-1-1-utf-7" -#: ../../library/codecs.rst:1289 +#: ../../library/codecs.rst:1292 msgid "utf_8" msgstr "utf_8" -#: ../../library/codecs.rst:1289 +#: ../../library/codecs.rst:1292 msgid "U8, UTF, utf8, cp65001" msgstr "U8, UTF, utf8, cp65001" -#: ../../library/codecs.rst:1291 +#: ../../library/codecs.rst:1294 msgid "utf_8_sig" msgstr "utf_8_sig" -#: ../../library/codecs.rst:1294 +#: ../../library/codecs.rst:1297 msgid "" "The utf-16\\* and utf-32\\* encoders no longer allow surrogate code points " "(``U+D800``--``U+DFFF``) to be encoded. The utf-32\\* decoders no longer " "decode byte sequences that correspond to surrogate code points." msgstr "" -#: ../../library/codecs.rst:1300 +#: ../../library/codecs.rst:1303 msgid "``cp65001`` is now an alias to ``utf_8``." msgstr "" -#: ../../library/codecs.rst:1305 +#: ../../library/codecs.rst:1308 msgid "Python Specific Encodings" msgstr "" -#: ../../library/codecs.rst:1307 +#: ../../library/codecs.rst:1310 msgid "" "A number of predefined codecs are specific to Python, so their codec names " "have no meaning outside Python. These are listed in the tables below based " @@ -2305,272 +2305,272 @@ msgid "" "asymmetric codecs, the stated meaning describes the encoding direction." msgstr "" -#: ../../library/codecs.rst:1315 +#: ../../library/codecs.rst:1318 msgid "Text Encodings" msgstr "" -#: ../../library/codecs.rst:1317 +#: ../../library/codecs.rst:1320 msgid "" "The following codecs provide :class:`str` to :class:`bytes` encoding and :" "term:`bytes-like object` to :class:`str` decoding, similar to the Unicode " "text encodings." msgstr "" -#: ../../library/codecs.rst:1326 +#: ../../library/codecs.rst:1329 msgid "idna" msgstr "idna" -#: ../../library/codecs.rst:1326 +#: ../../library/codecs.rst:1329 msgid "" "Implement :rfc:`3490`, see also :mod:`encodings.idna`. Only " "``errors='strict'`` is supported." msgstr "" -#: ../../library/codecs.rst:1332 +#: ../../library/codecs.rst:1335 msgid "mbcs" msgstr "mbcs" -#: ../../library/codecs.rst:1332 +#: ../../library/codecs.rst:1335 msgid "ansi, dbcs" msgstr "ansi, dbcs" -#: ../../library/codecs.rst:1332 +#: ../../library/codecs.rst:1335 msgid "" "Windows only: Encode the operand according to the ANSI codepage (CP_ACP)." msgstr "" -#: ../../library/codecs.rst:1336 +#: ../../library/codecs.rst:1339 msgid "oem" msgstr "oem" -#: ../../library/codecs.rst:1336 +#: ../../library/codecs.rst:1339 msgid "" "Windows only: Encode the operand according to the OEM codepage (CP_OEMCP)." msgstr "" -#: ../../library/codecs.rst:1342 +#: ../../library/codecs.rst:1345 msgid "palmos" msgstr "" -#: ../../library/codecs.rst:1342 +#: ../../library/codecs.rst:1345 msgid "Encoding of PalmOS 3.5." msgstr "" -#: ../../library/codecs.rst:1344 +#: ../../library/codecs.rst:1347 msgid "punycode" msgstr "" -#: ../../library/codecs.rst:1344 +#: ../../library/codecs.rst:1347 msgid "Implement :rfc:`3492`. Stateful codecs are not supported." msgstr "" -#: ../../library/codecs.rst:1348 +#: ../../library/codecs.rst:1351 msgid "raw_unicode_escape" msgstr "raw_unicode_escape" -#: ../../library/codecs.rst:1348 +#: ../../library/codecs.rst:1351 msgid "" -"Latin-1 encoding with ``\\uXXXX`` and ``\\UXXXXXXXX`` for other code points. " -"Existing backslashes are not escaped in any way. It is used in the Python " -"pickle protocol." +"Latin-1 encoding with :samp:`\\\\u{XXXX}` and :samp:`\\\\U{XXXXXXXX}` for " +"other code points. Existing backslashes are not escaped in any way. It is " +"used in the Python pickle protocol." msgstr "" -#: ../../library/codecs.rst:1357 +#: ../../library/codecs.rst:1361 msgid "undefined" msgstr "" -#: ../../library/codecs.rst:1357 +#: ../../library/codecs.rst:1361 msgid "" "Raise an exception for all conversions, even empty strings. The error " "handler is ignored." msgstr "" -#: ../../library/codecs.rst:1362 +#: ../../library/codecs.rst:1366 msgid "unicode_escape" msgstr "unicode_escape" -#: ../../library/codecs.rst:1362 +#: ../../library/codecs.rst:1366 msgid "" "Encoding suitable as the contents of a Unicode literal in ASCII-encoded " "Python source code, except that quotes are not escaped. Decode from Latin-1 " "source code. Beware that Python source code actually uses UTF-8 by default." msgstr "" -#: ../../library/codecs.rst:1374 +#: ../../library/codecs.rst:1378 msgid "\"unicode_internal\" codec is removed." msgstr "" -#: ../../library/codecs.rst:1381 +#: ../../library/codecs.rst:1385 msgid "Binary Transforms" msgstr "" -#: ../../library/codecs.rst:1383 +#: ../../library/codecs.rst:1387 msgid "" "The following codecs provide binary transforms: :term:`bytes-like object` " "to :class:`bytes` mappings. They are not supported by :meth:`bytes.decode` " "(which only produces :class:`str` output)." msgstr "" -#: ../../library/codecs.rst:1391 +#: ../../library/codecs.rst:1395 msgid "Encoder / decoder" msgstr "" -#: ../../library/codecs.rst:1393 +#: ../../library/codecs.rst:1397 msgid "base64_codec [#b64]_" msgstr "base64_codec [#b64]_" -#: ../../library/codecs.rst:1393 +#: ../../library/codecs.rst:1397 msgid "base64, base_64" msgstr "base64, base_64" -#: ../../library/codecs.rst:1393 +#: ../../library/codecs.rst:1397 msgid "" "Convert the operand to multiline MIME base64 (the result always includes a " "trailing ``'\\n'``)." msgstr "" -#: ../../library/codecs.rst:1398 +#: ../../library/codecs.rst:1402 msgid "" "accepts any :term:`bytes-like object` as input for encoding and decoding" msgstr "" -#: ../../library/codecs.rst:1393 +#: ../../library/codecs.rst:1397 msgid ":meth:`base64.encodebytes` / :meth:`base64.decodebytes`" msgstr ":meth:`base64.encodebytes` / :meth:`base64.decodebytes`" -#: ../../library/codecs.rst:1404 +#: ../../library/codecs.rst:1408 msgid "bz2_codec" msgstr "bz2_codec" -#: ../../library/codecs.rst:1404 +#: ../../library/codecs.rst:1408 msgid "bz2" msgstr "bz2" -#: ../../library/codecs.rst:1404 +#: ../../library/codecs.rst:1408 msgid "Compress the operand using bz2." msgstr "" -#: ../../library/codecs.rst:1404 +#: ../../library/codecs.rst:1408 msgid ":meth:`bz2.compress` / :meth:`bz2.decompress`" msgstr ":meth:`bz2.compress` / :meth:`bz2.decompress`" -#: ../../library/codecs.rst:1407 +#: ../../library/codecs.rst:1411 msgid "hex_codec" msgstr "hex_codec" -#: ../../library/codecs.rst:1407 +#: ../../library/codecs.rst:1411 msgid "hex" msgstr "hex" -#: ../../library/codecs.rst:1407 +#: ../../library/codecs.rst:1411 msgid "" "Convert the operand to hexadecimal representation, with two digits per byte." msgstr "" -#: ../../library/codecs.rst:1407 +#: ../../library/codecs.rst:1411 msgid ":meth:`binascii.b2a_hex` / :meth:`binascii.a2b_hex`" msgstr ":meth:`binascii.b2a_hex` / :meth:`binascii.a2b_hex`" -#: ../../library/codecs.rst:1412 +#: ../../library/codecs.rst:1416 msgid "quopri_codec" msgstr "quopri_codec" -#: ../../library/codecs.rst:1412 +#: ../../library/codecs.rst:1416 msgid "quopri, quotedprintable, quoted_printable" msgstr "quopri, quotedprintable, quoted_printable" -#: ../../library/codecs.rst:1412 +#: ../../library/codecs.rst:1416 msgid "Convert the operand to MIME quoted printable." msgstr "" -#: ../../library/codecs.rst:1412 +#: ../../library/codecs.rst:1416 msgid ":meth:`quopri.encode` with ``quotetabs=True`` / :meth:`quopri.decode`" msgstr ":meth:`quopri.encode` with ``quotetabs=True`` / :meth:`quopri.decode`" -#: ../../library/codecs.rst:1416 +#: ../../library/codecs.rst:1420 msgid "uu_codec" msgstr "uu_codec" -#: ../../library/codecs.rst:1416 +#: ../../library/codecs.rst:1420 msgid "uu" msgstr "uu" -#: ../../library/codecs.rst:1416 +#: ../../library/codecs.rst:1420 msgid "Convert the operand using uuencode." msgstr "" -#: ../../library/codecs.rst:1416 +#: ../../library/codecs.rst:1420 msgid ":meth:`uu.encode` / :meth:`uu.decode`" msgstr ":meth:`uu.encode` / :meth:`uu.decode`" -#: ../../library/codecs.rst:1419 +#: ../../library/codecs.rst:1423 msgid "zlib_codec" msgstr "zlib_codec" -#: ../../library/codecs.rst:1419 +#: ../../library/codecs.rst:1423 msgid "zip, zlib" msgstr "zip, zlib" -#: ../../library/codecs.rst:1419 +#: ../../library/codecs.rst:1423 msgid "Compress the operand using gzip." msgstr "" -#: ../../library/codecs.rst:1419 +#: ../../library/codecs.rst:1423 msgid ":meth:`zlib.compress` / :meth:`zlib.decompress`" msgstr ":meth:`zlib.compress` / :meth:`zlib.decompress`" -#: ../../library/codecs.rst:1423 +#: ../../library/codecs.rst:1427 msgid "" "In addition to :term:`bytes-like objects `, " "``'base64_codec'`` also accepts ASCII-only instances of :class:`str` for " "decoding" msgstr "" -#: ../../library/codecs.rst:1427 +#: ../../library/codecs.rst:1431 msgid "Restoration of the binary transforms." msgstr "" -#: ../../library/codecs.rst:1430 +#: ../../library/codecs.rst:1434 msgid "Restoration of the aliases for the binary transforms." msgstr "" -#: ../../library/codecs.rst:1437 +#: ../../library/codecs.rst:1441 msgid "Text Transforms" msgstr "" -#: ../../library/codecs.rst:1439 +#: ../../library/codecs.rst:1443 msgid "" "The following codec provides a text transform: a :class:`str` to :class:" "`str` mapping. It is not supported by :meth:`str.encode` (which only " "produces :class:`bytes` output)." msgstr "" -#: ../../library/codecs.rst:1448 +#: ../../library/codecs.rst:1452 msgid "rot_13" msgstr "rot_13" -#: ../../library/codecs.rst:1448 +#: ../../library/codecs.rst:1452 msgid "rot13" msgstr "" -#: ../../library/codecs.rst:1448 +#: ../../library/codecs.rst:1452 msgid "Return the Caesar-cypher encryption of the operand." msgstr "" -#: ../../library/codecs.rst:1453 +#: ../../library/codecs.rst:1457 msgid "Restoration of the ``rot_13`` text transform." msgstr "" -#: ../../library/codecs.rst:1456 +#: ../../library/codecs.rst:1460 msgid "Restoration of the ``rot13`` alias." msgstr "" -#: ../../library/codecs.rst:1461 +#: ../../library/codecs.rst:1465 msgid "" ":mod:`encodings.idna` --- Internationalized Domain Names in Applications" msgstr "" -#: ../../library/codecs.rst:1467 +#: ../../library/codecs.rst:1471 msgid "" "This module implements :rfc:`3490` (Internationalized Domain Names in " "Applications) and :rfc:`3492` (Nameprep: A Stringprep Profile for " @@ -2578,13 +2578,13 @@ msgid "" "encoding and :mod:`stringprep`." msgstr "" -#: ../../library/codecs.rst:1472 +#: ../../library/codecs.rst:1476 msgid "" "If you need the IDNA 2008 standard from :rfc:`5891` and :rfc:`5895`, use the " "third-party `idna module `_." msgstr "" -#: ../../library/codecs.rst:1475 +#: ../../library/codecs.rst:1479 msgid "" "These RFCs together define a protocol to support non-ASCII characters in " "domain names. A domain name containing non-ASCII characters (such as ``www." @@ -2598,7 +2598,7 @@ msgid "" "presenting them to the user." msgstr "" -#: ../../library/codecs.rst:1486 +#: ../../library/codecs.rst:1490 msgid "" "Python supports this conversion in several ways: the ``idna`` codec " "performs conversion between Unicode and ACE, separating an input string into " @@ -2615,14 +2615,14 @@ msgid "" "sends that field at all)." msgstr "" -#: ../../library/codecs.rst:1499 +#: ../../library/codecs.rst:1503 msgid "" "When receiving host names from the wire (such as in reverse name lookup), no " "automatic conversion to Unicode is performed: applications wishing to " "present such host names to the user should decode them to Unicode." msgstr "" -#: ../../library/codecs.rst:1503 +#: ../../library/codecs.rst:1507 msgid "" "The module :mod:`encodings.idna` also implements the nameprep procedure, " "which performs certain normalizations on host names, to achieve case-" @@ -2630,49 +2630,49 @@ msgid "" "characters. The nameprep functions can be used directly if desired." msgstr "" -#: ../../library/codecs.rst:1511 +#: ../../library/codecs.rst:1515 msgid "" "Return the nameprepped version of *label*. The implementation currently " "assumes query strings, so ``AllowUnassigned`` is true." msgstr "" -#: ../../library/codecs.rst:1517 +#: ../../library/codecs.rst:1521 msgid "" "Convert a label to ASCII, as specified in :rfc:`3490`. ``UseSTD3ASCIIRules`` " "is assumed to be false." msgstr "" -#: ../../library/codecs.rst:1523 +#: ../../library/codecs.rst:1527 msgid "Convert a label to Unicode, as specified in :rfc:`3490`." msgstr "" -#: ../../library/codecs.rst:1527 +#: ../../library/codecs.rst:1531 msgid ":mod:`encodings.mbcs` --- Windows ANSI codepage" msgstr "" -#: ../../library/codecs.rst:1532 +#: ../../library/codecs.rst:1536 msgid "This module implements the ANSI codepage (CP_ACP)." msgstr "" -#: ../../library/codecs.rst:1534 +#: ../../library/codecs.rst:1538 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" -#: ../../library/codecs.rst:1536 +#: ../../library/codecs.rst:1540 msgid "Support any error handler." msgstr "" -#: ../../library/codecs.rst:1539 +#: ../../library/codecs.rst:1543 msgid "" "Before 3.2, the *errors* argument was ignored; ``'replace'`` was always used " "to encode, and ``'ignore'`` to decode." msgstr "" -#: ../../library/codecs.rst:1545 +#: ../../library/codecs.rst:1549 msgid ":mod:`encodings.utf_8_sig` --- UTF-8 codec with BOM signature" msgstr "" -#: ../../library/codecs.rst:1551 +#: ../../library/codecs.rst:1555 msgid "" "This module implements a variant of the UTF-8 codec. On encoding, a UTF-8 " "encoded BOM will be prepended to the UTF-8 encoded bytes. For the stateful " @@ -2705,8 +2705,8 @@ msgstr "stackable(可堆疊)" msgid "strict" msgstr "strict" -#: ../../library/codecs.rst:312 ../../library/codecs.rst:363 -#: ../../library/codecs.rst:385 +#: ../../library/codecs.rst:312 ../../library/codecs.rst:364 +#: ../../library/codecs.rst:387 msgid "error handler's name" msgstr "error handler's name(錯誤處理器名稱)" @@ -2738,7 +2738,7 @@ msgstr "replacement character(替代字元)" msgid "\\ (backslash)" msgstr "\\ (反斜線)" -#: ../../library/codecs.rst:312 ../../library/codecs.rst:363 +#: ../../library/codecs.rst:312 ../../library/codecs.rst:364 msgid "escape sequence" msgstr "escape sequence(跳脫序列)" @@ -2754,18 +2754,18 @@ msgstr "\\u" msgid "\\U" msgstr "\\U" -#: ../../library/codecs.rst:363 +#: ../../library/codecs.rst:364 msgid "xmlcharrefreplace" msgstr "xmlcharrefreplace" -#: ../../library/codecs.rst:363 +#: ../../library/codecs.rst:364 msgid "namereplace" msgstr "namereplace" -#: ../../library/codecs.rst:363 +#: ../../library/codecs.rst:364 msgid "\\N" msgstr "\\N" -#: ../../library/codecs.rst:385 +#: ../../library/codecs.rst:387 msgid "surrogatepass" msgstr "surrogatepass" diff --git a/library/compileall.po b/library/compileall.po index 705cfc98f6..8d7b047354 100644 --- a/library/compileall.po +++ b/library/compileall.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-10-12 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:41+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -48,40 +48,40 @@ msgstr "" "此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法作用" "或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" -#: ../../library/compileall.rst:20 +#: ../../library/compileall.rst:22 msgid "Command-line use" msgstr "" -#: ../../library/compileall.rst:22 +#: ../../library/compileall.rst:24 msgid "" "This module can work as a script (using :program:`python -m compileall`) to " "compile Python sources." msgstr "" -#: ../../library/compileall.rst:30 +#: ../../library/compileall.rst:32 msgid "" "Positional arguments are files to compile or directories that contain source " "files, traversed recursively. If no argument is given, behave as if the " -"command line was ``-l ``." +"command line was :samp:`-l {}`." msgstr "" -#: ../../library/compileall.rst:36 +#: ../../library/compileall.rst:38 msgid "" "Do not recurse into subdirectories, only compile source code files directly " "contained in the named or implied directories." msgstr "" -#: ../../library/compileall.rst:41 +#: ../../library/compileall.rst:43 msgid "Force rebuild even if timestamps are up-to-date." msgstr "" -#: ../../library/compileall.rst:45 +#: ../../library/compileall.rst:47 msgid "" "Do not print the list of files compiled. If passed once, error messages will " "still be printed. If passed twice (``-qq``), all output is suppressed." msgstr "" -#: ../../library/compileall.rst:50 +#: ../../library/compileall.rst:52 msgid "" "Directory prepended to the path to each file being compiled. This will " "appear in compilation time tracebacks, and is also compiled in to the byte-" @@ -90,26 +90,26 @@ msgid "" "executed." msgstr "" -#: ../../library/compileall.rst:59 +#: ../../library/compileall.rst:61 msgid "" "Remove (``-s``) or append (``-p``) the given prefix of paths recorded in the " "``.pyc`` files. Cannot be combined with ``-d``." msgstr "" -#: ../../library/compileall.rst:65 +#: ../../library/compileall.rst:67 msgid "" "regex is used to search the full path to each file considered for " "compilation, and if the regex produces a match, the file is skipped." msgstr "" -#: ../../library/compileall.rst:70 +#: ../../library/compileall.rst:72 msgid "" "Read the file ``list`` and add each line that it contains to the list of " "files and directories to compile. If ``list`` is ``-``, read lines from " "``stdin``." msgstr "" -#: ../../library/compileall.rst:76 +#: ../../library/compileall.rst:78 msgid "" "Write the byte-code files to their legacy locations and names, which may " "overwrite byte-code files created by another version of Python. The default " @@ -117,7 +117,7 @@ msgid "" "byte-code files from multiple versions of Python to coexist." msgstr "" -#: ../../library/compileall.rst:83 +#: ../../library/compileall.rst:85 msgid "" "Control the maximum recursion level for subdirectories. If this is given, " "then ``-l`` option will not be taken into account. :program:`python -m " @@ -125,13 +125,13 @@ msgid "" " -l`." msgstr "" -#: ../../library/compileall.rst:90 +#: ../../library/compileall.rst:92 msgid "" "Use *N* workers to compile the files within the given directory. If ``0`` is " "used, then the result of :func:`os.cpu_count()` will be used." msgstr "" -#: ../../library/compileall.rst:96 +#: ../../library/compileall.rst:98 msgid "" "Control how the generated byte-code files are invalidated at runtime. The " "``timestamp`` value, means that ``.pyc`` files with the source timestamp and " @@ -144,53 +144,53 @@ msgid "" "the ``SOURCE_DATE_EPOCH`` environment variable is set." msgstr "" -#: ../../library/compileall.rst:109 +#: ../../library/compileall.rst:111 msgid "" "Compile with the given optimization level. May be used multiple times to " "compile for multiple levels at a time (for example, ``compileall -o 1 -o " "2``)." msgstr "" -#: ../../library/compileall.rst:115 +#: ../../library/compileall.rst:117 msgid "Ignore symlinks pointing outside the given directory." msgstr "" -#: ../../library/compileall.rst:119 +#: ../../library/compileall.rst:121 msgid "" "If two ``.pyc`` files with different optimization level have the same " "content, use hard links to consolidate duplicate files." msgstr "" -#: ../../library/compileall.rst:122 +#: ../../library/compileall.rst:124 msgid "Added the ``-i``, ``-b`` and ``-h`` options." msgstr "新增選項 ``-i``\\ 、\\ ``-b`` 與 ``-h``\\ 。" -#: ../../library/compileall.rst:125 +#: ../../library/compileall.rst:127 msgid "" "Added the ``-j``, ``-r``, and ``-qq`` options. ``-q`` option was changed " "to a multilevel value. ``-b`` will always produce a byte-code file ending " "in ``.pyc``, never ``.pyo``." msgstr "" -#: ../../library/compileall.rst:130 +#: ../../library/compileall.rst:132 msgid "Added the ``--invalidation-mode`` option." msgstr "新增選項 ``--invalidation-mode``\\ 。" -#: ../../library/compileall.rst:133 +#: ../../library/compileall.rst:135 msgid "" "Added the ``-s``, ``-p``, ``-e`` and ``--hardlink-dupes`` options. Raised " "the default recursion limit from 10 to :py:func:`sys.getrecursionlimit()`. " "Added the possibility to specify the ``-o`` option multiple times." msgstr "" -#: ../../library/compileall.rst:140 +#: ../../library/compileall.rst:142 msgid "" "There is no command-line option to control the optimization level used by " "the :func:`compile` function, because the Python interpreter itself already " "provides the option: :program:`python -O -m compileall`." msgstr "" -#: ../../library/compileall.rst:144 +#: ../../library/compileall.rst:146 msgid "" "Similarly, the :func:`compile` function respects the :data:`sys." "pycache_prefix` setting. The generated bytecode cache will only be useful " @@ -198,24 +198,24 @@ msgid "" "that will be used at runtime." msgstr "" -#: ../../library/compileall.rst:150 +#: ../../library/compileall.rst:152 msgid "Public functions" msgstr "" -#: ../../library/compileall.rst:154 +#: ../../library/compileall.rst:156 msgid "" "Recursively descend the directory tree named by *dir*, compiling all :file:`." "py` files along the way. Return a true value if all the files compiled " "successfully, and a false value otherwise." msgstr "" -#: ../../library/compileall.rst:158 +#: ../../library/compileall.rst:160 msgid "" "The *maxlevels* parameter is used to limit the depth of the recursion; it " "defaults to ``sys.getrecursionlimit()``." msgstr "" -#: ../../library/compileall.rst:161 +#: ../../library/compileall.rst:163 msgid "" "If *ddir* is given, it is prepended to the path to each file being compiled " "for use in compilation time tracebacks, and is also compiled in to the byte-" @@ -224,13 +224,13 @@ msgid "" "executed." msgstr "" -#: ../../library/compileall.rst:167 +#: ../../library/compileall.rst:169 msgid "" "If *force* is true, modules are re-compiled even if the timestamps are up to " "date." msgstr "" -#: ../../library/compileall.rst:170 +#: ../../library/compileall.rst:172 msgid "" "If *rx* is given, its ``search`` method is called on the complete path to " "each file considered for compilation, and if it returns a true value, the " @@ -238,14 +238,14 @@ msgid "" "expression, given as a :ref:`re.Pattern ` object." msgstr "" -#: ../../library/compileall.rst:175 ../../library/compileall.rst:252 +#: ../../library/compileall.rst:177 ../../library/compileall.rst:254 msgid "" "If *quiet* is ``False`` or ``0`` (the default), the filenames and other " "information are printed to standard out. Set to ``1``, only errors are " "printed. Set to ``2``, all output is suppressed." msgstr "" -#: ../../library/compileall.rst:179 ../../library/compileall.rst:256 +#: ../../library/compileall.rst:181 ../../library/compileall.rst:258 msgid "" "If *legacy* is true, byte-code files are written to their legacy locations " "and names, which may overwrite byte-code files created by another version of " @@ -254,7 +254,7 @@ msgid "" "coexist." msgstr "" -#: ../../library/compileall.rst:185 ../../library/compileall.rst:262 +#: ../../library/compileall.rst:187 ../../library/compileall.rst:264 msgid "" "*optimize* specifies the optimization level for the compiler. It is passed " "to the built-in :func:`compile` function. Accepts also a sequence of " @@ -262,7 +262,7 @@ msgid "" "file in one call." msgstr "" -#: ../../library/compileall.rst:189 +#: ../../library/compileall.rst:191 msgid "" "The argument *workers* specifies how many workers are used to compile files " "in parallel. The default is to not use multiple workers. If the platform " @@ -272,79 +272,79 @@ msgid "" "`ValueError` will be raised." msgstr "" -#: ../../library/compileall.rst:196 ../../library/compileall.rst:266 +#: ../../library/compileall.rst:198 ../../library/compileall.rst:268 msgid "" "*invalidation_mode* should be a member of the :class:`py_compile." "PycInvalidationMode` enum and controls how the generated pycs are " "invalidated at runtime." msgstr "" -#: ../../library/compileall.rst:200 ../../library/compileall.rst:270 +#: ../../library/compileall.rst:202 ../../library/compileall.rst:272 msgid "" "The *stripdir*, *prependdir* and *limit_sl_dest* arguments correspond to the " "``-s``, ``-p`` and ``-e`` options described above. They may be specified as " "``str`` or :py:class:`os.PathLike`." msgstr "" -#: ../../library/compileall.rst:204 ../../library/compileall.rst:274 +#: ../../library/compileall.rst:206 ../../library/compileall.rst:276 msgid "" "If *hardlink_dupes* is true and two ``.pyc`` files with different " "optimization level have the same content, use hard links to consolidate " "duplicate files." msgstr "" -#: ../../library/compileall.rst:207 ../../library/compileall.rst:305 +#: ../../library/compileall.rst:209 ../../library/compileall.rst:307 msgid "Added the *legacy* and *optimize* parameter." msgstr "新增 *legacy* 與 *optimize* 參數。" -#: ../../library/compileall.rst:210 +#: ../../library/compileall.rst:212 msgid "Added the *workers* parameter." msgstr "新增 *workers* 參數。" -#: ../../library/compileall.rst:213 ../../library/compileall.rst:279 -#: ../../library/compileall.rst:308 +#: ../../library/compileall.rst:215 ../../library/compileall.rst:281 +#: ../../library/compileall.rst:310 msgid "*quiet* parameter was changed to a multilevel value." msgstr "" -#: ../../library/compileall.rst:216 ../../library/compileall.rst:282 -#: ../../library/compileall.rst:311 +#: ../../library/compileall.rst:218 ../../library/compileall.rst:284 +#: ../../library/compileall.rst:313 msgid "" "The *legacy* parameter only writes out ``.pyc`` files, not ``.pyo`` files no " "matter what the value of *optimize* is." msgstr "" -#: ../../library/compileall.rst:220 +#: ../../library/compileall.rst:222 msgid "Accepts a :term:`path-like object`." msgstr "" -#: ../../library/compileall.rst:223 ../../library/compileall.rst:286 -#: ../../library/compileall.rst:315 +#: ../../library/compileall.rst:225 ../../library/compileall.rst:288 +#: ../../library/compileall.rst:317 msgid "The *invalidation_mode* parameter was added." msgstr "新增 *invalidation_mode* 參數。" -#: ../../library/compileall.rst:226 ../../library/compileall.rst:289 -#: ../../library/compileall.rst:318 +#: ../../library/compileall.rst:228 ../../library/compileall.rst:291 +#: ../../library/compileall.rst:320 msgid "The *invalidation_mode* parameter's default value is updated to None." msgstr "" -#: ../../library/compileall.rst:229 +#: ../../library/compileall.rst:231 msgid "Setting *workers* to 0 now chooses the optimal number of cores." msgstr "" -#: ../../library/compileall.rst:232 +#: ../../library/compileall.rst:234 msgid "" "Added *stripdir*, *prependdir*, *limit_sl_dest* and *hardlink_dupes* " "arguments. Default value of *maxlevels* was changed from ``10`` to ``sys." "getrecursionlimit()``" msgstr "" -#: ../../library/compileall.rst:238 +#: ../../library/compileall.rst:240 msgid "" "Compile the file with path *fullname*. Return a true value if the file " "compiled successfully, and a false value otherwise." msgstr "" -#: ../../library/compileall.rst:241 +#: ../../library/compileall.rst:243 msgid "" "If *ddir* is given, it is prepended to the path to the file being compiled " "for use in compilation time tracebacks, and is also compiled in to the byte-" @@ -353,7 +353,7 @@ msgid "" "executed." msgstr "" -#: ../../library/compileall.rst:247 +#: ../../library/compileall.rst:249 msgid "" "If *rx* is given, its ``search`` method is passed the full path name to the " "file being compiled, and if it returns a true value, the file is not " @@ -362,20 +362,20 @@ msgid "" "object." msgstr "" -#: ../../library/compileall.rst:292 +#: ../../library/compileall.rst:294 msgid "" "Added *stripdir*, *prependdir*, *limit_sl_dest* and *hardlink_dupes* " "arguments." msgstr "" -#: ../../library/compileall.rst:297 +#: ../../library/compileall.rst:299 msgid "" "Byte-compile all the :file:`.py` files found along ``sys.path``. Return a " "true value if all the files compiled successfully, and a false value " "otherwise." msgstr "" -#: ../../library/compileall.rst:300 +#: ../../library/compileall.rst:302 msgid "" "If *skip_curdir* is true (the default), the current directory is not " "included in the search. All other parameters are passed to the :func:" @@ -383,16 +383,16 @@ msgid "" "``maxlevels`` defaults to ``0``." msgstr "" -#: ../../library/compileall.rst:321 +#: ../../library/compileall.rst:323 msgid "" "To force a recompile of all the :file:`.py` files in the :file:`Lib/` " "subdirectory and all its subdirectories::" msgstr "" -#: ../../library/compileall.rst:338 +#: ../../library/compileall.rst:340 msgid "Module :mod:`py_compile`" msgstr ":mod:`py_compile` 模組" -#: ../../library/compileall.rst:339 +#: ../../library/compileall.rst:341 msgid "Byte-compile a single source file." msgstr "" diff --git a/library/concurrent.futures.po b/library/concurrent.futures.po index 90ba3a62ab..d8c5ecccee 100644 --- a/library/concurrent.futures.po +++ b/library/concurrent.futures.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2023-01-24 03:33+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -439,15 +439,24 @@ msgid "" msgstr "" "新增了 *max_tasks_per_child* 引數以允許使用者控制池中 worker 的生命週期。" -#: ../../library/concurrent.futures.rst:299 +#: ../../library/concurrent.futures.rst:296 +msgid "" +"On POSIX systems, if your application has multiple threads and the :mod:" +"`multiprocessing` context uses the ``\"fork\"`` start method: The :func:`os." +"fork` function called internally to spawn workers may raise a :exc:" +"`DeprecationWarning`. Pass a *mp_context* configured to use a different " +"start method. See the :func:`os.fork` documentation for further explanation." +msgstr "" + +#: ../../library/concurrent.futures.rst:307 msgid "ProcessPoolExecutor Example" msgstr "ProcessPoolExecutor 範例" -#: ../../library/concurrent.futures.rst:337 +#: ../../library/concurrent.futures.rst:345 msgid "Future Objects" msgstr "Future 物件" -#: ../../library/concurrent.futures.rst:339 +#: ../../library/concurrent.futures.rst:347 msgid "" "The :class:`Future` class encapsulates the asynchronous execution of a " "callable. :class:`Future` instances are created by :meth:`Executor.submit`." @@ -455,7 +464,7 @@ msgstr "" ":class:`Future` 類別封裝了可呼叫物件的非同步執行。:class:`Future` 實例由 :" "meth:`Executor.submit` 建立。" -#: ../../library/concurrent.futures.rst:344 +#: ../../library/concurrent.futures.rst:352 msgid "" "Encapsulates the asynchronous execution of a callable. :class:`Future` " "instances are created by :meth:`Executor.submit` and should not be created " @@ -464,7 +473,7 @@ msgstr "" "封裝可呼叫物件的非同步執行。:class:`Future` 實例由 :meth:`Executor.submit` 建" "立,且除測試外不應直接建立。" -#: ../../library/concurrent.futures.rst:350 +#: ../../library/concurrent.futures.rst:358 msgid "" "Attempt to cancel the call. If the call is currently being executed or " "finished running and cannot be cancelled then the method will return " @@ -474,22 +483,22 @@ msgstr "" "嘗試取消呼叫。如果呼叫當前正在執行或已完成運行且無法取消,則該方法將回傳 " "``False``,否則呼叫將被取消並且該方法將回傳 ``True``。" -#: ../../library/concurrent.futures.rst:357 +#: ../../library/concurrent.futures.rst:365 msgid "Return ``True`` if the call was successfully cancelled." msgstr "如果該呼叫成功被取消,則回傳 ``True``。" -#: ../../library/concurrent.futures.rst:361 +#: ../../library/concurrent.futures.rst:369 msgid "" "Return ``True`` if the call is currently being executed and cannot be " "cancelled." msgstr "如果呼叫正在執行且無法取消,則回傳 ``True``。" -#: ../../library/concurrent.futures.rst:366 +#: ../../library/concurrent.futures.rst:374 msgid "" "Return ``True`` if the call was successfully cancelled or finished running." msgstr "如果呼叫成功被取消或結束運行,則回傳 ``True``。" -#: ../../library/concurrent.futures.rst:371 +#: ../../library/concurrent.futures.rst:379 msgid "" "Return the value returned by the call. If the call hasn't yet completed then " "this method will wait up to *timeout* seconds. If the call hasn't completed " @@ -501,19 +510,19 @@ msgstr "" "叫在 *timeout* 秒內未完成,則會引發 :exc:`TimeoutError`。*timeout* 可以是整數" "或浮點數。如果未指定 *timeout* 或為 ``None``,則等待時間就不會有限制。" -#: ../../library/concurrent.futures.rst:378 -#: ../../library/concurrent.futures.rst:392 +#: ../../library/concurrent.futures.rst:386 +#: ../../library/concurrent.futures.rst:400 msgid "" "If the future is cancelled before completing then :exc:`.CancelledError` " "will be raised." msgstr "如果 future 在完成之前被取消,那麼 :exc:`.CancelledError` 將被引發。" -#: ../../library/concurrent.futures.rst:381 +#: ../../library/concurrent.futures.rst:389 msgid "" "If the call raised an exception, this method will raise the same exception." msgstr "如果該呼叫引發了例外,此方法將引發相同的例外。" -#: ../../library/concurrent.futures.rst:385 +#: ../../library/concurrent.futures.rst:393 msgid "" "Return the exception raised by the call. If the call hasn't yet completed " "then this method will wait up to *timeout* seconds. If the call hasn't " @@ -525,11 +534,11 @@ msgstr "" "呼叫在 *timeout* 秒內未完成,則會引發 :exc:`TimeoutError`。 *timeout* 可以是" "整數或浮點數。如果未指定 *timeout* 或為 ``None``,則等待時間就不會有限制。" -#: ../../library/concurrent.futures.rst:395 +#: ../../library/concurrent.futures.rst:403 msgid "If the call completed without raising, ``None`` is returned." msgstr "如果呼叫在沒有引發的情況下完成,則回傳 ``None``。" -#: ../../library/concurrent.futures.rst:399 +#: ../../library/concurrent.futures.rst:407 msgid "" "Attaches the callable *fn* to the future. *fn* will be called, with the " "future as its only argument, when the future is cancelled or finishes " @@ -538,7 +547,7 @@ msgstr "" "將可呼叫的 *fn* 附加到 future 上。當 future 被取消或完成運行時,*fn* 將被以 " "future 作為其唯一引數來呼叫。" -#: ../../library/concurrent.futures.rst:403 +#: ../../library/concurrent.futures.rst:411 msgid "" "Added callables are called in the order that they were added and are always " "called in a thread belonging to the process that added them. If the " @@ -550,19 +559,19 @@ msgstr "" "如果可呼叫物件引發 :exc:`Exception` 子類別,它將被記錄 (log) 並忽略。如果可呼" "叫物件引發 :exc:`BaseException` 子類別,該行為未定義。" -#: ../../library/concurrent.futures.rst:409 +#: ../../library/concurrent.futures.rst:417 msgid "" "If the future has already completed or been cancelled, *fn* will be called " "immediately." msgstr "如果 future 已經完成或被取消,*fn* 將立即被呼叫。" -#: ../../library/concurrent.futures.rst:412 +#: ../../library/concurrent.futures.rst:420 msgid "" "The following :class:`Future` methods are meant for use in unit tests and :" "class:`Executor` implementations." msgstr "以下 :class:`Future` 方法旨在用於單元測試和 :class:`Executor` 實作。" -#: ../../library/concurrent.futures.rst:417 +#: ../../library/concurrent.futures.rst:425 msgid "" "This method should only be called by :class:`Executor` implementations " "before executing the work associated with the :class:`Future` and by unit " @@ -571,7 +580,7 @@ msgstr "" "此方法只能在與 :class:`Future` 關聯的工作被執行之前於 :class:`Executor` 實作" "中呼叫,或者在單元測試中呼叫。" -#: ../../library/concurrent.futures.rst:421 +#: ../../library/concurrent.futures.rst:429 msgid "" "If the method returns ``False`` then the :class:`Future` was cancelled, i." "e. :meth:`Future.cancel` was called and returned ``True``. Any threads " @@ -582,7 +591,7 @@ msgstr "" "cancel` 被呼叫並回傳 ``True``。任何等待 :class:`Future` 完成的執行緒(即透" "過 :func:`as_completed` 或 :func:`wait`)將被喚醒。" -#: ../../library/concurrent.futures.rst:426 +#: ../../library/concurrent.futures.rst:434 msgid "" "If the method returns ``True`` then the :class:`Future` was not cancelled " "and has been put in the running state, i.e. calls to :meth:`Future.running` " @@ -591,7 +600,7 @@ msgstr "" "如果該方法回傳 ``True`` 則代表 :class:`Future` 未被取消並已進入運行狀態,意即" "呼叫 :meth:`Future.running` 將回傳 ``True``。" -#: ../../library/concurrent.futures.rst:430 +#: ../../library/concurrent.futures.rst:438 msgid "" "This method can only be called once and cannot be called after :meth:`Future." "set_result` or :meth:`Future.set_exception` have been called." @@ -599,20 +608,20 @@ msgstr "" "此方法只能呼叫一次,且不能在呼叫 :meth:`Future.set_result` 或 :meth:`Future." "set_exception` 之後呼叫。" -#: ../../library/concurrent.futures.rst:436 +#: ../../library/concurrent.futures.rst:444 msgid "" "Sets the result of the work associated with the :class:`Future` to *result*." msgstr "將與 :class:`Future` 關聯的工作結果設定為 *result*。" -#: ../../library/concurrent.futures.rst:439 -#: ../../library/concurrent.futures.rst:452 +#: ../../library/concurrent.futures.rst:447 +#: ../../library/concurrent.futures.rst:460 msgid "" "This method should only be used by :class:`Executor` implementations and " "unit tests." msgstr "此方法只能在 :class:`Executor` 實作中和單元測試中使用。" -#: ../../library/concurrent.futures.rst:442 -#: ../../library/concurrent.futures.rst:455 +#: ../../library/concurrent.futures.rst:450 +#: ../../library/concurrent.futures.rst:463 msgid "" "This method raises :exc:`concurrent.futures.InvalidStateError` if the :class:" "`Future` is already done." @@ -620,18 +629,18 @@ msgstr "" "如果 :class:`Future` 已經完成,此方法會引發 :exc:`concurrent.futures." "InvalidStateError`。" -#: ../../library/concurrent.futures.rst:449 +#: ../../library/concurrent.futures.rst:457 msgid "" "Sets the result of the work associated with the :class:`Future` to the :" "class:`Exception` *exception*." msgstr "" "將與 :class:`Future` 關聯的工作結果設定為 :class:`Exception` *exception*。" -#: ../../library/concurrent.futures.rst:461 +#: ../../library/concurrent.futures.rst:469 msgid "Module Functions" msgstr "模組函式" -#: ../../library/concurrent.futures.rst:465 +#: ../../library/concurrent.futures.rst:473 msgid "" "Wait for the :class:`Future` instances (possibly created by different :class:" "`Executor` instances) given by *fs* to complete. Duplicate futures given to " @@ -647,7 +656,7 @@ msgstr "" "完成的 future(已完成或被取消的 future)。第二組名為 ``not_done``,包含未完成" "的 future(未定或運行中的 future)。" -#: ../../library/concurrent.futures.rst:473 +#: ../../library/concurrent.futures.rst:481 msgid "" "*timeout* can be used to control the maximum number of seconds to wait " "before returning. *timeout* can be an int or float. If *timeout* is not " @@ -656,33 +665,33 @@ msgstr "" "*timeout* 可用於控制回傳前等待的最大秒數。*timeout* 可以是整數或浮點數。如果" "未指定 *timeout* 或為 ``None``,則等待時間就沒有限制。" -#: ../../library/concurrent.futures.rst:477 +#: ../../library/concurrent.futures.rst:485 msgid "" "*return_when* indicates when this function should return. It must be one of " "the following constants:" msgstr "*return_when* 表示此函式應回傳的時間。它必須是以下常數之一:" -#: ../../library/concurrent.futures.rst:483 +#: ../../library/concurrent.futures.rst:491 msgid "Constant" msgstr "常數" -#: ../../library/concurrent.futures.rst:483 +#: ../../library/concurrent.futures.rst:491 msgid "Description" msgstr "描述" -#: ../../library/concurrent.futures.rst:485 +#: ../../library/concurrent.futures.rst:493 msgid ":const:`FIRST_COMPLETED`" msgstr ":const:`FIRST_COMPLETED`" -#: ../../library/concurrent.futures.rst:485 +#: ../../library/concurrent.futures.rst:493 msgid "The function will return when any future finishes or is cancelled." msgstr "當任何 future 完成或被取消時,該函式就會回傳。" -#: ../../library/concurrent.futures.rst:488 +#: ../../library/concurrent.futures.rst:496 msgid ":const:`FIRST_EXCEPTION`" msgstr ":const:`FIRST_EXCEPTION`" -#: ../../library/concurrent.futures.rst:488 +#: ../../library/concurrent.futures.rst:496 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:" @@ -691,15 +700,15 @@ msgstr "" "該函式會在任何 future 透過引發例外而完結時回傳。如果 future 沒有引發例外,那" "麼它等同於 :const:`ALL_COMPLETED`。" -#: ../../library/concurrent.futures.rst:494 +#: ../../library/concurrent.futures.rst:502 msgid ":const:`ALL_COMPLETED`" msgstr ":const:`ALL_COMPLETED`" -#: ../../library/concurrent.futures.rst:494 +#: ../../library/concurrent.futures.rst:502 msgid "The function will return when all futures finish or are cancelled." msgstr "當所有 future 都完成或被取消時,該函式才會回傳。" -#: ../../library/concurrent.futures.rst:500 +#: ../../library/concurrent.futures.rst:508 msgid "" "Returns an iterator over the :class:`Future` instances (possibly created by " "different :class:`Executor` instances) given by *fs* that yields futures as " @@ -719,36 +728,36 @@ msgstr "" "`TimeoutError`。*timeout* 可以是整數或浮點數。如果未指定 *timeout* 或為 " "``None``,則等待時間就沒有限制。" -#: ../../library/concurrent.futures.rst:514 +#: ../../library/concurrent.futures.rst:522 msgid ":pep:`3148` -- futures - execute computations asynchronously" msgstr ":pep:`3148` -- futures - 非同步地執行運算" -#: ../../library/concurrent.futures.rst:514 +#: ../../library/concurrent.futures.rst:522 msgid "" "The proposal which described this feature for inclusion in the Python " "standard library." msgstr "描述此功能並提出被包含於 Python 標準函式庫中的提案。" -#: ../../library/concurrent.futures.rst:519 +#: ../../library/concurrent.futures.rst:527 msgid "Exception classes" msgstr "例外類別" -#: ../../library/concurrent.futures.rst:525 +#: ../../library/concurrent.futures.rst:533 msgid "Raised when a future is cancelled." msgstr "當 future 被取消時引發。" -#: ../../library/concurrent.futures.rst:529 +#: ../../library/concurrent.futures.rst:537 msgid "" "A deprecated alias of :exc:`TimeoutError`, raised when a future operation " "exceeds the given timeout." msgstr "" ":exc:`TimeoutError` 的棄用別名,在 future 操作超過給定超時 (timeout) 時引發。" -#: ../../library/concurrent.futures.rst:534 +#: ../../library/concurrent.futures.rst:542 msgid "This class was made an alias of :exc:`TimeoutError`." msgstr "這個類別是 :exc:`TimeoutError` 的別名。" -#: ../../library/concurrent.futures.rst:539 +#: ../../library/concurrent.futures.rst:547 msgid "" "Derived from :exc:`RuntimeError`, this exception class is raised when an " "executor is broken for some reason, and cannot be used to submit or execute " @@ -757,13 +766,13 @@ msgstr "" "衍生自 :exc:`RuntimeError`,當執行器因某種原因損壞時會引發此例外類別,並且不" "能用於提交或執行新任務。" -#: ../../library/concurrent.futures.rst:547 +#: ../../library/concurrent.futures.rst:555 msgid "" "Raised when an operation is performed on a future that is not allowed in the " "current state." msgstr "當前狀態下不允許的 future 操作被執行時而引發。" -#: ../../library/concurrent.futures.rst:556 +#: ../../library/concurrent.futures.rst:564 msgid "" "Derived from :exc:`~concurrent.futures.BrokenExecutor`, this exception class " "is raised when one of the workers of a :class:`ThreadPoolExecutor` has " @@ -772,7 +781,7 @@ msgstr "" "衍生自 :exc:`~concurrent.futures.BrokenExecutor`,當 :class:" "`ThreadPoolExecutor` 的其中一個 worker 初始化失敗時會引發此例外類別。" -#: ../../library/concurrent.futures.rst:566 +#: ../../library/concurrent.futures.rst:574 msgid "" "Derived from :exc:`~concurrent.futures.BrokenExecutor` (formerly :exc:" "`RuntimeError`), this exception class is raised when one of the workers of " diff --git a/library/ctypes.po b/library/ctypes.po index 120a3fae5a..803aeb4d87 100644 --- a/library/ctypes.po +++ b/library/ctypes.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-20 15:45+0000\n" +"POT-Creation-Date: 2023-10-12 00:03+0000\n" "PO-Revision-Date: 2023-04-26 02:59+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -210,7 +210,7 @@ msgid "" "learn more about :mod:`ctypes` data types." msgstr "" -#: ../../library/ctypes.rst:213 ../../library/ctypes.rst:2201 +#: ../../library/ctypes.rst:213 ../../library/ctypes.rst:2203 msgid "Fundamental data types" msgstr "" @@ -1245,7 +1245,7 @@ msgid "" "If no library can be found, returns ``None``." msgstr "" -#: ../../library/ctypes.rst:1317 ../../library/ctypes.rst:1976 +#: ../../library/ctypes.rst:1317 ../../library/ctypes.rst:1977 msgid "The exact functionality is system dependent." msgstr "" @@ -1322,8 +1322,8 @@ msgid "" "determine which one is not found using Windows debugging and tracing tools." msgstr "" -#: ../../library/ctypes.rst:1388 ../../library/ctypes.rst:1410 -#: ../../library/ctypes.rst:1421 ../../library/ctypes.rst:1438 +#: ../../library/ctypes.rst:1388 ../../library/ctypes.rst:1411 +#: ../../library/ctypes.rst:1422 ../../library/ctypes.rst:1439 msgid "The *name* parameter can now be a :term:`path-like object`." msgstr "" @@ -1344,23 +1344,25 @@ msgid "" msgstr "" #: ../../library/ctypes.rst:1405 -msgid ":exc:`WindowsError` used to be raised." +msgid "" +":exc:`WindowsError` used to be raised, which is now an alias of :exc:" +"`OSError`." msgstr "" -#: ../../library/ctypes.rst:1415 +#: ../../library/ctypes.rst:1416 msgid "" "Windows only: Instances of this class represent loaded shared libraries, " "functions in these libraries use the ``stdcall`` calling convention, and are " "assumed to return :c:expr:`int` by default." msgstr "" -#: ../../library/ctypes.rst:1423 +#: ../../library/ctypes.rst:1424 msgid "" "The Python :term:`global interpreter lock` is released before calling any " "function exported by these libraries, and reacquired afterwards." msgstr "" -#: ../../library/ctypes.rst:1429 +#: ../../library/ctypes.rst:1430 msgid "" "Instances of this class behave like :class:`CDLL` instances, except that the " "Python GIL is *not* released during the function call, and after the " @@ -1368,11 +1370,11 @@ msgid "" "set, a Python exception is raised." msgstr "" -#: ../../library/ctypes.rst:1434 +#: ../../library/ctypes.rst:1435 msgid "Thus, this is only useful to call Python C api functions directly." msgstr "" -#: ../../library/ctypes.rst:1440 +#: ../../library/ctypes.rst:1441 msgid "" "All these classes can be instantiated by calling them with at least one " "argument, the pathname of the shared library. If you have an existing " @@ -1382,7 +1384,7 @@ msgid "" "the process, and to get a handle to it." msgstr "" -#: ../../library/ctypes.rst:1447 +#: ../../library/ctypes.rst:1448 msgid "" "The *mode* parameter can be used to specify how the library is loaded. For " "details, consult the :manpage:`dlopen(3)` manpage. On Windows, *mode* is " @@ -1390,7 +1392,7 @@ msgid "" "configurable." msgstr "" -#: ../../library/ctypes.rst:1452 +#: ../../library/ctypes.rst:1453 msgid "" "The *use_errno* parameter, when set to true, enables a ctypes mechanism that " "allows accessing the system :data:`errno` error number in a safe way. :mod:" @@ -1400,14 +1402,14 @@ msgid "" "private copy, the same happens immediately after the function call." msgstr "" -#: ../../library/ctypes.rst:1459 +#: ../../library/ctypes.rst:1460 msgid "" "The function :func:`ctypes.get_errno` returns the value of the ctypes " "private copy, and the function :func:`ctypes.set_errno` changes the ctypes " "private copy to a new value and returns the former value." msgstr "" -#: ../../library/ctypes.rst:1463 +#: ../../library/ctypes.rst:1464 msgid "" "The *use_last_error* parameter, when set to true, enables the same mechanism " "for the Windows error code which is managed by the :func:`GetLastError` and :" @@ -1416,7 +1418,7 @@ msgid "" "private copy of the windows error code." msgstr "" -#: ../../library/ctypes.rst:1469 +#: ../../library/ctypes.rst:1470 msgid "" "The *winmode* parameter is used on Windows to specify how the library is " "loaded (since *mode* is ignored). It takes any value that is valid for the " @@ -1426,29 +1428,29 @@ msgid "" "ensure the correct library and dependencies are loaded." msgstr "" -#: ../../library/ctypes.rst:1476 +#: ../../library/ctypes.rst:1477 msgid "Added *winmode* parameter." msgstr "新增 *winmode* 參數。" -#: ../../library/ctypes.rst:1483 +#: ../../library/ctypes.rst:1484 msgid "" "Flag to use as *mode* parameter. On platforms where this flag is not " "available, it is defined as the integer zero." msgstr "" -#: ../../library/ctypes.rst:1490 +#: ../../library/ctypes.rst:1491 msgid "" "Flag to use as *mode* parameter. On platforms where this is not available, " "it is the same as *RTLD_GLOBAL*." msgstr "" -#: ../../library/ctypes.rst:1497 +#: ../../library/ctypes.rst:1498 msgid "" "The default mode which is used to load shared libraries. On OSX 10.3, this " "is *RTLD_GLOBAL*, otherwise it is the same as *RTLD_LOCAL*." msgstr "" -#: ../../library/ctypes.rst:1500 +#: ../../library/ctypes.rst:1501 msgid "" "Instances of these classes have no public methods. Functions exported by " "the shared library can be accessed as attributes or by index. Please note " @@ -1457,21 +1459,21 @@ msgid "" "other hand, accessing it through an index returns a new object each time::" msgstr "" -#: ../../library/ctypes.rst:1513 +#: ../../library/ctypes.rst:1514 msgid "" "The following public attributes are available, their name starts with an " "underscore to not clash with exported function names:" msgstr "" -#: ../../library/ctypes.rst:1519 +#: ../../library/ctypes.rst:1520 msgid "The system handle used to access the library." msgstr "" -#: ../../library/ctypes.rst:1524 +#: ../../library/ctypes.rst:1525 msgid "The name of the library passed in the constructor." msgstr "" -#: ../../library/ctypes.rst:1526 +#: ../../library/ctypes.rst:1527 msgid "" "Shared libraries can also be loaded by using one of the prefabricated " "objects, which are instances of the :class:`LibraryLoader` class, either by " @@ -1479,13 +1481,13 @@ msgid "" "library as attribute of the loader instance." msgstr "" -#: ../../library/ctypes.rst:1534 +#: ../../library/ctypes.rst:1535 msgid "" "Class which loads shared libraries. *dlltype* should be one of the :class:" "`CDLL`, :class:`PyDLL`, :class:`WinDLL`, or :class:`OleDLL` types." msgstr "" -#: ../../library/ctypes.rst:1537 +#: ../../library/ctypes.rst:1538 msgid "" ":meth:`!__getattr__` has special behavior: It allows loading a shared " "library by accessing it as attribute of a library loader instance. The " @@ -1493,39 +1495,39 @@ msgid "" "each time." msgstr "" -#: ../../library/ctypes.rst:1543 +#: ../../library/ctypes.rst:1544 msgid "" "Load a shared library into the process and return it. This method always " "returns a new instance of the library." msgstr "" -#: ../../library/ctypes.rst:1547 +#: ../../library/ctypes.rst:1548 msgid "These prefabricated library loaders are available:" msgstr "" -#: ../../library/ctypes.rst:1552 +#: ../../library/ctypes.rst:1553 msgid "Creates :class:`CDLL` instances." msgstr "" -#: ../../library/ctypes.rst:1558 +#: ../../library/ctypes.rst:1559 msgid "Windows only: Creates :class:`WinDLL` instances." msgstr "" -#: ../../library/ctypes.rst:1564 +#: ../../library/ctypes.rst:1565 msgid "Windows only: Creates :class:`OleDLL` instances." msgstr "" -#: ../../library/ctypes.rst:1570 +#: ../../library/ctypes.rst:1571 msgid "Creates :class:`PyDLL` instances." msgstr "" -#: ../../library/ctypes.rst:1573 +#: ../../library/ctypes.rst:1574 msgid "" "For accessing the C Python api directly, a ready-to-use Python shared " "library object is available:" msgstr "" -#: ../../library/ctypes.rst:1579 +#: ../../library/ctypes.rst:1580 msgid "" "An instance of :class:`PyDLL` that exposes Python C API functions as " "attributes. Note that all these functions are assumed to return C :c:expr:" @@ -1533,21 +1535,21 @@ msgid "" "correct :attr:`!restype` attribute to use these functions." msgstr "" -#: ../../library/ctypes.rst:1584 +#: ../../library/ctypes.rst:1585 msgid "" "Raises an :ref:`auditing event ` ``ctypes.dlopen`` with argument " "``name``." msgstr "" "引發一個附帶引數 ``name`` 的\\ :ref:`稽核事件 ` ``ctypes.dlopen``。" -#: ../../library/ctypes.rst:1586 +#: ../../library/ctypes.rst:1587 msgid "" "Loading a library through any of these objects raises an :ref:`auditing " "event ` ``ctypes.dlopen`` with string argument ``name``, the name " "used to load the library." msgstr "" -#: ../../library/ctypes.rst:1590 +#: ../../library/ctypes.rst:1591 #, fuzzy msgid "" "Raises an :ref:`auditing event ` ``ctypes.dlsym`` with arguments " @@ -1556,14 +1558,14 @@ msgstr "" "引發一個附帶引數 ``library``、``name`` 的\\ :ref:`稽核事件 ` " "``ctypes.dlsym``。" -#: ../../library/ctypes.rst:1592 +#: ../../library/ctypes.rst:1593 msgid "" "Accessing a function on a loaded library raises an auditing event ``ctypes." "dlsym`` with arguments ``library`` (the library object) and ``name`` (the " "symbol's name as a string or integer)." msgstr "" -#: ../../library/ctypes.rst:1596 +#: ../../library/ctypes.rst:1597 #, fuzzy msgid "" "Raises an :ref:`auditing event ` ``ctypes.dlsym/handle`` with " @@ -1572,18 +1574,18 @@ msgstr "" "引發一個附帶引數 ``handle``、``name`` 的\\ :ref:`稽核事件 ` " "``ctypes.dlsym/handle``。" -#: ../../library/ctypes.rst:1598 +#: ../../library/ctypes.rst:1599 msgid "" "In cases when only the library handle is available rather than the object, " "accessing a function raises an auditing event ``ctypes.dlsym/handle`` with " "arguments ``handle`` (the raw library handle) and ``name``." msgstr "" -#: ../../library/ctypes.rst:1605 +#: ../../library/ctypes.rst:1606 msgid "Foreign functions" msgstr "" -#: ../../library/ctypes.rst:1607 +#: ../../library/ctypes.rst:1608 msgid "" "As explained in the previous section, foreign functions can be accessed as " "attributes of loaded shared libraries. The function objects created in this " @@ -1592,29 +1594,29 @@ msgid "" "library loader. They are instances of a private class:" msgstr "" -#: ../../library/ctypes.rst:1616 +#: ../../library/ctypes.rst:1617 msgid "Base class for C callable foreign functions." msgstr "" -#: ../../library/ctypes.rst:1618 +#: ../../library/ctypes.rst:1619 msgid "" "Instances of foreign functions are also C compatible data types; they " "represent C function pointers." msgstr "" -#: ../../library/ctypes.rst:1621 +#: ../../library/ctypes.rst:1622 msgid "" "This behavior can be customized by assigning to special attributes of the " "foreign function object." msgstr "" -#: ../../library/ctypes.rst:1626 +#: ../../library/ctypes.rst:1627 msgid "" "Assign a ctypes type to specify the result type of the foreign function. Use " "``None`` for :c:expr:`void`, a function not returning anything." msgstr "" -#: ../../library/ctypes.rst:1629 +#: ../../library/ctypes.rst:1630 msgid "" "It is possible to assign a callable Python object that is not a ctypes type, " "in this case the function is assumed to return a C :c:expr:`int`, and the " @@ -1624,7 +1626,7 @@ msgid "" "callable to the :attr:`errcheck` attribute." msgstr "" -#: ../../library/ctypes.rst:1638 +#: ../../library/ctypes.rst:1639 msgid "" "Assign a tuple of ctypes types to specify the argument types that the " "function accepts. Functions using the ``stdcall`` calling convention can " @@ -1633,7 +1635,7 @@ msgid "" "unspecified arguments as well." msgstr "" -#: ../../library/ctypes.rst:1644 +#: ../../library/ctypes.rst:1645 msgid "" "When a foreign function is called, each actual argument is passed to the :" "meth:`~_CData.from_param` class method of the items in the :attr:`argtypes` " @@ -1643,7 +1645,7 @@ msgid "" "object using ctypes conversion rules." msgstr "" -#: ../../library/ctypes.rst:1651 +#: ../../library/ctypes.rst:1652 msgid "" "New: It is now possible to put items in argtypes which are not ctypes types, " "but each item must have a :meth:`~_CData.from_param` method which returns a " @@ -1651,44 +1653,44 @@ msgid "" "defining adapters that can adapt custom objects as function parameters." msgstr "" -#: ../../library/ctypes.rst:1658 +#: ../../library/ctypes.rst:1659 msgid "" "Assign a Python function or another callable to this attribute. The callable " "will be called with three or more arguments:" msgstr "" -#: ../../library/ctypes.rst:1665 +#: ../../library/ctypes.rst:1666 msgid "" "*result* is what the foreign function returns, as specified by the :attr:`!" "restype` attribute." msgstr "" -#: ../../library/ctypes.rst:1668 +#: ../../library/ctypes.rst:1669 msgid "" "*func* is the foreign function object itself, this allows reusing the same " "callable object to check or post process the results of several functions." msgstr "" -#: ../../library/ctypes.rst:1672 +#: ../../library/ctypes.rst:1673 msgid "" "*arguments* is a tuple containing the parameters originally passed to the " "function call, this allows specializing the behavior on the arguments used." msgstr "" -#: ../../library/ctypes.rst:1676 +#: ../../library/ctypes.rst:1677 msgid "" "The object that this function returns will be returned from the foreign " "function call, but it can also check the result value and raise an exception " "if the foreign function call failed." msgstr "" -#: ../../library/ctypes.rst:1683 +#: ../../library/ctypes.rst:1684 msgid "" "This exception is raised when a foreign function call cannot convert one of " "the passed arguments." msgstr "" -#: ../../library/ctypes.rst:1687 +#: ../../library/ctypes.rst:1688 #, fuzzy msgid "" "Raises an :ref:`auditing event ` ``ctypes.set_exception`` with " @@ -1697,7 +1699,7 @@ msgstr "" "引發一個附帶引數 ``code`` 的\\ :ref:`稽核事件 ` ``ctypes." "set_exception``。" -#: ../../library/ctypes.rst:1689 +#: ../../library/ctypes.rst:1690 msgid "" "On Windows, when a foreign function call raises a system exception (for " "example, due to an access violation), it will be captured and replaced with " @@ -1706,7 +1708,7 @@ msgid "" "hook to replace the exception with its own." msgstr "" -#: ../../library/ctypes.rst:1695 +#: ../../library/ctypes.rst:1696 #, fuzzy msgid "" "Raises an :ref:`auditing event ` ``ctypes.call_function`` with " @@ -1715,18 +1717,18 @@ msgstr "" "引發一個附帶引數 ``func_pointer``、``arguments`` 的\\ :ref:`稽核事件 " "` ``ctypes.call_function``。" -#: ../../library/ctypes.rst:1697 +#: ../../library/ctypes.rst:1698 msgid "" "Some ways to invoke foreign function calls may raise an auditing event " "``ctypes.call_function`` with arguments ``function pointer`` and " "``arguments``." msgstr "" -#: ../../library/ctypes.rst:1703 +#: ../../library/ctypes.rst:1704 msgid "Function prototypes" msgstr "" -#: ../../library/ctypes.rst:1705 +#: ../../library/ctypes.rst:1706 msgid "" "Foreign functions can also be created by instantiating function prototypes. " "Function prototypes are similar to function prototypes in C; they describe a " @@ -1737,7 +1739,7 @@ msgid "" "``@wrapper`` syntax. See :ref:`ctypes-callback-functions` for examples." msgstr "" -#: ../../library/ctypes.rst:1716 +#: ../../library/ctypes.rst:1717 msgid "" "The returned function prototype creates functions that use the standard C " "calling convention. The function will release the GIL during the call. If " @@ -1746,20 +1748,20 @@ msgid "" "after the call; *use_last_error* does the same for the Windows error code." msgstr "" -#: ../../library/ctypes.rst:1726 +#: ../../library/ctypes.rst:1727 msgid "" "Windows only: The returned function prototype creates functions that use the " "``stdcall`` calling convention. The function will release the GIL during " "the call. *use_errno* and *use_last_error* have the same meaning as above." msgstr "" -#: ../../library/ctypes.rst:1734 +#: ../../library/ctypes.rst:1735 msgid "" "The returned function prototype creates functions that use the Python " "calling convention. The function will *not* release the GIL during the call." msgstr "" -#: ../../library/ctypes.rst:1737 +#: ../../library/ctypes.rst:1738 msgid "" "Function prototypes created by these factory functions can be instantiated " "in different ways, depending on the type and number of the parameters in the " @@ -1857,22 +1859,22 @@ msgstr "" msgid "The optional third item is the default value for this parameter." msgstr "" -#: ../../library/ctypes.rst:1803 +#: ../../library/ctypes.rst:1804 msgid "" -"This example demonstrates how to wrap the Windows ``MessageBoxW`` function " -"so that it supports default parameters and named arguments. The C " +"The following example demonstrates how to wrap the Windows ``MessageBoxW`` " +"function so that it supports default parameters and named arguments. The C " "declaration from the windows header file is this::" msgstr "" -#: ../../library/ctypes.rst:1814 ../../library/ctypes.rst:1837 +#: ../../library/ctypes.rst:1815 ../../library/ctypes.rst:1838 msgid "Here is the wrapping with :mod:`ctypes`::" msgstr "" -#: ../../library/ctypes.rst:1822 +#: ../../library/ctypes.rst:1823 msgid "The ``MessageBox`` foreign function can now be called in these ways::" msgstr "" -#: ../../library/ctypes.rst:1828 +#: ../../library/ctypes.rst:1829 msgid "" "A second example demonstrates output parameters. The win32 " "``GetWindowRect`` function retrieves the dimensions of a specified window by " @@ -1880,7 +1882,7 @@ msgid "" "the C declaration::" msgstr "" -#: ../../library/ctypes.rst:1846 +#: ../../library/ctypes.rst:1847 msgid "" "Functions with output parameters will automatically return the output " "parameter value if there is a single one, or a tuple containing the output " @@ -1888,7 +1890,7 @@ msgid "" "now returns a RECT instance, when called." msgstr "" -#: ../../library/ctypes.rst:1851 +#: ../../library/ctypes.rst:1852 msgid "" "Output parameters can be combined with the :attr:`~_FuncPtr.errcheck` " "protocol to do further output processing and error checking. The win32 " @@ -1897,7 +1899,7 @@ msgid "" "exception when the api call failed::" msgstr "" -#: ../../library/ctypes.rst:1864 +#: ../../library/ctypes.rst:1865 msgid "" "If the :attr:`~_FuncPtr.errcheck` function returns the argument tuple it " "receives unchanged, :mod:`ctypes` continues the normal processing it does on " @@ -1906,17 +1908,17 @@ msgid "" "and return them instead, the normal processing will no longer take place::" msgstr "" -#: ../../library/ctypes.rst:1883 +#: ../../library/ctypes.rst:1884 msgid "Utility functions" msgstr "" -#: ../../library/ctypes.rst:1887 +#: ../../library/ctypes.rst:1888 msgid "" "Returns the address of the memory buffer as integer. *obj* must be an " "instance of a ctypes type." msgstr "" -#: ../../library/ctypes.rst:1890 +#: ../../library/ctypes.rst:1891 msgid "" "Raises an :ref:`auditing event ` ``ctypes.addressof`` with " "argument ``obj``." @@ -1924,30 +1926,30 @@ msgstr "" "引發一個附帶引數 ``obj`` 的\\ :ref:`稽核事件 ` ``ctypes." "addressof``。" -#: ../../library/ctypes.rst:1895 +#: ../../library/ctypes.rst:1896 msgid "" "Returns the alignment requirements of a ctypes type. *obj_or_type* must be a " "ctypes type or instance." msgstr "" -#: ../../library/ctypes.rst:1901 +#: ../../library/ctypes.rst:1902 msgid "" "Returns a light-weight pointer to *obj*, which must be an instance of a " "ctypes type. *offset* defaults to zero, and must be an integer that will be " "added to the internal pointer value." msgstr "" -#: ../../library/ctypes.rst:1905 +#: ../../library/ctypes.rst:1906 msgid "``byref(obj, offset)`` corresponds to this C code::" msgstr "" -#: ../../library/ctypes.rst:1909 +#: ../../library/ctypes.rst:1910 msgid "" "The returned object can only be used as a foreign function call parameter. " "It behaves similar to ``pointer(obj)``, but the construction is a lot faster." msgstr "" -#: ../../library/ctypes.rst:1915 +#: ../../library/ctypes.rst:1916 msgid "" "This function is similar to the cast operator in C. It returns a new " "instance of *type* which points to the same memory block as *obj*. *type* " @@ -1955,19 +1957,19 @@ msgid "" "as a pointer." msgstr "" -#: ../../library/ctypes.rst:1923 +#: ../../library/ctypes.rst:1924 msgid "" "This function creates a mutable character buffer. The returned object is a " "ctypes array of :class:`c_char`." msgstr "" -#: ../../library/ctypes.rst:1926 +#: ../../library/ctypes.rst:1927 msgid "" "*init_or_size* must be an integer which specifies the size of the array, or " "a bytes object which will be used to initialize the array items." msgstr "" -#: ../../library/ctypes.rst:1929 +#: ../../library/ctypes.rst:1930 msgid "" "If a bytes object is specified as first argument, the buffer is made one " "item larger than its length so that the last element in the array is a NUL " @@ -1976,7 +1978,7 @@ msgid "" "not be used." msgstr "" -#: ../../library/ctypes.rst:1934 +#: ../../library/ctypes.rst:1935 msgid "" "Raises an :ref:`auditing event ` ``ctypes.create_string_buffer`` " "with arguments ``init``, ``size``." @@ -1984,19 +1986,19 @@ msgstr "" "引發一個附帶引數 ``init`` 與 ``size`` 的\\ :ref:`稽核事件 ` " "``ctypes.create_string_buffer``。" -#: ../../library/ctypes.rst:1939 +#: ../../library/ctypes.rst:1940 msgid "" "This function creates a mutable unicode character buffer. The returned " "object is a ctypes array of :class:`c_wchar`." msgstr "" -#: ../../library/ctypes.rst:1942 +#: ../../library/ctypes.rst:1943 msgid "" "*init_or_size* must be an integer which specifies the size of the array, or " "a string which will be used to initialize the array items." msgstr "" -#: ../../library/ctypes.rst:1945 +#: ../../library/ctypes.rst:1946 msgid "" "If a string is specified as first argument, the buffer is made one item " "larger than the length of the string so that the last element in the array " @@ -2005,7 +2007,7 @@ msgid "" "should not be used." msgstr "" -#: ../../library/ctypes.rst:1951 +#: ../../library/ctypes.rst:1952 msgid "" "Raises an :ref:`auditing event ` ``ctypes.create_unicode_buffer`` " "with arguments ``init``, ``size``." @@ -2013,21 +2015,21 @@ msgstr "" "引發一個附帶引數 ``init`` 與 ``size`` 的\\ :ref:`稽核事件 ` " "``ctypes.create_unicode_buffer``。" -#: ../../library/ctypes.rst:1956 +#: ../../library/ctypes.rst:1957 msgid "" "Windows only: This function is a hook which allows implementing in-process " "COM servers with ctypes. It is called from the DllCanUnloadNow function " "that the _ctypes extension dll exports." msgstr "" -#: ../../library/ctypes.rst:1963 +#: ../../library/ctypes.rst:1964 msgid "" "Windows only: This function is a hook which allows implementing in-process " "COM servers with ctypes. It is called from the DllGetClassObject function " "that the ``_ctypes`` extension dll exports." msgstr "" -#: ../../library/ctypes.rst:1971 +#: ../../library/ctypes.rst:1972 msgid "" "Try to find a library and return a pathname. *name* is the library name " "without any prefix like ``lib``, suffix like ``.so``, ``.dylib`` or version " @@ -2035,94 +2037,94 @@ msgid "" "If no library can be found, returns ``None``." msgstr "" -#: ../../library/ctypes.rst:1982 +#: ../../library/ctypes.rst:1983 msgid "" "Windows only: return the filename of the VC runtime library used by Python, " "and by the extension modules. If the name of the library cannot be " "determined, ``None`` is returned." msgstr "" -#: ../../library/ctypes.rst:1986 +#: ../../library/ctypes.rst:1987 msgid "" "If you need to free memory, for example, allocated by an extension module " "with a call to the ``free(void *)``, it is important that you use the " "function in the same library that allocated the memory." msgstr "" -#: ../../library/ctypes.rst:1993 +#: ../../library/ctypes.rst:1994 msgid "" "Windows only: Returns a textual description of the error code *code*. If no " "error code is specified, the last error code is used by calling the Windows " "api function GetLastError." msgstr "" -#: ../../library/ctypes.rst:2000 +#: ../../library/ctypes.rst:2001 msgid "" "Windows only: Returns the last error code set by Windows in the calling " "thread. This function calls the Windows ``GetLastError()`` function " "directly, it does not return the ctypes-private copy of the error code." msgstr "" -#: ../../library/ctypes.rst:2006 +#: ../../library/ctypes.rst:2007 msgid "" "Returns the current value of the ctypes-private copy of the system :data:" "`errno` variable in the calling thread." msgstr "" -#: ../../library/ctypes.rst:2009 +#: ../../library/ctypes.rst:2010 msgid "" "Raises an :ref:`auditing event ` ``ctypes.get_errno`` with no " "arguments." msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``ctypes.get_errno``。" -#: ../../library/ctypes.rst:2013 +#: ../../library/ctypes.rst:2014 msgid "" "Windows only: returns the current value of the ctypes-private copy of the " "system :data:`!LastError` variable in the calling thread." msgstr "" -#: ../../library/ctypes.rst:2016 +#: ../../library/ctypes.rst:2017 msgid "" "Raises an :ref:`auditing event ` ``ctypes.get_last_error`` with no " "arguments." msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``ctypes.get_last_error``。" -#: ../../library/ctypes.rst:2020 +#: ../../library/ctypes.rst:2021 msgid "" "Same as the standard C memmove library function: copies *count* bytes from " "*src* to *dst*. *dst* and *src* must be integers or ctypes instances that " "can be converted to pointers." msgstr "" -#: ../../library/ctypes.rst:2027 +#: ../../library/ctypes.rst:2028 msgid "" "Same as the standard C memset library function: fills the memory block at " "address *dst* with *count* bytes of value *c*. *dst* must be an integer " "specifying an address, or a ctypes instance." msgstr "" -#: ../../library/ctypes.rst:2034 +#: ../../library/ctypes.rst:2035 msgid "" "Create and return a new ctypes pointer type. Pointer types are cached and " "reused internally, so calling this function repeatedly is cheap. *type* must " "be a ctypes type." msgstr "" -#: ../../library/ctypes.rst:2041 +#: ../../library/ctypes.rst:2042 msgid "" "Create a new pointer instance, pointing to *obj*. The returned object is of " "the type ``POINTER(type(obj))``." msgstr "" -#: ../../library/ctypes.rst:2044 +#: ../../library/ctypes.rst:2045 msgid "" "Note: If you just want to pass a pointer to an object to a foreign function " "call, you should use ``byref(obj)`` which is much faster." msgstr "" -#: ../../library/ctypes.rst:2050 +#: ../../library/ctypes.rst:2051 msgid "" "This function resizes the internal memory buffer of *obj*, which must be an " "instance of a ctypes type. It is not possible to make the buffer smaller " @@ -2130,13 +2132,13 @@ msgid "" "but it is possible to enlarge the buffer." msgstr "" -#: ../../library/ctypes.rst:2058 +#: ../../library/ctypes.rst:2059 msgid "" "Set the current value of the ctypes-private copy of the system :data:`errno` " "variable in the calling thread to *value* and return the previous value." msgstr "" -#: ../../library/ctypes.rst:2061 +#: ../../library/ctypes.rst:2062 msgid "" "Raises an :ref:`auditing event ` ``ctypes.set_errno`` with " "argument ``errno``." @@ -2144,14 +2146,14 @@ msgstr "" "引發一個附帶引數 ``errno`` 的\\ :ref:`稽核事件 ` ``ctypes." "set_errno``。" -#: ../../library/ctypes.rst:2066 +#: ../../library/ctypes.rst:2067 msgid "" "Windows only: set the current value of the ctypes-private copy of the " "system :data:`!LastError` variable in the calling thread to *value* and " "return the previous value." msgstr "" -#: ../../library/ctypes.rst:2070 +#: ../../library/ctypes.rst:2071 msgid "" "Raises an :ref:`auditing event ` ``ctypes.set_last_error`` with " "argument ``error``." @@ -2159,20 +2161,20 @@ msgstr "" "引發一個附帶引數 ``error`` 的\\ :ref:`稽核事件 ` ``ctypes." "get_last_error``。" -#: ../../library/ctypes.rst:2075 +#: ../../library/ctypes.rst:2076 msgid "" "Returns the size in bytes of a ctypes type or instance memory buffer. Does " "the same as the C ``sizeof`` operator." msgstr "" -#: ../../library/ctypes.rst:2081 +#: ../../library/ctypes.rst:2082 msgid "" "This function returns the C string starting at memory address *address* as a " "bytes object. If size is specified, it is used as size, otherwise the string " "is assumed to be zero-terminated." msgstr "" -#: ../../library/ctypes.rst:2085 +#: ../../library/ctypes.rst:2086 msgid "" "Raises an :ref:`auditing event ` ``ctypes.string_at`` with " "arguments ``address``, ``size``." @@ -2180,20 +2182,22 @@ msgstr "" "引發一個附帶引數 ``error``、``size`` 的\\ :ref:`稽核事件 ` " "``ctypes.string_at``。" -#: ../../library/ctypes.rst:2090 +#: ../../library/ctypes.rst:2091 msgid "" "Windows only: this function is probably the worst-named thing in ctypes. It " -"creates an instance of OSError. If *code* is not specified, " +"creates an instance of :exc:`OSError`. If *code* is not specified, " "``GetLastError`` is called to determine the error code. If *descr* is not " "specified, :func:`FormatError` is called to get a textual description of the " "error." msgstr "" -#: ../../library/ctypes.rst:2096 -msgid "An instance of :exc:`WindowsError` used to be created." +#: ../../library/ctypes.rst:2097 +msgid "" +"An instance of :exc:`WindowsError` used to be created, which is now an alias " +"of :exc:`OSError`." msgstr "" -#: ../../library/ctypes.rst:2102 +#: ../../library/ctypes.rst:2104 msgid "" "This function returns the wide character string starting at memory address " "*address* as a string. If *size* is specified, it is used as the number of " @@ -2201,7 +2205,7 @@ msgid "" "terminated." msgstr "" -#: ../../library/ctypes.rst:2107 +#: ../../library/ctypes.rst:2109 msgid "" "Raises an :ref:`auditing event ` ``ctypes.wstring_at`` with " "arguments ``address``, ``size``." @@ -2209,11 +2213,11 @@ msgstr "" "引發一個附帶引數 ``address``、``size`` 的\\ :ref:`稽核事件 ` " "``ctypes.wstring_at``。" -#: ../../library/ctypes.rst:2113 +#: ../../library/ctypes.rst:2115 msgid "Data types" msgstr "" -#: ../../library/ctypes.rst:2118 +#: ../../library/ctypes.rst:2120 msgid "" "This non-public class is the common base class of all ctypes data types. " "Among other things, all ctypes type instances contain a memory block that " @@ -2223,13 +2227,13 @@ msgid "" "alive in case the memory block contains pointers." msgstr "" -#: ../../library/ctypes.rst:2125 +#: ../../library/ctypes.rst:2127 msgid "" "Common methods of ctypes data types, these are all class methods (to be " "exact, they are methods of the :term:`metaclass`):" msgstr "" -#: ../../library/ctypes.rst:2130 +#: ../../library/ctypes.rst:2132 msgid "" "This method returns a ctypes instance that shares the buffer of the *source* " "object. The *source* object must support the writeable buffer interface. " @@ -2238,7 +2242,7 @@ msgid "" "exc:`ValueError` is raised." msgstr "" -#: ../../library/ctypes.rst:2136 ../../library/ctypes.rst:2146 +#: ../../library/ctypes.rst:2138 ../../library/ctypes.rst:2148 msgid "" "Raises an :ref:`auditing event ` ``ctypes.cdata/buffer`` with " "arguments ``pointer``, ``size``, ``offset``." @@ -2246,7 +2250,7 @@ msgstr "" "引發一個附帶引數 ``pointer``、``size``、``offset`` 的\\ :ref:`稽核事件 " "` ``ctypes.cdata/buffer``。" -#: ../../library/ctypes.rst:2140 +#: ../../library/ctypes.rst:2142 msgid "" "This method creates a ctypes instance, copying the buffer from the *source* " "object buffer which must be readable. The optional *offset* parameter " @@ -2254,13 +2258,13 @@ msgid "" "If the source buffer is not large enough a :exc:`ValueError` is raised." msgstr "" -#: ../../library/ctypes.rst:2150 +#: ../../library/ctypes.rst:2152 msgid "" "This method returns a ctypes type instance using the memory specified by " "*address* which must be an integer." msgstr "" -#: ../../library/ctypes.rst:2153 +#: ../../library/ctypes.rst:2155 msgid "" "Raises an :ref:`auditing event ` ``ctypes.cdata`` with argument " "``address``." @@ -2268,13 +2272,13 @@ msgstr "" "引發一個附帶引數 ``address`` 的\\ :ref:`稽核事件 ` ``ctypes." "cdata``。" -#: ../../library/ctypes.rst:2155 +#: ../../library/ctypes.rst:2157 msgid "" "This method, and others that indirectly call this method, raises an :ref:" "`auditing event ` ``ctypes.cdata`` with argument ``address``." msgstr "" -#: ../../library/ctypes.rst:2161 +#: ../../library/ctypes.rst:2163 msgid "" "This method adapts *obj* to a ctypes type. It is called with the actual " "object used in a foreign function call when the type is present in the " @@ -2282,25 +2286,25 @@ msgid "" "object that can be used as a function call parameter." msgstr "" -#: ../../library/ctypes.rst:2166 +#: ../../library/ctypes.rst:2168 msgid "" "All ctypes data types have a default implementation of this classmethod that " "normally returns *obj* if that is an instance of the type. Some types " "accept other objects as well." msgstr "" -#: ../../library/ctypes.rst:2172 +#: ../../library/ctypes.rst:2174 msgid "" "This method returns a ctypes type instance exported by a shared library. " "*name* is the name of the symbol that exports the data, *library* is the " "loaded shared library." msgstr "" -#: ../../library/ctypes.rst:2176 +#: ../../library/ctypes.rst:2178 msgid "Common instance variables of ctypes data types:" msgstr "" -#: ../../library/ctypes.rst:2180 +#: ../../library/ctypes.rst:2182 msgid "" "Sometimes ctypes data instances do not own the memory block they contain, " "instead they share part of the memory block of a base object. The :attr:" @@ -2308,13 +2312,13 @@ msgid "" "block." msgstr "" -#: ../../library/ctypes.rst:2187 +#: ../../library/ctypes.rst:2189 msgid "" "This read-only variable is true when the ctypes data instance has allocated " "the memory block itself, false otherwise." msgstr "" -#: ../../library/ctypes.rst:2192 +#: ../../library/ctypes.rst:2194 msgid "" "This member is either ``None`` or a dictionary containing Python objects " "that need to be kept alive so that the memory block contents is kept valid. " @@ -2322,7 +2326,7 @@ msgid "" "dictionary." msgstr "" -#: ../../library/ctypes.rst:2205 +#: ../../library/ctypes.rst:2207 msgid "" "This non-public class is the base class of all fundamental ctypes data " "types. It is mentioned here because it contains the common attributes of the " @@ -2331,11 +2335,11 @@ msgid "" "types that are not and do not contain pointers can now be pickled." msgstr "" -#: ../../library/ctypes.rst:2211 +#: ../../library/ctypes.rst:2213 msgid "Instances have a single attribute:" msgstr "" -#: ../../library/ctypes.rst:2215 +#: ../../library/ctypes.rst:2217 msgid "" "This attribute contains the actual value of the instance. For integer and " "pointer types, it is an integer, for character types, it is a single " @@ -2343,7 +2347,7 @@ msgid "" "bytes object or string." msgstr "" -#: ../../library/ctypes.rst:2220 +#: ../../library/ctypes.rst:2222 msgid "" "When the ``value`` attribute is retrieved from a ctypes instance, usually a " "new object is returned each time. :mod:`ctypes` does *not* implement " @@ -2351,7 +2355,7 @@ msgid "" "true for all other ctypes object instances." msgstr "" -#: ../../library/ctypes.rst:2226 +#: ../../library/ctypes.rst:2228 msgid "" "Fundamental data types, when returned as foreign function call results, or, " "for example, by retrieving structure field members or array items, are " @@ -2361,7 +2365,7 @@ msgid "" "instance." msgstr "" -#: ../../library/ctypes.rst:2234 +#: ../../library/ctypes.rst:2236 msgid "" "Subclasses of fundamental data types do *not* inherit this behavior. So, if " "a foreign functions :attr:`!restype` is a subclass of :class:`c_void_p`, you " @@ -2369,25 +2373,25 @@ msgid "" "you can get the value of the pointer by accessing the ``value`` attribute." msgstr "" -#: ../../library/ctypes.rst:2239 +#: ../../library/ctypes.rst:2241 msgid "These are the fundamental ctypes data types:" msgstr "" -#: ../../library/ctypes.rst:2243 +#: ../../library/ctypes.rst:2245 msgid "" "Represents the C :c:expr:`signed char` datatype, and interprets the value as " "small integer. The constructor accepts an optional integer initializer; no " "overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2250 +#: ../../library/ctypes.rst:2252 msgid "" "Represents the C :c:expr:`char` datatype, and interprets the value as a " "single character. The constructor accepts an optional string initializer, " "the length of the string must be exactly one character." msgstr "" -#: ../../library/ctypes.rst:2257 +#: ../../library/ctypes.rst:2259 msgid "" "Represents the C :c:expr:`char *` datatype when it points to a zero-" "terminated string. For a general character pointer that may also point to " @@ -2395,182 +2399,182 @@ msgid "" "integer address, or a bytes object." msgstr "" -#: ../../library/ctypes.rst:2265 +#: ../../library/ctypes.rst:2267 msgid "" "Represents the C :c:expr:`double` datatype. The constructor accepts an " "optional float initializer." msgstr "" -#: ../../library/ctypes.rst:2271 +#: ../../library/ctypes.rst:2273 msgid "" "Represents the C :c:expr:`long double` datatype. The constructor accepts an " "optional float initializer. On platforms where ``sizeof(long double) == " "sizeof(double)`` it is an alias to :class:`c_double`." msgstr "" -#: ../../library/ctypes.rst:2277 +#: ../../library/ctypes.rst:2279 msgid "" "Represents the C :c:expr:`float` datatype. The constructor accepts an " "optional float initializer." msgstr "" -#: ../../library/ctypes.rst:2283 +#: ../../library/ctypes.rst:2285 msgid "" "Represents the C :c:expr:`signed int` datatype. The constructor accepts an " "optional integer initializer; no overflow checking is done. On platforms " "where ``sizeof(int) == sizeof(long)`` it is an alias to :class:`c_long`." msgstr "" -#: ../../library/ctypes.rst:2290 +#: ../../library/ctypes.rst:2292 msgid "" "Represents the C 8-bit :c:expr:`signed int` datatype. Usually an alias for :" "class:`c_byte`." msgstr "" -#: ../../library/ctypes.rst:2296 +#: ../../library/ctypes.rst:2298 msgid "" "Represents the C 16-bit :c:expr:`signed int` datatype. Usually an alias " "for :class:`c_short`." msgstr "" -#: ../../library/ctypes.rst:2302 +#: ../../library/ctypes.rst:2304 msgid "" "Represents the C 32-bit :c:expr:`signed int` datatype. Usually an alias " "for :class:`c_int`." msgstr "" -#: ../../library/ctypes.rst:2308 +#: ../../library/ctypes.rst:2310 msgid "" "Represents the C 64-bit :c:expr:`signed int` datatype. Usually an alias " "for :class:`c_longlong`." msgstr "" -#: ../../library/ctypes.rst:2314 +#: ../../library/ctypes.rst:2316 msgid "" "Represents the C :c:expr:`signed long` datatype. The constructor accepts an " "optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2320 +#: ../../library/ctypes.rst:2322 msgid "" "Represents the C :c:expr:`signed long long` datatype. The constructor " "accepts an optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2326 +#: ../../library/ctypes.rst:2328 msgid "" "Represents the C :c:expr:`signed short` datatype. The constructor accepts " "an optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2332 +#: ../../library/ctypes.rst:2334 msgid "Represents the C :c:type:`size_t` datatype." msgstr "" -#: ../../library/ctypes.rst:2337 +#: ../../library/ctypes.rst:2339 msgid "Represents the C :c:type:`ssize_t` datatype." msgstr "" -#: ../../library/ctypes.rst:2344 +#: ../../library/ctypes.rst:2346 msgid "Represents the C :c:type:`time_t` datatype." msgstr "" -#: ../../library/ctypes.rst:2351 +#: ../../library/ctypes.rst:2353 msgid "" "Represents the C :c:expr:`unsigned char` datatype, it interprets the value " "as small integer. The constructor accepts an optional integer initializer; " "no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2358 +#: ../../library/ctypes.rst:2360 msgid "" "Represents the C :c:expr:`unsigned int` datatype. The constructor accepts " "an optional integer initializer; no overflow checking is done. On platforms " "where ``sizeof(int) == sizeof(long)`` it is an alias for :class:`c_ulong`." msgstr "" -#: ../../library/ctypes.rst:2365 +#: ../../library/ctypes.rst:2367 msgid "" "Represents the C 8-bit :c:expr:`unsigned int` datatype. Usually an alias " "for :class:`c_ubyte`." msgstr "" -#: ../../library/ctypes.rst:2371 +#: ../../library/ctypes.rst:2373 msgid "" "Represents the C 16-bit :c:expr:`unsigned int` datatype. Usually an alias " "for :class:`c_ushort`." msgstr "" -#: ../../library/ctypes.rst:2377 +#: ../../library/ctypes.rst:2379 msgid "" "Represents the C 32-bit :c:expr:`unsigned int` datatype. Usually an alias " "for :class:`c_uint`." msgstr "" -#: ../../library/ctypes.rst:2383 +#: ../../library/ctypes.rst:2385 msgid "" "Represents the C 64-bit :c:expr:`unsigned int` datatype. Usually an alias " "for :class:`c_ulonglong`." msgstr "" -#: ../../library/ctypes.rst:2389 +#: ../../library/ctypes.rst:2391 msgid "" "Represents the C :c:expr:`unsigned long` datatype. The constructor accepts " "an optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2395 +#: ../../library/ctypes.rst:2397 msgid "" "Represents the C :c:expr:`unsigned long long` datatype. The constructor " "accepts an optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2401 +#: ../../library/ctypes.rst:2403 msgid "" "Represents the C :c:expr:`unsigned short` datatype. The constructor accepts " "an optional integer initializer; no overflow checking is done." msgstr "" -#: ../../library/ctypes.rst:2407 +#: ../../library/ctypes.rst:2409 msgid "" "Represents the C :c:expr:`void *` type. The value is represented as " "integer. The constructor accepts an optional integer initializer." msgstr "" -#: ../../library/ctypes.rst:2413 +#: ../../library/ctypes.rst:2415 msgid "" "Represents the C :c:type:`wchar_t` datatype, and interprets the value as a " "single character unicode string. The constructor accepts an optional string " "initializer, the length of the string must be exactly one character." msgstr "" -#: ../../library/ctypes.rst:2420 +#: ../../library/ctypes.rst:2422 msgid "" "Represents the C :c:expr:`wchar_t *` datatype, which must be a pointer to a " "zero-terminated wide character string. The constructor accepts an integer " "address, or a string." msgstr "" -#: ../../library/ctypes.rst:2427 +#: ../../library/ctypes.rst:2429 msgid "" "Represent the C :c:expr:`bool` datatype (more accurately, :c:expr:`_Bool` " "from C99). Its value can be ``True`` or ``False``, and the constructor " "accepts any object that has a truth value." msgstr "" -#: ../../library/ctypes.rst:2434 +#: ../../library/ctypes.rst:2436 msgid "" "Windows only: Represents a :c:type:`!HRESULT` value, which contains success " "or error information for a function or method call." msgstr "" -#: ../../library/ctypes.rst:2440 +#: ../../library/ctypes.rst:2442 msgid "" "Represents the C :c:expr:`PyObject *` datatype. Calling this without an " "argument creates a ``NULL`` :c:expr:`PyObject *` pointer." msgstr "" -#: ../../library/ctypes.rst:2443 +#: ../../library/ctypes.rst:2445 msgid "" "The :mod:`!ctypes.wintypes` module provides quite some other Windows " "specific data types, for example :c:type:`!HWND`, :c:type:`!WPARAM`, or :c:" @@ -2578,41 +2582,41 @@ msgid "" "are also defined." msgstr "" -#: ../../library/ctypes.rst:2451 +#: ../../library/ctypes.rst:2453 msgid "Structured data types" msgstr "" -#: ../../library/ctypes.rst:2456 +#: ../../library/ctypes.rst:2458 msgid "Abstract base class for unions in native byte order." msgstr "" -#: ../../library/ctypes.rst:2461 +#: ../../library/ctypes.rst:2463 msgid "Abstract base class for unions in *big endian* byte order." msgstr "" -#: ../../library/ctypes.rst:2467 +#: ../../library/ctypes.rst:2469 msgid "Abstract base class for unions in *little endian* byte order." msgstr "" -#: ../../library/ctypes.rst:2473 +#: ../../library/ctypes.rst:2475 msgid "Abstract base class for structures in *big endian* byte order." msgstr "" -#: ../../library/ctypes.rst:2478 +#: ../../library/ctypes.rst:2480 msgid "Abstract base class for structures in *little endian* byte order." msgstr "" -#: ../../library/ctypes.rst:2480 +#: ../../library/ctypes.rst:2482 msgid "" "Structures and unions with non-native byte order cannot contain pointer type " "fields, or any other data types containing pointer type fields." msgstr "" -#: ../../library/ctypes.rst:2486 +#: ../../library/ctypes.rst:2488 msgid "Abstract base class for structures in *native* byte order." msgstr "" -#: ../../library/ctypes.rst:2488 +#: ../../library/ctypes.rst:2490 msgid "" "Concrete structure and union types must be created by subclassing one of " "these types, and at least define a :attr:`_fields_` class variable. :mod:" @@ -2620,34 +2624,34 @@ msgid "" "the fields by direct attribute accesses. These are the" msgstr "" -#: ../../library/ctypes.rst:2496 +#: ../../library/ctypes.rst:2498 msgid "" "A sequence defining the structure fields. The items must be 2-tuples or 3-" "tuples. The first item is the name of the field, the second item specifies " "the type of the field; it can be any ctypes data type." msgstr "" -#: ../../library/ctypes.rst:2500 +#: ../../library/ctypes.rst:2502 msgid "" "For integer type fields like :class:`c_int`, a third optional item can be " "given. It must be a small positive integer defining the bit width of the " "field." msgstr "" -#: ../../library/ctypes.rst:2504 +#: ../../library/ctypes.rst:2506 msgid "" "Field names must be unique within one structure or union. This is not " "checked, only one field can be accessed when names are repeated." msgstr "" -#: ../../library/ctypes.rst:2507 +#: ../../library/ctypes.rst:2509 msgid "" "It is possible to define the :attr:`_fields_` class variable *after* the " "class statement that defines the Structure subclass, this allows creating " "data types that directly or indirectly reference themselves::" msgstr "" -#: ../../library/ctypes.rst:2517 +#: ../../library/ctypes.rst:2519 msgid "" "The :attr:`_fields_` class variable must, however, be defined before the " "type is first used (an instance is created, :func:`sizeof` is called on it, " @@ -2655,14 +2659,14 @@ msgid "" "raise an AttributeError." msgstr "" -#: ../../library/ctypes.rst:2522 +#: ../../library/ctypes.rst:2524 msgid "" "It is possible to define sub-subclasses of structure types, they inherit the " "fields of the base class plus the :attr:`_fields_` defined in the sub-" "subclass, if any." msgstr "" -#: ../../library/ctypes.rst:2529 +#: ../../library/ctypes.rst:2531 msgid "" "An optional small integer that allows overriding the alignment of structure " "fields in the instance. :attr:`_pack_` must already be defined when :attr:" @@ -2670,14 +2674,14 @@ msgid "" "attribute to 0 is the same as not setting it at all." msgstr "" -#: ../../library/ctypes.rst:2537 +#: ../../library/ctypes.rst:2539 msgid "" "An optional sequence that lists the names of unnamed (anonymous) fields. :" "attr:`_anonymous_` must be already defined when :attr:`_fields_` is " "assigned, otherwise it will have no effect." msgstr "" -#: ../../library/ctypes.rst:2541 +#: ../../library/ctypes.rst:2543 msgid "" "The fields listed in this variable must be structure or union type fields. :" "mod:`ctypes` will create descriptors in the structure type that allows " @@ -2685,11 +2689,11 @@ msgid "" "structure or union field." msgstr "" -#: ../../library/ctypes.rst:2546 +#: ../../library/ctypes.rst:2548 msgid "Here is an example type (Windows)::" msgstr "" -#: ../../library/ctypes.rst:2559 +#: ../../library/ctypes.rst:2561 msgid "" "The ``TYPEDESC`` structure describes a COM data type, the ``vt`` field " "specifies which one of the union fields is valid. Since the ``u`` field is " @@ -2699,7 +2703,7 @@ msgid "" "temporary union instance::" msgstr "" -#: ../../library/ctypes.rst:2571 +#: ../../library/ctypes.rst:2573 msgid "" "It is possible to define sub-subclasses of structures, they inherit the " "fields of the base class. If the subclass definition has a separate :attr:" @@ -2707,7 +2711,7 @@ msgid "" "of the base class." msgstr "" -#: ../../library/ctypes.rst:2576 +#: ../../library/ctypes.rst:2578 msgid "" "Structure and union constructors accept both positional and keyword " "arguments. Positional arguments are used to initialize member fields in the " @@ -2717,15 +2721,15 @@ msgid "" "names not present in :attr:`_fields_`." msgstr "" -#: ../../library/ctypes.rst:2587 +#: ../../library/ctypes.rst:2589 msgid "Arrays and pointers" msgstr "" -#: ../../library/ctypes.rst:2591 +#: ../../library/ctypes.rst:2593 msgid "Abstract base class for arrays." msgstr "" -#: ../../library/ctypes.rst:2593 +#: ../../library/ctypes.rst:2595 msgid "" "The recommended way to create concrete array types is by multiplying any :" "mod:`ctypes` data type with a non-negative integer. Alternatively, you can " @@ -2735,34 +2739,34 @@ msgid "" "an :class:`Array`." msgstr "" -#: ../../library/ctypes.rst:2603 +#: ../../library/ctypes.rst:2605 msgid "" "A positive integer specifying the number of elements in the array. Out-of-" "range subscripts result in an :exc:`IndexError`. Will be returned by :func:" "`len`." msgstr "" -#: ../../library/ctypes.rst:2610 +#: ../../library/ctypes.rst:2612 msgid "Specifies the type of each element in the array." msgstr "" -#: ../../library/ctypes.rst:2613 +#: ../../library/ctypes.rst:2615 msgid "" "Array subclass constructors accept positional arguments, used to initialize " "the elements in order." msgstr "" -#: ../../library/ctypes.rst:2619 +#: ../../library/ctypes.rst:2621 msgid "Private, abstract base class for pointers." msgstr "" -#: ../../library/ctypes.rst:2621 +#: ../../library/ctypes.rst:2623 msgid "" "Concrete pointer types are created by calling :func:`POINTER` with the type " "that will be pointed to; this is done automatically by :func:`pointer`." msgstr "" -#: ../../library/ctypes.rst:2625 +#: ../../library/ctypes.rst:2627 msgid "" "If a pointer points to an array, its elements can be read and written using " "standard subscript and slice accesses. Pointer objects have no size, so :" @@ -2771,11 +2775,11 @@ msgid "" "probably crash with an access violation (if you're lucky)." msgstr "" -#: ../../library/ctypes.rst:2635 +#: ../../library/ctypes.rst:2637 msgid "Specifies the type pointed to." msgstr "" -#: ../../library/ctypes.rst:2639 +#: ../../library/ctypes.rst:2641 msgid "" "Returns the object to which to pointer points. Assigning to this attribute " "changes the pointer to point to the assigned object." diff --git a/library/dataclasses.po b/library/dataclasses.po index 4bd6371f89..592d18ef66 100644 --- a/library/dataclasses.po +++ b/library/dataclasses.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-24 00:03+0000\n" +"POT-Creation-Date: 2023-10-12 00:03+0000\n" "PO-Revision-Date: 2023-02-11 15:02+0800\n" "Last-Translator: \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -565,12 +565,12 @@ msgstr "" msgid "``name``: The name of the field." msgstr "``name``:欄位的名稱。" -#: ../../library/dataclasses.rst:324 +#: ../../library/dataclasses.rst:323 #, fuzzy msgid "``type``: The type of the field." msgstr "``type``:欄位的型別。" -#: ../../library/dataclasses.rst:326 +#: ../../library/dataclasses.rst:324 #, fuzzy msgid "" "``default``, ``default_factory``, ``init``, ``repr``, ``hash``, ``compare``, " @@ -580,14 +580,14 @@ msgstr "" "``default``、``default_factory``、``init``、``repr``、``hash``、``compare``、" "``metadata`` 和 ``kw_only`` 有與它們在 :func:`field` 函式中的含義和值相同。" -#: ../../library/dataclasses.rst:330 +#: ../../library/dataclasses.rst:328 #, fuzzy msgid "" "Other attributes may exist, but they are private and must not be inspected " "or relied on." msgstr "可能存在其他屬性,但它們是私有的,不得檢查或依賴。" -#: ../../library/dataclasses.rst:335 +#: ../../library/dataclasses.rst:333 #, fuzzy msgid "" "Returns a tuple of :class:`Field` objects that define the fields for this " @@ -599,7 +599,7 @@ msgstr "" "如果未傳遞資料類或其中一個實例,則引發 :exc:`TypeError`。不回傳 ``ClassVar`` " "或 ``InitVar`` 的偽欄位。" -#: ../../library/dataclasses.rst:342 +#: ../../library/dataclasses.rst:340 #, fuzzy msgid "" "Converts the dataclass ``obj`` to a dict (by using the factory function " @@ -611,24 +611,24 @@ msgstr "" "為其欄位的字典,作為“名稱:值”對。資料類、字典、列表和元組被遞迴到。其他物件" "使用 :func:`copy.deepcopy` 複製。" -#: ../../library/dataclasses.rst:348 +#: ../../library/dataclasses.rst:346 #, fuzzy msgid "Example of using :func:`asdict` on nested dataclasses::" msgstr "在嵌套資料類上使用 :func:`asdict` 的示例::" -#: ../../library/dataclasses.rst:365 ../../library/dataclasses.rst:385 +#: ../../library/dataclasses.rst:363 ../../library/dataclasses.rst:383 #, fuzzy msgid "To create a shallow copy, the following workaround may be used::" msgstr "要建立淺拷貝,可以使用以下解決方法:" -#: ../../library/dataclasses.rst:369 +#: ../../library/dataclasses.rst:367 #, fuzzy msgid "" ":func:`asdict` raises :exc:`TypeError` if ``obj`` is not a dataclass " "instance." msgstr ":func:`asdict` 如果 ``obj`` 不是資料類實例,則引發 :exc:`TypeError`。" -#: ../../library/dataclasses.rst:374 +#: ../../library/dataclasses.rst:372 #, fuzzy msgid "" "Converts the dataclass ``obj`` to a tuple (by using the factory function " @@ -640,19 +640,19 @@ msgstr "" "換為其欄位值的元組。資料類、字典、列表和元組被遞迴到。其他物件使用 :func:" "`copy.deepcopy` 複製。" -#: ../../library/dataclasses.rst:380 +#: ../../library/dataclasses.rst:378 #, fuzzy msgid "Continuing from the previous example::" msgstr "從前面的例子繼續:" -#: ../../library/dataclasses.rst:389 +#: ../../library/dataclasses.rst:387 #, fuzzy msgid "" ":func:`astuple` raises :exc:`TypeError` if ``obj`` is not a dataclass " "instance." msgstr ":func:`astuple` 如果 ``obj`` 不是資料類實例,則引發 :exc:`TypeError`。" -#: ../../library/dataclasses.rst:394 +#: ../../library/dataclasses.rst:392 #, fuzzy msgid "" "Creates a new dataclass with name ``cls_name``, fields as defined in " @@ -671,13 +671,13 @@ msgstr "" "``order``、``unsafe_hash``、``frozen``、``match_args``、``kw_only`` 的值, " "``slots`` 和 ``weakref_slot`` 與它們在 :func:`dataclass` 中的含義相同。" -#: ../../library/dataclasses.rst:404 +#: ../../library/dataclasses.rst:402 msgid "" "If ``module`` is defined, the ``__module__`` attribute of the dataclass is " "set to that value. By default, it is set to the module name of the caller." msgstr "" -#: ../../library/dataclasses.rst:408 +#: ../../library/dataclasses.rst:406 #, fuzzy msgid "" "This function is not strictly required, because any Python mechanism for " @@ -689,12 +689,12 @@ msgstr "" "制都可以應用 :func:`dataclass` 函式將該類轉換為資料類。提供此功能是為了方便。" "例如::" -#: ../../library/dataclasses.rst:420 +#: ../../library/dataclasses.rst:418 #, fuzzy msgid "Is equivalent to::" msgstr "相當於::" -#: ../../library/dataclasses.rst:433 +#: ../../library/dataclasses.rst:431 #, fuzzy msgid "" "Creates a new object of the same type as ``obj``, replacing fields with " @@ -706,7 +706,7 @@ msgstr "" "``obj`` 不是資料類,則引發 :exc:`TypeError`。如果 ``changes`` 中的值未指定欄" "位,則引發:exc:`TypeError`。" -#: ../../library/dataclasses.rst:438 +#: ../../library/dataclasses.rst:436 #, fuzzy msgid "" "The newly returned object is created by calling the :meth:`~object.__init__` " @@ -716,7 +716,7 @@ msgstr "" "新回傳的對像是通過呼叫資料類的 :meth:`__init__` 方法建立的。這確保 :meth:" "`__post_init__`(如果存在)也被呼叫。" -#: ../../library/dataclasses.rst:442 +#: ../../library/dataclasses.rst:440 #, fuzzy msgid "" "Init-only variables without default values, if any exist, must be specified " @@ -726,7 +726,7 @@ msgstr "" "沒有預設值的僅初始化變數(如果存在)必須在呼叫 :func:`replace` 時指定,以便它" "們可以傳遞給 :meth:`__init__` 和 :meth:`__post_init__`。" -#: ../../library/dataclasses.rst:446 +#: ../../library/dataclasses.rst:444 #, fuzzy msgid "" "It is an error for ``changes`` to contain any fields that are defined as " @@ -735,7 +735,7 @@ msgstr "" "``changes`` 包含任何定義為具有 ``init=False`` 的欄位是錯誤的。在這種情況下將" "引發 :exc:`ValueError`。" -#: ../../library/dataclasses.rst:450 +#: ../../library/dataclasses.rst:448 #, fuzzy msgid "" "Be forewarned about how ``init=False`` fields work during a call to :func:" @@ -752,14 +752,14 @@ msgstr "" "造函式可能是明智的,或者可能是處理實例複製的自定義“replace()”(或類似命名的)" "方法。" -#: ../../library/dataclasses.rst:461 +#: ../../library/dataclasses.rst:459 #, fuzzy msgid "" "Return ``True`` if its parameter is a dataclass or an instance of one, " "otherwise return ``False``." msgstr "如果它的參數是一個資料類或一個實例,則回傳“True”,否則回傳“False”。" -#: ../../library/dataclasses.rst:464 +#: ../../library/dataclasses.rst:462 #, fuzzy msgid "" "If you need to know if a class is an instance of a dataclass (and not a " @@ -769,12 +769,12 @@ msgstr "" "如果你需要知道一個類是否是資料類的實例(而不是資料類本身),那麼新增一個進一" "步的檢查``not isinstance(obj, type)``::" -#: ../../library/dataclasses.rst:473 +#: ../../library/dataclasses.rst:471 #, fuzzy msgid "A sentinel value signifying a missing default or default_factory." msgstr "表示缺少預設值或 default_factory 的標記值。" -#: ../../library/dataclasses.rst:477 +#: ../../library/dataclasses.rst:475 #, fuzzy msgid "" "A sentinel value used as a type annotation. Any fields after a pseudo-field " @@ -790,21 +790,21 @@ msgstr "" "例,名稱 _ 用於 :const: `KW_ONLY` 欄位。僅關鍵字欄位表示 :meth:`__init__` 參" "數,在實例化類時必須將其指定為關鍵字。" -#: ../../library/dataclasses.rst:486 +#: ../../library/dataclasses.rst:484 #, fuzzy msgid "" "In this example, the fields ``y`` and ``z`` will be marked as keyword-only " "fields::" msgstr "在此示例中,欄位 ``y`` 和 ``z`` 將被標記為僅關鍵字欄位::" -#: ../../library/dataclasses.rst:497 +#: ../../library/dataclasses.rst:495 #, fuzzy msgid "" "In a single dataclass, it is an error to specify more than one field whose " "type is :const:`KW_ONLY`." msgstr "在單個資料類中,指定多個型別為 KW_ONLY 的欄位是錯誤的。" -#: ../../library/dataclasses.rst:504 +#: ../../library/dataclasses.rst:502 #, fuzzy msgid "" "Raised when an implicitly defined :meth:`~object.__setattr__` or :meth:" @@ -814,12 +814,12 @@ msgstr "" "當在使用 frozen=True 定義的資料類上呼叫隱式定義的 :meth:`__setattr__` 或 :" "meth:`__delattr__` 時引發。它是 :exc:`AttributeError` 的子類別。" -#: ../../library/dataclasses.rst:511 +#: ../../library/dataclasses.rst:509 #, fuzzy msgid "Post-init processing" msgstr "初始化後處理" -#: ../../library/dataclasses.rst:515 +#: ../../library/dataclasses.rst:513 #, fuzzy msgid "" "When defined on the class, it will be called by the generated :meth:`~object." @@ -834,7 +834,7 @@ msgstr "" "類中定義的順序傳遞給 :meth:`__post_init__` 。如果沒有生成 :meth:`__init__` 方" "法,那麼 :meth:`__post_init__` 將不會被自動呼叫。" -#: ../../library/dataclasses.rst:522 +#: ../../library/dataclasses.rst:520 #, fuzzy msgid "" "Among other uses, this allows for initializing field values that depend on " @@ -843,7 +843,7 @@ msgstr "" "在其他用途\\u200b\\u200b中,這允許初始化依賴於一個或多個其他欄位的欄位值。例" "如::" -#: ../../library/dataclasses.rst:534 +#: ../../library/dataclasses.rst:532 #, fuzzy msgid "" "The :meth:`~object.__init__` method generated by :func:`dataclass` does not " @@ -855,7 +855,7 @@ msgstr "" "方法。如果基底類別有一個必須呼叫的 :meth:`__init__` 方法,通常在 :meth:" "`__post_init__` 方法中呼叫此方法::" -#: ../../library/dataclasses.rst:551 +#: ../../library/dataclasses.rst:549 #, fuzzy msgid "" "Note, however, that in general the dataclass-generated :meth:`~object." @@ -866,7 +866,7 @@ msgstr "" "但是請注意,通常不需要呼叫資料類生成的 :meth:`__init__` 方法,因為派生資料類" "將負責初始化作為資料類本身的任何基底類別的所有欄位。" -#: ../../library/dataclasses.rst:555 +#: ../../library/dataclasses.rst:553 #, fuzzy msgid "" "See the section below on init-only variables for ways to pass parameters to :" @@ -876,12 +876,12 @@ msgstr "" "請參閱下面有關僅初始化變數的部分,了解將參數傳遞給 :meth:`__post_init__` 的方" "法。另請參閱有關 :func:`replace` 如何處理 ``init=False`` 欄位的警告。" -#: ../../library/dataclasses.rst:560 +#: ../../library/dataclasses.rst:558 #, fuzzy msgid "Class variables" msgstr "類變數" -#: ../../library/dataclasses.rst:562 +#: ../../library/dataclasses.rst:560 #, fuzzy msgid "" "One of the few places where :func:`dataclass` actually inspects the type of " @@ -896,12 +896,12 @@ msgstr "" "一個欄位是一個“ClassVar”,它就被排除在考慮之外,並被資料類機制忽略。模組級 :" "func:`fields` 函式不會回傳此類 ``ClassVar`` 偽欄位。" -#: ../../library/dataclasses.rst:571 +#: ../../library/dataclasses.rst:569 #, fuzzy msgid "Init-only variables" msgstr "僅初始化變數" -#: ../../library/dataclasses.rst:573 +#: ../../library/dataclasses.rst:571 #, fuzzy msgid "" "Another place where :func:`dataclass` inspects a type annotation is to " @@ -920,14 +920,14 @@ msgstr "" "meth:`__init__` 方法,並傳遞給可選的 :meth:`__post_init__` 方法。它們不被資料" "類使用。" -#: ../../library/dataclasses.rst:583 +#: ../../library/dataclasses.rst:581 #, fuzzy msgid "" "For example, suppose a field will be initialized from a database, if a value " "is not provided when creating the class::" msgstr "例如,假設一個欄位將從資料庫中初始化,如果在建立類時沒有提供值::" -#: ../../library/dataclasses.rst:598 +#: ../../library/dataclasses.rst:596 #, fuzzy msgid "" "In this case, :func:`fields` will return :class:`Field` objects for ``i`` " @@ -936,12 +936,12 @@ msgstr "" "在這種情況下,:func:`fields` 將為 ``i`` 和 ``j`` 回傳 :class:`Field` 物件,但" "不會為 ``database`` 回傳。" -#: ../../library/dataclasses.rst:602 +#: ../../library/dataclasses.rst:600 #, fuzzy msgid "Frozen instances" msgstr "凍結實例" -#: ../../library/dataclasses.rst:604 +#: ../../library/dataclasses.rst:602 #, fuzzy msgid "" "It is not possible to create truly immutable Python objects. However, by " @@ -955,7 +955,7 @@ msgstr "" "meth:`__setattr__` 和 :meth:`__delattr__` 方法。這些方法在呼叫時會引發:exc:" "`FrozenInstanceError`。" -#: ../../library/dataclasses.rst:610 +#: ../../library/dataclasses.rst:608 #, fuzzy msgid "" "There is a tiny performance penalty when using ``frozen=True``: :meth:" @@ -965,12 +965,12 @@ msgstr "" "使用 ``frozen=True`` 時有一個微小的性能損失::meth:`__init__` 不能使用簡單賦" "值來初始化欄位,必須使用 :meth:`object.__setattr__`。" -#: ../../library/dataclasses.rst:615 +#: ../../library/dataclasses.rst:613 #, fuzzy msgid "Inheritance" msgstr "遺產" -#: ../../library/dataclasses.rst:617 +#: ../../library/dataclasses.rst:615 #, fuzzy msgid "" "When the dataclass is being created by the :meth:`dataclass` decorator, it " @@ -988,7 +988,7 @@ msgstr "" "增到有序映射中。所有生成的方法都將使用這種組合的、計算的有序欄位映射。因為欄" "位是按插入順序排列的,所以派生類會覆蓋基底類別。一個例子::" -#: ../../library/dataclasses.rst:637 +#: ../../library/dataclasses.rst:635 #, fuzzy msgid "" "The final list of fields is, in order, ``x``, ``y``, ``z``. The final type " @@ -997,18 +997,18 @@ msgstr "" "最終的欄位列表按順序為“x”、“y”、“z”。 ``x`` 的最終型別是 ``int``,如類 ``C`` " "中指定的那樣。" -#: ../../library/dataclasses.rst:640 +#: ../../library/dataclasses.rst:638 #, fuzzy msgid "" "The generated :meth:`~object.__init__` method for ``C`` will look like::" msgstr "為 ``C`` 生成的 :meth:`__init__` 方法將如下所示:" -#: ../../library/dataclasses.rst:645 +#: ../../library/dataclasses.rst:643 #, fuzzy msgid "Re-ordering of keyword-only parameters in :meth:`~object.__init__`" msgstr ":meth:`__init__` 中僅關鍵字參數的重新排序" -#: ../../library/dataclasses.rst:647 +#: ../../library/dataclasses.rst:645 #, fuzzy msgid "" "After the parameters needed for :meth:`~object.__init__` are computed, any " @@ -1020,7 +1020,7 @@ msgstr "" "僅關鍵字)參數之後。這是如何在 Python 中實作僅關鍵字參數的要求:它們必須位於" "非僅關鍵字參數之後。" -#: ../../library/dataclasses.rst:653 +#: ../../library/dataclasses.rst:651 #, fuzzy msgid "" "In this example, ``Base.y``, ``Base.w``, and ``D.t`` are keyword-only " @@ -1029,13 +1029,13 @@ msgstr "" "在此示例中,``Base.y``、``Base.w`` 和``D.t`` 是僅限關鍵字的欄位,``Base.x`` " "和``D.z`` 是常規欄位: :" -#: ../../library/dataclasses.rst:668 +#: ../../library/dataclasses.rst:666 #, fuzzy msgid "" "The generated :meth:`~object.__init__` method for ``D`` will look like::" msgstr "為 ``D`` 生成的 :meth:`__init__` 方法將如下所示:" -#: ../../library/dataclasses.rst:672 +#: ../../library/dataclasses.rst:670 #, fuzzy msgid "" "Note that the parameters have been re-ordered from how they appear in the " @@ -1045,19 +1045,19 @@ msgstr "" "請注意,參數已根據它們在欄位列表中的顯示方式重新排序:從常規欄位派生的參數後" "跟從僅關鍵字欄位派生的參數。" -#: ../../library/dataclasses.rst:676 +#: ../../library/dataclasses.rst:674 #, fuzzy msgid "" "The relative ordering of keyword-only parameters is maintained in the re-" "ordered :meth:`~object.__init__` parameter list." msgstr "僅關鍵字參數的相對順序在重新排序的 :meth:`__init__` 參數列表中維護。" -#: ../../library/dataclasses.rst:681 +#: ../../library/dataclasses.rst:679 #, fuzzy msgid "Default factory functions" msgstr "預設工廠函式" -#: ../../library/dataclasses.rst:683 +#: ../../library/dataclasses.rst:681 #, fuzzy msgid "" "If a :func:`field` specifies a ``default_factory``, it is called with zero " @@ -1067,7 +1067,7 @@ msgstr "" "如果 :func:`field` 指定了 ``default_factory``,當需要該欄位的預設值時,它會以" "零參數呼叫。例如,要建立列表的新實例,請使用:" -#: ../../library/dataclasses.rst:689 +#: ../../library/dataclasses.rst:687 #, fuzzy msgid "" "If a field is excluded from :meth:`~object.__init__` (using ``init=False``) " @@ -1080,35 +1080,35 @@ msgstr "" "了 ``default_factory``,那麼預設工廠函式將始終從生成的 :meth:`__init__ 中呼叫" "`功能。發生這種情況是因為沒有其他方法可以為該欄位賦予初始值。" -#: ../../library/dataclasses.rst:696 +#: ../../library/dataclasses.rst:694 #, fuzzy msgid "Mutable default values" msgstr "可變預設值" -#: ../../library/dataclasses.rst:698 +#: ../../library/dataclasses.rst:696 #, fuzzy msgid "" "Python stores default member variable values in class attributes. Consider " "this example, not using dataclasses::" msgstr "Python 將預設成員變數值存儲在類屬性中。考慮這個例子,不使用資料類::" -#: ../../library/dataclasses.rst:713 +#: ../../library/dataclasses.rst:711 #, fuzzy msgid "" "Note that the two instances of class ``C`` share the same class variable " "``x``, as expected." msgstr "請注意,類“C”的兩個實例共享同一個類變數“x”,正如預期的那樣。" -#: ../../library/dataclasses.rst:716 +#: ../../library/dataclasses.rst:714 #, fuzzy msgid "Using dataclasses, *if* this code was valid::" msgstr "使用資料類,*如果*此程式碼有效::" -#: ../../library/dataclasses.rst:724 +#: ../../library/dataclasses.rst:722 msgid "it would generate code similar to::" msgstr "它會生成類似的程式碼::" -#: ../../library/dataclasses.rst:735 +#: ../../library/dataclasses.rst:733 #, fuzzy msgid "" "This has the same issue as the original example using class ``C``. That is, " @@ -1128,14 +1128,14 @@ msgstr "" "`TypeError`。假設是如果一個值是不可散列的,那麼它就是可變的。這是一個部分解決" "方案,但它確實可以防止許多常見錯誤。" -#: ../../library/dataclasses.rst:746 +#: ../../library/dataclasses.rst:744 #, fuzzy msgid "" "Using default factory functions is a way to create new instances of mutable " "types as default values for fields::" msgstr "使用預設工廠函式是一種建立可變型別的新實例作為欄位預設值的方法:" -#: ../../library/dataclasses.rst:755 +#: ../../library/dataclasses.rst:753 #, fuzzy msgid "" "Instead of looking for and disallowing objects of type ``list``, ``dict``, " @@ -1145,12 +1145,12 @@ msgstr "" "不再查找和禁止型別為“list”、“dict”或“set”的物件,現在不允許使用不可散列的對像" "作為預設值。不可散列性用於近似可變性。" -#: ../../library/dataclasses.rst:762 +#: ../../library/dataclasses.rst:760 #, fuzzy msgid "Descriptor-typed fields" msgstr "描述器型別的欄位" -#: ../../library/dataclasses.rst:764 +#: ../../library/dataclasses.rst:762 #, fuzzy msgid "" "Fields that are assigned :ref:`descriptor objects ` as their " @@ -1159,7 +1159,7 @@ msgstr "" "指定為 :ref:`descriptor objects ` 作為預設值的欄位具有以下特殊行" "為:" -#: ../../library/dataclasses.rst:767 +#: ../../library/dataclasses.rst:765 #, fuzzy msgid "" "The value for the field passed to the dataclass's ``__init__`` method is " @@ -1169,7 +1169,7 @@ msgstr "" "傳遞給資料類的“__init__”方法的欄位值被傳遞給描述器的“__set__”方法,而不是覆蓋" "描述器物件。" -#: ../../library/dataclasses.rst:770 +#: ../../library/dataclasses.rst:768 #, fuzzy msgid "" "Similarly, when getting or setting the field, the descriptor's ``__get__`` " @@ -1179,7 +1179,7 @@ msgstr "" "同樣,在獲取或設定欄位時,將呼叫描述器的“__get__”或“__set__”方法,而不是回傳" "或覆蓋描述器物件。" -#: ../../library/dataclasses.rst:773 +#: ../../library/dataclasses.rst:771 #, fuzzy msgid "" "To determine whether a field contains a default value, ``dataclasses`` will " @@ -1194,7 +1194,7 @@ msgstr "" "情況下,描述器回傳一個值,它將用作欄位的預設值。另一方面,如果描述器在這種情" "況下引發 :exc:`AttributeError`,則不會為該欄位提供預設值。" -#: ../../library/dataclasses.rst:808 +#: ../../library/dataclasses.rst:806 #, fuzzy msgid "" "Note that if a field is annotated with a descriptor type, but is not " diff --git a/library/devmode.po b/library/devmode.po index afd4426b90..f5b9098f1f 100644 --- a/library/devmode.po +++ b/library/devmode.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+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-" @@ -134,54 +134,55 @@ msgstr "" #: ../../library/devmode.rst:61 msgid "" "Call :func:`faulthandler.enable` at Python startup to install handlers for " -"the :const:`SIGSEGV`, :const:`SIGFPE`, :const:`SIGABRT`, :const:`SIGBUS` " -"and :const:`SIGILL` signals to dump the Python traceback on a crash." +"the :const:`~signal.SIGSEGV`, :const:`~signal.SIGFPE`, :const:`~signal." +"SIGABRT`, :const:`~signal.SIGBUS` and :const:`~signal.SIGILL` signals to " +"dump the Python traceback on a crash." msgstr "" -#: ../../library/devmode.rst:65 +#: ../../library/devmode.rst:66 msgid "" "It behaves as if the :option:`-X faulthandler <-X>` command line option is " "used or if the :envvar:`PYTHONFAULTHANDLER` environment variable is set to " "``1``." msgstr "" -#: ../../library/devmode.rst:69 +#: ../../library/devmode.rst:70 msgid "" "Enable :ref:`asyncio debug mode `. For example, :mod:" "`asyncio` checks for coroutines that were not awaited and logs them." msgstr "" -#: ../../library/devmode.rst:72 +#: ../../library/devmode.rst:73 msgid "" "It behaves as if the :envvar:`PYTHONASYNCIODEBUG` environment variable is " "set to ``1``." msgstr "" -#: ../../library/devmode.rst:75 +#: ../../library/devmode.rst:76 msgid "" "Check the *encoding* and *errors* arguments for string encoding and decoding " "operations. Examples: :func:`open`, :meth:`str.encode` and :meth:`bytes." "decode`." msgstr "" -#: ../../library/devmode.rst:79 +#: ../../library/devmode.rst:80 msgid "" "By default, for best performance, the *errors* argument is only checked at " "the first encoding/decoding error and the *encoding* argument is sometimes " "ignored for empty strings." msgstr "" -#: ../../library/devmode.rst:83 +#: ../../library/devmode.rst:84 msgid "The :class:`io.IOBase` destructor logs ``close()`` exceptions." msgstr "" -#: ../../library/devmode.rst:84 +#: ../../library/devmode.rst:85 msgid "" "Set the :attr:`~sys.flags.dev_mode` attribute of :data:`sys.flags` to " "``True``." msgstr "" -#: ../../library/devmode.rst:87 +#: ../../library/devmode.rst:88 msgid "" "The Python Development Mode does not enable the :mod:`tracemalloc` module by " "default, because the overhead cost (to performance and memory) would be too " @@ -192,63 +193,63 @@ msgid "" "allocated." msgstr "" -#: ../../library/devmode.rst:94 +#: ../../library/devmode.rst:95 msgid "" "The Python Development Mode does not prevent the :option:`-O` command line " "option from removing :keyword:`assert` statements nor from setting :const:" "`__debug__` to ``False``." msgstr "" -#: ../../library/devmode.rst:98 +#: ../../library/devmode.rst:99 msgid "" "The Python Development Mode can only be enabled at the Python startup. Its " "value can be read from :data:`sys.flags.dev_mode `." msgstr "" -#: ../../library/devmode.rst:101 +#: ../../library/devmode.rst:102 msgid "The :class:`io.IOBase` destructor now logs ``close()`` exceptions." msgstr "" -#: ../../library/devmode.rst:104 +#: ../../library/devmode.rst:105 msgid "" "The *encoding* and *errors* arguments are now checked for string encoding " "and decoding operations." msgstr "" -#: ../../library/devmode.rst:110 +#: ../../library/devmode.rst:111 msgid "ResourceWarning Example" msgstr "ResourceWarning 範例" -#: ../../library/devmode.rst:112 +#: ../../library/devmode.rst:113 msgid "" "Example of a script counting the number of lines of the text file specified " "in the command line::" msgstr "" -#: ../../library/devmode.rst:126 +#: ../../library/devmode.rst:127 msgid "" "The script does not close the file explicitly. By default, Python does not " "emit any warning. Example using README.txt, which has 269 lines:" msgstr "" -#: ../../library/devmode.rst:134 +#: ../../library/devmode.rst:135 msgid "" "Enabling the Python Development Mode displays a :exc:`ResourceWarning` " "warning:" msgstr "" -#: ../../library/devmode.rst:144 +#: ../../library/devmode.rst:145 msgid "" "In addition, enabling :mod:`tracemalloc` shows the line where the file was " "opened:" msgstr "" -#: ../../library/devmode.rst:159 +#: ../../library/devmode.rst:160 msgid "" "The fix is to close explicitly the file. Example using a context manager::" msgstr "" -#: ../../library/devmode.rst:167 +#: ../../library/devmode.rst:168 msgid "" "Not closing a resource explicitly can leave a resource open for way longer " "than expected; it can cause severe issues upon exiting Python. It is bad in " @@ -256,25 +257,25 @@ msgid "" "application more deterministic and more reliable." msgstr "" -#: ../../library/devmode.rst:174 +#: ../../library/devmode.rst:175 msgid "Bad file descriptor error example" msgstr "" -#: ../../library/devmode.rst:176 +#: ../../library/devmode.rst:177 msgid "Script displaying the first line of itself::" msgstr "" -#: ../../library/devmode.rst:189 +#: ../../library/devmode.rst:190 msgid "By default, Python does not emit any warning:" msgstr "" -#: ../../library/devmode.rst:196 +#: ../../library/devmode.rst:197 msgid "" "The Python Development Mode shows a :exc:`ResourceWarning` and logs a \"Bad " "file descriptor\" error when finalizing the file object:" msgstr "" -#: ../../library/devmode.rst:212 +#: ../../library/devmode.rst:213 msgid "" "``os.close(fp.fileno())`` closes the file descriptor. When the file object " "finalizer tries to close the file descriptor again, it fails with the ``Bad " @@ -283,7 +284,7 @@ msgid "" "`18748` for an example)." msgstr "" -#: ../../library/devmode.rst:218 +#: ../../library/devmode.rst:219 msgid "" "The fix is to remove the ``os.close(fp.fileno())`` line, or open the file " "with ``closefd=False``." diff --git a/library/difflib.po b/library/difflib.po index 2af26c0865..fd4440ff4a 100644 --- a/library/difflib.po +++ b/library/difflib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2016-11-19 00:29+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -655,8 +655,9 @@ msgstr "" msgid "" "The three methods that return the ratio of matching to total characters can " "give different results due to differing levels of approximation, although :" -"meth:`quick_ratio` and :meth:`real_quick_ratio` are always at least as large " -"as :meth:`ratio`:" +"meth:`~SequenceMatcher.quick_ratio` and :meth:`~SequenceMatcher." +"real_quick_ratio` are always at least as large as :meth:`~SequenceMatcher." +"ratio`:" msgstr "" #: ../../library/difflib.rst:588 @@ -669,28 +670,29 @@ msgstr "" #: ../../library/difflib.rst:596 msgid "" -":meth:`ratio` returns a float in [0, 1], measuring the similarity of the " -"sequences. As a rule of thumb, a :meth:`ratio` value over 0.6 means the " -"sequences are close matches:" +":meth:`~SequenceMatcher.ratio` returns a float in [0, 1], measuring the " +"similarity of the sequences. As a rule of thumb, a :meth:`~SequenceMatcher." +"ratio` value over 0.6 means the sequences are close matches:" msgstr "" #: ../../library/difflib.rst:603 msgid "" "If you're only interested in where the sequences match, :meth:" -"`get_matching_blocks` is handy:" +"`~SequenceMatcher.get_matching_blocks` is handy:" msgstr "" #: ../../library/difflib.rst:612 msgid "" -"Note that the last tuple returned by :meth:`get_matching_blocks` is always a " -"dummy, ``(len(a), len(b), 0)``, and this is the only case in which the last " -"tuple element (number of elements matched) is ``0``." +"Note that the last tuple returned by :meth:`~SequenceMatcher." +"get_matching_blocks` is always a dummy, ``(len(a), len(b), 0)``, and this is " +"the only case in which the last tuple element (number of elements matched) " +"is ``0``." msgstr "" #: ../../library/difflib.rst:616 msgid "" "If you want to know how to change the first sequence into the second, use :" -"meth:`get_opcodes`:" +"meth:`~SequenceMatcher.get_opcodes`:" msgstr "" #: ../../library/difflib.rst:627 @@ -778,7 +780,7 @@ msgstr "" msgid "" "This example compares two texts. First we set up the texts, sequences of " "individual single-line strings ending with newlines (such sequences can also " -"be obtained from the :meth:`~io.BaseIO.readlines` method of file-like " +"be obtained from the :meth:`~io.IOBase.readlines` method of file-like " "objects):" msgstr "" diff --git a/library/dis.po b/library/dis.po index a8f051c8cc..149873e707 100644 --- a/library/dis.po +++ b/library/dis.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-28 00:04+0000\n" +"POT-Creation-Date: 2023-10-12 00:03+0000\n" "PO-Revision-Date: 2018-07-27 16:55+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -82,32 +82,55 @@ msgstr "" msgid "(The \"2\" is a line number)." msgstr "" -#: ../../library/dis.rst:67 -msgid "Bytecode analysis" +#: ../../library/dis.rst:69 +msgid "Command-line interface" msgstr "" #: ../../library/dis.rst:71 +msgid "The :mod:`dis` module can be invoked as a script from the command line:" +msgstr "" + +#: ../../library/dis.rst:77 +msgid "The following options are accepted:" +msgstr "" + +#: ../../library/dis.rst:83 +msgid "Display usage and exit." +msgstr "" + +#: ../../library/dis.rst:85 +msgid "" +"If :file:`infile` is specified, its disassembled code will be written to " +"stdout. Otherwise, disassembly is performed on compiled source code recieved " +"from stdin." +msgstr "" + +#: ../../library/dis.rst:89 +msgid "Bytecode analysis" +msgstr "" + +#: ../../library/dis.rst:93 msgid "" "The bytecode analysis API allows pieces of Python code to be wrapped in a :" "class:`Bytecode` object that provides easy access to details of the compiled " "code." msgstr "" -#: ../../library/dis.rst:78 +#: ../../library/dis.rst:100 msgid "" "Analyse the bytecode corresponding to a function, generator, asynchronous " "generator, coroutine, method, string of source code, or a code object (as " "returned by :func:`compile`)." msgstr "" -#: ../../library/dis.rst:82 +#: ../../library/dis.rst:104 msgid "" "This is a convenience wrapper around many of the functions listed below, " "most notably :func:`get_instructions`, as iterating over a :class:`Bytecode` " "instance yields the bytecode operations as :class:`Instruction` instances." msgstr "" -#: ../../library/dis.rst:86 ../../library/dis.rst:274 +#: ../../library/dis.rst:108 ../../library/dis.rst:296 msgid "" "If *first_line* is not ``None``, it indicates the line number that should be " "reported for the first source line in the disassembled code. Otherwise, the " @@ -115,71 +138,71 @@ msgid "" "code object." msgstr "" -#: ../../library/dis.rst:91 +#: ../../library/dis.rst:113 msgid "" "If *current_offset* is not ``None``, it refers to an instruction offset in " "the disassembled code. Setting this means :meth:`.dis` will display a " "\"current instruction\" marker against the specified opcode." msgstr "" -#: ../../library/dis.rst:95 +#: ../../library/dis.rst:117 msgid "" "If *show_caches* is ``True``, :meth:`.dis` will display inline cache entries " "used by the interpreter to specialize the bytecode." msgstr "" -#: ../../library/dis.rst:98 +#: ../../library/dis.rst:120 msgid "" "If *adaptive* is ``True``, :meth:`.dis` will display specialized bytecode " "that may be different from the original bytecode." msgstr "" -#: ../../library/dis.rst:103 +#: ../../library/dis.rst:125 msgid "" "Construct a :class:`Bytecode` instance from the given traceback, setting " "*current_offset* to the instruction responsible for the exception." msgstr "" -#: ../../library/dis.rst:108 +#: ../../library/dis.rst:130 msgid "The compiled code object." msgstr "" -#: ../../library/dis.rst:112 +#: ../../library/dis.rst:134 msgid "The first source line of the code object (if available)" msgstr "" -#: ../../library/dis.rst:116 +#: ../../library/dis.rst:138 msgid "" "Return a formatted view of the bytecode operations (the same as printed by :" "func:`dis.dis`, but returned as a multi-line string)." msgstr "" -#: ../../library/dis.rst:121 +#: ../../library/dis.rst:143 msgid "" "Return a formatted multi-line string with detailed information about the " "code object, like :func:`code_info`." msgstr "" -#: ../../library/dis.rst:124 ../../library/dis.rst:164 -#: ../../library/dis.rst:216 +#: ../../library/dis.rst:146 ../../library/dis.rst:186 +#: ../../library/dis.rst:238 msgid "This can now handle coroutine and asynchronous generator objects." msgstr "" -#: ../../library/dis.rst:127 ../../library/dis.rst:219 -#: ../../library/dis.rst:235 ../../library/dis.rst:262 -#: ../../library/dis.rst:283 +#: ../../library/dis.rst:149 ../../library/dis.rst:241 +#: ../../library/dis.rst:257 ../../library/dis.rst:284 +#: ../../library/dis.rst:305 msgid "Added the *show_caches* and *adaptive* parameters." msgstr "新增 *show_caches* 與 *adaptive* 參數。" -#: ../../library/dis.rst:130 +#: ../../library/dis.rst:152 msgid "Example:" msgstr "範例:" -#: ../../library/dis.rst:146 +#: ../../library/dis.rst:168 msgid "Analysis functions" msgstr "" -#: ../../library/dis.rst:148 +#: ../../library/dis.rst:170 msgid "" "The :mod:`dis` module also defines the following analysis functions that " "convert the input directly to the desired output. They can be useful if only " @@ -187,39 +210,39 @@ msgid "" "isn't useful:" msgstr "" -#: ../../library/dis.rst:154 +#: ../../library/dis.rst:176 msgid "" "Return a formatted multi-line string with detailed code object information " "for the supplied function, generator, asynchronous generator, coroutine, " "method, source code string or code object." msgstr "" -#: ../../library/dis.rst:158 +#: ../../library/dis.rst:180 msgid "" "Note that the exact contents of code info strings are highly implementation " "dependent and they may change arbitrarily across Python VMs or Python " "releases." msgstr "" -#: ../../library/dis.rst:170 +#: ../../library/dis.rst:192 msgid "" "Print detailed code object information for the supplied function, method, " "source code string or code object to *file* (or ``sys.stdout`` if *file* is " "not specified)." msgstr "" -#: ../../library/dis.rst:174 +#: ../../library/dis.rst:196 msgid "" "This is a convenient shorthand for ``print(code_info(x), file=file)``, " "intended for interactive exploration at the interpreter prompt." msgstr "" -#: ../../library/dis.rst:179 ../../library/dis.rst:210 -#: ../../library/dis.rst:232 ../../library/dis.rst:259 +#: ../../library/dis.rst:201 ../../library/dis.rst:232 +#: ../../library/dis.rst:254 ../../library/dis.rst:281 msgid "Added *file* parameter." msgstr "新增 *file* 參數。" -#: ../../library/dis.rst:185 +#: ../../library/dis.rst:207 msgid "" "Disassemble the *x* object. *x* can denote either a module, a class, a " "method, a function, a generator, an asynchronous generator, a coroutine, a " @@ -235,127 +258,127 @@ msgid "" "disassembles the last traceback." msgstr "" -#: ../../library/dis.rst:198 ../../library/dis.rst:229 -#: ../../library/dis.rst:256 +#: ../../library/dis.rst:220 ../../library/dis.rst:251 +#: ../../library/dis.rst:278 msgid "" "The disassembly is written as text to the supplied *file* argument if " "provided and to ``sys.stdout`` otherwise." msgstr "" -#: ../../library/dis.rst:201 +#: ../../library/dis.rst:223 msgid "" "The maximal depth of recursion is limited by *depth* unless it is ``None``. " "``depth=0`` means no recursion." msgstr "" -#: ../../library/dis.rst:204 +#: ../../library/dis.rst:226 msgid "" "If *show_caches* is ``True``, this function will display inline cache " "entries used by the interpreter to specialize the bytecode." msgstr "" -#: ../../library/dis.rst:207 +#: ../../library/dis.rst:229 msgid "" "If *adaptive* is ``True``, this function will display specialized bytecode " "that may be different from the original bytecode." msgstr "" -#: ../../library/dis.rst:213 +#: ../../library/dis.rst:235 msgid "Implemented recursive disassembling and added *depth* parameter." msgstr "" -#: ../../library/dis.rst:225 +#: ../../library/dis.rst:247 msgid "" "Disassemble the top-of-stack function of a traceback, using the last " "traceback if none was passed. The instruction causing the exception is " "indicated." msgstr "" -#: ../../library/dis.rst:242 +#: ../../library/dis.rst:264 msgid "" "Disassemble a code object, indicating the last instruction if *lasti* was " "provided. The output is divided in the following columns:" msgstr "" -#: ../../library/dis.rst:245 +#: ../../library/dis.rst:267 msgid "the line number, for the first instruction of each line" msgstr "" -#: ../../library/dis.rst:246 +#: ../../library/dis.rst:268 msgid "the current instruction, indicated as ``-->``," msgstr "" -#: ../../library/dis.rst:247 +#: ../../library/dis.rst:269 msgid "a labelled instruction, indicated with ``>>``," msgstr "" -#: ../../library/dis.rst:248 +#: ../../library/dis.rst:270 msgid "the address of the instruction," msgstr "" -#: ../../library/dis.rst:249 +#: ../../library/dis.rst:271 msgid "the operation code name," msgstr "" -#: ../../library/dis.rst:250 +#: ../../library/dis.rst:272 msgid "operation parameters, and" msgstr "" -#: ../../library/dis.rst:251 +#: ../../library/dis.rst:273 msgid "interpretation of the parameters in parentheses." msgstr "" -#: ../../library/dis.rst:253 +#: ../../library/dis.rst:275 msgid "" "The parameter interpretation recognizes local and global variable names, " "constant values, branch targets, and compare operators." msgstr "" -#: ../../library/dis.rst:268 +#: ../../library/dis.rst:290 msgid "" "Return an iterator over the instructions in the supplied function, method, " "source code string or code object." msgstr "" -#: ../../library/dis.rst:271 +#: ../../library/dis.rst:293 msgid "" "The iterator generates a series of :class:`Instruction` named tuples giving " "the details of each operation in the supplied code." msgstr "" -#: ../../library/dis.rst:279 +#: ../../library/dis.rst:301 msgid "" "The *show_caches* and *adaptive* parameters work as they do in :func:`dis`." msgstr "" -#: ../../library/dis.rst:289 +#: ../../library/dis.rst:311 msgid "" "This generator function uses the ``co_lines`` method of the code object " "*code* to find the offsets which are starts of lines in the source code. " "They are generated as ``(offset, lineno)`` pairs." msgstr "" -#: ../../library/dis.rst:293 +#: ../../library/dis.rst:315 msgid "Line numbers can be decreasing. Before, they were always increasing." msgstr "" -#: ../../library/dis.rst:296 +#: ../../library/dis.rst:318 msgid "" "The :pep:`626` ``co_lines`` method is used instead of the ``co_firstlineno`` " "and ``co_lnotab`` attributes of the code object." msgstr "" -#: ../../library/dis.rst:303 +#: ../../library/dis.rst:325 msgid "" "Detect all offsets in the raw compiled bytecode string *code* which are jump " "targets, and return a list of these offsets." msgstr "" -#: ../../library/dis.rst:309 +#: ../../library/dis.rst:331 msgid "Compute the stack effect of *opcode* with argument *oparg*." msgstr "" -#: ../../library/dis.rst:311 +#: ../../library/dis.rst:333 msgid "" "If the code has a jump target and *jump* is ``True``, :func:`~stack_effect` " "will return the stack effect of jumping. If *jump* is ``False``, it will " @@ -363,118 +386,118 @@ msgid "" "it will return the maximal stack effect of both cases." msgstr "" -#: ../../library/dis.rst:318 +#: ../../library/dis.rst:340 msgid "Added *jump* parameter." msgstr "新增 *jump* 參數。" -#: ../../library/dis.rst:325 +#: ../../library/dis.rst:347 msgid "Python Bytecode Instructions" msgstr "" -#: ../../library/dis.rst:327 +#: ../../library/dis.rst:349 msgid "" "The :func:`get_instructions` function and :class:`Bytecode` class provide " "details of bytecode instructions as :class:`Instruction` instances:" msgstr "" -#: ../../library/dis.rst:332 +#: ../../library/dis.rst:354 msgid "Details for a bytecode operation" msgstr "" -#: ../../library/dis.rst:336 +#: ../../library/dis.rst:358 msgid "" "numeric code for operation, corresponding to the opcode values listed below " "and the bytecode values in the :ref:`opcode_collections`." msgstr "" -#: ../../library/dis.rst:342 +#: ../../library/dis.rst:364 msgid "human readable name for operation" msgstr "" -#: ../../library/dis.rst:347 +#: ../../library/dis.rst:369 msgid "numeric argument to operation (if any), otherwise ``None``" msgstr "" -#: ../../library/dis.rst:352 +#: ../../library/dis.rst:374 msgid "resolved arg value (if any), otherwise ``None``" msgstr "" -#: ../../library/dis.rst:357 +#: ../../library/dis.rst:379 msgid "" "human readable description of operation argument (if any), otherwise an " "empty string." msgstr "" -#: ../../library/dis.rst:363 +#: ../../library/dis.rst:385 msgid "start index of operation within bytecode sequence" msgstr "" -#: ../../library/dis.rst:368 +#: ../../library/dis.rst:390 msgid "line started by this opcode (if any), otherwise ``None``" msgstr "" -#: ../../library/dis.rst:373 +#: ../../library/dis.rst:395 msgid "``True`` if other code jumps to here, otherwise ``False``" msgstr "" -#: ../../library/dis.rst:378 +#: ../../library/dis.rst:400 msgid "" ":class:`dis.Positions` object holding the start and end locations that are " "covered by this instruction." msgstr "" -#: ../../library/dis.rst:385 +#: ../../library/dis.rst:407 msgid "Field ``positions`` is added." msgstr "" -#: ../../library/dis.rst:390 +#: ../../library/dis.rst:412 msgid "" "In case the information is not available, some fields might be ``None``." msgstr "" -#: ../../library/dis.rst:400 +#: ../../library/dis.rst:422 msgid "" "The Python compiler currently generates the following bytecode instructions." msgstr "" -#: ../../library/dis.rst:403 +#: ../../library/dis.rst:425 msgid "**General instructions**" msgstr "" -#: ../../library/dis.rst:405 +#: ../../library/dis.rst:427 msgid "" "In the following, We will refer to the interpreter stack as ``STACK`` and " "describe operations on it as if it was a Python list. The top of the stack " "corresponds to ``STACK[-1]`` in this language." msgstr "" -#: ../../library/dis.rst:411 +#: ../../library/dis.rst:433 msgid "" "Do nothing code. Used as a placeholder by the bytecode optimizer, and to " "generate line tracing events." msgstr "" -#: ../../library/dis.rst:417 +#: ../../library/dis.rst:439 msgid "Removes the top-of-stack item::" msgstr "" -#: ../../library/dis.rst:424 +#: ../../library/dis.rst:446 msgid "" "Removes the top two values from the stack. Equivalent to ``POP_TOP``; " "``POP_TOP``. Used to clean up at the end of loops, hence the name." msgstr "" -#: ../../library/dis.rst:433 +#: ../../library/dis.rst:455 msgid "" "Push the i-th item to the top of the stack without removing it from its " "original location::" msgstr "" -#: ../../library/dis.rst:444 +#: ../../library/dis.rst:466 msgid "Swap the top of the stack with the i-th element::" msgstr "" -#: ../../library/dis.rst:453 +#: ../../library/dis.rst:475 msgid "" "Rather than being an actual instruction, this opcode is used to mark extra " "space for the interpreter to cache useful data directly in the bytecode " @@ -482,91 +505,91 @@ msgid "" "viewed with ``show_caches=True``." msgstr "" -#: ../../library/dis.rst:458 +#: ../../library/dis.rst:480 msgid "" "Logically, this space is part of the preceding instruction. Many opcodes " "expect to be followed by an exact number of caches, and will instruct the " "interpreter to skip over them at runtime." msgstr "" -#: ../../library/dis.rst:462 +#: ../../library/dis.rst:484 msgid "" "Populated caches can look like arbitrary instructions, so great care should " "be taken when reading or modifying raw, adaptive bytecode containing " "quickened data." msgstr "" -#: ../../library/dis.rst:469 +#: ../../library/dis.rst:491 msgid "**Unary operations**" msgstr "" -#: ../../library/dis.rst:471 +#: ../../library/dis.rst:493 msgid "" "Unary operations take the top of the stack, apply the operation, and push " "the result back on the stack." msgstr "" -#: ../../library/dis.rst:477 +#: ../../library/dis.rst:499 msgid "Implements ``STACK[-1] = -STACK[-1]``." msgstr "" -#: ../../library/dis.rst:482 +#: ../../library/dis.rst:504 msgid "Implements ``STACK[-1] = not STACK[-1]``." msgstr "" -#: ../../library/dis.rst:487 +#: ../../library/dis.rst:509 msgid "Implements ``STACK[-1] = ~STACK[-1]``." msgstr "" -#: ../../library/dis.rst:492 +#: ../../library/dis.rst:514 msgid "Implements ``STACK[-1] = iter(STACK[-1])``." msgstr "" -#: ../../library/dis.rst:497 +#: ../../library/dis.rst:519 msgid "" "If ``STACK[-1]`` is a :term:`generator iterator` or :term:`coroutine` object " "it is left as is. Otherwise, implements ``STACK[-1] = iter(STACK[-1])``." msgstr "" -#: ../../library/dis.rst:503 +#: ../../library/dis.rst:525 msgid "**Binary and in-place operations**" msgstr "" -#: ../../library/dis.rst:505 +#: ../../library/dis.rst:527 msgid "" "Binary operations remove the top two items from the stack (``STACK[-1]`` and " "``STACK[-2]``). They perform the operation, then put the result back on the " "stack." msgstr "" -#: ../../library/dis.rst:508 +#: ../../library/dis.rst:530 msgid "" "In-place operations are like binary operations, but the operation is done in-" "place when ``STACK[-2]`` supports it, and the resulting ``STACK[-1]`` may be " "(but does not have to be) the original ``STACK[-2]``." msgstr "" -#: ../../library/dis.rst:515 +#: ../../library/dis.rst:537 msgid "" "Implements the binary and in-place operators (depending on the value of " "*op*)::" msgstr "" -#: ../../library/dis.rst:527 ../../library/dis.rst:536 -#: ../../library/dis.rst:546 ../../library/dis.rst:554 -#: ../../library/dis.rst:566 ../../library/dis.rst:654 -#: ../../library/dis.rst:664 ../../library/dis.rst:674 -#: ../../library/dis.rst:894 ../../library/dis.rst:905 -#: ../../library/dis.rst:1005 ../../library/dis.rst:1017 -#: ../../library/dis.rst:1029 +#: ../../library/dis.rst:549 ../../library/dis.rst:558 +#: ../../library/dis.rst:568 ../../library/dis.rst:576 +#: ../../library/dis.rst:588 ../../library/dis.rst:676 +#: ../../library/dis.rst:686 ../../library/dis.rst:696 +#: ../../library/dis.rst:916 ../../library/dis.rst:927 +#: ../../library/dis.rst:1027 ../../library/dis.rst:1039 +#: ../../library/dis.rst:1051 msgid "Implements::" msgstr "" -#: ../../library/dis.rst:577 +#: ../../library/dis.rst:599 msgid "**Coroutine opcodes**" msgstr "" -#: ../../library/dis.rst:581 +#: ../../library/dis.rst:603 msgid "" "Implements ``STACK[-1] = get_awaitable(STACK[-1])``, where " "``get_awaitable(o)`` returns ``o`` if ``o`` is a coroutine object or a " @@ -574,39 +597,39 @@ msgid "" "resolves ``o.__await__``." msgstr "" -#: ../../library/dis.rst:586 +#: ../../library/dis.rst:608 msgid "" "If the ``where`` operand is nonzero, it indicates where the instruction " "occurs:" msgstr "" -#: ../../library/dis.rst:589 +#: ../../library/dis.rst:611 msgid "``1``: After a call to ``__aenter__``" msgstr "" -#: ../../library/dis.rst:590 +#: ../../library/dis.rst:612 msgid "``2``: After a call to ``__aexit__``" msgstr "" -#: ../../library/dis.rst:594 +#: ../../library/dis.rst:616 msgid "Previously, this instruction did not have an oparg." msgstr "" -#: ../../library/dis.rst:600 +#: ../../library/dis.rst:622 msgid "Implements ``STACK[-1] = STACK[-1].__aiter__()``." msgstr "" -#: ../../library/dis.rst:603 +#: ../../library/dis.rst:625 msgid "Returning awaitable objects from ``__aiter__`` is no longer supported." msgstr "" -#: ../../library/dis.rst:610 +#: ../../library/dis.rst:632 msgid "" "Implement ``STACK.append(get_awaitable(STACK[-1].__anext__()))`` to the " "stack. See ``GET_AWAITABLE`` for details about ``get_awaitable``." msgstr "" -#: ../../library/dis.rst:618 +#: ../../library/dis.rst:640 msgid "" "Terminates an :keyword:`async for` loop. Handles an exception raised when " "awaiting a next item. The stack contains the async iterable in ``STACK[-2]`` " @@ -614,13 +637,13 @@ msgid "" "is not :exc:`StopAsyncIteration`, it is re-raised." msgstr "" -#: ../../library/dis.rst:625 ../../library/dis.rst:730 -#: ../../library/dis.rst:741 +#: ../../library/dis.rst:647 ../../library/dis.rst:752 +#: ../../library/dis.rst:763 msgid "" "Exception representation on the stack now consist of one, not three, items." msgstr "" -#: ../../library/dis.rst:631 +#: ../../library/dis.rst:653 msgid "" "Handles an exception raised during a :meth:`~generator.throw` or :meth:" "`~generator.close` call through the current frame. If ``STACK[-1]`` is an " @@ -628,35 +651,35 @@ msgid "" "its ``value`` member. Otherwise, re-raise ``STACK[-1]``." msgstr "" -#: ../../library/dis.rst:641 +#: ../../library/dis.rst:663 msgid "" "Resolves ``__aenter__`` and ``__aexit__`` from ``STACK[-1]``. Pushes " "``__aexit__`` and result of ``__aenter__()`` to the stack::" msgstr "" -#: ../../library/dis.rst:650 +#: ../../library/dis.rst:672 msgid "**Miscellaneous opcodes**" msgstr "" -#: ../../library/dis.rst:659 +#: ../../library/dis.rst:681 msgid "Used to implement set comprehensions." msgstr "" -#: ../../library/dis.rst:669 +#: ../../library/dis.rst:691 msgid "Used to implement list comprehensions." msgstr "" -#: ../../library/dis.rst:680 +#: ../../library/dis.rst:702 msgid "Used to implement dict comprehensions." msgstr "" -#: ../../library/dis.rst:683 +#: ../../library/dis.rst:705 msgid "" "Map value is ``STACK[-1]`` and map key is ``STACK[-2]``. Before, those were " "reversed." msgstr "" -#: ../../library/dis.rst:687 +#: ../../library/dis.rst:709 msgid "" "For all of the :opcode:`SET_ADD`, :opcode:`LIST_APPEND` and :opcode:" "`MAP_ADD` instructions, while the added value or key/value pair is popped " @@ -664,29 +687,29 @@ msgid "" "further iterations of the loop." msgstr "" -#: ../../library/dis.rst:695 +#: ../../library/dis.rst:717 msgid "Returns with ``STACK[-1]`` to the caller of the function." msgstr "" -#: ../../library/dis.rst:700 +#: ../../library/dis.rst:722 msgid "Returns with ``co_consts[consti]`` to the caller of the function." msgstr "" -#: ../../library/dis.rst:707 +#: ../../library/dis.rst:729 msgid "Yields ``STACK.pop()`` from a :term:`generator`." msgstr "" -#: ../../library/dis.rst:709 +#: ../../library/dis.rst:731 msgid "oparg set to be the stack depth." msgstr "" -#: ../../library/dis.rst:712 +#: ../../library/dis.rst:734 msgid "" "oparg set to be the exception block depth, for efficient closing of " "generators." msgstr "" -#: ../../library/dis.rst:718 +#: ../../library/dis.rst:740 msgid "" "Checks whether ``__annotations__`` is defined in ``locals()``, if not it is " "set up to an empty ``dict``. This opcode is only emitted if a class or " @@ -694,39 +717,39 @@ msgid "" "statically." msgstr "" -#: ../../library/dis.rst:728 +#: ../../library/dis.rst:750 msgid "" "Pops a value from the stack, which is used to restore the exception state." msgstr "" -#: ../../library/dis.rst:735 +#: ../../library/dis.rst:757 msgid "" "Re-raises the exception currently on top of the stack. If oparg is non-zero, " "pops an additional value from the stack which is used to set ``f_lasti`` of " "the current frame." msgstr "" -#: ../../library/dis.rst:746 +#: ../../library/dis.rst:768 msgid "" "Pops a value from the stack. Pushes the current exception to the top of the " "stack. Pushes the value originally popped back to the stack. Used in " "exception handlers." msgstr "" -#: ../../library/dis.rst:754 +#: ../../library/dis.rst:776 msgid "" "Performs exception matching for ``except``. Tests whether the ``STACK[-2]`` " "is an exception matching ``STACK[-1]``. Pops ``STACK[-1]`` and pushes the " "boolean result of the test." msgstr "" -#: ../../library/dis.rst:762 +#: ../../library/dis.rst:784 msgid "" "Performs exception matching for ``except*``. Applies ``split(STACK[-1])`` on " "the exception group representing ``STACK[-2]``." msgstr "" -#: ../../library/dis.rst:765 +#: ../../library/dis.rst:787 msgid "" "In case of a match, pops two items from the stack and pushes the non-" "matching subgroup (``None`` in case of full match) followed by the matching " @@ -734,7 +757,7 @@ msgid "" "``None``." msgstr "" -#: ../../library/dis.rst:774 +#: ../../library/dis.rst:796 msgid "" "Calls the function in position 4 on the stack with arguments (type, val, tb) " "representing the exception at the top of the stack. Used to implement the " @@ -742,25 +765,25 @@ msgid "" "occurred in a :keyword:`with` statement." msgstr "" -#: ../../library/dis.rst:781 +#: ../../library/dis.rst:803 msgid "" "The ``__exit__`` function is in position 4 of the stack rather than 7. " "Exception representation on the stack now consist of one, not three, items." msgstr "" -#: ../../library/dis.rst:788 +#: ../../library/dis.rst:810 msgid "" "Pushes :exc:`AssertionError` onto the stack. Used by the :keyword:`assert` " "statement." msgstr "" -#: ../../library/dis.rst:796 +#: ../../library/dis.rst:818 msgid "" "Pushes :func:`!builtins.__build_class__` onto the stack. It is later called " "to construct a class." msgstr "" -#: ../../library/dis.rst:802 +#: ../../library/dis.rst:824 msgid "" "This opcode performs several operations before a with block starts. First, " "it loads :meth:`~object.__exit__` from the context manager and pushes it " @@ -769,11 +792,11 @@ msgid "" "``__enter__()`` method is pushed onto the stack." msgstr "" -#: ../../library/dis.rst:813 +#: ../../library/dis.rst:835 msgid "Perform ``STACK.append(len(STACK[-1]))``." msgstr "" -#: ../../library/dis.rst:820 +#: ../../library/dis.rst:842 msgid "" "If ``STACK[-1]`` is an instance of :class:`collections.abc.Mapping` (or, " "more technically: if it has the :c:macro:`Py_TPFLAGS_MAPPING` flag set in " @@ -781,7 +804,7 @@ msgid "" "Otherwise, push ``False``." msgstr "" -#: ../../library/dis.rst:830 +#: ../../library/dis.rst:852 msgid "" "If ``STACK[-1]`` is an instance of :class:`collections.abc.Sequence` and is " "*not* an instance of :class:`str`/:class:`bytes`/:class:`bytearray` (or, " @@ -790,20 +813,20 @@ msgid "" "Otherwise, push ``False``." msgstr "" -#: ../../library/dis.rst:840 +#: ../../library/dis.rst:862 msgid "" "``STACK[-1]`` is a tuple of mapping keys, and ``STACK[-2]`` is the match " "subject. If ``STACK[-2]`` contains all of the keys in ``STACK[-1]``, push a :" "class:`tuple` containing the corresponding values. Otherwise, push ``None``." msgstr "" -#: ../../library/dis.rst:846 ../../library/dis.rst:1467 +#: ../../library/dis.rst:868 ../../library/dis.rst:1489 msgid "" "Previously, this instruction also pushed a boolean value indicating success " "(``True``) or failure (``False``)." msgstr "" -#: ../../library/dis.rst:853 +#: ../../library/dis.rst:875 msgid "" "Implements ``name = STACK.pop()``. *namei* is the index of *name* in the " "attribute :attr:`!co_names` of the :ref:`code object `. The " @@ -811,19 +834,19 @@ msgid "" "possible." msgstr "" -#: ../../library/dis.rst:860 +#: ../../library/dis.rst:882 msgid "" "Implements ``del name``, where *namei* is the index into :attr:`!co_names` " "attribute of the :ref:`code object `." msgstr "" -#: ../../library/dis.rst:866 +#: ../../library/dis.rst:888 msgid "" "Unpacks ``STACK[-1]`` into *count* individual values, which are put onto the " "stack right-to-left. Require there to be exactly *count* values.::" msgstr "" -#: ../../library/dis.rst:875 +#: ../../library/dis.rst:897 msgid "" "Implements assignment with a starred target: Unpacks an iterable in " "``STACK[-1]`` into individual values, where the total number of values can " @@ -831,11 +854,11 @@ msgid "" "will be a list of all leftover items." msgstr "" -#: ../../library/dis.rst:880 +#: ../../library/dis.rst:902 msgid "The number of values before and after the list value is limited to 255." msgstr "" -#: ../../library/dis.rst:882 +#: ../../library/dis.rst:904 msgid "" "The number of values before the list value is encoded in the argument of the " "opcode. The number of values after the list if any is encoded using an " @@ -844,50 +867,50 @@ msgid "" "list value, the high byte of *counts* the number of values after it." msgstr "" -#: ../../library/dis.rst:888 +#: ../../library/dis.rst:910 msgid "" "The extracted values are put onto the stack right-to-left, i.e. ``a, *b, c = " "d`` will be stored after execution as ``STACK.extend((a, b, c))``." msgstr "" -#: ../../library/dis.rst:900 +#: ../../library/dis.rst:922 msgid "" "where *namei* is the index of name in :attr:`!co_names` of the :ref:`code " "object `." msgstr "" -#: ../../library/dis.rst:910 +#: ../../library/dis.rst:932 msgid "" "where *namei* is the index of name into :attr:`!co_names` of the :ref:`code " "object `." msgstr "" -#: ../../library/dis.rst:916 +#: ../../library/dis.rst:938 msgid "Works as :opcode:`STORE_NAME`, but stores the name as a global." msgstr "" -#: ../../library/dis.rst:921 +#: ../../library/dis.rst:943 msgid "Works as :opcode:`DELETE_NAME`, but deletes a global name." msgstr "" -#: ../../library/dis.rst:926 +#: ../../library/dis.rst:948 msgid "Pushes ``co_consts[consti]`` onto the stack." msgstr "" -#: ../../library/dis.rst:931 +#: ../../library/dis.rst:953 msgid "" "Pushes the value associated with ``co_names[namei]`` onto the stack. The " "name is looked up within the locals, then the globals, then the builtins." msgstr "" -#: ../../library/dis.rst:937 +#: ../../library/dis.rst:959 msgid "" "Pushes a reference to the locals dictionary onto the stack. This is used to " "prepare namespace dictionaries for :opcode:`LOAD_FROM_DICT_OR_DEREF` and :" "opcode:`LOAD_FROM_DICT_OR_GLOBALS`." msgstr "" -#: ../../library/dis.rst:946 +#: ../../library/dis.rst:968 msgid "" "Pops a mapping off the stack and looks up the value for ``co_names[namei]``. " "If the name is not found there, looks it up in the globals and then the " @@ -896,69 +919,69 @@ msgid "" "bodies." msgstr "" -#: ../../library/dis.rst:957 +#: ../../library/dis.rst:979 msgid "" "Creates a tuple consuming *count* items from the stack, and pushes the " "resulting tuple onto the stack.::" msgstr "" -#: ../../library/dis.rst:967 +#: ../../library/dis.rst:989 msgid "Works as :opcode:`BUILD_TUPLE`, but creates a list." msgstr "" -#: ../../library/dis.rst:972 +#: ../../library/dis.rst:994 msgid "Works as :opcode:`BUILD_TUPLE`, but creates a set." msgstr "" -#: ../../library/dis.rst:977 +#: ../../library/dis.rst:999 msgid "" "Pushes a new dictionary object onto the stack. Pops ``2 * count`` items so " "that the dictionary holds *count* entries: ``{..., STACK[-4]: STACK[-3], " "STACK[-2]: STACK[-1]}``." msgstr "" -#: ../../library/dis.rst:981 +#: ../../library/dis.rst:1003 msgid "" "The dictionary is created from stack items instead of creating an empty " "dictionary pre-sized to hold *count* items." msgstr "" -#: ../../library/dis.rst:988 +#: ../../library/dis.rst:1010 msgid "" "The version of :opcode:`BUILD_MAP` specialized for constant keys. Pops the " "top element on the stack which contains a tuple of keys, then starting from " "``STACK[-2]``, pops *count* values to form values in the built dictionary." msgstr "" -#: ../../library/dis.rst:997 +#: ../../library/dis.rst:1019 msgid "" "Concatenates *count* strings from the stack and pushes the resulting string " "onto the stack." msgstr "" -#: ../../library/dis.rst:1010 +#: ../../library/dis.rst:1032 msgid "Used to build lists." msgstr "" -#: ../../library/dis.rst:1022 +#: ../../library/dis.rst:1044 msgid "Used to build sets." msgstr "" -#: ../../library/dis.rst:1034 +#: ../../library/dis.rst:1056 msgid "Used to build dicts." msgstr "" -#: ../../library/dis.rst:1041 +#: ../../library/dis.rst:1063 msgid "Like :opcode:`DICT_UPDATE` but raises an exception for duplicate keys." msgstr "" -#: ../../library/dis.rst:1048 +#: ../../library/dis.rst:1070 msgid "" "If the low bit of ``namei`` is not set, this replaces ``STACK[-1]`` with " "``getattr(STACK[-1], co_names[namei>>1])``." msgstr "" -#: ../../library/dis.rst:1051 +#: ../../library/dis.rst:1073 msgid "" "If the low bit of ``namei`` is set, this will attempt to load a method named " "``co_names[namei>>1]`` from the ``STACK[-1]`` object. ``STACK[-1]`` is " @@ -969,13 +992,13 @@ msgid "" "the object returned by the attribute lookup are pushed." msgstr "" -#: ../../library/dis.rst:1059 +#: ../../library/dis.rst:1081 msgid "" "If the low bit of ``namei`` is set, then a ``NULL`` or ``self`` is pushed to " "the stack before the attribute or unbound method respectively." msgstr "" -#: ../../library/dis.rst:1066 +#: ../../library/dis.rst:1088 msgid "" "This opcode implements :func:`super` (e.g. ``super().method()`` and " "``super().attr``). It works the same as :opcode:`LOAD_ATTR`, except that " @@ -985,33 +1008,33 @@ msgid "" "class within which the current method was defined), and the global ``super``." msgstr "" -#: ../../library/dis.rst:1073 +#: ../../library/dis.rst:1095 msgid "" "The low bit of ``namei`` signals to attempt a method load, as with :opcode:" "`LOAD_ATTR`." msgstr "" -#: ../../library/dis.rst:1076 +#: ../../library/dis.rst:1098 msgid "" "The second-low bit of ``namei``, if set, means that this was a two-argument " "call to :func:`super` (unset means zero-argument)." msgstr "" -#: ../../library/dis.rst:1084 +#: ../../library/dis.rst:1106 msgid "" "Performs a Boolean operation. The operation name can be found in " "``cmp_op[opname]``." msgstr "" -#: ../../library/dis.rst:1090 +#: ../../library/dis.rst:1112 msgid "Performs ``is`` comparison, or ``is not`` if ``invert`` is 1." msgstr "" -#: ../../library/dis.rst:1097 +#: ../../library/dis.rst:1119 msgid "Performs ``in`` comparison, or ``not in`` if ``invert`` is 1." msgstr "" -#: ../../library/dis.rst:1104 +#: ../../library/dis.rst:1126 msgid "" "Imports the module ``co_names[namei]``. ``STACK[-1]`` and ``STACK[-2]`` are " "popped and provide the *fromlist* and *level* arguments of :func:" @@ -1020,68 +1043,68 @@ msgid "" "opcode:`STORE_FAST` instruction modifies the namespace." msgstr "" -#: ../../library/dis.rst:1112 +#: ../../library/dis.rst:1134 msgid "" "Loads the attribute ``co_names[namei]`` from the module found in " "``STACK[-1]``. The resulting object is pushed onto the stack, to be " "subsequently stored by a :opcode:`STORE_FAST` instruction." msgstr "" -#: ../../library/dis.rst:1119 +#: ../../library/dis.rst:1141 msgid "Increments bytecode counter by *delta*." msgstr "" -#: ../../library/dis.rst:1124 +#: ../../library/dis.rst:1146 msgid "Decrements bytecode counter by *delta*. Checks for interrupts." msgstr "" -#: ../../library/dis.rst:1131 +#: ../../library/dis.rst:1153 msgid "Decrements bytecode counter by *delta*. Does not check for interrupts." msgstr "" -#: ../../library/dis.rst:1138 +#: ../../library/dis.rst:1160 msgid "" "If ``STACK[-1]`` is true, increments the bytecode counter by *delta*. " "``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1141 ../../library/dis.rst:1154 +#: ../../library/dis.rst:1163 ../../library/dis.rst:1176 msgid "" "The oparg is now a relative delta rather than an absolute target. This " "opcode is a pseudo-instruction, replaced in final bytecode by the directed " "versions (forward/backward)." msgstr "" -#: ../../library/dis.rst:1146 ../../library/dis.rst:1159 -#: ../../library/dis.rst:1172 ../../library/dis.rst:1186 +#: ../../library/dis.rst:1168 ../../library/dis.rst:1181 +#: ../../library/dis.rst:1194 ../../library/dis.rst:1208 msgid "This is no longer a pseudo-instruction." msgstr "" -#: ../../library/dis.rst:1151 +#: ../../library/dis.rst:1173 msgid "" "If ``STACK[-1]`` is false, increments the bytecode counter by *delta*. " "``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1164 +#: ../../library/dis.rst:1186 msgid "" "If ``STACK[-1]`` is not ``None``, increments the bytecode counter by " "*delta*. ``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1167 ../../library/dis.rst:1181 +#: ../../library/dis.rst:1189 ../../library/dis.rst:1203 msgid "" "This opcode is a pseudo-instruction, replaced in final bytecode by the " "directed versions (forward/backward)." msgstr "" -#: ../../library/dis.rst:1178 +#: ../../library/dis.rst:1200 msgid "" "If ``STACK[-1]`` is ``None``, increments the bytecode counter by *delta*. " "``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1191 +#: ../../library/dis.rst:1213 msgid "" "``STACK[-1]`` is an :term:`iterator`. Call its :meth:`~iterator.__next__` " "method. If this yields a new value, push it on the stack (leaving the " @@ -1089,83 +1112,83 @@ msgid "" "code counter is incremented by *delta*." msgstr "" -#: ../../library/dis.rst:1196 +#: ../../library/dis.rst:1218 msgid "Up until 3.11 the iterator was popped when it was exhausted." msgstr "" -#: ../../library/dis.rst:1201 +#: ../../library/dis.rst:1223 msgid "Loads the global named ``co_names[namei>>1]`` onto the stack." msgstr "" -#: ../../library/dis.rst:1203 +#: ../../library/dis.rst:1225 msgid "" "If the low bit of ``namei`` is set, then a ``NULL`` is pushed to the stack " "before the global variable." msgstr "" -#: ../../library/dis.rst:1209 +#: ../../library/dis.rst:1231 msgid "" "Pushes a reference to the local ``co_varnames[var_num]`` onto the stack." msgstr "" -#: ../../library/dis.rst:1211 +#: ../../library/dis.rst:1233 msgid "" "This opcode is now only used in situations where the local variable is " "guaranteed to be initialized. It cannot raise :exc:`UnboundLocalError`." msgstr "" -#: ../../library/dis.rst:1217 +#: ../../library/dis.rst:1239 msgid "" "Pushes a reference to the local ``co_varnames[var_num]`` onto the stack, " "raising an :exc:`UnboundLocalError` if the local variable has not been " "initialized." msgstr "" -#: ../../library/dis.rst:1225 +#: ../../library/dis.rst:1247 msgid "" "Pushes a reference to the local ``co_varnames[var_num]`` onto the stack (or " "pushes ``NULL`` onto the stack if the local variable has not been " "initialized) and sets ``co_varnames[var_num]`` to ``NULL``." msgstr "" -#: ../../library/dis.rst:1233 +#: ../../library/dis.rst:1255 msgid "Stores ``STACK.pop()`` into the local ``co_varnames[var_num]``." msgstr "" -#: ../../library/dis.rst:1238 +#: ../../library/dis.rst:1260 msgid "Deletes local ``co_varnames[var_num]``." msgstr "" -#: ../../library/dis.rst:1243 +#: ../../library/dis.rst:1265 msgid "" "Creates a new cell in slot ``i``. If that slot is nonempty then that value " "is stored into the new cell." msgstr "" -#: ../../library/dis.rst:1251 +#: ../../library/dis.rst:1273 msgid "" "Pushes a reference to the cell contained in slot ``i`` of the \"fast " "locals\" storage. The name of the variable is ``co_fastlocalnames[i]``." msgstr "" -#: ../../library/dis.rst:1254 +#: ../../library/dis.rst:1276 msgid "" "Note that ``LOAD_CLOSURE`` is effectively an alias for ``LOAD_FAST``. It " "exists to keep bytecode a little more readable." msgstr "" -#: ../../library/dis.rst:1257 ../../library/dis.rst:1266 -#: ../../library/dis.rst:1288 ../../library/dis.rst:1299 +#: ../../library/dis.rst:1279 ../../library/dis.rst:1288 +#: ../../library/dis.rst:1310 ../../library/dis.rst:1321 msgid "``i`` is no longer offset by the length of ``co_varnames``." msgstr "" -#: ../../library/dis.rst:1263 +#: ../../library/dis.rst:1285 msgid "" "Loads the cell contained in slot ``i`` of the \"fast locals\" storage. " "Pushes a reference to the object the cell contains on the stack." msgstr "" -#: ../../library/dis.rst:1272 +#: ../../library/dis.rst:1294 msgid "" "Pops a mapping off the stack and looks up the name associated with slot " "``i`` of the \"fast locals\" storage in this mapping. If the name is not " @@ -1175,94 +1198,94 @@ msgid "" "scopes ` within class bodies." msgstr "" -#: ../../library/dis.rst:1285 +#: ../../library/dis.rst:1307 msgid "" "Stores ``STACK.pop()`` into the cell contained in slot ``i`` of the \"fast " "locals\" storage." msgstr "" -#: ../../library/dis.rst:1294 +#: ../../library/dis.rst:1316 msgid "" "Empties the cell contained in slot ``i`` of the \"fast locals\" storage. " "Used by the :keyword:`del` statement." msgstr "" -#: ../../library/dis.rst:1305 +#: ../../library/dis.rst:1327 msgid "" "Copies the ``n`` free variables from the closure into the frame. Removes the " "need for special code on the caller's side when calling closures." msgstr "" -#: ../../library/dis.rst:1314 +#: ../../library/dis.rst:1336 msgid "" "Raises an exception using one of the 3 forms of the ``raise`` statement, " "depending on the value of *argc*:" msgstr "" -#: ../../library/dis.rst:1317 +#: ../../library/dis.rst:1339 msgid "0: ``raise`` (re-raise previous exception)" msgstr "" -#: ../../library/dis.rst:1318 +#: ../../library/dis.rst:1340 msgid "" "1: ``raise STACK[-1]`` (raise exception instance or type at ``STACK[-1]``)" msgstr "" -#: ../../library/dis.rst:1319 +#: ../../library/dis.rst:1341 msgid "" "2: ``raise STACK[-2] from STACK[-1]`` (raise exception instance or type at " "``STACK[-2]`` with ``__cause__`` set to ``STACK[-1]``)" msgstr "" -#: ../../library/dis.rst:1325 +#: ../../library/dis.rst:1347 msgid "" "Calls a callable object with the number of arguments specified by ``argc``, " "including the named arguments specified by the preceding :opcode:`KW_NAMES`, " "if any. On the stack are (in ascending order), either:" msgstr "" -#: ../../library/dis.rst:1330 +#: ../../library/dis.rst:1352 msgid "NULL" msgstr "" -#: ../../library/dis.rst:1331 ../../library/dis.rst:1337 +#: ../../library/dis.rst:1353 ../../library/dis.rst:1359 msgid "The callable" msgstr "" -#: ../../library/dis.rst:1332 +#: ../../library/dis.rst:1354 msgid "The positional arguments" msgstr "" -#: ../../library/dis.rst:1333 ../../library/dis.rst:1340 +#: ../../library/dis.rst:1355 ../../library/dis.rst:1362 msgid "The named arguments" msgstr "" -#: ../../library/dis.rst:1335 +#: ../../library/dis.rst:1357 msgid "or:" msgstr "或:" -#: ../../library/dis.rst:1338 +#: ../../library/dis.rst:1360 msgid "``self``" msgstr "``self``" -#: ../../library/dis.rst:1339 +#: ../../library/dis.rst:1361 msgid "The remaining positional arguments" msgstr "" -#: ../../library/dis.rst:1342 +#: ../../library/dis.rst:1364 msgid "" "``argc`` is the total of the positional and named arguments, excluding " "``self`` when a ``NULL`` is not present." msgstr "" -#: ../../library/dis.rst:1345 +#: ../../library/dis.rst:1367 msgid "" "``CALL`` pops all arguments and the callable object off the stack, calls the " "callable object with those arguments, and pushes the return value returned " "by the callable object." msgstr "" -#: ../../library/dis.rst:1354 +#: ../../library/dis.rst:1376 msgid "" "Calls a callable object with variable set of positional and keyword " "arguments. If the lowest bit of *flags* is set, the top of the stack " @@ -1274,70 +1297,70 @@ msgid "" "arguments, and pushes the return value returned by the callable object." msgstr "" -#: ../../library/dis.rst:1369 +#: ../../library/dis.rst:1391 msgid "" "Pushes a ``NULL`` to the stack. Used in the call sequence to match the " "``NULL`` pushed by :opcode:`LOAD_METHOD` for non-method calls." msgstr "" -#: ../../library/dis.rst:1378 +#: ../../library/dis.rst:1400 msgid "" "Prefixes :opcode:`CALL`. Stores a reference to ``co_consts[consti]`` into an " "internal variable for use by :opcode:`CALL`. ``co_consts[consti]`` must be a " "tuple of strings." msgstr "" -#: ../../library/dis.rst:1387 +#: ../../library/dis.rst:1409 msgid "" "Pushes a new function object on the stack. From bottom to top, the consumed " "stack must consist of values if the argument carries a specified flag value" msgstr "" -#: ../../library/dis.rst:1390 +#: ../../library/dis.rst:1412 msgid "" "``0x01`` a tuple of default values for positional-only and positional-or-" "keyword parameters in positional order" msgstr "" -#: ../../library/dis.rst:1392 +#: ../../library/dis.rst:1414 msgid "``0x02`` a dictionary of keyword-only parameters' default values" msgstr "" -#: ../../library/dis.rst:1393 +#: ../../library/dis.rst:1415 msgid "``0x04`` a tuple of strings containing parameters' annotations" msgstr "" -#: ../../library/dis.rst:1394 +#: ../../library/dis.rst:1416 msgid "``0x08`` a tuple containing cells for free variables, making a closure" msgstr "" -#: ../../library/dis.rst:1395 +#: ../../library/dis.rst:1417 msgid "the code associated with the function (at ``STACK[-1]``)" msgstr "" -#: ../../library/dis.rst:1397 +#: ../../library/dis.rst:1419 msgid "Flag value ``0x04`` is a tuple of strings instead of dictionary" msgstr "" -#: ../../library/dis.rst:1400 +#: ../../library/dis.rst:1422 msgid "Qualified name at ``STACK[-1]`` was removed." msgstr "" -#: ../../library/dis.rst:1408 +#: ../../library/dis.rst:1430 msgid "" "Pushes a slice object on the stack. *argc* must be 2 or 3. If it is 2, " "implements::" msgstr "" -#: ../../library/dis.rst:1414 +#: ../../library/dis.rst:1436 msgid "if it is 3, implements::" msgstr "" -#: ../../library/dis.rst:1421 +#: ../../library/dis.rst:1443 msgid "See the :func:`slice` built-in function for more information." msgstr "" -#: ../../library/dis.rst:1426 +#: ../../library/dis.rst:1448 msgid "" "Prefixes any opcode which has an argument too big to fit into the default " "one byte. *ext* holds an additional byte which act as higher bits in the " @@ -1345,54 +1368,54 @@ msgid "" "allowed, forming an argument from two-byte to four-byte." msgstr "" -#: ../../library/dis.rst:1434 +#: ../../library/dis.rst:1456 msgid "" "Used for implementing formatted literal strings (f-strings). Pops an " "optional *fmt_spec* from the stack, then a required *value*. *flags* is " "interpreted as follows:" msgstr "" -#: ../../library/dis.rst:1438 +#: ../../library/dis.rst:1460 msgid "``(flags & 0x03) == 0x00``: *value* is formatted as-is." msgstr "" -#: ../../library/dis.rst:1439 +#: ../../library/dis.rst:1461 msgid "" "``(flags & 0x03) == 0x01``: call :func:`str` on *value* before formatting it." msgstr "" -#: ../../library/dis.rst:1441 +#: ../../library/dis.rst:1463 msgid "" "``(flags & 0x03) == 0x02``: call :func:`repr` on *value* before formatting " "it." msgstr "" -#: ../../library/dis.rst:1443 +#: ../../library/dis.rst:1465 msgid "" "``(flags & 0x03) == 0x03``: call :func:`ascii` on *value* before formatting " "it." msgstr "" -#: ../../library/dis.rst:1445 +#: ../../library/dis.rst:1467 msgid "" "``(flags & 0x04) == 0x04``: pop *fmt_spec* from the stack and use it, else " "use an empty *fmt_spec*." msgstr "" -#: ../../library/dis.rst:1448 +#: ../../library/dis.rst:1470 msgid "" "Formatting is performed using :c:func:`PyObject_Format`. The result is " "pushed on the stack." msgstr "" -#: ../../library/dis.rst:1456 +#: ../../library/dis.rst:1478 msgid "" "``STACK[-1]`` is a tuple of keyword attribute names, ``STACK[-2]`` is the " "class being matched against, and ``STACK[-3]`` is the match subject. " "*count* is the number of positional sub-patterns." msgstr "" -#: ../../library/dis.rst:1460 +#: ../../library/dis.rst:1482 msgid "" "Pop ``STACK[-1]``, ``STACK[-2]``, and ``STACK[-3]``. If ``STACK[-3]`` is an " "instance of ``STACK[-2]`` and has the positional and keyword attributes " @@ -1400,258 +1423,258 @@ msgid "" "Otherwise, push ``None``." msgstr "" -#: ../../library/dis.rst:1474 +#: ../../library/dis.rst:1496 msgid "A no-op. Performs internal tracing, debugging and optimization checks." msgstr "" -#: ../../library/dis.rst:1476 +#: ../../library/dis.rst:1498 msgid "The ``where`` operand marks where the ``RESUME`` occurs:" msgstr "" -#: ../../library/dis.rst:1478 +#: ../../library/dis.rst:1500 msgid "" "``0`` The start of a function, which is neither a generator, coroutine nor " "an async generator" msgstr "" -#: ../../library/dis.rst:1480 +#: ../../library/dis.rst:1502 msgid "``1`` After a ``yield`` expression" msgstr "" -#: ../../library/dis.rst:1481 +#: ../../library/dis.rst:1503 msgid "``2`` After a ``yield from`` expression" msgstr "" -#: ../../library/dis.rst:1482 +#: ../../library/dis.rst:1504 msgid "``3`` After an ``await`` expression" msgstr "" -#: ../../library/dis.rst:1489 +#: ../../library/dis.rst:1511 msgid "" "Create a generator, coroutine, or async generator from the current frame. " "Used as first opcode of in code object for the above mentioned callables. " "Clear the current frame and return the newly created generator." msgstr "" -#: ../../library/dis.rst:1498 +#: ../../library/dis.rst:1520 msgid "" "Equivalent to ``STACK[-1] = STACK[-2].send(STACK[-1])``. Used in ``yield " "from`` and ``await`` statements." msgstr "" -#: ../../library/dis.rst:1501 +#: ../../library/dis.rst:1523 msgid "" "If the call raises :exc:`StopIteration`, pop both items, push the " "exception's ``value`` attribute, and increment the bytecode counter by " "*delta*." msgstr "" -#: ../../library/dis.rst:1510 +#: ../../library/dis.rst:1532 msgid "" "This is not really an opcode. It identifies the dividing line between " "opcodes in the range [0,255] which don't use their argument and those that " "do (``< HAVE_ARGUMENT`` and ``>= HAVE_ARGUMENT``, respectively)." msgstr "" -#: ../../library/dis.rst:1514 +#: ../../library/dis.rst:1536 msgid "" "If your application uses pseudo instructions, use the :data:`hasarg` " "collection instead." msgstr "" -#: ../../library/dis.rst:1517 +#: ../../library/dis.rst:1539 msgid "" "Now every instruction has an argument, but opcodes ``< HAVE_ARGUMENT`` " "ignore it. Before, only opcodes ``>= HAVE_ARGUMENT`` had an argument." msgstr "" -#: ../../library/dis.rst:1521 +#: ../../library/dis.rst:1543 msgid "" "Pseudo instructions were added to the :mod:`dis` module, and for them it is " "not true that comparison with ``HAVE_ARGUMENT`` indicates whether they use " "their arg." msgstr "" -#: ../../library/dis.rst:1529 +#: ../../library/dis.rst:1551 msgid "" "Calls an intrinsic function with one argument. Passes ``STACK[-1]`` as the " "argument and sets ``STACK[-1]`` to the result. Used to implement " "functionality that is necessary but not performance critical." msgstr "" -#: ../../library/dis.rst:1533 ../../library/dis.rst:1583 +#: ../../library/dis.rst:1555 ../../library/dis.rst:1605 msgid "The operand determines which intrinsic function is called:" msgstr "" -#: ../../library/dis.rst:1536 ../../library/dis.rst:1586 +#: ../../library/dis.rst:1558 ../../library/dis.rst:1608 msgid "Operand" msgstr "" -#: ../../library/dis.rst:1536 ../../library/dis.rst:1586 +#: ../../library/dis.rst:1558 ../../library/dis.rst:1608 msgid "Description" msgstr "" -#: ../../library/dis.rst:1538 +#: ../../library/dis.rst:1560 msgid "``INTRINSIC_1_INVALID``" msgstr "``INTRINSIC_1_INVALID``" -#: ../../library/dis.rst:1538 ../../library/dis.rst:1588 +#: ../../library/dis.rst:1560 ../../library/dis.rst:1610 msgid "Not valid" msgstr "" -#: ../../library/dis.rst:1540 +#: ../../library/dis.rst:1562 msgid "``INTRINSIC_PRINT``" msgstr "``INTRINSIC_PRINT``" -#: ../../library/dis.rst:1540 +#: ../../library/dis.rst:1562 msgid "Prints the argument to standard out. Used in the REPL." msgstr "" -#: ../../library/dis.rst:1543 +#: ../../library/dis.rst:1565 msgid "``INTRINSIC_IMPORT_STAR``" msgstr "``INTRINSIC_IMPORT_STAR``" -#: ../../library/dis.rst:1543 +#: ../../library/dis.rst:1565 msgid "Performs ``import *`` for the named module." msgstr "" -#: ../../library/dis.rst:1546 +#: ../../library/dis.rst:1568 msgid "``INTRINSIC_STOPITERATION_ERROR``" msgstr "``INTRINSIC_STOPITERATION_ERROR``" -#: ../../library/dis.rst:1546 +#: ../../library/dis.rst:1568 msgid "Extracts the return value from a ``StopIteration`` exception." msgstr "" -#: ../../library/dis.rst:1549 +#: ../../library/dis.rst:1571 msgid "``INTRINSIC_ASYNC_GEN_WRAP``" msgstr "``INTRINSIC_ASYNC_GEN_WRAP``" -#: ../../library/dis.rst:1549 +#: ../../library/dis.rst:1571 msgid "Wraps an aync generator value" msgstr "" -#: ../../library/dis.rst:1551 +#: ../../library/dis.rst:1573 msgid "``INTRINSIC_UNARY_POSITIVE``" msgstr "``INTRINSIC_UNARY_POSITIVE``" -#: ../../library/dis.rst:1551 +#: ../../library/dis.rst:1573 msgid "Performs the unary ``+`` operation" msgstr "" -#: ../../library/dis.rst:1554 +#: ../../library/dis.rst:1576 msgid "``INTRINSIC_LIST_TO_TUPLE``" msgstr "``INTRINSIC_LIST_TO_TUPLE``" -#: ../../library/dis.rst:1554 +#: ../../library/dis.rst:1576 msgid "Converts a list to a tuple" msgstr "" -#: ../../library/dis.rst:1556 +#: ../../library/dis.rst:1578 msgid "``INTRINSIC_TYPEVAR``" msgstr "``INTRINSIC_TYPEVAR``" -#: ../../library/dis.rst:1556 +#: ../../library/dis.rst:1578 msgid "Creates a :class:`typing.TypeVar`" msgstr "" -#: ../../library/dis.rst:1558 +#: ../../library/dis.rst:1580 msgid "``INTRINSIC_PARAMSPEC``" msgstr "``INTRINSIC_PARAMSPEC``" -#: ../../library/dis.rst:1558 +#: ../../library/dis.rst:1580 msgid "Creates a :class:`typing.ParamSpec`" msgstr "" -#: ../../library/dis.rst:1561 +#: ../../library/dis.rst:1583 msgid "``INTRINSIC_TYPEVARTUPLE``" msgstr "``INTRINSIC_TYPEVARTUPLE``" -#: ../../library/dis.rst:1561 +#: ../../library/dis.rst:1583 msgid "Creates a :class:`typing.TypeVarTuple`" msgstr "" -#: ../../library/dis.rst:1564 +#: ../../library/dis.rst:1586 msgid "``INTRINSIC_SUBSCRIPT_GENERIC``" msgstr "``INTRINSIC_SUBSCRIPT_GENERIC``" -#: ../../library/dis.rst:1564 +#: ../../library/dis.rst:1586 msgid "Returns :class:`typing.Generic` subscripted with the argument" msgstr "" -#: ../../library/dis.rst:1567 +#: ../../library/dis.rst:1589 msgid "``INTRINSIC_TYPEALIAS``" msgstr "``INTRINSIC_TYPEALIAS``" -#: ../../library/dis.rst:1567 +#: ../../library/dis.rst:1589 msgid "" "Creates a :class:`typing.TypeAliasType`; used in the :keyword:`type` " "statement. The argument is a tuple of the type alias's name, type " "parameters, and value." msgstr "" -#: ../../library/dis.rst:1579 +#: ../../library/dis.rst:1601 msgid "" "Calls an intrinsic function with two arguments. Passes ``STACK[-2]``, " "``STACK[-1]`` as the arguments and sets ``STACK[-1]`` to the result. Used to " "implement functionality that is necessary but not performance critical." msgstr "" -#: ../../library/dis.rst:1588 +#: ../../library/dis.rst:1610 msgid "``INTRINSIC_2_INVALID``" msgstr "``INTRINSIC_2_INVALID``" -#: ../../library/dis.rst:1590 +#: ../../library/dis.rst:1612 msgid "``INTRINSIC_PREP_RERAISE_STAR``" msgstr "``INTRINSIC_PREP_RERAISE_STAR``" -#: ../../library/dis.rst:1590 +#: ../../library/dis.rst:1612 msgid "Calculates the :exc:`ExceptionGroup` to raise from a ``try-except*``." msgstr "" -#: ../../library/dis.rst:1594 +#: ../../library/dis.rst:1616 msgid "``INTRINSIC_TYPEVAR_WITH_BOUND``" msgstr "``INTRINSIC_TYPEVAR_WITH_BOUND``" -#: ../../library/dis.rst:1594 +#: ../../library/dis.rst:1616 msgid "Creates a :class:`typing.TypeVar` with a bound." msgstr "" -#: ../../library/dis.rst:1597 +#: ../../library/dis.rst:1619 msgid "``INTRINSIC_TYPEVAR_WITH_CONSTRAINTS``" msgstr "``INTRINSIC_TYPEVAR_WITH_CONSTRAINTS``" -#: ../../library/dis.rst:1597 +#: ../../library/dis.rst:1619 msgid "Creates a :class:`typing.TypeVar` with constraints." msgstr "" -#: ../../library/dis.rst:1601 +#: ../../library/dis.rst:1623 msgid "``INTRINSIC_SET_FUNCTION_TYPE_PARAMS``" msgstr "``INTRINSIC_SET_FUNCTION_TYPE_PARAMS``" -#: ../../library/dis.rst:1601 +#: ../../library/dis.rst:1623 msgid "Sets the ``__type_params__`` attribute of a function." msgstr "" -#: ../../library/dis.rst:1608 +#: ../../library/dis.rst:1630 msgid "**Pseudo-instructions**" msgstr "" -#: ../../library/dis.rst:1610 +#: ../../library/dis.rst:1632 msgid "" "These opcodes do not appear in Python bytecode. They are used by the " "compiler but are replaced by real opcodes or removed before bytecode is " "generated." msgstr "" -#: ../../library/dis.rst:1615 +#: ../../library/dis.rst:1637 msgid "" "Set up an exception handler for the following code block. If an exception " "occurs, the value stack level is restored to its current state and control " "is transferred to the exception handler at ``target``." msgstr "" -#: ../../library/dis.rst:1622 +#: ../../library/dis.rst:1644 msgid "" "Like ``SETUP_FINALLY``, but in case of an exception also pushes the last " "instruction (``lasti``) to the stack so that ``RERAISE`` can restore it. If " @@ -1660,75 +1683,75 @@ msgid "" "exception handler at ``target``." msgstr "" -#: ../../library/dis.rst:1631 +#: ../../library/dis.rst:1653 msgid "" "Like ``SETUP_CLEANUP``, but in case of an exception one more item is popped " "from the stack before control is transferred to the exception handler at " "``target``." msgstr "" -#: ../../library/dis.rst:1635 +#: ../../library/dis.rst:1657 msgid "" "This variant is used in :keyword:`with` and :keyword:`async with` " "constructs, which push the return value of the context manager's :meth:" "`~object.__enter__` or :meth:`~object.__aenter__` to the stack." msgstr "" -#: ../../library/dis.rst:1642 +#: ../../library/dis.rst:1664 msgid "" "Marks the end of the code block associated with the last ``SETUP_FINALLY``, " "``SETUP_CLEANUP`` or ``SETUP_WITH``." msgstr "" -#: ../../library/dis.rst:1648 +#: ../../library/dis.rst:1670 msgid "" "Undirected relative jump instructions which are replaced by their directed " "(forward/backward) counterparts by the assembler." msgstr "" -#: ../../library/dis.rst:1653 +#: ../../library/dis.rst:1675 msgid "" "Optimized unbound method lookup. Emitted as a ``LOAD_ATTR`` opcode with a " "flag set in the arg." msgstr "" -#: ../../library/dis.rst:1660 +#: ../../library/dis.rst:1682 msgid "Opcode collections" msgstr "" -#: ../../library/dis.rst:1662 +#: ../../library/dis.rst:1684 msgid "" "These collections are provided for automatic introspection of bytecode " "instructions:" msgstr "" -#: ../../library/dis.rst:1665 +#: ../../library/dis.rst:1687 msgid "" "The collections now contain pseudo instructions as well. These are opcodes " "with values ``>= MIN_PSEUDO_OPCODE``." msgstr "" -#: ../../library/dis.rst:1671 +#: ../../library/dis.rst:1693 msgid "Sequence of operation names, indexable using the bytecode." msgstr "" -#: ../../library/dis.rst:1676 +#: ../../library/dis.rst:1698 msgid "Dictionary mapping operation names to bytecodes." msgstr "" -#: ../../library/dis.rst:1681 +#: ../../library/dis.rst:1703 msgid "Sequence of all compare operation names." msgstr "" -#: ../../library/dis.rst:1686 +#: ../../library/dis.rst:1708 msgid "Sequence of bytecodes that use their argument." msgstr "" -#: ../../library/dis.rst:1693 +#: ../../library/dis.rst:1715 msgid "Sequence of bytecodes that access a constant." msgstr "" -#: ../../library/dis.rst:1698 +#: ../../library/dis.rst:1720 msgid "" "Sequence of bytecodes that access a free variable. 'free' in this context " "refers to names in the current scope that are referenced by inner scopes or " @@ -1736,34 +1759,34 @@ msgid "" "include references to global or builtin scopes." msgstr "" -#: ../../library/dis.rst:1706 +#: ../../library/dis.rst:1728 msgid "Sequence of bytecodes that access an attribute by name." msgstr "" -#: ../../library/dis.rst:1711 +#: ../../library/dis.rst:1733 msgid "Sequence of bytecodes that have a relative jump target." msgstr "" -#: ../../library/dis.rst:1716 +#: ../../library/dis.rst:1738 msgid "Sequence of bytecodes that have an absolute jump target." msgstr "" -#: ../../library/dis.rst:1721 +#: ../../library/dis.rst:1743 msgid "Sequence of bytecodes that access a local variable." msgstr "" -#: ../../library/dis.rst:1726 +#: ../../library/dis.rst:1748 msgid "Sequence of bytecodes of Boolean operations." msgstr "" -#: ../../library/dis.rst:1730 +#: ../../library/dis.rst:1752 msgid "Sequence of bytecodes that set an exception handler." msgstr "" -#: ../../library/dis.rst:1406 +#: ../../library/dis.rst:1428 msgid "built-in function" msgstr "built-in function(內建函式)" -#: ../../library/dis.rst:1406 +#: ../../library/dis.rst:1428 msgid "slice" msgstr "slice(切片)" diff --git a/library/ensurepip.po b/library/ensurepip.po index 095fea9c59..b2b3d46843 100644 --- a/library/ensurepip.po +++ b/library/ensurepip.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-24 00:16+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+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-" @@ -81,7 +81,7 @@ msgstr "" #: ../../library/ensurepip.rst:44 msgid "Command line interface" -msgstr "" +msgstr "命令列介面" #: ../../library/ensurepip.rst:46 msgid "" @@ -110,7 +110,7 @@ msgstr "" #: ../../library/ensurepip.rst:64 msgid "" -"``--root ``: Installs ``pip`` relative to the given root directory " +":samp:`--root {dir}`: Installs ``pip`` relative to the given root directory " "rather than the root of the currently active virtual environment (if any) or " "the default root for the current Python installation." msgstr "" @@ -215,7 +215,8 @@ msgid "" "Raises an :ref:`auditing event ` ``ensurepip.bootstrap`` with " "argument ``root``." msgstr "" -"引發一個附帶引數 ``root`` 的\\ :ref:`稽核事件 ` ``ensurepip.bootstrap``。" +"引發一個附帶引數 ``root`` 的\\ :ref:`稽核事件 ` ``ensurepip." +"bootstrap``。" #: ../../library/ensurepip.rst:129 msgid "" diff --git a/library/exceptions.po b/library/exceptions.po index ffbb21c128..903b7da466 100644 --- a/library/exceptions.po +++ b/library/exceptions.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+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-" @@ -267,37 +267,43 @@ msgstr "" #: ../../library/exceptions.rst:223 msgid "" -"The :attr:`name` and :attr:`path` attributes can be set using keyword-only " -"arguments to the constructor. When set they represent the name of the module " -"that was attempted to be imported and the path to any file which triggered " -"the exception, respectively." +"The optional *name* and *path* keyword-only arguments set the corresponding " +"attributes:" msgstr "" #: ../../library/exceptions.rst:228 +msgid "The name of the module that was attempted to be imported." +msgstr "" + +#: ../../library/exceptions.rst:232 +msgid "The path to any file which triggered the exception." +msgstr "" + +#: ../../library/exceptions.rst:234 msgid "Added the :attr:`name` and :attr:`path` attributes." msgstr "新增 :attr:`name` 與 :attr:`path` 屬性。" -#: ../../library/exceptions.rst:233 +#: ../../library/exceptions.rst:239 msgid "" "A subclass of :exc:`ImportError` which is raised by :keyword:`import` when a " "module could not be located. It is also raised when ``None`` is found in :" "data:`sys.modules`." msgstr "" -#: ../../library/exceptions.rst:242 +#: ../../library/exceptions.rst:248 msgid "" "Raised when a sequence subscript is out of range. (Slice indices are " "silently truncated to fall in the allowed range; if an index is not an " "integer, :exc:`TypeError` is raised.)" msgstr "" -#: ../../library/exceptions.rst:251 +#: ../../library/exceptions.rst:257 msgid "" "Raised when a mapping (dictionary) key is not found in the set of existing " "keys." msgstr "" -#: ../../library/exceptions.rst:258 +#: ../../library/exceptions.rst:264 msgid "" "Raised when the user hits the interrupt key (normally :kbd:`Control-C` or :" "kbd:`Delete`). During execution, a check for interrupts is made regularly. " @@ -306,7 +312,7 @@ msgid "" "the interpreter from exiting." msgstr "" -#: ../../library/exceptions.rst:266 +#: ../../library/exceptions.rst:272 msgid "" "Catching a :exc:`KeyboardInterrupt` requires special consideration. Because " "it can be raised at unpredictable points, it may, in some circumstances, " @@ -315,7 +321,7 @@ msgid "" "avoid raising it entirely. (See :ref:`handlers-and-exceptions`.)" msgstr "" -#: ../../library/exceptions.rst:276 +#: ../../library/exceptions.rst:282 msgid "" "Raised when an operation runs out of memory but the situation may still be " "rescued (by deleting some objects). The associated value is a string " @@ -326,25 +332,25 @@ msgid "" "stack traceback can be printed, in case a run-away program was the cause." msgstr "" -#: ../../library/exceptions.rst:287 +#: ../../library/exceptions.rst:293 msgid "" "Raised when a local or global name is not found. This applies only to " "unqualified names. The associated value is an error message that includes " "the name that could not be found." msgstr "" -#: ../../library/exceptions.rst:291 +#: ../../library/exceptions.rst:297 msgid "" "The :attr:`name` attribute can be set using a keyword-only argument to the " "constructor. When set it represent the name of the variable that was " "attempted to be accessed." msgstr "" -#: ../../library/exceptions.rst:295 +#: ../../library/exceptions.rst:301 msgid "Added the :attr:`name` attribute." msgstr "新增 :attr:`name` 屬性。" -#: ../../library/exceptions.rst:301 +#: ../../library/exceptions.rst:307 msgid "" "This exception is derived from :exc:`RuntimeError`. In user defined base " "classes, abstract methods should raise this exception when they require " @@ -352,28 +358,28 @@ msgid "" "developed to indicate that the real implementation still needs to be added." msgstr "" -#: ../../library/exceptions.rst:308 +#: ../../library/exceptions.rst:314 msgid "" "It should not be used to indicate that an operator or method is not meant to " "be supported at all -- in that case either leave the operator / method " "undefined or, if a subclass, set it to :data:`None`." msgstr "" -#: ../../library/exceptions.rst:314 +#: ../../library/exceptions.rst:320 msgid "" "``NotImplementedError`` and ``NotImplemented`` are not interchangeable, even " "though they have similar names and purposes. See :data:`NotImplemented` for " "details on when to use it." msgstr "" -#: ../../library/exceptions.rst:323 +#: ../../library/exceptions.rst:329 msgid "" "This exception is raised when a system function returns a system-related " "error, including I/O failures such as \"file not found\" or \"disk " "full\" (not for illegal argument types or other incidental errors)." msgstr "" -#: ../../library/exceptions.rst:327 +#: ../../library/exceptions.rst:333 msgid "" "The second form of the constructor sets the corresponding attributes, " "described below. The attributes default to :const:`None` if not specified. " @@ -382,7 +388,7 @@ msgid "" "constructor arguments." msgstr "" -#: ../../library/exceptions.rst:333 +#: ../../library/exceptions.rst:339 msgid "" "The constructor often actually returns a subclass of :exc:`OSError`, as " "described in `OS exceptions`_ below. The particular subclass depends on the " @@ -391,18 +397,18 @@ msgid "" "subclassing." msgstr "" -#: ../../library/exceptions.rst:341 +#: ../../library/exceptions.rst:347 msgid "A numeric error code from the C variable :c:data:`errno`." msgstr "" -#: ../../library/exceptions.rst:345 +#: ../../library/exceptions.rst:351 msgid "" "Under Windows, this gives you the native Windows error code. The :attr:`." "errno` attribute is then an approximate translation, in POSIX terms, of that " "native error code." msgstr "" -#: ../../library/exceptions.rst:349 +#: ../../library/exceptions.rst:355 msgid "" "Under Windows, if the *winerror* constructor argument is an integer, the :" "attr:`.errno` attribute is determined from the Windows error code, and the " @@ -410,14 +416,14 @@ msgid "" "ignored, and the :attr:`winerror` attribute does not exist." msgstr "" -#: ../../library/exceptions.rst:357 +#: ../../library/exceptions.rst:363 msgid "" "The corresponding error message, as provided by the operating system. It is " "formatted by the C functions :c:func:`perror` under POSIX, and :c:func:" "`FormatMessage` under Windows." msgstr "" -#: ../../library/exceptions.rst:365 +#: ../../library/exceptions.rst:371 msgid "" "For exceptions that involve a file system path (such as :func:`open` or :" "func:`os.unlink`), :attr:`filename` is the file name passed to the function. " @@ -426,14 +432,14 @@ msgid "" "the function." msgstr "" -#: ../../library/exceptions.rst:372 +#: ../../library/exceptions.rst:378 msgid "" ":exc:`EnvironmentError`, :exc:`IOError`, :exc:`WindowsError`, :exc:`socket." "error`, :exc:`select.error` and :exc:`mmap.error` have been merged into :exc:" "`OSError`, and the constructor may return a subclass." msgstr "" -#: ../../library/exceptions.rst:378 +#: ../../library/exceptions.rst:384 msgid "" "The :attr:`filename` attribute is now the original file name passed to the " "function, instead of the name encoded to or decoded from the :term:" @@ -441,7 +447,7 @@ msgid "" "argument and attribute was added." msgstr "" -#: ../../library/exceptions.rst:387 +#: ../../library/exceptions.rst:393 msgid "" "Raised when the result of an arithmetic operation is too large to be " "represented. This cannot occur for integers (which would rather raise :exc:" @@ -451,18 +457,18 @@ msgid "" "in C, most floating point operations are not checked." msgstr "" -#: ../../library/exceptions.rst:397 +#: ../../library/exceptions.rst:403 msgid "" "This exception is derived from :exc:`RuntimeError`. It is raised when the " "interpreter detects that the maximum recursion depth (see :func:`sys." "getrecursionlimit`) is exceeded." msgstr "" -#: ../../library/exceptions.rst:401 +#: ../../library/exceptions.rst:407 msgid "Previously, a plain :exc:`RuntimeError` was raised." msgstr "" -#: ../../library/exceptions.rst:407 +#: ../../library/exceptions.rst:413 msgid "" "This exception is raised when a weak reference proxy, created by the :func:" "`weakref.proxy` function, is used to access an attribute of the referent " @@ -470,65 +476,65 @@ msgid "" "references, see the :mod:`weakref` module." msgstr "" -#: ../../library/exceptions.rst:415 +#: ../../library/exceptions.rst:421 msgid "" "Raised when an error is detected that doesn't fall in any of the other " "categories. The associated value is a string indicating what precisely went " "wrong." msgstr "" -#: ../../library/exceptions.rst:422 +#: ../../library/exceptions.rst:428 msgid "" "Raised by built-in function :func:`next` and an :term:`iterator`\\'s :meth:" "`~iterator.__next__` method to signal that there are no further items " "produced by the iterator." msgstr "" -#: ../../library/exceptions.rst:426 +#: ../../library/exceptions.rst:432 msgid "" "The exception object has a single attribute :attr:`value`, which is given as " "an argument when constructing the exception, and defaults to :const:`None`." msgstr "" -#: ../../library/exceptions.rst:430 +#: ../../library/exceptions.rst:436 msgid "" "When a :term:`generator` or :term:`coroutine` function returns, a new :exc:" "`StopIteration` instance is raised, and the value returned by the function " "is used as the :attr:`value` parameter to the constructor of the exception." msgstr "" -#: ../../library/exceptions.rst:435 +#: ../../library/exceptions.rst:441 msgid "" "If a generator code directly or indirectly raises :exc:`StopIteration`, it " "is converted into a :exc:`RuntimeError` (retaining the :exc:`StopIteration` " "as the new exception's cause)." msgstr "" -#: ../../library/exceptions.rst:439 +#: ../../library/exceptions.rst:445 msgid "" "Added ``value`` attribute and the ability for generator functions to use it " "to return a value." msgstr "" -#: ../../library/exceptions.rst:443 +#: ../../library/exceptions.rst:449 msgid "" "Introduced the RuntimeError transformation via ``from __future__ import " "generator_stop``, see :pep:`479`." msgstr "" -#: ../../library/exceptions.rst:447 +#: ../../library/exceptions.rst:453 msgid "" "Enable :pep:`479` for all code by default: a :exc:`StopIteration` error " "raised in a generator is transformed into a :exc:`RuntimeError`." msgstr "" -#: ../../library/exceptions.rst:453 +#: ../../library/exceptions.rst:459 msgid "" "Must be raised by :meth:`~object.__anext__` method of an :term:`asynchronous " "iterator` object to stop the iteration." msgstr "" -#: ../../library/exceptions.rst:460 +#: ../../library/exceptions.rst:466 msgid "" "Raised when the parser encounters a syntax error. This may occur in an :" "keyword:`import` statement, in a call to the built-in functions :func:" @@ -536,45 +542,45 @@ msgid "" "or standard input (also interactively)." msgstr "" -#: ../../library/exceptions.rst:466 +#: ../../library/exceptions.rst:472 msgid "" "The :func:`str` of the exception instance returns only the error message. " "Details is a tuple whose members are also available as separate attributes." msgstr "" -#: ../../library/exceptions.rst:471 +#: ../../library/exceptions.rst:477 msgid "The name of the file the syntax error occurred in." msgstr "" -#: ../../library/exceptions.rst:475 +#: ../../library/exceptions.rst:481 msgid "" "Which line number in the file the error occurred in. This is 1-indexed: the " "first line in the file has a ``lineno`` of 1." msgstr "" -#: ../../library/exceptions.rst:480 +#: ../../library/exceptions.rst:486 msgid "" "The column in the line where the error occurred. This is 1-indexed: the " "first character in the line has an ``offset`` of 1." msgstr "" -#: ../../library/exceptions.rst:485 +#: ../../library/exceptions.rst:491 msgid "The source code text involved in the error." msgstr "" -#: ../../library/exceptions.rst:489 +#: ../../library/exceptions.rst:495 msgid "" "Which line number in the file the error occurred ends in. This is 1-indexed: " "the first line in the file has a ``lineno`` of 1." msgstr "" -#: ../../library/exceptions.rst:494 +#: ../../library/exceptions.rst:500 msgid "" "The column in the end line where the error occurred finishes. This is 1-" "indexed: the first character in the line has an ``offset`` of 1." msgstr "" -#: ../../library/exceptions.rst:497 +#: ../../library/exceptions.rst:503 msgid "" "For errors in f-string fields, the message is prefixed by \"f-string: \" and " "the offsets are offsets in a text constructed from the replacement " @@ -582,30 +588,30 @@ msgid "" "attribute: ('f-string: ...', ('', 1, 2, '(a b)\\n', 1, 5))." msgstr "" -#: ../../library/exceptions.rst:502 +#: ../../library/exceptions.rst:508 msgid "Added the :attr:`end_lineno` and :attr:`end_offset` attributes." msgstr "新增 :attr:`end_lineno` 與 :attr:`end_offset` 屬性。" -#: ../../library/exceptions.rst:507 +#: ../../library/exceptions.rst:513 msgid "" "Base class for syntax errors related to incorrect indentation. This is a " "subclass of :exc:`SyntaxError`." msgstr "" -#: ../../library/exceptions.rst:513 +#: ../../library/exceptions.rst:519 msgid "" "Raised when indentation contains an inconsistent use of tabs and spaces. " "This is a subclass of :exc:`IndentationError`." msgstr "" -#: ../../library/exceptions.rst:519 +#: ../../library/exceptions.rst:525 msgid "" "Raised when the interpreter finds an internal error, but the situation does " "not look so serious to cause it to abandon all hope. The associated value is " "a string indicating what went wrong (in low-level terms)." msgstr "" -#: ../../library/exceptions.rst:523 +#: ../../library/exceptions.rst:529 msgid "" "You should report this to the author or maintainer of your Python " "interpreter. Be sure to report the version of the Python interpreter (``sys." @@ -614,7 +620,7 @@ msgid "" "possible the source of the program that triggered the error." msgstr "" -#: ../../library/exceptions.rst:532 +#: ../../library/exceptions.rst:538 msgid "" "This exception is raised by the :func:`sys.exit` function. It inherits " "from :exc:`BaseException` instead of :exc:`Exception` so that it is not " @@ -628,7 +634,7 @@ msgid "" "printed and the exit status is one." msgstr "" -#: ../../library/exceptions.rst:543 +#: ../../library/exceptions.rst:549 msgid "" "A call to :func:`sys.exit` is translated into an exception so that clean-up " "handlers (:keyword:`finally` clauses of :keyword:`try` statements) can be " @@ -638,20 +644,20 @@ msgid "" "child process after a call to :func:`os.fork`)." msgstr "" -#: ../../library/exceptions.rst:552 +#: ../../library/exceptions.rst:558 msgid "" "The exit status or error message that is passed to the constructor. " "(Defaults to ``None``.)" msgstr "" -#: ../../library/exceptions.rst:558 +#: ../../library/exceptions.rst:564 msgid "" "Raised when an operation or function is applied to an object of " "inappropriate type. The associated value is a string giving details about " "the type mismatch." msgstr "" -#: ../../library/exceptions.rst:561 +#: ../../library/exceptions.rst:567 msgid "" "This exception may be raised by user code to indicate that an attempted " "operation on an object is not supported, and is not meant to be. If an " @@ -659,7 +665,7 @@ msgid "" "implementation, :exc:`NotImplementedError` is the proper exception to raise." msgstr "" -#: ../../library/exceptions.rst:566 +#: ../../library/exceptions.rst:572 msgid "" "Passing arguments of the wrong type (e.g. passing a :class:`list` when an :" "class:`int` is expected) should result in a :exc:`TypeError`, but passing " @@ -667,99 +673,99 @@ msgid "" "should result in a :exc:`ValueError`." msgstr "" -#: ../../library/exceptions.rst:573 +#: ../../library/exceptions.rst:579 msgid "" "Raised when a reference is made to a local variable in a function or method, " "but no value has been bound to that variable. This is a subclass of :exc:" "`NameError`." msgstr "" -#: ../../library/exceptions.rst:580 +#: ../../library/exceptions.rst:586 msgid "" "Raised when a Unicode-related encoding or decoding error occurs. It is a " "subclass of :exc:`ValueError`." msgstr "" -#: ../../library/exceptions.rst:583 +#: ../../library/exceptions.rst:589 msgid "" ":exc:`UnicodeError` has attributes that describe the encoding or decoding " "error. For example, ``err.object[err.start:err.end]`` gives the particular " "invalid input that the codec failed on." msgstr "" -#: ../../library/exceptions.rst:589 +#: ../../library/exceptions.rst:595 msgid "The name of the encoding that raised the error." msgstr "" -#: ../../library/exceptions.rst:593 +#: ../../library/exceptions.rst:599 msgid "A string describing the specific codec error." msgstr "" -#: ../../library/exceptions.rst:597 +#: ../../library/exceptions.rst:603 msgid "The object the codec was attempting to encode or decode." msgstr "" -#: ../../library/exceptions.rst:601 +#: ../../library/exceptions.rst:607 msgid "The first index of invalid data in :attr:`object`." msgstr "" -#: ../../library/exceptions.rst:605 +#: ../../library/exceptions.rst:611 msgid "The index after the last invalid data in :attr:`object`." msgstr "" -#: ../../library/exceptions.rst:610 +#: ../../library/exceptions.rst:616 msgid "" "Raised when a Unicode-related error occurs during encoding. It is a " "subclass of :exc:`UnicodeError`." msgstr "" -#: ../../library/exceptions.rst:616 +#: ../../library/exceptions.rst:622 msgid "" "Raised when a Unicode-related error occurs during decoding. It is a " "subclass of :exc:`UnicodeError`." msgstr "" -#: ../../library/exceptions.rst:622 +#: ../../library/exceptions.rst:628 msgid "" "Raised when a Unicode-related error occurs during translating. It is a " "subclass of :exc:`UnicodeError`." msgstr "" -#: ../../library/exceptions.rst:628 +#: ../../library/exceptions.rst:634 msgid "" "Raised when an operation or function receives an argument that has the right " "type but an inappropriate value, and the situation is not described by a " "more precise exception such as :exc:`IndexError`." msgstr "" -#: ../../library/exceptions.rst:635 +#: ../../library/exceptions.rst:641 msgid "" "Raised when the second argument of a division or modulo operation is zero. " "The associated value is a string indicating the type of the operands and the " "operation." msgstr "" -#: ../../library/exceptions.rst:640 +#: ../../library/exceptions.rst:646 msgid "" "The following exceptions are kept for compatibility with previous versions; " "starting from Python 3.3, they are aliases of :exc:`OSError`." msgstr "" -#: ../../library/exceptions.rst:649 +#: ../../library/exceptions.rst:655 msgid "Only available on Windows." msgstr "" -#: ../../library/exceptions.rst:653 +#: ../../library/exceptions.rst:659 msgid "OS exceptions" msgstr "" -#: ../../library/exceptions.rst:655 +#: ../../library/exceptions.rst:661 msgid "" "The following exceptions are subclasses of :exc:`OSError`, they get raised " "depending on the system error code." msgstr "" -#: ../../library/exceptions.rst:660 +#: ../../library/exceptions.rst:666 msgid "" "Raised when an operation would block on an object (e.g. socket) set for non-" "blocking operation. Corresponds to :c:data:`errno` :py:const:`~errno." @@ -767,36 +773,36 @@ msgid "" "const:`~errno.EINPROGRESS`." msgstr "" -#: ../../library/exceptions.rst:665 +#: ../../library/exceptions.rst:671 msgid "" "In addition to those of :exc:`OSError`, :exc:`BlockingIOError` can have one " "more attribute:" msgstr "" -#: ../../library/exceptions.rst:670 +#: ../../library/exceptions.rst:676 msgid "" "An integer containing the number of characters written to the stream before " "it blocked. This attribute is available when using the buffered I/O classes " "from the :mod:`io` module." msgstr "" -#: ../../library/exceptions.rst:676 +#: ../../library/exceptions.rst:682 msgid "" "Raised when an operation on a child process failed. Corresponds to :c:data:" "`errno` :py:const:`~errno.ECHILD`." msgstr "" -#: ../../library/exceptions.rst:681 +#: ../../library/exceptions.rst:687 msgid "A base class for connection-related issues." msgstr "" -#: ../../library/exceptions.rst:683 +#: ../../library/exceptions.rst:689 msgid "" "Subclasses are :exc:`BrokenPipeError`, :exc:`ConnectionAbortedError`, :exc:" "`ConnectionRefusedError` and :exc:`ConnectionResetError`." msgstr "" -#: ../../library/exceptions.rst:688 +#: ../../library/exceptions.rst:694 msgid "" "A subclass of :exc:`ConnectionError`, raised when trying to write on a pipe " "while the other end has been closed, or trying to write on a socket which " @@ -804,58 +810,58 @@ msgid "" "`~errno.EPIPE` and :py:const:`~errno.ESHUTDOWN`." msgstr "" -#: ../../library/exceptions.rst:695 +#: ../../library/exceptions.rst:701 msgid "" "A subclass of :exc:`ConnectionError`, raised when a connection attempt is " "aborted by the peer. Corresponds to :c:data:`errno` :py:const:`~errno." "ECONNABORTED`." msgstr "" -#: ../../library/exceptions.rst:701 +#: ../../library/exceptions.rst:707 msgid "" "A subclass of :exc:`ConnectionError`, raised when a connection attempt is " "refused by the peer. Corresponds to :c:data:`errno` :py:const:`~errno." "ECONNREFUSED`." msgstr "" -#: ../../library/exceptions.rst:707 +#: ../../library/exceptions.rst:713 msgid "" "A subclass of :exc:`ConnectionError`, raised when a connection is reset by " "the peer. Corresponds to :c:data:`errno` :py:const:`~errno.ECONNRESET`." msgstr "" -#: ../../library/exceptions.rst:713 +#: ../../library/exceptions.rst:719 msgid "" "Raised when trying to create a file or directory which already exists. " "Corresponds to :c:data:`errno` :py:const:`~errno.EEXIST`." msgstr "" -#: ../../library/exceptions.rst:718 +#: ../../library/exceptions.rst:724 msgid "" "Raised when a file or directory is requested but doesn't exist. Corresponds " "to :c:data:`errno` :py:const:`~errno.ENOENT`." msgstr "" -#: ../../library/exceptions.rst:723 +#: ../../library/exceptions.rst:729 msgid "" "Raised when a system call is interrupted by an incoming signal. Corresponds " "to :c:data:`errno` :py:const:`~errno.EINTR`." msgstr "" -#: ../../library/exceptions.rst:726 +#: ../../library/exceptions.rst:732 msgid "" "Python now retries system calls when a syscall is interrupted by a signal, " "except if the signal handler raises an exception (see :pep:`475` for the " "rationale), instead of raising :exc:`InterruptedError`." msgstr "" -#: ../../library/exceptions.rst:733 +#: ../../library/exceptions.rst:739 msgid "" "Raised when a file operation (such as :func:`os.remove`) is requested on a " "directory. Corresponds to :c:data:`errno` :py:const:`~errno.EISDIR`." msgstr "" -#: ../../library/exceptions.rst:739 +#: ../../library/exceptions.rst:745 msgid "" "Raised when a directory operation (such as :func:`os.listdir`) is requested " "on something which is not a directory. On most POSIX platforms, it may also " @@ -864,7 +870,7 @@ msgid "" "ENOTDIR`." msgstr "" -#: ../../library/exceptions.rst:747 +#: ../../library/exceptions.rst:753 msgid "" "Raised when trying to run an operation without the adequate access rights - " "for example filesystem permissions. Corresponds to :c:data:`errno` :py:const:" @@ -872,131 +878,131 @@ msgid "" "ENOTCAPABLE`." msgstr "" -#: ../../library/exceptions.rst:752 +#: ../../library/exceptions.rst:758 msgid "" "WASI's :py:const:`~errno.ENOTCAPABLE` is now mapped to :exc:" "`PermissionError`." msgstr "" -#: ../../library/exceptions.rst:758 +#: ../../library/exceptions.rst:764 msgid "" "Raised when a given process doesn't exist. Corresponds to :c:data:`errno` :" "py:const:`~errno.ESRCH`." msgstr "" -#: ../../library/exceptions.rst:763 +#: ../../library/exceptions.rst:769 msgid "" "Raised when a system function timed out at the system level. Corresponds to :" "c:data:`errno` :py:const:`~errno.ETIMEDOUT`." msgstr "" -#: ../../library/exceptions.rst:766 +#: ../../library/exceptions.rst:772 msgid "All the above :exc:`OSError` subclasses were added." msgstr "" -#: ../../library/exceptions.rst:772 +#: ../../library/exceptions.rst:778 msgid ":pep:`3151` - Reworking the OS and IO exception hierarchy" msgstr "" -#: ../../library/exceptions.rst:778 +#: ../../library/exceptions.rst:784 msgid "Warnings" msgstr "警告" -#: ../../library/exceptions.rst:780 +#: ../../library/exceptions.rst:786 msgid "" "The following exceptions are used as warning categories; see the :ref:" "`warning-categories` documentation for more details." msgstr "" -#: ../../library/exceptions.rst:785 +#: ../../library/exceptions.rst:791 msgid "Base class for warning categories." msgstr "" -#: ../../library/exceptions.rst:790 +#: ../../library/exceptions.rst:796 msgid "Base class for warnings generated by user code." msgstr "" -#: ../../library/exceptions.rst:795 +#: ../../library/exceptions.rst:801 msgid "" "Base class for warnings about deprecated features when those warnings are " "intended for other Python developers." msgstr "" -#: ../../library/exceptions.rst:798 +#: ../../library/exceptions.rst:804 msgid "" "Ignored by the default warning filters, except in the ``__main__`` module (:" "pep:`565`). Enabling the :ref:`Python Development Mode ` shows this " "warning." msgstr "" -#: ../../library/exceptions.rst:802 ../../library/exceptions.rst:818 +#: ../../library/exceptions.rst:808 ../../library/exceptions.rst:824 msgid "The deprecation policy is described in :pep:`387`." msgstr "" -#: ../../library/exceptions.rst:807 +#: ../../library/exceptions.rst:813 msgid "" "Base class for warnings about features which are obsolete and expected to be " "deprecated in the future, but are not deprecated at the moment." msgstr "" -#: ../../library/exceptions.rst:811 +#: ../../library/exceptions.rst:817 msgid "" "This class is rarely used as emitting a warning about a possible upcoming " "deprecation is unusual, and :exc:`DeprecationWarning` is preferred for " "already active deprecations." msgstr "" -#: ../../library/exceptions.rst:815 ../../library/exceptions.rst:841 -#: ../../library/exceptions.rst:868 +#: ../../library/exceptions.rst:821 ../../library/exceptions.rst:847 +#: ../../library/exceptions.rst:874 msgid "" "Ignored by the default warning filters. Enabling the :ref:`Python " "Development Mode ` shows this warning." msgstr "" -#: ../../library/exceptions.rst:823 +#: ../../library/exceptions.rst:829 msgid "Base class for warnings about dubious syntax." msgstr "" -#: ../../library/exceptions.rst:828 +#: ../../library/exceptions.rst:834 msgid "Base class for warnings about dubious runtime behavior." msgstr "" -#: ../../library/exceptions.rst:833 +#: ../../library/exceptions.rst:839 msgid "" "Base class for warnings about deprecated features when those warnings are " "intended for end users of applications that are written in Python." msgstr "" -#: ../../library/exceptions.rst:839 +#: ../../library/exceptions.rst:845 msgid "Base class for warnings about probable mistakes in module imports." msgstr "" -#: ../../library/exceptions.rst:847 +#: ../../library/exceptions.rst:853 msgid "Base class for warnings related to Unicode." msgstr "" -#: ../../library/exceptions.rst:852 +#: ../../library/exceptions.rst:858 msgid "Base class for warnings related to encodings." msgstr "" -#: ../../library/exceptions.rst:854 +#: ../../library/exceptions.rst:860 msgid "See :ref:`io-encoding-warning` for details." msgstr "細節請見 :ref:`io-encoding-warning`\\ 。" -#: ../../library/exceptions.rst:861 +#: ../../library/exceptions.rst:867 msgid "" "Base class for warnings related to :class:`bytes` and :class:`bytearray`." msgstr "" -#: ../../library/exceptions.rst:866 +#: ../../library/exceptions.rst:872 msgid "Base class for warnings related to resource usage." msgstr "" -#: ../../library/exceptions.rst:877 +#: ../../library/exceptions.rst:883 msgid "Exception groups" msgstr "" -#: ../../library/exceptions.rst:879 +#: ../../library/exceptions.rst:885 msgid "" "The following are used when it is necessary to raise multiple unrelated " "exceptions. They are part of the exception hierarchy so they can be handled " @@ -1005,7 +1011,7 @@ msgid "" "based on the types of the contained exceptions." msgstr "" -#: ../../library/exceptions.rst:888 +#: ../../library/exceptions.rst:894 msgid "" "Both of these exception types wrap the exceptions in the sequence ``excs``. " "The ``msg`` parameter must be a string. The difference between the two " @@ -1016,7 +1022,7 @@ msgid "" "exc:`BaseExceptionGroup`." msgstr "" -#: ../../library/exceptions.rst:896 +#: ../../library/exceptions.rst:902 msgid "" "The :exc:`BaseExceptionGroup` constructor returns an :exc:`ExceptionGroup` " "rather than a :exc:`BaseExceptionGroup` if all contained exceptions are :exc:" @@ -1025,23 +1031,23 @@ msgid "" "`TypeError` if any contained exception is not an :exc:`Exception` subclass." msgstr "" -#: ../../library/exceptions.rst:905 +#: ../../library/exceptions.rst:911 msgid "The ``msg`` argument to the constructor. This is a read-only attribute." msgstr "" -#: ../../library/exceptions.rst:909 +#: ../../library/exceptions.rst:915 msgid "" "A tuple of the exceptions in the ``excs`` sequence given to the constructor. " "This is a read-only attribute." msgstr "" -#: ../../library/exceptions.rst:914 +#: ../../library/exceptions.rst:920 msgid "" "Returns an exception group that contains only the exceptions from the " "current group that match *condition*, or ``None`` if the result is empty." msgstr "" -#: ../../library/exceptions.rst:917 +#: ../../library/exceptions.rst:923 msgid "" "The condition can be either a function that accepts an exception and returns " "true for those that should be in the subgroup, or it can be an exception " @@ -1049,7 +1055,7 @@ msgid "" "the same check that is used in an ``except`` clause." msgstr "" -#: ../../library/exceptions.rst:922 +#: ../../library/exceptions.rst:928 msgid "" "The nesting structure of the current exception is preserved in the result, " "as are the values of its :attr:`message`, :attr:`__traceback__`, :attr:" @@ -1057,34 +1063,34 @@ msgid "" "groups are omitted from the result." msgstr "" -#: ../../library/exceptions.rst:927 +#: ../../library/exceptions.rst:933 msgid "" "The condition is checked for all exceptions in the nested exception group, " "including the top-level and any nested exception groups. If the condition is " "true for such an exception group, it is included in the result in full." msgstr "" -#: ../../library/exceptions.rst:933 +#: ../../library/exceptions.rst:939 msgid "" "Like :meth:`subgroup`, but returns the pair ``(match, rest)`` where " "``match`` is ``subgroup(condition)`` and ``rest`` is the remaining non-" "matching part." msgstr "" -#: ../../library/exceptions.rst:939 +#: ../../library/exceptions.rst:945 msgid "" "Returns an exception group with the same :attr:`message`, but which wraps " "the exceptions in ``excs``." msgstr "" -#: ../../library/exceptions.rst:942 +#: ../../library/exceptions.rst:948 msgid "" "This method is used by :meth:`subgroup` and :meth:`split`. A subclass needs " "to override it in order to make :meth:`subgroup` and :meth:`split` return " "instances of the subclass rather than :exc:`ExceptionGroup`." msgstr "" -#: ../../library/exceptions.rst:947 +#: ../../library/exceptions.rst:953 msgid "" ":meth:`subgroup` and :meth:`split` copy the :attr:`__traceback__`, :attr:" "`__cause__`, :attr:`__context__` and :attr:`__notes__` fields from the " @@ -1092,7 +1098,7 @@ msgid "" "fields do not need to be updated by :meth:`derive`. ::" msgstr "" -#: ../../library/exceptions.rst:976 +#: ../../library/exceptions.rst:982 msgid "" "Note that :exc:`BaseExceptionGroup` defines :meth:`__new__`, so subclasses " "that need a different constructor signature need to override that rather " @@ -1101,18 +1107,18 @@ msgid "" "from it. ::" msgstr "" -#: ../../library/exceptions.rst:991 +#: ../../library/exceptions.rst:997 msgid "" "Like :exc:`ExceptionGroup`, any subclass of :exc:`BaseExceptionGroup` which " "is also a subclass of :exc:`Exception` can only wrap instances of :exc:" "`Exception`." msgstr "" -#: ../../library/exceptions.rst:999 +#: ../../library/exceptions.rst:1005 msgid "Exception hierarchy" msgstr "" -#: ../../library/exceptions.rst:1001 +#: ../../library/exceptions.rst:1007 msgid "The class hierarchy for built-in exceptions is:" msgstr "" @@ -1137,10 +1143,10 @@ msgstr "raise" msgid "assert" msgstr "assert" -#: ../../library/exceptions.rst:321 +#: ../../library/exceptions.rst:327 msgid "module" msgstr "module(模組)" -#: ../../library/exceptions.rst:321 +#: ../../library/exceptions.rst:327 msgid "errno" msgstr "errno" diff --git a/library/functions.po b/library/functions.po index e26b4be9d6..85c5c1ace1 100644 --- a/library/functions.po +++ b/library/functions.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-07 00:03+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2023-07-02 22:53+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2167,7 +2167,7 @@ msgstr "" msgid "" "``'xmlcharrefreplace'`` is only supported when writing to a file. Characters " "not supported by the encoding are replaced with the appropriate XML " -"character reference ``&#nnn;``." +"character reference :samp:`&#{nnn};`." msgstr "" #: ../../library/functions.rst:1276 diff --git a/library/gettext.po b/library/gettext.po index 1b56ff954e..8933fb9e99 100644 --- a/library/gettext.po +++ b/library/gettext.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-24 00:03+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2018-05-23 16:02+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -84,7 +84,7 @@ msgstr "" msgid "" "Return the localized translation of *message*, based on the current global " "domain, language, and locale directory. This function is usually aliased " -"as :func:`_` in the local namespace (see examples below)." +"as :func:`!_` in the local namespace (see examples below)." msgstr "" #: ../../library/gettext.rst:66 @@ -124,7 +124,7 @@ msgstr "" #: ../../library/gettext.rst:101 msgid "" -"Note that GNU :program:`gettext` also defines a :func:`dcgettext` method, " +"Note that GNU :program:`gettext` also defines a :func:`!dcgettext` method, " "but this was deemed not useful and so it is currently unimplemented." msgstr "" @@ -144,7 +144,7 @@ msgid "" "gettext` defines a :class:`GNUTranslations` class which implements the " "parsing of GNU :file:`.mo` format files, and has methods for returning " "strings. Instances of this class can also install themselves in the built-in " -"namespace as the function :func:`_`." +"namespace as the function :func:`!_`." msgstr "" #: ../../library/gettext.rst:127 @@ -186,17 +186,15 @@ msgstr "" #: ../../library/gettext.rst:153 msgid "" -"Return a :class:`*Translations` instance based on the *domain*, *localedir*, " -"and *languages*, which are first passed to :func:`find` to get a list of the " +"Return a ``*Translations`` instance based on the *domain*, *localedir*, and " +"*languages*, which are first passed to :func:`find` to get a list of the " "associated :file:`.mo` file paths. Instances with identical :file:`.mo` " "file names are cached. The actual class instantiated is *class_* if " "provided, otherwise :class:`GNUTranslations`. The class's constructor must " -"take a single :term:`file object` argument. If provided, *codeset* will " -"change the charset used to encode translated strings in the :meth:" -"`~NullTranslations.lgettext` and :meth:`~NullTranslations.lngettext` methods." +"take a single :term:`file object` argument." msgstr "" -#: ../../library/gettext.rst:163 +#: ../../library/gettext.rst:160 msgid "" "If multiple files are found, later files are used as fallbacks for earlier " "ones. To allow setting the fallback, :func:`copy.copy` is used to clone each " @@ -204,57 +202,57 @@ msgid "" "with the cache." msgstr "" -#: ../../library/gettext.rst:168 +#: ../../library/gettext.rst:165 msgid "" "If no :file:`.mo` file is found, this function raises :exc:`OSError` if " "*fallback* is false (which is the default), and returns a :class:" "`NullTranslations` instance if *fallback* is true." msgstr "" -#: ../../library/gettext.rst:172 -msgid ":exc:`IOError` used to be raised instead of :exc:`OSError`." +#: ../../library/gettext.rst:169 +msgid ":exc:`IOError` used to be raised, it is now an alias of :exc:`OSError`." msgstr "" -#: ../../library/gettext.rst:175 +#: ../../library/gettext.rst:172 msgid "*codeset* parameter is removed." msgstr "*codeset* 參數被移除。" -#: ../../library/gettext.rst:180 +#: ../../library/gettext.rst:177 msgid "" -"This installs the function :func:`_` in Python's builtins namespace, based " +"This installs the function :func:`!_` in Python's builtins namespace, based " "on *domain* and *localedir* which are passed to the function :func:" "`translation`." msgstr "" -#: ../../library/gettext.rst:183 +#: ../../library/gettext.rst:180 msgid "" "For the *names* parameter, please see the description of the translation " "object's :meth:`~NullTranslations.install` method." msgstr "" -#: ../../library/gettext.rst:186 +#: ../../library/gettext.rst:183 msgid "" "As seen below, you usually mark the strings in your application that are " -"candidates for translation, by wrapping them in a call to the :func:`_` " +"candidates for translation, by wrapping them in a call to the :func:`!_` " "function, like this::" msgstr "" -#: ../../library/gettext.rst:192 +#: ../../library/gettext.rst:189 msgid "" -"For convenience, you want the :func:`_` function to be installed in Python's " -"builtins namespace, so it is easily accessible in all modules of your " -"application." +"For convenience, you want the :func:`!_` function to be installed in " +"Python's builtins namespace, so it is easily accessible in all modules of " +"your application." msgstr "" -#: ../../library/gettext.rst:196 +#: ../../library/gettext.rst:193 msgid "*names* is now a keyword-only parameter." msgstr "" -#: ../../library/gettext.rst:200 +#: ../../library/gettext.rst:197 msgid "The :class:`NullTranslations` class" msgstr "" -#: ../../library/gettext.rst:202 +#: ../../library/gettext.rst:199 msgid "" "Translation classes are what actually implement the translation of original " "source file message strings to translated message strings. The base class " @@ -263,7 +261,7 @@ msgid "" "classes. Here are the methods of :class:`!NullTranslations`:" msgstr "" -#: ../../library/gettext.rst:211 +#: ../../library/gettext.rst:208 msgid "" "Takes an optional :term:`file object` *fp*, which is ignored by the base " "class. Initializes \"protected\" instance variables *_info* and *_charset* " @@ -272,7 +270,7 @@ msgid "" "not ``None``." msgstr "" -#: ../../library/gettext.rst:219 +#: ../../library/gettext.rst:216 msgid "" "No-op in the base class, this method takes file object *fp*, and reads the " "data from the file, initializing its message catalog. If you have an " @@ -280,86 +278,86 @@ msgid "" "parse your format." msgstr "" -#: ../../library/gettext.rst:227 +#: ../../library/gettext.rst:224 msgid "" "Add *fallback* as the fallback object for the current translation object. A " "translation object should consult the fallback if it cannot provide a " "translation for a given message." msgstr "" -#: ../../library/gettext.rst:234 +#: ../../library/gettext.rst:231 msgid "" "If a fallback has been set, forward :meth:`!gettext` to the fallback. " "Otherwise, return *message*. Overridden in derived classes." msgstr "" -#: ../../library/gettext.rst:240 +#: ../../library/gettext.rst:237 msgid "" "If a fallback has been set, forward :meth:`!ngettext` to the fallback. " "Otherwise, return *singular* if *n* is 1; return *plural* otherwise. " "Overridden in derived classes." msgstr "" -#: ../../library/gettext.rst:247 +#: ../../library/gettext.rst:244 msgid "" "If a fallback has been set, forward :meth:`pgettext` to the fallback. " "Otherwise, return the translated message. Overridden in derived classes." msgstr "" -#: ../../library/gettext.rst:255 +#: ../../library/gettext.rst:252 msgid "" "If a fallback has been set, forward :meth:`npgettext` to the fallback. " "Otherwise, return the translated message. Overridden in derived classes." msgstr "" -#: ../../library/gettext.rst:263 +#: ../../library/gettext.rst:260 msgid "" "Return the \"protected\" :attr:`_info` variable, a dictionary containing the " "metadata found in the message catalog file." msgstr "" -#: ../../library/gettext.rst:269 +#: ../../library/gettext.rst:266 msgid "Return the encoding of the message catalog file." msgstr "" -#: ../../library/gettext.rst:274 +#: ../../library/gettext.rst:271 msgid "" "This method installs :meth:`.gettext` into the built-in namespace, binding " "it to ``_``." msgstr "" -#: ../../library/gettext.rst:277 +#: ../../library/gettext.rst:274 msgid "" "If the *names* parameter is given, it must be a sequence containing the " "names of functions you want to install in the builtins namespace in addition " -"to :func:`_`. Supported names are ``'gettext'``, ``'ngettext'``, " -"``'pgettext'``, ``'npgettext'``, ``'lgettext'``, and ``'lngettext'``." +"to :func:`!_`. Supported names are ``'gettext'``, ``'ngettext'``, " +"``'pgettext'``, and ``'npgettext'``." msgstr "" -#: ../../library/gettext.rst:282 +#: ../../library/gettext.rst:279 msgid "" "Note that this is only one way, albeit the most convenient way, to make the :" -"func:`_` function available to your application. Because it affects the " +"func:`!_` function available to your application. Because it affects the " "entire application globally, and specifically the built-in namespace, " -"localized modules should never install :func:`_`. Instead, they should use " -"this code to make :func:`_` available to their module::" +"localized modules should never install :func:`!_`. Instead, they should use " +"this code to make :func:`!_` available to their module::" msgstr "" -#: ../../library/gettext.rst:292 +#: ../../library/gettext.rst:289 msgid "" -"This puts :func:`_` only in the module's global namespace and so only " +"This puts :func:`!_` only in the module's global namespace and so only " "affects calls within this module." msgstr "" -#: ../../library/gettext.rst:295 +#: ../../library/gettext.rst:292 msgid "Added ``'pgettext'`` and ``'npgettext'``." msgstr "新增 ``'pgettext'`` 與 ``'npgettext'``\\ 。" -#: ../../library/gettext.rst:300 +#: ../../library/gettext.rst:297 msgid "The :class:`GNUTranslations` class" msgstr "" -#: ../../library/gettext.rst:302 +#: ../../library/gettext.rst:299 msgid "" "The :mod:`gettext` module provides one additional class derived from :class:" "`NullTranslations`: :class:`GNUTranslations`. This class overrides :meth:" @@ -367,7 +365,7 @@ msgid "" "in both big-endian and little-endian format." msgstr "" -#: ../../library/gettext.rst:307 +#: ../../library/gettext.rst:304 msgid "" ":class:`GNUTranslations` parses optional metadata out of the translation " "catalog. It is convention with GNU :program:`gettext` to include metadata as " @@ -380,31 +378,31 @@ msgid "" "to Unicode using this encoding, else ASCII is assumed." msgstr "" -#: ../../library/gettext.rst:317 +#: ../../library/gettext.rst:314 msgid "" -"Since message ids are read as Unicode strings too, all :meth:`*gettext` " +"Since message ids are read as Unicode strings too, all ``*gettext()`` " "methods will assume message ids as Unicode strings, not byte strings." msgstr "" -#: ../../library/gettext.rst:320 +#: ../../library/gettext.rst:317 msgid "" "The entire set of key/value pairs are placed into a dictionary and set as " "the \"protected\" :attr:`_info` instance variable." msgstr "" -#: ../../library/gettext.rst:323 +#: ../../library/gettext.rst:320 msgid "" "If the :file:`.mo` file's magic number is invalid, the major version number " "is unexpected, or if other problems occur while reading the file, " "instantiating a :class:`GNUTranslations` class can raise :exc:`OSError`." msgstr "" -#: ../../library/gettext.rst:329 +#: ../../library/gettext.rst:326 msgid "" "The following methods are overridden from the base class implementation:" msgstr "" -#: ../../library/gettext.rst:333 +#: ../../library/gettext.rst:330 msgid "" "Look up the *message* id in the catalog and return the corresponding message " "string, as a Unicode string. If there is no entry in the catalog for the " @@ -413,14 +411,14 @@ msgid "" "*message* id is returned." msgstr "" -#: ../../library/gettext.rst:342 +#: ../../library/gettext.rst:339 msgid "" "Do a plural-forms lookup of a message id. *singular* is used as the message " "id for purposes of lookup in the catalog, while *n* is used to determine " "which plural form to use. The returned message string is a Unicode string." msgstr "" -#: ../../library/gettext.rst:346 +#: ../../library/gettext.rst:343 msgid "" "If the message id is not found in the catalog, and a fallback is specified, " "the request is forwarded to the fallback's :meth:`~NullTranslations." @@ -428,14 +426,14 @@ msgid "" "*plural* is returned in all other cases." msgstr "" -#: ../../library/gettext.rst:351 +#: ../../library/gettext.rst:348 msgid "Here is an example::" msgstr "" "以下是個範例:\n" "\n" "::" -#: ../../library/gettext.rst:363 +#: ../../library/gettext.rst:360 msgid "" "Look up the *context* and *message* id in the catalog and return the " "corresponding message string, as a Unicode string. If there is no entry in " @@ -444,14 +442,14 @@ msgid "" "Otherwise, the *message* id is returned." msgstr "" -#: ../../library/gettext.rst:374 +#: ../../library/gettext.rst:371 msgid "" "Do a plural-forms lookup of a message id. *singular* is used as the message " "id for purposes of lookup in the catalog, while *n* is used to determine " "which plural form to use." msgstr "" -#: ../../library/gettext.rst:378 +#: ../../library/gettext.rst:375 msgid "" "If the message id for *context* is not found in the catalog, and a fallback " "is specified, the request is forwarded to the fallback's :meth:`npgettext` " @@ -459,45 +457,45 @@ msgid "" "returned in all other cases." msgstr "" -#: ../../library/gettext.rst:387 +#: ../../library/gettext.rst:384 msgid "Solaris message catalog support" msgstr "" -#: ../../library/gettext.rst:389 +#: ../../library/gettext.rst:386 msgid "" "The Solaris operating system defines its own binary :file:`.mo` file format, " "but since no documentation can be found on this format, it is not supported " "at this time." msgstr "" -#: ../../library/gettext.rst:395 +#: ../../library/gettext.rst:392 msgid "The Catalog constructor" msgstr "" -#: ../../library/gettext.rst:399 +#: ../../library/gettext.rst:396 msgid "" "GNOME uses a version of the :mod:`gettext` module by James Henstridge, but " "this version has a slightly different API. Its documented usage was::" msgstr "" -#: ../../library/gettext.rst:407 +#: ../../library/gettext.rst:404 msgid "" -"For compatibility with this older module, the function :func:`Catalog` is an " -"alias for the :func:`translation` function described above." +"For compatibility with this older module, the function :func:`!Catalog` is " +"an alias for the :func:`translation` function described above." msgstr "" -#: ../../library/gettext.rst:410 +#: ../../library/gettext.rst:407 msgid "" "One difference between this module and Henstridge's: his catalog objects " "supported access through a mapping API, but this appears to be unused and so " "is not currently supported." msgstr "" -#: ../../library/gettext.rst:417 +#: ../../library/gettext.rst:414 msgid "Internationalizing your programs and modules" msgstr "" -#: ../../library/gettext.rst:419 +#: ../../library/gettext.rst:416 msgid "" "Internationalization (I18N) refers to the operation by which a program is " "made aware of multiple languages. Localization (L10N) refers to the " @@ -506,41 +504,41 @@ msgid "" "Python programs, you need to take the following steps:" msgstr "" -#: ../../library/gettext.rst:425 +#: ../../library/gettext.rst:422 msgid "" "prepare your program or module by specially marking translatable strings" msgstr "" -#: ../../library/gettext.rst:427 +#: ../../library/gettext.rst:424 msgid "" "run a suite of tools over your marked files to generate raw messages catalogs" msgstr "" -#: ../../library/gettext.rst:429 +#: ../../library/gettext.rst:426 msgid "create language-specific translations of the message catalogs" msgstr "" -#: ../../library/gettext.rst:431 +#: ../../library/gettext.rst:428 msgid "" "use the :mod:`gettext` module so that message strings are properly translated" msgstr "" -#: ../../library/gettext.rst:433 +#: ../../library/gettext.rst:430 msgid "" "In order to prepare your code for I18N, you need to look at all the strings " "in your files. Any string that needs to be translated should be marked by " -"wrapping it in ``_('...')`` --- that is, a call to the function :func:`_`. " -"For example::" +"wrapping it in ``_('...')`` --- that is, a call to the function :func:`_ " +"`. For example::" msgstr "" -#: ../../library/gettext.rst:442 +#: ../../library/gettext.rst:439 msgid "" "In this example, the string ``'writing a log message'`` is marked as a " "candidate for translation, while the strings ``'mylog.txt'`` and ``'w'`` are " "not." msgstr "" -#: ../../library/gettext.rst:445 +#: ../../library/gettext.rst:442 msgid "" "There are a few tools to extract the strings meant for translation. The " "original GNU :program:`gettext` only supported C or C++ source code but its " @@ -553,7 +551,7 @@ msgid "" "utils>`__." msgstr "" -#: ../../library/gettext.rst:455 +#: ../../library/gettext.rst:452 msgid "" "(Python also includes pure-Python versions of these programs, called :" "program:`pygettext.py` and :program:`msgfmt.py`; some Python distributions " @@ -566,7 +564,7 @@ msgid "" "GNU :program:`gettext` package to internationalize your Python applications.)" msgstr "" -#: ../../library/gettext.rst:467 +#: ../../library/gettext.rst:464 msgid "" ":program:`xgettext`, :program:`pygettext`, and similar tools generate :file:" "`.po` files that are message catalogs. They are structured human-readable " @@ -574,7 +572,7 @@ msgid "" "placeholder for the translated versions of these strings." msgstr "" -#: ../../library/gettext.rst:473 +#: ../../library/gettext.rst:470 msgid "" "Copies of these :file:`.po` files are then handed over to the individual " "human translators who write translations for every supported natural " @@ -585,25 +583,25 @@ msgid "" "processing at run-time." msgstr "" -#: ../../library/gettext.rst:482 +#: ../../library/gettext.rst:479 msgid "" "How you use the :mod:`gettext` module in your code depends on whether you " "are internationalizing a single module or your entire application. The next " "two sections will discuss each case." msgstr "" -#: ../../library/gettext.rst:488 +#: ../../library/gettext.rst:485 msgid "Localizing your module" msgstr "" -#: ../../library/gettext.rst:490 +#: ../../library/gettext.rst:487 msgid "" "If you are localizing your module, you must take care not to make global " "changes, e.g. to the built-in namespace. You should not use the GNU :program:" "`gettext` API but instead the class-based API." msgstr "" -#: ../../library/gettext.rst:494 +#: ../../library/gettext.rst:491 msgid "" "Let's say your module is called \"spam\" and the module's various natural " "language translation :file:`.mo` files reside in :file:`/usr/share/locale` " @@ -611,143 +609,143 @@ msgid "" "your module::" msgstr "" -#: ../../library/gettext.rst:505 +#: ../../library/gettext.rst:502 msgid "Localizing your application" msgstr "" -#: ../../library/gettext.rst:507 +#: ../../library/gettext.rst:504 msgid "" -"If you are localizing your application, you can install the :func:`_` " +"If you are localizing your application, you can install the :func:`!_` " "function globally into the built-in namespace, usually in the main driver " "file of your application. This will let all your application-specific files " "just use ``_('...')`` without having to explicitly install it in each file." msgstr "" -#: ../../library/gettext.rst:512 +#: ../../library/gettext.rst:509 msgid "" "In the simple case then, you need only add the following bit of code to the " "main driver file of your application::" msgstr "" -#: ../../library/gettext.rst:518 +#: ../../library/gettext.rst:515 msgid "" "If you need to set the locale directory, you can pass it into the :func:" "`install` function::" msgstr "" -#: ../../library/gettext.rst:526 +#: ../../library/gettext.rst:523 msgid "Changing languages on the fly" msgstr "" -#: ../../library/gettext.rst:528 +#: ../../library/gettext.rst:525 msgid "" "If your program needs to support many languages at the same time, you may " "want to create multiple translation instances and then switch between them " "explicitly, like so::" msgstr "" -#: ../../library/gettext.rst:549 +#: ../../library/gettext.rst:546 msgid "Deferred translations" msgstr "" -#: ../../library/gettext.rst:551 +#: ../../library/gettext.rst:548 msgid "" "In most coding situations, strings are translated where they are coded. " "Occasionally however, you need to mark strings for translation, but defer " "actual translation until later. A classic example is::" msgstr "" -#: ../../library/gettext.rst:564 +#: ../../library/gettext.rst:561 msgid "" "Here, you want to mark the strings in the ``animals`` list as being " "translatable, but you don't actually want to translate them until they are " "printed." msgstr "" -#: ../../library/gettext.rst:568 +#: ../../library/gettext.rst:565 msgid "Here is one way you can handle this situation::" msgstr "" -#: ../../library/gettext.rst:584 +#: ../../library/gettext.rst:581 msgid "" -"This works because the dummy definition of :func:`_` simply returns the " +"This works because the dummy definition of :func:`!_` simply returns the " "string unchanged. And this dummy definition will temporarily override any " -"definition of :func:`_` in the built-in namespace (until the :keyword:`del` " -"command). Take care, though if you have a previous definition of :func:`_` " +"definition of :func:`!_` in the built-in namespace (until the :keyword:`del` " +"command). Take care, though if you have a previous definition of :func:`!_` " "in the local namespace." msgstr "" -#: ../../library/gettext.rst:590 +#: ../../library/gettext.rst:587 msgid "" -"Note that the second use of :func:`_` will not identify \"a\" as being " +"Note that the second use of :func:`!_` will not identify \"a\" as being " "translatable to the :program:`gettext` program, because the parameter is not " "a string literal." msgstr "" -#: ../../library/gettext.rst:594 +#: ../../library/gettext.rst:591 msgid "Another way to handle this is with the following example::" msgstr "" -#: ../../library/gettext.rst:608 +#: ../../library/gettext.rst:605 msgid "" -"In this case, you are marking translatable strings with the function :func:" -"`N_`, which won't conflict with any definition of :func:`_`. However, you " +"In this case, you are marking translatable strings with the function :func:`!" +"N_`, which won't conflict with any definition of :func:`!_`. However, you " "will need to teach your message extraction program to look for translatable " -"strings marked with :func:`N_`. :program:`xgettext`, :program:`pygettext`, " +"strings marked with :func:`!N_`. :program:`xgettext`, :program:`pygettext`, " "``pybabel extract``, and :program:`xpot` all support this through the use of " -"the :option:`!-k` command-line switch. The choice of :func:`N_` here is " -"totally arbitrary; it could have just as easily been :func:" -"`MarkThisStringForTranslation`." +"the :option:`!-k` command-line switch. The choice of :func:`!N_` here is " +"totally arbitrary; it could have just as easily been :func:`!" +"MarkThisStringForTranslation`." msgstr "" -#: ../../library/gettext.rst:619 +#: ../../library/gettext.rst:616 msgid "Acknowledgements" msgstr "致謝" -#: ../../library/gettext.rst:621 +#: ../../library/gettext.rst:618 msgid "" "The following people contributed code, feedback, design suggestions, " "previous implementations, and valuable experience to the creation of this " "module:" msgstr "" -#: ../../library/gettext.rst:624 +#: ../../library/gettext.rst:621 msgid "Peter Funk" msgstr "Peter Funk" -#: ../../library/gettext.rst:626 +#: ../../library/gettext.rst:623 msgid "James Henstridge" msgstr "James Henstridge" -#: ../../library/gettext.rst:628 +#: ../../library/gettext.rst:625 msgid "Juan David Ibáñez Palomar" msgstr "Juan David Ibáñez Palomar" -#: ../../library/gettext.rst:630 +#: ../../library/gettext.rst:627 msgid "Marc-André Lemburg" msgstr "Marc-André Lemburg" -#: ../../library/gettext.rst:632 +#: ../../library/gettext.rst:629 msgid "Martin von Löwis" msgstr "Martin von Löwis" -#: ../../library/gettext.rst:634 +#: ../../library/gettext.rst:631 msgid "François Pinard" msgstr "François Pinard" -#: ../../library/gettext.rst:636 +#: ../../library/gettext.rst:633 msgid "Barry Warsaw" msgstr "Barry Warsaw" -#: ../../library/gettext.rst:638 +#: ../../library/gettext.rst:635 msgid "Gustavo Niemeyer" msgstr "Gustavo Niemeyer" -#: ../../library/gettext.rst:641 +#: ../../library/gettext.rst:638 msgid "Footnotes" msgstr "註解" -#: ../../library/gettext.rst:642 +#: ../../library/gettext.rst:639 msgid "" "The default locale directory is system dependent; for example, on RedHat " "Linux it is :file:`/usr/share/locale`, but on Solaris it is :file:`/usr/lib/" @@ -758,7 +756,7 @@ msgid "" "your application." msgstr "" -#: ../../library/gettext.rst:650 +#: ../../library/gettext.rst:647 msgid "See the footnote for :func:`bindtextdomain` above." msgstr "請見上方 :func:`bindtextdomain` 之註解。" @@ -770,6 +768,6 @@ msgstr "_ (底線)" msgid "gettext" msgstr "gettext" -#: ../../library/gettext.rst:397 +#: ../../library/gettext.rst:394 msgid "GNOME" msgstr "GNOME" diff --git a/library/gzip.po b/library/gzip.po index 703b7bda25..b0564b3347 100644 --- a/library/gzip.po +++ b/library/gzip.po @@ -1,13 +1,13 @@ -# 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: +# Adrian Liaw , 2018 msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 10:36+0000\n" +"POT-Creation-Date: 2023-10-12 00:03+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-" @@ -20,7 +20,7 @@ msgstr "" #: ../../library/gzip.rst:2 msgid ":mod:`gzip` --- Support for :program:`gzip` files" -msgstr "" +msgstr ":mod:`gzip` --- :program:`gzip` 檔案的支援" #: ../../library/gzip.rst:7 msgid "**Source code:** :source:`Lib/gzip.py`" @@ -54,7 +54,7 @@ msgstr "" #: ../../library/gzip.rst:26 msgid "The module defines the following items:" -msgstr "" +msgstr "此模組定義了以下項目:" #: ../../library/gzip.rst:31 msgid "" @@ -107,7 +107,7 @@ msgstr "新增 ``'x'``、``'xb'`` 和 ``'xt'`` 模式的支援。" #: ../../library/gzip.rst:59 ../../library/gzip.rst:171 msgid "Accepts a :term:`path-like object`." -msgstr "" +msgstr "接受\\ :term:`類路徑物件 `。" #: ../../library/gzip.rst:64 msgid "" @@ -192,7 +192,7 @@ msgstr "" #: ../../library/gzip.rst:118 msgid ":class:`GzipFile` also provides the following method and attribute:" -msgstr "" +msgstr ":class:`GzipFile` 也提供了以下的方法和屬性:" #: ../../library/gzip.rst:122 msgid "" @@ -243,7 +243,7 @@ msgstr "" #: ../../library/gzip.rst:159 msgid "The :meth:`io.BufferedIOBase.read1` method is now implemented." -msgstr "" +msgstr ":meth:`io.BufferedIOBase.read1` 方法現在已有實作。" #: ../../library/gzip.rst:162 msgid "Added support for the ``'x'`` and ``'xb'`` modes." @@ -309,19 +309,19 @@ msgstr "用法範例" #: ../../library/gzip.rst:217 msgid "Example of how to read a compressed file::" -msgstr "" +msgstr "如何讀取壓縮檔案的範例: ::" #: ../../library/gzip.rst:223 msgid "Example of how to create a compressed GZIP file::" -msgstr "" +msgstr "如何建立一個壓縮的 GZIP 檔案的範例: ::" #: ../../library/gzip.rst:230 msgid "Example of how to GZIP compress an existing file::" -msgstr "" +msgstr "如何壓縮一個已存在的檔案的範例: ::" #: ../../library/gzip.rst:238 msgid "Example of how to GZIP compress a binary string::" -msgstr "" +msgstr "如何壓縮一個二進位字串的範例: ::" #: ../../library/gzip.rst:247 msgid "Module :mod:`zlib`" @@ -333,46 +333,46 @@ msgid "" "format." msgstr "" -#: ../../library/gzip.rst:254 +#: ../../library/gzip.rst:256 msgid "Command Line Interface" -msgstr "" +msgstr "命令列介面" -#: ../../library/gzip.rst:256 +#: ../../library/gzip.rst:258 msgid "" "The :mod:`gzip` module provides a simple command line interface to compress " "or decompress files." msgstr "" -#: ../../library/gzip.rst:259 +#: ../../library/gzip.rst:261 msgid "Once executed the :mod:`gzip` module keeps the input file(s)." msgstr "" -#: ../../library/gzip.rst:263 +#: ../../library/gzip.rst:265 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:267 +#: ../../library/gzip.rst:269 msgid "Command line options" -msgstr "" +msgstr "命令列選項" -#: ../../library/gzip.rst:271 +#: ../../library/gzip.rst:273 msgid "If *file* is not specified, read from :data:`sys.stdin`." -msgstr "" +msgstr "如果未指定 *file*,則從 :data:`sys.stdin` 讀取。" -#: ../../library/gzip.rst:275 +#: ../../library/gzip.rst:277 msgid "Indicates the fastest compression method (less compression)." msgstr "" -#: ../../library/gzip.rst:279 +#: ../../library/gzip.rst:281 msgid "Indicates the slowest compression method (best compression)." msgstr "" -#: ../../library/gzip.rst:283 +#: ../../library/gzip.rst:285 msgid "Decompress the given file." -msgstr "" +msgstr "解壓縮指定的檔案。" -#: ../../library/gzip.rst:287 +#: ../../library/gzip.rst:289 msgid "Show the help message." -msgstr "" +msgstr "顯示幫助訊息。" diff --git a/library/html.parser.po b/library/html.parser.po index 6b2e17cfe4..3541d18e9f 100644 --- a/library/html.parser.po +++ b/library/html.parser.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-02-18 00:10+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2023-05-04 22:54+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -231,15 +231,15 @@ msgstr "" #: ../../library/html.parser.rst:175 msgid "" "This method is called to process decimal and hexadecimal numeric character " -"references of the form ``&#NNN;`` and ``&#xNNN;``. For example, the decimal " -"equivalent for ``>`` is ``>``, whereas the hexadecimal is ``>``; " -"in this case the method will receive ``'62'`` or ``'x3E'``. This method is " -"never called if *convert_charrefs* is ``True``." +"references of the form :samp:`&#{NNN};` and :samp:`&#x{NNN};`. For example, " +"the decimal equivalent for ``>`` is ``>``, whereas the hexadecimal is " +"``>``; in this case the method will receive ``'62'`` or ``'x3E'``. " +"This method is never called if *convert_charrefs* is ``True``." msgstr "" -"呼叫此方法來處理 ``#NNN;`` 和 ``&#xNNN;`` 形式的十進位和十六進位數字字元參" -"照。例如,``>`` 的十進位等效為 ``>``,而十六進位為 ``>``;在這種" -"情況下,該方法將收到 ``'62'`` 或 ``'x3E'``。如果 *convert_charrefs* 為 " -"``True``,則永遠不會呼叫此方法。" +"呼叫此方法來處理 :samp:`&#{NNN};` 和 :samp:`&#x{NNN};` 形式的十進位和十六進位" +"數字字元參照。例如,``>`` 的十進位等效為 ``>``,而十六進位為 ``>" +"``;在這種情況下,該方法將收到 ``'62'`` 或 ``'x3E'``。如果 " +"*convert_charrefs* 為 ``True``,則永遠不會呼叫此方法。" #: ../../library/html.parser.rst:184 msgid "" diff --git a/library/http.cookiejar.po b/library/http.cookiejar.po index 022fe9d2ee..ff0abea3da 100644 --- a/library/http.cookiejar.po +++ b/library/http.cookiejar.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2016-11-19 00:31+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -69,7 +69,8 @@ msgstr "" #: ../../library/http.cookiejar.rst:46 msgid "" -"LoadError was made a subclass of :exc:`OSError` instead of :exc:`IOError`." +":exc:`LoadError` used to be a subtype of :exc:`IOError`, which is now an " +"alias of :exc:`OSError`." msgstr "" #: ../../library/http.cookiejar.rst:51 @@ -630,10 +631,10 @@ msgid "" "cookie domain to be matched. For example, ``\"example.com\"`` matches a " "blocklist entry of ``\"example.com\"``, but ``\"www.example.com\"`` does " "not. Domains that do start with a dot are matched by more specific domains " -"too. For example, both ``\"www.example.com\"`` and ``\"www.coyote.example.com" -"\"`` match ``\".example.com\"`` (but ``\"example.com\"`` itself does not). " -"IP addresses are an exception, and must match exactly. For example, if " -"blocked_domains contains ``\"192.168.1.2\"`` and ``\".168.1.2\"``, " +"too. For example, both ``\"www.example.com\"`` and ``\"www.coyote.example." +"com\"`` match ``\".example.com\"`` (but ``\"example.com\"`` itself does " +"not). IP addresses are an exception, and must match exactly. For example, " +"if blocked_domains contains ``\"192.168.1.2\"`` and ``\".168.1.2\"``, " "192.168.1.2 is blocked, but 193.168.1.2 is not." msgstr "" diff --git a/library/http.server.po b/library/http.server.po index 1a5ec94aa5..c48bf130f8 100644 --- a/library/http.server.po +++ b/library/http.server.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-10-11 17:13+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-" @@ -265,8 +265,8 @@ msgid "" "attribute holds the default values for *message* and *explain* that will be " "used if no value is provided; for unknown codes the default value for both " "is the string ``???``. The body will be empty if the method is HEAD or the " -"response code is one of the following: ``1xx``, ``204 No Content``, ``205 " -"Reset Content``, ``304 Not Modified``." +"response code is one of the following: :samp:`1{xx}`, ``204 No Content``, " +"``205 Reset Content``, ``304 Not Modified``." msgstr "" #: ../../library/http.server.rst:223 diff --git a/library/idle.po b/library/idle.po index 521bc73b78..0046d297a0 100644 --- a/library/idle.po +++ b/library/idle.po @@ -1199,7 +1199,7 @@ msgstr "" #: ../../library/idle.rst:672 msgid "Command line usage" -msgstr "" +msgstr "命令列用法" #: ../../library/idle.rst:688 msgid "If there are arguments:" diff --git a/library/inspect.po b/library/inspect.po index 65cac3464a..8f55ff930d 100644 --- a/library/inspect.po +++ b/library/inspect.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-09-06 16:53+0000\n" +"POT-Creation-Date: 2023-10-12 00:03+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-" @@ -1785,28 +1785,28 @@ msgstr "" msgid "Get current state of a generator-iterator." msgstr "" -#: ../../library/inspect.rst:1464 ../../library/inspect.rst:1479 -#: ../../library/inspect.rst:1495 +#: ../../library/inspect.rst:1460 ../../library/inspect.rst:1476 +#: ../../library/inspect.rst:1493 msgid "Possible states are:" msgstr "" -#: ../../library/inspect.rst:1461 +#: ../../library/inspect.rst:1462 msgid "GEN_CREATED: Waiting to start execution." msgstr "" -#: ../../library/inspect.rst:1462 +#: ../../library/inspect.rst:1463 msgid "GEN_RUNNING: Currently being executed by the interpreter." msgstr "" -#: ../../library/inspect.rst:1463 +#: ../../library/inspect.rst:1464 msgid "GEN_SUSPENDED: Currently suspended at a yield expression." msgstr "" -#: ../../library/inspect.rst:1464 +#: ../../library/inspect.rst:1465 msgid "GEN_CLOSED: Execution has completed." msgstr "" -#: ../../library/inspect.rst:1470 +#: ../../library/inspect.rst:1471 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 " @@ -1814,23 +1814,23 @@ msgid "" "``cr_frame`` attributes." msgstr "" -#: ../../library/inspect.rst:1476 +#: ../../library/inspect.rst:1478 msgid "CORO_CREATED: Waiting to start execution." msgstr "" -#: ../../library/inspect.rst:1477 +#: ../../library/inspect.rst:1479 msgid "CORO_RUNNING: Currently being executed by the interpreter." msgstr "" -#: ../../library/inspect.rst:1478 +#: ../../library/inspect.rst:1480 msgid "CORO_SUSPENDED: Currently suspended at an await expression." msgstr "" -#: ../../library/inspect.rst:1479 +#: ../../library/inspect.rst:1481 msgid "CORO_CLOSED: Execution has completed." msgstr "" -#: ../../library/inspect.rst:1485 +#: ../../library/inspect.rst:1487 msgid "" "Get current state of an asynchronous generator object. The function is " "intended to be used with asynchronous iterator objects created by :keyword:" @@ -1839,30 +1839,30 @@ msgid "" "``ag_frame`` attributes." msgstr "" -#: ../../library/inspect.rst:1492 +#: ../../library/inspect.rst:1495 msgid "AGEN_CREATED: Waiting to start execution." msgstr "" -#: ../../library/inspect.rst:1493 +#: ../../library/inspect.rst:1496 msgid "AGEN_RUNNING: Currently being executed by the interpreter." msgstr "" -#: ../../library/inspect.rst:1494 +#: ../../library/inspect.rst:1497 msgid "AGEN_SUSPENDED: Currently suspended at a yield expression." msgstr "" -#: ../../library/inspect.rst:1495 +#: ../../library/inspect.rst:1498 msgid "AGEN_CLOSED: Execution has completed." msgstr "" -#: ../../library/inspect.rst:1499 +#: ../../library/inspect.rst:1502 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:1505 +#: ../../library/inspect.rst:1508 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. " @@ -1870,14 +1870,14 @@ msgid "" "generator, and all the same caveats apply." msgstr "" -#: ../../library/inspect.rst:1510 +#: ../../library/inspect.rst:1513 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:1516 +#: ../../library/inspect.rst:1519 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 " @@ -1885,79 +1885,79 @@ msgid "" "dictionary." msgstr "" -#: ../../library/inspect.rst:1525 +#: ../../library/inspect.rst:1528 msgid "" "This function is analogous to :func:`~inspect.getgeneratorlocals`, but works " "for coroutine objects created by :keyword:`async def` functions." msgstr "" -#: ../../library/inspect.rst:1532 +#: ../../library/inspect.rst:1535 msgid "" "This function is analogous to :func:`~inspect.getgeneratorlocals`, but works " "for asynchronous generator objects created by :keyword:`async def` functions " "which use the :keyword:`yield` statement." msgstr "" -#: ../../library/inspect.rst:1542 +#: ../../library/inspect.rst:1545 msgid "Code Objects Bit Flags" msgstr "" -#: ../../library/inspect.rst:1544 +#: ../../library/inspect.rst:1547 msgid "" "Python code objects have a ``co_flags`` attribute, which is a bitmap of the " "following flags:" msgstr "" -#: ../../library/inspect.rst:1549 +#: ../../library/inspect.rst:1552 msgid "The code object is optimized, using fast locals." msgstr "" -#: ../../library/inspect.rst:1553 +#: ../../library/inspect.rst:1556 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:1558 +#: ../../library/inspect.rst:1561 msgid "The code object has a variable positional parameter (``*args``-like)." msgstr "" -#: ../../library/inspect.rst:1562 +#: ../../library/inspect.rst:1565 msgid "The code object has a variable keyword parameter (``**kwargs``-like)." msgstr "" -#: ../../library/inspect.rst:1566 +#: ../../library/inspect.rst:1569 msgid "The flag is set when the code object is a nested function." msgstr "" -#: ../../library/inspect.rst:1570 +#: ../../library/inspect.rst:1573 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:1575 +#: ../../library/inspect.rst:1578 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:1583 +#: ../../library/inspect.rst:1586 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:1592 +#: ../../library/inspect.rst:1595 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:1599 +#: ../../library/inspect.rst:1602 msgid "" "The flags are specific to CPython, and may not be defined in other Python " "implementations. Furthermore, the flags are an implementation detail, and " @@ -1965,39 +1965,39 @@ msgid "" "use public APIs from the :mod:`inspect` module for any introspection needs." msgstr "" -#: ../../library/inspect.rst:1607 +#: ../../library/inspect.rst:1610 msgid "Buffer flags" msgstr "" -#: ../../library/inspect.rst:1611 +#: ../../library/inspect.rst:1614 msgid "" "This is an :class:`enum.IntFlag` that represents the flags that can be " "passed to the :meth:`~object.__buffer__` method of objects implementing the :" "ref:`buffer protocol `." msgstr "" -#: ../../library/inspect.rst:1615 +#: ../../library/inspect.rst:1618 msgid "The meaning of the flags is explained at :ref:`buffer-request-types`." msgstr "" -#: ../../library/inspect.rst:1642 +#: ../../library/inspect.rst:1645 msgid "Command Line Interface" -msgstr "" +msgstr "命令列介面" -#: ../../library/inspect.rst:1644 +#: ../../library/inspect.rst:1647 msgid "" "The :mod:`inspect` module also provides a basic introspection capability " "from the command line." msgstr "" -#: ../../library/inspect.rst:1649 +#: ../../library/inspect.rst:1652 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:1655 +#: ../../library/inspect.rst:1658 msgid "" "Print information about the specified object rather than the source code" msgstr "" diff --git a/library/json.po b/library/json.po index 34790dc35c..f7702f267a 100644 --- a/library/json.po +++ b/library/json.po @@ -50,8 +50,8 @@ msgid "" "string may cause the decoder to consume considerable CPU and memory " "resources. Limiting the size of data to be parsed is recommended." msgstr "" -"當剖析無法信任來源的 JSON 資料時要小心。一段惡意的 JSON 字串可能會導致" -"解碼器耗費大量 CPU 與記憶體資源。建議限制剖析資料的大小。" +"當剖析無法信任來源的 JSON 資料時要小心。一段惡意的 JSON 字串可能會導致解碼器" +"耗費大量 CPU 與記憶體資源。建議限制剖析資料的大小。" #: ../../library/json.rst:26 msgid "" @@ -778,7 +778,7 @@ msgstr "" #: ../../library/json.rst:673 msgid "Command Line Interface" -msgstr "" +msgstr "命令列介面" #: ../../library/json.rst:678 msgid "**Source code:** :source:`Lib/json/tool.py`" @@ -804,7 +804,7 @@ msgstr "" #: ../../library/json.rst:704 msgid "Command line options" -msgstr "" +msgstr "命令列選項" #: ../../library/json.rst:708 msgid "The JSON file to be validated or pretty-printed:" diff --git a/library/logging.po b/library/logging.po index a01a4bd182..b3823e886e 100644 --- a/library/logging.po +++ b/library/logging.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 10:36+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2023-08-20 16:49+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -51,8 +51,7 @@ msgid "" "This module defines functions and classes which implement a flexible event " "logging system for applications and libraries." msgstr "" -"這個模組定義了函式與類別 (class),為應用程式和函式庫實作彈性的日誌管理系" -"統。" +"這個模組定義了函式與類別 (class),為應用程式和函式庫實作彈性的日誌管理系統。" #: ../../library/logging.rst:28 msgid "" @@ -61,10 +60,9 @@ msgid "" "application log can include your own messages integrated with messages from " "third-party modules." msgstr "" -"由標準函式庫模組提供的日誌記錄 API 的主要好處是," -"所有的 Python 模組都能參與日誌記錄," -"因此您的應用程式日誌可以包含您自己的訊息," -"並與來自第三方模組的訊息整合在一起。" +"由標準函式庫模組提供的日誌記錄 API 的主要好處是,所有的 Python 模組都能參與日" +"誌記錄,因此您的應用程式日誌可以包含您自己的訊息,並與來自第三方模組的訊息整" +"合在一起。" #: ../../library/logging.rst:33 msgid "The simplest example:" @@ -1117,7 +1115,7 @@ msgstr "" 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: " -"a placeholder of ``{msecs:03d}`` would format a millisecond value of ``4`` " +"a placeholder of ``{msecs:03.0f}`` would format a millisecond value of ``4`` " "as ``004``. Refer to the :meth:`str.format` documentation for full details " "on the options available to you." msgstr "" diff --git a/library/lzma.po b/library/lzma.po index 9ccd407592..245b87f7f2 100644 --- a/library/lzma.po +++ b/library/lzma.po @@ -1,5 +1,4 @@ -# 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: @@ -7,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 10:36+0000\n" +"POT-Creation-Date: 2023-10-12 00:03+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-" @@ -475,15 +474,15 @@ msgid "" "filter-dependent options. Valid filter IDs are as follows:" msgstr "" -#: ../../library/lzma.rst:337 +#: ../../library/lzma.rst:335 msgid "Compression filters:" msgstr "" -#: ../../library/lzma.rst:336 +#: ../../library/lzma.rst:337 msgid ":const:`FILTER_LZMA1` (for use with :const:`FORMAT_ALONE`)" msgstr "" -#: ../../library/lzma.rst:337 +#: ../../library/lzma.rst:338 msgid "" ":const:`FILTER_LZMA2` (for use with :const:`FORMAT_XZ` and :const:" "`FORMAT_RAW`)" @@ -493,100 +492,100 @@ msgstr "" msgid "Delta filter:" msgstr "" -#: ../../library/lzma.rst:340 +#: ../../library/lzma.rst:342 msgid ":const:`FILTER_DELTA`" msgstr ":const:`FILTER_DELTA`" -#: ../../library/lzma.rst:348 +#: ../../library/lzma.rst:344 msgid "Branch-Call-Jump (BCJ) filters:" msgstr "" -#: ../../library/lzma.rst:343 +#: ../../library/lzma.rst:346 msgid ":const:`FILTER_X86`" msgstr ":const:`FILTER_X86`" -#: ../../library/lzma.rst:344 +#: ../../library/lzma.rst:347 msgid ":const:`FILTER_IA64`" msgstr ":const:`FILTER_IA64`" -#: ../../library/lzma.rst:345 +#: ../../library/lzma.rst:348 msgid ":const:`FILTER_ARM`" msgstr ":const:`FILTER_ARM`" -#: ../../library/lzma.rst:346 +#: ../../library/lzma.rst:349 msgid ":const:`FILTER_ARMTHUMB`" msgstr ":const:`FILTER_ARMTHUMB`" -#: ../../library/lzma.rst:347 +#: ../../library/lzma.rst:350 msgid ":const:`FILTER_POWERPC`" msgstr ":const:`FILTER_POWERPC`" -#: ../../library/lzma.rst:348 +#: ../../library/lzma.rst:351 msgid ":const:`FILTER_SPARC`" msgstr ":const:`FILTER_SPARC`" -#: ../../library/lzma.rst:350 +#: ../../library/lzma.rst:353 msgid "" "A filter chain can consist of up to 4 filters, and cannot be empty. The last " "filter in the chain must be a compression filter, and any other filters must " "be delta or BCJ filters." msgstr "" -#: ../../library/lzma.rst:354 +#: ../../library/lzma.rst:357 msgid "" "Compression filters support the following options (specified as additional " "entries in the dictionary representing the filter):" msgstr "" -#: ../../library/lzma.rst:357 +#: ../../library/lzma.rst:360 msgid "" "``preset``: A compression preset to use as a source of default values for " "options that are not specified explicitly." msgstr "" -#: ../../library/lzma.rst:359 +#: ../../library/lzma.rst:362 msgid "" "``dict_size``: Dictionary size in bytes. This should be between 4 KiB and " "1.5 GiB (inclusive)." msgstr "" -#: ../../library/lzma.rst:361 +#: ../../library/lzma.rst:364 msgid "``lc``: Number of literal context bits." msgstr "" -#: ../../library/lzma.rst:362 +#: ../../library/lzma.rst:365 msgid "" "``lp``: Number of literal position bits. The sum ``lc + lp`` must be at most " "4." msgstr "" -#: ../../library/lzma.rst:364 +#: ../../library/lzma.rst:367 msgid "``pb``: Number of position bits; must be at most 4." msgstr "" -#: ../../library/lzma.rst:365 +#: ../../library/lzma.rst:368 msgid "``mode``: :const:`MODE_FAST` or :const:`MODE_NORMAL`." msgstr "" -#: ../../library/lzma.rst:366 +#: ../../library/lzma.rst:369 msgid "" "``nice_len``: What should be considered a \"nice length\" for a match. This " "should be 273 or less." msgstr "" -#: ../../library/lzma.rst:368 +#: ../../library/lzma.rst:371 msgid "" "``mf``: What match finder to use -- :const:`MF_HC3`, :const:`MF_HC4`, :const:" "`MF_BT2`, :const:`MF_BT3`, or :const:`MF_BT4`." msgstr "" -#: ../../library/lzma.rst:370 +#: ../../library/lzma.rst:373 msgid "" "``depth``: Maximum search depth used by match finder. 0 (default) means to " "select automatically based on other filter options." msgstr "" -#: ../../library/lzma.rst:373 +#: ../../library/lzma.rst:376 msgid "" "The delta filter stores the differences between bytes, producing more " "repetitive input for the compressor in certain circumstances. It supports " @@ -595,7 +594,7 @@ msgid "" "bytes." msgstr "" -#: ../../library/lzma.rst:378 +#: ../../library/lzma.rst:381 msgid "" "The BCJ filters are intended to be applied to machine code. They convert " "relative branches, calls and jumps in the code to use absolute addressing, " @@ -605,30 +604,30 @@ msgid "" "data. The default is 0." msgstr "" -#: ../../library/lzma.rst:386 +#: ../../library/lzma.rst:389 msgid "Examples" msgstr "範例" -#: ../../library/lzma.rst:388 +#: ../../library/lzma.rst:391 msgid "Reading in a compressed file::" msgstr "" -#: ../../library/lzma.rst:394 +#: ../../library/lzma.rst:397 msgid "Creating a compressed file::" msgstr "" -#: ../../library/lzma.rst:401 +#: ../../library/lzma.rst:404 msgid "Compressing data in memory::" msgstr "" -#: ../../library/lzma.rst:407 +#: ../../library/lzma.rst:410 msgid "Incremental compression::" msgstr "" -#: ../../library/lzma.rst:418 +#: ../../library/lzma.rst:421 msgid "Writing compressed data to an already-open file::" msgstr "" -#: ../../library/lzma.rst:427 +#: ../../library/lzma.rst:430 msgid "Creating a compressed file using a custom filter chain::" msgstr "" diff --git a/library/multiprocessing.po b/library/multiprocessing.po index 2d6e9bd948..38134ab93d 100644 --- a/library/multiprocessing.po +++ b/library/multiprocessing.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-31 00:03+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2018-05-23 16:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -133,7 +133,7 @@ msgid "" "Available on POSIX and Windows platforms. The default on Windows and macOS." msgstr "" -#: ../../library/multiprocessing.rst:132 +#: ../../library/multiprocessing.rst:138 msgid "*fork*" msgstr "" @@ -157,11 +157,19 @@ msgid "" "or :func:`set_start_method`." msgstr "" -#: ../../library/multiprocessing.rst:145 +#: ../../library/multiprocessing.rst:134 +msgid "" +"If Python is able to detect that your process has multiple threads, the :" +"func:`os.fork` function that this start method calls internally will raise " +"a :exc:`DeprecationWarning`. Use a different start method. See the :func:`os." +"fork` documentation for further explanation." +msgstr "" + +#: ../../library/multiprocessing.rst:151 msgid "*forkserver*" msgstr "" -#: ../../library/multiprocessing.rst:135 +#: ../../library/multiprocessing.rst:141 msgid "" "When the program starts and selects the *forkserver* start method, a server " "process is spawned. From then on, whenever a new process is needed, the " @@ -171,27 +179,27 @@ msgid "" "for it to use :func:`os.fork`. No unnecessary resources are inherited." msgstr "" -#: ../../library/multiprocessing.rst:143 +#: ../../library/multiprocessing.rst:149 msgid "" "Available on POSIX platforms which support passing file descriptors over " "Unix pipes such as Linux." msgstr "" -#: ../../library/multiprocessing.rst:149 +#: ../../library/multiprocessing.rst:155 msgid "" "On macOS, the *spawn* start method is now the default. The *fork* start " "method should be considered unsafe as it can lead to crashes of the " "subprocess as macOS system libraries may start threads. See :issue:`33725`." msgstr "" -#: ../../library/multiprocessing.rst:153 +#: ../../library/multiprocessing.rst:159 msgid "" "*spawn* added on all POSIX platforms, and *forkserver* added for some POSIX " "platforms. Child processes no longer inherit all of the parents inheritable " "handles on Windows." msgstr "" -#: ../../library/multiprocessing.rst:159 +#: ../../library/multiprocessing.rst:165 msgid "" "On POSIX using the *spawn* or *forkserver* start methods will also start a " "*resource tracker* process which tracks the unlinked named system resources " @@ -206,25 +214,25 @@ msgid "" "space in the main memory.)" msgstr "" -#: ../../library/multiprocessing.rst:172 +#: ../../library/multiprocessing.rst:178 msgid "" "To select a start method you use the :func:`set_start_method` in the ``if " "__name__ == '__main__'`` clause of the main module. For example::" msgstr "" -#: ../../library/multiprocessing.rst:189 +#: ../../library/multiprocessing.rst:195 msgid "" ":func:`set_start_method` should not be used more than once in the program." msgstr "" -#: ../../library/multiprocessing.rst:192 +#: ../../library/multiprocessing.rst:198 msgid "" "Alternatively, you can use :func:`get_context` to obtain a context object. " "Context objects have the same API as the multiprocessing module, and allow " "one to use multiple start methods in the same program. ::" msgstr "" -#: ../../library/multiprocessing.rst:210 +#: ../../library/multiprocessing.rst:216 msgid "" "Note that objects related to one context may not be compatible with " "processes for a different context. In particular, locks created using the " @@ -232,13 +240,13 @@ msgid "" "*forkserver* start methods." msgstr "" -#: ../../library/multiprocessing.rst:215 +#: ../../library/multiprocessing.rst:221 msgid "" "A library which wants to use a particular start method should probably use :" "func:`get_context` to avoid interfering with the choice of the library user." msgstr "" -#: ../../library/multiprocessing.rst:221 +#: ../../library/multiprocessing.rst:227 msgid "" "The ``'spawn'`` and ``'forkserver'`` start methods generally cannot be used " "with \"frozen\" executables (i.e., binaries produced by packages like " @@ -246,41 +254,41 @@ msgid "" "method may work if code does not use threads." msgstr "" -#: ../../library/multiprocessing.rst:228 +#: ../../library/multiprocessing.rst:234 msgid "Exchanging objects between processes" msgstr "" -#: ../../library/multiprocessing.rst:230 +#: ../../library/multiprocessing.rst:236 msgid "" ":mod:`multiprocessing` supports two types of communication channel between " "processes:" msgstr "" -#: ../../library/multiprocessing.rst:233 +#: ../../library/multiprocessing.rst:239 msgid "**Queues**" msgstr "" -#: ../../library/multiprocessing.rst:235 +#: ../../library/multiprocessing.rst:241 msgid "" "The :class:`Queue` class is a near clone of :class:`queue.Queue`. For " "example::" msgstr "" -#: ../../library/multiprocessing.rst:250 +#: ../../library/multiprocessing.rst:256 msgid "Queues are thread and process safe." msgstr "" -#: ../../library/multiprocessing.rst:252 +#: ../../library/multiprocessing.rst:258 msgid "**Pipes**" msgstr "" -#: ../../library/multiprocessing.rst:254 +#: ../../library/multiprocessing.rst:260 msgid "" "The :func:`Pipe` function returns a pair of connection objects connected by " "a pipe which by default is duplex (two-way). For example::" msgstr "" -#: ../../library/multiprocessing.rst:270 +#: ../../library/multiprocessing.rst:276 msgid "" "The two connection objects returned by :func:`Pipe` represent the two ends " "of the pipe. Each connection object has :meth:`~Connection.send` and :meth:" @@ -290,55 +298,55 @@ msgid "" "corruption from processes using different ends of the pipe at the same time." msgstr "" -#: ../../library/multiprocessing.rst:280 +#: ../../library/multiprocessing.rst:286 msgid "Synchronization between processes" msgstr "" -#: ../../library/multiprocessing.rst:282 +#: ../../library/multiprocessing.rst:288 msgid "" ":mod:`multiprocessing` contains equivalents of all the synchronization " "primitives from :mod:`threading`. For instance one can use a lock to ensure " "that only one process prints to standard output at a time::" msgstr "" -#: ../../library/multiprocessing.rst:301 +#: ../../library/multiprocessing.rst:307 msgid "" "Without using the lock output from the different processes is liable to get " "all mixed up." msgstr "" -#: ../../library/multiprocessing.rst:306 +#: ../../library/multiprocessing.rst:312 msgid "Sharing state between processes" msgstr "" -#: ../../library/multiprocessing.rst:308 +#: ../../library/multiprocessing.rst:314 msgid "" "As mentioned above, when doing concurrent programming it is usually best to " "avoid using shared state as far as possible. This is particularly true when " "using multiple processes." msgstr "" -#: ../../library/multiprocessing.rst:312 +#: ../../library/multiprocessing.rst:318 msgid "" "However, if you really do need to use some shared data then :mod:" "`multiprocessing` provides a couple of ways of doing so." msgstr "" -#: ../../library/multiprocessing.rst:315 +#: ../../library/multiprocessing.rst:321 msgid "**Shared memory**" msgstr "" -#: ../../library/multiprocessing.rst:317 +#: ../../library/multiprocessing.rst:323 msgid "" "Data can be stored in a shared memory map using :class:`Value` or :class:" "`Array`. For example, the following code ::" msgstr "" -#: ../../library/multiprocessing.rst:338 ../../library/multiprocessing.rst:384 +#: ../../library/multiprocessing.rst:344 ../../library/multiprocessing.rst:390 msgid "will print ::" msgstr "" -#: ../../library/multiprocessing.rst:343 +#: ../../library/multiprocessing.rst:349 msgid "" "The ``'d'`` and ``'i'`` arguments used when creating ``num`` and ``arr`` are " "typecodes of the kind used by the :mod:`array` module: ``'d'`` indicates a " @@ -346,25 +354,25 @@ msgid "" "objects will be process and thread-safe." msgstr "" -#: ../../library/multiprocessing.rst:348 +#: ../../library/multiprocessing.rst:354 msgid "" "For more flexibility in using shared memory one can use the :mod:" "`multiprocessing.sharedctypes` module which supports the creation of " "arbitrary ctypes objects allocated from shared memory." msgstr "" -#: ../../library/multiprocessing.rst:352 +#: ../../library/multiprocessing.rst:358 msgid "**Server process**" msgstr "" -#: ../../library/multiprocessing.rst:354 +#: ../../library/multiprocessing.rst:360 msgid "" "A manager object returned by :func:`Manager` controls a server process which " "holds Python objects and allows other processes to manipulate them using " "proxies." msgstr "" -#: ../../library/multiprocessing.rst:358 +#: ../../library/multiprocessing.rst:364 msgid "" "A manager returned by :func:`Manager` will support types :class:`list`, :" "class:`dict`, :class:`~managers.Namespace`, :class:`Lock`, :class:`RLock`, :" @@ -373,7 +381,7 @@ msgid "" "`Array`. For example, ::" msgstr "" -#: ../../library/multiprocessing.rst:389 +#: ../../library/multiprocessing.rst:395 msgid "" "Server process managers are more flexible than using shared memory objects " "because they can be made to support arbitrary object types. Also, a single " @@ -381,31 +389,31 @@ msgid "" "They are, however, slower than using shared memory." msgstr "" -#: ../../library/multiprocessing.rst:396 +#: ../../library/multiprocessing.rst:402 msgid "Using a pool of workers" msgstr "" -#: ../../library/multiprocessing.rst:398 +#: ../../library/multiprocessing.rst:404 msgid "" "The :class:`~multiprocessing.pool.Pool` class represents a pool of worker " "processes. It has methods which allows tasks to be offloaded to the worker " "processes in a few different ways." msgstr "" -#: ../../library/multiprocessing.rst:402 +#: ../../library/multiprocessing.rst:408 msgid "For example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/multiprocessing.rst:446 +#: ../../library/multiprocessing.rst:452 msgid "" "Note that the methods of a pool should only ever be used by the process " "which created it." msgstr "" -#: ../../library/multiprocessing.rst:451 +#: ../../library/multiprocessing.rst:457 msgid "" "Functionality within this package requires that the ``__main__`` module be " "importable by the children. This is covered in :ref:`multiprocessing-" @@ -414,35 +422,35 @@ msgid "" "work in the interactive interpreter. For example::" msgstr "" -#: ../../library/multiprocessing.rst:474 +#: ../../library/multiprocessing.rst:480 msgid "" "(If you try this it will actually output three full tracebacks interleaved " "in a semi-random fashion, and then you may have to stop the parent process " "somehow.)" msgstr "" -#: ../../library/multiprocessing.rst:480 +#: ../../library/multiprocessing.rst:486 msgid "Reference" msgstr "" -#: ../../library/multiprocessing.rst:482 +#: ../../library/multiprocessing.rst:488 msgid "" "The :mod:`multiprocessing` package mostly replicates the API of the :mod:" "`threading` module." msgstr "" -#: ../../library/multiprocessing.rst:487 +#: ../../library/multiprocessing.rst:493 msgid ":class:`Process` and exceptions" msgstr ":class:`Process` 與例外" -#: ../../library/multiprocessing.rst:492 +#: ../../library/multiprocessing.rst:498 msgid "" "Process objects represent activity that is run in a separate process. The :" "class:`Process` class has equivalents of all the methods of :class:" "`threading.Thread`." msgstr "" -#: ../../library/multiprocessing.rst:496 +#: ../../library/multiprocessing.rst:502 msgid "" "The constructor should always be called with keyword arguments. *group* " "should always be ``None``; it exists solely for compatibility with :class:" @@ -456,29 +464,29 @@ msgid "" "creating process." msgstr "" -#: ../../library/multiprocessing.rst:507 +#: ../../library/multiprocessing.rst:513 msgid "" "By default, no arguments are passed to *target*. The *args* argument, which " "defaults to ``()``, can be used to specify a list or tuple of the arguments " "to pass to *target*." msgstr "" -#: ../../library/multiprocessing.rst:511 +#: ../../library/multiprocessing.rst:517 msgid "" "If a subclass overrides the constructor, it must make sure it invokes the " "base class constructor (:meth:`Process.__init__`) before doing anything else " "to the process." msgstr "" -#: ../../library/multiprocessing.rst:515 +#: ../../library/multiprocessing.rst:521 msgid "Added the *daemon* argument." msgstr "新增 *daemon* 引數。" -#: ../../library/multiprocessing.rst:520 +#: ../../library/multiprocessing.rst:526 msgid "Method representing the process's activity." msgstr "" -#: ../../library/multiprocessing.rst:522 +#: ../../library/multiprocessing.rst:528 msgid "" "You may override this method in a subclass. The standard :meth:`run` method " "invokes the callable object passed to the object's constructor as the target " @@ -486,30 +494,30 @@ msgid "" "*args* and *kwargs* arguments, respectively." msgstr "" -#: ../../library/multiprocessing.rst:527 +#: ../../library/multiprocessing.rst:533 msgid "" "Using a list or tuple as the *args* argument passed to :class:`Process` " "achieves the same effect." msgstr "" -#: ../../library/multiprocessing.rst:530 +#: ../../library/multiprocessing.rst:536 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/multiprocessing.rst:542 +#: ../../library/multiprocessing.rst:548 msgid "Start the process's activity." msgstr "" -#: ../../library/multiprocessing.rst:544 +#: ../../library/multiprocessing.rst:550 msgid "" "This must be called at most once per process object. It arranges for the " "object's :meth:`run` method to be invoked in a separate process." msgstr "" -#: ../../library/multiprocessing.rst:549 +#: ../../library/multiprocessing.rst:555 msgid "" "If the optional argument *timeout* is ``None`` (the default), the method " "blocks until the process whose :meth:`join` method is called terminates. If " @@ -519,23 +527,23 @@ msgid "" "terminated." msgstr "" -#: ../../library/multiprocessing.rst:556 +#: ../../library/multiprocessing.rst:562 msgid "A process can be joined many times." msgstr "" -#: ../../library/multiprocessing.rst:558 +#: ../../library/multiprocessing.rst:564 msgid "" "A process cannot join itself because this would cause a deadlock. It is an " "error to attempt to join a process before it has been started." msgstr "" -#: ../../library/multiprocessing.rst:563 +#: ../../library/multiprocessing.rst:569 msgid "" "The process's name. The name is a string used for identification purposes " "only. It has no semantics. Multiple processes may be given the same name." msgstr "" -#: ../../library/multiprocessing.rst:567 +#: ../../library/multiprocessing.rst:573 msgid "" "The initial name is set by the constructor. If no explicit name is provided " "to the constructor, a name of the form 'Process-N\\ :sub:`1`:N\\ :sub:" @@ -543,33 +551,33 @@ msgid "" "child of its parent." msgstr "" -#: ../../library/multiprocessing.rst:574 +#: ../../library/multiprocessing.rst:580 msgid "Return whether the process is alive." msgstr "" -#: ../../library/multiprocessing.rst:576 +#: ../../library/multiprocessing.rst:582 msgid "" "Roughly, a process object is alive from the moment the :meth:`start` method " "returns until the child process terminates." msgstr "" -#: ../../library/multiprocessing.rst:581 +#: ../../library/multiprocessing.rst:587 msgid "" "The process's daemon flag, a Boolean value. This must be set before :meth:" "`start` is called." msgstr "" -#: ../../library/multiprocessing.rst:584 +#: ../../library/multiprocessing.rst:590 msgid "The initial value is inherited from the creating process." msgstr "" -#: ../../library/multiprocessing.rst:586 +#: ../../library/multiprocessing.rst:592 msgid "" "When a process exits, it attempts to terminate all of its daemonic child " "processes." msgstr "" -#: ../../library/multiprocessing.rst:589 +#: ../../library/multiprocessing.rst:595 msgid "" "Note that a daemonic process is not allowed to create child processes. " "Otherwise a daemonic process would leave its children orphaned if it gets " @@ -578,92 +586,92 @@ msgid "" "(and not joined) if non-daemonic processes have exited." msgstr "" -#: ../../library/multiprocessing.rst:595 +#: ../../library/multiprocessing.rst:601 msgid "" "In addition to the :class:`threading.Thread` API, :class:`Process` objects " "also support the following attributes and methods:" msgstr "" -#: ../../library/multiprocessing.rst:600 +#: ../../library/multiprocessing.rst:606 msgid "" "Return the process ID. Before the process is spawned, this will be ``None``." msgstr "" -#: ../../library/multiprocessing.rst:605 +#: ../../library/multiprocessing.rst:611 msgid "" "The child's exit code. This will be ``None`` if the process has not yet " "terminated." msgstr "" -#: ../../library/multiprocessing.rst:608 +#: ../../library/multiprocessing.rst:614 msgid "" "If the child's :meth:`run` method returned normally, the exit code will be " "0. If it terminated via :func:`sys.exit` with an integer argument *N*, the " "exit code will be *N*." msgstr "" -#: ../../library/multiprocessing.rst:612 +#: ../../library/multiprocessing.rst:618 msgid "" "If the child terminated due to an exception not caught within :meth:`run`, " "the exit code will be 1. If it was terminated by signal *N*, the exit code " "will be the negative value *-N*." msgstr "" -#: ../../library/multiprocessing.rst:618 +#: ../../library/multiprocessing.rst:624 msgid "The process's authentication key (a byte string)." msgstr "" -#: ../../library/multiprocessing.rst:620 +#: ../../library/multiprocessing.rst:626 msgid "" "When :mod:`multiprocessing` is initialized the main process is assigned a " "random string using :func:`os.urandom`." msgstr "" -#: ../../library/multiprocessing.rst:623 +#: ../../library/multiprocessing.rst:629 msgid "" "When a :class:`Process` object is created, it will inherit the " "authentication key of its parent process, although this may be changed by " "setting :attr:`authkey` to another byte string." msgstr "" -#: ../../library/multiprocessing.rst:627 +#: ../../library/multiprocessing.rst:633 msgid "See :ref:`multiprocessing-auth-keys`." msgstr "參閱 :ref:`multiprocessing-auth-keys`\\ 。" -#: ../../library/multiprocessing.rst:631 +#: ../../library/multiprocessing.rst:637 msgid "" "A numeric handle of a system object which will become \"ready\" when the " "process ends." msgstr "" -#: ../../library/multiprocessing.rst:634 +#: ../../library/multiprocessing.rst:640 msgid "" "You can use this value if you want to wait on several events at once using :" "func:`multiprocessing.connection.wait`. Otherwise calling :meth:`join()` is " "simpler." msgstr "" -#: ../../library/multiprocessing.rst:638 +#: ../../library/multiprocessing.rst:644 msgid "" "On Windows, this is an OS handle usable with the ``WaitForSingleObject`` and " "``WaitForMultipleObjects`` family of API calls. On POSIX, this is a file " "descriptor usable with primitives from the :mod:`select` module." msgstr "" -#: ../../library/multiprocessing.rst:646 +#: ../../library/multiprocessing.rst:652 msgid "" "Terminate the process. On POSIX this is done using the ``SIGTERM`` signal; " "on Windows :c:func:`TerminateProcess` is used. Note that exit handlers and " "finally clauses, etc., will not be executed." msgstr "" -#: ../../library/multiprocessing.rst:650 +#: ../../library/multiprocessing.rst:656 msgid "" "Note that descendant processes of the process will *not* be terminated -- " "they will simply become orphaned." msgstr "" -#: ../../library/multiprocessing.rst:655 +#: ../../library/multiprocessing.rst:661 msgid "" "If this method is used when the associated process is using a pipe or queue " "then the pipe or queue is liable to become corrupted and may become unusable " @@ -672,11 +680,11 @@ msgid "" "deadlock." msgstr "" -#: ../../library/multiprocessing.rst:663 +#: ../../library/multiprocessing.rst:669 msgid "Same as :meth:`terminate()` but using the ``SIGKILL`` signal on POSIX." msgstr "" -#: ../../library/multiprocessing.rst:669 +#: ../../library/multiprocessing.rst:675 msgid "" "Close the :class:`Process` object, releasing all resources associated with " "it. :exc:`ValueError` is raised if the underlying process is still " @@ -684,59 +692,59 @@ msgid "" "attributes of the :class:`Process` object will raise :exc:`ValueError`." msgstr "" -#: ../../library/multiprocessing.rst:677 +#: ../../library/multiprocessing.rst:683 msgid "" "Note that the :meth:`start`, :meth:`join`, :meth:`is_alive`, :meth:" "`terminate` and :attr:`exitcode` methods should only be called by the " "process that created the process object." msgstr "" -#: ../../library/multiprocessing.rst:681 +#: ../../library/multiprocessing.rst:687 msgid "Example usage of some of the methods of :class:`Process`:" msgstr "" -#: ../../library/multiprocessing.rst:702 +#: ../../library/multiprocessing.rst:708 msgid "The base class of all :mod:`multiprocessing` exceptions." msgstr "" -#: ../../library/multiprocessing.rst:706 +#: ../../library/multiprocessing.rst:712 msgid "" "Exception raised by :meth:`Connection.recv_bytes_into()` when the supplied " "buffer object is too small for the message read." msgstr "" -#: ../../library/multiprocessing.rst:709 +#: ../../library/multiprocessing.rst:715 msgid "" "If ``e`` is an instance of :exc:`BufferTooShort` then ``e.args[0]`` will " "give the message as a byte string." msgstr "" -#: ../../library/multiprocessing.rst:714 +#: ../../library/multiprocessing.rst:720 msgid "Raised when there is an authentication error." msgstr "" -#: ../../library/multiprocessing.rst:718 +#: ../../library/multiprocessing.rst:724 msgid "Raised by methods with a timeout when the timeout expires." msgstr "" -#: ../../library/multiprocessing.rst:721 +#: ../../library/multiprocessing.rst:727 msgid "Pipes and Queues" msgstr "" -#: ../../library/multiprocessing.rst:723 +#: ../../library/multiprocessing.rst:729 msgid "" "When using multiple processes, one generally uses message passing for " "communication between processes and avoids having to use any synchronization " "primitives like locks." msgstr "" -#: ../../library/multiprocessing.rst:727 +#: ../../library/multiprocessing.rst:733 msgid "" "For passing messages one can use :func:`Pipe` (for a connection between two " "processes) or a queue (which allows multiple producers and consumers)." msgstr "" -#: ../../library/multiprocessing.rst:730 +#: ../../library/multiprocessing.rst:736 msgid "" "The :class:`Queue`, :class:`SimpleQueue` and :class:`JoinableQueue` types " "are multi-producer, multi-consumer :abbr:`FIFO (first-in, first-out)` queues " @@ -746,7 +754,7 @@ msgid "" "Queue` class." msgstr "" -#: ../../library/multiprocessing.rst:737 +#: ../../library/multiprocessing.rst:743 msgid "" "If you use :class:`JoinableQueue` then you **must** call :meth:" "`JoinableQueue.task_done` for each task removed from the queue or else the " @@ -754,20 +762,20 @@ msgid "" "overflow, raising an exception." msgstr "" -#: ../../library/multiprocessing.rst:742 +#: ../../library/multiprocessing.rst:748 msgid "" "Note that one can also create a shared queue by using a manager object -- " "see :ref:`multiprocessing-managers`." msgstr "" -#: ../../library/multiprocessing.rst:747 +#: ../../library/multiprocessing.rst:753 msgid "" ":mod:`multiprocessing` uses the usual :exc:`queue.Empty` and :exc:`queue." "Full` exceptions to signal a timeout. They are not available in the :mod:" "`multiprocessing` namespace so you need to import them from :mod:`queue`." msgstr "" -#: ../../library/multiprocessing.rst:754 +#: ../../library/multiprocessing.rst:760 msgid "" "When an object is put on a queue, the object is pickled and a background " "thread later flushes the pickled data to an underlying pipe. This has some " @@ -776,14 +784,14 @@ msgid "" "a queue created with a :ref:`manager `." msgstr "" -#: ../../library/multiprocessing.rst:761 +#: ../../library/multiprocessing.rst:767 msgid "" "After putting an object on an empty queue there may be an infinitesimal " "delay before the queue's :meth:`~Queue.empty` method returns :const:`False` " "and :meth:`~Queue.get_nowait` can return without raising :exc:`queue.Empty`." msgstr "" -#: ../../library/multiprocessing.rst:766 +#: ../../library/multiprocessing.rst:772 msgid "" "If multiple processes are enqueuing objects, it is possible for the objects " "to be received at the other end out-of-order. However, objects enqueued by " @@ -791,7 +799,7 @@ msgid "" "other." msgstr "" -#: ../../library/multiprocessing.rst:773 +#: ../../library/multiprocessing.rst:779 msgid "" "If a process is killed using :meth:`Process.terminate` or :func:`os.kill` " "while it is trying to use a :class:`Queue`, then the data in the queue is " @@ -799,7 +807,7 @@ msgid "" "exception when it tries to use the queue later on." msgstr "" -#: ../../library/multiprocessing.rst:780 +#: ../../library/multiprocessing.rst:786 msgid "" "As mentioned above, if a child process has put items on a queue (and it has " "not used :meth:`JoinableQueue.cancel_join_thread ` -- see also :ref:`multiprocessing-listeners-clients`." msgstr "" -#: ../../library/multiprocessing.rst:1155 +#: ../../library/multiprocessing.rst:1161 msgid "" "Send an object to the other end of the connection which should be read " "using :meth:`recv`." msgstr "" -#: ../../library/multiprocessing.rst:1158 +#: ../../library/multiprocessing.rst:1164 msgid "" "The object must be picklable. Very large pickles (approximately 32 MiB+, " "though it depends on the OS) may raise a :exc:`ValueError` exception." msgstr "" -#: ../../library/multiprocessing.rst:1163 +#: ../../library/multiprocessing.rst:1169 msgid "" "Return an object sent from the other end of the connection using :meth:" "`send`. Blocks until there is something to receive. Raises :exc:`EOFError` " "if there is nothing left to receive and the other end was closed." msgstr "" -#: ../../library/multiprocessing.rst:1170 +#: ../../library/multiprocessing.rst:1176 msgid "Return the file descriptor or handle used by the connection." msgstr "" -#: ../../library/multiprocessing.rst:1174 +#: ../../library/multiprocessing.rst:1180 msgid "Close the connection." msgstr "" -#: ../../library/multiprocessing.rst:1176 +#: ../../library/multiprocessing.rst:1182 msgid "This is called automatically when the connection is garbage collected." msgstr "" -#: ../../library/multiprocessing.rst:1180 +#: ../../library/multiprocessing.rst:1186 msgid "Return whether there is any data available to be read." msgstr "" -#: ../../library/multiprocessing.rst:1182 +#: ../../library/multiprocessing.rst:1188 msgid "" "If *timeout* is not specified then it will return immediately. If *timeout* " "is a number then this specifies the maximum time in seconds to block. If " "*timeout* is ``None`` then an infinite timeout is used." msgstr "" -#: ../../library/multiprocessing.rst:1186 +#: ../../library/multiprocessing.rst:1192 msgid "" "Note that multiple connection objects may be polled at once by using :func:" "`multiprocessing.connection.wait`." msgstr "" -#: ../../library/multiprocessing.rst:1191 +#: ../../library/multiprocessing.rst:1197 msgid "Send byte data from a :term:`bytes-like object` as a complete message." msgstr "" -#: ../../library/multiprocessing.rst:1193 +#: ../../library/multiprocessing.rst:1199 msgid "" "If *offset* is given then data is read from that position in *buffer*. If " "*size* is given then that many bytes will be read from buffer. Very large " @@ -1316,7 +1324,7 @@ msgid "" "exc:`ValueError` exception" msgstr "" -#: ../../library/multiprocessing.rst:1200 +#: ../../library/multiprocessing.rst:1206 msgid "" "Return a complete message of byte data sent from the other end of the " "connection as a string. Blocks until there is something to receive. Raises :" @@ -1324,19 +1332,19 @@ msgid "" "closed." msgstr "" -#: ../../library/multiprocessing.rst:1205 +#: ../../library/multiprocessing.rst:1211 msgid "" "If *maxlength* is specified and the message is longer than *maxlength* then :" "exc:`OSError` is raised and the connection will no longer be readable." msgstr "" -#: ../../library/multiprocessing.rst:1209 +#: ../../library/multiprocessing.rst:1215 msgid "" "This function used to raise :exc:`IOError`, which is now an alias of :exc:" "`OSError`." msgstr "" -#: ../../library/multiprocessing.rst:1216 +#: ../../library/multiprocessing.rst:1222 msgid "" "Read into *buffer* a complete message of byte data sent from the other end " "of the connection and return the number of bytes in the message. Blocks " @@ -1344,45 +1352,45 @@ msgid "" "nothing left to receive and the other end was closed." msgstr "" -#: ../../library/multiprocessing.rst:1222 +#: ../../library/multiprocessing.rst:1228 msgid "" "*buffer* must be a writable :term:`bytes-like object`. If *offset* is given " "then the message will be written into the buffer from that position. Offset " "must be a non-negative integer less than the length of *buffer* (in bytes)." msgstr "" -#: ../../library/multiprocessing.rst:1227 +#: ../../library/multiprocessing.rst:1233 msgid "" "If the buffer is too short then a :exc:`BufferTooShort` exception is raised " "and the complete message is available as ``e.args[0]`` where ``e`` is the " "exception instance." msgstr "" -#: ../../library/multiprocessing.rst:1231 +#: ../../library/multiprocessing.rst:1237 msgid "" "Connection objects themselves can now be transferred between processes " "using :meth:`Connection.send` and :meth:`Connection.recv`." msgstr "" -#: ../../library/multiprocessing.rst:1235 +#: ../../library/multiprocessing.rst:1241 msgid "" "Connection objects now support the context management protocol -- see :ref:" "`typecontextmanager`. :meth:`~contextmanager.__enter__` returns the " "connection object, and :meth:`~contextmanager.__exit__` calls :meth:`close`." msgstr "" -#: ../../library/multiprocessing.rst:1240 +#: ../../library/multiprocessing.rst:1246 msgid "For example:" msgstr "" -#: ../../library/multiprocessing.rst:1265 +#: ../../library/multiprocessing.rst:1271 msgid "" "The :meth:`Connection.recv` method automatically unpickles the data it " "receives, which can be a security risk unless you can trust the process " "which sent the message." msgstr "" -#: ../../library/multiprocessing.rst:1269 +#: ../../library/multiprocessing.rst:1275 msgid "" "Therefore, unless the connection object was produced using :func:`Pipe` you " "should only use the :meth:`~Connection.recv` and :meth:`~Connection.send` " @@ -1390,73 +1398,73 @@ msgid "" "`multiprocessing-auth-keys`." msgstr "" -#: ../../library/multiprocessing.rst:1276 +#: ../../library/multiprocessing.rst:1282 msgid "" "If a process is killed while it is trying to read or write to a pipe then " "the data in the pipe is likely to become corrupted, because it may become " "impossible to be sure where the message boundaries lie." msgstr "" -#: ../../library/multiprocessing.rst:1282 +#: ../../library/multiprocessing.rst:1288 msgid "Synchronization primitives" msgstr "" -#: ../../library/multiprocessing.rst:1286 +#: ../../library/multiprocessing.rst:1292 msgid "" "Generally synchronization primitives are not as necessary in a multiprocess " "program as they are in a multithreaded program. See the documentation for :" "mod:`threading` module." msgstr "" -#: ../../library/multiprocessing.rst:1290 +#: ../../library/multiprocessing.rst:1296 msgid "" "Note that one can also create synchronization primitives by using a manager " "object -- see :ref:`multiprocessing-managers`." msgstr "" -#: ../../library/multiprocessing.rst:1295 +#: ../../library/multiprocessing.rst:1301 msgid "A barrier object: a clone of :class:`threading.Barrier`." msgstr "" -#: ../../library/multiprocessing.rst:1301 +#: ../../library/multiprocessing.rst:1307 msgid "" "A bounded semaphore object: a close analog of :class:`threading." "BoundedSemaphore`." msgstr "" -#: ../../library/multiprocessing.rst:1304 -#: ../../library/multiprocessing.rst:1442 +#: ../../library/multiprocessing.rst:1310 +#: ../../library/multiprocessing.rst:1448 msgid "" "A solitary difference from its close analog exists: its ``acquire`` method's " "first argument is named *block*, as is consistent with :meth:`Lock.acquire`." msgstr "" -#: ../../library/multiprocessing.rst:1308 +#: ../../library/multiprocessing.rst:1314 msgid "" "On macOS, this is indistinguishable from :class:`Semaphore` because " "``sem_getvalue()`` is not implemented on that platform." msgstr "" -#: ../../library/multiprocessing.rst:1313 +#: ../../library/multiprocessing.rst:1319 msgid "A condition variable: an alias for :class:`threading.Condition`." msgstr "" -#: ../../library/multiprocessing.rst:1315 +#: ../../library/multiprocessing.rst:1321 msgid "" "If *lock* is specified then it should be a :class:`Lock` or :class:`RLock` " "object from :mod:`multiprocessing`." msgstr "" -#: ../../library/multiprocessing.rst:1318 -#: ../../library/multiprocessing.rst:1867 +#: ../../library/multiprocessing.rst:1324 +#: ../../library/multiprocessing.rst:1873 msgid "The :meth:`~threading.Condition.wait_for` method was added." msgstr "" -#: ../../library/multiprocessing.rst:1323 +#: ../../library/multiprocessing.rst:1329 msgid "A clone of :class:`threading.Event`." msgstr "" -#: ../../library/multiprocessing.rst:1328 +#: ../../library/multiprocessing.rst:1334 msgid "" "A non-recursive lock object: a close analog of :class:`threading.Lock`. Once " "a process or thread has acquired a lock, subsequent attempts to acquire it " @@ -1467,25 +1475,25 @@ msgid "" "as noted." msgstr "" -#: ../../library/multiprocessing.rst:1336 +#: ../../library/multiprocessing.rst:1342 msgid "" "Note that :class:`Lock` is actually a factory function which returns an " "instance of ``multiprocessing.synchronize.Lock`` initialized with a default " "context." msgstr "" -#: ../../library/multiprocessing.rst:1340 +#: ../../library/multiprocessing.rst:1346 msgid "" ":class:`Lock` supports the :term:`context manager` protocol and thus may be " "used in :keyword:`with` statements." msgstr "" -#: ../../library/multiprocessing.rst:1345 -#: ../../library/multiprocessing.rst:1396 +#: ../../library/multiprocessing.rst:1351 +#: ../../library/multiprocessing.rst:1402 msgid "Acquire a lock, blocking or non-blocking." msgstr "" -#: ../../library/multiprocessing.rst:1347 +#: ../../library/multiprocessing.rst:1353 msgid "" "With the *block* argument set to ``True`` (the default), the method call " "will block until the lock is in an unlocked state, then set it to locked and " @@ -1493,14 +1501,14 @@ msgid "" "that in :meth:`threading.Lock.acquire`." msgstr "" -#: ../../library/multiprocessing.rst:1352 +#: ../../library/multiprocessing.rst:1358 msgid "" "With the *block* argument set to ``False``, the method call does not block. " "If the lock is currently in a locked state, return ``False``; otherwise set " "the lock to a locked state and return ``True``." msgstr "" -#: ../../library/multiprocessing.rst:1356 +#: ../../library/multiprocessing.rst:1362 msgid "" "When invoked with a positive, floating-point value for *timeout*, block for " "at most the number of seconds specified by *timeout* as long as the lock can " @@ -1514,19 +1522,19 @@ msgid "" "acquired or ``False`` if the timeout period has elapsed." msgstr "" -#: ../../library/multiprocessing.rst:1371 +#: ../../library/multiprocessing.rst:1377 msgid "" "Release a lock. This can be called from any process or thread, not only the " "process or thread which originally acquired the lock." msgstr "" -#: ../../library/multiprocessing.rst:1374 +#: ../../library/multiprocessing.rst:1380 msgid "" "Behavior is the same as in :meth:`threading.Lock.release` except that when " "invoked on an unlocked lock, a :exc:`ValueError` is raised." msgstr "" -#: ../../library/multiprocessing.rst:1380 +#: ../../library/multiprocessing.rst:1386 msgid "" "A recursive lock object: a close analog of :class:`threading.RLock`. A " "recursive lock must be released by the process or thread that acquired it. " @@ -1535,20 +1543,20 @@ msgid "" "release it once for each time it has been acquired." msgstr "" -#: ../../library/multiprocessing.rst:1386 +#: ../../library/multiprocessing.rst:1392 msgid "" "Note that :class:`RLock` is actually a factory function which returns an " "instance of ``multiprocessing.synchronize.RLock`` initialized with a default " "context." msgstr "" -#: ../../library/multiprocessing.rst:1390 +#: ../../library/multiprocessing.rst:1396 msgid "" ":class:`RLock` supports the :term:`context manager` protocol and thus may be " "used in :keyword:`with` statements." msgstr "" -#: ../../library/multiprocessing.rst:1398 +#: ../../library/multiprocessing.rst:1404 msgid "" "When invoked with the *block* argument set to ``True``, block until the lock " "is in an unlocked state (not owned by any process or thread) unless the lock " @@ -1561,7 +1569,7 @@ msgid "" "itself." msgstr "" -#: ../../library/multiprocessing.rst:1408 +#: ../../library/multiprocessing.rst:1414 msgid "" "When invoked with the *block* argument set to ``False``, do not block. If " "the lock has already been acquired (and thus is owned) by another process or " @@ -1572,14 +1580,14 @@ msgid "" "a return value of ``True``." msgstr "" -#: ../../library/multiprocessing.rst:1416 +#: ../../library/multiprocessing.rst:1422 msgid "" "Use and behaviors of the *timeout* argument are the same as in :meth:`Lock." "acquire`. Note that some of these behaviors of *timeout* differ from the " "implemented behaviors in :meth:`threading.RLock.acquire`." msgstr "" -#: ../../library/multiprocessing.rst:1423 +#: ../../library/multiprocessing.rst:1429 msgid "" "Release a lock, decrementing the recursion level. If after the decrement " "the recursion level is zero, reset the lock to unlocked (not owned by any " @@ -1589,7 +1597,7 @@ msgid "" "locked and owned by the calling process or thread." msgstr "" -#: ../../library/multiprocessing.rst:1431 +#: ../../library/multiprocessing.rst:1437 msgid "" "Only call this method when the calling process or thread owns the lock. An :" "exc:`AssertionError` is raised if this method is called by a process or " @@ -1598,17 +1606,17 @@ msgid "" "from the implemented behavior in :meth:`threading.RLock.release`." msgstr "" -#: ../../library/multiprocessing.rst:1440 +#: ../../library/multiprocessing.rst:1446 msgid "A semaphore object: a close analog of :class:`threading.Semaphore`." msgstr "" -#: ../../library/multiprocessing.rst:1447 +#: ../../library/multiprocessing.rst:1453 msgid "" "On macOS, ``sem_timedwait`` is unsupported, so calling ``acquire()`` with a " "timeout will emulate that function's behavior using a sleeping loop." msgstr "" -#: ../../library/multiprocessing.rst:1452 +#: ../../library/multiprocessing.rst:1458 msgid "" "If the SIGINT signal generated by :kbd:`Ctrl-C` arrives while the main " "thread is blocked by a call to :meth:`BoundedSemaphore.acquire`, :meth:`Lock." @@ -1617,13 +1625,13 @@ msgid "" "interrupted and :exc:`KeyboardInterrupt` will be raised." msgstr "" -#: ../../library/multiprocessing.rst:1458 +#: ../../library/multiprocessing.rst:1464 msgid "" "This differs from the behaviour of :mod:`threading` where SIGINT will be " "ignored while the equivalent blocking calls are in progress." msgstr "" -#: ../../library/multiprocessing.rst:1463 +#: ../../library/multiprocessing.rst:1469 msgid "" "Some of this package's functionality requires a functioning shared semaphore " "implementation on the host operating system. Without one, the :mod:" @@ -1632,32 +1640,32 @@ msgid "" "additional information." msgstr "" -#: ../../library/multiprocessing.rst:1471 +#: ../../library/multiprocessing.rst:1477 msgid "Shared :mod:`ctypes` Objects" msgstr "" -#: ../../library/multiprocessing.rst:1473 +#: ../../library/multiprocessing.rst:1479 msgid "" "It is possible to create shared objects using shared memory which can be " "inherited by child processes." msgstr "" -#: ../../library/multiprocessing.rst:1478 +#: ../../library/multiprocessing.rst:1484 msgid "" "Return a :mod:`ctypes` object allocated from shared memory. By default the " "return value is actually a synchronized wrapper for the object. The object " "itself can be accessed via the *value* attribute of a :class:`Value`." msgstr "" -#: ../../library/multiprocessing.rst:1482 -#: ../../library/multiprocessing.rst:1569 +#: ../../library/multiprocessing.rst:1488 +#: ../../library/multiprocessing.rst:1575 msgid "" "*typecode_or_type* determines the type of the returned object: it is either " "a ctypes type or a one character typecode of the kind used by the :mod:" "`array` module. *\\*args* is passed on to the constructor for the type." msgstr "" -#: ../../library/multiprocessing.rst:1486 +#: ../../library/multiprocessing.rst:1492 msgid "" "If *lock* is ``True`` (the default) then a new recursive lock object is " "created to synchronize access to the value. If *lock* is a :class:`Lock` " @@ -1667,32 +1675,32 @@ msgid "" "\"process-safe\"." msgstr "" -#: ../../library/multiprocessing.rst:1493 +#: ../../library/multiprocessing.rst:1499 msgid "" "Operations like ``+=`` which involve a read and write are not atomic. So " "if, for instance, you want to atomically increment a shared value it is " "insufficient to just do ::" msgstr "" -#: ../../library/multiprocessing.rst:1499 +#: ../../library/multiprocessing.rst:1505 msgid "" "Assuming the associated lock is recursive (which it is by default) you can " "instead do ::" msgstr "" -#: ../../library/multiprocessing.rst:1505 -#: ../../library/multiprocessing.rst:1595 -#: ../../library/multiprocessing.rst:1610 +#: ../../library/multiprocessing.rst:1511 +#: ../../library/multiprocessing.rst:1601 +#: ../../library/multiprocessing.rst:1616 msgid "Note that *lock* is a keyword-only argument." msgstr "" -#: ../../library/multiprocessing.rst:1509 +#: ../../library/multiprocessing.rst:1515 msgid "" "Return a ctypes array allocated from shared memory. By default the return " "value is actually a synchronized wrapper for the array." msgstr "" -#: ../../library/multiprocessing.rst:1512 +#: ../../library/multiprocessing.rst:1518 msgid "" "*typecode_or_type* determines the type of the elements of the returned " "array: it is either a ctypes type or a one character typecode of the kind " @@ -1702,7 +1710,7 @@ msgid "" "initialize the array and whose length determines the length of the array." msgstr "" -#: ../../library/multiprocessing.rst:1519 +#: ../../library/multiprocessing.rst:1525 msgid "" "If *lock* is ``True`` (the default) then a new lock object is created to " "synchronize access to the value. If *lock* is a :class:`Lock` or :class:" @@ -1712,28 +1720,28 @@ msgid "" "safe\"." msgstr "" -#: ../../library/multiprocessing.rst:1526 +#: ../../library/multiprocessing.rst:1532 msgid "Note that *lock* is a keyword only argument." msgstr "" -#: ../../library/multiprocessing.rst:1528 +#: ../../library/multiprocessing.rst:1534 msgid "" "Note that an array of :data:`ctypes.c_char` has *value* and *raw* attributes " "which allow one to use it to store and retrieve strings." msgstr "" -#: ../../library/multiprocessing.rst:1533 +#: ../../library/multiprocessing.rst:1539 msgid "The :mod:`multiprocessing.sharedctypes` module" msgstr "" -#: ../../library/multiprocessing.rst:1538 +#: ../../library/multiprocessing.rst:1544 msgid "" "The :mod:`multiprocessing.sharedctypes` module provides functions for " "allocating :mod:`ctypes` objects from shared memory which can be inherited " "by child processes." msgstr "" -#: ../../library/multiprocessing.rst:1544 +#: ../../library/multiprocessing.rst:1550 msgid "" "Although it is possible to store a pointer in shared memory remember that " "this will refer to a location in the address space of a specific process. " @@ -1742,11 +1750,11 @@ msgid "" "may cause a crash." msgstr "" -#: ../../library/multiprocessing.rst:1552 +#: ../../library/multiprocessing.rst:1558 msgid "Return a ctypes array allocated from shared memory." msgstr "" -#: ../../library/multiprocessing.rst:1554 +#: ../../library/multiprocessing.rst:1560 msgid "" "*typecode_or_type* determines the type of the elements of the returned " "array: it is either a ctypes type or a one character typecode of the kind " @@ -1756,40 +1764,40 @@ msgid "" "initialize the array and whose length determines the length of the array." msgstr "" -#: ../../library/multiprocessing.rst:1561 +#: ../../library/multiprocessing.rst:1567 msgid "" "Note that setting and getting an element is potentially non-atomic -- use :" "func:`Array` instead to make sure that access is automatically synchronized " "using a lock." msgstr "" -#: ../../library/multiprocessing.rst:1567 +#: ../../library/multiprocessing.rst:1573 msgid "Return a ctypes object allocated from shared memory." msgstr "" -#: ../../library/multiprocessing.rst:1573 +#: ../../library/multiprocessing.rst:1579 msgid "" "Note that setting and getting the value is potentially non-atomic -- use :" "func:`Value` instead to make sure that access is automatically synchronized " "using a lock." msgstr "" -#: ../../library/multiprocessing.rst:1577 +#: ../../library/multiprocessing.rst:1583 msgid "" "Note that an array of :data:`ctypes.c_char` has ``value`` and ``raw`` " "attributes which allow one to use it to store and retrieve strings -- see " "documentation for :mod:`ctypes`." msgstr "" -#: ../../library/multiprocessing.rst:1583 +#: ../../library/multiprocessing.rst:1589 msgid "" "The same as :func:`RawArray` except that depending on the value of *lock* a " "process-safe synchronization wrapper may be returned instead of a raw ctypes " "array." msgstr "" -#: ../../library/multiprocessing.rst:1587 -#: ../../library/multiprocessing.rst:1603 +#: ../../library/multiprocessing.rst:1593 +#: ../../library/multiprocessing.rst:1609 msgid "" "If *lock* is ``True`` (the default) then a new lock object is created to " "synchronize access to the value. If *lock* is a :class:`~multiprocessing." @@ -1799,121 +1807,121 @@ msgid "" "not necessarily be \"process-safe\"." msgstr "" -#: ../../library/multiprocessing.rst:1599 +#: ../../library/multiprocessing.rst:1605 msgid "" "The same as :func:`RawValue` except that depending on the value of *lock* a " "process-safe synchronization wrapper may be returned instead of a raw ctypes " "object." msgstr "" -#: ../../library/multiprocessing.rst:1614 +#: ../../library/multiprocessing.rst:1620 msgid "" "Return a ctypes object allocated from shared memory which is a copy of the " "ctypes object *obj*." msgstr "" -#: ../../library/multiprocessing.rst:1619 +#: ../../library/multiprocessing.rst:1625 msgid "" "Return a process-safe wrapper object for a ctypes object which uses *lock* " "to synchronize access. If *lock* is ``None`` (the default) then a :class:" "`multiprocessing.RLock` object is created automatically." msgstr "" -#: ../../library/multiprocessing.rst:1623 +#: ../../library/multiprocessing.rst:1629 msgid "" "A synchronized wrapper will have two methods in addition to those of the " "object it wraps: :meth:`get_obj` returns the wrapped object and :meth:" "`get_lock` returns the lock object used for synchronization." msgstr "" -#: ../../library/multiprocessing.rst:1627 +#: ../../library/multiprocessing.rst:1633 msgid "" "Note that accessing the ctypes object through the wrapper can be a lot " "slower than accessing the raw ctypes object." msgstr "" -#: ../../library/multiprocessing.rst:1630 +#: ../../library/multiprocessing.rst:1636 msgid "Synchronized objects support the :term:`context manager` protocol." msgstr "" -#: ../../library/multiprocessing.rst:1634 +#: ../../library/multiprocessing.rst:1640 msgid "" "The table below compares the syntax for creating shared ctypes objects from " "shared memory with the normal ctypes syntax. (In the table ``MyStruct`` is " "some subclass of :class:`ctypes.Structure`.)" msgstr "" -#: ../../library/multiprocessing.rst:1639 +#: ../../library/multiprocessing.rst:1645 msgid "ctypes" msgstr "ctypes" -#: ../../library/multiprocessing.rst:1639 +#: ../../library/multiprocessing.rst:1645 msgid "sharedctypes using type" msgstr "" -#: ../../library/multiprocessing.rst:1639 +#: ../../library/multiprocessing.rst:1645 msgid "sharedctypes using typecode" msgstr "" -#: ../../library/multiprocessing.rst:1641 +#: ../../library/multiprocessing.rst:1647 msgid "c_double(2.4)" msgstr "c_double(2.4)" -#: ../../library/multiprocessing.rst:1641 +#: ../../library/multiprocessing.rst:1647 msgid "RawValue(c_double, 2.4)" msgstr "RawValue(c_double, 2.4)" -#: ../../library/multiprocessing.rst:1641 +#: ../../library/multiprocessing.rst:1647 msgid "RawValue('d', 2.4)" msgstr "RawValue('d', 2.4)" -#: ../../library/multiprocessing.rst:1642 +#: ../../library/multiprocessing.rst:1648 msgid "MyStruct(4, 6)" msgstr "MyStruct(4, 6)" -#: ../../library/multiprocessing.rst:1642 +#: ../../library/multiprocessing.rst:1648 msgid "RawValue(MyStruct, 4, 6)" msgstr "RawValue(MyStruct, 4, 6)" -#: ../../library/multiprocessing.rst:1643 +#: ../../library/multiprocessing.rst:1649 msgid "(c_short * 7)()" msgstr "(c_short * 7)()" -#: ../../library/multiprocessing.rst:1643 +#: ../../library/multiprocessing.rst:1649 msgid "RawArray(c_short, 7)" msgstr "RawArray(c_short, 7)" -#: ../../library/multiprocessing.rst:1643 +#: ../../library/multiprocessing.rst:1649 msgid "RawArray('h', 7)" msgstr "RawArray('h', 7)" -#: ../../library/multiprocessing.rst:1644 +#: ../../library/multiprocessing.rst:1650 msgid "(c_int * 3)(9, 2, 8)" msgstr "(c_int * 3)(9, 2, 8)" -#: ../../library/multiprocessing.rst:1644 +#: ../../library/multiprocessing.rst:1650 msgid "RawArray(c_int, (9, 2, 8))" msgstr "RawArray(c_int, (9, 2, 8))" -#: ../../library/multiprocessing.rst:1644 +#: ../../library/multiprocessing.rst:1650 msgid "RawArray('i', (9, 2, 8))" msgstr "RawArray('i', (9, 2, 8))" -#: ../../library/multiprocessing.rst:1648 +#: ../../library/multiprocessing.rst:1654 msgid "" "Below is an example where a number of ctypes objects are modified by a child " "process::" msgstr "" -#: ../../library/multiprocessing.rst:1686 +#: ../../library/multiprocessing.rst:1692 msgid "The results printed are ::" msgstr "" -#: ../../library/multiprocessing.rst:1699 +#: ../../library/multiprocessing.rst:1705 msgid "Managers" msgstr "" -#: ../../library/multiprocessing.rst:1701 +#: ../../library/multiprocessing.rst:1707 msgid "" "Managers provide a way to create data which can be shared between different " "processes, including sharing over a network between processes running on " @@ -1922,7 +1930,7 @@ msgid "" "proxies." msgstr "" -#: ../../library/multiprocessing.rst:1710 +#: ../../library/multiprocessing.rst:1716 msgid "" "Returns a started :class:`~multiprocessing.managers.SyncManager` object " "which can be used for sharing objects between processes. The returned " @@ -1930,31 +1938,31 @@ msgid "" "will create shared objects and return corresponding proxies." msgstr "" -#: ../../library/multiprocessing.rst:1718 +#: ../../library/multiprocessing.rst:1724 msgid "" "Manager processes will be shutdown as soon as they are garbage collected or " "their parent process exits. The manager classes are defined in the :mod:" "`multiprocessing.managers` module:" msgstr "" -#: ../../library/multiprocessing.rst:1724 +#: ../../library/multiprocessing.rst:1730 msgid "Create a BaseManager object." msgstr "" -#: ../../library/multiprocessing.rst:1726 +#: ../../library/multiprocessing.rst:1732 msgid "" "Once created one should call :meth:`start` or ``get_server()." "serve_forever()`` to ensure that the manager object refers to a started " "manager process." msgstr "" -#: ../../library/multiprocessing.rst:1729 +#: ../../library/multiprocessing.rst:1735 msgid "" "*address* is the address on which the manager process listens for new " "connections. If *address* is ``None`` then an arbitrary one is chosen." msgstr "" -#: ../../library/multiprocessing.rst:1732 +#: ../../library/multiprocessing.rst:1738 msgid "" "*authkey* is the authentication key which will be used to check the validity " "of incoming connections to the server process. If *authkey* is ``None`` " @@ -1962,19 +1970,19 @@ msgid "" "it must be a byte string." msgstr "" -#: ../../library/multiprocessing.rst:1737 +#: ../../library/multiprocessing.rst:1743 msgid "" "*serializer* must be ``'pickle'`` (use :mod:`pickle` serialization) or " "``'xmlrpclib'`` (use :mod:`xmlrpc.client` serialization)." msgstr "" -#: ../../library/multiprocessing.rst:1740 +#: ../../library/multiprocessing.rst:1746 msgid "" "*ctx* is a context object, or ``None`` (use the current context). See the :" "func:`get_context` function." msgstr "" -#: ../../library/multiprocessing.rst:1743 +#: ../../library/multiprocessing.rst:1749 msgid "" "*shutdown_timeout* is a timeout in seconds used to wait until the process " "used by the manager completes in the :meth:`shutdown` method. If the " @@ -1982,54 +1990,54 @@ msgid "" "also times out, the process is killed." msgstr "" -#: ../../library/multiprocessing.rst:1748 +#: ../../library/multiprocessing.rst:1754 msgid "Added the *shutdown_timeout* parameter." msgstr "新增 *shutdown_timeout* 參數。" -#: ../../library/multiprocessing.rst:1753 +#: ../../library/multiprocessing.rst:1759 msgid "" "Start a subprocess to start the manager. If *initializer* is not ``None`` " "then the subprocess will call ``initializer(*initargs)`` when it starts." msgstr "" -#: ../../library/multiprocessing.rst:1758 +#: ../../library/multiprocessing.rst:1764 msgid "" "Returns a :class:`Server` object which represents the actual server under " "the control of the Manager. The :class:`Server` object supports the :meth:" "`serve_forever` method::" msgstr "" -#: ../../library/multiprocessing.rst:1767 +#: ../../library/multiprocessing.rst:1773 msgid ":class:`Server` additionally has an :attr:`address` attribute." msgstr "" -#: ../../library/multiprocessing.rst:1771 +#: ../../library/multiprocessing.rst:1777 msgid "Connect a local manager object to a remote manager process::" msgstr "" -#: ../../library/multiprocessing.rst:1779 +#: ../../library/multiprocessing.rst:1785 msgid "" "Stop the process used by the manager. This is only available if :meth:" "`start` has been used to start the server process." msgstr "" -#: ../../library/multiprocessing.rst:1782 +#: ../../library/multiprocessing.rst:1788 msgid "This can be called multiple times." msgstr "" -#: ../../library/multiprocessing.rst:1786 +#: ../../library/multiprocessing.rst:1792 msgid "" "A classmethod which can be used for registering a type or callable with the " "manager class." msgstr "" -#: ../../library/multiprocessing.rst:1789 +#: ../../library/multiprocessing.rst:1795 msgid "" "*typeid* is a \"type identifier\" which is used to identify a particular " "type of shared object. This must be a string." msgstr "" -#: ../../library/multiprocessing.rst:1792 +#: ../../library/multiprocessing.rst:1798 msgid "" "*callable* is a callable used for creating objects for this type " "identifier. If a manager instance will be connected to the server using " @@ -2037,14 +2045,14 @@ msgid "" "then this can be left as ``None``." msgstr "" -#: ../../library/multiprocessing.rst:1798 +#: ../../library/multiprocessing.rst:1804 msgid "" "*proxytype* is a subclass of :class:`BaseProxy` which is used to create " "proxies for shared objects with this *typeid*. If ``None`` then a proxy " "class is created automatically." msgstr "" -#: ../../library/multiprocessing.rst:1802 +#: ../../library/multiprocessing.rst:1808 msgid "" "*exposed* is used to specify a sequence of method names which proxies for " "this typeid should be allowed to access using :meth:`BaseProxy." @@ -2055,7 +2063,7 @@ msgid "" "method and whose name does not begin with ``'_'``.)" msgstr "" -#: ../../library/multiprocessing.rst:1811 +#: ../../library/multiprocessing.rst:1817 msgid "" "*method_to_typeid* is a mapping used to specify the return type of those " "exposed methods which should return a proxy. It maps method names to typeid " @@ -2065,22 +2073,22 @@ msgid "" "returned by the method will be copied by value." msgstr "" -#: ../../library/multiprocessing.rst:1818 +#: ../../library/multiprocessing.rst:1824 msgid "" "*create_method* determines whether a method should be created with name " "*typeid* which can be used to tell the server process to create a new shared " "object and return a proxy for it. By default it is ``True``." msgstr "" -#: ../../library/multiprocessing.rst:1822 +#: ../../library/multiprocessing.rst:1828 msgid ":class:`BaseManager` instances also have one read-only property:" msgstr "" -#: ../../library/multiprocessing.rst:1826 +#: ../../library/multiprocessing.rst:1832 msgid "The address used by the manager." msgstr "" -#: ../../library/multiprocessing.rst:1828 +#: ../../library/multiprocessing.rst:1834 msgid "" "Manager objects support the context management protocol -- see :ref:" "`typecontextmanager`. :meth:`~contextmanager.__enter__` starts the server " @@ -2088,173 +2096,173 @@ msgid "" "object. :meth:`~contextmanager.__exit__` calls :meth:`shutdown`." msgstr "" -#: ../../library/multiprocessing.rst:1834 +#: ../../library/multiprocessing.rst:1840 msgid "" "In previous versions :meth:`~contextmanager.__enter__` did not start the " "manager's server process if it was not already started." msgstr "" -#: ../../library/multiprocessing.rst:1839 +#: ../../library/multiprocessing.rst:1845 msgid "" "A subclass of :class:`BaseManager` which can be used for the synchronization " "of processes. Objects of this type are returned by :func:`multiprocessing." "Manager`." msgstr "" -#: ../../library/multiprocessing.rst:1843 +#: ../../library/multiprocessing.rst:1849 msgid "" "Its methods create and return :ref:`multiprocessing-proxy_objects` for a " "number of commonly used data types to be synchronized across processes. This " "notably includes shared lists and dictionaries." msgstr "" -#: ../../library/multiprocessing.rst:1849 +#: ../../library/multiprocessing.rst:1855 msgid "" "Create a shared :class:`threading.Barrier` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1856 +#: ../../library/multiprocessing.rst:1862 msgid "" "Create a shared :class:`threading.BoundedSemaphore` object and return a " "proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1861 +#: ../../library/multiprocessing.rst:1867 msgid "" "Create a shared :class:`threading.Condition` object and return a proxy for " "it." msgstr "" -#: ../../library/multiprocessing.rst:1864 +#: ../../library/multiprocessing.rst:1870 msgid "" "If *lock* is supplied then it should be a proxy for a :class:`threading." "Lock` or :class:`threading.RLock` object." msgstr "" -#: ../../library/multiprocessing.rst:1872 +#: ../../library/multiprocessing.rst:1878 msgid "" "Create a shared :class:`threading.Event` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1876 +#: ../../library/multiprocessing.rst:1882 msgid "" "Create a shared :class:`threading.Lock` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1880 +#: ../../library/multiprocessing.rst:1886 msgid "Create a shared :class:`Namespace` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1884 +#: ../../library/multiprocessing.rst:1890 msgid "Create a shared :class:`queue.Queue` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1888 +#: ../../library/multiprocessing.rst:1894 msgid "" "Create a shared :class:`threading.RLock` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1892 +#: ../../library/multiprocessing.rst:1898 msgid "" "Create a shared :class:`threading.Semaphore` object and return a proxy for " "it." msgstr "" -#: ../../library/multiprocessing.rst:1897 +#: ../../library/multiprocessing.rst:1903 msgid "Create an array and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1901 +#: ../../library/multiprocessing.rst:1907 msgid "" "Create an object with a writable ``value`` attribute and return a proxy for " "it." msgstr "" -#: ../../library/multiprocessing.rst:1908 +#: ../../library/multiprocessing.rst:1914 msgid "Create a shared :class:`dict` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1913 +#: ../../library/multiprocessing.rst:1919 msgid "Create a shared :class:`list` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:1915 +#: ../../library/multiprocessing.rst:1921 msgid "" "Shared objects are capable of being nested. For example, a shared container " "object such as a shared list can contain other shared objects which will all " "be managed and synchronized by the :class:`SyncManager`." msgstr "" -#: ../../library/multiprocessing.rst:1922 +#: ../../library/multiprocessing.rst:1928 msgid "A type that can register with :class:`SyncManager`." msgstr "" -#: ../../library/multiprocessing.rst:1924 +#: ../../library/multiprocessing.rst:1930 msgid "" "A namespace object has no public methods, but does have writable attributes. " "Its representation shows the values of its attributes." msgstr "" -#: ../../library/multiprocessing.rst:1927 +#: ../../library/multiprocessing.rst:1933 msgid "" "However, when using a proxy for a namespace object, an attribute beginning " "with ``'_'`` will be an attribute of the proxy and not an attribute of the " "referent:" msgstr "" -#: ../../library/multiprocessing.rst:1944 +#: ../../library/multiprocessing.rst:1950 msgid "Customized managers" msgstr "" -#: ../../library/multiprocessing.rst:1946 +#: ../../library/multiprocessing.rst:1952 msgid "" "To create one's own manager, one creates a subclass of :class:`BaseManager` " "and uses the :meth:`~BaseManager.register` classmethod to register new types " "or callables with the manager class. For example::" msgstr "" -#: ../../library/multiprocessing.rst:1971 +#: ../../library/multiprocessing.rst:1977 msgid "Using a remote manager" msgstr "" -#: ../../library/multiprocessing.rst:1973 +#: ../../library/multiprocessing.rst:1979 msgid "" "It is possible to run a manager server on one machine and have clients use " "it from other machines (assuming that the firewalls involved allow it)." msgstr "" -#: ../../library/multiprocessing.rst:1976 +#: ../../library/multiprocessing.rst:1982 msgid "" "Running the following commands creates a server for a single shared queue " "which remote clients can access::" msgstr "" -#: ../../library/multiprocessing.rst:1988 +#: ../../library/multiprocessing.rst:1994 msgid "One client can access the server as follows::" msgstr "" -#: ../../library/multiprocessing.rst:1998 +#: ../../library/multiprocessing.rst:2004 msgid "Another client can also use it::" msgstr "" -#: ../../library/multiprocessing.rst:2009 +#: ../../library/multiprocessing.rst:2015 msgid "" "Local processes can also access that queue, using the code from above on the " "client to access it remotely::" msgstr "" -#: ../../library/multiprocessing.rst:2034 +#: ../../library/multiprocessing.rst:2040 msgid "Proxy Objects" msgstr "" -#: ../../library/multiprocessing.rst:2036 +#: ../../library/multiprocessing.rst:2042 msgid "" "A proxy is an object which *refers* to a shared object which lives " "(presumably) in a different process. The shared object is said to be the " "*referent* of the proxy. Multiple proxy objects may have the same referent." msgstr "" -#: ../../library/multiprocessing.rst:2040 +#: ../../library/multiprocessing.rst:2046 msgid "" "A proxy object has methods which invoke corresponding methods of its " "referent (although not every method of the referent will necessarily be " @@ -2262,14 +2270,14 @@ msgid "" "its referent can:" msgstr "" -#: ../../library/multiprocessing.rst:2058 +#: ../../library/multiprocessing.rst:2064 msgid "" "Notice that applying :func:`str` to a proxy will return the representation " "of the referent, whereas applying :func:`repr` will return the " "representation of the proxy." msgstr "" -#: ../../library/multiprocessing.rst:2062 +#: ../../library/multiprocessing.rst:2068 msgid "" "An important feature of proxy objects is that they are picklable so they can " "be passed between processes. As such, a referent can contain :ref:" @@ -2277,11 +2285,11 @@ msgid "" "lists, dicts, and other :ref:`multiprocessing-proxy_objects`:" msgstr "" -#: ../../library/multiprocessing.rst:2078 +#: ../../library/multiprocessing.rst:2084 msgid "Similarly, dict and list proxies may be nested inside one another::" msgstr "" -#: ../../library/multiprocessing.rst:2091 +#: ../../library/multiprocessing.rst:2097 msgid "" "If standard (non-proxy) :class:`list` or :class:`dict` objects are contained " "in a referent, modifications to those mutable values will not be propagated " @@ -2292,53 +2300,53 @@ msgid "" "assign the modified value to the container proxy::" msgstr "" -#: ../../library/multiprocessing.rst:2110 +#: ../../library/multiprocessing.rst:2116 msgid "" "This approach is perhaps less convenient than employing nested :ref:" "`multiprocessing-proxy_objects` for most use cases but also demonstrates a " "level of control over the synchronization." msgstr "" -#: ../../library/multiprocessing.rst:2116 +#: ../../library/multiprocessing.rst:2122 msgid "" "The proxy types in :mod:`multiprocessing` do nothing to support comparisons " "by value. So, for instance, we have:" msgstr "" -#: ../../library/multiprocessing.rst:2124 +#: ../../library/multiprocessing.rst:2130 msgid "" "One should just use a copy of the referent instead when making comparisons." msgstr "" -#: ../../library/multiprocessing.rst:2128 +#: ../../library/multiprocessing.rst:2134 msgid "Proxy objects are instances of subclasses of :class:`BaseProxy`." msgstr "" -#: ../../library/multiprocessing.rst:2132 +#: ../../library/multiprocessing.rst:2138 msgid "Call and return the result of a method of the proxy's referent." msgstr "" -#: ../../library/multiprocessing.rst:2134 +#: ../../library/multiprocessing.rst:2140 msgid "" "If ``proxy`` is a proxy whose referent is ``obj`` then the expression ::" msgstr "" -#: ../../library/multiprocessing.rst:2138 +#: ../../library/multiprocessing.rst:2144 msgid "will evaluate the expression ::" msgstr "" -#: ../../library/multiprocessing.rst:2142 +#: ../../library/multiprocessing.rst:2148 msgid "in the manager's process." msgstr "" -#: ../../library/multiprocessing.rst:2144 +#: ../../library/multiprocessing.rst:2150 msgid "" "The returned value will be a copy of the result of the call or a proxy to a " "new shared object -- see documentation for the *method_to_typeid* argument " "of :meth:`BaseManager.register`." msgstr "" -#: ../../library/multiprocessing.rst:2148 +#: ../../library/multiprocessing.rst:2154 msgid "" "If an exception is raised by the call, then is re-raised by :meth:" "`_callmethod`. If some other exception is raised in the manager's process " @@ -2346,79 +2354,79 @@ msgid "" "meth:`_callmethod`." msgstr "" -#: ../../library/multiprocessing.rst:2153 +#: ../../library/multiprocessing.rst:2159 msgid "" "Note in particular that an exception will be raised if *methodname* has not " "been *exposed*." msgstr "" -#: ../../library/multiprocessing.rst:2156 +#: ../../library/multiprocessing.rst:2162 msgid "An example of the usage of :meth:`_callmethod`:" msgstr "" -#: ../../library/multiprocessing.rst:2172 +#: ../../library/multiprocessing.rst:2178 msgid "Return a copy of the referent." msgstr "" -#: ../../library/multiprocessing.rst:2174 +#: ../../library/multiprocessing.rst:2180 msgid "If the referent is unpicklable then this will raise an exception." msgstr "" -#: ../../library/multiprocessing.rst:2178 +#: ../../library/multiprocessing.rst:2184 msgid "Return a representation of the proxy object." msgstr "" -#: ../../library/multiprocessing.rst:2182 +#: ../../library/multiprocessing.rst:2188 msgid "Return the representation of the referent." msgstr "" -#: ../../library/multiprocessing.rst:2186 +#: ../../library/multiprocessing.rst:2192 msgid "Cleanup" msgstr "" -#: ../../library/multiprocessing.rst:2188 +#: ../../library/multiprocessing.rst:2194 msgid "" "A proxy object uses a weakref callback so that when it gets garbage " "collected it deregisters itself from the manager which owns its referent." msgstr "" -#: ../../library/multiprocessing.rst:2191 +#: ../../library/multiprocessing.rst:2197 msgid "" "A shared object gets deleted from the manager process when there are no " "longer any proxies referring to it." msgstr "" -#: ../../library/multiprocessing.rst:2196 +#: ../../library/multiprocessing.rst:2202 msgid "Process Pools" msgstr "" -#: ../../library/multiprocessing.rst:2201 +#: ../../library/multiprocessing.rst:2207 msgid "" "One can create a pool of processes which will carry out tasks submitted to " "it with the :class:`Pool` class." msgstr "" -#: ../../library/multiprocessing.rst:2206 +#: ../../library/multiprocessing.rst:2212 msgid "" "A process pool object which controls a pool of worker processes to which " "jobs can be submitted. It supports asynchronous results with timeouts and " "callbacks and has a parallel map implementation." msgstr "" -#: ../../library/multiprocessing.rst:2210 +#: ../../library/multiprocessing.rst:2216 msgid "" "*processes* is the number of worker processes to use. If *processes* is " "``None`` then the number returned by :func:`os.cpu_count` is used." msgstr "" -#: ../../library/multiprocessing.rst:2213 -#: ../../library/multiprocessing.rst:2774 +#: ../../library/multiprocessing.rst:2219 +#: ../../library/multiprocessing.rst:2780 msgid "" "If *initializer* is not ``None`` then each worker process will call " "``initializer(*initargs)`` when it starts." msgstr "" -#: ../../library/multiprocessing.rst:2216 +#: ../../library/multiprocessing.rst:2222 msgid "" "*maxtasksperchild* is the number of tasks a worker process can complete " "before it will exit and be replaced with a fresh worker process, to enable " @@ -2426,7 +2434,7 @@ msgid "" "which means worker processes will live as long as the pool." msgstr "" -#: ../../library/multiprocessing.rst:2221 +#: ../../library/multiprocessing.rst:2227 msgid "" "*context* can be used to specify the context used for starting the worker " "processes. Usually a pool is created using the function :func:" @@ -2434,13 +2442,13 @@ msgid "" "both cases *context* is set appropriately." msgstr "" -#: ../../library/multiprocessing.rst:2227 +#: ../../library/multiprocessing.rst:2233 msgid "" "Note that the methods of the pool object should only be called by the " "process which created the pool." msgstr "" -#: ../../library/multiprocessing.rst:2231 +#: ../../library/multiprocessing.rst:2237 msgid "" ":class:`multiprocessing.pool` objects have internal resources that need to " "be properly managed (like any other resource) by using the pool as a context " @@ -2448,22 +2456,22 @@ msgid "" "to do this can lead to the process hanging on finalization." msgstr "" -#: ../../library/multiprocessing.rst:2236 +#: ../../library/multiprocessing.rst:2242 msgid "" "Note that it is **not correct** to rely on the garbage collector to destroy " "the pool as CPython does not assure that the finalizer of the pool will be " "called (see :meth:`object.__del__` for more information)." msgstr "" -#: ../../library/multiprocessing.rst:2240 +#: ../../library/multiprocessing.rst:2246 msgid "*maxtasksperchild*" msgstr "" -#: ../../library/multiprocessing.rst:2243 +#: ../../library/multiprocessing.rst:2249 msgid "*context*" msgstr "" -#: ../../library/multiprocessing.rst:2248 +#: ../../library/multiprocessing.rst:2254 msgid "" "Worker processes within a :class:`Pool` typically live for the complete " "duration of the Pool's work queue. A frequent pattern found in other systems " @@ -2474,7 +2482,7 @@ msgid "" "ability to the end user." msgstr "" -#: ../../library/multiprocessing.rst:2258 +#: ../../library/multiprocessing.rst:2264 msgid "" "Call *func* with arguments *args* and keyword arguments *kwds*. It blocks " "until the result is ready. Given this blocks, :meth:`apply_async` is better " @@ -2482,14 +2490,14 @@ msgid "" "executed in one of the workers of the pool." msgstr "" -#: ../../library/multiprocessing.rst:2265 +#: ../../library/multiprocessing.rst:2271 msgid "" "A variant of the :meth:`apply` method which returns a :class:" "`~multiprocessing.pool.AsyncResult` object." msgstr "" -#: ../../library/multiprocessing.rst:2268 -#: ../../library/multiprocessing.rst:2299 +#: ../../library/multiprocessing.rst:2274 +#: ../../library/multiprocessing.rst:2305 msgid "" "If *callback* is specified then it should be a callable which accepts a " "single argument. When the result becomes ready *callback* is applied to it, " @@ -2497,60 +2505,60 @@ msgid "" "applied instead." msgstr "" -#: ../../library/multiprocessing.rst:2273 -#: ../../library/multiprocessing.rst:2304 +#: ../../library/multiprocessing.rst:2279 +#: ../../library/multiprocessing.rst:2310 msgid "" "If *error_callback* is specified then it should be a callable which accepts " "a single argument. If the target function fails, then the *error_callback* " "is called with the exception instance." msgstr "" -#: ../../library/multiprocessing.rst:2277 -#: ../../library/multiprocessing.rst:2308 +#: ../../library/multiprocessing.rst:2283 +#: ../../library/multiprocessing.rst:2314 msgid "" "Callbacks should complete immediately since otherwise the thread which " "handles the results will get blocked." msgstr "" -#: ../../library/multiprocessing.rst:2282 +#: ../../library/multiprocessing.rst:2288 msgid "" "A parallel equivalent of the :func:`map` built-in function (it supports only " "one *iterable* argument though, for multiple iterables see :meth:`starmap`). " "It blocks until the result is ready." msgstr "" -#: ../../library/multiprocessing.rst:2286 +#: ../../library/multiprocessing.rst:2292 msgid "" "This method chops the iterable into a number of chunks which it submits to " "the process pool as separate tasks. The (approximate) size of these chunks " "can be specified by setting *chunksize* to a positive integer." msgstr "" -#: ../../library/multiprocessing.rst:2290 +#: ../../library/multiprocessing.rst:2296 msgid "" "Note that it may cause high memory usage for very long iterables. Consider " "using :meth:`imap` or :meth:`imap_unordered` with explicit *chunksize* " "option for better efficiency." msgstr "" -#: ../../library/multiprocessing.rst:2296 +#: ../../library/multiprocessing.rst:2302 msgid "" "A variant of the :meth:`.map` method which returns a :class:" "`~multiprocessing.pool.AsyncResult` object." msgstr "" -#: ../../library/multiprocessing.rst:2313 +#: ../../library/multiprocessing.rst:2319 msgid "A lazier version of :meth:`.map`." msgstr "" -#: ../../library/multiprocessing.rst:2315 +#: ../../library/multiprocessing.rst:2321 msgid "" "The *chunksize* argument is the same as the one used by the :meth:`.map` " "method. For very long iterables using a large value for *chunksize* can " "make the job complete **much** faster than using the default value of ``1``." msgstr "" -#: ../../library/multiprocessing.rst:2320 +#: ../../library/multiprocessing.rst:2326 msgid "" "Also if *chunksize* is ``1`` then the :meth:`!next` method of the iterator " "returned by the :meth:`imap` method has an optional *timeout* parameter: " @@ -2558,65 +2566,65 @@ msgid "" "result cannot be returned within *timeout* seconds." msgstr "" -#: ../../library/multiprocessing.rst:2327 +#: ../../library/multiprocessing.rst:2333 msgid "" "The same as :meth:`imap` except that the ordering of the results from the " "returned iterator should be considered arbitrary. (Only when there is only " "one worker process is the order guaranteed to be \"correct\".)" msgstr "" -#: ../../library/multiprocessing.rst:2333 +#: ../../library/multiprocessing.rst:2339 msgid "" "Like :meth:`~multiprocessing.pool.Pool.map` except that the elements of the " "*iterable* are expected to be iterables that are unpacked as arguments." msgstr "" -#: ../../library/multiprocessing.rst:2337 +#: ../../library/multiprocessing.rst:2343 msgid "" "Hence an *iterable* of ``[(1,2), (3, 4)]`` results in ``[func(1,2), " "func(3,4)]``." msgstr "" -#: ../../library/multiprocessing.rst:2344 +#: ../../library/multiprocessing.rst:2350 msgid "" "A combination of :meth:`starmap` and :meth:`map_async` that iterates over " "*iterable* of iterables and calls *func* with the iterables unpacked. " "Returns a result object." msgstr "" -#: ../../library/multiprocessing.rst:2352 +#: ../../library/multiprocessing.rst:2358 msgid "" "Prevents any more tasks from being submitted to the pool. Once all the " "tasks have been completed the worker processes will exit." msgstr "" -#: ../../library/multiprocessing.rst:2357 +#: ../../library/multiprocessing.rst:2363 msgid "" "Stops the worker processes immediately without completing outstanding work. " "When the pool object is garbage collected :meth:`terminate` will be called " "immediately." msgstr "" -#: ../../library/multiprocessing.rst:2363 +#: ../../library/multiprocessing.rst:2369 msgid "" "Wait for the worker processes to exit. One must call :meth:`close` or :meth:" "`terminate` before using :meth:`join`." msgstr "" -#: ../../library/multiprocessing.rst:2366 +#: ../../library/multiprocessing.rst:2372 msgid "" "Pool objects now support the context management protocol -- see :ref:" "`typecontextmanager`. :meth:`~contextmanager.__enter__` returns the pool " "object, and :meth:`~contextmanager.__exit__` calls :meth:`terminate`." msgstr "" -#: ../../library/multiprocessing.rst:2374 +#: ../../library/multiprocessing.rst:2380 msgid "" "The class of the result returned by :meth:`Pool.apply_async` and :meth:`Pool." "map_async`." msgstr "" -#: ../../library/multiprocessing.rst:2379 +#: ../../library/multiprocessing.rst:2385 msgid "" "Return the result when it arrives. If *timeout* is not ``None`` and the " "result does not arrive within *timeout* seconds then :exc:`multiprocessing." @@ -2624,41 +2632,41 @@ msgid "" "exception will be reraised by :meth:`get`." msgstr "" -#: ../../library/multiprocessing.rst:2386 +#: ../../library/multiprocessing.rst:2392 msgid "Wait until the result is available or until *timeout* seconds pass." msgstr "" -#: ../../library/multiprocessing.rst:2390 +#: ../../library/multiprocessing.rst:2396 msgid "Return whether the call has completed." msgstr "" -#: ../../library/multiprocessing.rst:2394 +#: ../../library/multiprocessing.rst:2400 msgid "" "Return whether the call completed without raising an exception. Will raise :" "exc:`ValueError` if the result is not ready." msgstr "" -#: ../../library/multiprocessing.rst:2397 +#: ../../library/multiprocessing.rst:2403 msgid "" "If the result is not ready, :exc:`ValueError` is raised instead of :exc:" "`AssertionError`." msgstr "" -#: ../../library/multiprocessing.rst:2401 +#: ../../library/multiprocessing.rst:2407 msgid "The following example demonstrates the use of a pool::" msgstr "" -#: ../../library/multiprocessing.rst:2428 +#: ../../library/multiprocessing.rst:2434 msgid "Listeners and Clients" msgstr "" -#: ../../library/multiprocessing.rst:2433 +#: ../../library/multiprocessing.rst:2439 msgid "" "Usually message passing between processes is done using queues or by using :" "class:`~Connection` objects returned by :func:`~multiprocessing.Pipe`." msgstr "" -#: ../../library/multiprocessing.rst:2437 +#: ../../library/multiprocessing.rst:2443 msgid "" "However, the :mod:`multiprocessing.connection` module allows some extra " "flexibility. It basically gives a high level message oriented API for " @@ -2667,46 +2675,46 @@ msgid "" "multiple connections at the same time." msgstr "" -#: ../../library/multiprocessing.rst:2446 +#: ../../library/multiprocessing.rst:2452 msgid "" "Send a randomly generated message to the other end of the connection and " "wait for a reply." msgstr "" -#: ../../library/multiprocessing.rst:2449 +#: ../../library/multiprocessing.rst:2455 msgid "" "If the reply matches the digest of the message using *authkey* as the key " "then a welcome message is sent to the other end of the connection. " "Otherwise :exc:`~multiprocessing.AuthenticationError` is raised." msgstr "" -#: ../../library/multiprocessing.rst:2455 +#: ../../library/multiprocessing.rst:2461 msgid "" "Receive a message, calculate the digest of the message using *authkey* as " "the key, and then send the digest back." msgstr "" -#: ../../library/multiprocessing.rst:2458 +#: ../../library/multiprocessing.rst:2464 msgid "" "If a welcome message is not received, then :exc:`~multiprocessing." "AuthenticationError` is raised." msgstr "" -#: ../../library/multiprocessing.rst:2463 +#: ../../library/multiprocessing.rst:2469 msgid "" "Attempt to set up a connection to the listener which is using address " "*address*, returning a :class:`~Connection`." msgstr "" -#: ../../library/multiprocessing.rst:2466 +#: ../../library/multiprocessing.rst:2472 msgid "" "The type of the connection is determined by *family* argument, but this can " "generally be omitted since it can usually be inferred from the format of " "*address*. (See :ref:`multiprocessing-address-formats`)" msgstr "" -#: ../../library/multiprocessing.rst:2470 -#: ../../library/multiprocessing.rst:2505 +#: ../../library/multiprocessing.rst:2476 +#: ../../library/multiprocessing.rst:2511 msgid "" "If *authkey* is given and not None, it should be a byte string and will be " "used as the secret key for an HMAC-based authentication challenge. No " @@ -2715,26 +2723,26 @@ msgid "" "`multiprocessing-auth-keys`." msgstr "" -#: ../../library/multiprocessing.rst:2478 +#: ../../library/multiprocessing.rst:2484 msgid "" "A wrapper for a bound socket or Windows named pipe which is 'listening' for " "connections." msgstr "" -#: ../../library/multiprocessing.rst:2481 +#: ../../library/multiprocessing.rst:2487 msgid "" "*address* is the address to be used by the bound socket or named pipe of the " "listener object." msgstr "" -#: ../../library/multiprocessing.rst:2486 +#: ../../library/multiprocessing.rst:2492 msgid "" "If an address of '0.0.0.0' is used, the address will not be a connectable " "end point on Windows. If you require a connectable end-point, you should use " "'127.0.0.1'." msgstr "" -#: ../../library/multiprocessing.rst:2490 +#: ../../library/multiprocessing.rst:2496 msgid "" "*family* is the type of socket (or named pipe) to use. This can be one of " "the strings ``'AF_INET'`` (for a TCP socket), ``'AF_UNIX'`` (for a Unix " @@ -2748,49 +2756,49 @@ msgid "" "using :func:`tempfile.mkstemp`." msgstr "" -#: ../../library/multiprocessing.rst:2501 +#: ../../library/multiprocessing.rst:2507 msgid "" "If the listener object uses a socket then *backlog* (1 by default) is passed " "to the :meth:`~socket.socket.listen` method of the socket once it has been " "bound." msgstr "" -#: ../../library/multiprocessing.rst:2513 +#: ../../library/multiprocessing.rst:2519 msgid "" "Accept a connection on the bound socket or named pipe of the listener object " "and return a :class:`~Connection` object. If authentication is attempted and " "fails, then :exc:`~multiprocessing.AuthenticationError` is raised." msgstr "" -#: ../../library/multiprocessing.rst:2520 +#: ../../library/multiprocessing.rst:2526 msgid "" "Close the bound socket or named pipe of the listener object. This is called " "automatically when the listener is garbage collected. However it is " "advisable to call it explicitly." msgstr "" -#: ../../library/multiprocessing.rst:2524 +#: ../../library/multiprocessing.rst:2530 msgid "Listener objects have the following read-only properties:" msgstr "" -#: ../../library/multiprocessing.rst:2528 +#: ../../library/multiprocessing.rst:2534 msgid "The address which is being used by the Listener object." msgstr "" -#: ../../library/multiprocessing.rst:2532 +#: ../../library/multiprocessing.rst:2538 msgid "" "The address from which the last accepted connection came. If this is " "unavailable then it is ``None``." msgstr "" -#: ../../library/multiprocessing.rst:2535 +#: ../../library/multiprocessing.rst:2541 msgid "" "Listener objects now support the context management protocol -- see :ref:" "`typecontextmanager`. :meth:`~contextmanager.__enter__` returns the " "listener object, and :meth:`~contextmanager.__exit__` calls :meth:`close`." msgstr "" -#: ../../library/multiprocessing.rst:2542 +#: ../../library/multiprocessing.rst:2548 msgid "" "Wait till an object in *object_list* is ready. Returns the list of those " "objects in *object_list* which are ready. If *timeout* is a float then the " @@ -2799,32 +2807,32 @@ msgid "" "zero timeout." msgstr "" -#: ../../library/multiprocessing.rst:2548 +#: ../../library/multiprocessing.rst:2554 msgid "" "For both POSIX and Windows, an object can appear in *object_list* if it is" msgstr "" -#: ../../library/multiprocessing.rst:2551 +#: ../../library/multiprocessing.rst:2557 msgid "a readable :class:`~multiprocessing.connection.Connection` object;" msgstr "" -#: ../../library/multiprocessing.rst:2552 +#: ../../library/multiprocessing.rst:2558 msgid "a connected and readable :class:`socket.socket` object; or" msgstr "" -#: ../../library/multiprocessing.rst:2553 +#: ../../library/multiprocessing.rst:2559 msgid "" "the :attr:`~multiprocessing.Process.sentinel` attribute of a :class:" "`~multiprocessing.Process` object." msgstr "" -#: ../../library/multiprocessing.rst:2556 +#: ../../library/multiprocessing.rst:2562 msgid "" "A connection or socket object is ready when there is data available to be " "read from it, or the other end has been closed." msgstr "" -#: ../../library/multiprocessing.rst:2559 +#: ../../library/multiprocessing.rst:2565 msgid "" "**POSIX**: ``wait(object_list, timeout)`` almost equivalent ``select." "select(object_list, [], [], timeout)``. The difference is that, if :func:" @@ -2832,7 +2840,7 @@ msgid "" "an error number of ``EINTR``, whereas :func:`wait` will not." msgstr "" -#: ../../library/multiprocessing.rst:2565 +#: ../../library/multiprocessing.rst:2571 msgid "" "**Windows**: An item in *object_list* must either be an integer handle which " "is waitable (according to the definition used by the documentation of the " @@ -2841,46 +2849,46 @@ msgid "" "that pipe handles and socket handles are **not** waitable handles.)" msgstr "" -#: ../../library/multiprocessing.rst:2575 +#: ../../library/multiprocessing.rst:2581 msgid "**Examples**" msgstr "" -#: ../../library/multiprocessing.rst:2577 +#: ../../library/multiprocessing.rst:2583 msgid "" "The following server code creates a listener which uses ``'secret " "password'`` as an authentication key. It then waits for a connection and " "sends some data to the client::" msgstr "" -#: ../../library/multiprocessing.rst:2596 +#: ../../library/multiprocessing.rst:2602 msgid "" "The following code connects to the server and receives some data from the " "server::" msgstr "" -#: ../../library/multiprocessing.rst:2613 +#: ../../library/multiprocessing.rst:2619 msgid "" "The following code uses :func:`~multiprocessing.connection.wait` to wait for " "messages from multiple processes at once::" msgstr "" -#: ../../library/multiprocessing.rst:2652 +#: ../../library/multiprocessing.rst:2658 msgid "Address Formats" msgstr "" -#: ../../library/multiprocessing.rst:2654 +#: ../../library/multiprocessing.rst:2660 msgid "" "An ``'AF_INET'`` address is a tuple of the form ``(hostname, port)`` where " "*hostname* is a string and *port* is an integer." msgstr "" -#: ../../library/multiprocessing.rst:2657 +#: ../../library/multiprocessing.rst:2663 msgid "" "An ``'AF_UNIX'`` address is a string representing a filename on the " "filesystem." msgstr "" -#: ../../library/multiprocessing.rst:2660 +#: ../../library/multiprocessing.rst:2666 msgid "" "An ``'AF_PIPE'`` address is a string of the form :samp:`r'\\\\\\\\\\\\.\\" "\\pipe\\\\\\\\{PipeName}'`. To use :func:`Client` to connect to a named " @@ -2889,17 +2897,17 @@ msgid "" "instead." msgstr "" -#: ../../library/multiprocessing.rst:2665 +#: ../../library/multiprocessing.rst:2671 msgid "" "Note that any string beginning with two backslashes is assumed by default to " "be an ``'AF_PIPE'`` address rather than an ``'AF_UNIX'`` address." msgstr "" -#: ../../library/multiprocessing.rst:2672 +#: ../../library/multiprocessing.rst:2678 msgid "Authentication keys" msgstr "" -#: ../../library/multiprocessing.rst:2674 +#: ../../library/multiprocessing.rst:2680 msgid "" "When one uses :meth:`Connection.recv `, the data received " "is automatically unpickled. Unfortunately unpickling data from an untrusted " @@ -2907,7 +2915,7 @@ msgid "" "use the :mod:`hmac` module to provide digest authentication." msgstr "" -#: ../../library/multiprocessing.rst:2680 +#: ../../library/multiprocessing.rst:2686 msgid "" "An authentication key is a byte string which can be thought of as a " "password: once a connection is established both ends will demand proof that " @@ -2915,7 +2923,7 @@ msgid "" "using the same key does **not** involve sending the key over the connection.)" msgstr "" -#: ../../library/multiprocessing.rst:2686 +#: ../../library/multiprocessing.rst:2692 msgid "" "If authentication is requested but no authentication key is specified then " "the return value of ``current_process().authkey`` is used (see :class:" @@ -2926,17 +2934,17 @@ msgid "" "setting up connections between themselves." msgstr "" -#: ../../library/multiprocessing.rst:2694 +#: ../../library/multiprocessing.rst:2700 msgid "" "Suitable authentication keys can also be generated by using :func:`os." "urandom`." msgstr "" -#: ../../library/multiprocessing.rst:2698 +#: ../../library/multiprocessing.rst:2704 msgid "Logging" msgstr "" -#: ../../library/multiprocessing.rst:2700 +#: ../../library/multiprocessing.rst:2706 msgid "" "Some support for logging is available. Note, however, that the :mod:" "`logging` package does not use process shared locks so it is possible " @@ -2944,27 +2952,27 @@ msgid "" "mixed up." msgstr "" -#: ../../library/multiprocessing.rst:2707 +#: ../../library/multiprocessing.rst:2713 msgid "" "Returns the logger used by :mod:`multiprocessing`. If necessary, a new one " "will be created." msgstr "" -#: ../../library/multiprocessing.rst:2710 +#: ../../library/multiprocessing.rst:2716 msgid "" "When first created the logger has level :const:`logging.NOTSET` and no " "default handler. Messages sent to this logger will not by default propagate " "to the root logger." msgstr "" -#: ../../library/multiprocessing.rst:2714 +#: ../../library/multiprocessing.rst:2720 msgid "" "Note that on Windows child processes will only inherit the level of the " "parent process's logger -- any other customization of the logger will not be " "inherited." msgstr "" -#: ../../library/multiprocessing.rst:2721 +#: ../../library/multiprocessing.rst:2727 msgid "" "This function performs a call to :func:`get_logger` but in addition to " "returning the logger created by get_logger, it adds a handler which sends " @@ -2973,25 +2981,25 @@ msgid "" "``level`` argument." msgstr "" -#: ../../library/multiprocessing.rst:2727 +#: ../../library/multiprocessing.rst:2733 msgid "Below is an example session with logging turned on::" msgstr "" -#: ../../library/multiprocessing.rst:2742 +#: ../../library/multiprocessing.rst:2748 msgid "For a full table of logging levels, see the :mod:`logging` module." msgstr "" -#: ../../library/multiprocessing.rst:2746 +#: ../../library/multiprocessing.rst:2752 msgid "The :mod:`multiprocessing.dummy` module" msgstr "" -#: ../../library/multiprocessing.rst:2751 +#: ../../library/multiprocessing.rst:2757 msgid "" ":mod:`multiprocessing.dummy` replicates the API of :mod:`multiprocessing` " "but is no more than a wrapper around the :mod:`threading` module." msgstr "" -#: ../../library/multiprocessing.rst:2756 +#: ../../library/multiprocessing.rst:2762 msgid "" "In particular, the ``Pool`` function provided by :mod:`multiprocessing." "dummy` returns an instance of :class:`ThreadPool`, which is a subclass of :" @@ -2999,7 +3007,7 @@ msgid "" "worker threads rather than worker processes." msgstr "" -#: ../../library/multiprocessing.rst:2764 +#: ../../library/multiprocessing.rst:2770 msgid "" "A thread pool object which controls a pool of worker threads to which jobs " "can be submitted. :class:`ThreadPool` instances are fully interface " @@ -3009,18 +3017,18 @@ msgid "" "pool.Pool.terminate` manually." msgstr "" -#: ../../library/multiprocessing.rst:2771 +#: ../../library/multiprocessing.rst:2777 msgid "" "*processes* is the number of worker threads to use. If *processes* is " "``None`` then the number returned by :func:`os.cpu_count` is used." msgstr "" -#: ../../library/multiprocessing.rst:2777 +#: ../../library/multiprocessing.rst:2783 msgid "" "Unlike :class:`Pool`, *maxtasksperchild* and *context* cannot be provided." msgstr "" -#: ../../library/multiprocessing.rst:2781 +#: ../../library/multiprocessing.rst:2787 msgid "" "A :class:`ThreadPool` shares the same interface as :class:`Pool`, which is " "designed around a pool of processes and predates the introduction of the :" @@ -3030,7 +3038,7 @@ msgid "" "is not understood by any other libraries." msgstr "" -#: ../../library/multiprocessing.rst:2788 +#: ../../library/multiprocessing.rst:2794 msgid "" "Users should generally prefer to use :class:`concurrent.futures." "ThreadPoolExecutor`, which has a simpler interface that was designed around " @@ -3039,69 +3047,69 @@ msgid "" "`asyncio`." msgstr "" -#: ../../library/multiprocessing.rst:2798 +#: ../../library/multiprocessing.rst:2804 msgid "Programming guidelines" msgstr "" -#: ../../library/multiprocessing.rst:2800 +#: ../../library/multiprocessing.rst:2806 msgid "" "There are certain guidelines and idioms which should be adhered to when " "using :mod:`multiprocessing`." msgstr "" -#: ../../library/multiprocessing.rst:2805 +#: ../../library/multiprocessing.rst:2811 msgid "All start methods" msgstr "" -#: ../../library/multiprocessing.rst:2807 +#: ../../library/multiprocessing.rst:2813 msgid "The following applies to all start methods." msgstr "" -#: ../../library/multiprocessing.rst:2809 +#: ../../library/multiprocessing.rst:2815 msgid "Avoid shared state" msgstr "" -#: ../../library/multiprocessing.rst:2811 +#: ../../library/multiprocessing.rst:2817 msgid "" "As far as possible one should try to avoid shifting large amounts of data " "between processes." msgstr "" -#: ../../library/multiprocessing.rst:2814 +#: ../../library/multiprocessing.rst:2820 msgid "" "It is probably best to stick to using queues or pipes for communication " "between processes rather than using the lower level synchronization " "primitives." msgstr "" -#: ../../library/multiprocessing.rst:2818 +#: ../../library/multiprocessing.rst:2824 msgid "Picklability" msgstr "" -#: ../../library/multiprocessing.rst:2820 +#: ../../library/multiprocessing.rst:2826 msgid "Ensure that the arguments to the methods of proxies are picklable." msgstr "" -#: ../../library/multiprocessing.rst:2822 +#: ../../library/multiprocessing.rst:2828 msgid "Thread safety of proxies" msgstr "" -#: ../../library/multiprocessing.rst:2824 +#: ../../library/multiprocessing.rst:2830 msgid "" "Do not use a proxy object from more than one thread unless you protect it " "with a lock." msgstr "" -#: ../../library/multiprocessing.rst:2827 +#: ../../library/multiprocessing.rst:2833 msgid "" "(There is never a problem with different processes using the *same* proxy.)" msgstr "" -#: ../../library/multiprocessing.rst:2829 +#: ../../library/multiprocessing.rst:2835 msgid "Joining zombie processes" msgstr "" -#: ../../library/multiprocessing.rst:2831 +#: ../../library/multiprocessing.rst:2837 msgid "" "On POSIX when a process finishes but has not been joined it becomes a " "zombie. There should never be very many because each time a new process " @@ -3112,11 +3120,11 @@ msgid "" "explicitly join all the processes that you start." msgstr "" -#: ../../library/multiprocessing.rst:2839 +#: ../../library/multiprocessing.rst:2845 msgid "Better to inherit than pickle/unpickle" msgstr "" -#: ../../library/multiprocessing.rst:2841 +#: ../../library/multiprocessing.rst:2847 msgid "" "When using the *spawn* or *forkserver* start methods many types from :mod:" "`multiprocessing` need to be picklable so that child processes can use " @@ -3126,11 +3134,11 @@ msgid "" "inherit it from an ancestor process." msgstr "" -#: ../../library/multiprocessing.rst:2849 +#: ../../library/multiprocessing.rst:2855 msgid "Avoid terminating processes" msgstr "" -#: ../../library/multiprocessing.rst:2851 +#: ../../library/multiprocessing.rst:2857 msgid "" "Using the :meth:`Process.terminate ` " "method to stop a process is liable to cause any shared resources (such as " @@ -3138,18 +3146,18 @@ msgid "" "become broken or unavailable to other processes." msgstr "" -#: ../../library/multiprocessing.rst:2857 +#: ../../library/multiprocessing.rst:2863 msgid "" "Therefore it is probably best to only consider using :meth:`Process." "terminate ` on processes which never use " "any shared resources." msgstr "" -#: ../../library/multiprocessing.rst:2861 +#: ../../library/multiprocessing.rst:2867 msgid "Joining processes that use queues" msgstr "" -#: ../../library/multiprocessing.rst:2863 +#: ../../library/multiprocessing.rst:2869 msgid "" "Bear in mind that a process that has put items in a queue will wait before " "terminating until all the buffered items are fed by the \"feeder\" thread to " @@ -3158,7 +3166,7 @@ msgid "" "queue to avoid this behaviour.)" msgstr "" -#: ../../library/multiprocessing.rst:2869 +#: ../../library/multiprocessing.rst:2875 msgid "" "This means that whenever you use a queue you need to make sure that all " "items which have been put on the queue will eventually be removed before the " @@ -3167,21 +3175,21 @@ msgid "" "processes will be joined automatically." msgstr "" -#: ../../library/multiprocessing.rst:2875 +#: ../../library/multiprocessing.rst:2881 msgid "An example which will deadlock is the following::" msgstr "" -#: ../../library/multiprocessing.rst:2889 +#: ../../library/multiprocessing.rst:2895 msgid "" "A fix here would be to swap the last two lines (or simply remove the ``p." "join()`` line)." msgstr "" -#: ../../library/multiprocessing.rst:2892 +#: ../../library/multiprocessing.rst:2898 msgid "Explicitly pass resources to child processes" msgstr "" -#: ../../library/multiprocessing.rst:2894 +#: ../../library/multiprocessing.rst:2900 msgid "" "On POSIX using the *fork* start method, a child process can make use of a " "shared resource created in a parent process using a global resource. " @@ -3189,7 +3197,7 @@ msgid "" "for the child process." msgstr "" -#: ../../library/multiprocessing.rst:2899 +#: ../../library/multiprocessing.rst:2905 msgid "" "Apart from making the code (potentially) compatible with Windows and the " "other start methods this also ensures that as long as the child process is " @@ -3198,29 +3206,29 @@ msgid "" "collected in the parent process." msgstr "" -#: ../../library/multiprocessing.rst:2906 +#: ../../library/multiprocessing.rst:2912 msgid "So for instance ::" msgstr "" -#: ../../library/multiprocessing.rst:2918 +#: ../../library/multiprocessing.rst:2924 msgid "should be rewritten as ::" msgstr "" -#: ../../library/multiprocessing.rst:2930 +#: ../../library/multiprocessing.rst:2936 msgid "Beware of replacing :data:`sys.stdin` with a \"file like object\"" msgstr "" -#: ../../library/multiprocessing.rst:2932 +#: ../../library/multiprocessing.rst:2938 msgid ":mod:`multiprocessing` originally unconditionally called::" msgstr "" -#: ../../library/multiprocessing.rst:2936 +#: ../../library/multiprocessing.rst:2942 msgid "" "in the :meth:`multiprocessing.Process._bootstrap` method --- this resulted " "in issues with processes-in-processes. This has been changed to::" msgstr "" -#: ../../library/multiprocessing.rst:2942 +#: ../../library/multiprocessing.rst:2948 msgid "" "Which solves the fundamental issue of processes colliding with each other " "resulting in a bad file descriptor error, but introduces a potential danger " @@ -3230,33 +3238,33 @@ msgid "" "data being flushed to the object multiple times, resulting in corruption." msgstr "" -#: ../../library/multiprocessing.rst:2949 +#: ../../library/multiprocessing.rst:2955 msgid "" "If you write a file-like object and implement your own caching, you can make " "it fork-safe by storing the pid whenever you append to the cache, and " "discarding the cache when the pid changes. For example::" msgstr "" -#: ../../library/multiprocessing.rst:2961 +#: ../../library/multiprocessing.rst:2967 msgid "" "For more information, see :issue:`5155`, :issue:`5313` and :issue:`5331`" msgstr "" -#: ../../library/multiprocessing.rst:2964 +#: ../../library/multiprocessing.rst:2970 msgid "The *spawn* and *forkserver* start methods" msgstr "" -#: ../../library/multiprocessing.rst:2966 +#: ../../library/multiprocessing.rst:2972 msgid "" "There are a few extra restriction which don't apply to the *fork* start " "method." msgstr "" -#: ../../library/multiprocessing.rst:2969 +#: ../../library/multiprocessing.rst:2975 msgid "More picklability" msgstr "" -#: ../../library/multiprocessing.rst:2971 +#: ../../library/multiprocessing.rst:2977 msgid "" "Ensure that all arguments to :meth:`Process.__init__` are picklable. Also, " "if you subclass :class:`~multiprocessing.Process` then make sure that " @@ -3264,11 +3272,11 @@ msgid "" "Process.start>` method is called." msgstr "" -#: ../../library/multiprocessing.rst:2976 +#: ../../library/multiprocessing.rst:2982 msgid "Global variables" msgstr "" -#: ../../library/multiprocessing.rst:2978 +#: ../../library/multiprocessing.rst:2984 msgid "" "Bear in mind that if code run in a child process tries to access a global " "variable, then the value it sees (if any) may not be the same as the value " @@ -3276,66 +3284,66 @@ msgid "" "Process.start>` was called." msgstr "" -#: ../../library/multiprocessing.rst:2983 +#: ../../library/multiprocessing.rst:2989 msgid "" "However, global variables which are just module level constants cause no " "problems." msgstr "" -#: ../../library/multiprocessing.rst:2988 +#: ../../library/multiprocessing.rst:2994 msgid "Safe importing of main module" msgstr "" -#: ../../library/multiprocessing.rst:2990 +#: ../../library/multiprocessing.rst:2996 msgid "" "Make sure that the main module can be safely imported by a new Python " "interpreter without causing unintended side effects (such as starting a new " "process)." msgstr "" -#: ../../library/multiprocessing.rst:2994 +#: ../../library/multiprocessing.rst:3000 msgid "" "For example, using the *spawn* or *forkserver* start method running the " "following module would fail with a :exc:`RuntimeError`::" msgstr "" -#: ../../library/multiprocessing.rst:3006 +#: ../../library/multiprocessing.rst:3012 msgid "" "Instead one should protect the \"entry point\" of the program by using ``if " "__name__ == '__main__':`` as follows::" msgstr "" -#: ../../library/multiprocessing.rst:3020 +#: ../../library/multiprocessing.rst:3026 msgid "" "(The ``freeze_support()`` line can be omitted if the program will be run " "normally instead of frozen.)" msgstr "" -#: ../../library/multiprocessing.rst:3023 +#: ../../library/multiprocessing.rst:3029 msgid "" "This allows the newly spawned Python interpreter to safely import the module " "and then run the module's ``foo()`` function." msgstr "" -#: ../../library/multiprocessing.rst:3026 +#: ../../library/multiprocessing.rst:3032 msgid "" "Similar restrictions apply if a pool or manager is created in the main " "module." msgstr "" -#: ../../library/multiprocessing.rst:3033 +#: ../../library/multiprocessing.rst:3039 msgid "Examples" msgstr "範例" -#: ../../library/multiprocessing.rst:3035 +#: ../../library/multiprocessing.rst:3041 msgid "Demonstration of how to create and use customized managers and proxies:" msgstr "" -#: ../../library/multiprocessing.rst:3041 +#: ../../library/multiprocessing.rst:3047 msgid "Using :class:`~multiprocessing.pool.Pool`:" msgstr "" -#: ../../library/multiprocessing.rst:3047 +#: ../../library/multiprocessing.rst:3053 msgid "" "An example showing how to use queues to feed tasks to a collection of worker " "processes and collect the results:" diff --git a/library/os.po b/library/os.po index e7c91a433e..2d9cdc7d82 100644 --- a/library/os.po +++ b/library/os.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 00:03+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2023-08-30 23:53+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -142,8 +142,8 @@ msgid "" "On some systems, conversion using the file system encoding may fail. In this " "case, Python uses the :ref:`surrogateescape encoding error handler " "`, which means that undecodable bytes are replaced by a " -"Unicode character U+DCxx on decoding, and these are again translated to the " -"original byte on encoding." +"Unicode character U+DC\\ *xx* on decoding, and these are again translated to " +"the original byte on encoding." msgstr "" #: ../../library/os.rst:95 @@ -314,20 +314,19 @@ msgstr "" #: ../../library/os.rst:4108 ../../library/os.rst:4117 #: ../../library/os.rst:4125 ../../library/os.rst:4133 #: ../../library/os.rst:4140 ../../library/os.rst:4147 -#: ../../library/os.rst:4168 ../../library/os.rst:4185 -#: ../../library/os.rst:4225 ../../library/os.rst:4232 -#: ../../library/os.rst:4262 ../../library/os.rst:4389 -#: ../../library/os.rst:4438 ../../library/os.rst:4675 -#: ../../library/os.rst:4709 ../../library/os.rst:4767 -#: ../../library/os.rst:4781 ../../library/os.rst:4798 -#: ../../library/os.rst:4813 ../../library/os.rst:4824 -#: ../../library/os.rst:4836 ../../library/os.rst:4849 -#: ../../library/os.rst:4858 ../../library/os.rst:4868 -#: ../../library/os.rst:4881 ../../library/os.rst:4932 -#: ../../library/os.rst:4943 ../../library/os.rst:4955 -#: ../../library/os.rst:4962 ../../library/os.rst:4971 -#: ../../library/os.rst:4980 ../../library/os.rst:4989 -#: ../../library/os.rst:4998 +#: ../../library/os.rst:4213 ../../library/os.rst:4253 +#: ../../library/os.rst:4260 ../../library/os.rst:4290 +#: ../../library/os.rst:4417 ../../library/os.rst:4466 +#: ../../library/os.rst:4703 ../../library/os.rst:4737 +#: ../../library/os.rst:4795 ../../library/os.rst:4809 +#: ../../library/os.rst:4826 ../../library/os.rst:4841 +#: ../../library/os.rst:4852 ../../library/os.rst:4864 +#: ../../library/os.rst:4877 ../../library/os.rst:4886 +#: ../../library/os.rst:4896 ../../library/os.rst:4909 +#: ../../library/os.rst:4960 ../../library/os.rst:4971 +#: ../../library/os.rst:4983 ../../library/os.rst:4990 +#: ../../library/os.rst:4999 ../../library/os.rst:5008 +#: ../../library/os.rst:5017 ../../library/os.rst:5026 msgid ":ref:`Availability `: Unix, not Emscripten, not WASI." msgstr ":ref:`適用 `:Unix、非 Emscripten、非 WASI。" @@ -487,8 +486,8 @@ msgstr "" #: ../../library/os.rst:1649 ../../library/os.rst:1797 #: ../../library/os.rst:2530 ../../library/os.rst:3375 #: ../../library/os.rst:3412 ../../library/os.rst:4028 -#: ../../library/os.rst:4526 ../../library/os.rst:4537 -#: ../../library/os.rst:4654 +#: ../../library/os.rst:4554 ../../library/os.rst:4565 +#: ../../library/os.rst:4682 msgid ":ref:`Availability `: Unix, Windows." msgstr ":ref:`適用 `:Unix、Windows。" @@ -519,9 +518,9 @@ msgstr "" #: ../../library/os.rst:2165 ../../library/os.rst:2178 #: ../../library/os.rst:2496 ../../library/os.rst:2508 #: ../../library/os.rst:3241 ../../library/os.rst:3398 -#: ../../library/os.rst:3631 ../../library/os.rst:5144 -#: ../../library/os.rst:5153 ../../library/os.rst:5174 -#: ../../library/os.rst:5184 ../../library/os.rst:5193 +#: ../../library/os.rst:3631 ../../library/os.rst:5174 +#: ../../library/os.rst:5183 ../../library/os.rst:5204 +#: ../../library/os.rst:5214 ../../library/os.rst:5223 msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" @@ -594,9 +593,9 @@ msgid "" msgstr "" #: ../../library/os.rst:426 ../../library/os.rst:462 ../../library/os.rst:3993 -#: ../../library/os.rst:4209 ../../library/os.rst:4507 -#: ../../library/os.rst:4631 ../../library/os.rst:4747 -#: ../../library/os.rst:4916 +#: ../../library/os.rst:4237 ../../library/os.rst:4535 +#: ../../library/os.rst:4659 ../../library/os.rst:4775 +#: ../../library/os.rst:4944 msgid "" ":ref:`Availability `: Unix, Windows, not Emscripten, not WASI." msgstr ":ref:`適用 `:Unix、Windows、非 Emscripten、非 WASI。" @@ -894,7 +893,7 @@ msgid "" "or even ``socket.gethostbyaddr(socket.gethostname())``." msgstr "" -#: ../../library/os.rst:789 ../../library/os.rst:4656 +#: ../../library/os.rst:789 ../../library/os.rst:4684 msgid "" "Return type changed from a tuple to a tuple-like object with named " "attributes." @@ -1444,7 +1443,7 @@ msgid "The *dir_fd* argument." msgstr "*dir_fd* 引數。" #: ../../library/os.rst:1257 ../../library/os.rst:1576 -#: ../../library/os.rst:1752 ../../library/os.rst:4749 +#: ../../library/os.rst:1752 ../../library/os.rst:4777 msgid "" "If the system call is interrupted and the signal handler does not raise an " "exception, the function now retries the system call instead of raising an :" @@ -1465,7 +1464,7 @@ msgstr "" #: ../../library/os.rst:3435 ../../library/os.rst:3475 #: ../../library/os.rst:3574 ../../library/os.rst:3635 #: ../../library/os.rst:3819 ../../library/os.rst:3999 -#: ../../library/os.rst:4514 +#: ../../library/os.rst:4542 msgid "Accepts a :term:`path-like object`." msgstr "" @@ -2008,8 +2007,8 @@ msgid "Get the \"inheritable\" flag of the specified handle (a boolean)." msgstr "" #: ../../library/os.rst:1849 ../../library/os.rst:1855 -#: ../../library/os.rst:3924 ../../library/os.rst:4549 -#: ../../library/os.rst:4594 +#: ../../library/os.rst:3924 ../../library/os.rst:4577 +#: ../../library/os.rst:4622 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" @@ -4542,18 +4541,55 @@ msgid "" "Raises an :ref:`auditing event ` ``os.fork`` with no arguments." msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``os.fork``。" -#: ../../library/os.rst:4160 +#: ../../library/os.rst:4162 +msgid "" +"If you use TLS sockets in an application calling ``fork()``, see the warning " +"in the :mod:`ssl` documentation." +msgstr "" + +#: ../../library/os.rst:4165 msgid "" "Calling ``fork()`` in a subinterpreter is no longer supported (:exc:" "`RuntimeError` is raised)." msgstr "" -#: ../../library/os.rst:4166 -msgid "See :mod:`ssl` for applications that use the SSL module with fork()." +#: ../../library/os.rst:4169 +msgid "" +"If Python is able to detect that your process has multiple threads, :func:" +"`os.fork` now raises a :exc:`DeprecationWarning`." msgstr "" #: ../../library/os.rst:4173 msgid "" +"We chose to surface this as a warning, when detectable, to better inform " +"developers of a design problem that the POSIX platform specifically notes as " +"not supported. Even in code that *appears* to work, it has never been safe " +"to mix threading with :func:`os.fork` on POSIX platforms. The CPython " +"runtime itself has always made API calls that are not safe for use in the " +"child process when threads existed in the parent (such as ``malloc`` and " +"``free``)." +msgstr "" + +#: ../../library/os.rst:4182 +msgid "" +"Users of macOS or users of libc or malloc implementations other than those " +"typically found in glibc to date are among those already more likely to " +"experience deadlocks running such code." +msgstr "" + +#: ../../library/os.rst:4186 +msgid "" +"See `this discussion on fork being incompatible with threads `_ for technical details of why we're surfacing " +"this longstanding platform compatibility problem to developers." +msgstr "" + +#: ../../library/os.rst:4191 ../../library/os.rst:4433 +msgid ":ref:`Availability `: POSIX, not Emscripten, not WASI." +msgstr ":ref:`適用 `:POSIX、非 Emscripten、非 WASI。" + +#: ../../library/os.rst:4196 +msgid "" "Fork a child process, using a new pseudo-terminal as the child's controlling " "terminal. Return a pair of ``(pid, fd)``, where *pid* is ``0`` in the child, " "the new child's process id in the parent, and *fd* is the file descriptor of " @@ -4561,24 +4597,31 @@ msgid "" "the :mod:`pty` module. If an error occurs :exc:`OSError` is raised." msgstr "" -#: ../../library/os.rst:4179 +#: ../../library/os.rst:4202 msgid "" "Raises an :ref:`auditing event ` ``os.forkpty`` with no arguments." msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``os.forkpty``。" -#: ../../library/os.rst:4181 +#: ../../library/os.rst:4204 +msgid "" +"If Python is able to detect that your process has multiple threads, this now " +"raises a :exc:`DeprecationWarning`. See the longer explanation on :func:`os." +"fork`." +msgstr "" + +#: ../../library/os.rst:4209 msgid "" "Calling ``forkpty()`` in a subinterpreter is no longer supported (:exc:" "`RuntimeError` is raised)." msgstr "" -#: ../../library/os.rst:4194 +#: ../../library/os.rst:4222 msgid "" "Send signal *sig* to the process *pid*. Constants for the specific signals " "available on the host platform are defined in the :mod:`signal` module." msgstr "" -#: ../../library/os.rst:4197 +#: ../../library/os.rst:4225 msgid "" "Windows: The :const:`signal.CTRL_C_EVENT` and :const:`signal." "CTRL_BREAK_EVENT` signals are special signals which can only be sent to " @@ -4589,11 +4632,11 @@ msgid "" "process handles to be killed." msgstr "" -#: ../../library/os.rst:4205 +#: ../../library/os.rst:4233 msgid "See also :func:`signal.pthread_kill`." msgstr "另請參閱 :func:`signal.pthread_kill`\\ 。" -#: ../../library/os.rst:4207 +#: ../../library/os.rst:4235 msgid "" "Raises an :ref:`auditing event ` ``os.kill`` with arguments " "``pid``, ``sig``." @@ -4601,15 +4644,15 @@ msgstr "" "引發一個附帶引數 ``pid``、``sig`` 的\\ :ref:`稽核事件 ` ``os." "kill``。" -#: ../../library/os.rst:4211 +#: ../../library/os.rst:4239 msgid "Windows support." msgstr "" -#: ../../library/os.rst:4221 +#: ../../library/os.rst:4249 msgid "Send the signal *sig* to the process group *pgid*." msgstr "" -#: ../../library/os.rst:4223 +#: ../../library/os.rst:4251 msgid "" "Raises an :ref:`auditing event ` ``os.killpg`` with arguments " "``pgid``, ``sig``." @@ -4617,27 +4660,27 @@ msgstr "" "引發一個附帶引數 ``pgid``、``sig`` 的\\ :ref:`稽核事件 ` ``os." "killpg``。" -#: ../../library/os.rst:4230 +#: ../../library/os.rst:4258 msgid "" "Add *increment* to the process's \"niceness\". Return the new niceness." msgstr "" -#: ../../library/os.rst:4237 +#: ../../library/os.rst:4265 msgid "" "Return a file descriptor referring to the process *pid* with *flags* set. " "This descriptor can be used to perform process management without races and " "signals." msgstr "" -#: ../../library/os.rst:4241 +#: ../../library/os.rst:4269 msgid "See the :manpage:`pidfd_open(2)` man page for more details." msgstr "更多細節請見 :manpage:`pidfd_open(2)` 手冊頁。" -#: ../../library/os.rst:4243 +#: ../../library/os.rst:4271 msgid ":ref:`Availability `: Linux >= 5.3" msgstr ":ref:`適用 `:Linux 5.3 以上" -#: ../../library/os.rst:4248 +#: ../../library/os.rst:4276 msgid "" "This flag indicates that the file descriptor will be non-blocking. If the " "process referred to by the file descriptor has not yet terminated, then an " @@ -4645,17 +4688,17 @@ msgid "" "immediately return the error :const:`~errno.EAGAIN` rather than blocking." msgstr "" -#: ../../library/os.rst:4253 +#: ../../library/os.rst:4281 msgid ":ref:`Availability `: Linux >= 5.10" msgstr ":ref:`適用 `:Linux 5.10 以上" -#: ../../library/os.rst:4259 +#: ../../library/os.rst:4287 msgid "" "Lock program segments into memory. The value of *op* (defined in ````) determines which segments are locked." msgstr "" -#: ../../library/os.rst:4267 +#: ../../library/os.rst:4295 msgid "" "Open a pipe to or from command *cmd*. The return value is an open file " "object connected to the pipe, which can be read or written depending on " @@ -4665,7 +4708,7 @@ msgid "" "rather than bytes." msgstr "" -#: ../../library/os.rst:4275 +#: ../../library/os.rst:4303 msgid "" "The ``close`` method returns :const:`None` if the subprocess exited " "successfully, or the subprocess's return code if there was an error. On " @@ -4677,60 +4720,60 @@ msgid "" "contains the signed integer return code from the child process." msgstr "" -#: ../../library/os.rst:4285 +#: ../../library/os.rst:4313 msgid "" "On Unix, :func:`waitstatus_to_exitcode` can be used to convert the ``close`` " "method result (exit status) into an exit code if it is not ``None``. On " "Windows, the ``close`` method result is directly the exit code (or ``None``)." msgstr "" -#: ../../library/os.rst:4290 +#: ../../library/os.rst:4318 msgid "" "This is implemented using :class:`subprocess.Popen`; see that class's " "documentation for more powerful ways to manage and communicate with " "subprocesses." msgstr "" -#: ../../library/os.rst:4294 +#: ../../library/os.rst:4322 msgid ":ref:`Availability `: not Emscripten, not WASI." msgstr ":ref:`適用 `:非 Emscripten、非 WASI。" -#: ../../library/os.rst:4297 +#: ../../library/os.rst:4325 msgid "" "The :ref:`Python UTF-8 Mode ` affects encodings used for *cmd* " "and pipe contents." msgstr "" -#: ../../library/os.rst:4300 +#: ../../library/os.rst:4328 msgid "" ":func:`popen` is a simple wrapper around :class:`subprocess.Popen`. Use :" "class:`subprocess.Popen` or :func:`subprocess.run` to control options like " "encodings." msgstr "" -#: ../../library/os.rst:4309 +#: ../../library/os.rst:4337 msgid "Wraps the :c:func:`!posix_spawn` C library API for use from Python." msgstr "" -#: ../../library/os.rst:4311 +#: ../../library/os.rst:4339 msgid "" "Most users should use :func:`subprocess.run` instead of :func:`posix_spawn`." msgstr "" -#: ../../library/os.rst:4313 +#: ../../library/os.rst:4341 msgid "" "The positional-only arguments *path*, *args*, and *env* are similar to :func:" "`execve`." msgstr "" -#: ../../library/os.rst:4316 +#: ../../library/os.rst:4344 msgid "" "The *path* parameter is the path to the executable file. The *path* should " "contain a directory. Use :func:`posix_spawnp` to pass an executable file " "without directory." msgstr "" -#: ../../library/os.rst:4320 +#: ../../library/os.rst:4348 msgid "" "The *file_actions* argument may be a sequence of tuples describing actions " "to take on specific file descriptors in the child process between the C " @@ -4739,31 +4782,31 @@ msgid "" "describing the remaining tuple elements:" msgstr "" -#: ../../library/os.rst:4328 +#: ../../library/os.rst:4356 msgid "(``os.POSIX_SPAWN_OPEN``, *fd*, *path*, *flags*, *mode*)" msgstr "(``os.POSIX_SPAWN_OPEN``, *fd*, *path*, *flags*, *mode*)" -#: ../../library/os.rst:4330 +#: ../../library/os.rst:4358 msgid "Performs ``os.dup2(os.open(path, flags, mode), fd)``." msgstr "" -#: ../../library/os.rst:4334 +#: ../../library/os.rst:4362 msgid "(``os.POSIX_SPAWN_CLOSE``, *fd*)" msgstr "(``os.POSIX_SPAWN_CLOSE``, *fd*)" -#: ../../library/os.rst:4336 +#: ../../library/os.rst:4364 msgid "Performs ``os.close(fd)``." msgstr "" -#: ../../library/os.rst:4340 +#: ../../library/os.rst:4368 msgid "(``os.POSIX_SPAWN_DUP2``, *fd*, *new_fd*)" msgstr "(``os.POSIX_SPAWN_DUP2``, *fd*, *new_fd*)" -#: ../../library/os.rst:4342 +#: ../../library/os.rst:4370 msgid "Performs ``os.dup2(fd, new_fd)``." msgstr "" -#: ../../library/os.rst:4344 +#: ../../library/os.rst:4372 msgid "" "These tuples correspond to the C library :c:func:`!" "posix_spawn_file_actions_addopen`, :c:func:`!" @@ -4772,7 +4815,7 @@ msgid "" "`!posix_spawn` call itself." msgstr "" -#: ../../library/os.rst:4350 +#: ../../library/os.rst:4378 msgid "" "The *setpgroup* argument will set the process group of the child to the " "value specified. If the value specified is 0, the child's process group ID " @@ -4781,7 +4824,7 @@ msgid "" "corresponds to the C library :c:macro:`!POSIX_SPAWN_SETPGROUP` flag." msgstr "" -#: ../../library/os.rst:4356 +#: ../../library/os.rst:4384 msgid "" "If the *resetids* argument is ``True`` it will reset the effective UID and " "GID of the child to the real UID and GID of the parent process. If the " @@ -4792,7 +4835,7 @@ msgid "" "library :c:macro:`!POSIX_SPAWN_RESETIDS` flag." msgstr "" -#: ../../library/os.rst:4364 +#: ../../library/os.rst:4392 msgid "" "If the *setsid* argument is ``True``, it will create a new session ID for " "``posix_spawn``. *setsid* requires :c:macro:`!POSIX_SPAWN_SETSID` or :c:" @@ -4800,7 +4843,7 @@ msgid "" "is raised." msgstr "" -#: ../../library/os.rst:4369 +#: ../../library/os.rst:4397 msgid "" "The *setsigmask* argument will set the signal mask to the signal set " "specified. If the parameter is not used, then the child inherits the " @@ -4808,14 +4851,14 @@ msgid "" "POSIX_SPAWN_SETSIGMASK` flag." msgstr "" -#: ../../library/os.rst:4374 +#: ../../library/os.rst:4402 msgid "" "The *sigdef* argument will reset the disposition of all signals in the set " "specified. This argument corresponds to the C library :c:macro:`!" "POSIX_SPAWN_SETSIGDEF` flag." msgstr "" -#: ../../library/os.rst:4378 +#: ../../library/os.rst:4406 msgid "" "The *scheduler* argument must be a tuple containing the (optional) scheduler " "policy and an instance of :class:`sched_param` with the scheduler " @@ -4825,7 +4868,7 @@ msgid "" "POSIX_SPAWN_SETSCHEDULER` flags." msgstr "" -#: ../../library/os.rst:4385 ../../library/os.rst:4401 +#: ../../library/os.rst:4413 ../../library/os.rst:4429 msgid "" "Raises an :ref:`auditing event ` ``os.posix_spawn`` with arguments " "``path``, ``argv``, ``env``." @@ -4833,76 +4876,72 @@ msgstr "" "引發一個附帶引數 ``path``、``argv``、``env`` 的\\ :ref:`稽核事件 ` " "``os.posix_spawn``。" -#: ../../library/os.rst:4395 +#: ../../library/os.rst:4423 msgid "Wraps the :c:func:`!posix_spawnp` C library API for use from Python." msgstr "" -#: ../../library/os.rst:4397 +#: ../../library/os.rst:4425 msgid "" "Similar to :func:`posix_spawn` except that the system searches for the " "*executable* file in the list of directories specified by the :envvar:`PATH` " "environment variable (in the same way as for ``execvp(3)``)." msgstr "" -#: ../../library/os.rst:4405 -msgid ":ref:`Availability `: POSIX, not Emscripten, not WASI." -msgstr ":ref:`適用 `:POSIX、非 Emscripten、非 WASI。" - -#: ../../library/os.rst:4407 +#: ../../library/os.rst:4435 msgid "See :func:`posix_spawn` documentation." msgstr "" -#: ../../library/os.rst:4413 +#: ../../library/os.rst:4441 msgid "" "Register callables to be executed when a new child process is forked using :" "func:`os.fork` or similar process cloning APIs. The parameters are optional " "and keyword-only. Each specifies a different call point." msgstr "" -#: ../../library/os.rst:4418 +#: ../../library/os.rst:4446 msgid "*before* is a function called before forking a child process." msgstr "" -#: ../../library/os.rst:4419 +#: ../../library/os.rst:4447 msgid "" "*after_in_parent* is a function called from the parent process after forking " "a child process." msgstr "" -#: ../../library/os.rst:4421 +#: ../../library/os.rst:4449 msgid "*after_in_child* is a function called from the child process." msgstr "" -#: ../../library/os.rst:4423 +#: ../../library/os.rst:4451 msgid "" "These calls are only made if control is expected to return to the Python " "interpreter. A typical :mod:`subprocess` launch will not trigger them as " "the child is not going to re-enter the interpreter." msgstr "" -#: ../../library/os.rst:4427 +#: ../../library/os.rst:4455 msgid "" "Functions registered for execution before forking are called in reverse " "registration order. Functions registered for execution after forking " "(either in the parent or in the child) are called in registration order." msgstr "" -#: ../../library/os.rst:4432 +#: ../../library/os.rst:4460 msgid "" "Note that :c:func:`fork` calls made by third-party C code may not call those " "functions, unless it explicitly calls :c:func:`PyOS_BeforeFork`, :c:func:" "`PyOS_AfterFork_Parent` and :c:func:`PyOS_AfterFork_Child`." msgstr "" -#: ../../library/os.rst:4436 +#: ../../library/os.rst:4464 msgid "There is no way to unregister a function." msgstr "" -#: ../../library/os.rst:4452 +#: ../../library/os.rst:4480 msgid "Execute the program *path* in a new process." msgstr "" -#: ../../library/os.rst:4454 +#: ../../library/os.rst:4482 msgid "" "(Note that the :mod:`subprocess` module provides more powerful facilities " "for spawning new processes and retrieving their results; using that module " @@ -4910,7 +4949,7 @@ msgid "" "`subprocess-replacements` section.)" msgstr "" -#: ../../library/os.rst:4459 +#: ../../library/os.rst:4487 msgid "" "If *mode* is :const:`P_NOWAIT`, this function returns the process id of the " "new process; if *mode* is :const:`P_WAIT`, returns the process's exit code " @@ -4919,13 +4958,13 @@ msgid "" "handle, so can be used with the :func:`waitpid` function." msgstr "" -#: ../../library/os.rst:4465 +#: ../../library/os.rst:4493 msgid "" "Note on VxWorks, this function doesn't return ``-signal`` when the new " "process is killed. Instead it raises OSError exception." msgstr "" -#: ../../library/os.rst:4468 +#: ../../library/os.rst:4496 msgid "" "The \"l\" and \"v\" variants of the :func:`spawn\\* ` functions " "differ in how command-line arguments are passed. The \"l\" variants are " @@ -4937,7 +4976,7 @@ msgid "" "to the child process must start with the name of the command being run." msgstr "" -#: ../../library/os.rst:4477 +#: ../../library/os.rst:4505 msgid "" "The variants which include a second \"p\" near the end (:func:`spawnlp`, :" "func:`spawnlpe`, :func:`spawnvp`, and :func:`spawnvpe`) will use the :envvar:" @@ -4950,7 +4989,7 @@ msgid "" "appropriate absolute or relative path." msgstr "" -#: ../../library/os.rst:4487 +#: ../../library/os.rst:4515 msgid "" "For :func:`spawnle`, :func:`spawnlpe`, :func:`spawnve`, and :func:`spawnvpe` " "(note that these all end in \"e\"), the *env* parameter must be a mapping " @@ -4962,13 +5001,13 @@ msgid "" "values will cause the function to fail, with a return value of ``127``." msgstr "" -#: ../../library/os.rst:4496 +#: ../../library/os.rst:4524 msgid "" "As an example, the following calls to :func:`spawnlp` and :func:`spawnvpe` " "are equivalent::" msgstr "" -#: ../../library/os.rst:4505 +#: ../../library/os.rst:4533 msgid "" "Raises an :ref:`auditing event ` ``os.spawn`` with arguments " "``mode``, ``path``, ``args``, ``env``." @@ -4976,7 +5015,7 @@ msgstr "" "引發一個附帶引數 ``mode``、``path``、``args``、``env`` 的\\ :ref:`稽核事件 " "` ``os.spawn``。" -#: ../../library/os.rst:4509 +#: ../../library/os.rst:4537 msgid "" ":func:`spawnlp`, :func:`spawnlpe`, :func:`spawnvp` and :func:`spawnvpe` are " "not available on Windows. :func:`spawnle` and :func:`spawnve` are not " @@ -4984,7 +5023,7 @@ msgid "" "instead." msgstr "" -#: ../../library/os.rst:4521 +#: ../../library/os.rst:4549 msgid "" "Possible values for the *mode* parameter to the :func:`spawn\\* ` " "family of functions. If either of these values is given, the :func:" @@ -4992,7 +5031,7 @@ msgid "" "created, with the process id as the return value." msgstr "" -#: ../../library/os.rst:4531 +#: ../../library/os.rst:4559 msgid "" "Possible value for the *mode* parameter to the :func:`spawn\\* ` " "family of functions. If this is given as *mode*, the :func:`spawn\\*` " @@ -5001,7 +5040,7 @@ msgid "" "signal`` if a signal kills the process." msgstr "" -#: ../../library/os.rst:4543 +#: ../../library/os.rst:4571 msgid "" "Possible values for the *mode* parameter to the :func:`spawn\\* ` " "family of functions. These are less portable than those listed above. :" @@ -5011,11 +5050,11 @@ msgid "" "function will not return." msgstr "" -#: ../../library/os.rst:4554 +#: ../../library/os.rst:4582 msgid "Start a file with its associated application." msgstr "" -#: ../../library/os.rst:4556 +#: ../../library/os.rst:4584 msgid "" "When *operation* is not specified, this acts like double-clicking the file " "in Windows Explorer, or giving the file name as an argument to the :program:" @@ -5023,7 +5062,7 @@ msgid "" "whatever application (if any) its extension is associated." msgstr "" -#: ../../library/os.rst:4561 +#: ../../library/os.rst:4589 msgid "" "When another *operation* is given, it must be a \"command verb\" that " "specifies what should be done with the file. Common verbs documented by " @@ -5031,28 +5070,28 @@ msgid "" "as well as ``'explore'`` and ``'find'`` (to be used on directories)." msgstr "" -#: ../../library/os.rst:4566 +#: ../../library/os.rst:4594 msgid "" "When launching an application, specify *arguments* to be passed as a single " "string. This argument may have no effect when using this function to launch " "a document." msgstr "" -#: ../../library/os.rst:4570 +#: ../../library/os.rst:4598 msgid "" "The default working directory is inherited, but may be overridden by the " "*cwd* argument. This should be an absolute path. A relative *path* will be " "resolved against this argument." msgstr "" -#: ../../library/os.rst:4574 +#: ../../library/os.rst:4602 msgid "" "Use *show_cmd* to override the default window style. Whether this has any " "effect will depend on the application being launched. Values are integers as " "supported by the Win32 :c:func:`!ShellExecute` function." msgstr "" -#: ../../library/os.rst:4578 +#: ../../library/os.rst:4606 msgid "" ":func:`startfile` returns as soon as the associated application is launched. " "There is no option to wait for the application to close, and no way to " @@ -5063,14 +5102,14 @@ msgid "" "encoded for Win32." msgstr "" -#: ../../library/os.rst:4586 +#: ../../library/os.rst:4614 msgid "" "To reduce interpreter startup overhead, the Win32 :c:func:`!ShellExecute` " "function is not resolved until this function is first called. If the " "function cannot be resolved, :exc:`NotImplementedError` will be raised." msgstr "" -#: ../../library/os.rst:4590 +#: ../../library/os.rst:4618 msgid "" "Raises an :ref:`auditing event ` ``os.startfile`` with arguments " "``path``, ``operation``." @@ -5078,7 +5117,7 @@ msgstr "" "引發一個附帶引數 ``path``、``operation`` 的\\ :ref:`稽核事件 ` " "``os.startfile``。" -#: ../../library/os.rst:4592 +#: ../../library/os.rst:4620 msgid "" "Raises an :ref:`auditing event ` ``os.startfile/2`` with arguments " "``path``, ``operation``, ``arguments``, ``cwd``, ``show_cmd``." @@ -5086,13 +5125,13 @@ msgstr "" "引發一個附帶引數 ``path``、``operation``、``arguments``、``cwd``、" "``show_cmd`` 的\\ :ref:`稽核事件 ` ``os.startfile/2``。" -#: ../../library/os.rst:4596 +#: ../../library/os.rst:4624 msgid "" "Added the *arguments*, *cwd* and *show_cmd* arguments, and the ``os." "startfile/2`` audit event." msgstr "" -#: ../../library/os.rst:4603 +#: ../../library/os.rst:4631 msgid "" "Execute the command (a string) in a subshell. This is implemented by " "calling the Standard C function :c:func:`system`, and has the same " @@ -5103,13 +5142,13 @@ msgid "" "value of the Python function is system-dependent." msgstr "" -#: ../../library/os.rst:4611 +#: ../../library/os.rst:4639 msgid "" "On Unix, the return value is the exit status of the process encoded in the " "format specified for :func:`wait`." msgstr "" -#: ../../library/os.rst:4614 +#: ../../library/os.rst:4642 msgid "" "On Windows, the return value is that returned by the system shell after " "running *command*. The shell is given by the Windows environment variable :" @@ -5118,7 +5157,7 @@ msgid "" "shell documentation." msgstr "" -#: ../../library/os.rst:4620 +#: ../../library/os.rst:4648 msgid "" "The :mod:`subprocess` module provides more powerful facilities for spawning " "new processes and retrieving their results; using that module is preferable " @@ -5126,54 +5165,54 @@ msgid "" "the :mod:`subprocess` documentation for some helpful recipes." msgstr "" -#: ../../library/os.rst:4625 +#: ../../library/os.rst:4653 msgid "" "On Unix, :func:`waitstatus_to_exitcode` can be used to convert the result " "(exit status) into an exit code. On Windows, the result is directly the exit " "code." msgstr "" -#: ../../library/os.rst:4629 +#: ../../library/os.rst:4657 msgid "" "Raises an :ref:`auditing event ` ``os.system`` with argument " "``command``." msgstr "" "引發一個附帶引數 ``command`` 的\\ :ref:`稽核事件 ` ``os.system``。" -#: ../../library/os.rst:4636 +#: ../../library/os.rst:4664 msgid "" "Returns the current global process times. The return value is an object with " "five attributes:" msgstr "" -#: ../../library/os.rst:4639 +#: ../../library/os.rst:4667 msgid ":attr:`!user` - user time" msgstr "" -#: ../../library/os.rst:4640 +#: ../../library/os.rst:4668 msgid ":attr:`!system` - system time" msgstr ":attr:`!system` - 系統時間" -#: ../../library/os.rst:4641 +#: ../../library/os.rst:4669 msgid ":attr:`!children_user` - user time of all child processes" msgstr "" -#: ../../library/os.rst:4642 +#: ../../library/os.rst:4670 msgid ":attr:`!children_system` - system time of all child processes" msgstr "" -#: ../../library/os.rst:4643 +#: ../../library/os.rst:4671 msgid ":attr:`!elapsed` - elapsed real time since a fixed point in the past" msgstr "" -#: ../../library/os.rst:4645 +#: ../../library/os.rst:4673 msgid "" "For backwards compatibility, this object also behaves like a five-tuple " "containing :attr:`!user`, :attr:`!system`, :attr:`!children_user`, :attr:`!" "children_system`, and :attr:`!elapsed` in that order." msgstr "" -#: ../../library/os.rst:4649 +#: ../../library/os.rst:4677 msgid "" "See the Unix manual page :manpage:`times(2)` and `times(3) `_ manual page on Unix or `the " @@ -5183,7 +5222,7 @@ msgid "" "attributes are zero." msgstr "" -#: ../../library/os.rst:4663 +#: ../../library/os.rst:4691 msgid "" "Wait for completion of a child process, and return a tuple containing its " "pid and exit status indication: a 16-bit number, whose low byte is the " @@ -5192,83 +5231,83 @@ msgid "" "if a core file was produced." msgstr "" -#: ../../library/os.rst:4669 +#: ../../library/os.rst:4697 msgid "" "If there are no children that could be waited for, :exc:`ChildProcessError` " "is raised." msgstr "" -#: ../../library/os.rst:4672 ../../library/os.rst:4744 +#: ../../library/os.rst:4700 ../../library/os.rst:4772 msgid "" ":func:`waitstatus_to_exitcode` can be used to convert the exit status into " "an exit code." msgstr "" -#: ../../library/os.rst:4679 +#: ../../library/os.rst:4707 msgid "" "The other :func:`!wait*` functions documented below can be used to wait for " "the completion of a specific child process and have more options. :func:" "`waitpid` is the only one also available on Windows." msgstr "" -#: ../../library/os.rst:4686 +#: ../../library/os.rst:4714 msgid "Wait for the completion of a child process." msgstr "" -#: ../../library/os.rst:4688 +#: ../../library/os.rst:4716 msgid "" "*idtype* can be :data:`P_PID`, :data:`P_PGID`, :data:`P_ALL`, or (on Linux) :" "data:`P_PIDFD`. The interpretation of *id* depends on it; see their " "individual descriptions." msgstr "" -#: ../../library/os.rst:4691 +#: ../../library/os.rst:4719 msgid "" "*options* is an OR combination of flags. At least one of :data:`WEXITED`, :" "data:`WSTOPPED` or :data:`WCONTINUED` is required; :data:`WNOHANG` and :data:" "`WNOWAIT` are additional optional flags." msgstr "" -#: ../../library/os.rst:4695 +#: ../../library/os.rst:4723 msgid "" "The return value is an object representing the data contained in the :c:type:" "`siginfo_t` structure with the following attributes:" msgstr "" -#: ../../library/os.rst:4698 +#: ../../library/os.rst:4726 msgid ":attr:`!si_pid` (process ID)" msgstr "" -#: ../../library/os.rst:4699 +#: ../../library/os.rst:4727 msgid ":attr:`!si_uid` (real user ID of the child)" msgstr "" -#: ../../library/os.rst:4700 +#: ../../library/os.rst:4728 msgid ":attr:`!si_signo` (always :const:`~signal.SIGCHLD`)" msgstr "" -#: ../../library/os.rst:4701 +#: ../../library/os.rst:4729 msgid "" ":attr:`!si_status` (the exit status or signal number, depending on :attr:`!" "si_code`)" msgstr "" -#: ../../library/os.rst:4702 +#: ../../library/os.rst:4730 msgid ":attr:`!si_code` (see :data:`CLD_EXITED` for possible values)" msgstr "" -#: ../../library/os.rst:4704 +#: ../../library/os.rst:4732 msgid "" "If :data:`WNOHANG` is specified and there are no matching children in the " "requested state, ``None`` is returned. Otherwise, if there are no matching " "children that could be waited for, :exc:`ChildProcessError` is raised." msgstr "" -#: ../../library/os.rst:4716 +#: ../../library/os.rst:4744 msgid "The details of this function differ on Unix and Windows." msgstr "" -#: ../../library/os.rst:4718 +#: ../../library/os.rst:4746 msgid "" "On Unix: Wait for completion of a child process given by process id *pid*, " "and return a tuple containing its process id and exit status indication " @@ -5277,7 +5316,7 @@ msgid "" "operation." msgstr "" -#: ../../library/os.rst:4723 +#: ../../library/os.rst:4751 msgid "" "If *pid* is greater than ``0``, :func:`waitpid` requests status information " "for that specific process. If *pid* is ``0``, the request is for the status " @@ -5287,7 +5326,7 @@ msgid "" "group ``-pid`` (the absolute value of *pid*)." msgstr "" -#: ../../library/os.rst:4730 +#: ../../library/os.rst:4758 msgid "" "*options* is an OR combination of flags. If it contains :data:`WNOHANG` and " "there are no matching children in the requested state, ``(0, 0)`` is " @@ -5296,7 +5335,7 @@ msgid "" "are :data:`WUNTRACED` and :data:`WCONTINUED`." msgstr "" -#: ../../library/os.rst:4736 +#: ../../library/os.rst:4764 msgid "" "On Windows: Wait for completion of a process given by process handle *pid*, " "and return a tuple containing *pid*, and its exit status shifted left by 8 " @@ -5308,7 +5347,7 @@ msgid "" "process handles." msgstr "" -#: ../../library/os.rst:4757 +#: ../../library/os.rst:4785 msgid "" "Similar to :func:`waitpid`, except no process id argument is given and a 3-" "element tuple containing the child's process id, exit status indication, and " @@ -5317,13 +5356,13 @@ msgid "" "same as that provided to :func:`waitpid` and :func:`wait4`." msgstr "" -#: ../../library/os.rst:4764 ../../library/os.rst:4778 +#: ../../library/os.rst:4792 ../../library/os.rst:4806 msgid "" ":func:`waitstatus_to_exitcode` can be used to convert the exit status into " "an exitcode." msgstr "" -#: ../../library/os.rst:4772 +#: ../../library/os.rst:4800 msgid "" "Similar to :func:`waitpid`, except a 3-element tuple, containing the child's " "process id, exit status indication, and resource usage information is " @@ -5332,118 +5371,118 @@ msgid "" "to :func:`waitpid`." msgstr "" -#: ../../library/os.rst:4789 +#: ../../library/os.rst:4817 msgid "" "These are the possible values for *idtype* in :func:`waitid`. They affect " "how *id* is interpreted:" msgstr "" -#: ../../library/os.rst:4792 +#: ../../library/os.rst:4820 msgid ":data:`!P_PID` - wait for the child whose PID is *id*." msgstr "" -#: ../../library/os.rst:4793 +#: ../../library/os.rst:4821 msgid ":data:`!P_PGID` - wait for any child whose progress group ID is *id*." msgstr "" -#: ../../library/os.rst:4794 +#: ../../library/os.rst:4822 msgid ":data:`!P_ALL` - wait for any child; *id* is ignored." msgstr "" -#: ../../library/os.rst:4795 +#: ../../library/os.rst:4823 msgid "" ":data:`!P_PIDFD` - wait for the child identified by the file descriptor *id* " "(a process file descriptor created with :func:`pidfd_open`)." msgstr "" -#: ../../library/os.rst:4800 +#: ../../library/os.rst:4828 msgid ":data:`!P_PIDFD` is only available on Linux >= 5.4." msgstr "" -#: ../../library/os.rst:4803 +#: ../../library/os.rst:4831 msgid "The :data:`!P_PIDFD` constant." msgstr "" -#: ../../library/os.rst:4809 +#: ../../library/os.rst:4837 msgid "" "This *options* flag for :func:`waitpid`, :func:`wait3`, :func:`wait4`, and :" "func:`waitid` causes child processes to be reported if they have been " "continued from a job control stop since they were last reported." msgstr "" -#: ../../library/os.rst:4818 +#: ../../library/os.rst:4846 msgid "" "This *options* flag for :func:`waitid` causes child processes that have " "terminated to be reported." msgstr "" -#: ../../library/os.rst:4821 +#: ../../library/os.rst:4849 msgid "" "The other ``wait*`` functions always report children that have terminated, " "so this option is not available for them." msgstr "" -#: ../../library/os.rst:4831 +#: ../../library/os.rst:4859 msgid "" "This *options* flag for :func:`waitid` causes child processes that have been " "stopped by the delivery of a signal to be reported." msgstr "" -#: ../../library/os.rst:4834 ../../library/os.rst:4866 +#: ../../library/os.rst:4862 ../../library/os.rst:4894 msgid "This option is not available for the other ``wait*`` functions." msgstr "" -#: ../../library/os.rst:4843 +#: ../../library/os.rst:4871 msgid "" "This *options* flag for :func:`waitpid`, :func:`wait3`, and :func:`wait4` " "causes child processes to also be reported if they have been stopped but " "their current state has not been reported since they were stopped." msgstr "" -#: ../../library/os.rst:4847 +#: ../../library/os.rst:4875 msgid "This option is not available for :func:`waitid`." msgstr "" -#: ../../library/os.rst:4854 +#: ../../library/os.rst:4882 msgid "" "This *options* flag causes :func:`waitpid`, :func:`wait3`, :func:`wait4`, " "and :func:`waitid` to return right away if no child process status is " "available immediately." msgstr "" -#: ../../library/os.rst:4863 +#: ../../library/os.rst:4891 msgid "" "This *options* flag causes :func:`waitid` to leave the child in a waitable " "state, so that a later :func:`!wait*` call can be used to retrieve the child " "status information again." msgstr "" -#: ../../library/os.rst:4878 +#: ../../library/os.rst:4906 msgid "" "These are the possible values for :attr:`!si_code` in the result returned " "by :func:`waitid`." msgstr "" -#: ../../library/os.rst:4885 +#: ../../library/os.rst:4913 msgid "Added :data:`CLD_KILLED` and :data:`CLD_STOPPED` values." msgstr "" -#: ../../library/os.rst:4891 +#: ../../library/os.rst:4919 msgid "Convert a wait status to an exit code." msgstr "" -#: ../../library/os.rst:4893 +#: ../../library/os.rst:4921 msgid "On Unix:" msgstr "" -#: ../../library/os.rst:4895 +#: ../../library/os.rst:4923 msgid "" "If the process exited normally (if ``WIFEXITED(status)`` is true), return " "the process exit status (return ``WEXITSTATUS(status)``): result greater " "than or equal to 0." msgstr "" -#: ../../library/os.rst:4898 +#: ../../library/os.rst:4926 msgid "" "If the process was terminated by a signal (if ``WIFSIGNALED(status)`` is " "true), return ``-signum`` where *signum* is the number of the signal that " @@ -5451,15 +5490,15 @@ msgid "" "than 0." msgstr "" -#: ../../library/os.rst:4902 +#: ../../library/os.rst:4930 msgid "Otherwise, raise a :exc:`ValueError`." msgstr "" -#: ../../library/os.rst:4904 +#: ../../library/os.rst:4932 msgid "On Windows, return *status* shifted right by 8 bits." msgstr "" -#: ../../library/os.rst:4906 +#: ../../library/os.rst:4934 msgid "" "On Unix, if the process is being traced or if :func:`waitpid` was called " "with :data:`WUNTRACED` option, the caller must first check if " @@ -5467,217 +5506,221 @@ msgid "" "``WIFSTOPPED(status)`` is true." msgstr "" -#: ../../library/os.rst:4913 +#: ../../library/os.rst:4941 msgid "" ":func:`WIFEXITED`, :func:`WEXITSTATUS`, :func:`WIFSIGNALED`, :func:" "`WTERMSIG`, :func:`WIFSTOPPED`, :func:`WSTOPSIG` functions." msgstr "" -#: ../../library/os.rst:4921 +#: ../../library/os.rst:4949 msgid "" "The following functions take a process status code as returned by :func:" "`system`, :func:`wait`, or :func:`waitpid` as a parameter. They may be used " "to determine the disposition of a process." msgstr "" -#: ../../library/os.rst:4927 +#: ../../library/os.rst:4955 msgid "" "Return ``True`` if a core dump was generated for the process, otherwise " "return ``False``." msgstr "" -#: ../../library/os.rst:4930 ../../library/os.rst:4996 +#: ../../library/os.rst:4958 ../../library/os.rst:5024 msgid "This function should be employed only if :func:`WIFSIGNALED` is true." msgstr "" -#: ../../library/os.rst:4937 +#: ../../library/os.rst:4965 msgid "" "Return ``True`` if a stopped child has been resumed by delivery of :const:" "`~signal.SIGCONT` (if the process has been continued from a job control " "stop), otherwise return ``False``." msgstr "" -#: ../../library/os.rst:4941 +#: ../../library/os.rst:4969 msgid "See :data:`WCONTINUED` option." msgstr "參閱 :data:`WCONTINUED` 選項。" -#: ../../library/os.rst:4948 +#: ../../library/os.rst:4976 msgid "" "Return ``True`` if the process was stopped by delivery of a signal, " "otherwise return ``False``." msgstr "" -#: ../../library/os.rst:4951 +#: ../../library/os.rst:4979 msgid "" ":func:`WIFSTOPPED` only returns ``True`` if the :func:`waitpid` call was " "done using :data:`WUNTRACED` option or when the process is being traced " "(see :manpage:`ptrace(2)`)." msgstr "" -#: ../../library/os.rst:4959 +#: ../../library/os.rst:4987 msgid "" "Return ``True`` if the process was terminated by a signal, otherwise return " "``False``." msgstr "" -#: ../../library/os.rst:4967 +#: ../../library/os.rst:4995 msgid "" "Return ``True`` if the process exited terminated normally, that is, by " "calling ``exit()`` or ``_exit()``, or by returning from ``main()``; " "otherwise return ``False``." msgstr "" -#: ../../library/os.rst:4976 +#: ../../library/os.rst:5004 msgid "Return the process exit status." msgstr "" -#: ../../library/os.rst:4978 +#: ../../library/os.rst:5006 msgid "This function should be employed only if :func:`WIFEXITED` is true." msgstr "" -#: ../../library/os.rst:4985 +#: ../../library/os.rst:5013 msgid "Return the signal which caused the process to stop." msgstr "" -#: ../../library/os.rst:4987 +#: ../../library/os.rst:5015 msgid "This function should be employed only if :func:`WIFSTOPPED` is true." msgstr "" -#: ../../library/os.rst:4994 +#: ../../library/os.rst:5022 msgid "Return the number of the signal that caused the process to terminate." msgstr "" -#: ../../library/os.rst:5002 +#: ../../library/os.rst:5030 msgid "Interface to the scheduler" msgstr "" -#: ../../library/os.rst:5004 +#: ../../library/os.rst:5032 msgid "" "These functions control how a process is allocated CPU time by the operating " "system. They are only available on some Unix platforms. For more detailed " "information, consult your Unix manpages." msgstr "" -#: ../../library/os.rst:5010 +#: ../../library/os.rst:5038 msgid "" "The following scheduling policies are exposed if they are supported by the " "operating system." msgstr "" -#: ../../library/os.rst:5015 +#: ../../library/os.rst:5043 msgid "The default scheduling policy." msgstr "" -#: ../../library/os.rst:5019 +#: ../../library/os.rst:5047 msgid "" "Scheduling policy for CPU-intensive processes that tries to preserve " "interactivity on the rest of the computer." msgstr "" -#: ../../library/os.rst:5024 +#: ../../library/os.rst:5052 msgid "Scheduling policy for extremely low priority background tasks." msgstr "" -#: ../../library/os.rst:5028 +#: ../../library/os.rst:5056 msgid "Scheduling policy for sporadic server programs." msgstr "" -#: ../../library/os.rst:5032 +#: ../../library/os.rst:5060 msgid "A First In First Out scheduling policy." msgstr "" -#: ../../library/os.rst:5036 +#: ../../library/os.rst:5064 msgid "A round-robin scheduling policy." msgstr "" -#: ../../library/os.rst:5040 +#: ../../library/os.rst:5068 msgid "" "This flag can be OR'ed with any other scheduling policy. When a process with " "this flag set forks, its child's scheduling policy and priority are reset to " "the default." msgstr "" -#: ../../library/os.rst:5047 +#: ../../library/os.rst:5075 msgid "" "This class represents tunable scheduling parameters used in :func:" "`sched_setparam`, :func:`sched_setscheduler`, and :func:`sched_getparam`. It " "is immutable." msgstr "" -#: ../../library/os.rst:5051 +#: ../../library/os.rst:5079 msgid "At the moment, there is only one possible parameter:" msgstr "" -#: ../../library/os.rst:5055 +#: ../../library/os.rst:5083 msgid "The scheduling priority for a scheduling policy." msgstr "" -#: ../../library/os.rst:5060 +#: ../../library/os.rst:5088 msgid "" "Get the minimum priority value for *policy*. *policy* is one of the " "scheduling policy constants above." msgstr "" -#: ../../library/os.rst:5066 +#: ../../library/os.rst:5094 msgid "" "Get the maximum priority value for *policy*. *policy* is one of the " "scheduling policy constants above." msgstr "" -#: ../../library/os.rst:5072 +#: ../../library/os.rst:5100 msgid "" "Set the scheduling policy for the process with PID *pid*. A *pid* of 0 means " "the calling process. *policy* is one of the scheduling policy constants " "above. *param* is a :class:`sched_param` instance." msgstr "" -#: ../../library/os.rst:5079 +#: ../../library/os.rst:5107 msgid "" "Return the scheduling policy for the process with PID *pid*. A *pid* of 0 " "means the calling process. The result is one of the scheduling policy " "constants above." msgstr "" -#: ../../library/os.rst:5086 +#: ../../library/os.rst:5114 msgid "" "Set the scheduling parameters for the process with PID *pid*. A *pid* of 0 " "means the calling process. *param* is a :class:`sched_param` instance." msgstr "" -#: ../../library/os.rst:5092 +#: ../../library/os.rst:5120 msgid "" "Return the scheduling parameters as a :class:`sched_param` instance for the " "process with PID *pid*. A *pid* of 0 means the calling process." msgstr "" -#: ../../library/os.rst:5098 +#: ../../library/os.rst:5126 msgid "" "Return the round-robin quantum in seconds for the process with PID *pid*. A " "*pid* of 0 means the calling process." msgstr "" -#: ../../library/os.rst:5104 +#: ../../library/os.rst:5132 msgid "Voluntarily relinquish the CPU." msgstr "" -#: ../../library/os.rst:5109 +#: ../../library/os.rst:5137 msgid "" "Restrict the process with PID *pid* (or the current process if zero) to a " "set of CPUs. *mask* is an iterable of integers representing the set of CPUs " "to which the process should be restricted." msgstr "" -#: ../../library/os.rst:5116 +#: ../../library/os.rst:5144 +msgid "Return the set of CPUs the process with PID *pid* is restricted to." +msgstr "" + +#: ../../library/os.rst:5146 msgid "" -"Return the set of CPUs the process with PID *pid* (or the current process if " -"zero) is restricted to." +"If *pid* is zero, return the set of CPUs the calling thread of the current " +"process is restricted to." msgstr "" -#: ../../library/os.rst:5123 +#: ../../library/os.rst:5153 msgid "Miscellaneous System Information" msgstr "" -#: ../../library/os.rst:5128 +#: ../../library/os.rst:5158 msgid "" "Return string-valued system configuration values. *name* specifies the " "configuration value to retrieve; it may be a string which is the name of a " @@ -5688,13 +5731,13 @@ msgid "" "included in that mapping, passing an integer for *name* is also accepted." msgstr "" -#: ../../library/os.rst:5136 +#: ../../library/os.rst:5166 msgid "" "If the configuration value specified by *name* isn't defined, ``None`` is " "returned." msgstr "" -#: ../../library/os.rst:5139 +#: ../../library/os.rst:5169 msgid "" "If *name* is a string and is not known, :exc:`ValueError` is raised. If a " "specific value for *name* is not supported by the host system, even if it is " @@ -5702,33 +5745,34 @@ msgid "" "`errno.EINVAL` for the error number." msgstr "" -#: ../../library/os.rst:5149 +#: ../../library/os.rst:5179 msgid "" "Dictionary mapping names accepted by :func:`confstr` to the integer values " "defined for those names by the host operating system. This can be used to " "determine the set of names known to the system." msgstr "" -#: ../../library/os.rst:5158 +#: ../../library/os.rst:5188 msgid "" -"Return the number of CPUs in the system. Returns ``None`` if undetermined." +"Return the number of logical CPUs in the system. Returns ``None`` if " +"undetermined." msgstr "" -#: ../../library/os.rst:5160 +#: ../../library/os.rst:5191 msgid "" -"This number is not equivalent to the number of CPUs the current process can " -"use. The number of usable CPUs can be obtained with ``len(os." -"sched_getaffinity(0))``" +"This number is not equivalent to the number of logical CPUs the current " +"process can use. ``len(os.sched_getaffinity(0))`` gets the number of logical " +"CPUs the calling thread of the current process is restricted to" msgstr "" -#: ../../library/os.rst:5170 +#: ../../library/os.rst:5200 msgid "" "Return the number of processes in the system run queue averaged over the " "last 1, 5, and 15 minutes or raises :exc:`OSError` if the load average was " "unobtainable." msgstr "" -#: ../../library/os.rst:5179 +#: ../../library/os.rst:5209 msgid "" "Return integer-valued system configuration values. If the configuration " "value specified by *name* isn't defined, ``-1`` is returned. The comments " @@ -5737,44 +5781,44 @@ msgid "" "``sysconf_names``." msgstr "" -#: ../../library/os.rst:5189 +#: ../../library/os.rst:5219 msgid "" "Dictionary mapping names accepted by :func:`sysconf` to the integer values " "defined for those names by the host operating system. This can be used to " "determine the set of names known to the system." msgstr "" -#: ../../library/os.rst:5195 +#: ../../library/os.rst:5225 msgid "Add ``'SC_MINSIGSTKSZ'`` name." msgstr "" -#: ../../library/os.rst:5198 +#: ../../library/os.rst:5228 msgid "" "The following data values are used to support path manipulation operations. " "These are defined for all platforms." msgstr "" -#: ../../library/os.rst:5201 +#: ../../library/os.rst:5231 msgid "" "Higher-level operations on pathnames are defined in the :mod:`os.path` " "module." msgstr "" -#: ../../library/os.rst:5207 +#: ../../library/os.rst:5237 msgid "" "The constant string used by the operating system to refer to the current " "directory. This is ``'.'`` for Windows and POSIX. Also available via :mod:" "`os.path`." msgstr "" -#: ../../library/os.rst:5215 +#: ../../library/os.rst:5245 msgid "" "The constant string used by the operating system to refer to the parent " "directory. This is ``'..'`` for Windows and POSIX. Also available via :mod:" "`os.path`." msgstr "" -#: ../../library/os.rst:5224 +#: ../../library/os.rst:5254 msgid "" "The character used by the operating system to separate pathname components. " "This is ``'/'`` for POSIX and ``'\\\\'`` for Windows. Note that knowing " @@ -5783,7 +5827,7 @@ msgid "" "useful. Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:5234 +#: ../../library/os.rst:5264 msgid "" "An alternative character used by the operating system to separate pathname " "components, or ``None`` if only one separator character exists. This is set " @@ -5791,27 +5835,27 @@ msgid "" "via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:5243 +#: ../../library/os.rst:5273 msgid "" "The character which separates the base filename from the extension; for " "example, the ``'.'`` in :file:`os.py`. Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:5251 +#: ../../library/os.rst:5281 msgid "" "The character conventionally used by the operating system to separate search " "path components (as in :envvar:`PATH`), such as ``':'`` for POSIX or ``';'`` " "for Windows. Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:5258 +#: ../../library/os.rst:5288 msgid "" "The default search path used by :func:`exec\\*p\\* ` and :func:" "`spawn\\*p\\* ` if the environment doesn't have a ``'PATH'`` key. " "Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:5265 +#: ../../library/os.rst:5295 msgid "" "The string used to separate (or, rather, terminate) lines on the current " "platform. This may be a single character, such as ``'\\n'`` for POSIX, or " @@ -5820,36 +5864,36 @@ msgid "" "default); use a single ``'\\n'`` instead, on all platforms." msgstr "" -#: ../../library/os.rst:5274 +#: ../../library/os.rst:5304 msgid "" "The file path of the null device. For example: ``'/dev/null'`` for POSIX, " "``'nul'`` for Windows. Also available via :mod:`os.path`." msgstr "" -#: ../../library/os.rst:5285 +#: ../../library/os.rst:5315 msgid "" "Flags for use with the :func:`~sys.setdlopenflags` and :func:`~sys." "getdlopenflags` functions. See the Unix manual page :manpage:`dlopen(3)` " "for what the different flags mean." msgstr "" -#: ../../library/os.rst:5293 +#: ../../library/os.rst:5323 msgid "Random numbers" msgstr "" -#: ../../library/os.rst:5298 +#: ../../library/os.rst:5328 msgid "" "Get up to *size* random bytes. The function can return less bytes than " "requested." msgstr "" -#: ../../library/os.rst:5301 +#: ../../library/os.rst:5331 msgid "" "These bytes can be used to seed user-space random number generators or for " "cryptographic purposes." msgstr "" -#: ../../library/os.rst:5304 +#: ../../library/os.rst:5334 msgid "" "``getrandom()`` relies on entropy gathered from device drivers and other " "sources of environmental noise. Unnecessarily reading large quantities of " @@ -5857,36 +5901,36 @@ msgid "" "``/dev/urandom`` devices." msgstr "" -#: ../../library/os.rst:5309 +#: ../../library/os.rst:5339 msgid "" "The flags argument is a bit mask that can contain zero or more of the " "following values ORed together: :py:const:`os.GRND_RANDOM` and :py:data:" "`GRND_NONBLOCK`." msgstr "" -#: ../../library/os.rst:5313 +#: ../../library/os.rst:5343 msgid "" "See also the `Linux getrandom() manual page `_." msgstr "" -#: ../../library/os.rst:5316 +#: ../../library/os.rst:5346 msgid ":ref:`Availability `: Linux >= 3.17." msgstr ":ref:`適用 `:Linux 3.17 以上。" -#: ../../library/os.rst:5322 +#: ../../library/os.rst:5352 msgid "" "Return a bytestring of *size* random bytes suitable for cryptographic use." msgstr "" -#: ../../library/os.rst:5324 +#: ../../library/os.rst:5354 msgid "" "This function returns random bytes from an OS-specific randomness source. " "The returned data should be unpredictable enough for cryptographic " "applications, though its exact quality depends on the OS implementation." msgstr "" -#: ../../library/os.rst:5328 +#: ../../library/os.rst:5358 msgid "" "On Linux, if the ``getrandom()`` syscall is available, it is used in " "blocking mode: block until the system urandom entropy pool is initialized " @@ -5896,63 +5940,63 @@ msgid "" "to poll until the system urandom entropy pool is initialized." msgstr "" -#: ../../library/os.rst:5335 +#: ../../library/os.rst:5365 msgid "" "On a Unix-like system, random bytes are read from the ``/dev/urandom`` " "device. If the ``/dev/urandom`` device is not available or not readable, " "the :exc:`NotImplementedError` exception is raised." msgstr "" -#: ../../library/os.rst:5339 +#: ../../library/os.rst:5369 msgid "On Windows, it will use ``BCryptGenRandom()``." msgstr "" -#: ../../library/os.rst:5342 +#: ../../library/os.rst:5372 msgid "" "The :mod:`secrets` module provides higher level functions. For an easy-to-" "use interface to the random number generator provided by your platform, " "please see :class:`random.SystemRandom`." msgstr "" -#: ../../library/os.rst:5346 +#: ../../library/os.rst:5376 msgid "" "On Linux, ``getrandom()`` is now used in blocking mode to increase the " "security." msgstr "" -#: ../../library/os.rst:5350 +#: ../../library/os.rst:5380 msgid "" "On Linux, if the ``getrandom()`` syscall blocks (the urandom entropy pool is " "not initialized yet), fall back on reading ``/dev/urandom``." msgstr "" -#: ../../library/os.rst:5354 +#: ../../library/os.rst:5384 msgid "" "On Linux 3.17 and newer, the ``getrandom()`` syscall is now used when " "available. On OpenBSD 5.6 and newer, the C ``getentropy()`` function is now " "used. These functions avoid the usage of an internal file descriptor." msgstr "" -#: ../../library/os.rst:5360 +#: ../../library/os.rst:5390 msgid "" "On Windows, ``BCryptGenRandom()`` is used instead of ``CryptGenRandom()`` " "which is deprecated." msgstr "" -#: ../../library/os.rst:5366 +#: ../../library/os.rst:5396 msgid "" "By default, when reading from ``/dev/random``, :func:`getrandom` blocks if " "no random bytes are available, and when reading from ``/dev/urandom``, it " "blocks if the entropy pool has not yet been initialized." msgstr "" -#: ../../library/os.rst:5370 +#: ../../library/os.rst:5400 msgid "" "If the :py:data:`GRND_NONBLOCK` flag is set, then :func:`getrandom` does not " "block in these cases, but instead immediately raises :exc:`BlockingIOError`." msgstr "" -#: ../../library/os.rst:5377 +#: ../../library/os.rst:5407 msgid "" "If this bit is set, then random bytes are drawn from the ``/dev/" "random`` pool instead of the ``/dev/urandom`` pool." @@ -5968,7 +6012,7 @@ msgstr "" #: ../../library/os.rst:372 ../../library/os.rst:438 ../../library/os.rst:447 #: ../../library/os.rst:456 ../../library/os.rst:470 ../../library/os.rst:666 -#: ../../library/os.rst:4190 ../../library/os.rst:4217 +#: ../../library/os.rst:4218 ../../library/os.rst:4245 msgid "process" msgstr "process" @@ -6054,48 +6098,48 @@ msgstr "" msgid "traversal" msgstr "traversal(遍歷)" -#: ../../library/os.rst:4190 ../../library/os.rst:4217 +#: ../../library/os.rst:4218 ../../library/os.rst:4245 msgid "killing" msgstr "" -#: ../../library/os.rst:4190 ../../library/os.rst:4217 +#: ../../library/os.rst:4218 ../../library/os.rst:4245 msgid "signalling" msgstr "signalling(信號)" -#: ../../library/os.rst:5204 ../../library/os.rst:5240 +#: ../../library/os.rst:5234 ../../library/os.rst:5270 msgid ". (dot)" msgstr ". (點)" -#: ../../library/os.rst:5204 ../../library/os.rst:5212 -#: ../../library/os.rst:5220 ../../library/os.rst:5231 -#: ../../library/os.rst:5240 +#: ../../library/os.rst:5234 ../../library/os.rst:5242 +#: ../../library/os.rst:5250 ../../library/os.rst:5261 +#: ../../library/os.rst:5270 msgid "in pathnames" msgstr "於 pathnames(路徑名稱)中" -#: ../../library/os.rst:5212 +#: ../../library/os.rst:5242 msgid ".." msgstr ".." -#: ../../library/os.rst:5220 ../../library/os.rst:5231 +#: ../../library/os.rst:5250 ../../library/os.rst:5261 msgid "/ (slash)" msgstr "/ (斜線)" -#: ../../library/os.rst:5221 +#: ../../library/os.rst:5251 msgid "\\ (backslash)" msgstr "\\ (反斜線)" -#: ../../library/os.rst:5221 +#: ../../library/os.rst:5251 msgid "in pathnames (Windows)" msgstr "in pathnames (Windows)(在路徑名稱中 (Windows))" -#: ../../library/os.rst:5247 +#: ../../library/os.rst:5277 msgid ": (colon)" msgstr ": (冒號)" -#: ../../library/os.rst:5247 +#: ../../library/os.rst:5277 msgid "path separator (POSIX)" msgstr "path separator (POSIX)(路徑分隔器 (POSIX))" -#: ../../library/os.rst:5247 +#: ../../library/os.rst:5277 msgid "; (semicolon)" msgstr "; (分號)" diff --git a/library/pickletools.po b/library/pickletools.po index a767c0487e..8281a8533b 100644 --- a/library/pickletools.po +++ b/library/pickletools.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-06-26 18:54+0800\n" +"POT-Creation-Date: 2023-10-12 00:03+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-" @@ -36,11 +36,11 @@ msgid "" "the :mod:`pickletools` module relevant." msgstr "" -#: ../../library/pickletools.rst:21 +#: ../../library/pickletools.rst:23 msgid "Command line usage" -msgstr "" +msgstr "命令列用法" -#: ../../library/pickletools.rst:25 +#: ../../library/pickletools.rst:27 msgid "" "When invoked from the command line, ``python -m pickletools`` will " "disassemble the contents of one or more pickle files. Note that if you want " @@ -50,42 +50,42 @@ msgid "" "pickletools`` is a safer option because it does not execute pickle bytecode." msgstr "" -#: ../../library/pickletools.rst:33 +#: ../../library/pickletools.rst:35 msgid "For example, with a tuple ``(1, 2)`` pickled in file ``x.pickle``:" msgstr "" -#: ../../library/pickletools.rst:50 +#: ../../library/pickletools.rst:52 msgid "Command line options" -msgstr "" +msgstr "命令列選項" -#: ../../library/pickletools.rst:56 +#: ../../library/pickletools.rst:58 msgid "Annotate each line with a short opcode description." msgstr "" -#: ../../library/pickletools.rst:60 +#: ../../library/pickletools.rst:62 msgid "Name of a file where the output should be written." msgstr "" -#: ../../library/pickletools.rst:64 +#: ../../library/pickletools.rst:66 msgid "The number of blanks by which to indent a new MARK level." msgstr "" -#: ../../library/pickletools.rst:68 +#: ../../library/pickletools.rst:70 msgid "" "When multiple objects are disassembled, preserve memo between disassemblies." msgstr "" -#: ../../library/pickletools.rst:73 +#: ../../library/pickletools.rst:75 msgid "" "When more than one pickle file are specified, print given preamble before " "each disassembly." msgstr "" -#: ../../library/pickletools.rst:79 +#: ../../library/pickletools.rst:81 msgid "Programmatic Interface" msgstr "" -#: ../../library/pickletools.rst:84 +#: ../../library/pickletools.rst:86 msgid "" "Outputs a symbolic disassembly of the pickle to the file-like object *out*, " "defaulting to ``sys.stdout``. *pickle* can be a string or a file-like " @@ -98,11 +98,11 @@ msgid "" "where annotation should start." msgstr "" -#: ../../library/pickletools.rst:95 +#: ../../library/pickletools.rst:97 msgid "The *annotate* argument." msgstr "*annotate* 引數。" -#: ../../library/pickletools.rst:100 +#: ../../library/pickletools.rst:102 msgid "" "Provides an :term:`iterator` over all of the opcodes in a pickle, returning " "a sequence of ``(opcode, arg, pos)`` triples. *opcode* is an instance of " @@ -111,7 +111,7 @@ msgid "" "is located. *pickle* can be a string or a file-like object." msgstr "" -#: ../../library/pickletools.rst:108 +#: ../../library/pickletools.rst:110 msgid "" "Returns a new equivalent pickle string after eliminating unused ``PUT`` " "opcodes. The optimized pickle is shorter, takes less transmission time, " diff --git a/library/profile.po b/library/profile.po index 220591bbab..16a0def997 100644 --- a/library/profile.po +++ b/library/profile.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-10-12 00:03+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-" @@ -175,42 +175,42 @@ msgid "" "formats them in various ways." msgstr "" -#: ../../library/profile.rst:124 +#: ../../library/profile.rst:126 msgid "" "The files :mod:`cProfile` and :mod:`profile` can also be invoked as a script " "to profile another script. For example::" msgstr "" -#: ../../library/profile.rst:129 +#: ../../library/profile.rst:131 msgid "``-o`` writes the profile results to a file instead of to stdout" msgstr "" -#: ../../library/profile.rst:131 +#: ../../library/profile.rst:133 msgid "" "``-s`` specifies one of the :func:`~pstats.Stats.sort_stats` sort values to " "sort the output by. This only applies when ``-o`` is not supplied." msgstr "" -#: ../../library/profile.rst:134 +#: ../../library/profile.rst:136 msgid "``-m`` specifies that a module is being profiled instead of a script." msgstr "" -#: ../../library/profile.rst:136 +#: ../../library/profile.rst:138 msgid "Added the ``-m`` option to :mod:`cProfile`." msgstr "新增 ``-m`` 選項到 :mod:`cProfile`。" -#: ../../library/profile.rst:139 +#: ../../library/profile.rst:141 msgid "Added the ``-m`` option to :mod:`profile`." msgstr "新增 ``-m`` 選項到 :mod:`profile`。" -#: ../../library/profile.rst:142 +#: ../../library/profile.rst:144 msgid "" "The :mod:`pstats` module's :class:`~pstats.Stats` class has a variety of " "methods for manipulating and printing the data saved into a profile results " "file::" msgstr "" -#: ../../library/profile.rst:150 +#: ../../library/profile.rst:152 msgid "" "The :meth:`~pstats.Stats.strip_dirs` method removed the extraneous path from " "all the module names. The :meth:`~pstats.Stats.sort_stats` method sorted all " @@ -219,44 +219,44 @@ msgid "" "statistics. You might try the following sort calls::" msgstr "" -#: ../../library/profile.rst:159 +#: ../../library/profile.rst:161 msgid "" "The first call will actually sort the list by function name, and the second " "call will print out the statistics. The following are some interesting " "calls to experiment with::" msgstr "" -#: ../../library/profile.rst:165 +#: ../../library/profile.rst:167 msgid "" "This sorts the profile by cumulative time in a function, and then only " "prints the ten most significant lines. If you want to understand what " "algorithms are taking time, the above line is what you would use." msgstr "" -#: ../../library/profile.rst:169 +#: ../../library/profile.rst:171 msgid "" "If you were looking to see what functions were looping a lot, and taking a " "lot of time, you would do::" msgstr "" -#: ../../library/profile.rst:174 +#: ../../library/profile.rst:176 msgid "" "to sort according to time spent within each function, and then print the " "statistics for the top ten functions." msgstr "" -#: ../../library/profile.rst:177 +#: ../../library/profile.rst:179 msgid "You might also try::" msgstr "" -#: ../../library/profile.rst:181 +#: ../../library/profile.rst:183 msgid "" "This will sort all the statistics by file name, and then print out " "statistics for only the class init methods (since they are spelled with " "``__init__`` in them). As one final example, you could try::" msgstr "" -#: ../../library/profile.rst:187 +#: ../../library/profile.rst:189 msgid "" "This line sorts statistics with a primary key of time, and a secondary key " "of cumulative time, and then prints out some of the statistics. To be " @@ -265,46 +265,46 @@ msgid "" "list is printed." msgstr "" -#: ../../library/profile.rst:192 +#: ../../library/profile.rst:194 msgid "" "If you wondered what functions called the above functions, you could now " "(``p`` is still sorted according to the last criteria) do::" msgstr "" -#: ../../library/profile.rst:197 +#: ../../library/profile.rst:199 msgid "and you would get a list of callers for each of the listed functions." msgstr "" -#: ../../library/profile.rst:199 +#: ../../library/profile.rst:201 msgid "" "If you want more functionality, you're going to have to read the manual, or " "guess what the following functions do::" msgstr "" -#: ../../library/profile.rst:205 +#: ../../library/profile.rst:207 msgid "" "Invoked as a script, the :mod:`pstats` module is a statistics browser for " "reading and examining profile dumps. It has a simple line-oriented " "interface (implemented using :mod:`cmd`) and interactive help." msgstr "" -#: ../../library/profile.rst:210 +#: ../../library/profile.rst:212 msgid ":mod:`profile` and :mod:`cProfile` Module Reference" msgstr "" -#: ../../library/profile.rst:216 +#: ../../library/profile.rst:218 msgid "" "Both the :mod:`profile` and :mod:`cProfile` modules provide the following " "functions:" msgstr "" -#: ../../library/profile.rst:221 +#: ../../library/profile.rst:223 msgid "" "This function takes a single argument that can be passed to the :func:`exec` " "function, and an optional file name. In all cases this routine executes::" msgstr "" -#: ../../library/profile.rst:226 +#: ../../library/profile.rst:228 msgid "" "and gathers profiling statistics from the execution. If no file name is " "present, then this function automatically creates a :class:`~pstats.Stats` " @@ -313,24 +313,24 @@ msgid "" "how the results are sorted." msgstr "" -#: ../../library/profile.rst:234 +#: ../../library/profile.rst:236 msgid "" "This function is similar to :func:`run`, with added arguments to supply the " "globals and locals dictionaries for the *command* string. This routine " "executes::" msgstr "" -#: ../../library/profile.rst:240 +#: ../../library/profile.rst:242 msgid "and gathers profiling statistics as in the :func:`run` function above." msgstr "" -#: ../../library/profile.rst:244 +#: ../../library/profile.rst:246 msgid "" "This class is normally only used if more precise control over profiling is " "needed than what the :func:`cProfile.run` function provides." msgstr "" -#: ../../library/profile.rst:247 +#: ../../library/profile.rst:249 msgid "" "A custom timer can be supplied for measuring how long code takes to run via " "the *timer* argument. This must be a function that returns a single number " @@ -340,61 +340,61 @@ msgid "" "time unit would be ``.001``." msgstr "" -#: ../../library/profile.rst:254 +#: ../../library/profile.rst:256 msgid "" "Directly using the :class:`Profile` class allows formatting profile results " "without writing the profile data to a file::" msgstr "" -#: ../../library/profile.rst:269 +#: ../../library/profile.rst:271 msgid "" "The :class:`Profile` class can also be used as a context manager (supported " "only in :mod:`cProfile` module. see :ref:`typecontextmanager`)::" msgstr "" -#: ../../library/profile.rst:279 +#: ../../library/profile.rst:281 msgid "Added context manager support." msgstr "新增情境管理器的支援。" -#: ../../library/profile.rst:284 +#: ../../library/profile.rst:286 msgid "Start collecting profiling data. Only in :mod:`cProfile`." msgstr "" -#: ../../library/profile.rst:288 +#: ../../library/profile.rst:290 msgid "Stop collecting profiling data. Only in :mod:`cProfile`." msgstr "" -#: ../../library/profile.rst:292 +#: ../../library/profile.rst:294 msgid "" "Stop collecting profiling data and record the results internally as the " "current profile." msgstr "" -#: ../../library/profile.rst:297 +#: ../../library/profile.rst:299 msgid "" "Create a :class:`~pstats.Stats` object based on the current profile and " "print the results to stdout." msgstr "" -#: ../../library/profile.rst:302 +#: ../../library/profile.rst:304 msgid "Write the results of the current profile to *filename*." msgstr "" -#: ../../library/profile.rst:306 +#: ../../library/profile.rst:308 msgid "Profile the cmd via :func:`exec`." msgstr "" -#: ../../library/profile.rst:310 +#: ../../library/profile.rst:312 msgid "" "Profile the cmd via :func:`exec` with the specified global and local " "environment." msgstr "" -#: ../../library/profile.rst:315 +#: ../../library/profile.rst:317 msgid "Profile ``func(*args, **kwargs)``" msgstr "" -#: ../../library/profile.rst:317 +#: ../../library/profile.rst:319 msgid "" "Note that profiling will only work if the called command/function actually " "returns. If the interpreter is terminated (e.g. via a :func:`sys.exit` call " @@ -402,23 +402,23 @@ msgid "" "printed." msgstr "" -#: ../../library/profile.rst:325 +#: ../../library/profile.rst:327 msgid "The :class:`Stats` Class" msgstr "" -#: ../../library/profile.rst:327 +#: ../../library/profile.rst:329 msgid "" "Analysis of the profiler data is done using the :class:`~pstats.Stats` class." msgstr "" -#: ../../library/profile.rst:334 +#: ../../library/profile.rst:336 msgid "" "This class constructor creates an instance of a \"statistics object\" from a " "*filename* (or list of filenames) or from a :class:`Profile` instance. " "Output will be printed to the stream specified by *stream*." msgstr "" -#: ../../library/profile.rst:338 +#: ../../library/profile.rst:340 msgid "" "The file selected by the above constructor must have been created by the " "corresponding version of :mod:`profile` or :mod:`cProfile`. To be specific, " @@ -432,17 +432,17 @@ msgid "" "can be used." msgstr "" -#: ../../library/profile.rst:349 +#: ../../library/profile.rst:351 msgid "" "Instead of reading the profile data from a file, a :class:`cProfile.Profile` " "or :class:`profile.Profile` object can be used as the profile data source." msgstr "" -#: ../../library/profile.rst:352 +#: ../../library/profile.rst:354 msgid ":class:`Stats` objects have the following methods:" msgstr "" -#: ../../library/profile.rst:356 +#: ../../library/profile.rst:358 msgid "" "This method for the :class:`Stats` class removes all leading path " "information from file names. It is very useful in reducing the size of the " @@ -456,7 +456,7 @@ msgid "" "single entry." msgstr "" -#: ../../library/profile.rst:370 +#: ../../library/profile.rst:372 msgid "" "This method of the :class:`Stats` class accumulates additional profiling " "information into the current profiling object. Its arguments should refer " @@ -465,7 +465,7 @@ msgid "" "functions are automatically accumulated into single function statistics." msgstr "" -#: ../../library/profile.rst:380 +#: ../../library/profile.rst:382 msgid "" "Save the data loaded into the :class:`Stats` object to a file named " "*filename*. The file is created if it does not exist, and is overwritten if " @@ -473,7 +473,7 @@ msgid "" "the :class:`profile.Profile` and :class:`cProfile.Profile` classes." msgstr "" -#: ../../library/profile.rst:388 +#: ../../library/profile.rst:390 msgid "" "This method modifies the :class:`Stats` object by sorting it according to " "the supplied criteria. The argument can be either a string or a SortKey " @@ -483,7 +483,7 @@ msgid "" "prone." msgstr "" -#: ../../library/profile.rst:395 +#: ../../library/profile.rst:397 msgid "" "When more than one key is provided, then additional keys are used as " "secondary criteria when there is equality in all keys selected before them. " @@ -492,164 +492,164 @@ msgid "" "function names) by sorting by file name." msgstr "" -#: ../../library/profile.rst:401 +#: ../../library/profile.rst:403 msgid "" "For the string argument, abbreviations can be used for any key names, as " "long as the abbreviation is unambiguous." msgstr "" -#: ../../library/profile.rst:404 +#: ../../library/profile.rst:406 msgid "The following are the valid string and SortKey:" msgstr "" -#: ../../library/profile.rst:407 +#: ../../library/profile.rst:409 msgid "Valid String Arg" msgstr "" -#: ../../library/profile.rst:407 +#: ../../library/profile.rst:409 msgid "Valid enum Arg" msgstr "" -#: ../../library/profile.rst:407 +#: ../../library/profile.rst:409 msgid "Meaning" msgstr "" -#: ../../library/profile.rst:409 +#: ../../library/profile.rst:411 msgid "``'calls'``" msgstr "``'calls'``" -#: ../../library/profile.rst:409 +#: ../../library/profile.rst:411 msgid "SortKey.CALLS" msgstr "SortKey.CALLS" -#: ../../library/profile.rst:409 ../../library/profile.rst:421 +#: ../../library/profile.rst:411 ../../library/profile.rst:423 msgid "call count" msgstr "" -#: ../../library/profile.rst:411 +#: ../../library/profile.rst:413 msgid "``'cumulative'``" msgstr "``'cumulative'``" -#: ../../library/profile.rst:411 +#: ../../library/profile.rst:413 msgid "SortKey.CUMULATIVE" msgstr "SortKey.CUMULATIVE" -#: ../../library/profile.rst:411 ../../library/profile.rst:413 +#: ../../library/profile.rst:413 ../../library/profile.rst:415 msgid "cumulative time" msgstr "" -#: ../../library/profile.rst:413 +#: ../../library/profile.rst:415 msgid "``'cumtime'``" msgstr "``'cumtime'``" -#: ../../library/profile.rst:413 ../../library/profile.rst:415 -#: ../../library/profile.rst:419 ../../library/profile.rst:421 -#: ../../library/profile.rst:435 +#: ../../library/profile.rst:415 ../../library/profile.rst:417 +#: ../../library/profile.rst:421 ../../library/profile.rst:423 +#: ../../library/profile.rst:437 msgid "N/A" msgstr "N/A" -#: ../../library/profile.rst:415 +#: ../../library/profile.rst:417 msgid "``'file'``" msgstr "``'file'``" -#: ../../library/profile.rst:415 ../../library/profile.rst:417 -#: ../../library/profile.rst:419 +#: ../../library/profile.rst:417 ../../library/profile.rst:419 +#: ../../library/profile.rst:421 msgid "file name" msgstr "file name(檔案名稱)" -#: ../../library/profile.rst:417 +#: ../../library/profile.rst:419 msgid "``'filename'``" msgstr "``'filename'``" -#: ../../library/profile.rst:417 +#: ../../library/profile.rst:419 msgid "SortKey.FILENAME" msgstr "SortKey.FILENAME" -#: ../../library/profile.rst:419 +#: ../../library/profile.rst:421 msgid "``'module'``" msgstr "``'module'``" -#: ../../library/profile.rst:421 +#: ../../library/profile.rst:423 msgid "``'ncalls'``" msgstr "``'ncalls'``" -#: ../../library/profile.rst:423 +#: ../../library/profile.rst:425 msgid "``'pcalls'``" msgstr "``'pcalls'``" -#: ../../library/profile.rst:423 +#: ../../library/profile.rst:425 msgid "SortKey.PCALLS" msgstr "SortKey.PCALLS" -#: ../../library/profile.rst:423 +#: ../../library/profile.rst:425 msgid "primitive call count" msgstr "" -#: ../../library/profile.rst:425 +#: ../../library/profile.rst:427 msgid "``'line'``" msgstr "``'line'``" -#: ../../library/profile.rst:425 +#: ../../library/profile.rst:427 msgid "SortKey.LINE" msgstr "SortKey.LINE" -#: ../../library/profile.rst:425 +#: ../../library/profile.rst:427 msgid "line number" msgstr "" -#: ../../library/profile.rst:427 +#: ../../library/profile.rst:429 msgid "``'name'``" msgstr "``'name'``" -#: ../../library/profile.rst:427 +#: ../../library/profile.rst:429 msgid "SortKey.NAME" msgstr "SortKey.NAME" -#: ../../library/profile.rst:427 +#: ../../library/profile.rst:429 msgid "function name" msgstr "" -#: ../../library/profile.rst:429 +#: ../../library/profile.rst:431 msgid "``'nfl'``" msgstr "``'nfl'``" -#: ../../library/profile.rst:429 +#: ../../library/profile.rst:431 msgid "SortKey.NFL" msgstr "SortKey.NFL" -#: ../../library/profile.rst:429 +#: ../../library/profile.rst:431 msgid "name/file/line" msgstr "" -#: ../../library/profile.rst:431 +#: ../../library/profile.rst:433 msgid "``'stdname'``" msgstr "``'stdname'``" -#: ../../library/profile.rst:431 +#: ../../library/profile.rst:433 msgid "SortKey.STDNAME" msgstr "SortKey.STDNAME" -#: ../../library/profile.rst:431 +#: ../../library/profile.rst:433 msgid "standard name" msgstr "" -#: ../../library/profile.rst:433 +#: ../../library/profile.rst:435 msgid "``'time'``" msgstr "``'time'``" -#: ../../library/profile.rst:433 +#: ../../library/profile.rst:435 msgid "SortKey.TIME" msgstr "SortKey.TIME" -#: ../../library/profile.rst:433 ../../library/profile.rst:435 +#: ../../library/profile.rst:435 ../../library/profile.rst:437 msgid "internal time" msgstr "" -#: ../../library/profile.rst:435 +#: ../../library/profile.rst:437 msgid "``'tottime'``" msgstr "``'tottime'``" -#: ../../library/profile.rst:438 +#: ../../library/profile.rst:440 msgid "" "Note that all sorts on statistics are in descending order (placing most time " "consuming items first), where as name, file, and line number searches are in " @@ -663,7 +663,7 @@ msgid "" "SortKey.FILENAME, SortKey.LINE)``." msgstr "" -#: ../../library/profile.rst:449 +#: ../../library/profile.rst:451 msgid "" "For backward-compatibility reasons, the numeric arguments ``-1``, ``0``, " "``1``, and ``2`` are permitted. They are interpreted as ``'stdname'``, " @@ -672,31 +672,31 @@ msgid "" "used, and additional arguments will be silently ignored." msgstr "" -#: ../../library/profile.rst:457 +#: ../../library/profile.rst:459 msgid "Added the SortKey enum." msgstr "" -#: ../../library/profile.rst:462 +#: ../../library/profile.rst:464 msgid "" "This method for the :class:`Stats` class reverses the ordering of the basic " "list within the object. Note that by default ascending vs descending order " "is properly selected based on the sort key of choice." msgstr "" -#: ../../library/profile.rst:472 +#: ../../library/profile.rst:474 msgid "" "This method for the :class:`Stats` class prints out a report as described in " "the :func:`profile.run` definition." msgstr "" -#: ../../library/profile.rst:475 +#: ../../library/profile.rst:477 msgid "" "The order of the printing is based on the last :meth:`~pstats.Stats." "sort_stats` operation done on the object (subject to caveats in :meth:" "`~pstats.Stats.add` and :meth:`~pstats.Stats.strip_dirs`)." msgstr "" -#: ../../library/profile.rst:480 +#: ../../library/profile.rst:482 msgid "" "The arguments provided (if any) can be used to limit the list down to the " "significant entries. Initially, the list is taken to be the complete set of " @@ -708,20 +708,20 @@ msgid "" "example::" msgstr "" -#: ../../library/profile.rst:491 +#: ../../library/profile.rst:493 msgid "" "would first limit the printing to first 10% of list, and then only print " "functions that were part of filename :file:`.\\*foo:`. In contrast, the " "command::" msgstr "" -#: ../../library/profile.rst:497 +#: ../../library/profile.rst:499 msgid "" "would limit the list to all functions having file names :file:`.\\*foo:`, " "and then proceed to only print the first 10% of them." msgstr "" -#: ../../library/profile.rst:503 +#: ../../library/profile.rst:505 msgid "" "This method for the :class:`Stats` class prints a list of all functions that " "called each function in the profiled database. The ordering is identical to " @@ -731,7 +731,7 @@ msgid "" "produced the stats:" msgstr "" -#: ../../library/profile.rst:510 +#: ../../library/profile.rst:512 msgid "" "With :mod:`profile`, a number is shown in parentheses after each caller to " "show how many times this specific call was made. For convenience, a second " @@ -739,14 +739,14 @@ msgid "" "at the right." msgstr "" -#: ../../library/profile.rst:515 +#: ../../library/profile.rst:517 msgid "" "With :mod:`cProfile`, each caller is preceded by three numbers: the number " "of times this specific call was made, and the total and cumulative times " "spent in the current function while it was invoked by this specific caller." msgstr "" -#: ../../library/profile.rst:523 +#: ../../library/profile.rst:525 msgid "" "This method for the :class:`Stats` class prints a list of all function that " "were called by the indicated function. Aside from this reversal of " @@ -754,7 +754,7 @@ msgid "" "are identical to the :meth:`~pstats.Stats.print_callers` method." msgstr "" -#: ../../library/profile.rst:531 +#: ../../library/profile.rst:533 msgid "" "This method returns an instance of StatsProfile, which contains a mapping of " "function names to instances of FunctionProfile. Each FunctionProfile " @@ -762,17 +762,17 @@ msgid "" "long the function took to run, how many times it was called, etc..." msgstr "" -#: ../../library/profile.rst:536 +#: ../../library/profile.rst:538 msgid "" "Added the following dataclasses: StatsProfile, FunctionProfile. Added the " "following function: get_stats_profile." msgstr "" -#: ../../library/profile.rst:543 +#: ../../library/profile.rst:545 msgid "What Is Deterministic Profiling?" msgstr "" -#: ../../library/profile.rst:545 +#: ../../library/profile.rst:547 msgid "" ":dfn:`Deterministic profiling` is meant to reflect the fact that all " "*function call*, *function return*, and *exception* events are monitored, " @@ -785,7 +785,7 @@ msgid "" "being spent." msgstr "" -#: ../../library/profile.rst:554 +#: ../../library/profile.rst:556 msgid "" "In Python, since there is an interpreter active during execution, the " "presence of instrumented code is not required in order to do deterministic " @@ -797,7 +797,7 @@ msgid "" "time statistics about the execution of a Python program." msgstr "" -#: ../../library/profile.rst:563 +#: ../../library/profile.rst:565 msgid "" "Call count statistics can be used to identify bugs in code (surprising " "counts), and to identify possible inline-expansion points (high call " @@ -809,11 +809,11 @@ msgid "" "compared to iterative implementations." msgstr "" -#: ../../library/profile.rst:576 +#: ../../library/profile.rst:578 msgid "Limitations" msgstr "限制" -#: ../../library/profile.rst:578 +#: ../../library/profile.rst:580 msgid "" "One limitation has to do with accuracy of timing information. There is a " "fundamental problem with deterministic profilers involving accuracy. The " @@ -824,7 +824,7 @@ msgid "" "first error induces a second source of error." msgstr "" -#: ../../library/profile.rst:586 +#: ../../library/profile.rst:588 msgid "" "The second problem is that it \"takes a while\" from when an event is " "dispatched until the profiler's call to get the time actually *gets* the " @@ -837,7 +837,7 @@ msgid "" "clock tick), but it *can* accumulate and become very significant." msgstr "" -#: ../../library/profile.rst:596 +#: ../../library/profile.rst:598 msgid "" "The problem is more important with :mod:`profile` than with the lower-" "overhead :mod:`cProfile`. For this reason, :mod:`profile` provides a means " @@ -851,11 +851,11 @@ msgid "" "calibration." msgstr "" -#: ../../library/profile.rst:610 +#: ../../library/profile.rst:612 msgid "Calibration" msgstr "校正" -#: ../../library/profile.rst:612 +#: ../../library/profile.rst:614 msgid "" "The profiler of the :mod:`profile` module subtracts a constant from each " "event handling time to compensate for the overhead of calling the time " @@ -864,7 +864,7 @@ msgid "" "platform (see :ref:`profile-limitations`). ::" msgstr "" -#: ../../library/profile.rst:623 +#: ../../library/profile.rst:625 msgid "" "The method executes the number of Python calls given by the argument, " "directly and again under the profiler, measuring the time for both. It then " @@ -874,48 +874,48 @@ msgid "" "4.04e-6." msgstr "" -#: ../../library/profile.rst:629 +#: ../../library/profile.rst:631 msgid "" "The object of this exercise is to get a fairly consistent result. If your " "computer is *very* fast, or your timer function has poor resolution, you " "might have to pass 100000, or even 1000000, to get consistent results." msgstr "" -#: ../../library/profile.rst:633 +#: ../../library/profile.rst:635 msgid "" "When you have a consistent answer, there are three ways you can use it::" msgstr "" -#: ../../library/profile.rst:647 +#: ../../library/profile.rst:649 msgid "" "If you have a choice, you are better off choosing a smaller constant, and " "then your results will \"less often\" show up as negative in profile " "statistics." msgstr "" -#: ../../library/profile.rst:653 +#: ../../library/profile.rst:655 msgid "Using a custom timer" msgstr "" -#: ../../library/profile.rst:655 +#: ../../library/profile.rst:657 msgid "" "If you want to change how current time is determined (for example, to force " "use of wall-clock time or elapsed process time), pass the timing function " "you want to the :class:`Profile` class constructor::" msgstr "" -#: ../../library/profile.rst:661 +#: ../../library/profile.rst:663 msgid "" "The resulting profiler will then call ``your_time_func``. Depending on " "whether you are using :class:`profile.Profile` or :class:`cProfile.Profile`, " "``your_time_func``'s return value will be interpreted differently:" msgstr "" -#: ../../library/profile.rst:679 +#: ../../library/profile.rst:681 msgid ":class:`profile.Profile`" msgstr ":class:`profile.Profile`" -#: ../../library/profile.rst:666 +#: ../../library/profile.rst:668 msgid "" "``your_time_func`` should return a single number, or a list of numbers whose " "sum is the current time (like what :func:`os.times` returns). If the " @@ -924,7 +924,7 @@ msgid "" "routine." msgstr "" -#: ../../library/profile.rst:672 +#: ../../library/profile.rst:674 msgid "" "Be warned that you should calibrate the profiler class for the timer " "function that you choose (see :ref:`profile-calibration`). For most " @@ -936,11 +936,11 @@ msgid "" "along with the appropriate calibration constant." msgstr "" -#: ../../library/profile.rst:693 +#: ../../library/profile.rst:695 msgid ":class:`cProfile.Profile`" msgstr ":class:`cProfile.Profile`" -#: ../../library/profile.rst:682 +#: ../../library/profile.rst:684 msgid "" "``your_time_func`` should return a single number. If it returns integers, " "you can also invoke the class constructor with a second argument specifying " @@ -949,7 +949,7 @@ msgid "" "you would construct the :class:`Profile` instance as follows::" msgstr "" -#: ../../library/profile.rst:690 +#: ../../library/profile.rst:692 msgid "" "As the :class:`cProfile.Profile` class cannot be calibrated, custom timer " "functions should be used with care and should be as fast as possible. For " @@ -957,7 +957,7 @@ msgid "" "in the C source of the internal :mod:`_lsprof` module." msgstr "" -#: ../../library/profile.rst:695 +#: ../../library/profile.rst:697 msgid "" "Python 3.3 adds several new functions in :mod:`time` that can be used to " "make precise measurements of process or wall-clock time. For example, see :" diff --git a/library/py_compile.po b/library/py_compile.po index 9d9d843043..f13e31e720 100644 --- a/library/py_compile.po +++ b/library/py_compile.po @@ -1,5 +1,4 @@ -# 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: @@ -7,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-10-12 00:03+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-" @@ -20,7 +19,7 @@ msgstr "" #: ../../library/py_compile.rst:2 msgid ":mod:`py_compile` --- Compile Python source files" -msgstr "" +msgstr ":mod:`py_compile` — 編譯 Python 來源檔案" #: ../../library/py_compile.rst:10 msgid "**Source code:** :source:`Lib/py_compile.py`" @@ -168,11 +167,11 @@ msgid "" "external to Python like a build system." msgstr "" -#: ../../library/py_compile.rst:130 +#: ../../library/py_compile.rst:131 msgid "Command-Line Interface" msgstr "" -#: ../../library/py_compile.rst:132 +#: ../../library/py_compile.rst:133 msgid "" "This module can be invoked as a script to compile several source files. The " "files named in *filenames* are compiled and the resulting bytecode is cached " @@ -181,29 +180,29 @@ msgid "" "status is nonzero if one of the files could not be compiled." msgstr "" -#: ../../library/py_compile.rst:144 +#: ../../library/py_compile.rst:145 msgid "" "Positional arguments are files to compile. If ``-`` is the only parameter, " "the list of files is taken from standard input." msgstr "" -#: ../../library/py_compile.rst:149 +#: ../../library/py_compile.rst:150 msgid "Suppress errors output." msgstr "" -#: ../../library/py_compile.rst:151 +#: ../../library/py_compile.rst:152 msgid "Added support for ``-``." msgstr "新增對 ``-`` 的支援。" -#: ../../library/py_compile.rst:154 +#: ../../library/py_compile.rst:155 msgid "Added support for :option:`-q`." msgstr "新增對 :option:`-q` 的支援。" -#: ../../library/py_compile.rst:160 +#: ../../library/py_compile.rst:161 msgid "Module :mod:`compileall`" msgstr ":mod:`compileall` 模組" -#: ../../library/py_compile.rst:161 +#: ../../library/py_compile.rst:162 msgid "Utilities to compile all Python source files in a directory tree." msgstr "" diff --git a/library/re.po b/library/re.po index 9a3cea8d64..30f305d70d 100644 --- a/library/re.po +++ b/library/re.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-27 00:04+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2023-09-16 14:49+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -935,8 +935,9 @@ msgstr "" #: ../../library/re.rst:662 msgid "" -"The ``'\\N{name}'`` escape sequence has been added. As in string literals, " -"it expands to the named Unicode character (e.g. ``'\\N{EM DASH}'``)." +"The :samp:`'\\\\N\\\\{{name}\\\\}'` escape sequence has been added. As in " +"string literals, it expands to the named Unicode character (e.g. ``'\\N{EM " +"DASH}'``)." msgstr "" #: ../../library/re.rst:670 diff --git a/library/shutil.po b/library/shutil.po index 9a21435530..252cdd980b 100644 --- a/library/shutil.po +++ b/library/shutil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 10:36+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+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-" @@ -617,18 +617,25 @@ msgid "" "now be found." msgstr "" -#: ../../library/shutil.rst:481 +#: ../../library/shutil.rst:479 +msgid "" +"On Windows, if *mode* includes ``os.X_OK``, executables with an extension in " +"``PATHEXT`` will be preferred over executables without a matching extension. " +"This brings behavior closer to that of Python 3.11." +msgstr "" + +#: ../../library/shutil.rst:487 msgid "" "This exception collects exceptions that are raised during a multi-file " "operation. For :func:`copytree`, the exception argument is a list of 3-" "tuples (*srcname*, *dstname*, *exception*)." msgstr "" -#: ../../library/shutil.rst:488 +#: ../../library/shutil.rst:494 msgid "Platform-dependent efficient copy operations" msgstr "" -#: ../../library/shutil.rst:490 +#: ../../library/shutil.rst:496 msgid "" "Starting from Python 3.8, all functions involving a file copy (:func:" "`copyfile`, :func:`~shutil.copy`, :func:`copy2`, :func:`copytree`, and :func:" @@ -638,51 +645,51 @@ msgid "" "buffers in Python as in \"``outfd.write(infd.read())``\"." msgstr "" -#: ../../library/shutil.rst:498 +#: ../../library/shutil.rst:504 msgid "On macOS `fcopyfile`_ is used to copy the file content (not metadata)." msgstr "" -#: ../../library/shutil.rst:500 +#: ../../library/shutil.rst:506 msgid "On Linux :func:`os.sendfile` is used." msgstr "" -#: ../../library/shutil.rst:502 +#: ../../library/shutil.rst:508 msgid "" "On Windows :func:`shutil.copyfile` uses a bigger default buffer size (1 MiB " "instead of 64 KiB) and a :func:`memoryview`-based variant of :func:`shutil." "copyfileobj` is used." msgstr "" -#: ../../library/shutil.rst:506 +#: ../../library/shutil.rst:512 msgid "" "If the fast-copy operation fails and no data was written in the destination " "file then shutil will silently fallback on using less efficient :func:" "`copyfileobj` function internally." msgstr "" -#: ../../library/shutil.rst:515 +#: ../../library/shutil.rst:521 msgid "copytree example" msgstr "" -#: ../../library/shutil.rst:517 +#: ../../library/shutil.rst:523 msgid "An example that uses the :func:`ignore_patterns` helper::" msgstr "" -#: ../../library/shutil.rst:523 +#: ../../library/shutil.rst:529 msgid "" "This will copy everything except ``.pyc`` files and files or directories " "whose name starts with ``tmp``." msgstr "" -#: ../../library/shutil.rst:526 +#: ../../library/shutil.rst:532 msgid "Another example that uses the *ignore* argument to add a logging call::" msgstr "" -#: ../../library/shutil.rst:541 +#: ../../library/shutil.rst:547 msgid "rmtree example" msgstr "rmtree 範例" -#: ../../library/shutil.rst:543 +#: ../../library/shutil.rst:549 msgid "" "This example shows how to remove a directory tree on Windows where some of " "the files have their read-only bit set. It uses the onexc callback to clear " @@ -690,25 +697,25 @@ msgid "" "propagate. ::" msgstr "" -#: ../../library/shutil.rst:561 +#: ../../library/shutil.rst:567 msgid "Archiving operations" msgstr "" -#: ../../library/shutil.rst:565 +#: ../../library/shutil.rst:571 msgid "Added support for the *xztar* format." msgstr "新增 *xztar* 格式的支援。" -#: ../../library/shutil.rst:569 +#: ../../library/shutil.rst:575 msgid "" "High-level utilities to create and read compressed and archived files are " "also provided. They rely on the :mod:`zipfile` and :mod:`tarfile` modules." msgstr "" -#: ../../library/shutil.rst:574 +#: ../../library/shutil.rst:580 msgid "Create an archive file (such as zip or tar) and return its name." msgstr "" -#: ../../library/shutil.rst:576 +#: ../../library/shutil.rst:582 msgid "" "*base_name* is the name of the file to create, including the path, minus any " "format-specific extension. *format* is the archive format: one of " @@ -717,14 +724,14 @@ msgid "" "available), or \"xztar\" (if the :mod:`lzma` module is available)." msgstr "" -#: ../../library/shutil.rst:582 +#: ../../library/shutil.rst:588 msgid "" "*root_dir* is a directory that will be the root directory of the archive, " "all paths in the archive will be relative to it; for example, we typically " "chdir into *root_dir* before creating the archive." msgstr "" -#: ../../library/shutil.rst:586 +#: ../../library/shutil.rst:592 msgid "" "*base_dir* is the directory where we start archiving from; i.e. *base_dir* " "will be the common prefix of all files and directories in the archive. " @@ -732,33 +739,33 @@ msgid "" "example-with-basedir` for how to use *base_dir* and *root_dir* together." msgstr "" -#: ../../library/shutil.rst:592 +#: ../../library/shutil.rst:598 msgid "*root_dir* and *base_dir* both default to the current directory." msgstr "" -#: ../../library/shutil.rst:594 +#: ../../library/shutil.rst:600 msgid "" "If *dry_run* is true, no archive is created, but the operations that would " "be executed are logged to *logger*." msgstr "" -#: ../../library/shutil.rst:597 +#: ../../library/shutil.rst:603 msgid "" "*owner* and *group* are used when creating a tar archive. By default, uses " "the current owner and group." msgstr "" -#: ../../library/shutil.rst:600 +#: ../../library/shutil.rst:606 msgid "" "*logger* must be an object compatible with :pep:`282`, usually an instance " "of :class:`logging.Logger`." msgstr "" -#: ../../library/shutil.rst:603 +#: ../../library/shutil.rst:609 msgid "The *verbose* argument is unused and deprecated." msgstr "" -#: ../../library/shutil.rst:605 +#: ../../library/shutil.rst:611 msgid "" "Raises an :ref:`auditing event ` ``shutil.make_archive`` with " "arguments ``base_name``, ``format``, ``root_dir``, ``base_dir``." @@ -766,7 +773,7 @@ msgstr "" "引發一個附帶引數 ``base_name``、``format``、``root_dir``、``base_dir`` 的\\ :" "ref:`稽核事件 ` ``shutil.make_archive``。" -#: ../../library/shutil.rst:609 +#: ../../library/shutil.rst:615 msgid "" "This function is not thread-safe when custom archivers registered with :func:" "`register_archive_format` do not support the *root_dir* argument. In this " @@ -774,60 +781,60 @@ msgid "" "*root_dir* to perform archiving." msgstr "" -#: ../../library/shutil.rst:615 +#: ../../library/shutil.rst:621 msgid "" "The modern pax (POSIX.1-2001) format is now used instead of the legacy GNU " "format for archives created with ``format=\"tar\"``." msgstr "" -#: ../../library/shutil.rst:619 +#: ../../library/shutil.rst:625 msgid "" "This function is now made thread-safe during creation of standard ``.zip`` " "and tar archives." msgstr "" -#: ../../library/shutil.rst:625 +#: ../../library/shutil.rst:631 msgid "" "Return a list of supported formats for archiving. Each element of the " "returned sequence is a tuple ``(name, description)``." msgstr "" -#: ../../library/shutil.rst:628 ../../library/shutil.rst:739 +#: ../../library/shutil.rst:634 ../../library/shutil.rst:745 msgid "By default :mod:`shutil` provides these formats:" msgstr "" -#: ../../library/shutil.rst:630 +#: ../../library/shutil.rst:636 msgid "*zip*: ZIP file (if the :mod:`zlib` module is available)." msgstr "" -#: ../../library/shutil.rst:631 +#: ../../library/shutil.rst:637 msgid "" "*tar*: Uncompressed tar file. Uses POSIX.1-2001 pax format for new archives." msgstr "" -#: ../../library/shutil.rst:632 ../../library/shutil.rst:744 +#: ../../library/shutil.rst:638 ../../library/shutil.rst:750 msgid "*gztar*: gzip'ed tar-file (if the :mod:`zlib` module is available)." msgstr "" -#: ../../library/shutil.rst:633 ../../library/shutil.rst:745 +#: ../../library/shutil.rst:639 ../../library/shutil.rst:751 msgid "*bztar*: bzip2'ed tar-file (if the :mod:`bz2` module is available)." msgstr "" -#: ../../library/shutil.rst:634 ../../library/shutil.rst:746 +#: ../../library/shutil.rst:640 ../../library/shutil.rst:752 msgid "*xztar*: xz'ed tar-file (if the :mod:`lzma` module is available)." msgstr "" -#: ../../library/shutil.rst:636 +#: ../../library/shutil.rst:642 msgid "" "You can register new formats or provide your own archiver for any existing " "formats, by using :func:`register_archive_format`." msgstr "" -#: ../../library/shutil.rst:642 +#: ../../library/shutil.rst:648 msgid "Register an archiver for the format *name*." msgstr "" -#: ../../library/shutil.rst:644 +#: ../../library/shutil.rst:650 msgid "" "*function* is the callable that will be used to unpack archives. The " "callable will receive the *base_name* of the file to create, followed by the " @@ -836,7 +843,7 @@ msgid "" "*dry_run* and *logger* (as passed in :func:`make_archive`)." msgstr "" -#: ../../library/shutil.rst:650 +#: ../../library/shutil.rst:656 msgid "" "If *function* has the custom attribute ``function.supports_root_dir`` set to " "``True``, the *root_dir* argument is passed as a keyword argument. Otherwise " @@ -845,37 +852,37 @@ msgid "" "not thread-safe." msgstr "" -#: ../../library/shutil.rst:656 +#: ../../library/shutil.rst:662 msgid "" "If given, *extra_args* is a sequence of ``(name, value)`` pairs that will be " "used as extra keywords arguments when the archiver callable is used." msgstr "" -#: ../../library/shutil.rst:659 +#: ../../library/shutil.rst:665 msgid "" "*description* is used by :func:`get_archive_formats` which returns the list " "of archivers. Defaults to an empty string." msgstr "" -#: ../../library/shutil.rst:662 +#: ../../library/shutil.rst:668 msgid "Added support for functions supporting the *root_dir* argument." msgstr "" -#: ../../library/shutil.rst:668 +#: ../../library/shutil.rst:674 msgid "Remove the archive format *name* from the list of supported formats." msgstr "" -#: ../../library/shutil.rst:673 +#: ../../library/shutil.rst:679 msgid "Unpack an archive. *filename* is the full path of the archive." msgstr "" -#: ../../library/shutil.rst:675 +#: ../../library/shutil.rst:681 msgid "" "*extract_dir* is the name of the target directory where the archive is " "unpacked. If not provided, the current working directory is used." msgstr "" -#: ../../library/shutil.rst:678 +#: ../../library/shutil.rst:684 msgid "" "*format* is the archive format: one of \"zip\", \"tar\", \"gztar\", " "\"bztar\", or \"xztar\". Or any other format registered with :func:" @@ -884,7 +891,7 @@ msgid "" "that extension. In case none is found, a :exc:`ValueError` is raised." msgstr "" -#: ../../library/shutil.rst:685 +#: ../../library/shutil.rst:691 msgid "" "The keyword-only *filter* argument is passed to the underlying unpacking " "function. For zip files, *filter* is not accepted. For tar files, it is " @@ -894,7 +901,7 @@ msgid "" "Python 3.14." msgstr "" -#: ../../library/shutil.rst:693 +#: ../../library/shutil.rst:699 msgid "" "Raises an :ref:`auditing event ` ``shutil.unpack_archive`` with " "arguments ``filename``, ``extract_dir``, ``format``." @@ -902,7 +909,7 @@ msgstr "" "引發一個附帶引數 ``filename``、``extract_dir``、``format`` 的\\ :ref:`稽核事" "件 ` ``shutil.unpack_archive``。" -#: ../../library/shutil.rst:697 +#: ../../library/shutil.rst:703 msgid "" "Never extract archives from untrusted sources without prior inspection. It " "is possible that files are created outside of the path specified in the " @@ -910,138 +917,138 @@ msgid "" "with \"/\" or filenames with two dots \"..\"." msgstr "" -#: ../../library/shutil.rst:702 +#: ../../library/shutil.rst:708 msgid "Accepts a :term:`path-like object` for *filename* and *extract_dir*." msgstr "" -#: ../../library/shutil.rst:705 +#: ../../library/shutil.rst:711 msgid "Added the *filter* argument." msgstr "新增 *filter* 引數。" -#: ../../library/shutil.rst:710 +#: ../../library/shutil.rst:716 msgid "" "Registers an unpack format. *name* is the name of the format and " "*extensions* is a list of extensions corresponding to the format, like ``." "zip`` for Zip files." msgstr "" -#: ../../library/shutil.rst:714 +#: ../../library/shutil.rst:720 msgid "" "*function* is the callable that will be used to unpack archives. The " "callable will receive:" msgstr "" -#: ../../library/shutil.rst:717 +#: ../../library/shutil.rst:723 msgid "the path of the archive, as a positional argument;" msgstr "" -#: ../../library/shutil.rst:718 +#: ../../library/shutil.rst:724 msgid "" "the directory the archive must be extracted to, as a positional argument;" msgstr "" -#: ../../library/shutil.rst:719 +#: ../../library/shutil.rst:725 msgid "" "possibly a *filter* keyword argument, if it was given to :func:" "`unpack_archive`;" msgstr "" -#: ../../library/shutil.rst:721 +#: ../../library/shutil.rst:727 msgid "" "additional keyword arguments, specified by *extra_args* as a sequence of " "``(name, value)`` tuples." msgstr "" -#: ../../library/shutil.rst:724 +#: ../../library/shutil.rst:730 msgid "" "*description* can be provided to describe the format, and will be returned " "by the :func:`get_unpack_formats` function." msgstr "" -#: ../../library/shutil.rst:730 +#: ../../library/shutil.rst:736 msgid "Unregister an unpack format. *name* is the name of the format." msgstr "" -#: ../../library/shutil.rst:735 +#: ../../library/shutil.rst:741 msgid "" "Return a list of all registered formats for unpacking. Each element of the " "returned sequence is a tuple ``(name, extensions, description)``." msgstr "" -#: ../../library/shutil.rst:741 +#: ../../library/shutil.rst:747 msgid "" "*zip*: ZIP file (unpacking compressed files works only if the corresponding " "module is available)." msgstr "" -#: ../../library/shutil.rst:743 +#: ../../library/shutil.rst:749 msgid "*tar*: uncompressed tar file." msgstr "" -#: ../../library/shutil.rst:748 +#: ../../library/shutil.rst:754 msgid "" "You can register new formats or provide your own unpacker for any existing " "formats, by using :func:`register_unpack_format`." msgstr "" -#: ../../library/shutil.rst:755 +#: ../../library/shutil.rst:761 msgid "Archiving example" msgstr "" -#: ../../library/shutil.rst:757 +#: ../../library/shutil.rst:763 msgid "" "In this example, we create a gzip'ed tar-file archive containing all files " "found in the :file:`.ssh` directory of the user::" msgstr "" -#: ../../library/shutil.rst:767 +#: ../../library/shutil.rst:773 msgid "The resulting archive contains:" msgstr "" -#: ../../library/shutil.rst:785 +#: ../../library/shutil.rst:791 msgid "Archiving example with *base_dir*" msgstr "" -#: ../../library/shutil.rst:787 +#: ../../library/shutil.rst:793 msgid "" "In this example, similar to the `one above `_, we " "show how to use :func:`make_archive`, but this time with the usage of " "*base_dir*. We now have the following directory structure:" msgstr "" -#: ../../library/shutil.rst:801 +#: ../../library/shutil.rst:807 msgid "" "In the final archive, :file:`please_add.txt` should be included, but :file:" "`do_not_add.txt` should not. Therefore we use the following::" msgstr "" -#: ../../library/shutil.rst:815 +#: ../../library/shutil.rst:821 msgid "Listing the files in the resulting archive gives us:" msgstr "" -#: ../../library/shutil.rst:825 +#: ../../library/shutil.rst:831 msgid "Querying the size of the output terminal" msgstr "" -#: ../../library/shutil.rst:829 +#: ../../library/shutil.rst:835 msgid "Get the size of the terminal window." msgstr "" -#: ../../library/shutil.rst:831 +#: ../../library/shutil.rst:837 msgid "" "For each of the two dimensions, the environment variable, ``COLUMNS`` and " "``LINES`` respectively, is checked. If the variable is defined and the value " "is a positive integer, it is used." msgstr "" -#: ../../library/shutil.rst:835 +#: ../../library/shutil.rst:841 msgid "" "When ``COLUMNS`` or ``LINES`` is not defined, which is the common case, the " "terminal connected to :data:`sys.__stdout__` is queried by invoking :func:" "`os.get_terminal_size`." msgstr "" -#: ../../library/shutil.rst:839 +#: ../../library/shutil.rst:845 msgid "" "If the terminal size cannot be successfully queried, either because the " "system doesn't support querying, or because we are not connected to a " @@ -1050,17 +1057,17 @@ msgid "" "emulators." msgstr "" -#: ../../library/shutil.rst:845 +#: ../../library/shutil.rst:851 msgid "The value returned is a named tuple of type :class:`os.terminal_size`." msgstr "" -#: ../../library/shutil.rst:847 +#: ../../library/shutil.rst:853 msgid "" "See also: The Single UNIX Specification, Version 2, `Other Environment " "Variables`_." msgstr "" -#: ../../library/shutil.rst:852 +#: ../../library/shutil.rst:858 msgid "" "The ``fallback`` values are also used if :func:`os.get_terminal_size` " "returns zeroes." diff --git a/library/site.po b/library/site.po index 8e1b8bb8fc..df42298966 100644 --- a/library/site.po +++ b/library/site.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-18 00:03+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+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-" @@ -39,7 +39,7 @@ msgid "" "path and add a few builtins, unless :option:`-S` was used. In that case, " "this module can be safely imported with no automatic modifications to the " "module search path or additions to the builtins. To explicitly trigger the " -"usual site-specific additions, call the :func:`site.main` function." +"usual site-specific additions, call the :func:`main` function." msgstr "" #: ../../library/site.rst:24 @@ -128,43 +128,52 @@ msgid "" "because it is not mentioned in either path configuration file." msgstr "" -#: ../../library/site.rst:114 +#: ../../library/site.rst:113 +msgid ":mod:`sitecustomize`" +msgstr ":mod:`sitecustomize`" + +#: ../../library/site.rst:117 msgid "" "After these path manipulations, an attempt is made to import a module named :" "mod:`sitecustomize`, which can perform arbitrary site-specific " "customizations. It is typically created by a system administrator in the " "site-packages directory. If this import fails with an :exc:`ImportError` or " -"its subclass exception, and the exception's :attr:`name` attribute equals to " -"``'sitecustomize'``, it is silently ignored. If Python is started without " -"output streams available, as with :file:`pythonw.exe` on Windows (which is " -"used by default to start IDLE), attempted output from :mod:`sitecustomize` " -"is ignored. Any other exception causes a silent and perhaps mysterious " -"failure of the process." +"its subclass exception, and the exception's :attr:`~ImportError.name` " +"attribute equals to ``'sitecustomize'``, it is silently ignored. If Python " +"is started without output streams available, as with :file:`pythonw.exe` on " +"Windows (which is used by default to start IDLE), attempted output from :mod:" +"`sitecustomize` is ignored. Any other exception causes a silent and perhaps " +"mysterious failure of the process." msgstr "" -#: ../../library/site.rst:126 +#: ../../library/site.rst:129 +msgid ":mod:`usercustomize`" +msgstr ":mod:`usercustomize`" + +#: ../../library/site.rst:133 msgid "" "After this, an attempt is made to import a module named :mod:" "`usercustomize`, which can perform arbitrary user-specific customizations, " -"if :data:`ENABLE_USER_SITE` is true. This file is intended to be created in " -"the user site-packages directory (see below), which is part of ``sys.path`` " -"unless disabled by :option:`-s`. If this import fails with an :exc:" -"`ImportError` or its subclass exception, and the exception's :attr:`name` " -"attribute equals to ``'usercustomize'``, it is silently ignored." +"if :data:`~site.ENABLE_USER_SITE` is true. This file is intended to be " +"created in the user site-packages directory (see below), which is part of " +"``sys.path`` unless disabled by :option:`-s`. If this import fails with an :" +"exc:`ImportError` or its subclass exception, and the exception's :attr:" +"`~ImportError.name` attribute equals to ``'usercustomize'``, it is silently " +"ignored." msgstr "" -#: ../../library/site.rst:134 +#: ../../library/site.rst:141 msgid "" "Note that for some non-Unix systems, ``sys.prefix`` and ``sys.exec_prefix`` " "are empty, and the path manipulations are skipped; however the import of :" "mod:`sitecustomize` and :mod:`usercustomize` is still attempted." msgstr "" -#: ../../library/site.rst:142 +#: ../../library/site.rst:150 msgid "Readline configuration" msgstr "" -#: ../../library/site.rst:144 +#: ../../library/site.rst:152 msgid "" "On systems that support :mod:`readline`, this module will also import and " "configure the :mod:`rlcompleter` module, if Python is started in :ref:" @@ -176,19 +185,19 @@ msgid "" "`PYTHONSTARTUP` file." msgstr "" -#: ../../library/site.rst:153 +#: ../../library/site.rst:161 msgid "Activation of rlcompleter and history was made automatic." msgstr "" -#: ../../library/site.rst:158 +#: ../../library/site.rst:166 msgid "Module contents" msgstr "模組內容" -#: ../../library/site.rst:162 +#: ../../library/site.rst:170 msgid "A list of prefixes for site-packages directories." msgstr "" -#: ../../library/site.rst:167 +#: ../../library/site.rst:175 msgid "" "Flag showing the status of the user site-packages directory. ``True`` means " "that it is enabled and was added to ``sys.path``. ``False`` means that it " @@ -197,7 +206,7 @@ msgid "" "(mismatch between user or group id and effective id) or by an administrator." msgstr "" -#: ../../library/site.rst:177 +#: ../../library/site.rst:185 msgid "" "Path to the user site-packages for the running Python. Can be ``None`` if :" "func:`getusersitepackages` hasn't been called yet. Default value is :file:" @@ -208,46 +217,46 @@ msgid "" "file:`.pth` files in it will be processed." msgstr "" -#: ../../library/site.rst:188 +#: ../../library/site.rst:196 msgid "" "Path to the base directory for the user site-packages. Can be ``None`` if :" "func:`getuserbase` hasn't been called yet. Default value is :file:`~/." "local` for UNIX and macOS non-framework builds, :file:`~/Library/Python/{X.Y}" "` for macOS framework builds, and :file:`{%APPDATA%}\\\\Python` for " "Windows. This value is used to compute the installation directories for " -"scripts, data files, Python modules, etc. for the user installation scheme. " -"See also :envvar:`PYTHONUSERBASE`." +"scripts, data files, Python modules, etc. for the :ref:`user installation " +"scheme `. See also :envvar:`PYTHONUSERBASE`." msgstr "" -#: ../../library/site.rst:200 +#: ../../library/site.rst:208 msgid "" "Adds all the standard site-specific directories to the module search path. " "This function is called automatically when this module is imported, unless " "the Python interpreter was started with the :option:`-S` flag." msgstr "" -#: ../../library/site.rst:204 +#: ../../library/site.rst:212 msgid "This function used to be called unconditionally." msgstr "" -#: ../../library/site.rst:210 +#: ../../library/site.rst:218 msgid "" "Add a directory to sys.path and process its :file:`.pth` files. Typically " "used in :mod:`sitecustomize` or :mod:`usercustomize` (see above)." msgstr "" -#: ../../library/site.rst:216 +#: ../../library/site.rst:224 msgid "Return a list containing all global site-packages directories." msgstr "" -#: ../../library/site.rst:223 +#: ../../library/site.rst:231 msgid "" "Return the path of the user base directory, :data:`USER_BASE`. If it is not " "initialized yet, this function will also set it, respecting :envvar:" "`PYTHONUSERBASE`." msgstr "" -#: ../../library/site.rst:232 +#: ../../library/site.rst:240 msgid "" "Return the path of the user-specific site-packages directory, :data:" "`USER_SITE`. If it is not initialized yet, this function will also set it, " @@ -255,17 +264,17 @@ msgid "" "packages was added to ``sys.path`` :data:`ENABLE_USER_SITE` should be used." msgstr "" -#: ../../library/site.rst:244 +#: ../../library/site.rst:252 msgid "Command Line Interface" -msgstr "" +msgstr "命令列介面" -#: ../../library/site.rst:248 +#: ../../library/site.rst:256 msgid "" "The :mod:`site` module also provides a way to get the user directories from " "the command line:" msgstr "" -#: ../../library/site.rst:256 +#: ../../library/site.rst:264 msgid "" "If it is called without arguments, it will print the contents of :data:`sys." "path` on the standard output, followed by the value of :data:`USER_BASE` and " @@ -273,21 +282,21 @@ msgid "" "finally the value of :data:`ENABLE_USER_SITE`." msgstr "" -#: ../../library/site.rst:263 +#: ../../library/site.rst:271 msgid "Print the path to the user base directory." msgstr "" -#: ../../library/site.rst:267 +#: ../../library/site.rst:275 msgid "Print the path to the user site-packages directory." msgstr "" -#: ../../library/site.rst:269 +#: ../../library/site.rst:277 msgid "" "If both options are given, user base and user site will be printed (always " "in this order), separated by :data:`os.pathsep`." msgstr "" -#: ../../library/site.rst:272 +#: ../../library/site.rst:280 msgid "" "If any option is given, the script will exit with one of these values: ``0`` " "if the user site-packages directory is enabled, ``1`` if it was disabled by " @@ -295,16 +304,15 @@ msgid "" "administrator, and a value greater than 2 if there is an error." msgstr "" -#: ../../library/site.rst:279 +#: ../../library/site.rst:287 msgid ":pep:`370` -- Per user site-packages directory" msgstr "" -#: ../../library/site.rst:280 +#: ../../library/site.rst:288 msgid ":ref:`sys-path-init` -- The initialization of :data:`sys.path`." msgstr "" -#: ../../library/site.rst:16 ../../library/site.rst:112 -#: ../../library/site.rst:124 +#: ../../library/site.rst:16 msgid "module" msgstr "module(模組)" @@ -351,11 +359,3 @@ msgstr "configuration(設定)" #: ../../library/site.rst:77 msgid "file" msgstr "file(檔案)" - -#: ../../library/site.rst:112 -msgid "sitecustomize" -msgstr "sitecustomize" - -#: ../../library/site.rst:124 -msgid "usercustomize" -msgstr "usercustomize" diff --git a/library/socket.po b/library/socket.po index 6ef99f085a..1c2482488b 100644 --- a/library/socket.po +++ b/library/socket.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-09-09 00:03+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+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-" @@ -2313,7 +2313,7 @@ msgid "" "and IPv6. The server side will listen to the first address family available " "(it should listen to both instead). On most of IPv6-ready systems, IPv6 will " "take precedence and the server may not accept IPv4 traffic. The client side " -"will try to connect to the all addresses returned as a result of the name " +"will try to connect to all the addresses returned as a result of the name " "resolution, and sends traffic to the first one connected successfully. ::" msgstr "" diff --git a/library/socketserver.po b/library/socketserver.po index 6502379140..b4a24654b3 100644 --- a/library/socketserver.po +++ b/library/socketserver.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-10-11 17:13+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-" @@ -152,41 +152,47 @@ msgid "" "available on POSIX platforms that support :func:`~os.fork`." msgstr "" -#: ../../library/socketserver.rst:119 +#: ../../library/socketserver.rst:121 msgid "" -":meth:`socketserver.ForkingMixIn.server_close` waits until all child " -"processes complete, except if :attr:`socketserver.ForkingMixIn." -"block_on_close` attribute is false." +":meth:`ForkingMixIn.server_close ` waits until all " +"child processes complete, except if :attr:`block_on_close` attribute is " +"``False``." msgstr "" -#: ../../library/socketserver.rst:123 +#: ../../library/socketserver.rst:125 msgid "" -":meth:`socketserver.ThreadingMixIn.server_close` waits until all non-daemon " -"threads complete, except if :attr:`socketserver.ThreadingMixIn." -"block_on_close` attribute is false. Use daemonic threads by setting :data:" -"`ThreadingMixIn.daemon_threads` to ``True`` to not wait until threads " -"complete." +":meth:`ThreadingMixIn.server_close ` waits until " +"all non-daemon threads complete, except if :attr:`block_on_close` attribute " +"is ``False``." msgstr "" -#: ../../library/socketserver.rst:132 +#: ../../library/socketserver.rst:131 msgid "" -":meth:`socketserver.ForkingMixIn.server_close` and :meth:`socketserver." -"ThreadingMixIn.server_close` now waits until all child processes and non-" -"daemonic threads complete. Add a new :attr:`socketserver.ForkingMixIn." -"block_on_close` class attribute to opt-in for the pre-3.7 behaviour." +"For :class:`ThreadingMixIn` use daemonic threads by setting :data:" +"`ThreadingMixIn.daemon_threads ` to ``True`` to not wait " +"until threads complete." msgstr "" -#: ../../library/socketserver.rst:148 +#: ../../library/socketserver.rst:137 +msgid "" +":meth:`ForkingMixIn.server_close ` and :meth:" +"`ThreadingMixIn.server_close ` now waits until all " +"child processes and non-daemonic threads complete. Add a new :attr:" +"`ForkingMixIn.block_on_close ` class attribute to opt-in for " +"the pre-3.7 behaviour." +msgstr "" + +#: ../../library/socketserver.rst:153 msgid "These classes are pre-defined using the mix-in classes." msgstr "" -#: ../../library/socketserver.rst:150 +#: ../../library/socketserver.rst:155 msgid "" "The ``ForkingUnixStreamServer`` and ``ForkingUnixDatagramServer`` classes " "were added." msgstr "" -#: ../../library/socketserver.rst:154 +#: ../../library/socketserver.rst:159 msgid "" "To implement a service, you must derive a class from :class:" "`BaseRequestHandler` and redefine its :meth:`~BaseRequestHandler.handle` " @@ -197,7 +203,7 @@ msgid "" "`DatagramRequestHandler`." msgstr "" -#: ../../library/socketserver.rst:162 +#: ../../library/socketserver.rst:167 msgid "" "Of course, you still have to use your head! For instance, it makes no sense " "to use a forking server if the service contains state in memory that can be " @@ -207,7 +213,7 @@ msgid "" "probably have to use locks to protect the integrity of the shared data." msgstr "" -#: ../../library/socketserver.rst:169 +#: ../../library/socketserver.rst:174 msgid "" "On the other hand, if you are building an HTTP server where all data is " "stored externally (for instance, in the file system), a synchronous class " @@ -217,7 +223,7 @@ msgid "" "appropriate." msgstr "" -#: ../../library/socketserver.rst:175 +#: ../../library/socketserver.rst:180 msgid "" "In some cases, it may be appropriate to process part of a request " "synchronously, but to finish processing in a forked child depending on the " @@ -226,7 +232,7 @@ msgid "" "`~BaseRequestHandler.handle` method." msgstr "" -#: ../../library/socketserver.rst:180 +#: ../../library/socketserver.rst:185 msgid "" "Another approach to handling multiple simultaneous requests in an " "environment that supports neither threads nor :func:`~os.fork` (or where " @@ -238,11 +244,11 @@ msgid "" "subprocesses cannot be used)." msgstr "" -#: ../../library/socketserver.rst:193 +#: ../../library/socketserver.rst:198 msgid "Server Objects" msgstr "" -#: ../../library/socketserver.rst:197 +#: ../../library/socketserver.rst:202 msgid "" "This is the superclass of all Server objects in the module. It defines the " "interface, given below, but does not implement most of the methods, which is " @@ -250,14 +256,14 @@ msgid "" "`server_address` and :attr:`RequestHandlerClass` attributes." msgstr "" -#: ../../library/socketserver.rst:205 +#: ../../library/socketserver.rst:210 msgid "" "Return an integer file descriptor for the socket on which the server is " "listening. This function is most commonly passed to :mod:`selectors`, to " "allow monitoring multiple servers in the same process." msgstr "" -#: ../../library/socketserver.rst:212 +#: ../../library/socketserver.rst:217 msgid "" "Process a single request. This function calls the following methods in " "order: :meth:`get_request`, :meth:`verify_request`, and :meth:" @@ -268,7 +274,7 @@ msgid "" "`handle_request` will return." msgstr "" -#: ../../library/socketserver.rst:224 +#: ../../library/socketserver.rst:229 msgid "" "Handle requests until an explicit :meth:`shutdown` request. Poll for " "shutdown every *poll_interval* seconds. Ignores the :attr:`timeout` " @@ -278,41 +284,41 @@ msgid "" "clean up zombie child processes." msgstr "" -#: ../../library/socketserver.rst:232 +#: ../../library/socketserver.rst:237 msgid "Added ``service_actions`` call to the ``serve_forever`` method." msgstr "" -#: ../../library/socketserver.rst:238 +#: ../../library/socketserver.rst:243 msgid "" "This is called in the :meth:`serve_forever` loop. This method can be " "overridden by subclasses or mixin classes to perform actions specific to a " "given service, such as cleanup actions." msgstr "" -#: ../../library/socketserver.rst:246 +#: ../../library/socketserver.rst:251 msgid "" "Tell the :meth:`serve_forever` loop to stop and wait until it does. :meth:" "`shutdown` must be called while :meth:`serve_forever` is running in a " "different thread otherwise it will deadlock." msgstr "" -#: ../../library/socketserver.rst:253 +#: ../../library/socketserver.rst:258 msgid "Clean up the server. May be overridden." msgstr "" -#: ../../library/socketserver.rst:258 +#: ../../library/socketserver.rst:263 msgid "" "The family of protocols to which the server's socket belongs. Common " "examples are :const:`socket.AF_INET` and :const:`socket.AF_UNIX`." msgstr "" -#: ../../library/socketserver.rst:264 +#: ../../library/socketserver.rst:269 msgid "" "The user-provided request handler class; an instance of this class is " "created for each request." msgstr "" -#: ../../library/socketserver.rst:270 +#: ../../library/socketserver.rst:275 msgid "" "The address on which the server is listening. The format of addresses " "varies depending on the protocol family; see the documentation for the :mod:" @@ -321,22 +327,22 @@ msgid "" "``('127.0.0.1', 80)``, for example." msgstr "" -#: ../../library/socketserver.rst:279 +#: ../../library/socketserver.rst:284 msgid "" "The socket object on which the server will listen for incoming requests." msgstr "" -#: ../../library/socketserver.rst:282 +#: ../../library/socketserver.rst:287 msgid "The server classes support the following class variables:" msgstr "" -#: ../../library/socketserver.rst:288 +#: ../../library/socketserver.rst:293 msgid "" "Whether the server will allow the reuse of an address. This defaults to :" "const:`False`, and can be set in subclasses to change the policy." msgstr "" -#: ../../library/socketserver.rst:294 +#: ../../library/socketserver.rst:299 msgid "" "The size of the request queue. If it takes a long time to process a single " "request, any requests that arrive while the server is busy are placed into a " @@ -345,40 +351,40 @@ msgid "" "default value is usually 5, but this can be overridden by subclasses." msgstr "" -#: ../../library/socketserver.rst:303 +#: ../../library/socketserver.rst:308 msgid "" "The type of socket used by the server; :const:`socket.SOCK_STREAM` and :" "const:`socket.SOCK_DGRAM` are two common values." msgstr "" -#: ../../library/socketserver.rst:309 +#: ../../library/socketserver.rst:314 msgid "" "Timeout duration, measured in seconds, or :const:`None` if no timeout is " "desired. If :meth:`handle_request` receives no incoming requests within the " "timeout period, the :meth:`handle_timeout` method is called." msgstr "" -#: ../../library/socketserver.rst:314 +#: ../../library/socketserver.rst:319 msgid "" "There are various server methods that can be overridden by subclasses of " "base server classes like :class:`TCPServer`; these methods aren't useful to " "external users of the server object." msgstr "" -#: ../../library/socketserver.rst:323 +#: ../../library/socketserver.rst:328 msgid "" "Actually processes the request by instantiating :attr:`RequestHandlerClass` " "and calling its :meth:`~BaseRequestHandler.handle` method." msgstr "" -#: ../../library/socketserver.rst:329 +#: ../../library/socketserver.rst:334 msgid "" "Must accept a request from the socket, and return a 2-tuple containing the " "*new* socket object to be used to communicate with the client, and the " "client's address." msgstr "" -#: ../../library/socketserver.rst:336 +#: ../../library/socketserver.rst:341 msgid "" "This function is called if the :meth:`~BaseRequestHandler.handle` method of " "a :attr:`RequestHandlerClass` instance raises an exception. The default " @@ -386,11 +392,11 @@ msgid "" "further requests." msgstr "" -#: ../../library/socketserver.rst:341 +#: ../../library/socketserver.rst:346 msgid "Now only called for exceptions derived from the :exc:`Exception` class." msgstr "" -#: ../../library/socketserver.rst:348 +#: ../../library/socketserver.rst:353 msgid "" "This function is called when the :attr:`timeout` attribute has been set to a " "value other than :const:`None` and the timeout period has passed with no " @@ -399,7 +405,7 @@ msgid "" "threading servers this method does nothing." msgstr "" -#: ../../library/socketserver.rst:357 +#: ../../library/socketserver.rst:362 msgid "" "Calls :meth:`finish_request` to create an instance of the :attr:" "`RequestHandlerClass`. If desired, this function can create a new process " @@ -407,20 +413,20 @@ msgid "" "`ThreadingMixIn` classes do this." msgstr "" -#: ../../library/socketserver.rst:369 +#: ../../library/socketserver.rst:374 msgid "" "Called by the server's constructor to activate the server. The default " "behavior for a TCP server just invokes :meth:`~socket.socket.listen` on the " "server's socket. May be overridden." msgstr "" -#: ../../library/socketserver.rst:376 +#: ../../library/socketserver.rst:381 msgid "" "Called by the server's constructor to bind the socket to the desired " "address. May be overridden." msgstr "" -#: ../../library/socketserver.rst:382 +#: ../../library/socketserver.rst:387 msgid "" "Must return a Boolean value; if the value is :const:`True`, the request will " "be processed, and if it's :const:`False`, the request will be denied. This " @@ -428,17 +434,17 @@ msgid "" "default implementation always returns :const:`True`." msgstr "" -#: ../../library/socketserver.rst:388 +#: ../../library/socketserver.rst:393 msgid "" "Support for the :term:`context manager` protocol was added. Exiting the " "context manager is equivalent to calling :meth:`server_close`." msgstr "" -#: ../../library/socketserver.rst:394 +#: ../../library/socketserver.rst:399 msgid "Request Handler Objects" msgstr "" -#: ../../library/socketserver.rst:398 +#: ../../library/socketserver.rst:403 msgid "" "This is the superclass of all request handler objects. It defines the " "interface, given below. A concrete request handler subclass must define a " @@ -446,73 +452,94 @@ msgid "" "instance of the subclass is created for each request." msgstr "" -#: ../../library/socketserver.rst:407 +#: ../../library/socketserver.rst:412 msgid "" "Called before the :meth:`handle` method to perform any initialization " "actions required. The default implementation does nothing." msgstr "" -#: ../../library/socketserver.rst:413 +#: ../../library/socketserver.rst:418 msgid "" "This function must do all the work required to service a request. The " "default implementation does nothing. Several instance attributes are " -"available to it; the request is available as :attr:`self.request`; the " -"client address as :attr:`self.client_address`; and the server instance as :" -"attr:`self.server`, in case it needs access to per-server information." +"available to it; the request is available as :attr:`request`; the client " +"address as :attr:`client_address`; and the server instance as :attr:" +"`server`, in case it needs access to per-server information." msgstr "" -#: ../../library/socketserver.rst:419 +#: ../../library/socketserver.rst:424 msgid "" -"The type of :attr:`self.request` is different for datagram or stream " -"services. For stream services, :attr:`self.request` is a socket object; for " -"datagram services, :attr:`self.request` is a pair of string and socket." +"The type of :attr:`request` is different for datagram or stream services. " +"For stream services, :attr:`request` is a socket object; for datagram " +"services, :attr:`request` is a pair of string and socket." msgstr "" -#: ../../library/socketserver.rst:426 +#: ../../library/socketserver.rst:431 msgid "" "Called after the :meth:`handle` method to perform any clean-up actions " "required. The default implementation does nothing. If :meth:`setup` raises " "an exception, this function will not be called." msgstr "" -#: ../../library/socketserver.rst:434 +#: ../../library/socketserver.rst:438 +msgid "" +"The *new* :class:`socket.socket` object to be used to communicate with the " +"client." +msgstr "" + +#: ../../library/socketserver.rst:444 +msgid "Client address returned by :meth:`BaseServer.get_request`." +msgstr "" + +#: ../../library/socketserver.rst:449 +msgid ":class:`BaseServer` object used for handling the request." +msgstr "" + +#: ../../library/socketserver.rst:455 msgid "" "These :class:`BaseRequestHandler` subclasses override the :meth:" "`~BaseRequestHandler.setup` and :meth:`~BaseRequestHandler.finish` methods, " -"and provide :attr:`self.rfile` and :attr:`self.wfile` attributes. The :attr:" -"`self.rfile` and :attr:`self.wfile` attributes can be read or written, " -"respectively, to get the request data or return data to the client. The :" -"attr:`!rfile` attributes support the :class:`io.BufferedIOBase` readable " -"interface, and :attr:`!wfile` attributes support the :class:`!io." -"BufferedIOBase` writable interface." +"and provide :attr:`rfile` and :attr:`wfile` attributes." msgstr "" -#: ../../library/socketserver.rst:443 +#: ../../library/socketserver.rst:461 msgid "" -":attr:`StreamRequestHandler.wfile` also supports the :class:`io." -"BufferedIOBase` writable interface." +"A file object from which receives the request is read. Support the :class:" +"`io.BufferedIOBase` readable interface." msgstr "" -#: ../../library/socketserver.rst:449 +#: ../../library/socketserver.rst:466 +msgid "" +"A file object to which the reply is written. Support the :class:`io." +"BufferedIOBase` writable interface" +msgstr "" + +#: ../../library/socketserver.rst:470 +msgid "" +":attr:`wfile` also supports the :class:`io.BufferedIOBase` writable " +"interface." +msgstr "" + +#: ../../library/socketserver.rst:476 msgid "Examples" msgstr "範例" -#: ../../library/socketserver.rst:452 +#: ../../library/socketserver.rst:479 msgid ":class:`socketserver.TCPServer` Example" msgstr ":class:`socketserver.TCPServer` 範例" -#: ../../library/socketserver.rst:454 ../../library/socketserver.rst:553 +#: ../../library/socketserver.rst:481 ../../library/socketserver.rst:580 msgid "This is the server side::" msgstr "" -#: ../../library/socketserver.rst:484 +#: ../../library/socketserver.rst:511 msgid "" "An alternative request handler class that makes use of streams (file-like " "objects that simplify communication by providing the standard file " "interface)::" msgstr "" -#: ../../library/socketserver.rst:499 +#: ../../library/socketserver.rst:526 msgid "" "The difference is that the ``readline()`` call in the second handler will " "call ``recv()`` multiple times until it encounters a newline character, " @@ -520,47 +547,47 @@ msgid "" "has been sent from the client in one ``sendall()`` call." msgstr "" -#: ../../library/socketserver.rst:505 ../../library/socketserver.rst:577 +#: ../../library/socketserver.rst:532 ../../library/socketserver.rst:604 msgid "This is the client side::" msgstr "" -#: ../../library/socketserver.rst:526 ../../library/socketserver.rst:652 +#: ../../library/socketserver.rst:553 ../../library/socketserver.rst:679 msgid "The output of the example should look something like this:" msgstr "" -#: ../../library/socketserver.rst:528 +#: ../../library/socketserver.rst:555 msgid "Server:" msgstr "" -#: ../../library/socketserver.rst:538 +#: ../../library/socketserver.rst:565 msgid "Client:" msgstr "" -#: ../../library/socketserver.rst:551 +#: ../../library/socketserver.rst:578 msgid ":class:`socketserver.UDPServer` Example" msgstr ":class:`socketserver.UDPServer` 範例" -#: ../../library/socketserver.rst:596 +#: ../../library/socketserver.rst:623 msgid "" "The output of the example should look exactly like for the TCP server " "example." msgstr "" -#: ../../library/socketserver.rst:600 +#: ../../library/socketserver.rst:627 msgid "Asynchronous Mixins" msgstr "" -#: ../../library/socketserver.rst:602 +#: ../../library/socketserver.rst:629 msgid "" "To build asynchronous handlers, use the :class:`ThreadingMixIn` and :class:" "`ForkingMixIn` classes." msgstr "" -#: ../../library/socketserver.rst:605 +#: ../../library/socketserver.rst:632 msgid "An example for the :class:`ThreadingMixIn` class::" msgstr "" -#: ../../library/socketserver.rst:663 +#: ../../library/socketserver.rst:690 msgid "" "The :class:`ForkingMixIn` class is used in the same way, except that the " "server will spawn a new process for each request. Available only on POSIX " diff --git a/library/sqlite3.po b/library/sqlite3.po index cacf25b635..af64d9d6f7 100644 --- a/library/sqlite3.po +++ b/library/sqlite3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-29 12:27+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+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-" @@ -2166,10 +2166,11 @@ msgid "" "manager does nothing." msgstr "" -#: ../../library/sqlite3.rst:2410 +#: ../../library/sqlite3.rst:2409 msgid "" "The context manager neither implicitly opens a new transaction nor closes " -"the connection." +"the connection. If you need a closing context manager, consider using :meth:" +"`contextlib.closing`." msgstr "" #: ../../library/sqlite3.rst:2443 diff --git a/library/statistics.po b/library/statistics.po index 7c0597019a..40db5fa227 100644 --- a/library/statistics.po +++ b/library/statistics.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-15 00:03+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2023-07-22 21:15+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -28,13 +28,13 @@ msgstr ":mod:`statistics` --- 數學統計函式" msgid "**Source code:** :source:`Lib/statistics.py`" msgstr "**原始碼:**\\ :source:`Lib/statistics.py`" -#: ../../library/statistics.rst:21 +#: ../../library/statistics.rst:22 msgid "" "This module provides functions for calculating mathematical statistics of " "numeric (:class:`~numbers.Real`-valued) data." msgstr "這個模組提供計算數值 (:class:`Real`-valued) 資料的數學統計函式。" -#: ../../library/statistics.rst:24 +#: ../../library/statistics.rst:25 msgid "" "The module is not intended to be a competitor to third-party libraries such " "as `NumPy `_, `SciPy `_, or " @@ -46,7 +46,7 @@ msgstr "" ">`_ 等第三方函式庫,或者像 Minitab、SAS 和 Matlab 等專門設計給專業統計學家的" "高階統計軟體互相競爭。此模組的目標在於繪圖和科學計算。" -#: ../../library/statistics.rst:30 +#: ../../library/statistics.rst:31 msgid "" "Unless explicitly noted, these functions support :class:`int`, :class:" "`float`, :class:`~decimal.Decimal` and :class:`~fractions.Fraction`. " @@ -62,7 +62,7 @@ msgstr "" "輸入資料含有混合型別,你可以考慮使用 :func:`map` 來確保結果是一致的,例如:" "``map(float, input_data)``。" -#: ../../library/statistics.rst:38 +#: ../../library/statistics.rst:39 msgid "" "Some datasets use ``NaN`` (not a number) values to represent missing data. " "Since NaNs have unusual comparison semantics, they cause surprising or " @@ -78,186 +78,186 @@ msgstr "" "``median_grouped()``、 ``mode()``、 ``multimode()`` 以及 ``quantiles()``。在" "呼叫這些函數之前,應該先移除 NaN 值:" -#: ../../library/statistics.rst:68 +#: ../../library/statistics.rst:69 msgid "Averages and measures of central location" msgstr "平均值與中央位置量數" -#: ../../library/statistics.rst:70 +#: ../../library/statistics.rst:71 msgid "" "These functions calculate an average or typical value from a population or " "sample." msgstr "這些函式計算來自一個母體或樣本的平均值或代表值。" -#: ../../library/statistics.rst:74 +#: ../../library/statistics.rst:75 msgid ":func:`mean`" msgstr ":func:`mean`" -#: ../../library/statistics.rst:74 +#: ../../library/statistics.rst:75 msgid "Arithmetic mean (\"average\") of data." msgstr "資料的算術平均數(平均值)。" -#: ../../library/statistics.rst:75 +#: ../../library/statistics.rst:76 msgid ":func:`fmean`" msgstr ":func:`fmean`" -#: ../../library/statistics.rst:75 +#: ../../library/statistics.rst:76 msgid "Fast, floating point arithmetic mean, with optional weighting." msgstr "快速浮點數算數平均數,可調整權重。" -#: ../../library/statistics.rst:76 +#: ../../library/statistics.rst:77 msgid ":func:`geometric_mean`" msgstr ":func:`geometric_mean`" -#: ../../library/statistics.rst:76 +#: ../../library/statistics.rst:77 msgid "Geometric mean of data." msgstr "資料的幾何平均數。" -#: ../../library/statistics.rst:77 +#: ../../library/statistics.rst:78 msgid ":func:`harmonic_mean`" msgstr ":func:`harmonic_mean`" -#: ../../library/statistics.rst:77 +#: ../../library/statistics.rst:78 msgid "Harmonic mean of data." msgstr "資料的調和平均數。" -#: ../../library/statistics.rst:78 +#: ../../library/statistics.rst:79 msgid ":func:`median`" msgstr ":func:`median`" -#: ../../library/statistics.rst:78 +#: ../../library/statistics.rst:79 msgid "Median (middle value) of data." msgstr "資料的中位數(中間值)。" -#: ../../library/statistics.rst:79 +#: ../../library/statistics.rst:80 msgid ":func:`median_low`" msgstr ":func:`median_low`" -#: ../../library/statistics.rst:79 +#: ../../library/statistics.rst:80 msgid "Low median of data." msgstr "資料中較小的中位數。" -#: ../../library/statistics.rst:80 +#: ../../library/statistics.rst:81 msgid ":func:`median_high`" msgstr ":func:`median_high`" -#: ../../library/statistics.rst:80 +#: ../../library/statistics.rst:81 msgid "High median of data." msgstr "資料中較大的中位數。" -#: ../../library/statistics.rst:81 +#: ../../library/statistics.rst:82 msgid ":func:`median_grouped`" msgstr ":func:`median_grouped`" -#: ../../library/statistics.rst:81 +#: ../../library/statistics.rst:82 msgid "Median, or 50th percentile, of grouped data." msgstr "分組資料的中位數或 50% 處。" -#: ../../library/statistics.rst:82 +#: ../../library/statistics.rst:83 msgid ":func:`mode`" msgstr ":func:`mode`" -#: ../../library/statistics.rst:82 +#: ../../library/statistics.rst:83 msgid "Single mode (most common value) of discrete or nominal data." msgstr "" "離散 (discrete) 或名目 (nomial) 資料中的眾數(出現次數最多次的值),只回傳一" "個。" -#: ../../library/statistics.rst:83 +#: ../../library/statistics.rst:84 msgid ":func:`multimode`" msgstr ":func:`multimode`" -#: ../../library/statistics.rst:83 +#: ../../library/statistics.rst:84 msgid "List of modes (most common values) of discrete or nominal data." msgstr "離散或名目資料中的眾數(出現次數最多次的值)組成的 list。" -#: ../../library/statistics.rst:84 +#: ../../library/statistics.rst:85 msgid ":func:`quantiles`" msgstr ":func:`quantiles`" -#: ../../library/statistics.rst:84 +#: ../../library/statistics.rst:85 msgid "Divide data into intervals with equal probability." msgstr "將資料分成數個具有相等機率的區間,即分位數 (quantile)。" -#: ../../library/statistics.rst:88 +#: ../../library/statistics.rst:89 msgid "Measures of spread" msgstr "離度 (spread) 的測量" -#: ../../library/statistics.rst:90 +#: ../../library/statistics.rst:91 msgid "" "These functions calculate a measure of how much the population or sample " "tends to deviate from the typical or average values." msgstr "這些函式計算母體或樣本偏離平均值的程度。" -#: ../../library/statistics.rst:94 +#: ../../library/statistics.rst:95 msgid ":func:`pstdev`" msgstr ":func:`pstdev`" -#: ../../library/statistics.rst:94 +#: ../../library/statistics.rst:95 msgid "Population standard deviation of data." msgstr "資料的母體標準差。" -#: ../../library/statistics.rst:95 +#: ../../library/statistics.rst:96 msgid ":func:`pvariance`" msgstr ":func:`pvariance`" -#: ../../library/statistics.rst:95 +#: ../../library/statistics.rst:96 msgid "Population variance of data." msgstr "資料的母體變異數。" -#: ../../library/statistics.rst:96 +#: ../../library/statistics.rst:97 msgid ":func:`stdev`" msgstr ":func:`stdev`" -#: ../../library/statistics.rst:96 +#: ../../library/statistics.rst:97 msgid "Sample standard deviation of data." msgstr "資料的樣本標準差。" -#: ../../library/statistics.rst:97 +#: ../../library/statistics.rst:98 msgid ":func:`variance`" msgstr ":func:`variance`" -#: ../../library/statistics.rst:97 +#: ../../library/statistics.rst:98 msgid "Sample variance of data." msgstr "資料的樣本變異數。" -#: ../../library/statistics.rst:101 +#: ../../library/statistics.rst:102 msgid "Statistics for relations between two inputs" msgstr "兩個輸入之間的關係統計" -#: ../../library/statistics.rst:103 +#: ../../library/statistics.rst:104 msgid "" "These functions calculate statistics regarding relations between two inputs." msgstr "這些函式計算兩個輸入之間的關係統計數據。" -#: ../../library/statistics.rst:106 +#: ../../library/statistics.rst:107 msgid ":func:`covariance`" msgstr ":func:`covariance`" -#: ../../library/statistics.rst:106 +#: ../../library/statistics.rst:107 msgid "Sample covariance for two variables." msgstr "兩變數的樣本共變異數。" -#: ../../library/statistics.rst:107 +#: ../../library/statistics.rst:108 msgid ":func:`correlation`" msgstr ":func:`correlation`" -#: ../../library/statistics.rst:107 +#: ../../library/statistics.rst:108 msgid "Pearson and Spearman's correlation coefficients." msgstr "Pearson 與 Spearman 相關係數 (correlation coefficient)。" -#: ../../library/statistics.rst:108 +#: ../../library/statistics.rst:109 msgid ":func:`linear_regression`" msgstr ":func:`linear_regression`" -#: ../../library/statistics.rst:108 +#: ../../library/statistics.rst:109 msgid "Slope and intercept for simple linear regression." msgstr "簡單線性迴歸的斜率和截距。" -#: ../../library/statistics.rst:113 +#: ../../library/statistics.rst:114 msgid "Function details" msgstr "函式細節" -#: ../../library/statistics.rst:115 +#: ../../library/statistics.rst:116 msgid "" "Note: The functions do not require the data given to them to be sorted. " "However, for reading convenience, most of the examples show sorted sequences." @@ -265,13 +265,13 @@ msgstr "" "註:這些函數並不要求輸入的資料必須排序過。為了閱讀方便,大部份的範例仍已排序" "過。" -#: ../../library/statistics.rst:120 +#: ../../library/statistics.rst:121 msgid "" "Return the sample arithmetic mean of *data* which can be a sequence or " "iterable." msgstr "回傳 *data* 的樣本算數平均數,輸入可為一個 sequence 或者 iterable。" -#: ../../library/statistics.rst:122 +#: ../../library/statistics.rst:123 msgid "" "The arithmetic mean is the sum of the data divided by the number of data " "points. It is commonly called \"the average\", although it is only one of " @@ -281,15 +281,15 @@ msgstr "" "算數平均數為資料總和除以資料點的數目。他通常被稱為「平均值」,儘管它只是眾多" "不同的數學平均值之一。它是衡量資料集中位置的一種指標。" -#: ../../library/statistics.rst:127 +#: ../../library/statistics.rst:128 msgid "If *data* is empty, :exc:`StatisticsError` will be raised." msgstr "若 *data* 為空,則會引發 :exc:`StatisticsError`。" -#: ../../library/statistics.rst:129 +#: ../../library/statistics.rst:130 msgid "Some examples of use:" msgstr "使用範例:" -#: ../../library/statistics.rst:148 +#: ../../library/statistics.rst:149 msgid "" "The mean is strongly affected by `outliers `_ and is not necessarily a typical example of the data points. For " @@ -301,7 +301,7 @@ msgstr "" "低的\\ `集中趨勢 (central tendency) `_ 度量,請參考 :func:`median`。" -#: ../../library/statistics.rst:154 +#: ../../library/statistics.rst:155 msgid "" "The sample mean gives an unbiased estimate of the true population mean, so " "that when taken on average over all the possible samples, ``mean(sample)`` " @@ -314,11 +314,11 @@ msgstr "" "*data* 為整個母體而非單一樣本,則 ``mean(data)`` 等同於計算真實的母體平均數 " "μ。" -#: ../../library/statistics.rst:163 +#: ../../library/statistics.rst:164 msgid "Convert *data* to floats and compute the arithmetic mean." msgstr "將 *data* 轉換為浮點數並計算其算數平均數。" -#: ../../library/statistics.rst:165 +#: ../../library/statistics.rst:166 msgid "" "This runs faster than the :func:`mean` function and it always returns a :" "class:`float`. The *data* may be a sequence or iterable. If the input " @@ -328,7 +328,7 @@ msgstr "" "可以是一個 sequence 或者 iterable。如果輸入的資料為空,則引發 :exc:" "`StatisticsError`。" -#: ../../library/statistics.rst:174 +#: ../../library/statistics.rst:175 msgid "" "Optional weighting is supported. For example, a professor assigns a grade " "for a course by weighting quizzes at 20%, homework at 20%, a midterm exam at " @@ -337,7 +337,7 @@ msgstr "" "支援選擇性的加權。例如,一位教授以 20% 的比重計算小考分數,20% 的比重計算作業" "分數,30% 的比重計算期中考試分數,以及 30% 的比重計算期末考試分數:" -#: ../../library/statistics.rst:185 +#: ../../library/statistics.rst:186 msgid "" "If *weights* is supplied, it must be the same length as the *data* or a :exc:" "`ValueError` will be raised." @@ -345,15 +345,15 @@ msgstr "" "如果有提供 *weights*,它必須與 *data* 長度相同,否則將引發 :exc:" "`ValueError`。" -#: ../../library/statistics.rst:190 ../../library/statistics.rst:258 +#: ../../library/statistics.rst:191 ../../library/statistics.rst:259 msgid "Added support for *weights*." msgstr "新增 *weights* 的支援。" -#: ../../library/statistics.rst:196 +#: ../../library/statistics.rst:197 msgid "Convert *data* to floats and compute the geometric mean." msgstr "將 *data* 轉換成浮點數並計算其幾何平均數。" -#: ../../library/statistics.rst:198 +#: ../../library/statistics.rst:199 msgid "" "The geometric mean indicates the central tendency or typical value of the " "*data* using the product of the values (as opposed to the arithmetic mean " @@ -362,7 +362,7 @@ msgstr "" "幾何平均數使用數值的乘積(與之對照,算數平均數使用的是數值的和)來表示 " "*data* 的集中趨勢或典型值。" -#: ../../library/statistics.rst:202 +#: ../../library/statistics.rst:203 msgid "" "Raises a :exc:`StatisticsError` if the input dataset is empty, if it " "contains a zero, or if it contains a negative value. The *data* may be a " @@ -371,13 +371,13 @@ msgstr "" "若輸入的資料集為空、包含零、包含負值,則引發 :exc:`StatisticsError`。*data* " "可為 sequence 或者 iterable。" -#: ../../library/statistics.rst:206 +#: ../../library/statistics.rst:207 msgid "" "No special efforts are made to achieve exact results. (However, this may " "change in the future.)" msgstr "目前沒有特別為了精確結果而特別多下什麼工夫。(然而,未來或許會有。)" -#: ../../library/statistics.rst:219 +#: ../../library/statistics.rst:220 msgid "" "Return the harmonic mean of *data*, a sequence or iterable of real-valued " "numbers. If *weights* is omitted or *None*, then equal weighting is assumed." @@ -385,7 +385,7 @@ msgstr "" "回傳 *data* 的調和平均數。*data* 可為實數 (real-valued) sequence 或者 " "iterable。如果省略 *weights* 或者 *weights* 為 *None*,則假設各權重相等。" -#: ../../library/statistics.rst:223 +#: ../../library/statistics.rst:224 msgid "" "The harmonic mean is the reciprocal of the arithmetic :func:`mean` of the " "reciprocals of the data. For example, the harmonic mean of three values *a*, " @@ -396,7 +396,7 @@ msgstr "" "三個數 *a*,*b* 與 *c* 的調和平均數等於 ``3/(1/a + 1/b + 1/c)``。若其中一個值" "為零,結果將為零。" -#: ../../library/statistics.rst:228 +#: ../../library/statistics.rst:229 msgid "" "The harmonic mean is a type of average, a measure of the central location of " "the data. It is often appropriate when averaging ratios or rates, for " @@ -405,7 +405,7 @@ msgstr "" "調和平均數是一種平均數,是衡量資料中心位置的一種方法。它通常用於計算比率 " "(ratio) 或率 (rate) 的平均,例如速率(speed)。" -#: ../../library/statistics.rst:232 +#: ../../library/statistics.rst:233 msgid "" "Suppose a car travels 10 km at 40 km/hr, then another 10 km at 60 km/hr. " "What is the average speed?" @@ -413,7 +413,7 @@ msgstr "" "假設一輛汽車以時速 40 公里的速率行駛 10 公里,然後再以時速 60 公里的速率行駛 " "10 公里,求汽車的平均速率?" -#: ../../library/statistics.rst:240 +#: ../../library/statistics.rst:241 msgid "" "Suppose a car travels 40 km/hr for 5 km, and when traffic clears, speeds-up " "to 60 km/hr for the remaining 30 km of the journey. What is the average " @@ -422,7 +422,7 @@ msgstr "" "假設一輛汽車以時速 40 公里的速率行駛 5 公里,然後在交通順暢時,加速到時速 60 " "公里,以此速度行駛剩下的 30 公里。求汽車的平均速率?" -#: ../../library/statistics.rst:249 +#: ../../library/statistics.rst:250 msgid "" ":exc:`StatisticsError` is raised if *data* is empty, any element is less " "than zero, or if the weighted sum isn't positive." @@ -430,7 +430,7 @@ msgstr "" "若 *data* 為空、含有任何小於零的元素、或者加權總和不為正數,則引發 :exc:" "`StatisticsError`。" -#: ../../library/statistics.rst:252 +#: ../../library/statistics.rst:253 msgid "" "The current algorithm has an early-out when it encounters a zero in the " "input. This means that the subsequent inputs are not tested for validity. " @@ -439,7 +439,7 @@ msgstr "" "目前的演算法設計為,若在輸入當中遇到零,則會提前退出。這意味著後續的輸入並未" "進行有效性檢查。(這種行為在未來可能會改變。)" -#: ../../library/statistics.rst:263 +#: ../../library/statistics.rst:264 msgid "" "Return the median (middle value) of numeric data, using the common \"mean of " "middle two\" method. If *data* is empty, :exc:`StatisticsError` is raised. " @@ -448,7 +448,7 @@ msgstr "" "使用常見的「中間兩數取平均」方法回傳數值資料的中位數 (中間值)。若 *data* 為" "空,則會引發 :exc:`StatisticsError`。*data* 可為一個 sequence 或者 iterable。" -#: ../../library/statistics.rst:267 +#: ../../library/statistics.rst:268 msgid "" "The median is a robust measure of central location and is less affected by " "the presence of outliers. When the number of data points is odd, the middle " @@ -457,13 +457,13 @@ msgstr "" "中位數是一種穩健的衡量資料中心位置的方法,較不易被離群值影響。當資料點數量為" "奇數時,會回傳中間的資料點:" -#: ../../library/statistics.rst:276 +#: ../../library/statistics.rst:277 msgid "" "When the number of data points is even, the median is interpolated by taking " "the average of the two middle values:" msgstr "當資料點數量為偶數時,中位數透過中間兩個值的平均數來插值計算:" -#: ../../library/statistics.rst:284 +#: ../../library/statistics.rst:285 msgid "" "This is suited for when your data is discrete, and you don't mind that the " "median may not be an actual data point." @@ -471,7 +471,7 @@ msgstr "" "若你的資料為離散資料,並且你不介意中位數可能並非真實的資料點,那這函式適合" "你。" -#: ../../library/statistics.rst:287 +#: ../../library/statistics.rst:288 msgid "" "If the data is ordinal (supports order operations) but not numeric (doesn't " "support addition), consider using :func:`median_low` or :func:`median_high` " @@ -480,7 +480,7 @@ msgstr "" "若你的資料為順序 (ordinal) 資料(支援排序操作)但並非數值型(不支援加法),可" "以考慮改用 :func:`median_low` 或是 :func:`median_high` 代替。" -#: ../../library/statistics.rst:293 +#: ../../library/statistics.rst:294 msgid "" "Return the low median of numeric data. If *data* is empty, :exc:" "`StatisticsError` is raised. *data* can be a sequence or iterable." @@ -488,7 +488,7 @@ msgstr "" "回傳數值型資料的低中位數 (low median)。若 *data* 為空,則引發 :exc:" "`StatisticsError`。*data* 可為 sequence 或者 iterable。" -#: ../../library/statistics.rst:296 +#: ../../library/statistics.rst:297 msgid "" "The low median is always a member of the data set. When the number of data " "points is odd, the middle value is returned. When it is even, the smaller " @@ -497,7 +497,7 @@ msgstr "" "低中位數一定會在原本的資料集當中。當資料點數量為奇數時,回傳中間值。當數量為" "偶數時,回傳兩個中間值當中較小的值。" -#: ../../library/statistics.rst:307 +#: ../../library/statistics.rst:308 msgid "" "Use the low median when your data are discrete and you prefer the median to " "be an actual data point rather than interpolated." @@ -505,7 +505,7 @@ msgstr "" "當你的資料為離散資料,且你希望中位數是實際的資料點而不是插值時,可以用低中位" "數。" -#: ../../library/statistics.rst:313 +#: ../../library/statistics.rst:314 msgid "" "Return the high median of data. If *data* is empty, :exc:`StatisticsError` " "is raised. *data* can be a sequence or iterable." @@ -513,7 +513,7 @@ msgstr "" "回傳數值型資料的高中位數 (high median)。若 *data* 為空,則引發 :exc:" "`StatisticsError`。*data* 可為 sequence 或者 iterable。" -#: ../../library/statistics.rst:316 +#: ../../library/statistics.rst:317 msgid "" "The high median is always a member of the data set. When the number of data " "points is odd, the middle value is returned. When it is even, the larger of " @@ -522,7 +522,7 @@ msgstr "" "高中位數一定會在原本的資料集當中。當資料點數量為奇數時,回傳中間值。當數量為" "偶數時,回傳兩個中間值當中較大的值。" -#: ../../library/statistics.rst:327 +#: ../../library/statistics.rst:328 msgid "" "Use the high median when your data are discrete and you prefer the median to " "be an actual data point rather than interpolated." @@ -530,7 +530,7 @@ msgstr "" "當你的資料為離散資料,且你希望中位數是實際的資料點而不是插值時,可以用高中位" "數。" -#: ../../library/statistics.rst:333 +#: ../../library/statistics.rst:334 msgid "" "Return the median of grouped continuous data, calculated as the 50th " "percentile, using interpolation. If *data* is empty, :exc:`StatisticsError` " @@ -540,7 +540,7 @@ msgstr "" "為空,則會引發 :exc:`StatisticsError`。*data* 可為一個 sequence 或者 " "iterable。" -#: ../../library/statistics.rst:342 +#: ../../library/statistics.rst:343 msgid "" "In the following example, the data are rounded, so that each value " "represents the midpoint of data classes, e.g. 1 is the midpoint of the class " @@ -552,7 +552,7 @@ msgstr "" "0.5--1.5 的中點,2 是組 1.5--2.5 的中點,3 是組 2.5--3.5 的中點等。根據輸入的" "資料,中間值落在 3.5--4.5 的組別中,並使用內插法來估計它:" -#: ../../library/statistics.rst:353 +#: ../../library/statistics.rst:354 msgid "" "Optional argument *interval* represents the class interval, and defaults to " "1. Changing the class interval naturally will change the interpolation:" @@ -560,13 +560,13 @@ msgstr "" "選擇性引數 *interval* 表示組距 (class interval),預設值為 1。改變組距自然會改" "變內插值:" -#: ../../library/statistics.rst:363 +#: ../../library/statistics.rst:364 msgid "" "This function does not check whether the data points are at least *interval* " "apart." msgstr "此函式不檢查資料點是否至少間隔 *interval* 以上。" -#: ../../library/statistics.rst:368 +#: ../../library/statistics.rst:369 msgid "" "Under some circumstances, :func:`median_grouped` may coerce data points to " "floats. This behaviour is likely to change in the future." @@ -574,7 +574,7 @@ msgstr "" "在部份情況下,:func:`median_grouped` 可能會強制將資料點轉換為浮點數。這種行為" "在未來可能會改變。" -#: ../../library/statistics.rst:373 +#: ../../library/statistics.rst:374 msgid "" "\"Statistics for the Behavioral Sciences\", Frederick J Gravetter and Larry " "B Wallnau (8th Edition)." @@ -582,7 +582,7 @@ msgstr "" "\"Statistics for the Behavioral Sciences\", Frederick J Gravetter and Larry " "B Wallnau (8th Edition)." -#: ../../library/statistics.rst:376 +#: ../../library/statistics.rst:377 msgid "" "The `SSMEDIAN `_ function in the Gnome Gnumeric " @@ -593,7 +593,7 @@ msgstr "" "stable/gnumeric.html#gnumeric-function-SSMEDIAN>`_ 函式,包括\\ `這篇討論 " "`_。" -#: ../../library/statistics.rst:384 +#: ../../library/statistics.rst:385 msgid "" "Return the single most common data point from discrete or nominal *data*. " "The mode (when it exists) is the most typical value and serves as a measure " @@ -602,7 +602,7 @@ msgstr "" "回傳離散或名目 *data* 中出現次數最多次的值,只回傳一個。眾數(如果存在)是最" "典型的值,並用來衡量資料的中心位置。" -#: ../../library/statistics.rst:388 +#: ../../library/statistics.rst:389 msgid "" "If there are multiple modes with the same frequency, returns the first one " "encountered in the *data*. If the smallest or largest of those is desired " @@ -614,20 +614,20 @@ msgstr "" "``max(multimode(data))``。如果輸入的 *data* 為空,則會引發 :exc:" "`StatisticsError`。" -#: ../../library/statistics.rst:393 +#: ../../library/statistics.rst:394 msgid "" "``mode`` assumes discrete data and returns a single value. This is the " "standard treatment of the mode as commonly taught in schools:" msgstr "" "``mode`` 假定為離散資料,並回傳單一的值。這也是一般學校教授的標準眾數定義:" -#: ../../library/statistics.rst:401 +#: ../../library/statistics.rst:402 msgid "" "The mode is unique in that it is the only statistic in this package that " "also applies to nominal (non-numeric) data:" msgstr "眾數特別之處在於它是此套件中唯一也適用於名目(非數值型)資料的統計量:" -#: ../../library/statistics.rst:409 +#: ../../library/statistics.rst:410 msgid "" "Now handles multimodal datasets by returning the first mode encountered. " "Formerly, it raised :exc:`StatisticsError` when more than one mode was found." @@ -635,7 +635,7 @@ msgstr "" "現在,遇到資料中有多個眾數時,會回傳第一個遇到的眾數。在以前,當找到大於一個" "眾數時,會引發 :exc:`StatisticsError`。" -#: ../../library/statistics.rst:417 +#: ../../library/statistics.rst:418 msgid "" "Return a list of the most frequently occurring values in the order they were " "first encountered in the *data*. Will return more than one result if there " @@ -645,7 +645,7 @@ msgstr "" "次出現的順序排列。如果有多個眾數,將會回傳所有結果。若 *data* 為空,則回傳空" "的 list:" -#: ../../library/statistics.rst:433 +#: ../../library/statistics.rst:434 msgid "" "Return the population standard deviation (the square root of the population " "variance). See :func:`pvariance` for arguments and other details." @@ -653,7 +653,7 @@ msgstr "" "回傳母體標準差(即母體變異數的平方根)。有關引數以及其他細節,請參見 :func:" "`pvariance`。" -#: ../../library/statistics.rst:444 +#: ../../library/statistics.rst:445 msgid "" "Return the population variance of *data*, a non-empty sequence or iterable " "of real-valued numbers. Variance, or second moment about the mean, is a " @@ -665,7 +665,7 @@ msgstr "" "數,或者以平均數為中心的二階動差,用於衡量資料的變異性(離度或分散程度)。變" "異數大表示資料分散,變異數小表示資料集中在平均數附近。" -#: ../../library/statistics.rst:450 +#: ../../library/statistics.rst:451 msgid "" "If the optional second argument *mu* is given, it is typically the mean of " "the *data*. It can also be used to compute the second moment around a point " @@ -676,7 +676,7 @@ msgstr "" "算非以平均值為中心的第二動差。如果沒有傳入此引數或者引數為 `None` (預設" "值),則自動計算資料的算數平均數。" -#: ../../library/statistics.rst:455 +#: ../../library/statistics.rst:456 msgid "" "Use this function to calculate the variance from the entire population. To " "estimate the variance from a sample, the :func:`variance` function is " @@ -685,16 +685,16 @@ msgstr "" "使用此函式來計算整個母體的變異數。如果要從樣本估算變異數,:func:`variance` 通" "常是較好的選擇。" -#: ../../library/statistics.rst:459 +#: ../../library/statistics.rst:460 msgid "Raises :exc:`StatisticsError` if *data* is empty." msgstr "若 *data* 為空,則引發 :exc:`StatisticsError`。" -#: ../../library/statistics.rst:461 ../../library/statistics.rst:531 -#: ../../library/statistics.rst:635 +#: ../../library/statistics.rst:462 ../../library/statistics.rst:532 +#: ../../library/statistics.rst:636 msgid "Examples:" msgstr "範例:" -#: ../../library/statistics.rst:469 +#: ../../library/statistics.rst:470 msgid "" "If you have already calculated the mean of your data, you can pass it as the " "optional second argument *mu* to avoid recalculation:" @@ -702,11 +702,11 @@ msgstr "" "如果已經計算出資料的平均值,你可以將其作為選擇性的第二個引數 *mu* 傳遞以避免" "重新計算:" -#: ../../library/statistics.rst:478 +#: ../../library/statistics.rst:479 msgid "Decimals and Fractions are supported:" msgstr "支援小數 (decimal) 與分數 (fraction):" -#: ../../library/statistics.rst:492 +#: ../../library/statistics.rst:493 msgid "" "When called with the entire population, this gives the population variance " "σ². When called on a sample instead, this is the biased sample variance s², " @@ -715,7 +715,7 @@ msgstr "" "當在整個母體上呼叫此函式時,會回傳母體變異數 σ²。當在樣本上呼叫此函式時,會回" "傳有偏差的樣本變異數 s²,也就是具有 N 個自由度的變異數。" -#: ../../library/statistics.rst:496 +#: ../../library/statistics.rst:497 msgid "" "If you somehow know the true population mean μ, you may use this function to " "calculate the variance of a sample, giving the known population mean as the " @@ -727,7 +727,7 @@ msgstr "" "引數提供給此函式,用以計算樣本的變異數。只要資料點是母體的隨機樣本,結果將是" "母體變異數的不偏估計。" -#: ../../library/statistics.rst:505 +#: ../../library/statistics.rst:506 msgid "" "Return the sample standard deviation (the square root of the sample " "variance). See :func:`variance` for arguments and other details." @@ -735,7 +735,7 @@ msgstr "" "回傳樣本標準差(即樣本變異數的平方根)。有關引數以及其他細節,請參見 :func:" "`variance`。" -#: ../../library/statistics.rst:516 +#: ../../library/statistics.rst:517 msgid "" "Return the sample variance of *data*, an iterable of at least two real-" "valued numbers. Variance, or second moment about the mean, is a measure of " @@ -747,7 +747,7 @@ msgstr "" "平均數為中心的二階動差,用於衡量資料的變異性(離度或分散程度)。變異數大表示" "資料分散,變異數小表示資料集中在平均數附近。" -#: ../../library/statistics.rst:522 +#: ../../library/statistics.rst:523 msgid "" "If the optional second argument *xbar* is given, it should be the mean of " "*data*. If it is missing or ``None`` (the default), the mean is " @@ -756,7 +756,7 @@ msgstr "" "若有傳入選擇性的第二個引數 *xbar*,它應該是 *data* 的平均值。如果沒有傳入或者" "為 ``None`` (預設值),則自動計算資料的平均值。" -#: ../../library/statistics.rst:526 +#: ../../library/statistics.rst:527 msgid "" "Use this function when your data is a sample from a population. To calculate " "the variance from the entire population, see :func:`pvariance`." @@ -764,11 +764,11 @@ msgstr "" "當你的資料是來自母體的樣本時,請使用此函式。若要從整個母體計算變異數,請參" "見 :func:`pvariance`。" -#: ../../library/statistics.rst:529 +#: ../../library/statistics.rst:530 msgid "Raises :exc:`StatisticsError` if *data* has fewer than two values." msgstr "若 *data* 內少於兩個值,則引發 :exc:`StatisticsError`。" -#: ../../library/statistics.rst:539 +#: ../../library/statistics.rst:540 msgid "" "If you have already calculated the mean of your data, you can pass it as the " "optional second argument *xbar* to avoid recalculation:" @@ -776,7 +776,7 @@ msgstr "" "如果已經計算出資料的平均值,你可以將其作為選擇性的第二個引數 *mu* 傳遞以避免" "重新計算:" -#: ../../library/statistics.rst:548 +#: ../../library/statistics.rst:549 msgid "" "This function does not attempt to verify that you have passed the actual " "mean as *xbar*. Using arbitrary values for *xbar* can lead to invalid or " @@ -785,11 +785,11 @@ msgstr "" "此函式不會驗證你傳入的 *xbar* 是否為實際的平均數。傳入任意的 *xbar* 會導致無" "效或不可能的結果。" -#: ../../library/statistics.rst:552 +#: ../../library/statistics.rst:553 msgid "Decimal and Fraction values are supported:" msgstr "支援小數 (decimal) 與分數 (fraction):" -#: ../../library/statistics.rst:566 +#: ../../library/statistics.rst:567 msgid "" "This is the sample variance s² with Bessel's correction, also known as " "variance with N-1 degrees of freedom. Provided that the data points are " @@ -800,7 +800,7 @@ msgstr "" "為 N-1 的變異數。只要資料點具有代表性(例如:獨立且具有相同分布),結果應該會" "是對真實母體變異數的不偏估計。" -#: ../../library/statistics.rst:571 +#: ../../library/statistics.rst:572 msgid "" "If you somehow know the actual population mean μ you should pass it to the :" "func:`pvariance` function as the *mu* parameter to get the variance of a " @@ -809,7 +809,7 @@ msgstr "" "若你剛好知道真正的母體平均數 μ,你應該將其作為 *mu* 參數傳入 :func:" "`pvariance` 函式來計算樣本變異數。" -#: ../../library/statistics.rst:577 +#: ../../library/statistics.rst:578 msgid "" "Divide *data* into *n* continuous intervals with equal probability. Returns " "a list of ``n - 1`` cut points separating the intervals." @@ -817,7 +817,7 @@ msgstr "" "將 *data* 分成 *n* 個具有相等機率的連續區間。回傳一個包含 ``n - 1`` 個用於切" "分各區間的分隔點的 list。" -#: ../../library/statistics.rst:580 +#: ../../library/statistics.rst:581 msgid "" "Set *n* to 4 for quartiles (the default). Set *n* to 10 for deciles. Set " "*n* to 100 for percentiles which gives the 99 cuts points that separate " @@ -828,7 +828,7 @@ msgstr "" "分位數 (percentile),這將給出 99 個分隔點將 *data* 分成 100 個大小相等的組。" "如果 *n* 不是至少為 1,則引發 :exc:`StatisticsError`。" -#: ../../library/statistics.rst:585 +#: ../../library/statistics.rst:586 msgid "" "The *data* can be any iterable containing sample data. For meaningful " "results, the number of data points in *data* should be larger than *n*. " @@ -837,7 +837,7 @@ msgstr "" "*data* 可以是包含樣本資料的任何 iterable。為了取得有意義的結果,*data* 中的資" "料點數量應大於 *n*。如果資料點少於兩個,則引發 :exc:`StatisticsError`。" -#: ../../library/statistics.rst:589 +#: ../../library/statistics.rst:590 msgid "" "The cut points are linearly interpolated from the two nearest data points. " "For example, if a cut point falls one-third of the distance between two " @@ -846,7 +846,7 @@ msgstr "" "分隔點是從兩個最近的資料點線性內插值計算出來的。舉例來說,如果分隔點落在兩個" "樣本值 ``100`` 與 ``112`` 之間的距離三分之一處,則分隔點的值將為 ``104``。" -#: ../../library/statistics.rst:594 +#: ../../library/statistics.rst:595 msgid "" "The *method* for computing quantiles can be varied depending on whether the " "*data* includes or excludes the lowest and highest possible values from the " @@ -855,7 +855,7 @@ msgstr "" "計算分位數的 *method* 可以根據 *data* 是否包含或排除來自母體的最小與最大可能" "的值而改變。" -#: ../../library/statistics.rst:598 +#: ../../library/statistics.rst:599 msgid "" "The default *method* is \"exclusive\" and is used for data sampled from a " "population that can have more extreme values than found in the samples. The " @@ -869,7 +869,7 @@ msgstr "" "1)``。給定九個樣本資料,此方法將對資料排序且計算下列百分位數:10%、20%、30%、" "40%、50%、60%、70%、80%、90%。" -#: ../../library/statistics.rst:605 +#: ../../library/statistics.rst:606 msgid "" "Setting the *method* to \"inclusive\" is used for describing population data " "or for samples that are known to include the most extreme values from the " @@ -886,7 +886,7 @@ msgstr "" "給定十一個個樣本資料,此方法將對資料排序且計算下列百分位數:0%、10%、20%、" "30%、40%、50%、60%、70%、80%、90%、100%。" -#: ../../library/statistics.rst:629 +#: ../../library/statistics.rst:630 msgid "" "Return the sample covariance of two inputs *x* and *y*. Covariance is a " "measure of the joint variability of two inputs." @@ -894,14 +894,14 @@ msgstr "" "回傳兩輸入 *x* 與 *y* 的樣本共變異數 (sample covariance)。共變異數是衡量兩輸" "入的聯合變異性 (joint variability) 的指標。" -#: ../../library/statistics.rst:632 +#: ../../library/statistics.rst:633 msgid "" "Both inputs must be of the same length (no less than two), otherwise :exc:" "`StatisticsError` is raised." msgstr "" "兩輸入必須具有相同長度(至少兩個),否則會引發 :exc:`StatisticsError`。" -#: ../../library/statistics.rst:653 +#: ../../library/statistics.rst:654 msgid "" "Return the `Pearson's correlation coefficient `_ for two inputs. Pearson's correlation " @@ -912,7 +912,7 @@ msgstr "" "en.wikipedia.org/wiki/Pearson_correlation_coefficient>`_。Pearson 相關係數 " "*r* 的值介於 -1 與 +1 之間。它衡量線性關係的強度與方向。" -#: ../../library/statistics.rst:659 +#: ../../library/statistics.rst:660 msgid "" "If *method* is \"ranked\", computes `Spearman's rank correlation coefficient " "`_ " @@ -926,7 +926,7 @@ msgstr "" "則取平均,令相同的值排名也相同。所得係數衡量單調關係 (monotonic " "relationship) 的強度。" -#: ../../library/statistics.rst:665 +#: ../../library/statistics.rst:666 msgid "" "Spearman's correlation coefficient is appropriate for ordinal data or for " "continuous data that doesn't meet the linear proportion requirement for " @@ -935,7 +935,7 @@ msgstr "" "Spearman 相關係數適用於順序型資料,或者不符合 Pearson 相關係數要求的線性比例" "關係的連續型 (continuous) 資料。" -#: ../../library/statistics.rst:669 +#: ../../library/statistics.rst:670 msgid "" "Both inputs must be of the same length (no less than two), and need not to " "be constant, otherwise :exc:`StatisticsError` is raised." @@ -943,7 +943,7 @@ msgstr "" "兩輸入必須具有相同長度(至少兩個),且不須為常數,否則會引發 :exc:" "`StatisticsError`。" -#: ../../library/statistics.rst:672 +#: ../../library/statistics.rst:673 msgid "" "Example with `Kepler's laws of planetary motion `_:" @@ -951,11 +951,11 @@ msgstr "" "以 `Kepler 行星運動定律 `_\\ 為例:" -#: ../../library/statistics.rst:699 +#: ../../library/statistics.rst:700 msgid "Added support for Spearman's rank correlation coefficient." msgstr "新增了對 Spearman 等級相關係數的支援。" -#: ../../library/statistics.rst:704 +#: ../../library/statistics.rst:705 msgid "" "Return the slope and intercept of `simple linear regression `_ parameters estimated using " @@ -969,11 +969,11 @@ msgstr "" "迴歸描述自變數 (independent variable) *x* 與應變數 (dependent variable) *y* " "之間的關係,用以下的線性函式表示:" -#: ../../library/statistics.rst:710 +#: ../../library/statistics.rst:711 msgid "*y = slope \\* x + intercept + noise*" msgstr "*y = slope \\* x + intercept + noise*" -#: ../../library/statistics.rst:712 +#: ../../library/statistics.rst:713 msgid "" "where ``slope`` and ``intercept`` are the regression parameters that are " "estimated, and ``noise`` represents the variability of the data that was not " @@ -983,7 +983,7 @@ msgstr "" "其中 ``slope`` 和 ``intercept`` 是被估計的迴歸參數,而 ``noise`` 表示由線性迴" "歸未解釋的資料變異性(它等於應變數的預測值與實際值之差)。" -#: ../../library/statistics.rst:718 +#: ../../library/statistics.rst:719 msgid "" "Both inputs must be of the same length (no less than two), and the " "independent variable *x* cannot be constant; otherwise a :exc:" @@ -992,7 +992,7 @@ msgstr "" "兩輸入必須具有相同長度(至少兩個),且自變數 *x* 不得為常數,否則會引發 :exc:" "`StatisticsError`。" -#: ../../library/statistics.rst:722 +#: ../../library/statistics.rst:723 msgid "" "For example, we can use the `release dates of the Monty Python films " "`_ to predict the " @@ -1003,7 +1003,7 @@ msgstr "" "wikipedia.org/wiki/Monty_Python#Films>`_\\ 來預測至 2019 年為止,假設他們保持" "固定的製作速度,應該會產生的 Monty Python 電影的累計數量。" -#: ../../library/statistics.rst:736 +#: ../../library/statistics.rst:737 msgid "" "If *proportional* is true, the independent variable *x* and the dependent " "variable *y* are assumed to be directly proportional. The data is fit to a " @@ -1014,31 +1014,38 @@ msgstr "" "資料座落在通過原點的一直線上。由於 *intercept* 始終為 0.0,因此線性函式可簡化" "如下:" -#: ../../library/statistics.rst:742 +#: ../../library/statistics.rst:743 msgid "*y = slope \\* x + noise*" msgstr "*y = slope \\* x + noise*" -#: ../../library/statistics.rst:746 +#: ../../library/statistics.rst:745 +msgid "" +"Continuing the example from :func:`correlation`, we look to see how well a " +"model based on major planets can predict the orbital distances for dwarf " +"planets:" +msgstr "" + +#: ../../library/statistics.rst:765 msgid "Added support for *proportional*." msgstr "新增 *proportional* 的支援。" -#: ../../library/statistics.rst:750 +#: ../../library/statistics.rst:769 msgid "Exceptions" msgstr "例外" -#: ../../library/statistics.rst:752 +#: ../../library/statistics.rst:771 msgid "A single exception is defined:" msgstr "定義了一個單一的例外:" -#: ../../library/statistics.rst:756 +#: ../../library/statistics.rst:775 msgid "Subclass of :exc:`ValueError` for statistics-related exceptions." msgstr ":exc:`ValueError` 的子類別,用於和統計相關的例外。" -#: ../../library/statistics.rst:760 +#: ../../library/statistics.rst:779 msgid ":class:`NormalDist` objects" msgstr ":class:`NormalDist` 物件" -#: ../../library/statistics.rst:762 +#: ../../library/statistics.rst:781 msgid "" ":class:`NormalDist` is a tool for creating and manipulating normal " "distributions of a `random variable `_ 的常態分布的工" "具。它是一個將量測資料的平均數與標準差視為單一實體的類別。" -#: ../../library/statistics.rst:768 +#: ../../library/statistics.rst:787 msgid "" "Normal distributions arise from the `Central Limit Theorem `_ and have a wide range of " @@ -1058,7 +1065,7 @@ msgstr "" "常態分布源自於\\ `中央極限定理 (Central Limit Theorem) `_,在統計學中有著廣泛的應用。" -#: ../../library/statistics.rst:774 +#: ../../library/statistics.rst:793 msgid "" "Returns a new *NormalDist* object where *mu* represents the `arithmetic mean " "`_ and *sigma* represents the " @@ -1068,11 +1075,11 @@ msgstr "" "en.wikipedia.org/wiki/Arithmetic_mean>`_\\ 而 *sigma* 代表\\ `標準差 " "`_。" -#: ../../library/statistics.rst:779 +#: ../../library/statistics.rst:798 msgid "If *sigma* is negative, raises :exc:`StatisticsError`." msgstr "若 *sigma* 為負值,則引發 :exc:`StatisticsError`。" -#: ../../library/statistics.rst:783 +#: ../../library/statistics.rst:802 msgid "" "A read-only property for the `arithmetic mean `_ of a normal distribution." @@ -1080,14 +1087,14 @@ msgstr "" "常態分布中的\\ `算數平均數 `_\\ 唯讀屬性。" -#: ../../library/statistics.rst:789 +#: ../../library/statistics.rst:808 msgid "" "A read-only property for the `median `_ of a normal distribution." msgstr "" "常態分布中的\\ `中位數 `_\\ 唯讀屬性。" -#: ../../library/statistics.rst:795 +#: ../../library/statistics.rst:814 msgid "" "A read-only property for the `mode `_ of a normal distribution." @@ -1095,7 +1102,7 @@ msgstr "" "常態分布中的\\ `眾數 `_\\ 唯" "讀屬性。" -#: ../../library/statistics.rst:801 +#: ../../library/statistics.rst:820 msgid "" "A read-only property for the `standard deviation `_ of a normal distribution." @@ -1103,7 +1110,7 @@ msgstr "" "常態分布中的\\ `標準差 `_\\ 唯讀屬性。" -#: ../../library/statistics.rst:807 +#: ../../library/statistics.rst:826 msgid "" "A read-only property for the `variance `_ of a normal distribution. Equal to the square of the standard " @@ -1112,7 +1119,7 @@ msgstr "" "常態分布中的\\ `變異數 `_\\ 唯讀屬" "性。" -#: ../../library/statistics.rst:813 +#: ../../library/statistics.rst:832 msgid "" "Makes a normal distribution instance with *mu* and *sigma* parameters " "estimated from the *data* using :func:`fmean` and :func:`stdev`." @@ -1120,7 +1127,7 @@ msgstr "" "利用 :func:`fmean` 與 :func:`stdev` 函式,估計 *data* 的 *mu* 與 *sigma* 參" "數,建立一個常態分布的實例。" -#: ../../library/statistics.rst:816 +#: ../../library/statistics.rst:835 msgid "" "The *data* can be any :term:`iterable` and should consist of values that can " "be converted to type :class:`float`. If *data* does not contain at least " @@ -1132,7 +1139,7 @@ msgstr "" "若 *data* 沒有包含至少兩個以上的元素在內,則引發 :exc:`StatisticsError`,因為" "至少需要一個點來估計中央值且至少需要兩個點來估計分散情形。" -#: ../../library/statistics.rst:824 +#: ../../library/statistics.rst:843 msgid "" "Generates *n* random samples for a given mean and standard deviation. " "Returns a :class:`list` of :class:`float` values." @@ -1140,7 +1147,7 @@ msgstr "" "給定平均值與標準差,產生 *n* 個隨機樣本。回傳一個由 :class:`float` 組成的 :" "class:`list`。" -#: ../../library/statistics.rst:827 +#: ../../library/statistics.rst:846 msgid "" "If *seed* is given, creates a new instance of the underlying random number " "generator. This is useful for creating reproducible results, even in a " @@ -1149,7 +1156,7 @@ msgstr "" "若有給定 *seed*,則會建立一個以此為基礎的亂數產生器實例。這對於建立可重現的結" "果很有幫助,即使在多執行緒情境下也是如此。" -#: ../../library/statistics.rst:833 +#: ../../library/statistics.rst:852 msgid "" "Using a `probability density function (pdf) `_, compute the relative likelihood that a " @@ -1161,7 +1168,7 @@ msgstr "" "值 *x* 的相對概度 (relative likelihood)。數學上,它是比率 ``P(x <= X < " "x+dx) / dx`` 在 *dx* 趨近於零時的極限值。" -#: ../../library/statistics.rst:839 +#: ../../library/statistics.rst:858 msgid "" "The relative likelihood is computed as the probability of a sample occurring " "in a narrow range divided by the width of the range (hence the word " @@ -1171,7 +1178,7 @@ msgstr "" "相對概度是樣本出現在狹窄範圍的機率,除以該範圍的寬度(故稱為「密度」)計算而" "得。由於概度是相對於其它點,故其值可大於 ``1.0``。" -#: ../../library/statistics.rst:846 +#: ../../library/statistics.rst:865 msgid "" "Using a `cumulative distribution function (cdf) `_, compute the probability that a " @@ -1182,7 +1189,7 @@ msgstr "" "wikipedia.org/wiki/Cumulative_distribution_function>`_ 計算隨機變數 *X* 小於" "或等於 *x* 的機率。數學上,它記為 ``P(X <= x)``。" -#: ../../library/statistics.rst:853 +#: ../../library/statistics.rst:872 msgid "" "Compute the inverse cumulative distribution function, also known as the " "`quantile function `_ or " @@ -1196,7 +1203,7 @@ msgstr "" "org/web/20190203145224/https://www.statisticshowto.datasciencecentral.com/" "inverse-distribution-function/>`_ 函式。數學上記為 ``x : P(X <= x) = p``。" -#: ../../library/statistics.rst:859 +#: ../../library/statistics.rst:878 msgid "" "Finds the value *x* of the random variable *X* such that the probability of " "the variable being less than or equal to that value equals the given " @@ -1204,7 +1211,7 @@ msgid "" msgstr "" "找出一個值 *x*,使得隨機變數 *X* 小於或等於該值的機率等於給定的機率 *p*。" -#: ../../library/statistics.rst:865 +#: ../../library/statistics.rst:884 msgid "" "Measures the agreement between two normal probability distributions. Returns " "a value between 0.0 and 1.0 giving `the overlapping area for the two " @@ -1213,7 +1220,7 @@ msgstr "" "衡量兩常態分布之間的一致性。回傳一個介於 0.0 與 1.0 之間的值,表示\\ `兩機率" "密度函式的重疊區域 `_。" -#: ../../library/statistics.rst:872 +#: ../../library/statistics.rst:891 msgid "" "Divide the normal distribution into *n* continuous intervals with equal " "probability. Returns a list of (n - 1) cut points separating the intervals." @@ -1221,7 +1228,7 @@ msgstr "" "將常態分布分割成 *n* 個具有相等機率的連續區間。回傳一個 list,包含 (n-1) 個切" "割區間的分隔點。" -#: ../../library/statistics.rst:876 +#: ../../library/statistics.rst:895 msgid "" "Set *n* to 4 for quartiles (the default). Set *n* to 10 for deciles. Set " "*n* to 100 for percentiles which gives the 99 cuts points that separate the " @@ -1231,7 +1238,7 @@ msgstr "" "*n* 設定為 100 表示百分位數,這會產生 99 個分隔點,將常態分布切割成大小相等的" "群組。" -#: ../../library/statistics.rst:882 +#: ../../library/statistics.rst:901 msgid "" "Compute the `Standard Score `_ describing *x* in terms of the number of standard " @@ -1242,7 +1249,7 @@ msgstr "" "probability-and-statistics/z-score/>`_,用以描述在常態分布中,*x* 高出或低於" "平均數幾個標準差:``(x - mean) / stdev``。" -#: ../../library/statistics.rst:890 +#: ../../library/statistics.rst:909 msgid "" "Instances of :class:`NormalDist` support addition, subtraction, " "multiplication and division by a constant. These operations are used for " @@ -1251,14 +1258,14 @@ msgstr "" ":class:`NormalDist` 的實例支援對常數的加法、減法、乘法與除法。這些操作用於平" "移與縮放。例如:" -#: ../../library/statistics.rst:900 +#: ../../library/statistics.rst:919 msgid "" "Dividing a constant by an instance of :class:`NormalDist` is not supported " "because the result wouldn't be normally distributed." msgstr "" "不支援將常數除以 :class:`NormalDist` 的實例,因為結果將不符合常態分布。" -#: ../../library/statistics.rst:903 +#: ../../library/statistics.rst:922 msgid "" "Since normal distributions arise from additive effects of independent " "variables, it is possible to `add and subtract two independent normally " @@ -1271,19 +1278,19 @@ msgstr "" "Sum_of_normally_distributed_random_variables>`_,並且表示為 :class:" "`NormalDist` 的實例。例如:" -#: ../../library/statistics.rst:923 +#: ../../library/statistics.rst:942 msgid ":class:`NormalDist` Examples and Recipes" msgstr ":class:`NormalDist` 範例與錦囊妙計" -#: ../../library/statistics.rst:927 +#: ../../library/statistics.rst:946 msgid "Classic probability problems" msgstr "經典機率問題" -#: ../../library/statistics.rst:929 +#: ../../library/statistics.rst:948 msgid ":class:`NormalDist` readily solves classic probability problems." msgstr ":class:`NormalDist` 可以輕易地解決經典的機率問題。" -#: ../../library/statistics.rst:931 +#: ../../library/statistics.rst:950 msgid "" "For example, given `historical data for SAT exams `_ showing that scores are " @@ -1295,7 +1302,7 @@ msgstr "" "tables/dt17_226.40.asp>`_,顯示成績為平均 1060、標準差 195 的常態分布。我們要" "求出分數在 1100 與 1200 之間(四捨五入至最接近的整數)的學生的百分比:" -#: ../../library/statistics.rst:944 +#: ../../library/statistics.rst:963 msgid "" "Find the `quartiles `_ and `deciles " "`_ for the SAT scores:" @@ -1303,11 +1310,11 @@ msgstr "" "找出 SAT 分數的\\ `四分位數 `_\\ 以及" "\\ `十分位數 `_:" -#: ../../library/statistics.rst:956 +#: ../../library/statistics.rst:975 msgid "Monte Carlo inputs for simulations" msgstr "用於模擬的蒙地卡羅 (Monte Carlo) 輸入" -#: ../../library/statistics.rst:958 +#: ../../library/statistics.rst:977 msgid "" "To estimate the distribution for a model than isn't easy to solve " "analytically, :class:`NormalDist` can generate input samples for a `Monte " @@ -1317,11 +1324,11 @@ msgstr "" "樣本以進行\\ `蒙地卡羅模擬 `_:" -#: ../../library/statistics.rst:975 +#: ../../library/statistics.rst:994 msgid "Approximating binomial distributions" msgstr "近似二項分布" -#: ../../library/statistics.rst:977 +#: ../../library/statistics.rst:996 msgid "" "Normal distributions can be used to approximate `Binomial distributions " "`_ when the sample " @@ -1331,7 +1338,7 @@ msgstr "" "(Binomial distributions) `_。" -#: ../../library/statistics.rst:982 +#: ../../library/statistics.rst:1001 msgid "" "For example, an open source conference has 750 attendees and two rooms with " "a 500 person capacity. There is a talk about Python and another about Ruby. " @@ -1344,15 +1351,15 @@ msgstr "" "向參與 Python 講座。假設參與者的偏好沒有改變,那麼 Python 會議室未超過自身容" "量限制的機率是?" -#: ../../library/statistics.rst:1016 +#: ../../library/statistics.rst:1035 msgid "Naive bayesian classifier" msgstr "單純貝氏分類器 (Naive bayesian classifier)" -#: ../../library/statistics.rst:1018 +#: ../../library/statistics.rst:1037 msgid "Normal distributions commonly arise in machine learning problems." msgstr "常態分布常在機器學習問題中出現。" -#: ../../library/statistics.rst:1020 +#: ../../library/statistics.rst:1039 msgid "" "Wikipedia has a `nice example of a Naive Bayesian Classifier `_. The " @@ -1363,7 +1370,7 @@ msgstr "" "wiki/Naive_Bayes_classifier#Person_classification>`_。課題為從身高、體重與鞋" "子尺寸等符合常態分布的特徵量測值中判斷一個人的性別。" -#: ../../library/statistics.rst:1025 +#: ../../library/statistics.rst:1044 msgid "" "We're given a training dataset with measurements for eight people. The " "measurements are assumed to be normally distributed, so we summarize the " @@ -1372,13 +1379,13 @@ msgstr "" "給定一組包含八個人的量測值的訓練資料集。假設這些量測值服從常態分布,我們可以" "利用 :class:`NormalDist` 來總結資料:" -#: ../../library/statistics.rst:1038 +#: ../../library/statistics.rst:1057 msgid "" "Next, we encounter a new person whose feature measurements are known but " "whose gender is unknown:" msgstr "接著,我們遇到一個新的人,他的特徵量測值已知,但性別未知:" -#: ../../library/statistics.rst:1047 +#: ../../library/statistics.rst:1066 msgid "" "Starting with a 50% `prior probability `_ of being male or female, we compute the posterior as " @@ -1389,7 +1396,7 @@ msgstr "" "org/wiki/Prior_probability>`_ 為開端,我們將後驗機率 (posterior probability) " "計算為先驗機率乘以給定性別下,各特徵量測值的概度乘積:" -#: ../../library/statistics.rst:1062 +#: ../../library/statistics.rst:1081 msgid "" "The final prediction goes to the largest posterior. This is known as the " "`maximum a posteriori `_ 或者 MAP:" -#: ../../library/statistics.rst:1073 +#: ../../library/statistics.rst:1092 msgid "Kernel density estimation" msgstr "核密度估計 (Kernel density estimation)" -#: ../../library/statistics.rst:1075 +#: ../../library/statistics.rst:1094 msgid "" "It is possible to estimate a continuous probability density function from a " "fixed number of discrete samples." msgstr "可以從固定數量的離散樣本估計出連續機率密度函式。" -#: ../../library/statistics.rst:1078 +#: ../../library/statistics.rst:1097 msgid "" "The basic idea is to smooth the data using `a kernel function such as a " "normal distribution, triangular distribution, or uniform distribution " @@ -1422,7 +1429,7 @@ msgstr "" "wikipedia.org/wiki/Kernel_(statistics)#Kernel_functions_in_common_use>`_\\ 來" "使資料更加平滑。平滑程度由單個參數 ``h`` 控制,代表核函數的變異數。" -#: ../../library/statistics.rst:1097 +#: ../../library/statistics.rst:1116 msgid "" "`Wikipedia has an example `_ where we can use the ``kde_normal()`` " @@ -1433,7 +1440,7 @@ msgstr "" "Kernel_density_estimation#Example>`_,我們可以使用 ``kde_normal()`` 這個錦囊" "妙計來生成並繪製從小樣本估計的機率密度函式:" -#: ../../library/statistics.rst:1109 +#: ../../library/statistics.rst:1128 msgid "The points in ``xarr`` and ``yarr`` can be used to make a PDF plot:" msgstr "``xarr`` 和 ``yarr`` 中的點可用於繪製 PDF 圖:" diff --git a/library/symtable.po b/library/symtable.po index a1da8da3f2..deb26241d8 100644 --- a/library/symtable.po +++ b/library/symtable.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -63,37 +63,56 @@ msgstr "" #: ../../library/symtable.rst:40 msgid "" "Return the type of the symbol table. Possible values are ``'class'``, " -"``'module'``, and ``'function'``." +"``'module'``, ``'function'``, ``'annotation'``, ``'TypeVar bound'``, ``'type " +"alias'``, and ``'type parameter'``. The latter four refer to different " +"flavors of :ref:`annotation scopes `." msgstr "" -"回傳符號表的種類。可能的值為 ``'class'``、``'module'`` 和 ``'function'``。" +"回傳符號表的種類。可能的值為 ``'class'``、``'module'``、``'function'``、" +"``'annotation'``、``'TypeVar bound'``、``'type alias'`` 和 ``'type " +"parameter'``。後四個是指不同的\\ :ref:`註釋範圍 (annotation scopes) " +"`。" #: ../../library/symtable.rst:45 +msgid "" +"Added ``'annotation'``, ``'TypeVar bound'``, ``'type alias'``, and ``'type " +"parameter'`` as possible return values." +msgstr "" +"新增了 ``'annotation'``、``'TypeVar bound'``、``'type alias'`` 和 ``'type " +"parameter'`` 作為可能的回傳值。" + +#: ../../library/symtable.rst:51 msgid "Return the table's identifier." msgstr "回傳表的識別器。" -#: ../../library/symtable.rst:49 +#: ../../library/symtable.rst:55 msgid "" "Return the table's name. This is the name of the class if the table is for " "a class, the name of the function if the table is for a function, or " -"``'top'`` if the table is global (:meth:`get_type` returns ``'module'``)." +"``'top'`` if the table is global (:meth:`get_type` returns ``'module'``). " +"For type parameter scopes (which are used for generic classes, functions, " +"and type aliases), it is the name of the underlying class, function, or type " +"alias. For type alias scopes, it is the name of the type alias. For :class:" +"`~typing.TypeVar` bound scopes, it is the name of the ``TypeVar``." msgstr "" "回傳表的名稱。如果表用於類別,則這是類別的名稱;如果表用於函式,則這是函式的" "名稱;如果表是全域的,則為 ``'top'`` (:meth:`get_type` 會回傳 " -"``'module'``)。" +"``'module'``)。對於型別參數作用域(用於泛型類別、函式和型別別名),它是底層" +"類別、函式或型別別名的名稱。對於型別別名作用域,它是型別別名的名稱。對於 :" +"class:`~typing.TypeVar` 綁定範圍,它會是 ``TypeVar`` 的名稱。" -#: ../../library/symtable.rst:55 +#: ../../library/symtable.rst:65 msgid "Return the number of the first line in the block this table represents." msgstr "回傳此表所代表的區塊中第一行的編號。" -#: ../../library/symtable.rst:59 +#: ../../library/symtable.rst:69 msgid "Return ``True`` if the locals in this table can be optimized." msgstr "如果可以最佳化該表中的區域變數,則回傳 ``True``。" -#: ../../library/symtable.rst:63 +#: ../../library/symtable.rst:73 msgid "Return ``True`` if the block is a nested class or function." msgstr "如果區塊是巢狀類別或函式,則回傳 ``True``。" -#: ../../library/symtable.rst:67 +#: ../../library/symtable.rst:77 msgid "" "Return ``True`` if the block has nested namespaces within it. These can be " "obtained with :meth:`get_children`." @@ -101,7 +120,7 @@ msgstr "" "如果區塊內有巢狀命名空間,則回傳 ``True``。這些可以通過 :meth:`get_children` " "獲得。" -#: ../../library/symtable.rst:72 +#: ../../library/symtable.rst:82 msgid "" "Return a view object containing the names of symbols in the table. See the :" "ref:`documentation of view objects `." @@ -109,97 +128,97 @@ msgstr "" "回傳包含表中符號之名稱的視圖物件 (view object)。請參閱\\ :ref:`視圖物件的文" "件 `。" -#: ../../library/symtable.rst:77 +#: ../../library/symtable.rst:87 msgid "Lookup *name* in the table and return a :class:`Symbol` instance." msgstr "在表中查找 *name* 並回傳一個 :class:`Symbol` 實例。" -#: ../../library/symtable.rst:81 +#: ../../library/symtable.rst:91 msgid "Return a list of :class:`Symbol` instances for names in the table." msgstr "回傳表中名稱的 :class:`Symbol` 實例串列。" -#: ../../library/symtable.rst:85 +#: ../../library/symtable.rst:95 msgid "Return a list of the nested symbol tables." msgstr "回傳巢狀符號表的串列。" -#: ../../library/symtable.rst:90 +#: ../../library/symtable.rst:100 msgid "" "A namespace for a function or method. This class inherits :class:" "`SymbolTable`." msgstr "一個函式或方法的命名空間。該類別繼承自 :class:`SymbolTable`。" -#: ../../library/symtable.rst:95 +#: ../../library/symtable.rst:105 msgid "Return a tuple containing names of parameters to this function." msgstr "回傳一個包含此函式參數名稱的元組 (tuple)。" -#: ../../library/symtable.rst:99 +#: ../../library/symtable.rst:109 msgid "Return a tuple containing names of locals in this function." msgstr "回傳一個包含此函式中區域變數 (locals) 名稱的元組。" -#: ../../library/symtable.rst:103 +#: ../../library/symtable.rst:113 msgid "Return a tuple containing names of globals in this function." msgstr "回傳一個包含此函式中全域變數 (globals) 名稱的元組。" -#: ../../library/symtable.rst:107 +#: ../../library/symtable.rst:117 msgid "Return a tuple containing names of nonlocals in this function." msgstr "回傳一個包含此函式中非區域變數 (nonlocals) 名稱的元組。" -#: ../../library/symtable.rst:111 +#: ../../library/symtable.rst:121 msgid "Return a tuple containing names of free variables in this function." msgstr "回傳一個包含此函式中自由變數 (free variables) 名稱的元組。" -#: ../../library/symtable.rst:116 +#: ../../library/symtable.rst:126 msgid "A namespace of a class. This class inherits :class:`SymbolTable`." msgstr "一個類別的命名空間。該類別繼承自 :class:`SymbolTable`。" -#: ../../library/symtable.rst:120 +#: ../../library/symtable.rst:130 msgid "Return a tuple containing the names of methods declared in the class." msgstr "回傳一個包含類別中聲明的方法名稱的元組。" -#: ../../library/symtable.rst:125 +#: ../../library/symtable.rst:135 msgid "" "An entry in a :class:`SymbolTable` corresponding to an identifier in the " "source. The constructor is not public." msgstr "" ":class:`SymbolTable` 中的條目對應於來源中的識別器。建構函式不是公開的。" -#: ../../library/symtable.rst:130 +#: ../../library/symtable.rst:140 msgid "Return the symbol's name." msgstr "回傳符號的名稱。" -#: ../../library/symtable.rst:134 +#: ../../library/symtable.rst:144 msgid "Return ``True`` if the symbol is used in its block." msgstr "如果該符號在其區塊中使用,則回傳 ``True``。" -#: ../../library/symtable.rst:138 +#: ../../library/symtable.rst:148 msgid "Return ``True`` if the symbol is created from an import statement." msgstr "如果符號是從 import 陳述式建立的,則回傳 ``True``。" -#: ../../library/symtable.rst:142 +#: ../../library/symtable.rst:152 msgid "Return ``True`` if the symbol is a parameter." msgstr "如果符號是一個參數,則回傳 ``True``。" -#: ../../library/symtable.rst:146 +#: ../../library/symtable.rst:156 msgid "Return ``True`` if the symbol is global." msgstr "如果符號是全域的,則回傳 ``True``。" -#: ../../library/symtable.rst:150 +#: ../../library/symtable.rst:160 msgid "Return ``True`` if the symbol is nonlocal." msgstr "如果符號是非區域的,則回傳 ``True``。" -#: ../../library/symtable.rst:154 +#: ../../library/symtable.rst:164 msgid "" "Return ``True`` if the symbol is declared global with a global statement." msgstr "如果使用全域陳述式將符號聲明為全域的,則回傳 ``True``。" -#: ../../library/symtable.rst:158 +#: ../../library/symtable.rst:168 msgid "Return ``True`` if the symbol is local to its block." msgstr "如果符號是其區塊的區域符號,則回傳 ``True``。" -#: ../../library/symtable.rst:162 +#: ../../library/symtable.rst:172 msgid "Return ``True`` if the symbol is annotated." msgstr "如果符號有被註釋,則回傳 ``True``。" -#: ../../library/symtable.rst:168 +#: ../../library/symtable.rst:178 msgid "" "Return ``True`` if the symbol is referenced in its block, but not assigned " "to." @@ -207,28 +226,28 @@ msgstr "" "如果該符號在其區塊中被參照 (referenced) 但未被賦值 (assigned),則回傳 " "``True``。" -#: ../../library/symtable.rst:173 +#: ../../library/symtable.rst:183 msgid "Return ``True`` if the symbol is assigned to in its block." msgstr "如果該符號被賦值到其區塊中,則回傳 ``True``。" -#: ../../library/symtable.rst:177 +#: ../../library/symtable.rst:187 msgid "Return ``True`` if name binding introduces new namespace." msgstr "如果名稱綁定引入 (introduce) 新的命名空間,則回傳 ``True``。" -#: ../../library/symtable.rst:179 +#: ../../library/symtable.rst:189 msgid "" "If the name is used as the target of a function or class statement, this " "will be true." msgstr "如果名稱用作函式或類別陳述式的目標,則這將會是 true。" -#: ../../library/symtable.rst:182 +#: ../../library/symtable.rst:192 msgid "For example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/symtable.rst:188 +#: ../../library/symtable.rst:198 msgid "" "Note that a single name can be bound to multiple objects. If the result is " "``True``, the name may also be bound to other objects, like an int or list, " @@ -237,11 +256,11 @@ msgstr "" "請注意,單個名稱可以綁定到多個物件。如果結果為 ``True``,則該名稱也可能被綁定" "到其他物件,例如 int 或 list,而不會引入新的命名空間。" -#: ../../library/symtable.rst:194 +#: ../../library/symtable.rst:204 msgid "Return a list of namespaces bound to this name." msgstr "回傳綁定到該名稱的命名空間的串列。" -#: ../../library/symtable.rst:198 +#: ../../library/symtable.rst:208 msgid "" "Return the namespace bound to this name. If more than one or no namespace is " "bound to this name, a :exc:`ValueError` is raised." diff --git a/library/sys.monitoring.po b/library/sys.monitoring.po index 58353e1ae7..00d44ff013 100644 --- a/library/sys.monitoring.po +++ b/library/sys.monitoring.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-09-06 00:03+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -302,7 +302,7 @@ msgstr "" #: ../../library/sys.monitoring.rst:150 msgid "" -"The ``C_RETURN`` and ``C_RAISE`` events are are controlled by the ``CALL`` " +"The ``C_RETURN`` and ``C_RAISE`` events are controlled by the ``CALL`` " "event. ``C_RETURN`` and ``C_RAISE`` events will only be seen if the " "corresponding ``CALL`` event is being monitored." msgstr "" diff --git a/library/sys.po b/library/sys.po index 0b47041954..93f7eb9d6e 100644 --- a/library/sys.po +++ b/library/sys.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-09-09 00:03+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2023-04-26 02:54+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -966,7 +966,7 @@ msgstr "" msgid "" "Return the current value of the flags that are used for :c:func:`dlopen` " "calls. Symbolic names for the flag values can be found in the :mod:`os` " -"module (``RTLD_xxx`` constants, e.g. :const:`os.RTLD_LAZY`)." +"module (:samp:`RTLD_{xxx}` constants, e.g. :const:`os.RTLD_LAZY`)." msgstr "" #: ../../library/sys.rst:759 ../../library/sys.rst:1447 @@ -1829,8 +1829,8 @@ msgid "" "enable a lazy resolving of symbols when importing a module, if called as " "``sys.setdlopenflags(0)``. To share symbols across extension modules, call " "as ``sys.setdlopenflags(os.RTLD_GLOBAL)``. Symbolic names for the flag " -"values can be found in the :mod:`os` module (``RTLD_xxx`` constants, e.g. :" -"const:`os.RTLD_LAZY`)." +"values can be found in the :mod:`os` module (:samp:`RTLD_{xxx}` constants, e." +"g. :const:`os.RTLD_LAZY`)." msgstr "" #: ../../library/sys.rst:1451 diff --git a/library/sysconfig.po b/library/sysconfig.po index ed92e796c6..0b9bffd1ea 100644 --- a/library/sysconfig.po +++ b/library/sysconfig.po @@ -1,5 +1,4 @@ -# 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: @@ -7,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-20 15:45+0000\n" +"POT-Creation-Date: 2023-10-12 00:03+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-" @@ -34,227 +33,479 @@ msgid "" "variables relevant for the current platform." msgstr "" -#: ../../library/sysconfig.rst:24 +#: ../../library/sysconfig.rst:25 msgid "Configuration variables" msgstr "" -#: ../../library/sysconfig.rst:26 +#: ../../library/sysconfig.rst:27 msgid "" "A Python distribution contains a :file:`Makefile` and a :file:`pyconfig.h` " "header file that are necessary to build both the Python binary itself and " "third-party C extensions compiled using ``setuptools``." msgstr "" -#: ../../library/sysconfig.rst:30 +#: ../../library/sysconfig.rst:31 msgid "" ":mod:`sysconfig` puts all variables found in these files in a dictionary " "that can be accessed using :func:`get_config_vars` or :func:`get_config_var`." msgstr "" -#: ../../library/sysconfig.rst:33 +#: ../../library/sysconfig.rst:34 msgid "Notice that on Windows, it's a much smaller set." msgstr "" -#: ../../library/sysconfig.rst:37 +#: ../../library/sysconfig.rst:38 msgid "" "With no arguments, return a dictionary of all configuration variables " "relevant for the current platform." msgstr "" -#: ../../library/sysconfig.rst:40 +#: ../../library/sysconfig.rst:41 msgid "" "With arguments, return a list of values that result from looking up each " "argument in the configuration variable dictionary." msgstr "" -#: ../../library/sysconfig.rst:43 +#: ../../library/sysconfig.rst:44 msgid "For each argument, if the value is not found, return ``None``." msgstr "" -#: ../../library/sysconfig.rst:48 +#: ../../library/sysconfig.rst:49 msgid "" "Return the value of a single variable *name*. Equivalent to " "``get_config_vars().get(name)``." msgstr "" -#: ../../library/sysconfig.rst:51 +#: ../../library/sysconfig.rst:52 msgid "If *name* is not found, return ``None``." msgstr "" -#: ../../library/sysconfig.rst:53 +#: ../../library/sysconfig.rst:54 msgid "Example of usage::" msgstr "" "用法範例:\n" "\n" "::" -#: ../../library/sysconfig.rst:66 +#: ../../library/sysconfig.rst:68 msgid "Installation paths" msgstr "" -#: ../../library/sysconfig.rst:68 +#: ../../library/sysconfig.rst:70 msgid "" "Python uses an installation scheme that differs depending on the platform " "and on the installation options. These schemes are stored in :mod:" "`sysconfig` under unique identifiers based on the value returned by :const:" -"`os.name`." +"`os.name`. The schemes are used by package installers to determine where to " +"copy files to." msgstr "" -#: ../../library/sysconfig.rst:72 -msgid "" -"Every new component that is installed using :mod:`!distutils` or a Distutils-" -"based system will follow the same scheme to copy its file in the right " -"places." -msgstr "" - -#: ../../library/sysconfig.rst:76 +#: ../../library/sysconfig.rst:75 msgid "Python currently supports nine schemes:" msgstr "" -#: ../../library/sysconfig.rst:78 +#: ../../library/sysconfig.rst:77 msgid "" "*posix_prefix*: scheme for POSIX platforms like Linux or macOS. This is the " "default scheme used when Python or a component is installed." msgstr "" -#: ../../library/sysconfig.rst:80 +#: ../../library/sysconfig.rst:79 msgid "" -"*posix_home*: scheme for POSIX platforms used when a *home* option is used " -"upon installation. This scheme is used when a component is installed " -"through Distutils with a specific home prefix." +"*posix_home*: scheme for POSIX platforms, when the *home* option is used. " +"This scheme defines paths located under a specific home prefix." msgstr "" -#: ../../library/sysconfig.rst:83 +#: ../../library/sysconfig.rst:81 msgid "" -"*posix_user*: scheme for POSIX platforms used when a component is installed " -"through Distutils and the *user* option is used. This scheme defines paths " -"located under the user home directory." +"*posix_user*: scheme for POSIX platforms, when the *user* option is used. " +"This scheme defines paths located under the user's home directory (:const:" +"`site.USER_BASE`)." msgstr "" -#: ../../library/sysconfig.rst:86 +#: ../../library/sysconfig.rst:84 msgid "" "*posix_venv*: scheme for :mod:`Python virtual environments ` on POSIX " "platforms; by default it is the same as *posix_prefix*." msgstr "" -#: ../../library/sysconfig.rst:88 -msgid "*nt*: scheme for NT platforms like Windows." +#: ../../library/sysconfig.rst:86 +msgid "" +"*nt*: scheme for Windows. This is the default scheme used when Python or a " +"component is installed." msgstr "" -#: ../../library/sysconfig.rst:89 -msgid "*nt_user*: scheme for NT platforms, when the *user* option is used." +#: ../../library/sysconfig.rst:88 +msgid "*nt_user*: scheme for Windows, when the *user* option is used." msgstr "" -#: ../../library/sysconfig.rst:90 +#: ../../library/sysconfig.rst:89 msgid "" -"*nt_venv*: scheme for :mod:`Python virtual environments ` on NT " -"platforms; by default it is the same as *nt*." +"*nt_venv*: scheme for :mod:`Python virtual environments ` on Windows; " +"by default it is the same as *nt*." msgstr "" -#: ../../library/sysconfig.rst:92 +#: ../../library/sysconfig.rst:91 msgid "" "*venv*: a scheme with values from either *posix_venv* or *nt_venv* depending " "on the platform Python runs on." msgstr "" -#: ../../library/sysconfig.rst:94 +#: ../../library/sysconfig.rst:93 msgid "*osx_framework_user*: scheme for macOS, when the *user* option is used." msgstr "" -#: ../../library/sysconfig.rst:96 +#: ../../library/sysconfig.rst:95 msgid "" "Each scheme is itself composed of a series of paths and each path has a " "unique identifier. Python currently uses eight paths:" msgstr "" -#: ../../library/sysconfig.rst:99 +#: ../../library/sysconfig.rst:98 msgid "" "*stdlib*: directory containing the standard Python library files that are " "not platform-specific." msgstr "" -#: ../../library/sysconfig.rst:101 +#: ../../library/sysconfig.rst:100 msgid "" "*platstdlib*: directory containing the standard Python library files that " "are platform-specific." msgstr "" -#: ../../library/sysconfig.rst:103 +#: ../../library/sysconfig.rst:102 msgid "*platlib*: directory for site-specific, platform-specific files." msgstr "" -#: ../../library/sysconfig.rst:104 -msgid "*purelib*: directory for site-specific, non-platform-specific files." +#: ../../library/sysconfig.rst:103 +msgid "" +"*purelib*: directory for site-specific, non-platform-specific files ('pure' " +"Python)." msgstr "" -#: ../../library/sysconfig.rst:105 +#: ../../library/sysconfig.rst:104 msgid "" "*include*: directory for non-platform-specific header files for the Python C-" "API." msgstr "" -#: ../../library/sysconfig.rst:107 +#: ../../library/sysconfig.rst:106 msgid "" "*platinclude*: directory for platform-specific header files for the Python C-" "API." msgstr "" -#: ../../library/sysconfig.rst:109 +#: ../../library/sysconfig.rst:108 msgid "*scripts*: directory for script files." msgstr "" -#: ../../library/sysconfig.rst:110 +#: ../../library/sysconfig.rst:109 msgid "*data*: directory for data files." msgstr "" -#: ../../library/sysconfig.rst:112 -msgid ":mod:`sysconfig` provides some functions to determine these paths." +#: ../../library/sysconfig.rst:115 +msgid "User scheme" +msgstr "" + +#: ../../library/sysconfig.rst:117 +msgid "" +"This scheme is designed to be the most convenient solution for users that " +"don't have write permission to the global site-packages directory or don't " +"want to install into it." msgstr "" -#: ../../library/sysconfig.rst:116 +#: ../../library/sysconfig.rst:121 +msgid "" +"Files will be installed into subdirectories of :const:`site.USER_BASE` " +"(written as :file:`{userbase}` hereafter). This scheme installs pure Python " +"modules and extension modules in the same location (also known as :const:" +"`site.USER_SITE`)." +msgstr "" + +#: ../../library/sysconfig.rst:126 +msgid "``posix_user``" +msgstr "``posix_user``" + +#: ../../library/sysconfig.rst:129 ../../library/sysconfig.rst:144 +#: ../../library/sysconfig.rst:159 ../../library/sysconfig.rst:187 +#: ../../library/sysconfig.rst:229 ../../library/sysconfig.rst:245 +msgid "Path" +msgstr "" + +#: ../../library/sysconfig.rst:129 ../../library/sysconfig.rst:144 +#: ../../library/sysconfig.rst:159 ../../library/sysconfig.rst:187 +#: ../../library/sysconfig.rst:229 ../../library/sysconfig.rst:245 +msgid "Installation directory" +msgstr "" + +#: ../../library/sysconfig.rst:131 ../../library/sysconfig.rst:146 +#: ../../library/sysconfig.rst:161 ../../library/sysconfig.rst:189 +#: ../../library/sysconfig.rst:231 ../../library/sysconfig.rst:247 +msgid "*stdlib*" +msgstr "*stdlib*" + +#: ../../library/sysconfig.rst:131 ../../library/sysconfig.rst:132 +msgid ":file:`{userbase}/lib/python{X.Y}`" +msgstr ":file:`{userbase}/lib/python{X.Y}`" + +#: ../../library/sysconfig.rst:132 ../../library/sysconfig.rst:147 +#: ../../library/sysconfig.rst:162 ../../library/sysconfig.rst:190 +#: ../../library/sysconfig.rst:232 ../../library/sysconfig.rst:248 +msgid "*platstdlib*" +msgstr "*platstdlib*" + +#: ../../library/sysconfig.rst:133 ../../library/sysconfig.rst:148 +#: ../../library/sysconfig.rst:163 ../../library/sysconfig.rst:191 +#: ../../library/sysconfig.rst:233 ../../library/sysconfig.rst:249 +msgid "*platlib*" +msgstr "*platlib*" + +#: ../../library/sysconfig.rst:133 ../../library/sysconfig.rst:134 +msgid ":file:`{userbase}/lib/python{X.Y}/site-packages`" +msgstr ":file:`{userbase}/lib/python{X.Y}/site-packages`" + +#: ../../library/sysconfig.rst:134 ../../library/sysconfig.rst:149 +#: ../../library/sysconfig.rst:164 ../../library/sysconfig.rst:192 +#: ../../library/sysconfig.rst:234 ../../library/sysconfig.rst:250 +msgid "*purelib*" +msgstr "*purelib*" + +#: ../../library/sysconfig.rst:135 ../../library/sysconfig.rst:150 +#: ../../library/sysconfig.rst:165 ../../library/sysconfig.rst:193 +#: ../../library/sysconfig.rst:235 ../../library/sysconfig.rst:251 +msgid "*include*" +msgstr "*include*" + +#: ../../library/sysconfig.rst:135 ../../library/sysconfig.rst:165 +msgid ":file:`{userbase}/include/python{X.Y}`" +msgstr ":file:`{userbase}/include/python{X.Y}`" + +#: ../../library/sysconfig.rst:136 ../../library/sysconfig.rst:151 +#: ../../library/sysconfig.rst:166 ../../library/sysconfig.rst:195 +#: ../../library/sysconfig.rst:237 ../../library/sysconfig.rst:253 +msgid "*scripts*" +msgstr "*scripts*" + +#: ../../library/sysconfig.rst:136 ../../library/sysconfig.rst:166 +msgid ":file:`{userbase}/bin`" +msgstr ":file:`{userbase}/bin`" + +#: ../../library/sysconfig.rst:137 ../../library/sysconfig.rst:152 +#: ../../library/sysconfig.rst:167 ../../library/sysconfig.rst:196 +#: ../../library/sysconfig.rst:238 ../../library/sysconfig.rst:254 +msgid "*data*" +msgstr "*data*" + +#: ../../library/sysconfig.rst:137 ../../library/sysconfig.rst:152 +#: ../../library/sysconfig.rst:167 +msgid ":file:`{userbase}`" +msgstr ":file:`{userbase}`" + +#: ../../library/sysconfig.rst:141 +msgid "``nt_user``" +msgstr "``nt_user``" + +#: ../../library/sysconfig.rst:146 ../../library/sysconfig.rst:147 +msgid ":file:`{userbase}\\\\Python{XY}`" +msgstr ":file:`{userbase}\\\\Python{XY}`" + +#: ../../library/sysconfig.rst:148 ../../library/sysconfig.rst:149 +msgid ":file:`{userbase}\\\\Python{XY}\\\\site-packages`" +msgstr ":file:`{userbase}\\\\Python{XY}\\\\site-packages`" + +#: ../../library/sysconfig.rst:150 +msgid ":file:`{userbase}\\\\Python{XY}\\\\Include`" +msgstr ":file:`{userbase}\\\\Python{XY}\\\\Include`" + +#: ../../library/sysconfig.rst:151 +msgid ":file:`{userbase}\\\\Python{XY}\\\\Scripts`" +msgstr ":file:`{userbase}\\\\Python{XY}\\\\Scripts`" + +#: ../../library/sysconfig.rst:156 +msgid "``osx_framework_user``" +msgstr "``osx_framework_user``" + +#: ../../library/sysconfig.rst:161 ../../library/sysconfig.rst:162 +msgid ":file:`{userbase}/lib/python`" +msgstr ":file:`{userbase}/lib/python`" + +#: ../../library/sysconfig.rst:163 ../../library/sysconfig.rst:164 +msgid ":file:`{userbase}/lib/python/site-packages`" +msgstr ":file:`{userbase}/lib/python/site-packages`" + +#: ../../library/sysconfig.rst:174 +msgid "Home scheme" +msgstr "" + +#: ../../library/sysconfig.rst:176 +msgid "" +"The idea behind the \"home scheme\" is that you build and maintain a " +"personal stash of Python modules. This scheme's name is derived from the " +"idea of a \"home\" directory on Unix, since it's not unusual for a Unix user " +"to make their home directory have a layout similar to :file:`/usr/` or :file:" +"`/usr/local/`. This scheme can be used by anyone, regardless of the " +"operating system they are installing for." +msgstr "" + +#: ../../library/sysconfig.rst:184 +msgid "``posix_home``" +msgstr "``posix_home``" + +#: ../../library/sysconfig.rst:189 ../../library/sysconfig.rst:190 +#: ../../library/sysconfig.rst:191 ../../library/sysconfig.rst:192 +msgid ":file:`{home}/lib/python`" +msgstr ":file:`{home}/lib/python`" + +#: ../../library/sysconfig.rst:193 ../../library/sysconfig.rst:194 +msgid ":file:`{home}/include/python`" +msgstr ":file:`{home}/include/python`" + +#: ../../library/sysconfig.rst:194 ../../library/sysconfig.rst:236 +#: ../../library/sysconfig.rst:252 +msgid "*platinclude*" +msgstr "*platinclude*" + +#: ../../library/sysconfig.rst:195 +msgid ":file:`{home}/bin`" +msgstr ":file:`{home}/bin`" + +#: ../../library/sysconfig.rst:196 +msgid ":file:`{home}`" +msgstr ":file:`{home}`" + +#: ../../library/sysconfig.rst:203 +msgid "Prefix scheme" +msgstr "" + +#: ../../library/sysconfig.rst:205 +msgid "" +"The \"prefix scheme\" is useful when you wish to use one Python installation " +"to perform the build/install (i.e., to run the setup script), but install " +"modules into the third-party module directory of a different Python " +"installation (or something that looks like a different Python " +"installation). If this sounds a trifle unusual, it is---that's why the user " +"and home schemes come before. However, there are at least two known cases " +"where the prefix scheme will be useful." +msgstr "" + +#: ../../library/sysconfig.rst:212 +msgid "" +"First, consider that many Linux distributions put Python in :file:`/usr`, " +"rather than the more traditional :file:`/usr/local`. This is entirely " +"appropriate, since in those cases Python is part of \"the system\" rather " +"than a local add-on. However, if you are installing Python modules from " +"source, you probably want them to go in :file:`/usr/local/lib/python2.{X}` " +"rather than :file:`/usr/lib/python2.{X}`." +msgstr "" + +#: ../../library/sysconfig.rst:219 +msgid "" +"Another possibility is a network filesystem where the name used to write to " +"a remote directory is different from the name used to read it: for example, " +"the Python interpreter accessed as :file:`/usr/local/bin/python` might " +"search for modules in :file:`/usr/local/lib/python2.{X}`, but those modules " +"would have to be installed to, say, :file:`/mnt/{@server}/export/lib/python2." +"{X}`." +msgstr "" + +#: ../../library/sysconfig.rst:226 +msgid "``posix_prefix``" +msgstr "``posix_prefix``" + +#: ../../library/sysconfig.rst:231 ../../library/sysconfig.rst:232 +msgid ":file:`{prefix}/lib/python{X.Y}`" +msgstr ":file:`{prefix}/lib/python{X.Y}`" + +#: ../../library/sysconfig.rst:233 ../../library/sysconfig.rst:234 +msgid ":file:`{prefix}/lib/python{X.Y}/site-packages`" +msgstr ":file:`{prefix}/lib/python{X.Y}/site-packages`" + +#: ../../library/sysconfig.rst:235 ../../library/sysconfig.rst:236 +msgid ":file:`{prefix}/include/python{X.Y}`" +msgstr ":file:`{prefix}/include/python{X.Y}`" + +#: ../../library/sysconfig.rst:237 +msgid ":file:`{prefix}/bin`" +msgstr ":file:`{prefix}/bin`" + +#: ../../library/sysconfig.rst:238 ../../library/sysconfig.rst:254 +msgid ":file:`{prefix}`" +msgstr ":file:`{prefix}`" + +#: ../../library/sysconfig.rst:242 +msgid "``nt``" +msgstr "``nt``" + +#: ../../library/sysconfig.rst:247 ../../library/sysconfig.rst:248 +msgid ":file:`{prefix}\\\\Lib`" +msgstr ":file:`{prefix}\\\\Lib`" + +#: ../../library/sysconfig.rst:249 ../../library/sysconfig.rst:250 +msgid ":file:`{prefix}\\\\Lib\\\\site-packages`" +msgstr ":file:`{prefix}\\\\Lib\\\\site-packages`" + +#: ../../library/sysconfig.rst:251 ../../library/sysconfig.rst:252 +msgid ":file:`{prefix}\\\\Include`" +msgstr ":file:`{prefix}\\\\Include`" + +#: ../../library/sysconfig.rst:253 +msgid ":file:`{prefix}\\\\Scripts`" +msgstr ":file:`{prefix}\\\\Scripts`" + +#: ../../library/sysconfig.rst:259 +msgid "Installation path functions" +msgstr "安裝路徑函式" + +#: ../../library/sysconfig.rst:261 +msgid "" +":mod:`sysconfig` provides some functions to determine these installation " +"paths." +msgstr "" + +#: ../../library/sysconfig.rst:265 msgid "" "Return a tuple containing all schemes currently supported in :mod:" "`sysconfig`." msgstr "" -#: ../../library/sysconfig.rst:122 +#: ../../library/sysconfig.rst:271 msgid "Return the default scheme name for the current platform." msgstr "" -#: ../../library/sysconfig.rst:124 +#: ../../library/sysconfig.rst:273 msgid "" "This function was previously named ``_get_default_scheme()`` and considered " "an implementation detail." msgstr "" -#: ../../library/sysconfig.rst:128 +#: ../../library/sysconfig.rst:277 msgid "" "When Python runs from a virtual environment, the *venv* scheme is returned." msgstr "" -#: ../../library/sysconfig.rst:134 +#: ../../library/sysconfig.rst:283 msgid "" "Return a preferred scheme name for an installation layout specified by *key*." msgstr "" -#: ../../library/sysconfig.rst:136 +#: ../../library/sysconfig.rst:285 msgid "*key* must be either ``\"prefix\"``, ``\"home\"``, or ``\"user\"``." msgstr "" -#: ../../library/sysconfig.rst:138 +#: ../../library/sysconfig.rst:287 msgid "" "The return value is a scheme name listed in :func:`get_scheme_names`. It can " "be passed to :mod:`sysconfig` functions that take a *scheme* argument, such " "as :func:`get_paths`." msgstr "" -#: ../../library/sysconfig.rst:144 +#: ../../library/sysconfig.rst:293 msgid "" "When Python runs from a virtual environment and ``key=\"prefix\"``, the " "*venv* scheme is returned." msgstr "" -#: ../../library/sysconfig.rst:151 +#: ../../library/sysconfig.rst:300 msgid "" "Return a dict containing preferred scheme names on the current platform. " "Python implementers and redistributors may add their preferred schemes to " @@ -264,109 +515,111 @@ msgid "" "mix with those by the other." msgstr "" -#: ../../library/sysconfig.rst:158 +#: ../../library/sysconfig.rst:307 msgid "" "End users should not use this function, but :func:`get_default_scheme` and :" "func:`get_preferred_scheme()` instead." msgstr "" -#: ../../library/sysconfig.rst:166 +#: ../../library/sysconfig.rst:315 msgid "" "Return a tuple containing all path names currently supported in :mod:" "`sysconfig`." msgstr "" -#: ../../library/sysconfig.rst:172 +#: ../../library/sysconfig.rst:321 msgid "" "Return an installation path corresponding to the path *name*, from the " "install scheme named *scheme*." msgstr "" -#: ../../library/sysconfig.rst:175 +#: ../../library/sysconfig.rst:324 msgid "" "*name* has to be a value from the list returned by :func:`get_path_names`." msgstr "" -#: ../../library/sysconfig.rst:177 +#: ../../library/sysconfig.rst:326 msgid "" ":mod:`sysconfig` stores installation paths corresponding to each path name, " "for each platform, with variables to be expanded. For instance the *stdlib* " "path for the *nt* scheme is: ``{base}/Lib``." msgstr "" -#: ../../library/sysconfig.rst:181 +#: ../../library/sysconfig.rst:330 msgid "" ":func:`get_path` will use the variables returned by :func:`get_config_vars` " "to expand the path. All variables have default values for each platform so " "one may call this function and get the default value." msgstr "" -#: ../../library/sysconfig.rst:185 +#: ../../library/sysconfig.rst:334 msgid "" "If *scheme* is provided, it must be a value from the list returned by :func:" "`get_scheme_names`. Otherwise, the default scheme for the current platform " "is used." msgstr "" -#: ../../library/sysconfig.rst:189 +#: ../../library/sysconfig.rst:338 msgid "" "If *vars* is provided, it must be a dictionary of variables that will update " "the dictionary returned by :func:`get_config_vars`." msgstr "" -#: ../../library/sysconfig.rst:192 +#: ../../library/sysconfig.rst:341 msgid "" "If *expand* is set to ``False``, the path will not be expanded using the " "variables." msgstr "" -#: ../../library/sysconfig.rst:195 +#: ../../library/sysconfig.rst:344 msgid "If *name* is not found, raise a :exc:`KeyError`." -msgstr "" +msgstr "如果找不到 *name*,則引發 :exc:`KeyError`。" -#: ../../library/sysconfig.rst:200 +#: ../../library/sysconfig.rst:349 msgid "" "Return a dictionary containing all installation paths corresponding to an " "installation scheme. See :func:`get_path` for more information." msgstr "" -#: ../../library/sysconfig.rst:203 +#: ../../library/sysconfig.rst:352 msgid "" "If *scheme* is not provided, will use the default scheme for the current " "platform." msgstr "" -#: ../../library/sysconfig.rst:206 +#: ../../library/sysconfig.rst:355 msgid "" "If *vars* is provided, it must be a dictionary of variables that will update " "the dictionary used to expand the paths." msgstr "" -#: ../../library/sysconfig.rst:209 +#: ../../library/sysconfig.rst:358 msgid "If *expand* is set to false, the paths will not be expanded." msgstr "" -#: ../../library/sysconfig.rst:211 +#: ../../library/sysconfig.rst:360 msgid "" "If *scheme* is not an existing scheme, :func:`get_paths` will raise a :exc:" "`KeyError`." msgstr "" -#: ../../library/sysconfig.rst:216 +#: ../../library/sysconfig.rst:365 msgid "Other functions" msgstr "其他函式" -#: ../../library/sysconfig.rst:220 +#: ../../library/sysconfig.rst:369 msgid "" "Return the ``MAJOR.MINOR`` Python version number as a string. Similar to " "``'%d.%d' % sys.version_info[:2]``." msgstr "" +"回傳 ``MAJOR.MINOR`` Python 版本號碼字串。類似於 ``'%d.%d' % sys." +"version_info[:2]``。" -#: ../../library/sysconfig.rst:226 +#: ../../library/sysconfig.rst:375 msgid "Return a string that identifies the current platform." msgstr "" -#: ../../library/sysconfig.rst:228 +#: ../../library/sysconfig.rst:377 msgid "" "This is used mainly to distinguish platform-specific build directories and " "platform-specific built distributions. Typically includes the OS name and " @@ -375,99 +628,99 @@ msgid "" "version isn't particularly important." msgstr "" -#: ../../library/sysconfig.rst:234 +#: ../../library/sysconfig.rst:383 msgid "Examples of returned values:" msgstr "" -#: ../../library/sysconfig.rst:236 +#: ../../library/sysconfig.rst:385 msgid "linux-i586" msgstr "linux-i586" -#: ../../library/sysconfig.rst:237 +#: ../../library/sysconfig.rst:386 msgid "linux-alpha (?)" msgstr "linux-alpha (?)" -#: ../../library/sysconfig.rst:238 +#: ../../library/sysconfig.rst:387 msgid "solaris-2.6-sun4u" msgstr "solaris-2.6-sun4u" -#: ../../library/sysconfig.rst:240 +#: ../../library/sysconfig.rst:389 msgid "Windows will return one of:" msgstr "" -#: ../../library/sysconfig.rst:242 +#: ../../library/sysconfig.rst:391 msgid "win-amd64 (64bit Windows on AMD64, aka x86_64, Intel64, and EM64T)" msgstr "" -#: ../../library/sysconfig.rst:243 +#: ../../library/sysconfig.rst:392 msgid "win32 (all others - specifically, sys.platform is returned)" msgstr "" -#: ../../library/sysconfig.rst:245 +#: ../../library/sysconfig.rst:394 msgid "macOS can return:" msgstr "" -#: ../../library/sysconfig.rst:247 +#: ../../library/sysconfig.rst:396 msgid "macosx-10.6-ppc" msgstr "macosx-10.6-ppc" -#: ../../library/sysconfig.rst:248 +#: ../../library/sysconfig.rst:397 msgid "macosx-10.4-ppc64" msgstr "macosx-10.4-ppc64" -#: ../../library/sysconfig.rst:249 +#: ../../library/sysconfig.rst:398 msgid "macosx-10.3-i386" msgstr "macosx-10.3-i386" -#: ../../library/sysconfig.rst:250 +#: ../../library/sysconfig.rst:399 msgid "macosx-10.4-fat" msgstr "macosx-10.4-fat" -#: ../../library/sysconfig.rst:252 +#: ../../library/sysconfig.rst:401 msgid "" "For other non-POSIX platforms, currently just returns :data:`sys.platform`." msgstr "" -#: ../../library/sysconfig.rst:257 +#: ../../library/sysconfig.rst:406 msgid "" "Return ``True`` if the running Python interpreter was built from source and " "is being run from its built location, and not from a location resulting from " "e.g. running ``make install`` or installing via a binary installer." msgstr "" -#: ../../library/sysconfig.rst:264 +#: ../../library/sysconfig.rst:413 msgid "Parse a :file:`config.h`\\-style file." msgstr "" -#: ../../library/sysconfig.rst:266 +#: ../../library/sysconfig.rst:415 msgid "" "*fp* is a file-like object pointing to the :file:`config.h`\\-like file." msgstr "" -#: ../../library/sysconfig.rst:268 +#: ../../library/sysconfig.rst:417 msgid "" "A dictionary containing name/value pairs is returned. If an optional " "dictionary is passed in as the second argument, it is used instead of a new " "dictionary, and updated with the values read in the file." msgstr "" -#: ../../library/sysconfig.rst:275 +#: ../../library/sysconfig.rst:424 msgid "Return the path of :file:`pyconfig.h`." -msgstr "" +msgstr "回傳 :file:`pyconfig.h` 的路徑。" -#: ../../library/sysconfig.rst:279 +#: ../../library/sysconfig.rst:428 msgid "Return the path of :file:`Makefile`." -msgstr "" +msgstr "回傳 :file:`Makefile` 的路徑。" -#: ../../library/sysconfig.rst:283 +#: ../../library/sysconfig.rst:433 msgid "Using :mod:`sysconfig` as a script" -msgstr "" +msgstr "將 :mod:`sysconfig` 作為腳本使用" -#: ../../library/sysconfig.rst:285 +#: ../../library/sysconfig.rst:435 msgid "You can use :mod:`sysconfig` as a script with Python's *-m* option:" msgstr "" -#: ../../library/sysconfig.rst:311 +#: ../../library/sysconfig.rst:461 msgid "" "This call will print in the standard output the information returned by :" "func:`get_platform`, :func:`get_python_version`, :func:`get_path` and :func:" diff --git a/library/textwrap.po b/library/textwrap.po index b3e2baf799..8bb1b9de67 100644 --- a/library/textwrap.po +++ b/library/textwrap.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-21 00:03+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -253,8 +253,8 @@ msgid "" "However, the sentence detection algorithm is imperfect: it assumes that a " "sentence ending consists of a lowercase letter followed by one of ``'.'``, " "``'!'``, or ``'?'``, possibly followed by one of ``'\"'`` or ``\"'\"``, " -"followed by a space. One problem with this is algorithm is that it is " -"unable to detect the difference between \"Dr.\" in ::" +"followed by a space. One problem with this algorithm is that it is unable " +"to detect the difference between \"Dr.\" in ::" msgstr "" #: ../../library/textwrap.rst:246 diff --git a/library/timeit.po b/library/timeit.po index e750ba6a16..5320b6898d 100644 --- a/library/timeit.po +++ b/library/timeit.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-27 18:15+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2023-05-20 13:21+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -205,7 +205,7 @@ msgid "" "the total time >= 0.2 second, returning the eventual (number of loops, time " "taken for that number of loops). It calls :meth:`.timeit` with increasing " "numbers from the sequence 1, 2, 5, 10, 20, 50, ... until the time taken is " -"at least 0.2 second." +"at least 0.2 seconds." msgstr "" "這是一個便捷函式,它重複呼叫 :meth:`.timeit` 以使得總時間 >= 0.2 秒,再回傳最" "終結果(迴圈數、該迴圈數所花費的時間)。它以 1、2、5、10、20、50... 的順序遞" diff --git a/library/tty.po b/library/tty.po index 1a933d2ef3..112a009880 100644 --- a/library/tty.po +++ b/library/tty.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2021-12-17 17:00+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -67,7 +67,11 @@ msgstr "" "將檔案描述器 *fd* 的模式更改為 raw。如果 *when* 被省略,則預設為 :const:" "`termios.TCSAFLUSH`,並傳遞給 :func:`termios.tcsetattr`。" -#: ../../library/tty.rst:49 +#: ../../library/tty.rst:46 ../../library/tty.rst:57 +msgid "The return value is now the original tty attributes, instead of None." +msgstr "" + +#: ../../library/tty.rst:52 #, fuzzy msgid "" "Change the mode of file descriptor *fd* to cbreak. If *when* is omitted, it " @@ -78,10 +82,10 @@ msgstr "" "將檔案描述器 *fd* 的模式更改為 cbreak。如果 *when* 被省略,則預設為 :const:" "`termios.TCSAFLUSH`,並傳遞給 :func:`termios.tcsetattr`。" -#: ../../library/tty.rst:57 +#: ../../library/tty.rst:63 msgid "Module :mod:`termios`" msgstr ":mod:`termios` 模組" -#: ../../library/tty.rst:58 +#: ../../library/tty.rst:64 msgid "Low-level terminal control interface." msgstr "低階終端機控制介面。" diff --git a/library/typing.po b/library/typing.po index 5a8c520a50..59abe80c15 100644 --- a/library/typing.po +++ b/library/typing.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-09-11 00:03+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2023-09-05 14:49+0800\n" "Last-Translator: RockLeon \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -449,8 +449,8 @@ msgid "" "of type :class:`int` and returns a :class:`str`." msgstr "" -#: ../../library/typing.rst:271 ../../library/typing.rst:2873 -#: ../../library/typing.rst:3015 +#: ../../library/typing.rst:271 ../../library/typing.rst:2888 +#: ../../library/typing.rst:3030 msgid "For example:" msgstr "舉例來說:" @@ -488,7 +488,7 @@ msgid "" "ReturnType]`` respectively." msgstr "" -#: ../../library/typing.rst:341 ../../library/typing.rst:3544 +#: ../../library/typing.rst:341 ../../library/typing.rst:3559 msgid "" "``Callable`` now supports :class:`ParamSpec` and :data:`Concatenate`. See :" "pep:`612` for more details." @@ -870,7 +870,7 @@ msgstr "" #: ../../library/typing.rst:843 ../../library/typing.rst:934 #: ../../library/typing.rst:954 ../../library/typing.rst:1011 #: ../../library/typing.rst:1180 ../../library/typing.rst:1237 -#: ../../library/typing.rst:1446 ../../library/typing.rst:2813 +#: ../../library/typing.rst:1446 ../../library/typing.rst:2828 msgid "For example::" msgstr "" "舉例來說:\n" @@ -1199,7 +1199,7 @@ msgid "" "scopes cannot be overridden in subclasses." msgstr "" -#: ../../library/typing.rst:1248 ../../library/typing.rst:2829 +#: ../../library/typing.rst:1248 ../../library/typing.rst:2844 msgid "" "There is no runtime checking of these properties. See :pep:`591` for more " "details." @@ -1260,8 +1260,8 @@ msgstr "" #: ../../library/typing.rst:1293 msgid "" -"The responsibility of how to interpret the metadata lies with the the tool " -"or library encountering an ``Annotated`` annotation. A tool or library " +"The responsibility of how to interpret the metadata lies with the tool or " +"library encountering an ``Annotated`` annotation. A tool or library " "encountering an ``Annotated`` type can scan through the metadata elements to " "determine if they are of interest (e.g., using :func:`isinstance`)." msgstr "" @@ -1864,7 +1864,7 @@ msgid "Typed version of :func:`collections.namedtuple`." msgstr "" #: ../../library/typing.rst:2029 ../../library/typing.rst:2106 -#: ../../library/typing.rst:3055 +#: ../../library/typing.rst:3070 msgid "Usage::" msgstr "" @@ -2153,21 +2153,32 @@ msgid "" "``Point2D.__total__`` gives the value of the ``total`` argument. Example:" msgstr "" -#: ../../library/typing.rst:2401 +#: ../../library/typing.rst:2395 +msgid "" +"This attribute reflects *only* the value of the ``total`` argument to the " +"current ``TypedDict`` class, not whether the class is semantically total. " +"For example, a ``TypedDict`` with ``__total__`` set to True may have keys " +"marked with :data:`NotRequired`, or it may inherit from another " +"``TypedDict`` with ``total=False``. Therefore, it is generally better to " +"use :attr:`__required_keys__` and :attr:`__optional_keys__` for " +"introspection." +msgstr "" + +#: ../../library/typing.rst:2408 msgid "" "``Point2D.__required_keys__`` and ``Point2D.__optional_keys__`` return :" "class:`frozenset` objects containing required and non-required keys, " "respectively." msgstr "" -#: ../../library/typing.rst:2404 +#: ../../library/typing.rst:2411 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:2407 +#: ../../library/typing.rst:2414 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 " @@ -2176,133 +2187,142 @@ msgid "" "``TypedDict`` with a different value for ``total``:" msgstr "" -#: ../../library/typing.rst:2430 +#: ../../library/typing.rst:2439 +msgid "" +"If ``from __future__ import annotations`` is used or if annotations are " +"given as strings, annotations are not evaluated when the ``TypedDict`` is " +"defined. Therefore, the runtime introspection that ``__required_keys__`` and " +"``__optional_keys__`` rely on may not work properly, and the values of the " +"attributes may be incorrect." +msgstr "" + +#: ../../library/typing.rst:2445 msgid "" "See :pep:`589` for more examples and detailed rules of using ``TypedDict``." msgstr "" -#: ../../library/typing.rst:2434 +#: ../../library/typing.rst:2449 msgid "" "Added support for marking individual keys as :data:`Required` or :data:" "`NotRequired`. See :pep:`655`." msgstr "" -#: ../../library/typing.rst:2438 +#: ../../library/typing.rst:2453 msgid "Added support for generic ``TypedDict``\\ s." msgstr "" -#: ../../library/typing.rst:2442 +#: ../../library/typing.rst:2457 msgid "Protocols" msgstr "協定" -#: ../../library/typing.rst:2444 +#: ../../library/typing.rst:2459 msgid "" "The following protocols are provided by the typing module. All are decorated " "with :func:`@runtime_checkable `." msgstr "" -#: ../../library/typing.rst:2449 +#: ../../library/typing.rst:2464 msgid "" "An ABC with one abstract method ``__abs__`` that is covariant in its return " "type." msgstr "" -#: ../../library/typing.rst:2454 +#: ../../library/typing.rst:2469 msgid "An ABC with one abstract method ``__bytes__``." msgstr "一個有抽象方法 ``__bytes__`` 的 ABC。" -#: ../../library/typing.rst:2458 +#: ../../library/typing.rst:2473 msgid "An ABC with one abstract method ``__complex__``." msgstr "一個有抽象方法 ``__complex__`` 的 ABC。" -#: ../../library/typing.rst:2462 +#: ../../library/typing.rst:2477 msgid "An ABC with one abstract method ``__float__``." msgstr "一個有抽象方法 ``__float__`` 的 ABC。" -#: ../../library/typing.rst:2466 +#: ../../library/typing.rst:2481 msgid "An ABC with one abstract method ``__index__``." msgstr "一個有抽象方法 ``__index__`` 的 ABC。" -#: ../../library/typing.rst:2472 +#: ../../library/typing.rst:2487 msgid "An ABC with one abstract method ``__int__``." msgstr "一個有抽象方法 ``__int__`` 的 ABC。" -#: ../../library/typing.rst:2476 +#: ../../library/typing.rst:2491 msgid "" "An ABC with one abstract method ``__round__`` that is covariant in its " "return type." msgstr "" -#: ../../library/typing.rst:2480 +#: ../../library/typing.rst:2495 msgid "ABCs for working with IO" msgstr "" -#: ../../library/typing.rst:2486 +#: ../../library/typing.rst:2501 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:2492 +#: ../../library/typing.rst:2507 msgid "Functions and decorators" msgstr "函式與裝飾器" -#: ../../library/typing.rst:2496 +#: ../../library/typing.rst:2511 msgid "Cast a value to a type." msgstr "" -#: ../../library/typing.rst:2498 +#: ../../library/typing.rst:2513 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:2505 +#: ../../library/typing.rst:2520 msgid "" "Ask a static type checker to confirm that *val* has an inferred type of " "*typ*." msgstr "" -#: ../../library/typing.rst:2507 +#: ../../library/typing.rst:2522 msgid "" "At runtime this does nothing: it returns the first argument unchanged with " "no checks or side effects, no matter the actual type of the argument." msgstr "" -#: ../../library/typing.rst:2510 +#: ../../library/typing.rst:2525 msgid "" "When a static 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:2517 +#: ../../library/typing.rst:2532 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:2531 +#: ../../library/typing.rst:2546 msgid "" "Ask a static type checker to confirm that a line of code is unreachable." msgstr "" -#: ../../library/typing.rst:2533 +#: ../../library/typing.rst:2548 msgid "Example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/typing.rst:2544 +#: ../../library/typing.rst:2559 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`, " "and both options are covered by earlier cases." msgstr "" -#: ../../library/typing.rst:2549 +#: ../../library/typing.rst:2564 msgid "" "If a type checker finds that a call to ``assert_never()`` is reachable, it " "will emit an error. For example, if the type annotation for ``arg`` was " @@ -2312,59 +2332,59 @@ msgid "" "passed in must be the bottom type, :data:`Never`, and nothing else." msgstr "" -#: ../../library/typing.rst:2557 +#: ../../library/typing.rst:2572 msgid "At runtime, this throws an exception when called." msgstr "" -#: ../../library/typing.rst:2560 +#: ../../library/typing.rst:2575 msgid "" "`Unreachable Code and Exhaustiveness Checking `__ has more information about " "exhaustiveness checking with static typing." msgstr "" -#: ../../library/typing.rst:2568 +#: ../../library/typing.rst:2583 msgid "Reveal the inferred static type of an expression." msgstr "" -#: ../../library/typing.rst:2570 +#: ../../library/typing.rst:2585 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:2576 +#: ../../library/typing.rst:2591 msgid "" "This can be useful when you want to debug how your type checker handles a " "particular piece of code." msgstr "" -#: ../../library/typing.rst:2579 +#: ../../library/typing.rst:2594 msgid "" "The function returns its argument unchanged, which allows using it within an " "expression::" msgstr "" -#: ../../library/typing.rst:2584 +#: ../../library/typing.rst:2599 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:2589 +#: ../../library/typing.rst:2604 msgid "" "At runtime, this function prints the runtime type of its argument to stderr " "and returns it unchanged::" msgstr "" -#: ../../library/typing.rst:2601 +#: ../../library/typing.rst:2616 msgid "" "Decorator to mark an object as providing :func:`dataclass `-like behavior." msgstr "" -#: ../../library/typing.rst:2604 +#: ../../library/typing.rst:2619 msgid "" "``dataclass_transform`` may be used to decorate a class, metaclass, or a " "function that is itself a decorator. The presence of " @@ -2373,19 +2393,19 @@ msgid "" "to :func:`@dataclasses.dataclass `." msgstr "" -#: ../../library/typing.rst:2611 +#: ../../library/typing.rst:2626 msgid "Example usage with a decorator function:" msgstr "" -#: ../../library/typing.rst:2625 +#: ../../library/typing.rst:2640 msgid "On a base class::" msgstr "" -#: ../../library/typing.rst:2634 +#: ../../library/typing.rst:2649 msgid "On a metaclass::" msgstr "" -#: ../../library/typing.rst:2645 +#: ../../library/typing.rst:2660 msgid "" "The ``CustomerModel`` classes defined above will be treated by type checkers " "similarly to classes created with :func:`@dataclasses.dataclass `-decorated definitions for " "*func*." msgstr "" -#: ../../library/typing.rst:2783 +#: ../../library/typing.rst:2798 msgid "" "*func* is the function object for the implementation of the overloaded " "function. For example, given the definition of ``process`` in the " @@ -2603,32 +2623,32 @@ msgid "" "returns an empty sequence." msgstr "" -#: ../../library/typing.rst:2790 +#: ../../library/typing.rst:2805 msgid "" "``get_overloads()`` can be used for introspecting an overloaded function at " "runtime." msgstr "" -#: ../../library/typing.rst:2798 +#: ../../library/typing.rst:2813 msgid "Clear all registered overloads in the internal registry." msgstr "" -#: ../../library/typing.rst:2800 +#: ../../library/typing.rst:2815 msgid "This can be used to reclaim the memory used by the registry." msgstr "" -#: ../../library/typing.rst:2807 +#: ../../library/typing.rst:2822 msgid "Decorator to indicate final methods and final classes." msgstr "" -#: ../../library/typing.rst:2809 +#: ../../library/typing.rst:2824 msgid "" "Decorating a method with ``@final`` indicates to a type checker that the " "method cannot be overridden in a subclass. Decorating a class with " "``@final`` indicates that it cannot be subclassed." msgstr "" -#: ../../library/typing.rst:2834 +#: ../../library/typing.rst:2849 msgid "" "The decorator will now attempt to set a ``__final__`` attribute to ``True`` " "on the decorated object. Thus, a check like ``if getattr(obj, \"__final__\", " @@ -2638,11 +2658,11 @@ msgid "" "exception." msgstr "" -#: ../../library/typing.rst:2845 +#: ../../library/typing.rst:2860 msgid "Decorator to indicate that annotations are not type hints." msgstr "" -#: ../../library/typing.rst:2847 +#: ../../library/typing.rst:2862 msgid "" "This works as a class or function :term:`decorator`. With a class, it " "applies recursively to all methods and classes defined in that class (but " @@ -2650,38 +2670,38 @@ msgid "" "will ignore all annotations in a function or class with this decorator." msgstr "" -#: ../../library/typing.rst:2853 +#: ../../library/typing.rst:2868 msgid "``@no_type_check`` mutates the decorated object in place." msgstr "" -#: ../../library/typing.rst:2857 +#: ../../library/typing.rst:2872 msgid "Decorator to give another decorator the :func:`no_type_check` effect." msgstr "" -#: ../../library/typing.rst:2859 +#: ../../library/typing.rst:2874 msgid "" "This wraps the decorator with something that wraps the decorated function " "in :func:`no_type_check`." msgstr "" -#: ../../library/typing.rst:2865 +#: ../../library/typing.rst:2880 msgid "" "Decorator to indicate that a method in a subclass is intended to override a " "method or attribute in a superclass." msgstr "" -#: ../../library/typing.rst:2868 +#: ../../library/typing.rst:2883 msgid "" "Type checkers should emit an error if a method decorated with ``@override`` " "does not, in fact, override anything. This helps prevent bugs that may occur " "when a base class is changed without an equivalent change to a child class." msgstr "" -#: ../../library/typing.rst:2890 +#: ../../library/typing.rst:2905 msgid "There is no runtime checking of this property." msgstr "" -#: ../../library/typing.rst:2892 +#: ../../library/typing.rst:2907 msgid "" "The decorator will attempt to set an ``__override__`` attribute to ``True`` " "on the decorated object. Thus, a check like ``if getattr(obj, " @@ -2691,38 +2711,38 @@ msgid "" "without raising an exception." msgstr "" -#: ../../library/typing.rst:2899 +#: ../../library/typing.rst:2914 msgid "See :pep:`698` for more details." msgstr "更多細節請見 :pep:`698`。" -#: ../../library/typing.rst:2906 +#: ../../library/typing.rst:2921 msgid "Decorator to mark a class or function as unavailable at runtime." msgstr "" -#: ../../library/typing.rst:2908 +#: ../../library/typing.rst:2923 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:2919 +#: ../../library/typing.rst:2934 msgid "" "Note that returning instances of private classes is not recommended. It is " "usually preferable to make such classes public." msgstr "" -#: ../../library/typing.rst:2923 +#: ../../library/typing.rst:2938 msgid "Introspection helpers" msgstr "" -#: ../../library/typing.rst:2927 +#: ../../library/typing.rst:2942 msgid "" "Return a dictionary containing type hints for a function, method, module or " "class object." msgstr "" -#: ../../library/typing.rst:2930 +#: ../../library/typing.rst:2945 msgid "" "This is often the same as ``obj.__annotations__``. In addition, forward " "references encoded as string literals are handled by evaluating them in " @@ -2731,21 +2751,21 @@ msgid "" "__mro__`` in reverse order." msgstr "" -#: ../../library/typing.rst:2936 +#: ../../library/typing.rst:2951 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:2953 +#: ../../library/typing.rst:2968 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:2958 +#: ../../library/typing.rst:2973 msgid "" "Added ``include_extras`` parameter as part of :pep:`593`. See the " "documentation on :data:`Annotated` for more information." @@ -2753,20 +2773,20 @@ msgstr "" "新增 ``include_extras`` 參數(如 :pep:`593` 中所述)。更多資訊請見 :data:" "`Annotated` 的文件。" -#: ../../library/typing.rst:2962 +#: ../../library/typing.rst:2977 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:2969 +#: ../../library/typing.rst:2984 msgid "" "Get the unsubscripted version of a type: for a typing object of the form " "``X[Y, Z, ...]`` return ``X``." msgstr "" -#: ../../library/typing.rst:2972 +#: ../../library/typing.rst:2987 msgid "" "If ``X`` is a typing-module alias for a builtin or :mod:`collections` class, " "it will be normalized to the original class. If ``X`` is an instance of :" @@ -2774,17 +2794,17 @@ msgid "" "class:`ParamSpec`. Return ``None`` for unsupported objects." msgstr "" -#: ../../library/typing.rst:2978 ../../library/typing.rst:3001 +#: ../../library/typing.rst:2993 ../../library/typing.rst:3016 msgid "Examples:" msgstr "舉例:" -#: ../../library/typing.rst:2993 +#: ../../library/typing.rst:3008 msgid "" "Get type arguments with all substitutions performed: for a typing object of " "the form ``X[Y, Z, ...]`` return ``(Y, Z, ...)``." msgstr "" -#: ../../library/typing.rst:2996 +#: ../../library/typing.rst:3011 msgid "" "If ``X`` is a union or :class:`Literal` contained in another generic type, " "the order of ``(Y, Z, ...)`` may be different from the order of the original " @@ -2792,40 +2812,40 @@ msgid "" "objects." msgstr "" -#: ../../library/typing.rst:3013 +#: ../../library/typing.rst:3028 msgid "Check if a type is a :class:`TypedDict`." msgstr "" -#: ../../library/typing.rst:3034 +#: ../../library/typing.rst:3049 msgid "" "Class used for internal typing representation of string forward references." msgstr "" -#: ../../library/typing.rst:3036 +#: ../../library/typing.rst:3051 msgid "" "For example, ``List[\"SomeClass\"]`` is implicitly transformed into " "``List[ForwardRef(\"SomeClass\")]``. ``ForwardRef`` should not be " "instantiated by a user, but may be used by introspection tools." msgstr "" -#: ../../library/typing.rst:3041 +#: ../../library/typing.rst:3056 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:3048 +#: ../../library/typing.rst:3063 msgid "Constant" msgstr "常數" -#: ../../library/typing.rst:3052 +#: ../../library/typing.rst:3067 msgid "" "A special constant that is assumed to be ``True`` by 3rd party static type " "checkers. It is ``False`` at runtime." msgstr "" -#: ../../library/typing.rst:3063 +#: ../../library/typing.rst:3078 msgid "" "The first type annotation must be enclosed in quotes, making it a \"forward " "reference\", to hide the ``expensive_mod`` reference from the interpreter " @@ -2833,7 +2853,7 @@ msgid "" "second annotation does not need to be enclosed in quotes." msgstr "" -#: ../../library/typing.rst:3070 +#: ../../library/typing.rst:3085 msgid "" "If ``from __future__ import annotations`` is used, annotations are not " "evaluated at function definition time. Instead, they are stored as strings " @@ -2841,11 +2861,11 @@ msgid "" "annotation (see :pep:`563`)." msgstr "" -#: ../../library/typing.rst:3082 +#: ../../library/typing.rst:3097 msgid "Deprecated aliases" msgstr "棄用的別名" -#: ../../library/typing.rst:3084 +#: ../../library/typing.rst:3099 msgid "" "This module defines several deprecated aliases to pre-existing standard " "library classes. These were originally included in the typing module in " @@ -2854,7 +2874,7 @@ msgid "" "existing classes were enhanced to support ``[]`` (see :pep:`585`)." msgstr "" -#: ../../library/typing.rst:3091 +#: ../../library/typing.rst:3106 msgid "" "The redundant types are deprecated as of Python 3.9. However, while the " "aliases may be removed at some point, removal of these aliases is not " @@ -2862,7 +2882,7 @@ msgid "" "the interpreter for these aliases." msgstr "" -#: ../../library/typing.rst:3096 +#: ../../library/typing.rst:3111 msgid "" "If at some point it is decided to remove these deprecated aliases, a " "deprecation warning will be issued by the interpreter for at least two " @@ -2870,188 +2890,188 @@ msgid "" "typing module without deprecation warnings until at least Python 3.14." msgstr "" -#: ../../library/typing.rst:3101 +#: ../../library/typing.rst:3116 msgid "" "Type checkers are encouraged to flag uses of the deprecated types if the " "program they are checking targets a minimum Python version of 3.9 or newer." msgstr "" -#: ../../library/typing.rst:3107 +#: ../../library/typing.rst:3122 msgid "Aliases to built-in types" msgstr "內建型別的別名" -#: ../../library/typing.rst:3111 +#: ../../library/typing.rst:3126 msgid "Deprecated alias to :class:`dict`." msgstr "棄用 :class:`dict` 的別名。" -#: ../../library/typing.rst:3113 +#: ../../library/typing.rst:3128 msgid "" "Note that to annotate arguments, it is preferred to use an abstract " "collection type such as :class:`Mapping` rather than to use :class:`dict` " "or :class:`!typing.Dict`." msgstr "" -#: ../../library/typing.rst:3117 ../../library/typing.rst:3359 +#: ../../library/typing.rst:3132 ../../library/typing.rst:3374 msgid "This type can be used as follows::" msgstr "" -#: ../../library/typing.rst:3122 +#: ../../library/typing.rst:3137 msgid "" ":class:`builtins.dict ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3128 +#: ../../library/typing.rst:3143 msgid "Deprecated alias to :class:`list`." msgstr "棄用 :class:`list` 的別名。" -#: ../../library/typing.rst:3130 +#: ../../library/typing.rst:3145 msgid "" "Note that to annotate arguments, it is preferred to use an abstract " "collection type such as :class:`Sequence` or :class:`Iterable` rather than " "to use :class:`list` or :class:`!typing.List`." msgstr "" -#: ../../library/typing.rst:3134 +#: ../../library/typing.rst:3149 msgid "This type may be used as follows::" msgstr "" -#: ../../library/typing.rst:3142 +#: ../../library/typing.rst:3157 msgid "" ":class:`builtins.list ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3148 +#: ../../library/typing.rst:3163 msgid "Deprecated alias to :class:`builtins.set `." msgstr "棄用 :class:`builtins.set ` 的別名。" -#: ../../library/typing.rst:3150 +#: ../../library/typing.rst:3165 msgid "" "Note that to annotate arguments, it is preferred to use an abstract " "collection type such as :class:`AbstractSet` rather than to use :class:`set` " "or :class:`!typing.Set`." msgstr "" -#: ../../library/typing.rst:3154 +#: ../../library/typing.rst:3169 msgid "" ":class:`builtins.set ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3160 +#: ../../library/typing.rst:3175 msgid "Deprecated alias to :class:`builtins.frozenset `." msgstr "棄用 :class:`builtins.frozenset ` 的別名。" -#: ../../library/typing.rst:3162 +#: ../../library/typing.rst:3177 msgid "" ":class:`builtins.frozenset ` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3169 +#: ../../library/typing.rst:3184 msgid "Deprecated alias for :class:`tuple`." msgstr "棄用 :class:`tuple` 的別名。" -#: ../../library/typing.rst:3171 +#: ../../library/typing.rst:3186 msgid "" ":class:`tuple` and ``Tuple`` are special-cased in the type system; see :ref:" "`annotating-tuples` for more details." msgstr "" -#: ../../library/typing.rst:3174 +#: ../../library/typing.rst:3189 msgid "" ":class:`builtins.tuple ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3180 +#: ../../library/typing.rst:3195 msgid "Deprecated alias to :class:`type`." msgstr "棄用 :class:`type` 的別名。" -#: ../../library/typing.rst:3182 +#: ../../library/typing.rst:3197 msgid "" "See :ref:`type-of-class-objects` for details on using :class:`type` or " "``typing.Type`` in type annotations." msgstr "" -#: ../../library/typing.rst:3187 +#: ../../library/typing.rst:3202 msgid "" ":class:`builtins.type ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3194 +#: ../../library/typing.rst:3209 msgid "Aliases to types in :mod:`collections`" msgstr ":mod:`collections` 中型別的別名" -#: ../../library/typing.rst:3198 +#: ../../library/typing.rst:3213 msgid "Deprecated alias to :class:`collections.defaultdict`." msgstr "棄用 :class:`collections.defaultdict` 的別名。" -#: ../../library/typing.rst:3202 +#: ../../library/typing.rst:3217 msgid "" ":class:`collections.defaultdict` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3208 +#: ../../library/typing.rst:3223 msgid "Deprecated alias to :class:`collections.OrderedDict`." msgstr "棄用 :class:`collections.OrderedDict` 的別名。" -#: ../../library/typing.rst:3212 +#: ../../library/typing.rst:3227 msgid "" ":class:`collections.OrderedDict` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3218 +#: ../../library/typing.rst:3233 msgid "Deprecated alias to :class:`collections.ChainMap`." msgstr "棄用 :class:`collections.ChainMap` 的別名。" -#: ../../library/typing.rst:3223 +#: ../../library/typing.rst:3238 msgid "" ":class:`collections.ChainMap` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3229 +#: ../../library/typing.rst:3244 msgid "Deprecated alias to :class:`collections.Counter`." msgstr "棄用 :class:`collections.Counter` 的別名。" -#: ../../library/typing.rst:3234 +#: ../../library/typing.rst:3249 msgid "" ":class:`collections.Counter` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3240 +#: ../../library/typing.rst:3255 msgid "Deprecated alias to :class:`collections.deque`." msgstr "棄用 :class:`collections.deque` 的別名。" -#: ../../library/typing.rst:3245 +#: ../../library/typing.rst:3260 msgid "" ":class:`collections.deque` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3252 +#: ../../library/typing.rst:3267 msgid "Aliases to other concrete types" msgstr "" -#: ../../library/typing.rst:3257 +#: ../../library/typing.rst:3272 msgid "" "The ``typing.io`` namespace is deprecated and will be removed. These types " "should be directly imported from ``typing`` instead." msgstr "" -#: ../../library/typing.rst:3261 +#: ../../library/typing.rst:3276 msgid "" "Deprecated aliases corresponding to the return types from :func:`re.compile` " "and :func:`re.match`." msgstr "" -#: ../../library/typing.rst:3264 +#: ../../library/typing.rst:3279 msgid "" "These types (and the corresponding functions) are generic over :data:" "`AnyStr`. ``Pattern`` can be specialised as ``Pattern[str]`` or " @@ -3059,391 +3079,391 @@ msgid "" "``Match[bytes]``." msgstr "" -#: ../../library/typing.rst:3272 +#: ../../library/typing.rst:3287 msgid "" "The ``typing.re`` namespace is deprecated and will be removed. These types " "should be directly imported from ``typing`` instead." msgstr "" -#: ../../library/typing.rst:3273 +#: ../../library/typing.rst:3288 msgid "" "Classes ``Pattern`` and ``Match`` from :mod:`re` now support ``[]``. See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3279 +#: ../../library/typing.rst:3294 msgid "Deprecated alias for :class:`str`." msgstr "棄用 :class:`str` 的別名。" -#: ../../library/typing.rst:3281 +#: ../../library/typing.rst:3296 msgid "" "``Text`` 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:3285 +#: ../../library/typing.rst:3300 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:3293 +#: ../../library/typing.rst:3308 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 " "planned, but users are encouraged to use :class:`str` instead of ``Text``." msgstr "" -#: ../../library/typing.rst:3303 +#: ../../library/typing.rst:3318 msgid "Aliases to container ABCs in :mod:`collections.abc`" msgstr ":mod:`collections.abc` 中容器 ABC 的別名" -#: ../../library/typing.rst:3307 +#: ../../library/typing.rst:3322 msgid "Deprecated alias to :class:`collections.abc.Set`." msgstr "棄用 :class:`collections.abc.Set` 的別名。" -#: ../../library/typing.rst:3309 +#: ../../library/typing.rst:3324 msgid "" ":class:`collections.abc.Set` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3315 +#: ../../library/typing.rst:3330 msgid "" "This type represents the types :class:`bytes`, :class:`bytearray`, and :" "class:`memoryview` of byte sequences." msgstr "" -#: ../../library/typing.rst:3319 +#: ../../library/typing.rst:3334 msgid "" "Prefer :class:`collections.abc.Buffer`, or a union like ``bytes | bytearray " "| memoryview``." msgstr "" -#: ../../library/typing.rst:3323 +#: ../../library/typing.rst:3338 msgid "Deprecated alias to :class:`collections.abc.Collection`." msgstr "棄用 :class:`collections.abc.Collection` 的別名。" -#: ../../library/typing.rst:3327 +#: ../../library/typing.rst:3342 msgid "" ":class:`collections.abc.Collection` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3333 +#: ../../library/typing.rst:3348 msgid "Deprecated alias to :class:`collections.abc.Container`." msgstr "棄用 :class:`collections.abc.Container` 的別名。" -#: ../../library/typing.rst:3335 +#: ../../library/typing.rst:3350 msgid "" ":class:`collections.abc.Container` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3341 +#: ../../library/typing.rst:3356 msgid "Deprecated alias to :class:`collections.abc.ItemsView`." msgstr "棄用 :class:`collections.abc.ItemsView` 的別名。" -#: ../../library/typing.rst:3343 +#: ../../library/typing.rst:3358 msgid "" ":class:`collections.abc.ItemsView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3349 +#: ../../library/typing.rst:3364 msgid "Deprecated alias to :class:`collections.abc.KeysView`." msgstr "棄用 :class:`collections.abc.KeysView` 的別名。" -#: ../../library/typing.rst:3351 +#: ../../library/typing.rst:3366 msgid "" ":class:`collections.abc.KeysView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3357 +#: ../../library/typing.rst:3372 msgid "Deprecated alias to :class:`collections.abc.Mapping`." msgstr "棄用 :class:`collections.abc.Mapping` 的別名。" -#: ../../library/typing.rst:3364 +#: ../../library/typing.rst:3379 msgid "" ":class:`collections.abc.Mapping` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3370 +#: ../../library/typing.rst:3385 msgid "Deprecated alias to :class:`collections.abc.MappingView`." msgstr "棄用 :class:`collections.abc.MappingView` 的別名。" -#: ../../library/typing.rst:3372 +#: ../../library/typing.rst:3387 msgid "" ":class:`collections.abc.MappingView` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3378 +#: ../../library/typing.rst:3393 msgid "Deprecated alias to :class:`collections.abc.MutableMapping`." msgstr "棄用 :class:`collections.abc.MutableMapping` 的別名。" -#: ../../library/typing.rst:3380 +#: ../../library/typing.rst:3395 msgid "" ":class:`collections.abc.MutableMapping` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3387 +#: ../../library/typing.rst:3402 msgid "Deprecated alias to :class:`collections.abc.MutableSequence`." msgstr "棄用 :class:`collections.abc.MutableSequence` 的別名。" -#: ../../library/typing.rst:3389 +#: ../../library/typing.rst:3404 msgid "" ":class:`collections.abc.MutableSequence` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3396 +#: ../../library/typing.rst:3411 msgid "Deprecated alias to :class:`collections.abc.MutableSet`." msgstr "棄用 :class:`collections.abc.MutableSet` 的別名。" -#: ../../library/typing.rst:3398 +#: ../../library/typing.rst:3413 msgid "" ":class:`collections.abc.MutableSet` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3404 +#: ../../library/typing.rst:3419 msgid "Deprecated alias to :class:`collections.abc.Sequence`." msgstr "棄用 :class:`collections.abc.Sequence` 的別名。" -#: ../../library/typing.rst:3406 +#: ../../library/typing.rst:3421 msgid "" ":class:`collections.abc.Sequence` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3412 +#: ../../library/typing.rst:3427 msgid "Deprecated alias to :class:`collections.abc.ValuesView`." msgstr "棄用 :class:`collections.abc.ValuesView` 的別名。" -#: ../../library/typing.rst:3414 +#: ../../library/typing.rst:3429 msgid "" ":class:`collections.abc.ValuesView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3421 +#: ../../library/typing.rst:3436 msgid "Aliases to asynchronous ABCs in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:3425 +#: ../../library/typing.rst:3440 msgid "Deprecated alias to :class:`collections.abc.Coroutine`." msgstr "棄用 :class:`collections.abc.Coroutine` 的別名。" -#: ../../library/typing.rst:3427 +#: ../../library/typing.rst:3442 msgid "" "The variance and order of type variables correspond to those of :class:" "`Generator`, for example::" msgstr "" -#: ../../library/typing.rst:3438 +#: ../../library/typing.rst:3453 msgid "" ":class:`collections.abc.Coroutine` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3444 +#: ../../library/typing.rst:3459 msgid "Deprecated alias to :class:`collections.abc.AsyncGenerator`." msgstr "棄用 :class:`collections.abc.AsyncGenerator` 的別名。" -#: ../../library/typing.rst:3446 +#: ../../library/typing.rst:3461 msgid "" "An async generator can be annotated by the generic type " "``AsyncGenerator[YieldType, SendType]``. For example::" msgstr "" -#: ../../library/typing.rst:3455 +#: ../../library/typing.rst:3470 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:3459 +#: ../../library/typing.rst:3474 msgid "" "If your generator will only yield values, set the ``SendType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:3467 +#: ../../library/typing.rst:3482 msgid "" "Alternatively, annotate your generator as having a return type of either " "``AsyncIterable[YieldType]`` or ``AsyncIterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:3477 +#: ../../library/typing.rst:3492 msgid "" ":class:`collections.abc.AsyncGenerator` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3484 +#: ../../library/typing.rst:3499 msgid "Deprecated alias to :class:`collections.abc.AsyncIterable`." msgstr "棄用 :class:`collections.abc.AsyncIterable` 的別名。" -#: ../../library/typing.rst:3488 +#: ../../library/typing.rst:3503 msgid "" ":class:`collections.abc.AsyncIterable` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3494 +#: ../../library/typing.rst:3509 msgid "Deprecated alias to :class:`collections.abc.AsyncIterator`." msgstr "棄用 :class:`collections.abc.AsyncIterator` 的別名。" -#: ../../library/typing.rst:3498 +#: ../../library/typing.rst:3513 msgid "" ":class:`collections.abc.AsyncIterator` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3504 +#: ../../library/typing.rst:3519 msgid "Deprecated alias to :class:`collections.abc.Awaitable`." msgstr "棄用 :class:`collections.abc.Awaitable` 的別名。" -#: ../../library/typing.rst:3508 +#: ../../library/typing.rst:3523 msgid "" ":class:`collections.abc.Awaitable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3515 +#: ../../library/typing.rst:3530 msgid "Aliases to other ABCs in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:3519 +#: ../../library/typing.rst:3534 msgid "Deprecated alias to :class:`collections.abc.Iterable`." msgstr "棄用 :class:`collections.abc.Iterable` 的別名。" -#: ../../library/typing.rst:3521 +#: ../../library/typing.rst:3536 msgid "" ":class:`collections.abc.Iterable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3527 +#: ../../library/typing.rst:3542 msgid "Deprecated alias to :class:`collections.abc.Iterator`." msgstr "棄用 :class:`collections.abc.Iterator` 的別名。" -#: ../../library/typing.rst:3529 +#: ../../library/typing.rst:3544 msgid "" ":class:`collections.abc.Iterator` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3535 +#: ../../library/typing.rst:3550 msgid "Deprecated alias to :class:`collections.abc.Callable`." msgstr "棄用 :class:`collections.abc.Callable` 的別名。" -#: ../../library/typing.rst:3537 +#: ../../library/typing.rst:3552 msgid "" "See :ref:`annotating-callables` for details on how to use :class:" "`collections.abc.Callable` and ``typing.Callable`` in type annotations." msgstr "" -#: ../../library/typing.rst:3540 +#: ../../library/typing.rst:3555 msgid "" ":class:`collections.abc.Callable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3550 +#: ../../library/typing.rst:3565 msgid "Deprecated alias to :class:`collections.abc.Generator`." msgstr "棄用 :class:`collections.abc.Generator` 的別名。" -#: ../../library/typing.rst:3552 +#: ../../library/typing.rst:3567 msgid "" "A generator can be annotated by the generic type ``Generator[YieldType, " "SendType, ReturnType]``. For example::" msgstr "" -#: ../../library/typing.rst:3561 +#: ../../library/typing.rst:3576 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:3565 +#: ../../library/typing.rst:3580 msgid "" "If your generator will only yield values, set the ``SendType`` and " "``ReturnType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:3573 +#: ../../library/typing.rst:3588 msgid "" "Alternatively, annotate your generator as having a return type of either " "``Iterable[YieldType]`` or ``Iterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:3581 +#: ../../library/typing.rst:3596 msgid "" ":class:`collections.abc.Generator` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3587 +#: ../../library/typing.rst:3602 msgid "Deprecated alias to :class:`collections.abc.Hashable`." msgstr "棄用 :class:`collections.abc.Hashable` 的別名。" -#: ../../library/typing.rst:3589 +#: ../../library/typing.rst:3604 msgid "Use :class:`collections.abc.Hashable` directly instead." msgstr "改為直接使用 :class:`collections.abc.Hashable`。" -#: ../../library/typing.rst:3594 +#: ../../library/typing.rst:3609 msgid "Deprecated alias to :class:`collections.abc.Reversible`." msgstr "棄用 :class:`collections.abc.Reversible` 的別名。" -#: ../../library/typing.rst:3596 +#: ../../library/typing.rst:3611 msgid "" ":class:`collections.abc.Reversible` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3602 +#: ../../library/typing.rst:3617 msgid "Deprecated alias to :class:`collections.abc.Sized`." msgstr "棄用 :class:`collections.abc.Sized` 的別名。" -#: ../../library/typing.rst:3604 +#: ../../library/typing.rst:3619 msgid "Use :class:`collections.abc.Sized` directly instead." msgstr "改為直接使用 :class:`collections.abc.Sized`。" -#: ../../library/typing.rst:3610 +#: ../../library/typing.rst:3625 msgid "Aliases to :mod:`contextlib` ABCs" msgstr ":mod:`contextlib` ABC 的別名" -#: ../../library/typing.rst:3614 +#: ../../library/typing.rst:3629 msgid "Deprecated alias to :class:`contextlib.AbstractContextManager`." msgstr "" -#: ../../library/typing.rst:3619 +#: ../../library/typing.rst:3634 msgid "" ":class:`contextlib.AbstractContextManager` now supports subscripting " "(``[]``). See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3626 +#: ../../library/typing.rst:3641 msgid "Deprecated alias to :class:`contextlib.AbstractAsyncContextManager`." msgstr "" -#: ../../library/typing.rst:3631 +#: ../../library/typing.rst:3646 msgid "" ":class:`contextlib.AbstractAsyncContextManager` now supports subscripting " "(``[]``). See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3637 +#: ../../library/typing.rst:3652 msgid "Deprecation Timeline of Major Features" msgstr "" -#: ../../library/typing.rst:3639 +#: ../../library/typing.rst:3654 msgid "" "Certain features in ``typing`` are deprecated and may be removed in a future " "version of Python. The following table summarizes major deprecations for " @@ -3451,99 +3471,99 @@ msgid "" "listed." msgstr "" -#: ../../library/typing.rst:3646 +#: ../../library/typing.rst:3661 msgid "Feature" msgstr "" -#: ../../library/typing.rst:3647 +#: ../../library/typing.rst:3662 msgid "Deprecated in" msgstr "棄用於" -#: ../../library/typing.rst:3648 +#: ../../library/typing.rst:3663 msgid "Projected removal" msgstr "" -#: ../../library/typing.rst:3649 +#: ../../library/typing.rst:3664 msgid "PEP/issue" msgstr "" -#: ../../library/typing.rst:3650 +#: ../../library/typing.rst:3665 msgid "``typing.io`` and ``typing.re`` submodules" msgstr "``typing.io`` 和 ``typing.re`` 子模組" -#: ../../library/typing.rst:3651 +#: ../../library/typing.rst:3666 msgid "3.8" msgstr "3.8" -#: ../../library/typing.rst:3652 +#: ../../library/typing.rst:3667 msgid "3.13" msgstr "3.13" -#: ../../library/typing.rst:3653 +#: ../../library/typing.rst:3668 msgid ":issue:`38291`" msgstr ":issue:`38291`" -#: ../../library/typing.rst:3654 +#: ../../library/typing.rst:3669 msgid "``typing`` versions of standard collections" msgstr "" -#: ../../library/typing.rst:3655 ../../library/typing.rst:3659 +#: ../../library/typing.rst:3670 ../../library/typing.rst:3674 msgid "3.9" msgstr "3.9" -#: ../../library/typing.rst:3656 +#: ../../library/typing.rst:3671 msgid "Undecided (see :ref:`deprecated-aliases` for more information)" msgstr "" -#: ../../library/typing.rst:3657 +#: ../../library/typing.rst:3672 msgid ":pep:`585`" msgstr ":pep:`585`" -#: ../../library/typing.rst:3658 +#: ../../library/typing.rst:3673 msgid ":class:`typing.ByteString`" msgstr ":class:`typing.ByteString`" -#: ../../library/typing.rst:3660 +#: ../../library/typing.rst:3675 msgid "3.14" msgstr "3.14" -#: ../../library/typing.rst:3661 +#: ../../library/typing.rst:3676 msgid ":gh:`91896`" msgstr ":gh:`91896`" -#: ../../library/typing.rst:3662 +#: ../../library/typing.rst:3677 msgid ":data:`typing.Text`" msgstr ":data:`typing.Text`" -#: ../../library/typing.rst:3663 +#: ../../library/typing.rst:3678 msgid "3.11" msgstr "3.11" -#: ../../library/typing.rst:3664 ../../library/typing.rst:3668 -#: ../../library/typing.rst:3672 +#: ../../library/typing.rst:3679 ../../library/typing.rst:3683 +#: ../../library/typing.rst:3687 msgid "Undecided" msgstr "" -#: ../../library/typing.rst:3665 +#: ../../library/typing.rst:3680 msgid ":gh:`92332`" msgstr ":gh:`92332`" -#: ../../library/typing.rst:3666 +#: ../../library/typing.rst:3681 msgid ":class:`typing.Hashable` and :class:`typing.Sized`" msgstr ":class:`typing.Hashable` 和 :class:`typing.Sized`。" -#: ../../library/typing.rst:3667 ../../library/typing.rst:3671 +#: ../../library/typing.rst:3682 ../../library/typing.rst:3686 msgid "3.12" msgstr "" -#: ../../library/typing.rst:3669 +#: ../../library/typing.rst:3684 msgid ":gh:`94309`" msgstr ":gh:`94309`" -#: ../../library/typing.rst:3670 +#: ../../library/typing.rst:3685 msgid ":data:`typing.TypeAlias`" msgstr ":data:`typing.TypeAlias`" -#: ../../library/typing.rst:3673 +#: ../../library/typing.rst:3688 msgid ":pep:`695`" msgstr ":pep:`695`" diff --git a/library/urllib.error.po b/library/urllib.error.po index 5f9fa4e6df..6a7e30dd7a 100644 --- a/library/urllib.error.po +++ b/library/urllib.error.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 10:36+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2022-06-11 15:34+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -60,10 +60,11 @@ msgstr "此錯誤的原因。它可以是一個訊息字串或另一個例外實 #: ../../library/urllib.error.rst:29 msgid "" -":exc:`URLError` has been made a subclass of :exc:`OSError` instead of :exc:" -"`IOError`." +":exc:`URLError` used to be a subtype of :exc:`IOError`, which is now an " +"alias of :exc:`OSError`." msgstr "" -":exc:`URLError` 已被設為 :exc:`OSError` 而不是 :exc:`IOError` 的子類別。" +":exc:`URLError` 過去是 :exc:`OSError` 的子類別,但現在為 :exc:`OSError` 的別" +"名。" #: ../../library/urllib.error.rst:36 msgid "" @@ -78,7 +79,7 @@ msgstr "" #: ../../library/urllib.error.rst:44 msgid "Contains the request URL. An alias for *filename* attribute." -msgstr "" +msgstr "包含請求 URL。*filename* 屬性的別名。" #: ../../library/urllib.error.rst:49 msgid "" @@ -105,7 +106,7 @@ msgstr "" #: ../../library/urllib.error.rst:68 msgid "A file-like object where the HTTP error body can be read from." -msgstr "" +msgstr "一個類檔案物件,可以從中讀取 HTTP 錯誤主體 (body)。" #: ../../library/urllib.error.rst:72 msgid "" diff --git a/library/urllib.parse.po b/library/urllib.parse.po index 83389d4993..633427da03 100644 --- a/library/urllib.parse.po +++ b/library/urllib.parse.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-06 00:19+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+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-" @@ -705,11 +705,11 @@ msgstr "" #: ../../library/urllib.parse.rst:601 msgid "" -"Replace special characters in *string* using the ``%xx`` escape. Letters, " -"digits, and the characters ``'_.-~'`` are never quoted. By default, this " -"function is intended for quoting the path section of a URL. The optional " -"*safe* parameter specifies additional ASCII characters that should not be " -"quoted --- its default value is ``'/'``." +"Replace special characters in *string* using the :samp:`%{xx}` escape. " +"Letters, digits, and the characters ``'_.-~'`` are never quoted. By default, " +"this function is intended for quoting the path section of a URL. The " +"optional *safe* parameter specifies additional ASCII characters that should " +"not be quoted --- its default value is ``'/'``." msgstr "" #: ../../library/urllib.parse.rst:607 ../../library/urllib.parse.rst:653 @@ -767,10 +767,10 @@ msgstr "" #: ../../library/urllib.parse.rst:648 msgid "" -"Replace ``%xx`` escapes with their single-character equivalent. The optional " -"*encoding* and *errors* parameters specify how to decode percent-encoded " -"sequences into Unicode characters, as accepted by the :meth:`bytes.decode` " -"method." +"Replace :samp:`%{xx}` escapes with their single-character equivalent. The " +"optional *encoding* and *errors* parameters specify how to decode percent-" +"encoded sequences into Unicode characters, as accepted by the :meth:`bytes." +"decode` method." msgstr "" #: ../../library/urllib.parse.rst:655 @@ -804,8 +804,8 @@ msgstr "" #: ../../library/urllib.parse.rst:679 msgid "" -"Replace ``%xx`` escapes with their single-octet equivalent, and return a :" -"class:`bytes` object." +"Replace :samp:`%{xx}` escapes with their single-octet equivalent, and return " +"a :class:`bytes` object." msgstr "" #: ../../library/urllib.parse.rst:684 diff --git a/library/venv.po b/library/venv.po index 9b857481d1..65b4bad59c 100644 --- a/library/venv.po +++ b/library/venv.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-24 00:03+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2023-07-09 15:09+0800\n" "Last-Translator: Po-Chuan Chen \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -46,10 +46,45 @@ msgid "" msgstr "" #: ../../library/venv.rst:33 +msgid "A virtual environment is (amongst other things):" +msgstr "" + +#: ../../library/venv.rst:35 +msgid "" +"Used to contain a specific Python interpreter and software libraries and " +"binaries which are needed to support a project (library or application). " +"These are by default isolated from software in other virtual environments " +"and Python interpreters and libraries installed in the operating system." +msgstr "" + +#: ../../library/venv.rst:40 +msgid "" +"Contained in a directory, conventionally either named ``venv`` or ``.venv`` " +"in the project directory, or under a container directory for lots of virtual " +"environments, such as ``~/.virtualenvs``." +msgstr "" + +#: ../../library/venv.rst:44 +msgid "Not checked into source control systems such as Git." +msgstr "" + +#: ../../library/venv.rst:46 +msgid "" +"Considered as disposable -- it should be simple to delete and recreate it " +"from scratch. You don't place any project code in the environment" +msgstr "" + +#: ../../library/venv.rst:49 +msgid "" +"Not considered as movable or copyable -- you just recreate the same " +"environment in the target location." +msgstr "" + +#: ../../library/venv.rst:52 msgid "See :pep:`405` for more background on Python virtual environments." msgstr "更多關於 Python 虛擬環境的背景資訊請見 :pep:`405`\\ 。" -#: ../../library/venv.rst:37 +#: ../../library/venv.rst:56 msgid "" "`Python Packaging User Guide: Creating and using virtual environments " "}` 需要替換成包含虛擬環" "境的目錄路徑)" -#: ../../library/venv.rst:71 +#: ../../library/venv.rst:90 msgid "Platform" msgstr "平台" -#: ../../library/venv.rst:71 +#: ../../library/venv.rst:90 msgid "Shell" msgstr "Shell" -#: ../../library/venv.rst:71 +#: ../../library/venv.rst:90 msgid "Command to activate virtual environment" msgstr "啟動虛擬環境的指令" -#: ../../library/venv.rst:73 +#: ../../library/venv.rst:92 msgid "POSIX" msgstr "POSIX" -#: ../../library/venv.rst:73 +#: ../../library/venv.rst:92 msgid "bash/zsh" msgstr "bash/zsh" -#: ../../library/venv.rst:73 +#: ../../library/venv.rst:92 msgid ":samp:`$ source {}/bin/activate`" msgstr ":samp:`$ source {}/bin/activate`" -#: ../../library/venv.rst:75 +#: ../../library/venv.rst:94 msgid "fish" msgstr "fish" -#: ../../library/venv.rst:75 +#: ../../library/venv.rst:94 msgid ":samp:`$ source {}/bin/activate.fish`" msgstr ":samp:`$ source {}/bin/activate.fish`" -#: ../../library/venv.rst:77 +#: ../../library/venv.rst:96 msgid "csh/tcsh" msgstr "csh/tcsh" -#: ../../library/venv.rst:77 +#: ../../library/venv.rst:96 msgid ":samp:`$ source {}/bin/activate.csh`" msgstr ":samp:`$ source {}/bin/activate.csh`" -#: ../../library/venv.rst:79 ../../library/venv.rst:83 +#: ../../library/venv.rst:98 ../../library/venv.rst:102 msgid "PowerShell" msgstr "PowerShell" -#: ../../library/venv.rst:79 +#: ../../library/venv.rst:98 msgid ":samp:`$ {}/bin/Activate.ps1`" msgstr ":samp:`$ {}/bin/Activate.ps1`" -#: ../../library/venv.rst:81 +#: ../../library/venv.rst:100 msgid "Windows" msgstr "Windows" -#: ../../library/venv.rst:81 +#: ../../library/venv.rst:100 msgid "cmd.exe" msgstr "cmd.exe" -#: ../../library/venv.rst:81 +#: ../../library/venv.rst:100 msgid ":samp:`C:\\\\> {}\\\\Scripts\\\\activate.bat`" msgstr ":samp:`C:\\\\> {}\\\\Scripts\\\\activate.bat`" -#: ../../library/venv.rst:83 +#: ../../library/venv.rst:102 msgid ":samp:`PS C:\\\\> {}\\\\Scripts\\\\Activate.ps1`" msgstr ":samp:`PS C:\\\\> {}\\\\Scripts\\\\Activate.ps1`" -#: ../../library/venv.rst:86 +#: ../../library/venv.rst:105 msgid ":program:`fish` and :program:`csh` activation scripts." msgstr ":program:`fish` 和 :program:`csh` 啟動腳本。" -#: ../../library/venv.rst:89 +#: ../../library/venv.rst:108 msgid "" "PowerShell activation scripts installed under POSIX for PowerShell Core " "support." msgstr "PowerShell 的啟動腳本安裝在 POSIX 上支援 PowerShell Core。" -#: ../../library/venv.rst:93 +#: ../../library/venv.rst:112 msgid "" "You don't specifically *need* to activate a virtual environment, as you can " "just specify the full path to that environment's Python interpreter when " @@ -331,7 +366,7 @@ msgstr "" "整路徑。此外,所有安裝在環境裡的腳本都應該都可以在未啟用虛擬環境的情況下運" "行。" -#: ../../library/venv.rst:99 +#: ../../library/venv.rst:118 msgid "" "In order to achieve this, scripts installed into virtual environments have a " "\"shebang\" line which points to the environment's Python interpreter, i.e. :" @@ -349,7 +384,7 @@ msgstr "" "(Windows Explorer)中雙擊已安裝的腳本,應該可以在沒有啟用環境或將其加入 :" "envvar:`PATH` 的情況下正確地運行。" -#: ../../library/venv.rst:108 +#: ../../library/venv.rst:127 msgid "" "When a virtual environment has been activated, the :envvar:`!VIRTUAL_ENV` " "environment variable is set to the path of the environment. Since explicitly " @@ -361,7 +396,7 @@ msgstr "" "於不需要明確啟用虛擬環境才能使用它。因此,無法依賴 :envvar:`!VIRTUAL_ENV` 來" "判斷是否正在使用虛擬環境。" -#: ../../library/venv.rst:114 +#: ../../library/venv.rst:133 msgid "" "Because scripts installed in environments should not expect the environment " "to be activated, their shebang lines contain the absolute paths to their " @@ -378,13 +413,13 @@ msgid "" msgstr "" "因為安裝在環境中的腳本不應該預期該環境已經被啟動,所以它們的 shebang 列會包含" "環境直譯器的絕對路徑。因此,在一般情況下,環境本質上是不可攜帶的。你應該使用" -"一個簡單的方法來重新建立一個環境(例如:如果你有一個名為 ``requirements.txt`` " -"的需求檔案,你可以使用環境的 ``pip install -r requirements.txt`` 來安裝環境所" -"需的所有套件)。如果出於某種原因,你需要將環境移至新位置,你應該在所需位置重" -"新建立它,並刪除舊位置的環境。如果你移動環境是因為移動了其父目錄,你應該在新" -"位置重新建立環境。否則,安裝在該環境中的軟體可能無法正常運作。" +"一個簡單的方法來重新建立一個環境(例如:如果你有一個名為 ``requirements." +"txt`` 的需求檔案,你可以使用環境的 ``pip install -r requirements.txt`` 來安裝" +"環境所需的所有套件)。如果出於某種原因,你需要將環境移至新位置,你應該在所需" +"位置重新建立它,並刪除舊位置的環境。如果你移動環境是因為移動了其父目錄,你應" +"該在新位置重新建立環境。否則,安裝在該環境中的軟體可能無法正常運作。" -#: ../../library/venv.rst:128 +#: ../../library/venv.rst:147 msgid "" "You can deactivate a virtual environment by typing ``deactivate`` in your " "shell. The exact mechanism is platform-specific and is an internal " @@ -393,11 +428,11 @@ msgstr "" "你可以在 shell 輸入 ``deactivate`` 來關閉虛擬環境。具體的使用方式因平台而異," "是內部實作的細節(通常會使用腳本或是 shell 函式)" -#: ../../library/venv.rst:136 +#: ../../library/venv.rst:155 msgid "API" msgstr "API" -#: ../../library/venv.rst:140 +#: ../../library/venv.rst:159 msgid "" "The high-level method described above makes use of a simple API which " "provides mechanisms for third-party virtual environment creators to " @@ -407,13 +442,13 @@ msgstr "" "上述提到的高階 method(方法)透過簡單的 API 使用, 為第三方虛擬環境建立者提供" "可以依據他們需求來建立環境的客製化機制: :class:`EnvBuilder` class。" -#: ../../library/venv.rst:148 +#: ../../library/venv.rst:167 msgid "" "The :class:`EnvBuilder` class accepts the following keyword arguments on " "instantiation:" msgstr "進行實例化時,class :class:`EnvBuilder` 接受下列的關鍵字引數:" -#: ../../library/venv.rst:151 +#: ../../library/venv.rst:170 msgid "" "``system_site_packages`` -- a Boolean value indicating that the system " "Python site-packages should be available to the environment (defaults to " @@ -422,7 +457,7 @@ msgstr "" "``system_site_packages`` -- 為一個 Boolean (布林值),並表明系統的 Python " "site-packages 是否可以在環境中可用(預設為 ``False`` )。" -#: ../../library/venv.rst:154 +#: ../../library/venv.rst:173 msgid "" "``clear`` -- a Boolean value which, if true, will delete the contents of any " "existing target directory, before creating the environment." @@ -430,7 +465,7 @@ msgstr "" "``clear`` -- 為一個 Boolean,如果為 true,則在建立環境之前,刪除目標目錄內所" "有存在的內容。" -#: ../../library/venv.rst:157 +#: ../../library/venv.rst:176 msgid "" "``symlinks`` -- a Boolean value indicating whether to attempt to symlink the " "Python binary rather than copying." @@ -438,7 +473,7 @@ msgstr "" "``symlinks`` -- 為一個 Boolean,並表明是否嘗試與 Python 二進位檔案建立符號連" "結而不是複製該檔案。" -#: ../../library/venv.rst:160 +#: ../../library/venv.rst:179 msgid "" "``upgrade`` -- a Boolean value which, if true, will upgrade an existing " "environment with the running Python - for use when that Python has been " @@ -447,7 +482,7 @@ msgstr "" "``upgrade`` -- 為一個 Boolean,若為 true,則會在執行 Python 時為現有的環境進" "行升級。目的是讓 Python 可以升級到位(預設為 ``False``)。" -#: ../../library/venv.rst:164 +#: ../../library/venv.rst:183 msgid "" "``with_pip`` -- a Boolean value which, if true, ensures pip is installed in " "the virtual environment. This uses :mod:`ensurepip` with the ``--default-" @@ -456,7 +491,7 @@ msgstr "" "``with_pip`` -- 為一個 Boolean,若為 true,則確保 pip 有安裝至虛擬環境之中。" "當有 ``--default-pip`` 的選項時,會使用 :mod:`ensurepip`。" -#: ../../library/venv.rst:168 +#: ../../library/venv.rst:187 msgid "" "``prompt`` -- a String to be used after virtual environment is activated " "(defaults to ``None`` which means directory name of the environment would be " @@ -467,23 +502,23 @@ msgstr "" "為 ``None``,代表該環境的目錄名稱會被使用)倘若出現特殊字串 ``\".\"`` ,則當" "前目錄的 basename 會做為提示路徑使用。" -#: ../../library/venv.rst:173 +#: ../../library/venv.rst:192 msgid "``upgrade_deps`` -- Update the base venv modules to the latest on PyPI" msgstr "``upgrade_deps`` -- 更新基礎 venv 模組至 PyPI 的最新版本" -#: ../../library/venv.rst:175 ../../library/venv.rst:353 +#: ../../library/venv.rst:194 ../../library/venv.rst:372 msgid "Added the ``with_pip`` parameter" msgstr "新增 ``with_pip`` 參數" -#: ../../library/venv.rst:178 ../../library/venv.rst:356 +#: ../../library/venv.rst:197 ../../library/venv.rst:375 msgid "Added the ``prompt`` parameter" msgstr "新增 ``prompt`` 參數" -#: ../../library/venv.rst:181 ../../library/venv.rst:359 +#: ../../library/venv.rst:200 ../../library/venv.rst:378 msgid "Added the ``upgrade_deps`` parameter" msgstr "新增 ``upgrade_deps`` 參數" -#: ../../library/venv.rst:184 +#: ../../library/venv.rst:203 msgid "" "Creators of third-party virtual environment tools will be free to use the " "provided :class:`EnvBuilder` class as a base class." @@ -491,11 +526,11 @@ msgstr "" "第三方虛擬環境工具的建立者可以自由地使用 :class:`EnvBuilder` class 作為 base " "class(基底類別)使用." -#: ../../library/venv.rst:187 +#: ../../library/venv.rst:206 msgid "The returned env-builder is an object which has a method, ``create``:" msgstr "回傳的 env-builder 為一個物件,且帶有一個 method ``create``:" -#: ../../library/venv.rst:191 +#: ../../library/venv.rst:210 msgid "" "Create a virtual environment by specifying the target directory (absolute or " "relative to the current directory) which is to contain the virtual " @@ -506,7 +541,7 @@ msgstr "" "目錄),也就是在該目錄中容納虛擬環境。``create`` method 將會在指定的目錄下建" "立環境,或是觸發適當的例外。" -#: ../../library/venv.rst:197 +#: ../../library/venv.rst:216 msgid "" "The ``create`` method of the :class:`EnvBuilder` class illustrates the hooks " "available for subclass customization::" @@ -514,7 +549,7 @@ msgstr "" ":class:`EnvBuilder` class 的 ``create`` method 會闡述可用的 Hooks 以客製化 " "subclass (子類別)::" -#: ../../library/venv.rst:212 +#: ../../library/venv.rst:231 msgid "" "Each of the methods :meth:`ensure_directories`, :meth:" "`create_configuration`, :meth:`setup_python`, :meth:`setup_scripts` and :" @@ -523,7 +558,7 @@ msgstr "" "每個 methods :meth:`ensure_directories`、:meth:`create_configuration`、:meth:" "`setup_python`、:meth:`setup_scripts` 及 :meth:`post_setup` 都可以被覆寫。" -#: ../../library/venv.rst:218 +#: ../../library/venv.rst:237 msgid "" "Creates the environment directory and all necessary subdirectories that " "don't already exist, and returns a context object. This context object is " @@ -537,7 +572,7 @@ msgstr "" "class:`EnvBuilder` 已被建立且帶有 ``clear=True`` 的引數,該環境目錄下的內容將" "被清空,以及所有必要的子目錄將被重新建立。" -#: ../../library/venv.rst:225 +#: ../../library/venv.rst:244 msgid "" "The returned context object is a :class:`types.SimpleNamespace` with the " "following attributes:" @@ -545,81 +580,81 @@ msgstr "" "回傳的情境物件(context object)其型別會是 :class:`types.SimpleNamespace`,並" "包含以下屬性:" -#: ../../library/venv.rst:228 +#: ../../library/venv.rst:247 msgid "" "``env_dir`` - The location of the virtual environment. Used for " "``__VENV_DIR__`` in activation scripts (see :meth:`install_scripts`)." msgstr "" -#: ../../library/venv.rst:231 +#: ../../library/venv.rst:250 msgid "" "``env_name`` - The name of the virtual environment. Used for " "``__VENV_NAME__`` in activation scripts (see :meth:`install_scripts`)." msgstr "" -#: ../../library/venv.rst:234 +#: ../../library/venv.rst:253 msgid "" "``prompt`` - The prompt to be used by the activation scripts. Used for " "``__VENV_PROMPT__`` in activation scripts (see :meth:`install_scripts`)." msgstr "" -#: ../../library/venv.rst:237 +#: ../../library/venv.rst:256 msgid "" "``executable`` - The underlying Python executable used by the virtual " "environment. This takes into account the case where a virtual environment is " "created from another virtual environment." msgstr "" -#: ../../library/venv.rst:241 +#: ../../library/venv.rst:260 msgid "``inc_path`` - The include path for the virtual environment." msgstr "" -#: ../../library/venv.rst:243 +#: ../../library/venv.rst:262 msgid "``lib_path`` - The purelib path for the virtual environment." msgstr "" -#: ../../library/venv.rst:245 +#: ../../library/venv.rst:264 msgid "``bin_path`` - The script path for the virtual environment." msgstr "" -#: ../../library/venv.rst:247 +#: ../../library/venv.rst:266 msgid "" "``bin_name`` - The name of the script path relative to the virtual " "environment location. Used for ``__VENV_BIN_NAME__`` in activation scripts " "(see :meth:`install_scripts`)." msgstr "" -#: ../../library/venv.rst:251 +#: ../../library/venv.rst:270 msgid "" "``env_exe`` - The name of the Python interpreter in the virtual environment. " "Used for ``__VENV_PYTHON__`` in activation scripts (see :meth:" "`install_scripts`)." msgstr "" -#: ../../library/venv.rst:255 +#: ../../library/venv.rst:274 msgid "" "``env_exec_cmd`` - The name of the Python interpreter, taking into account " "filesystem redirections. This can be used to run Python in the virtual " "environment." msgstr "" -#: ../../library/venv.rst:260 +#: ../../library/venv.rst:279 msgid "" "The attribute ``lib_path`` was added to the context, and the context object " "was documented." msgstr "" -#: ../../library/venv.rst:264 +#: ../../library/venv.rst:283 msgid "" "The *venv* :ref:`sysconfig installation scheme ` is used " "to construct the paths of the created directories." msgstr "" -#: ../../library/venv.rst:271 +#: ../../library/venv.rst:290 msgid "Creates the ``pyvenv.cfg`` configuration file in the environment." msgstr "" -#: ../../library/venv.rst:275 +#: ../../library/venv.rst:294 msgid "" "Creates a copy or symlink to the Python executable in the environment. On " "POSIX systems, if a specific executable ``python3.x`` was used, symlinks to " @@ -627,48 +662,48 @@ msgid "" "unless files with those names already exist." msgstr "" -#: ../../library/venv.rst:282 +#: ../../library/venv.rst:301 msgid "" "Installs activation scripts appropriate to the platform into the virtual " "environment." msgstr "" -#: ../../library/venv.rst:287 +#: ../../library/venv.rst:306 msgid "" "Upgrades the core venv dependency packages (currently ``pip``) in the " "environment. This is done by shelling out to the ``pip`` executable in the " "environment." msgstr "" -#: ../../library/venv.rst:298 +#: ../../library/venv.rst:317 msgid "" "A placeholder method which can be overridden in third party implementations " "to pre-install packages in the virtual environment or perform other post-" "creation steps." msgstr "" -#: ../../library/venv.rst:302 +#: ../../library/venv.rst:321 msgid "" "Windows now uses redirector scripts for ``python[w].exe`` instead of copying " "the actual binaries. In 3.7.2 only :meth:`setup_python` does nothing unless " "running from a build in the source tree." msgstr "" -#: ../../library/venv.rst:307 +#: ../../library/venv.rst:326 msgid "" "Windows copies the redirector scripts as part of :meth:`setup_python` " "instead of :meth:`setup_scripts`. This was not the case in 3.7.2. When using " "symlinks, the original executables will be linked." msgstr "" -#: ../../library/venv.rst:312 +#: ../../library/venv.rst:331 msgid "" "In addition, :class:`EnvBuilder` provides this utility method that can be " "called from :meth:`setup_scripts` or :meth:`post_setup` in subclasses to " "assist in installing custom scripts into the virtual environment." msgstr "" -#: ../../library/venv.rst:318 +#: ../../library/venv.rst:337 msgid "" "*path* is the path to a directory that should contain subdirectories " "\"common\", \"posix\", \"nt\", each containing scripts destined for the bin " @@ -677,64 +712,64 @@ msgid "" "placeholders:" msgstr "" -#: ../../library/venv.rst:324 +#: ../../library/venv.rst:343 msgid "" "``__VENV_DIR__`` is replaced with the absolute path of the environment " "directory." msgstr "" -#: ../../library/venv.rst:327 +#: ../../library/venv.rst:346 msgid "" "``__VENV_NAME__`` is replaced with the environment name (final path segment " "of environment directory)." msgstr "" -#: ../../library/venv.rst:330 +#: ../../library/venv.rst:349 msgid "" "``__VENV_PROMPT__`` is replaced with the prompt (the environment name " "surrounded by parentheses and with a following space)" msgstr "" -#: ../../library/venv.rst:333 +#: ../../library/venv.rst:352 msgid "" "``__VENV_BIN_NAME__`` is replaced with the name of the bin directory (either " "``bin`` or ``Scripts``)." msgstr "" -#: ../../library/venv.rst:336 +#: ../../library/venv.rst:355 msgid "" "``__VENV_PYTHON__`` is replaced with the absolute path of the environment's " "executable." msgstr "" -#: ../../library/venv.rst:339 +#: ../../library/venv.rst:358 msgid "" "The directories are allowed to exist (for when an existing environment is " "being upgraded)." msgstr "" -#: ../../library/venv.rst:342 +#: ../../library/venv.rst:361 msgid "There is also a module-level convenience function:" msgstr "" -#: ../../library/venv.rst:348 +#: ../../library/venv.rst:367 msgid "" "Create an :class:`EnvBuilder` with the given keyword arguments, and call " "its :meth:`~EnvBuilder.create` method with the *env_dir* argument." msgstr "" -#: ../../library/venv.rst:363 +#: ../../library/venv.rst:382 msgid "An example of extending ``EnvBuilder``" msgstr "" -#: ../../library/venv.rst:365 +#: ../../library/venv.rst:384 msgid "" "The following script shows how to extend :class:`EnvBuilder` by implementing " "a subclass which installs setuptools and pip into a created virtual " "environment::" msgstr "" -#: ../../library/venv.rst:576 +#: ../../library/venv.rst:595 msgid "" "This script is also available for download `online `_." diff --git a/library/weakref.po b/library/weakref.po index dcb2927e50..7dc80648fd 100644 --- a/library/weakref.po +++ b/library/weakref.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-22 00:15+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+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-" @@ -160,7 +160,7 @@ msgstr "" msgid "" "Exceptions raised by the callback will be noted on the standard error " "output, but cannot be propagated; they are handled in exactly the same way " -"as exceptions raised from an object's :meth:`__del__` method." +"as exceptions raised from an object's :meth:`~object.__del__` method." msgstr "" #: ../../library/weakref.rst:116 @@ -284,21 +284,20 @@ msgstr "" #: ../../library/weakref.rst:223 msgid "" ":class:`WeakValueDictionary` objects have an additional method that has the " -"same issues as the :meth:`keyrefs` method of :class:`WeakKeyDictionary` " -"objects." +"same issues as the :meth:`WeakKeyDictionary.keyrefs` method." msgstr "" -#: ../../library/weakref.rst:230 +#: ../../library/weakref.rst:229 msgid "Return an iterable of the weak references to the values." msgstr "" -#: ../../library/weakref.rst:235 +#: ../../library/weakref.rst:234 msgid "" "Set class that keeps weak references to its elements. An element will be " "discarded when no strong reference to it exists any more." msgstr "" -#: ../../library/weakref.rst:241 +#: ../../library/weakref.rst:240 msgid "" "A custom :class:`ref` subclass which simulates a weak reference to a bound " "method (i.e., a method defined on a class and looked up on an instance). " @@ -307,13 +306,13 @@ msgid "" "method until either the object or the original function dies::" msgstr "" -#: ../../library/weakref.rst:265 +#: ../../library/weakref.rst:264 msgid "" "*callback* is the same as the parameter of the same name to the :func:`ref` " "function." msgstr "" -#: ../../library/weakref.rst:271 +#: ../../library/weakref.rst:270 msgid "" "Return a callable finalizer object which will be called when *obj* is " "garbage collected. Unlike an ordinary weak reference, a finalizer will " @@ -321,7 +320,7 @@ msgid "" "lifecycle management." msgstr "" -#: ../../library/weakref.rst:276 +#: ../../library/weakref.rst:275 msgid "" "A finalizer is considered *alive* until it is called (either explicitly or " "at garbage collection), and after that it is *dead*. Calling a live " @@ -329,58 +328,58 @@ msgid "" "calling a dead finalizer returns :const:`None`." msgstr "" -#: ../../library/weakref.rst:281 +#: ../../library/weakref.rst:280 msgid "" "Exceptions raised by finalizer callbacks during garbage collection will be " "shown on the standard error output, but cannot be propagated. They are " -"handled in the same way as exceptions raised from an object's :meth:" -"`__del__` method or a weak reference's callback." +"handled in the same way as exceptions raised from an object's :meth:`~object." +"__del__` method or a weak reference's callback." msgstr "" -#: ../../library/weakref.rst:287 +#: ../../library/weakref.rst:286 msgid "" "When the program exits, each remaining live finalizer is called unless its :" "attr:`atexit` attribute has been set to false. They are called in reverse " "order of creation." msgstr "" -#: ../../library/weakref.rst:291 +#: ../../library/weakref.rst:290 msgid "" "A finalizer will never invoke its callback during the later part of the :" "term:`interpreter shutdown` when module globals are liable to have been " "replaced by :const:`None`." msgstr "" -#: ../../library/weakref.rst:297 +#: ../../library/weakref.rst:296 msgid "" "If *self* is alive then mark it as dead and return the result of calling " "``func(*args, **kwargs)``. If *self* is dead then return :const:`None`." msgstr "" -#: ../../library/weakref.rst:303 +#: ../../library/weakref.rst:302 msgid "" "If *self* is alive then mark it as dead and return the tuple ``(obj, func, " "args, kwargs)``. If *self* is dead then return :const:`None`." msgstr "" -#: ../../library/weakref.rst:309 +#: ../../library/weakref.rst:308 msgid "" "If *self* is alive then return the tuple ``(obj, func, args, kwargs)``. If " "*self* is dead then return :const:`None`." msgstr "" -#: ../../library/weakref.rst:314 +#: ../../library/weakref.rst:313 msgid "Property which is true if the finalizer is alive, false otherwise." msgstr "" -#: ../../library/weakref.rst:318 +#: ../../library/weakref.rst:317 msgid "" "A writable boolean property which by default is true. When the program " "exits, it calls all remaining live finalizers for which :attr:`.atexit` is " "true. They are called in reverse order of creation." msgstr "" -#: ../../library/weakref.rst:325 +#: ../../library/weakref.rst:324 msgid "" "It is important to ensure that *func*, *args* and *kwargs* do not own any " "references to *obj*, either directly or indirectly, since otherwise *obj* " @@ -388,60 +387,60 @@ msgid "" "bound method of *obj*." msgstr "" -#: ../../library/weakref.rst:335 +#: ../../library/weakref.rst:334 msgid "The type object for weak references objects." msgstr "" -#: ../../library/weakref.rst:340 +#: ../../library/weakref.rst:339 msgid "The type object for proxies of objects which are not callable." msgstr "" -#: ../../library/weakref.rst:345 +#: ../../library/weakref.rst:344 msgid "The type object for proxies of callable objects." msgstr "" -#: ../../library/weakref.rst:350 +#: ../../library/weakref.rst:349 msgid "" "Sequence containing all the type objects for proxies. This can make it " "simpler to test if an object is a proxy without being dependent on naming " "both proxy types." msgstr "" -#: ../../library/weakref.rst:358 +#: ../../library/weakref.rst:357 msgid ":pep:`205` - Weak References" msgstr "" -#: ../../library/weakref.rst:358 +#: ../../library/weakref.rst:357 msgid "" "The proposal and rationale for this feature, including links to earlier " "implementations and information about similar features in other languages." msgstr "" -#: ../../library/weakref.rst:365 +#: ../../library/weakref.rst:364 msgid "Weak Reference Objects" msgstr "" -#: ../../library/weakref.rst:367 +#: ../../library/weakref.rst:366 msgid "" "Weak reference objects have no methods and no attributes besides :attr:`ref." "__callback__`. A weak reference object allows the referent to be obtained, " "if it still exists, by calling it:" msgstr "" -#: ../../library/weakref.rst:381 +#: ../../library/weakref.rst:380 msgid "" "If the referent no longer exists, calling the reference object returns :" "const:`None`:" msgstr "" -#: ../../library/weakref.rst:388 +#: ../../library/weakref.rst:387 msgid "" "Testing that a weak reference object is still live should be done using the " "expression ``ref() is not None``. Normally, application code that needs to " "use a reference object should follow this pattern::" msgstr "" -#: ../../library/weakref.rst:401 +#: ../../library/weakref.rst:400 msgid "" "Using a separate test for \"liveness\" creates race conditions in threaded " "applications; another thread can cause a weak reference to become " @@ -449,7 +448,7 @@ msgid "" "safe in threaded applications as well as single-threaded applications." msgstr "" -#: ../../library/weakref.rst:406 +#: ../../library/weakref.rst:405 msgid "" "Specialized versions of :class:`ref` objects can be created through " "subclassing. This is used in the implementation of the :class:" @@ -459,18 +458,18 @@ msgid "" "to retrieve the referent." msgstr "" -#: ../../library/weakref.rst:412 +#: ../../library/weakref.rst:411 msgid "" "This example shows how a subclass of :class:`ref` can be used to store " "additional information about an object and affect the value that's returned " "when the referent is accessed::" msgstr "" -#: ../../library/weakref.rst:439 +#: ../../library/weakref.rst:438 msgid "Example" msgstr "範例" -#: ../../library/weakref.rst:441 +#: ../../library/weakref.rst:440 msgid "" "This simple example shows how an application can use object IDs to retrieve " "objects that it has seen before. The IDs of the objects can then be used in " @@ -478,103 +477,103 @@ msgid "" "objects can still be retrieved by ID if they do." msgstr "" -#: ../../library/weakref.rst:466 +#: ../../library/weakref.rst:465 msgid "Finalizer Objects" msgstr "" -#: ../../library/weakref.rst:468 +#: ../../library/weakref.rst:467 msgid "" "The main benefit of using :class:`finalize` is that it makes it simple to " "register a callback without needing to preserve the returned finalizer " "object. For instance" msgstr "" -#: ../../library/weakref.rst:482 +#: ../../library/weakref.rst:481 msgid "" "The finalizer can be called directly as well. However the finalizer will " "invoke the callback at most once." msgstr "" -#: ../../library/weakref.rst:498 +#: ../../library/weakref.rst:497 msgid "" "You can unregister a finalizer using its :meth:`~finalize.detach` method. " "This kills the finalizer and returns the arguments passed to the constructor " "when it was created." msgstr "" -#: ../../library/weakref.rst:512 +#: ../../library/weakref.rst:511 msgid "" "Unless you set the :attr:`~finalize.atexit` attribute to :const:`False`, a " "finalizer will be called when the program exits if it is still alive. For " "instance" msgstr "" -#: ../../library/weakref.rst:527 -msgid "Comparing finalizers with :meth:`__del__` methods" +#: ../../library/weakref.rst:526 +msgid "Comparing finalizers with :meth:`~object.__del__` methods" msgstr "" -#: ../../library/weakref.rst:529 +#: ../../library/weakref.rst:528 msgid "" "Suppose we want to create a class whose instances represent temporary " "directories. The directories should be deleted with their contents when the " "first of the following events occurs:" msgstr "" -#: ../../library/weakref.rst:533 +#: ../../library/weakref.rst:532 msgid "the object is garbage collected," msgstr "" -#: ../../library/weakref.rst:534 -msgid "the object's :meth:`remove` method is called, or" +#: ../../library/weakref.rst:533 +msgid "the object's :meth:`!remove` method is called, or" msgstr "" -#: ../../library/weakref.rst:535 +#: ../../library/weakref.rst:534 msgid "the program exits." msgstr "" -#: ../../library/weakref.rst:537 +#: ../../library/weakref.rst:536 msgid "" -"We might try to implement the class using a :meth:`__del__` method as " -"follows::" +"We might try to implement the class using a :meth:`~object.__del__` method " +"as follows::" msgstr "" -#: ../../library/weakref.rst:556 +#: ../../library/weakref.rst:555 msgid "" -"Starting with Python 3.4, :meth:`__del__` methods no longer prevent " +"Starting with Python 3.4, :meth:`~object.__del__` methods no longer prevent " "reference cycles from being garbage collected, and module globals are no " "longer forced to :const:`None` during :term:`interpreter shutdown`. So this " "code should work without any issues on CPython." msgstr "" -#: ../../library/weakref.rst:561 +#: ../../library/weakref.rst:560 msgid "" -"However, handling of :meth:`__del__` methods is notoriously implementation " -"specific, since it depends on internal details of the interpreter's garbage " -"collector implementation." +"However, handling of :meth:`~object.__del__` methods is notoriously " +"implementation specific, since it depends on internal details of the " +"interpreter's garbage collector implementation." msgstr "" -#: ../../library/weakref.rst:565 +#: ../../library/weakref.rst:564 msgid "" "A more robust alternative can be to define a finalizer which only references " "the specific functions and objects that it needs, rather than having access " "to the full state of the object::" msgstr "" -#: ../../library/weakref.rst:581 +#: ../../library/weakref.rst:580 msgid "" "Defined like this, our finalizer only receives a reference to the details it " "needs to clean up the directory appropriately. If the object never gets " "garbage collected the finalizer will still be called at exit." msgstr "" -#: ../../library/weakref.rst:585 +#: ../../library/weakref.rst:584 msgid "" "The other advantage of weakref based finalizers is that they can be used to " "register finalizers for classes where the definition is controlled by a " "third party, such as running code when a module is unloaded::" msgstr "" -#: ../../library/weakref.rst:597 +#: ../../library/weakref.rst:596 msgid "" "If you create a finalizer object in a daemonic thread just as the program " "exits then there is the possibility that the finalizer does not get called " diff --git a/library/wsgiref.po b/library/wsgiref.po index 4a32e3dffa..ff281215b8 100644 --- a/library/wsgiref.po +++ b/library/wsgiref.po @@ -33,8 +33,9 @@ msgid "" "interface makes it easy to use an application that supports WSGI with a " "number of different web servers." msgstr "" -"網頁伺服器閘道介面 (WSGI) 是一個標準介面,用於連接網頁伺服器軟體與使用 Python 撰寫的網頁應用程式,擁" -"有一個標準介面使得支援 WSGI 的應用程式可以與多個不同的網頁伺服器運行。" +"網頁伺服器閘道介面 (WSGI) 是一個標準介面,用於連接網頁伺服器軟體與使用 " +"Python 撰寫的網頁應用程式,擁有一個標準介面使得支援 WSGI 的應用程式可以與多個" +"不同的網頁伺服器運行。" #: ../../library/wsgiref.rst:19 msgid "" @@ -43,8 +44,9 @@ msgid "" "every detail of WSGI just to install a WSGI application or to write a web " "application using an existing framework." msgstr "" -"只有網頁伺服器與程式框架的作者需要瞭解 WSGI 設計的每個細節與邊角案例,你並不需要為了安裝 WSGI 應用程" -"式或是使用現有框架撰寫網頁應用程式而必須理解每個細節。" +"只有網頁伺服器與程式框架的作者需要瞭解 WSGI 設計的每個細節與邊角案例,你並不" +"需要為了安裝 WSGI 應用程式或是使用現有框架撰寫網頁應用程式而必須理解每個細" +"節。" #: ../../library/wsgiref.rst:24 msgid "" @@ -56,17 +58,18 @@ msgid "" "that checks WSGI servers and applications for conformance to the WSGI " "specification (:pep:`3333`)." msgstr "" -":mod:`wsgiref` 是 WSGI 規格的參考實作,可用於新增 WSGI 來支援網頁伺服器或框架,它提供操作 WSGI " -"環境變數以及回應標頭的工具,用於實作 WSGI 伺服器的基本類別,提供用於示範 HTTP 伺服器的 WSGI 應用程" -"式、靜態型別檢查、以及驗證 WSGI 伺服器與應用程式是否符合 WSGI 規格的驗證工具 (:pep:`3333`)。" +":mod:`wsgiref` 是 WSGI 規格的參考實作,可用於新增 WSGI 來支援網頁伺服器或框" +"架,它提供操作 WSGI 環境變數以及回應標頭的工具,用於實作 WSGI 伺服器的基本類" +"別,提供用於示範 HTTP 伺服器的 WSGI 應用程式、靜態型別檢查、以及驗證 WSGI 伺" +"服器與應用程式是否符合 WSGI 規格的驗證工具 (:pep:`3333`)。" #: ../../library/wsgiref.rst:32 msgid "" "See `wsgi.readthedocs.io `_ for more " "information about WSGI, and links to tutorials and other resources." msgstr "" -"參閱 `wsgi.readthedocs.io ` 更多 WSGI 相關資訊,以及教學連結" -"與其他資源。" +"參閱 `wsgi.readthedocs.io `_ 更多 WSGI 相關資" +"訊,以及教學連結與其他資源。" #: ../../library/wsgiref.rst:39 msgid ":mod:`wsgiref.util` -- WSGI environment utilities" @@ -81,9 +84,10 @@ msgid "" "please see :pep:`3333` for a detailed specification and :data:`~wsgiref." "types.WSGIEnvironment` for a type alias that can be used in type annotations." msgstr "" -"這個模組提供許多用於處理 WSGI 環境運作的功能。WSGU 環境是一個包含 HTTP 請求變數的字典,如 :pep:`3333` 所述。" -"所有接受 *environ* 的參數的函式都需要提供符合 WSGI 標準的字典;請參閱 :pep:`3333` 獲取詳細規格,以及 :data:" -"`~wsgiref.types.WSGIEnvironment` 獲取可用於使用型別註釋的型別別名。 +"這個模組提供許多用於處理 WSGI 環境運作的功能。WSGU 環境是一個包含 HTTP 請求變" +"數的字典,如 :pep:`3333` 所述。所有接受 *environ* 的參數的函式都需要提供符合 " +"WSGI 標準的字典;請參閱 :pep:`3333` 獲取詳細規格,以及 :data:`~wsgiref.types." +"WSGIEnvironment` 獲取可用於使用型別註釋的型別別名。" #: ../../library/wsgiref.rst:56 msgid "" @@ -91,8 +95,8 @@ msgid "" "\"https\", by checking for a ``HTTPS`` environment variable in the *environ* " "dictionary. The return value is a string." msgstr "" -"透過檢查 *environ* 字典中的 ``HTTPS`` 環境變數,回傳 ``wsgi.url_scheme`` 應該是 \"http\" 或 \"https\"" -" 的猜測。回傳值為一個字串。" +"透過檢查 *environ* 字典中的 ``HTTPS`` 環境變數,回傳 ``wsgi.url_scheme`` 應該" +"是 \"http\" 或 \"https\" 的猜測。回傳值為一個字串。" #: ../../library/wsgiref.rst:60 msgid "" @@ -102,9 +106,10 @@ msgid "" "a request is received via SSL. So, this function returns \"https\" if such " "a value is found, and \"http\" otherwise." msgstr "" -"當建立一個包裝 CGI 或類似 FastCGI 的 CGI-like 協議閘道時,此函式非常有用。例如 FastCGI,通常提供這類協議的" -"伺服器在通過 SSL 接收到請求時會包含 \"1\",\"yes\",或 \"on\" 的``HTTPS`` 變數,因此,如果找到這樣的值,此函" -"式回傳 \"https\",否則回傳 \"http\"。 +"當建立一個包裝 CGI 或類似 FastCGI 的 CGI-like 協議閘道時,此函式非常有用。例" +"如 FastCGI,通常提供這類協議的伺服器在通過 SSL 接收到請求時會包含 " +"\"1\",\"yes\",或 \"on\" 的 ``HTTPS`` 變數,因此,如果找到這樣的值,此函式回" +"傳 \"https\",否則回傳 \"http\"。" #: ../../library/wsgiref.rst:69 msgid "" @@ -113,8 +118,9 @@ msgid "" "If *include_query* is false, the query string is not included in the " "resulting URI." msgstr "" -"根據 :pep:`3333` 中 \"URL Reconstruction\" 章節所找到的演算法,回傳完整的請求 URI,可選擇性的包含查詢字串," -"如果 *include_query* 設為 false,查詢字串不會被包含在結果的 URI 中。" +"根據 :pep:`3333` 中 \"URL Reconstruction\" 章節所找到的演算法,回傳完整的請" +"求 URI,可選擇性的包含查詢字串,如果 *include_query* 設為 false,查詢字串不會" +"被包含在結果的 URI 中。" #: ../../library/wsgiref.rst:76 msgid "" @@ -122,8 +128,8 @@ msgid "" "``QUERY_STRING`` variables are ignored. The result is the base URI of the " "application object addressed by the request." msgstr "" -"類似於 :func:`request_uri`,但忽略 ``PATH_INFO`` 和 ``QUERY_STRING`` 變數。結果是請求地址的應用程式物件的" -"的基本 URI。" +"類似於 :func:`request_uri`,但忽略 ``PATH_INFO`` 和 ``QUERY_STRING`` 變數。結" +"果是請求地址的應用程式物件的的基本 URI。" #: ../../library/wsgiref.rst:83 msgid "" @@ -131,15 +137,15 @@ msgid "" "name. The *environ* dictionary is *modified* in-place; use a copy if you " "need to keep the original ``PATH_INFO`` or ``SCRIPT_NAME`` intact." msgstr "" -"將單一名稱從 ``PATH_INFO`` 移到 ``SCRIPT_NAME`` 並回傳該名稱。*environ* 字典會在適當時機被 *modified*;如" -"果你需要保留原始完好無損的 ``PATH_INFO`` 或 ``SCRIPT_NAME`` 請使用副本。" +"將單一名稱從 ``PATH_INFO`` 移到 ``SCRIPT_NAME`` 並回傳該名稱。*environ* 字典" +"會在適當時機被 *modified*;如果你需要保留原始完好無損的 ``PATH_INFO`` 或 " +"``SCRIPT_NAME`` 請使用副本。" #: ../../library/wsgiref.rst:87 msgid "" "If there are no remaining path segments in ``PATH_INFO``, ``None`` is " "returned." -msgstr "" -"如果在 ``PATH_INFO`` 中沒有剩餘的路徑片段,則回傳 ``None``。" +msgstr "如果在 ``PATH_INFO`` 中沒有剩餘的路徑片段,則回傳 ``None``。" #: ../../library/wsgiref.rst:89 msgid "" @@ -154,11 +160,13 @@ msgid "" "bar``. That is, ``SCRIPT_NAME`` will change from ``/foo`` to ``/foo/bar``, " "and ``PATH_INFO`` will change from ``/bar/baz`` to ``/baz``." msgstr "" -"通常,此程式用於處理請求 URI 的每一部分路徑,例如將路徑視為一系列的字典鍵此程式會修改傳入的環境,使其適用於調用位於" -"目標 URI 的 WSGI 應用程式。例如,如果在 ``/foo`` 上有一個 WSGI 應用程式且請求 URI 路徑為 ``/foo/bar/baz``," -"並且位於 ``/foo`` 的 WSGI 應用程式呼叫 :func:`shift_path_info`,它將接收字串 \"bar\",而環境將被更新為適用" -"於傳遞給位於 ``/foo/bar`` 的 WSGI 應用程式。換句話說,``SCRIPT_NAME`` 將從 ``/foo`` 變更為 ``/foo/bar``," -"而 ``PATH_INFO`` 將從 ``/bar/baz`` 變更為 ``/baz``。" +"通常,此程式用於處理請求 URI 的每一部分路徑,例如將路徑視為一系列的字典鍵此程" +"式會修改傳入的環境,使其適用於調用位於目標 URI 的 WSGI 應用程式。例如,如果" +"在 ``/foo`` 上有一個 WSGI 應用程式且請求 URI 路徑為 ``/foo/bar/baz``,並且位" +"於 ``/foo`` 的 WSGI 應用程式呼叫 :func:`shift_path_info`,它將接收字串 " +"\"bar\",而環境將被更新為適用於傳遞給位於 ``/foo/bar`` 的 WSGI 應用程式。換句" +"話說,``SCRIPT_NAME`` 將從 ``/foo`` 變更為 ``/foo/bar``,而 ``PATH_INFO`` 將" +"從 ``/bar/baz`` 變更為 ``/baz``。" #: ../../library/wsgiref.rst:100 msgid "" @@ -169,9 +177,10 @@ msgid "" "difference between URIs ending in ``/x`` from ones ending in ``/x/`` when " "using this routine to do object traversal." msgstr "" -"當 ``PATH_INFO`` 只是一個 \"/\" 時, 此程式會回傳一個空字串,並在 ``SCRIPT_NAME`` 後添加尾部斜號,即使空路徑片" -"段通常是被忽略的,而且 ``SCRIPT_NAME`` 通常不會以斜號結尾。這是刻意行為,以確保應用程式在使用這個程式進行物件遍歷時可" -"以區分結尾為 ``/x`` 和結尾為 ``/x/`` 的 URIs。" +"當 ``PATH_INFO`` 只是一個 \"/\" 時, 此程式會回傳一個空字串,並在 " +"``SCRIPT_NAME`` 後添加尾部斜號,即使空路徑片段通常是被忽略的,而且 " +"``SCRIPT_NAME`` 通常不會以斜號結尾。這是刻意行為,以確保應用程式在使用這個程" +"式進行物件遍歷時可以區分結尾為 ``/x`` 和結尾為 ``/x/`` 的 URIs。" #: ../../library/wsgiref.rst:110 msgid "Update *environ* with trivial defaults for testing purposes." @@ -185,9 +194,10 @@ msgid "" "*`` variables. It only supplies default values, and does not replace any " "existing settings for these variables." msgstr "" -"這個程式新增 WSGI 所需的各種參數,包括 ``HTTP_HOST``、``SERVER_NAME``、``SERVER_PORT``、``REQUEST_METHOD``" -"、``SCRIPT_NAME``、``PATH_INFO``,以及所有 :pep:`3333` 定義的 ``wsgi.*`` 變數,它只提供預設值,並且不會取代" -"現有的這些變數設定。" +"這個程式新增 WSGI 所需的各種參數,包括 ``HTTP_HOST``、``SERVER_NAME``、" +"``SERVER_PORT``、``REQUEST_METHOD``、``SCRIPT_NAME``、``PATH_INFO``,以及所" +"有 :pep:`3333` 定義的 ``wsgi.*`` 變數,它只提供預設值,並且不會取代現有的這些" +"變數設定。" #: ../../library/wsgiref.rst:118 msgid "" @@ -195,9 +205,8 @@ msgid "" "and applications to set up dummy environments. It should NOT be used by " "actual WSGI servers or applications, since the data is fake!" msgstr "" -"這個程式目的為了讓 WSGI 伺服器和應用程式的單元測試更容易建置虛擬環境。實際的 WSGI 伺服器或應用程式不應該使用它,因為" -"所產生的數據是假的!" - +"這個程式目的為了讓 WSGI 伺服器和應用程式的單元測試更容易建置虛擬環境。實際的 " +"WSGI 伺服器或應用程式不應該使用它,因為所產生的數據是假的!" #: ../../library/wsgiref.rst:122 ../../library/wsgiref.rst:170 #: ../../library/wsgiref.rst:292 ../../library/wsgiref.rst:425 diff --git a/library/xml.etree.elementtree.po b/library/xml.etree.elementtree.po index fbdf345c98..99998e7c40 100644 --- a/library/xml.etree.elementtree.po +++ b/library/xml.etree.elementtree.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2018-05-23 16:16+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -37,7 +37,7 @@ msgid "This module will use a fast implementation whenever available." msgstr "" #: ../../library/xml.etree.elementtree.rst:19 -msgid "The :mod:`xml.etree.cElementTree` module is deprecated." +msgid "The :mod:`!xml.etree.cElementTree` module is deprecated." msgstr "" #: ../../library/xml.etree.elementtree.rst:25 @@ -668,7 +668,7 @@ msgid "" msgstr "" #: ../../library/xml.etree.elementtree.rst:639 -#: ../../library/xml.etree.elementtree.rst:1473 +#: ../../library/xml.etree.elementtree.rst:1478 msgid "If you need a fully populated element, look for \"end\" events instead." msgstr "" @@ -677,7 +677,7 @@ msgid "The *parser* argument." msgstr "*parser* 引數。" #: ../../library/xml.etree.elementtree.rst:644 -#: ../../library/xml.etree.elementtree.rst:1477 +#: ../../library/xml.etree.elementtree.rst:1482 msgid "The ``comment`` and ``pi`` events were added." msgstr "新增 *context* 與 *check_hostname* 事件。" @@ -743,7 +743,7 @@ msgstr "" #: ../../library/xml.etree.elementtree.rst:705 #: ../../library/xml.etree.elementtree.rst:732 -#: ../../library/xml.etree.elementtree.rst:1184 +#: ../../library/xml.etree.elementtree.rst:1189 msgid "The *short_empty_elements* parameter." msgstr "*short_empty_elements* 參數。" @@ -851,7 +851,7 @@ msgstr "" msgid "The result might look something like:" msgstr "" -#: ../../library/xml.etree.elementtree.rst:831 +#: ../../library/xml.etree.elementtree.rst:833 msgid "" "Default loader. This default loader reads an included resource from disk. " "*href* is a URL. *parse* is for parse mode either \"xml\" or \"text\". " @@ -862,7 +862,7 @@ msgid "" "or raise an exception." msgstr "" -#: ../../library/xml.etree.elementtree.rst:843 +#: ../../library/xml.etree.elementtree.rst:845 msgid "" "This function expands XInclude directives. *elem* is the root element. " "*loader* is an optional resource loader. If omitted, it defaults to :func:" @@ -873,28 +873,28 @@ msgid "" "malicious content explosion. Pass a negative value to disable the limitation." msgstr "" -#: ../../library/xml.etree.elementtree.rst:851 +#: ../../library/xml.etree.elementtree.rst:853 msgid "" "Returns the expanded resource. If the parse mode is ``\"xml\"``, this is an " "ElementTree instance. If the parse mode is \"text\", this is a Unicode " "string. If the loader fails, it can return None or raise an exception." msgstr "" -#: ../../library/xml.etree.elementtree.rst:856 +#: ../../library/xml.etree.elementtree.rst:858 msgid "The *base_url* and *max_depth* parameters." msgstr "" -#: ../../library/xml.etree.elementtree.rst:863 +#: ../../library/xml.etree.elementtree.rst:865 msgid "Element Objects" msgstr "" -#: ../../library/xml.etree.elementtree.rst:867 +#: ../../library/xml.etree.elementtree.rst:872 msgid "" "Element class. This class defines the Element interface, and provides a " "reference implementation of this interface." msgstr "" -#: ../../library/xml.etree.elementtree.rst:870 +#: ../../library/xml.etree.elementtree.rst:875 msgid "" "The element name, attribute names, and attribute values can be either " "bytestrings or Unicode strings. *tag* is the element name. *attrib* is an " @@ -902,13 +902,13 @@ msgid "" "additional attributes, given as keyword arguments." msgstr "" -#: ../../library/xml.etree.elementtree.rst:878 +#: ../../library/xml.etree.elementtree.rst:883 msgid "" "A string identifying what kind of data this element represents (the element " "type, in other words)." msgstr "" -#: ../../library/xml.etree.elementtree.rst:885 +#: ../../library/xml.etree.elementtree.rst:890 msgid "" "These attributes can be used to hold additional data associated with the " "element. Their values are usually strings but may be any application-" @@ -919,7 +919,7 @@ msgid "" "the XML data" msgstr "" -#: ../../library/xml.etree.elementtree.rst:897 +#: ../../library/xml.etree.elementtree.rst:902 msgid "" "the *a* element has ``None`` for both *text* and *tail* attributes, the *b* " "element has *text* ``\"1\"`` and *tail* ``\"4\"``, the *c* element has " @@ -927,17 +927,17 @@ msgid "" "``None`` and *tail* ``\"3\"``." msgstr "" -#: ../../library/xml.etree.elementtree.rst:902 +#: ../../library/xml.etree.elementtree.rst:907 msgid "" "To collect the inner text of an element, see :meth:`itertext`, for example " "``\"\".join(element.itertext())``." msgstr "" -#: ../../library/xml.etree.elementtree.rst:905 +#: ../../library/xml.etree.elementtree.rst:910 msgid "Applications may store arbitrary objects in these attributes." msgstr "" -#: ../../library/xml.etree.elementtree.rst:910 +#: ../../library/xml.etree.elementtree.rst:915 msgid "" "A dictionary containing the element's attributes. Note that while the " "*attrib* value is always a real mutable Python dictionary, an ElementTree " @@ -946,59 +946,59 @@ msgid "" "implementations, use the dictionary methods below whenever possible." msgstr "" -#: ../../library/xml.etree.elementtree.rst:916 +#: ../../library/xml.etree.elementtree.rst:921 msgid "The following dictionary-like methods work on the element attributes." msgstr "" -#: ../../library/xml.etree.elementtree.rst:921 +#: ../../library/xml.etree.elementtree.rst:926 msgid "" "Resets an element. This function removes all subelements, clears all " "attributes, and sets the text and tail attributes to ``None``." msgstr "" -#: ../../library/xml.etree.elementtree.rst:927 +#: ../../library/xml.etree.elementtree.rst:932 msgid "Gets the element attribute named *key*." msgstr "" -#: ../../library/xml.etree.elementtree.rst:929 +#: ../../library/xml.etree.elementtree.rst:934 msgid "" "Returns the attribute value, or *default* if the attribute was not found." msgstr "" -#: ../../library/xml.etree.elementtree.rst:934 +#: ../../library/xml.etree.elementtree.rst:939 msgid "" "Returns the element attributes as a sequence of (name, value) pairs. The " "attributes are returned in an arbitrary order." msgstr "" -#: ../../library/xml.etree.elementtree.rst:940 +#: ../../library/xml.etree.elementtree.rst:945 msgid "" "Returns the elements attribute names as a list. The names are returned in " "an arbitrary order." msgstr "" -#: ../../library/xml.etree.elementtree.rst:946 +#: ../../library/xml.etree.elementtree.rst:951 msgid "Set the attribute *key* on the element to *value*." msgstr "" -#: ../../library/xml.etree.elementtree.rst:948 +#: ../../library/xml.etree.elementtree.rst:953 msgid "The following methods work on the element's children (subelements)." msgstr "" -#: ../../library/xml.etree.elementtree.rst:953 +#: ../../library/xml.etree.elementtree.rst:958 msgid "" "Adds the element *subelement* to the end of this element's internal list of " "subelements. Raises :exc:`TypeError` if *subelement* is not an :class:" "`Element`." msgstr "" -#: ../../library/xml.etree.elementtree.rst:960 +#: ../../library/xml.etree.elementtree.rst:965 msgid "" "Appends *subelements* from a sequence object with zero or more elements. " "Raises :exc:`TypeError` if a subelement is not an :class:`Element`." msgstr "" -#: ../../library/xml.etree.elementtree.rst:968 +#: ../../library/xml.etree.elementtree.rst:973 msgid "" "Finds the first subelement matching *match*. *match* may be a tag name or " "a :ref:`path `. Returns an element instance or " @@ -1007,7 +1007,7 @@ msgid "" "expression into the given namespace." msgstr "" -#: ../../library/xml.etree.elementtree.rst:977 +#: ../../library/xml.etree.elementtree.rst:982 msgid "" "Finds all matching subelements, by tag name or :ref:`path `. Returns a list containing all matching elements in document " @@ -1016,7 +1016,7 @@ msgid "" "expression into the given namespace." msgstr "" -#: ../../library/xml.etree.elementtree.rst:986 +#: ../../library/xml.etree.elementtree.rst:991 msgid "" "Finds text for the first subelement matching *match*. *match* may be a tag " "name or a :ref:`path `. Returns the text content of the " @@ -1027,13 +1027,13 @@ msgid "" "into the given namespace." msgstr "" -#: ../../library/xml.etree.elementtree.rst:997 +#: ../../library/xml.etree.elementtree.rst:1002 msgid "" "Inserts *subelement* at the given position in this element. Raises :exc:" "`TypeError` if *subelement* is not an :class:`Element`." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1003 +#: ../../library/xml.etree.elementtree.rst:1008 msgid "" "Creates a tree :term:`iterator` with the current element as the root. The " "iterator iterates over this element and all elements below it, in document " @@ -1042,7 +1042,7 @@ msgid "" "structure is modified during iteration, the result is undefined." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1014 +#: ../../library/xml.etree.elementtree.rst:1019 msgid "" "Finds all matching subelements, by tag name or :ref:`path `. Returns an iterable yielding all matching elements in document " @@ -1050,44 +1050,44 @@ msgid "" "name." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1025 +#: ../../library/xml.etree.elementtree.rst:1030 msgid "" "Creates a text iterator. The iterator loops over this element and all " "subelements, in document order, and returns all inner text." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1033 +#: ../../library/xml.etree.elementtree.rst:1038 msgid "" "Creates a new element object of the same type as this element. Do not call " "this method, use the :func:`SubElement` factory function instead." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1039 +#: ../../library/xml.etree.elementtree.rst:1044 msgid "" "Removes *subelement* from the element. Unlike the find\\* methods this " "method compares elements based on the instance identity, not on tag value or " "contents." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1043 +#: ../../library/xml.etree.elementtree.rst:1048 msgid "" ":class:`Element` objects also support the following sequence type methods " "for working with subelements: :meth:`~object.__delitem__`, :meth:`~object." "__getitem__`, :meth:`~object.__setitem__`, :meth:`~object.__len__`." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1048 +#: ../../library/xml.etree.elementtree.rst:1053 msgid "" "Caution: Elements with no subelements will test as ``False``. Testing the " "truth value of an Element is deprecated and will raise an exception in " "Python 3.14. Use specific ``len(elem)`` or ``elem is None`` test instead.::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:1060 +#: ../../library/xml.etree.elementtree.rst:1065 msgid "Testing the truth value of an Element emits :exc:`DeprecationWarning`." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1063 +#: ../../library/xml.etree.elementtree.rst:1068 msgid "" "Prior to Python 3.8, the serialisation order of the XML attributes of " "elements was artificially made predictable by sorting the attributes by " @@ -1096,7 +1096,7 @@ msgid "" "attributes were originally parsed or created by user code." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1069 +#: ../../library/xml.etree.elementtree.rst:1074 msgid "" "In general, user code should try not to depend on a specific ordering of " "attributes, given that the `XML Information Set `_ writer. Arguments are the " "same as for the :func:`canonicalize` function. This class does not build a " @@ -1332,11 +1332,11 @@ msgid "" "using the *write* function." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1348 +#: ../../library/xml.etree.elementtree.rst:1353 msgid "XMLParser Objects" msgstr "XMLParser 物件" -#: ../../library/xml.etree.elementtree.rst:1353 +#: ../../library/xml.etree.elementtree.rst:1358 msgid "" "This class is the low-level building block of the module. It uses :mod:`xml." "parsers.expat` for efficient, event-based parsing of XML. It can be fed XML " @@ -1347,24 +1347,24 @@ msgid "" "XML file." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1361 +#: ../../library/xml.etree.elementtree.rst:1366 msgid "" "Parameters are now :ref:`keyword-only `. The *html* " "argument no longer supported." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1368 +#: ../../library/xml.etree.elementtree.rst:1373 msgid "" "Finishes feeding data to the parser. Returns the result of calling the " "``close()`` method of the *target* passed during construction; by default, " "this is the toplevel document element." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1375 +#: ../../library/xml.etree.elementtree.rst:1380 msgid "Feeds data to the parser. *data* is encoded data." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1377 +#: ../../library/xml.etree.elementtree.rst:1382 msgid "" ":meth:`XMLParser.feed` calls *target*\\'s ``start(tag, attrs_dict)`` method " "for each opening tag, its ``end(tag)`` method for each closing tag, and data " @@ -1375,11 +1375,11 @@ msgid "" "of an XML file::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:1421 +#: ../../library/xml.etree.elementtree.rst:1426 msgid "XMLPullParser Objects" msgstr "XMLPullParser 物件" -#: ../../library/xml.etree.elementtree.rst:1425 +#: ../../library/xml.etree.elementtree.rst:1430 msgid "" "A pull parser suitable for non-blocking applications. Its input-side API is " "similar to that of :class:`XMLParser`, but instead of pushing calls to a " @@ -1391,11 +1391,11 @@ msgid "" "If *events* is omitted, only ``\"end\"`` events are reported." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1436 +#: ../../library/xml.etree.elementtree.rst:1441 msgid "Feed the given bytes data to the parser." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1440 +#: ../../library/xml.etree.elementtree.rst:1445 msgid "" "Signal the parser that the data stream is terminated. Unlike :meth:" "`XMLParser.close`, this method always returns :const:`None`. Any events not " @@ -1403,7 +1403,7 @@ msgid "" "`read_events`." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1447 +#: ../../library/xml.etree.elementtree.rst:1452 msgid "" "Return an iterator over the events which have been encountered in the data " "fed to the parser. The iterator yields ``(event, elem)`` pairs, where " @@ -1412,25 +1412,25 @@ msgid "" "follows." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1453 +#: ../../library/xml.etree.elementtree.rst:1458 msgid "``start``, ``end``: the current Element." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1454 +#: ../../library/xml.etree.elementtree.rst:1459 msgid "``comment``, ``pi``: the current comment / processing instruction" msgstr "" -#: ../../library/xml.etree.elementtree.rst:1455 +#: ../../library/xml.etree.elementtree.rst:1460 msgid "" "``start-ns``: a tuple ``(prefix, uri)`` naming the declared namespace " "mapping." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1457 +#: ../../library/xml.etree.elementtree.rst:1462 msgid "``end-ns``: :const:`None` (this may change in a future version)" msgstr "" -#: ../../library/xml.etree.elementtree.rst:1459 +#: ../../library/xml.etree.elementtree.rst:1464 msgid "" "Events provided in a previous call to :meth:`read_events` will not be " "yielded again. Events are consumed from the internal queue only when they " @@ -1439,7 +1439,7 @@ msgid "" "results." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1467 +#: ../../library/xml.etree.elementtree.rst:1472 msgid "" ":class:`XMLPullParser` only guarantees that it has seen the \">\" character " "of a starting tag when it emits a \"start\" event, so the attributes are " @@ -1448,11 +1448,11 @@ msgid "" "be present." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1482 +#: ../../library/xml.etree.elementtree.rst:1487 msgid "Exceptions" msgstr "例外" -#: ../../library/xml.etree.elementtree.rst:1486 +#: ../../library/xml.etree.elementtree.rst:1491 msgid "" "XML parse error, raised by the various parsing methods in this module when " "parsing fails. The string representation of an instance of this exception " @@ -1460,22 +1460,22 @@ msgid "" "following attributes available:" msgstr "" -#: ../../library/xml.etree.elementtree.rst:1493 +#: ../../library/xml.etree.elementtree.rst:1498 msgid "" "A numeric error code from the expat parser. See the documentation of :mod:" "`xml.parsers.expat` for the list of error codes and their meanings." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1498 +#: ../../library/xml.etree.elementtree.rst:1503 msgid "" "A tuple of *line*, *column* numbers, specifying where the error occurred." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1501 +#: ../../library/xml.etree.elementtree.rst:1506 msgid "Footnotes" msgstr "註解" -#: ../../library/xml.etree.elementtree.rst:1502 +#: ../../library/xml.etree.elementtree.rst:1507 msgid "" "The encoding string included in XML output should conform to the appropriate " "standards. For example, \"UTF-8\" is valid, but \"UTF8\" is not. See " diff --git a/library/zipimport.po b/library/zipimport.po index 69cf62e1ff..cc7909b20e 100644 --- a/library/zipimport.po +++ b/library/zipimport.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -159,7 +159,7 @@ msgid "" msgstr "" #: ../../library/zipimport.rst:115 -msgid ":exc:`IOError` used to be raised instead of :exc:`OSError`." +msgid ":exc:`IOError` used to be raised, it is now an alias of :exc:`OSError`." msgstr "" #: ../../library/zipimport.rst:121 diff --git a/reference/compound_stmts.po b/reference/compound_stmts.po index ceedd48bd8..2978dd7513 100644 --- a/reference/compound_stmts.po +++ b/reference/compound_stmts.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-10-12 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -449,14 +449,14 @@ msgid "" msgstr "" #: ../../reference/compound_stmts.rst:525 -#: ../../reference/compound_stmts.rst:1534 -#: ../../reference/compound_stmts.rst:1575 +#: ../../reference/compound_stmts.rst:1536 +#: ../../reference/compound_stmts.rst:1577 msgid "The following code::" msgstr "" #: ../../reference/compound_stmts.rst:530 #: ../../reference/compound_stmts.rst:555 -#: ../../reference/compound_stmts.rst:1580 +#: ../../reference/compound_stmts.rst:1582 msgid "is semantically equivalent to::" msgstr "" @@ -529,12 +529,12 @@ msgid "" msgstr "" #: ../../reference/compound_stmts.rst:624 -#: ../../reference/compound_stmts.rst:1179 +#: ../../reference/compound_stmts.rst:1181 msgid ":pep:`634` -- Structural Pattern Matching: Specification" msgstr "" #: ../../reference/compound_stmts.rst:625 -#: ../../reference/compound_stmts.rst:1180 +#: ../../reference/compound_stmts.rst:1182 msgid ":pep:`636` -- Structural Pattern Matching: Tutorial" msgstr "" @@ -1290,7 +1290,7 @@ msgid ":class:`int`" msgstr ":class:`int`" #: ../../reference/compound_stmts.rst:1159 -#: ../../reference/compound_stmts.rst:1850 +#: ../../reference/compound_stmts.rst:1852 msgid ":class:`list`" msgstr ":class:`list`" @@ -1303,7 +1303,7 @@ msgid ":class:`str`" msgstr ":class:`str`" #: ../../reference/compound_stmts.rst:1162 -#: ../../reference/compound_stmts.rst:1853 +#: ../../reference/compound_stmts.rst:1855 msgid ":class:`tuple`" msgstr ":class:`tuple`" @@ -1327,33 +1327,33 @@ msgstr "``isinstance(, CLS)``" msgid "convert ``P1`` to a keyword pattern using ``CLS.__match_args__``" msgstr "" -#: ../../reference/compound_stmts.rst:1173 +#: ../../reference/compound_stmts.rst:1172 msgid "For each keyword argument ``attr=P2``:" msgstr "" -#: ../../reference/compound_stmts.rst:1173 +#: ../../reference/compound_stmts.rst:1174 msgid "``hasattr(, \"attr\")``" msgstr "``hasattr(, \"attr\")``" -#: ../../reference/compound_stmts.rst:1174 +#: ../../reference/compound_stmts.rst:1175 msgid "``P2`` matches ``.attr``" msgstr "" -#: ../../reference/compound_stmts.rst:1175 +#: ../../reference/compound_stmts.rst:1177 msgid "... and so on for the corresponding keyword argument/pattern pair." msgstr "" -#: ../../reference/compound_stmts.rst:1190 +#: ../../reference/compound_stmts.rst:1192 msgid "Function definitions" msgstr "函式定義" -#: ../../reference/compound_stmts.rst:1205 +#: ../../reference/compound_stmts.rst:1207 msgid "" "A function definition defines a user-defined function object (see section :" "ref:`types`):" msgstr "" -#: ../../reference/compound_stmts.rst:1224 +#: ../../reference/compound_stmts.rst:1226 msgid "" "A function definition is an executable statement. Its execution binds the " "function name in the current local namespace to a function object (a wrapper " @@ -1362,13 +1362,13 @@ msgid "" "used when the function is called." msgstr "" -#: ../../reference/compound_stmts.rst:1230 +#: ../../reference/compound_stmts.rst:1232 msgid "" "The function definition does not execute the function body; this gets " "executed only when the function is called. [#]_" msgstr "" -#: ../../reference/compound_stmts.rst:1236 +#: ../../reference/compound_stmts.rst:1238 msgid "" "A function definition may be wrapped by one or more :term:`decorator` " "expressions. Decorator expressions are evaluated when the function is " @@ -1379,28 +1379,28 @@ msgid "" "example, the following code ::" msgstr "" -#: ../../reference/compound_stmts.rst:1247 -#: ../../reference/compound_stmts.rst:1433 +#: ../../reference/compound_stmts.rst:1249 +#: ../../reference/compound_stmts.rst:1435 msgid "is roughly equivalent to ::" msgstr "" "大致等價於:\n" "\n" "::" -#: ../../reference/compound_stmts.rst:1252 +#: ../../reference/compound_stmts.rst:1254 msgid "" "except that the original function is not temporarily bound to the name " "``func``." msgstr "" -#: ../../reference/compound_stmts.rst:1254 +#: ../../reference/compound_stmts.rst:1256 msgid "" "Functions may be decorated with any valid :token:`~python-grammar:" "assignment_expression`. Previously, the grammar was much more restrictive; " "see :pep:`614` for details." msgstr "" -#: ../../reference/compound_stmts.rst:1259 +#: ../../reference/compound_stmts.rst:1261 msgid "" "A list of :ref:`type parameters ` may be given in square " "brackets between the function's name and the opening parenthesis for its " @@ -1410,12 +1410,12 @@ msgid "" "more." msgstr "" -#: ../../reference/compound_stmts.rst:1265 -#: ../../reference/compound_stmts.rst:1452 +#: ../../reference/compound_stmts.rst:1267 +#: ../../reference/compound_stmts.rst:1454 msgid "Type parameter lists are new in Python 3.12." msgstr "" -#: ../../reference/compound_stmts.rst:1273 +#: ../../reference/compound_stmts.rst:1275 msgid "" "When one or more :term:`parameters ` have the form *parameter* " "``=`` *expression*, the function is said to have \"default parameter values." @@ -1426,7 +1426,7 @@ msgid "" "syntactic restriction that is not expressed by the grammar." msgstr "" -#: ../../reference/compound_stmts.rst:1281 +#: ../../reference/compound_stmts.rst:1283 msgid "" "**Default parameter values are evaluated from left to right when the " "function definition is executed.** This means that the expression is " @@ -1439,7 +1439,7 @@ msgid "" "the default, and explicitly test for it in the body of the function, e.g.::" msgstr "" -#: ../../reference/compound_stmts.rst:1302 +#: ../../reference/compound_stmts.rst:1304 msgid "" "Function call semantics are described in more detail in section :ref:" "`calls`. A function call always assigns values to all parameters mentioned " @@ -1455,13 +1455,13 @@ msgid "" "positional arguments." msgstr "" -#: ../../reference/compound_stmts.rst:1314 +#: ../../reference/compound_stmts.rst:1316 msgid "" "The ``/`` function parameter syntax may be used to indicate positional-only " "parameters. See :pep:`570` for details." msgstr "" -#: ../../reference/compound_stmts.rst:1323 +#: ../../reference/compound_stmts.rst:1325 msgid "" "Parameters may have an :term:`annotation ` of the form " "\"``: expression``\" following the parameter name. Any parameter may have " @@ -1478,7 +1478,7 @@ msgid "" "different order than they appear in the source code." msgstr "" -#: ../../reference/compound_stmts.rst:1338 +#: ../../reference/compound_stmts.rst:1340 msgid "" "It is also possible to create anonymous functions (functions not bound to a " "name), for immediate use in expressions. This uses lambda expressions, " @@ -1490,7 +1490,7 @@ msgid "" "execution of multiple statements and annotations." msgstr "" -#: ../../reference/compound_stmts.rst:1346 +#: ../../reference/compound_stmts.rst:1348 msgid "" "**Programmer's note:** Functions are first-class objects. A \"``def``\" " "statement executed inside a function definition defines a local function " @@ -1499,51 +1499,51 @@ msgid "" "See section :ref:`naming` for details." msgstr "" -#: ../../reference/compound_stmts.rst:1355 +#: ../../reference/compound_stmts.rst:1357 msgid ":pep:`3107` - Function Annotations" msgstr "" -#: ../../reference/compound_stmts.rst:1355 +#: ../../reference/compound_stmts.rst:1357 msgid "The original specification for function annotations." msgstr "" -#: ../../reference/compound_stmts.rst:1358 +#: ../../reference/compound_stmts.rst:1360 msgid ":pep:`484` - Type Hints" msgstr "" -#: ../../reference/compound_stmts.rst:1358 +#: ../../reference/compound_stmts.rst:1360 msgid "Definition of a standard meaning for annotations: type hints." msgstr "" -#: ../../reference/compound_stmts.rst:1362 +#: ../../reference/compound_stmts.rst:1364 msgid ":pep:`526` - Syntax for Variable Annotations" msgstr "" -#: ../../reference/compound_stmts.rst:1361 +#: ../../reference/compound_stmts.rst:1363 msgid "" "Ability to type hint variable declarations, including class variables and " "instance variables" msgstr "" -#: ../../reference/compound_stmts.rst:1365 +#: ../../reference/compound_stmts.rst:1367 msgid ":pep:`563` - Postponed Evaluation of Annotations" msgstr "" -#: ../../reference/compound_stmts.rst:1365 +#: ../../reference/compound_stmts.rst:1367 msgid "" "Support for forward references within annotations by preserving annotations " "in a string form at runtime instead of eager evaluation." msgstr "" -#: ../../reference/compound_stmts.rst:1372 +#: ../../reference/compound_stmts.rst:1374 msgid "Class definitions" msgstr "" -#: ../../reference/compound_stmts.rst:1387 +#: ../../reference/compound_stmts.rst:1389 msgid "A class definition defines a class object (see section :ref:`types`):" msgstr "" -#: ../../reference/compound_stmts.rst:1394 +#: ../../reference/compound_stmts.rst:1396 msgid "" "A class definition is an executable statement. The inheritance list usually " "gives a list of base classes (see :ref:`metaclasses` for more advanced " @@ -1552,11 +1552,11 @@ msgid "" "default, from the base class :class:`object`; hence, ::" msgstr "" -#: ../../reference/compound_stmts.rst:1403 +#: ../../reference/compound_stmts.rst:1405 msgid "is equivalent to ::" msgstr "" -#: ../../reference/compound_stmts.rst:1408 +#: ../../reference/compound_stmts.rst:1410 msgid "" "The class's suite is then executed in a new execution frame (see :ref:" "`naming`), using a newly created local namespace and the original global " @@ -1568,7 +1568,7 @@ msgid "" "original local namespace." msgstr "" -#: ../../reference/compound_stmts.rst:1417 +#: ../../reference/compound_stmts.rst:1419 msgid "" "The order in which attributes are defined in the class body is preserved in " "the new class's ``__dict__``. Note that this is reliable only right after " @@ -1576,30 +1576,30 @@ msgid "" "definition syntax." msgstr "" -#: ../../reference/compound_stmts.rst:1422 +#: ../../reference/compound_stmts.rst:1424 msgid "" "Class creation can be customized heavily using :ref:`metaclasses " "`." msgstr "" -#: ../../reference/compound_stmts.rst:1427 +#: ../../reference/compound_stmts.rst:1429 msgid "Classes can also be decorated: just like when decorating functions, ::" msgstr "" -#: ../../reference/compound_stmts.rst:1438 +#: ../../reference/compound_stmts.rst:1440 msgid "" "The evaluation rules for the decorator expressions are the same as for " "function decorators. The result is then bound to the class name." msgstr "" -#: ../../reference/compound_stmts.rst:1441 +#: ../../reference/compound_stmts.rst:1443 msgid "" "Classes may be decorated with any valid :token:`~python-grammar:" "assignment_expression`. Previously, the grammar was much more restrictive; " "see :pep:`614` for details." msgstr "" -#: ../../reference/compound_stmts.rst:1446 +#: ../../reference/compound_stmts.rst:1448 msgid "" "A list of :ref:`type parameters ` may be given in square " "brackets immediately after the class's name. This indicates to static type " @@ -1608,7 +1608,7 @@ msgid "" "classes` for more." msgstr "" -#: ../../reference/compound_stmts.rst:1455 +#: ../../reference/compound_stmts.rst:1457 msgid "" "**Programmer's note:** Variables defined in the class definition are class " "attributes; they are shared by instances. Instance attributes can be set in " @@ -1621,35 +1621,35 @@ msgid "" "implementation details." msgstr "" -#: ../../reference/compound_stmts.rst:1470 +#: ../../reference/compound_stmts.rst:1472 msgid ":pep:`3115` - Metaclasses in Python 3000" msgstr "" -#: ../../reference/compound_stmts.rst:1468 +#: ../../reference/compound_stmts.rst:1470 msgid "" "The proposal that changed the declaration of metaclasses to the current " "syntax, and the semantics for how classes with metaclasses are constructed." msgstr "" -#: ../../reference/compound_stmts.rst:1473 +#: ../../reference/compound_stmts.rst:1475 msgid ":pep:`3129` - Class Decorators" msgstr "" -#: ../../reference/compound_stmts.rst:1473 +#: ../../reference/compound_stmts.rst:1475 msgid "" "The proposal that added class decorators. Function and method decorators " "were introduced in :pep:`318`." msgstr "" -#: ../../reference/compound_stmts.rst:1480 +#: ../../reference/compound_stmts.rst:1482 msgid "Coroutines" msgstr "協程" -#: ../../reference/compound_stmts.rst:1488 +#: ../../reference/compound_stmts.rst:1490 msgid "Coroutine function definition" msgstr "" -#: ../../reference/compound_stmts.rst:1498 +#: ../../reference/compound_stmts.rst:1500 msgid "" "Execution of Python coroutines can be suspended and resumed at many points " "(see :term:`coroutine`). :keyword:`await` expressions, :keyword:`async for` " @@ -1657,109 +1657,109 @@ msgid "" "function." msgstr "" -#: ../../reference/compound_stmts.rst:1502 +#: ../../reference/compound_stmts.rst:1504 msgid "" "Functions defined with ``async def`` syntax are always coroutine functions, " "even if they do not contain ``await`` or ``async`` keywords." msgstr "" -#: ../../reference/compound_stmts.rst:1505 +#: ../../reference/compound_stmts.rst:1507 msgid "" "It is a :exc:`SyntaxError` to use a ``yield from`` expression inside the " "body of a coroutine function." msgstr "" -#: ../../reference/compound_stmts.rst:1508 +#: ../../reference/compound_stmts.rst:1510 msgid "An example of a coroutine function::" msgstr "" "一個協程韓式函式範例:\n" "\n" "::" -#: ../../reference/compound_stmts.rst:1514 +#: ../../reference/compound_stmts.rst:1516 msgid "" "``await`` and ``async`` are now keywords; previously they were only treated " "as such inside the body of a coroutine function." msgstr "" -#: ../../reference/compound_stmts.rst:1522 +#: ../../reference/compound_stmts.rst:1524 msgid "The :keyword:`!async for` statement" msgstr "" -#: ../../reference/compound_stmts.rst:1527 +#: ../../reference/compound_stmts.rst:1529 msgid "" "An :term:`asynchronous iterable` provides an ``__aiter__`` method that " "directly returns an :term:`asynchronous iterator`, which can call " "asynchronous code in its ``__anext__`` method." msgstr "" -#: ../../reference/compound_stmts.rst:1531 +#: ../../reference/compound_stmts.rst:1533 msgid "" "The ``async for`` statement allows convenient iteration over asynchronous " "iterables." msgstr "" -#: ../../reference/compound_stmts.rst:1541 +#: ../../reference/compound_stmts.rst:1543 msgid "Is semantically equivalent to::" msgstr "" -#: ../../reference/compound_stmts.rst:1557 +#: ../../reference/compound_stmts.rst:1559 msgid "" "See also :meth:`~object.__aiter__` and :meth:`~object.__anext__` for details." msgstr "" "更多細節請見 :meth:`~object.__aiter__` 與 :meth:`~object.__anext__`\\ 。" -#: ../../reference/compound_stmts.rst:1559 +#: ../../reference/compound_stmts.rst:1561 msgid "" "It is a :exc:`SyntaxError` to use an ``async for`` statement outside the " "body of a coroutine function." msgstr "" -#: ../../reference/compound_stmts.rst:1567 +#: ../../reference/compound_stmts.rst:1569 msgid "The :keyword:`!async with` statement" msgstr "" -#: ../../reference/compound_stmts.rst:1572 +#: ../../reference/compound_stmts.rst:1574 msgid "" "An :term:`asynchronous context manager` is a :term:`context manager` that is " "able to suspend execution in its *enter* and *exit* methods." msgstr "" -#: ../../reference/compound_stmts.rst:1599 +#: ../../reference/compound_stmts.rst:1601 msgid "" "See also :meth:`~object.__aenter__` and :meth:`~object.__aexit__` for " "details." msgstr "" "更多細節請見 :meth:`~object.__aenter__` 與 :meth:`~object.__aexit__`\\ 。" -#: ../../reference/compound_stmts.rst:1601 +#: ../../reference/compound_stmts.rst:1603 msgid "" "It is a :exc:`SyntaxError` to use an ``async with`` statement outside the " "body of a coroutine function." msgstr "" -#: ../../reference/compound_stmts.rst:1607 +#: ../../reference/compound_stmts.rst:1609 msgid ":pep:`492` - Coroutines with async and await syntax" msgstr "" -#: ../../reference/compound_stmts.rst:1607 +#: ../../reference/compound_stmts.rst:1609 msgid "" "The proposal that made coroutines a proper standalone concept in Python, and " "added supporting syntax." msgstr "" -#: ../../reference/compound_stmts.rst:1613 +#: ../../reference/compound_stmts.rst:1615 msgid "Type parameter lists" msgstr "" -#: ../../reference/compound_stmts.rst:1627 +#: ../../reference/compound_stmts.rst:1629 msgid "" ":ref:`Functions ` (including :ref:`coroutines `), :ref:" "`classes ` and :ref:`type aliases ` may contain a type " "parameter list::" msgstr "" -#: ../../reference/compound_stmts.rst:1646 +#: ../../reference/compound_stmts.rst:1648 msgid "" "Semantically, this indicates that the function, class, or type alias is " "generic over a type variable. This information is primarily used by static " @@ -1767,7 +1767,7 @@ msgid "" "generic counterparts." msgstr "" -#: ../../reference/compound_stmts.rst:1651 +#: ../../reference/compound_stmts.rst:1653 msgid "" "Type parameters are declared in square brackets (``[]``) immediately after " "the name of the function, class, or type alias. The type parameters are " @@ -1779,36 +1779,36 @@ msgid "" "wraps the creation of the generic object." msgstr "" -#: ../../reference/compound_stmts.rst:1660 +#: ../../reference/compound_stmts.rst:1662 msgid "" "Generic functions, classes, and type aliases have a :attr:`!__type_params__` " "attribute listing their type parameters." msgstr "" -#: ../../reference/compound_stmts.rst:1663 +#: ../../reference/compound_stmts.rst:1665 msgid "Type parameters come in three kinds:" msgstr "" -#: ../../reference/compound_stmts.rst:1665 +#: ../../reference/compound_stmts.rst:1667 msgid "" ":data:`typing.TypeVar`, introduced by a plain name (e.g., ``T``). " "Semantically, this represents a single type to a type checker." msgstr "" -#: ../../reference/compound_stmts.rst:1667 +#: ../../reference/compound_stmts.rst:1669 msgid "" ":data:`typing.TypeVarTuple`, introduced by a name prefixed with a single " "asterisk (e.g., ``*Ts``). Semantically, this stands for a tuple of any " "number of types." msgstr "" -#: ../../reference/compound_stmts.rst:1670 +#: ../../reference/compound_stmts.rst:1672 msgid "" ":data:`typing.ParamSpec`, introduced by a name prefixed with two asterisks " "(e.g., ``**P``). Semantically, this stands for the parameters of a callable." msgstr "" -#: ../../reference/compound_stmts.rst:1673 +#: ../../reference/compound_stmts.rst:1675 msgid "" ":data:`typing.TypeVar` declarations can define *bounds* and *constraints* " "with a colon (``:``) followed by an expression. A single expression after " @@ -1820,7 +1820,7 @@ msgid "" "variables can only take on one of the types in the list of constraints." msgstr "" -#: ../../reference/compound_stmts.rst:1682 +#: ../../reference/compound_stmts.rst:1684 msgid "" "For :data:`!typing.TypeVar`\\ s declared using the type parameter list " "syntax, the bound and constraints are not evaluated when the generic object " @@ -1830,35 +1830,35 @@ msgid "" "`." msgstr "" -#: ../../reference/compound_stmts.rst:1688 +#: ../../reference/compound_stmts.rst:1690 msgid "" ":data:`typing.TypeVarTuple`\\ s and :data:`typing.ParamSpec`\\ s cannot have " "bounds or constraints." msgstr "" -#: ../../reference/compound_stmts.rst:1691 +#: ../../reference/compound_stmts.rst:1693 msgid "" "The following example indicates the full set of allowed type parameter " "declarations::" msgstr "" -#: ../../reference/compound_stmts.rst:1709 +#: ../../reference/compound_stmts.rst:1711 msgid "Generic functions" msgstr "" -#: ../../reference/compound_stmts.rst:1711 +#: ../../reference/compound_stmts.rst:1713 msgid "Generic functions are declared as follows::" msgstr "" -#: ../../reference/compound_stmts.rst:1715 -#: ../../reference/compound_stmts.rst:1775 +#: ../../reference/compound_stmts.rst:1717 +#: ../../reference/compound_stmts.rst:1777 msgid "This syntax is equivalent to::" msgstr "" "語法大致等價於:\n" "\n" "::" -#: ../../reference/compound_stmts.rst:1724 +#: ../../reference/compound_stmts.rst:1726 msgid "" "Here ``annotation-def`` indicates an :ref:`annotation scope `, which is not actually bound to any name at runtime. (One other " @@ -1867,47 +1867,47 @@ msgid "" "data:`typing.TypeVar` directly.)" msgstr "" -#: ../../reference/compound_stmts.rst:1730 +#: ../../reference/compound_stmts.rst:1732 msgid "" "The annotations of generic functions are evaluated within the annotation " "scope used for declaring the type parameters, but the function's defaults " "and decorators are not." msgstr "" -#: ../../reference/compound_stmts.rst:1734 +#: ../../reference/compound_stmts.rst:1736 msgid "" "The following example illustrates the scoping rules for these cases, as well " "as for additional flavors of type parameters::" msgstr "" -#: ../../reference/compound_stmts.rst:1741 +#: ../../reference/compound_stmts.rst:1743 msgid "" "Except for the :ref:`lazy evaluation ` of the :class:" "`~typing.TypeVar` bound, this is equivalent to::" msgstr "" -#: ../../reference/compound_stmts.rst:1763 +#: ../../reference/compound_stmts.rst:1765 msgid "" "The capitalized names like ``DEFAULT_OF_arg`` are not actually bound at " "runtime." msgstr "" -#: ../../reference/compound_stmts.rst:1769 +#: ../../reference/compound_stmts.rst:1771 msgid "Generic classes" msgstr "" -#: ../../reference/compound_stmts.rst:1771 +#: ../../reference/compound_stmts.rst:1773 msgid "Generic classes are declared as follows::" msgstr "" -#: ../../reference/compound_stmts.rst:1785 +#: ../../reference/compound_stmts.rst:1787 msgid "" "Here again ``annotation-def`` (not a real keyword) indicates an :ref:" "`annotation scope `, and the name ``TYPE_PARAMS_OF_Bag`` " "is not actually bound at runtime." msgstr "" -#: ../../reference/compound_stmts.rst:1789 +#: ../../reference/compound_stmts.rst:1791 msgid "" "Generic classes implicitly inherit from :data:`typing.Generic`. The base " "classes and keyword arguments of generic classes are evaluated within the " @@ -1915,128 +1915,128 @@ msgid "" "that scope. This is illustrated by this example::" msgstr "" -#: ../../reference/compound_stmts.rst:1798 +#: ../../reference/compound_stmts.rst:1800 msgid "This is equivalent to::" msgstr "" "這等價於:\n" "\n" "::" -#: ../../reference/compound_stmts.rst:1811 +#: ../../reference/compound_stmts.rst:1813 msgid "Generic type aliases" msgstr "" -#: ../../reference/compound_stmts.rst:1813 +#: ../../reference/compound_stmts.rst:1815 msgid "" "The :keyword:`type` statement can also be used to create a generic type " "alias::" msgstr "" -#: ../../reference/compound_stmts.rst:1817 +#: ../../reference/compound_stmts.rst:1819 msgid "" "Except for the :ref:`lazy evaluation ` of the value, this " "is equivalent to::" msgstr "" -#: ../../reference/compound_stmts.rst:1829 +#: ../../reference/compound_stmts.rst:1831 msgid "" "Here, ``annotation-def`` (not a real keyword) indicates an :ref:`annotation " "scope `. The capitalized names like " "``TYPE_PARAMS_OF_ListOrSet`` are not actually bound at runtime." msgstr "" -#: ../../reference/compound_stmts.rst:1834 +#: ../../reference/compound_stmts.rst:1836 msgid "Footnotes" msgstr "註解" -#: ../../reference/compound_stmts.rst:1835 +#: ../../reference/compound_stmts.rst:1837 msgid "" "The exception is propagated to the invocation stack unless there is a :" "keyword:`finally` clause which happens to raise another exception. That new " "exception causes the old one to be lost." msgstr "" -#: ../../reference/compound_stmts.rst:1839 +#: ../../reference/compound_stmts.rst:1841 msgid "In pattern matching, a sequence is defined as one of the following:" msgstr "" -#: ../../reference/compound_stmts.rst:1841 +#: ../../reference/compound_stmts.rst:1843 msgid "a class that inherits from :class:`collections.abc.Sequence`" msgstr "" -#: ../../reference/compound_stmts.rst:1842 +#: ../../reference/compound_stmts.rst:1844 msgid "" "a Python class that has been registered as :class:`collections.abc.Sequence`" msgstr "" -#: ../../reference/compound_stmts.rst:1843 +#: ../../reference/compound_stmts.rst:1845 msgid "" "a builtin class that has its (CPython) :c:macro:`Py_TPFLAGS_SEQUENCE` bit set" msgstr "" -#: ../../reference/compound_stmts.rst:1844 -#: ../../reference/compound_stmts.rst:1863 +#: ../../reference/compound_stmts.rst:1846 +#: ../../reference/compound_stmts.rst:1865 msgid "a class that inherits from any of the above" msgstr "" -#: ../../reference/compound_stmts.rst:1846 +#: ../../reference/compound_stmts.rst:1848 msgid "The following standard library classes are sequences:" msgstr "" -#: ../../reference/compound_stmts.rst:1848 +#: ../../reference/compound_stmts.rst:1850 msgid ":class:`array.array`" msgstr ":class:`array.array`" -#: ../../reference/compound_stmts.rst:1849 +#: ../../reference/compound_stmts.rst:1851 msgid ":class:`collections.deque`" msgstr ":class:`collections.deque`" -#: ../../reference/compound_stmts.rst:1851 +#: ../../reference/compound_stmts.rst:1853 msgid ":class:`memoryview`" msgstr ":class:`memoryview`" -#: ../../reference/compound_stmts.rst:1852 +#: ../../reference/compound_stmts.rst:1854 msgid ":class:`range`" msgstr ":class:`range`" -#: ../../reference/compound_stmts.rst:1855 +#: ../../reference/compound_stmts.rst:1857 msgid "" "Subject values of type ``str``, ``bytes``, and ``bytearray`` do not match " "sequence patterns." msgstr "" -#: ../../reference/compound_stmts.rst:1858 +#: ../../reference/compound_stmts.rst:1860 msgid "In pattern matching, a mapping is defined as one of the following:" msgstr "" -#: ../../reference/compound_stmts.rst:1860 +#: ../../reference/compound_stmts.rst:1862 msgid "a class that inherits from :class:`collections.abc.Mapping`" msgstr "" -#: ../../reference/compound_stmts.rst:1861 +#: ../../reference/compound_stmts.rst:1863 msgid "" "a Python class that has been registered as :class:`collections.abc.Mapping`" msgstr "" -#: ../../reference/compound_stmts.rst:1862 +#: ../../reference/compound_stmts.rst:1864 msgid "" "a builtin class that has its (CPython) :c:macro:`Py_TPFLAGS_MAPPING` bit set" msgstr "" -#: ../../reference/compound_stmts.rst:1865 +#: ../../reference/compound_stmts.rst:1867 msgid "" "The standard library classes :class:`dict` and :class:`types." "MappingProxyType` are mappings." msgstr "" -#: ../../reference/compound_stmts.rst:1868 +#: ../../reference/compound_stmts.rst:1870 msgid "" "A string literal appearing as the first statement in the function body is " "transformed into the function's ``__doc__`` attribute and therefore the " "function's :term:`docstring`." msgstr "" -#: ../../reference/compound_stmts.rst:1872 +#: ../../reference/compound_stmts.rst:1874 msgid "" "A string literal appearing as the first statement in the class body is " "transformed into the namespace's ``__doc__`` item and therefore the class's :" @@ -2057,11 +2057,11 @@ msgstr "compound(複合)" #: ../../reference/compound_stmts.rst:436 #: ../../reference/compound_stmts.rst:470 #: ../../reference/compound_stmts.rst:587 -#: ../../reference/compound_stmts.rst:1192 -#: ../../reference/compound_stmts.rst:1374 -#: ../../reference/compound_stmts.rst:1484 -#: ../../reference/compound_stmts.rst:1518 -#: ../../reference/compound_stmts.rst:1563 +#: ../../reference/compound_stmts.rst:1194 +#: ../../reference/compound_stmts.rst:1376 +#: ../../reference/compound_stmts.rst:1486 +#: ../../reference/compound_stmts.rst:1520 +#: ../../reference/compound_stmts.rst:1565 msgid "statement" msgstr "statement(陳述式)" @@ -2109,7 +2109,7 @@ msgstr "if" #: ../../reference/compound_stmts.rst:407 #: ../../reference/compound_stmts.rst:470 #: ../../reference/compound_stmts.rst:587 -#: ../../reference/compound_stmts.rst:1494 +#: ../../reference/compound_stmts.rst:1496 msgid "keyword" msgstr "keyword(關鍵字)" @@ -2122,9 +2122,9 @@ msgstr "elif" #: ../../reference/compound_stmts.rst:207 #: ../../reference/compound_stmts.rst:470 #: ../../reference/compound_stmts.rst:587 -#: ../../reference/compound_stmts.rst:1192 -#: ../../reference/compound_stmts.rst:1318 -#: ../../reference/compound_stmts.rst:1374 +#: ../../reference/compound_stmts.rst:1194 +#: ../../reference/compound_stmts.rst:1320 +#: ../../reference/compound_stmts.rst:1376 msgid ": (colon)" msgstr ": (冒號)" @@ -2133,8 +2133,8 @@ msgstr ": (冒號)" #: ../../reference/compound_stmts.rst:207 #: ../../reference/compound_stmts.rst:470 #: ../../reference/compound_stmts.rst:587 -#: ../../reference/compound_stmts.rst:1192 -#: ../../reference/compound_stmts.rst:1374 +#: ../../reference/compound_stmts.rst:1194 +#: ../../reference/compound_stmts.rst:1376 msgid "compound statement" msgstr "compound statement(複合陳述式)" @@ -2179,8 +2179,8 @@ msgstr "list(串列)" #: ../../reference/compound_stmts.rst:144 #: ../../reference/compound_stmts.rst:299 -#: ../../reference/compound_stmts.rst:1192 -#: ../../reference/compound_stmts.rst:1374 +#: ../../reference/compound_stmts.rst:1194 +#: ../../reference/compound_stmts.rst:1376 msgid "object" msgstr "object(物件)" @@ -2250,8 +2250,8 @@ msgid "with statement" msgstr "with statement(with 陳述式)" #: ../../reference/compound_stmts.rst:470 -#: ../../reference/compound_stmts.rst:1192 -#: ../../reference/compound_stmts.rst:1374 +#: ../../reference/compound_stmts.rst:1194 +#: ../../reference/compound_stmts.rst:1376 msgid ", (comma)" msgstr ", (逗號)" @@ -2291,158 +2291,158 @@ msgstr "" msgid "AS pattern, OR pattern, capture pattern, wildcard pattern" msgstr "" -#: ../../reference/compound_stmts.rst:1183 -#: ../../reference/compound_stmts.rst:1268 +#: ../../reference/compound_stmts.rst:1185 +#: ../../reference/compound_stmts.rst:1270 msgid "parameter" msgstr "parameter(參數)" -#: ../../reference/compound_stmts.rst:1183 -#: ../../reference/compound_stmts.rst:1192 -#: ../../reference/compound_stmts.rst:1233 -#: ../../reference/compound_stmts.rst:1268 -#: ../../reference/compound_stmts.rst:1297 +#: ../../reference/compound_stmts.rst:1185 +#: ../../reference/compound_stmts.rst:1194 +#: ../../reference/compound_stmts.rst:1235 +#: ../../reference/compound_stmts.rst:1270 +#: ../../reference/compound_stmts.rst:1299 msgid "function definition" msgstr "function definition(函式定義)" -#: ../../reference/compound_stmts.rst:1192 +#: ../../reference/compound_stmts.rst:1194 msgid "def" msgstr "def" -#: ../../reference/compound_stmts.rst:1192 -#: ../../reference/compound_stmts.rst:1318 +#: ../../reference/compound_stmts.rst:1194 +#: ../../reference/compound_stmts.rst:1320 msgid "function" msgstr "function (函式)" -#: ../../reference/compound_stmts.rst:1192 -#: ../../reference/compound_stmts.rst:1374 +#: ../../reference/compound_stmts.rst:1194 +#: ../../reference/compound_stmts.rst:1376 msgid "definition" msgstr "definition(定義)" -#: ../../reference/compound_stmts.rst:1192 -#: ../../reference/compound_stmts.rst:1374 +#: ../../reference/compound_stmts.rst:1194 +#: ../../reference/compound_stmts.rst:1376 msgid "name" msgstr "name(名稱)" -#: ../../reference/compound_stmts.rst:1192 -#: ../../reference/compound_stmts.rst:1374 +#: ../../reference/compound_stmts.rst:1194 +#: ../../reference/compound_stmts.rst:1376 msgid "binding" msgstr "binding(綁定)" -#: ../../reference/compound_stmts.rst:1192 +#: ../../reference/compound_stmts.rst:1194 msgid "user-defined function" msgstr "user-defined function(使用者定義函式)" -#: ../../reference/compound_stmts.rst:1192 -#: ../../reference/compound_stmts.rst:1374 +#: ../../reference/compound_stmts.rst:1194 +#: ../../reference/compound_stmts.rst:1376 msgid "() (parentheses)" msgstr "() (圓括號)" -#: ../../reference/compound_stmts.rst:1192 +#: ../../reference/compound_stmts.rst:1194 msgid "parameter list" msgstr "parameter list(參數列表)" -#: ../../reference/compound_stmts.rst:1233 -#: ../../reference/compound_stmts.rst:1424 +#: ../../reference/compound_stmts.rst:1235 +#: ../../reference/compound_stmts.rst:1426 msgid "@ (at)" msgstr "@ (在)" -#: ../../reference/compound_stmts.rst:1268 +#: ../../reference/compound_stmts.rst:1270 msgid "default" msgstr "default(預設)" -#: ../../reference/compound_stmts.rst:1268 +#: ../../reference/compound_stmts.rst:1270 msgid "value" msgstr "value(值)" -#: ../../reference/compound_stmts.rst:1268 +#: ../../reference/compound_stmts.rst:1270 msgid "argument" msgstr "argument(引數)" -#: ../../reference/compound_stmts.rst:1268 +#: ../../reference/compound_stmts.rst:1270 msgid "= (equals)" msgstr "= (等於)" -#: ../../reference/compound_stmts.rst:1297 +#: ../../reference/compound_stmts.rst:1299 msgid "/ (slash)" msgstr "/ (斜線)" -#: ../../reference/compound_stmts.rst:1297 +#: ../../reference/compound_stmts.rst:1299 msgid "* (asterisk)" msgstr "* (星號)" -#: ../../reference/compound_stmts.rst:1297 +#: ../../reference/compound_stmts.rst:1299 msgid "**" msgstr "**" -#: ../../reference/compound_stmts.rst:1318 +#: ../../reference/compound_stmts.rst:1320 msgid "annotations" msgstr "annotations(註釋)" -#: ../../reference/compound_stmts.rst:1318 +#: ../../reference/compound_stmts.rst:1320 msgid "->" msgstr "->" -#: ../../reference/compound_stmts.rst:1318 +#: ../../reference/compound_stmts.rst:1320 msgid "function annotations" msgstr "function annotations(函式註釋)" -#: ../../reference/compound_stmts.rst:1336 +#: ../../reference/compound_stmts.rst:1338 msgid "lambda" msgstr "lambda" -#: ../../reference/compound_stmts.rst:1336 +#: ../../reference/compound_stmts.rst:1338 msgid "expression" msgstr "expression(運算式)" -#: ../../reference/compound_stmts.rst:1374 +#: ../../reference/compound_stmts.rst:1376 msgid "class" msgstr "class(類別)" -#: ../../reference/compound_stmts.rst:1374 +#: ../../reference/compound_stmts.rst:1376 msgid "execution" msgstr "execution(執行)" -#: ../../reference/compound_stmts.rst:1374 +#: ../../reference/compound_stmts.rst:1376 msgid "frame" msgstr "frame" -#: ../../reference/compound_stmts.rst:1374 +#: ../../reference/compound_stmts.rst:1376 msgid "inheritance" msgstr "inheritance(繼承)" -#: ../../reference/compound_stmts.rst:1374 +#: ../../reference/compound_stmts.rst:1376 msgid "docstring" msgstr "docstring(說明字串)" -#: ../../reference/compound_stmts.rst:1374 -#: ../../reference/compound_stmts.rst:1424 +#: ../../reference/compound_stmts.rst:1376 +#: ../../reference/compound_stmts.rst:1426 msgid "class definition" msgstr "class definition(類別定義)" -#: ../../reference/compound_stmts.rst:1374 +#: ../../reference/compound_stmts.rst:1376 msgid "expression list" msgstr "expression list(表達式列表)" -#: ../../reference/compound_stmts.rst:1484 +#: ../../reference/compound_stmts.rst:1486 msgid "async def" msgstr "async def" -#: ../../reference/compound_stmts.rst:1494 +#: ../../reference/compound_stmts.rst:1496 msgid "async" msgstr "async" -#: ../../reference/compound_stmts.rst:1494 +#: ../../reference/compound_stmts.rst:1496 msgid "await" msgstr "await" -#: ../../reference/compound_stmts.rst:1518 +#: ../../reference/compound_stmts.rst:1520 msgid "async for" msgstr "async for" -#: ../../reference/compound_stmts.rst:1563 +#: ../../reference/compound_stmts.rst:1565 msgid "async with" msgstr "async with" -#: ../../reference/compound_stmts.rst:1617 +#: ../../reference/compound_stmts.rst:1619 msgid "type parameters" msgstr "type parameter(型別參數)" diff --git a/reference/lexical_analysis.po b/reference/lexical_analysis.po index a58e3375df..017a48a4ea 100644 --- a/reference/lexical_analysis.po +++ b/reference/lexical_analysis.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 10:36+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -337,11 +337,11 @@ msgstr "" #: ../../reference/lexical_analysis.rst:307 msgid "*Lu* - uppercase letters" -msgstr "" +msgstr "*Lu* - 大寫字母" #: ../../reference/lexical_analysis.rst:308 msgid "*Ll* - lowercase letters" -msgstr "" +msgstr "*Ll* - 小寫字母" #: ../../reference/lexical_analysis.rst:309 msgid "*Lt* - titlecase letters" @@ -353,7 +353,7 @@ msgstr "" #: ../../reference/lexical_analysis.rst:311 msgid "*Lo* - other letters" -msgstr "" +msgstr "*Lo* - 其他字母" #: ../../reference/lexical_analysis.rst:312 msgid "*Nl* - letter numbers" @@ -369,7 +369,7 @@ msgstr "" #: ../../reference/lexical_analysis.rst:315 msgid "*Nd* - decimal numbers" -msgstr "" +msgstr "*Nd* - 十進位數字" #: ../../reference/lexical_analysis.rst:316 msgid "*Pc* - connector punctuations" @@ -401,7 +401,7 @@ msgstr "" #: ../../reference/lexical_analysis.rst:333 msgid "Keywords" -msgstr "" +msgstr "關鍵字" #: ../../reference/lexical_analysis.rst:339 msgid "" @@ -412,7 +412,7 @@ msgstr "" #: ../../reference/lexical_analysis.rst:357 msgid "Soft Keywords" -msgstr "" +msgstr "軟關鍵字" #: ../../reference/lexical_analysis.rst:363 msgid "" @@ -437,7 +437,7 @@ msgstr "" #: ../../reference/lexical_analysis.rst:375 msgid "``type`` is now a soft keyword." -msgstr "" +msgstr "``type`` 現在是軟關鍵字。" #: ../../reference/lexical_analysis.rst:384 msgid "Reserved classes of identifiers" @@ -657,7 +657,7 @@ msgstr "``\\'``" #: ../../reference/lexical_analysis.rst:567 msgid "Single quote (``'``)" -msgstr "" +msgstr "單引號 (``'``)" #: ../../reference/lexical_analysis.rst:569 msgid "``\\\"``" @@ -665,7 +665,7 @@ msgstr "``\\\"``" #: ../../reference/lexical_analysis.rst:569 msgid "Double quote (``\"``)" -msgstr "" +msgstr "雙引號 (``\"``)" #: ../../reference/lexical_analysis.rst:571 msgid "``\\a``" @@ -724,8 +724,8 @@ msgid "ASCII Vertical Tab (VT)" msgstr "" #: ../../reference/lexical_analysis.rst:585 -msgid "``\\ooo``" -msgstr "``\\ooo``" +msgid ":samp:`\\\\\\\\{ooo}`" +msgstr "" #: ../../reference/lexical_analysis.rst:585 msgid "Character with octal value *ooo*" @@ -736,8 +736,8 @@ msgid "(2,4)" msgstr "(2,4)" #: ../../reference/lexical_analysis.rst:588 -msgid "``\\xhh``" -msgstr "``\\xhh``" +msgid ":samp:`\\\\x{hh}`" +msgstr ":samp:`\\\\x{hh}`" #: ../../reference/lexical_analysis.rst:588 msgid "Character with hex value *hh*" @@ -752,8 +752,8 @@ msgid "Escape sequences only recognized in string literals are:" msgstr "" #: ../../reference/lexical_analysis.rst:596 -msgid "``\\N{name}``" -msgstr "``\\N{name}``" +msgid ":samp:`\\\\N\\\\{{name}\\\\}`" +msgstr ":samp:`\\\\N\\\\{{name}\\\\}`" #: ../../reference/lexical_analysis.rst:596 msgid "Character named *name* in the Unicode database" @@ -764,8 +764,8 @@ msgid "\\(5)" msgstr "\\(5)" #: ../../reference/lexical_analysis.rst:599 -msgid "``\\uxxxx``" -msgstr "``\\uxxxx``" +msgid ":samp:`\\\\u{xxxx}`" +msgstr ":samp:`\\\\u{xxxx}`" #: ../../reference/lexical_analysis.rst:599 msgid "Character with 16-bit hex value *xxxx*" @@ -776,8 +776,8 @@ msgid "\\(6)" msgstr "\\(6)" #: ../../reference/lexical_analysis.rst:602 -msgid "``\\Uxxxxxxxx``" -msgstr "``\\Uxxxxxxxx``" +msgid ":samp:`\\\\U{xxxxxxxx}`" +msgstr ":samp:`\\\\U{xxxxxxxx}`" #: ../../reference/lexical_analysis.rst:602 msgid "Character with 32-bit hex value *xxxxxxxx*" @@ -974,7 +974,7 @@ msgstr "" #: ../../reference/lexical_analysis.rst:782 msgid "The equal sign ``'='``." -msgstr "" +msgstr "等號 ``'='``。" #: ../../reference/lexical_analysis.rst:785 msgid "" @@ -1608,3 +1608,15 @@ msgstr "operators(運算子)" #: ../../reference/lexical_analysis.rst:1015 msgid "delimiters" msgstr "delimiters(分隔符號)" + +#~ msgid "``\\ooo``" +#~ msgstr "``\\ooo``" + +#~ msgid "``\\xhh``" +#~ msgstr "``\\xhh``" + +#~ msgid "``\\N{name}``" +#~ msgstr "``\\N{name}``" + +#~ msgid "``\\uxxxx``" +#~ msgstr "``\\uxxxx``" diff --git a/tutorial/controlflow.po b/tutorial/controlflow.po index 70a87a9db4..bd3440f671 100644 --- a/tutorial/controlflow.po +++ b/tutorial/controlflow.po @@ -11,7 +11,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-22 00:03+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2022-07-24 14:52+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -648,7 +648,7 @@ msgid "" "the object's type. Different types define different methods. Methods of " "different types may have the same name without causing ambiguity. (It is " "possible to define your own object types and methods, using *classes*, see :" -"ref:`tut-classes`) The method :meth:`~list.append` shown in the example is " +"ref:`tut-classes`) The method :meth:`!append` shown in the example is " "defined for list objects; it adds a new element at the end of the list. In " "this example it is equivalent to ``result = result + [a]``, but more " "efficient." @@ -658,9 +658,9 @@ msgstr "" "``obj`` 為某個物件(亦可為一運算式),而 ``methodname`` 為該 method 的名稱," "並由該物件的型別所定義。不同的型別定義不同的 method。不同型別的 method 可以擁" "有一樣的名稱而不會讓 Python 混淆。(你可以使用 *class*\\ (類別)定義自己的物" -"件型別和 method,見 :ref:`tut-classes`\\ )範例中的 :meth:`~list.append` " -"method 定義在 list 物件中;它會在該 list 的末端加入一個新的元素。這個例子等同" -"於 ``result = result + [a]``,但更有效率。" +"件型別和 method,見 :ref:`tut-classes`\\ )範例中的 :meth:`!append` method 定" +"義在 list 物件中;它會在該 list 的末端加入一個新的元素。這個例子等同於 " +"``result = result + [a]``,但更有效率。" #: ../../tutorial/controlflow.rst:545 msgid "More on Defining Functions" @@ -1227,8 +1227,8 @@ msgstr "" #: ../../tutorial/controlflow.rst:1049 msgid "" -":term:`Annotations ` are stored in the :attr:" -"`__annotations__` attribute of the function as a dictionary and have no " +":term:`Annotations ` are stored in the :attr:`!" +"__annotations__` attribute of the function as a dictionary and have no " "effect on any other part of the function. Parameter annotations are defined " "by a colon after the parameter name, followed by an expression evaluating to " "the value of the annotation. Return annotations are defined by a literal ``-" @@ -1237,10 +1237,10 @@ msgid "" "a required argument, an optional argument, and the return value annotated::" msgstr "" ":term:`註釋 `\\ 以 dictionary(字典)的形式存放在函式" -"的 :attr:`__annotations__` 屬性中,且不會影響函式的任何其他部分。參數註釋的定" -"義方式是在參數名稱後加一個冒號,冒號後面跟著一個對註釋求值的運算式。回傳註釋" -"的定義方式是在參數列表和 :keyword:`def` 陳述式結尾的冒號中間,用一個 ``->`` " -"文字接著一個運算式。以下範例註釋了一個必要引數、一個選擇性引數,以及回傳" +"的 :attr:`!__annotations__` 屬性中,且不會影響函式的任何其他部分。參數註釋的" +"定義方式是在參數名稱後加一個冒號,冒號後面跟著一個對註釋求值的運算式。回傳註" +"釋的定義方式是在參數列表和 :keyword:`def` 陳述式結尾的冒號中間,用一個 ``-" +">`` 文字接著一個運算式。以下範例註釋了一個必要引數、一個選擇性引數,以及回傳" "值:\n" "\n" "::" diff --git a/tutorial/floatingpoint.po b/tutorial/floatingpoint.po index fdd9c5324d..3b9786296a 100644 --- a/tutorial/floatingpoint.po +++ b/tutorial/floatingpoint.po @@ -11,7 +11,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2023-06-22 14:43+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -220,8 +220,8 @@ msgstr "" #: ../../tutorial/floatingpoint.rst:139 msgid "" "Alternatively, the :func:`round` function can be used to compare rough " -"approximations::" -msgstr "或者,可以使用 :func:`round` 函式來比較粗略的近似值: ::" +"approximations:" +msgstr "或者,可以使用 :func:`round` 函式來比較粗略的近似值:" #: ../../tutorial/floatingpoint.rst:147 msgid "" diff --git a/tutorial/introduction.po b/tutorial/introduction.po index ee580ee041..9979da11cf 100644 --- a/tutorial/introduction.po +++ b/tutorial/introduction.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-25 00:04+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2022-10-16 03:20+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -35,7 +35,7 @@ msgid "" "that a secondary prompt on a line by itself in an example means you must " "type a blank line; this is used to end a multi-line command." msgstr "" -"在下面的例子中,輸入與輸出的區別在於有無提示字元(prompt,\\ :term:`>>>` 和 :" +"在下面的例子中,輸入與輸出的區別在於有無提示字元(prompt,:term:`>>>` 和 :" "term:`...`\\ ):如果要重做範例,你必須在提示字元出現的時候,輸入提示字元後方" "的所有內容;那些非提示字元開始的文字行是直譯器的輸出。注意到在範例中,若出現" "單行只有次提示字元時,代表該行你必須直接換行;這被使用在多行指令結束輸入時。" @@ -264,8 +264,8 @@ msgid "" "at the end of the line. The following example::" msgstr "" "字串文本可以跨越數行。其中一方式是使用三個重覆引號:\\ ``\"\"\"...\"\"\"`` " -"或 ``'''...'''``\\ 。此時換行會被自動加入字串值中,但也可以在換行前加入 " -"``\\`` 來取消這個行為。在以下的例子中:\n" +"或 ``'''...'''``。此時換行會被自動加入字串值中,但也可以在換行前加入 ``\\`` " +"來取消這個行為。在以下的例子中:\n" "\n" "::" @@ -590,7 +590,7 @@ msgstr "初探程式設計的前幾步" msgid "" "Of course, we can use Python for more complicated tasks than adding two and " "two together. For instance, we can write an initial sub-sequence of the " -"`Fibonacci series `_ as " +"`Fibonacci series `_ as " "follows::" msgstr "" "當然,我們可以用 Python 來處理比 2 加 2 更複雜的工作。例如,我們可以印出\\ `" @@ -630,9 +630,8 @@ msgstr "" "行。在 Python 中如同 C 語言,任何非零的整數值為真 (true);零為假 (false)。條" "件可以是字串、list、甚至是任何序列型別;任何非零長度的序列為真,空的序列即為" "假。本例子使用的條件是個簡單的比較。標準的比較運算子 (comparison operators) " -"使用如同 C 語言一樣的符號:\\ ``<``\\ (小於)、\\ ``>``\\ (大於)、\\ " -"``==``\\ (等於)、\\ ``<=``\\ (小於等於)、\\ ``>=``\\ (大於等於)以及 ``!" -"=``\\ (不等於)。" +"使用如同 C 語言一樣的符號:``<``\\ (小於)、``>``\\ (大於)、``==``\\ (等" +"於)、``<=``\\ (小於等於)、``>=``\\ (大於等於)以及 ``!=``\\ (不等於)。" #: ../../tutorial/introduction.rst:518 msgid "" @@ -688,9 +687,8 @@ msgid "" "as ``-(3**2)`` and thus result in ``-9``. To avoid this and get ``9``, you " "can use ``(-3)**2``." msgstr "" -"因為 ``**`` 擁有較 ``-`` 高的優先次序,\\ ``-3**2`` 會被解釋為 ``-(3**2)`` 並" -"得到 ``-9``\\ 。如果要避免這樣的優先順序以得到 ``9``,你可以使用 " -"``(-3)**2``\\ 。" +"因為 ``**`` 擁有較 ``-`` 高的優先次序,``-3**2`` 會被解釋為 ``-(3**2)`` 並得" +"到 ``-9``。如果要避免這樣的優先順序以得到 ``9``,你可以使用 ``(-3)**2``。" #: ../../tutorial/introduction.rst:555 msgid "" diff --git a/using/cmdline.po b/using/cmdline.po index 06d0f4d366..4bc54baaa8 100644 --- a/using/cmdline.po +++ b/using/cmdline.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-18 00:03+0000\n" +"POT-Creation-Date: 2023-10-14 23:09+0800\n" "PO-Revision-Date: 2018-05-23 16:19+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -169,8 +169,7 @@ msgstr "" msgid "" ":option:`-I` option can be used to run the script in isolated mode where :" "data:`sys.path` contains neither the current directory nor the user's site-" -"packages directory. All :envvar:`PYTHON*` environment variables are ignored, " -"too." +"packages directory. All ``PYTHON*`` environment variables are ignored, too." msgstr "" #: ../../using/cmdline.rst:109 @@ -259,8 +258,7 @@ msgstr "" msgid "" ":option:`-I` option can be used to run the script in isolated mode where :" "data:`sys.path` contains neither the script's directory nor the user's site-" -"packages directory. All :envvar:`PYTHON*` environment variables are ignored, " -"too." +"packages directory. All ``PYTHON*`` environment variables are ignored, too." msgstr "" #: ../../using/cmdline.rst:167 @@ -378,8 +376,8 @@ msgstr "" #: ../../using/cmdline.rst:283 msgid "" -"Ignore all :envvar:`PYTHON*` environment variables, e.g. :envvar:" -"`PYTHONPATH` and :envvar:`PYTHONHOME`, that might be set." +"Ignore all ``PYTHON*`` environment variables, e.g. :envvar:`PYTHONPATH` and :" +"envvar:`PYTHONHOME`, that might be set." msgstr "" #: ../../using/cmdline.rst:286 @@ -409,7 +407,7 @@ msgstr "" #: ../../using/cmdline.rst:305 msgid "" "In isolated mode :data:`sys.path` contains neither the script's directory " -"nor the user's site-packages directory. All :envvar:`PYTHON*` environment " +"nor the user's site-packages directory. All ``PYTHON*`` environment " "variables are ignored, too. Further restrictions may be imposed to prevent " "the user from injecting malicious code." msgstr "" @@ -476,10 +474,10 @@ msgstr "" #: ../../using/cmdline.rst:364 msgid "" "On previous versions of Python, this option turns on hash randomization, so " -"that the :meth:`__hash__` values of str and bytes objects are \"salted\" " -"with an unpredictable random value. Although they remain constant within an " -"individual Python process, they are not predictable between repeated " -"invocations of Python." +"that the :meth:`~object.__hash__` values of str and bytes objects are " +"\"salted\" with an unpredictable random value. Although they remain " +"constant within an individual Python process, they are not predictable " +"between repeated invocations of Python." msgstr "" #: ../../using/cmdline.rst:370 @@ -1061,7 +1059,8 @@ msgstr "" msgid "" "Defines the :data:`user base directory `, which is used to " "compute the path of the :data:`user site-packages directory ` and installation paths for ``python -m pip install --user``." +"USER_SITE>` and :ref:`installation paths ` for " +"``python -m pip install --user``." msgstr "" #: ../../using/cmdline.rst:824 @@ -1081,12 +1080,12 @@ msgstr "" msgid "" "If this environment variable is set to a non-empty string, :func:" "`faulthandler.enable` is called at startup: install a handler for :const:" -"`SIGSEGV`, :const:`SIGFPE`, :const:`SIGABRT`, :const:`SIGBUS` and :const:" -"`SIGILL` signals to dump the Python traceback. This is equivalent to :" -"option:`-X` ``faulthandler`` option." +"`~signal.SIGSEGV`, :const:`~signal.SIGFPE`, :const:`~signal.SIGABRT`, :const:" +"`~signal.SIGBUS` and :const:`~signal.SIGILL` signals to dump the Python " +"traceback. This is equivalent to :option:`-X` ``faulthandler`` option." msgstr "" -#: ../../using/cmdline.rst:863 +#: ../../using/cmdline.rst:864 msgid "" "If this environment variable is set to a non-empty string, start tracing " "Python memory allocations using the :mod:`tracemalloc` module. The value of " @@ -1096,90 +1095,90 @@ msgid "" "is equivalent to setting the :option:`-X` ``tracemalloc`` option." msgstr "" -#: ../../using/cmdline.rst:876 +#: ../../using/cmdline.rst:877 msgid "" "If this environment variable is set to a non-empty string, Python will show " "how long each import takes. This is equivalent to setting the :option:`-X` " "``importtime`` option." msgstr "" -#: ../../using/cmdline.rst:885 +#: ../../using/cmdline.rst:886 msgid "" "If this environment variable is set to a non-empty string, enable the :ref:" "`debug mode ` of the :mod:`asyncio` module." msgstr "" -#: ../../using/cmdline.rst:893 +#: ../../using/cmdline.rst:894 msgid "Set the Python memory allocators and/or install debug hooks." msgstr "" -#: ../../using/cmdline.rst:895 +#: ../../using/cmdline.rst:896 msgid "Set the family of memory allocators used by Python:" msgstr "" -#: ../../using/cmdline.rst:897 +#: ../../using/cmdline.rst:898 msgid "" "``default``: use the :ref:`default memory allocators `." msgstr "" -#: ../../using/cmdline.rst:899 +#: ../../using/cmdline.rst:900 msgid "" "``malloc``: use the :c:func:`malloc` function of the C library for all " "domains (:c:macro:`PYMEM_DOMAIN_RAW`, :c:macro:`PYMEM_DOMAIN_MEM`, :c:macro:" "`PYMEM_DOMAIN_OBJ`)." msgstr "" -#: ../../using/cmdline.rst:902 +#: ../../using/cmdline.rst:903 msgid "" "``pymalloc``: use the :ref:`pymalloc allocator ` for :c:macro:" "`PYMEM_DOMAIN_MEM` and :c:macro:`PYMEM_DOMAIN_OBJ` domains and use the :c:" "func:`malloc` function for the :c:macro:`PYMEM_DOMAIN_RAW` domain." msgstr "" -#: ../../using/cmdline.rst:906 +#: ../../using/cmdline.rst:907 msgid "Install :ref:`debug hooks `:" msgstr "" -#: ../../using/cmdline.rst:908 +#: ../../using/cmdline.rst:909 msgid "" "``debug``: install debug hooks on top of the :ref:`default memory allocators " "`." msgstr "" -#: ../../using/cmdline.rst:910 +#: ../../using/cmdline.rst:911 msgid "``malloc_debug``: same as ``malloc`` but also install debug hooks." msgstr "" -#: ../../using/cmdline.rst:911 +#: ../../using/cmdline.rst:912 msgid "``pymalloc_debug``: same as ``pymalloc`` but also install debug hooks." msgstr "" -#: ../../using/cmdline.rst:913 +#: ../../using/cmdline.rst:914 msgid "Added the ``\"default\"`` allocator." msgstr "" -#: ../../using/cmdline.rst:921 +#: ../../using/cmdline.rst:922 msgid "" "If set to a non-empty string, Python will print statistics of the :ref:" "`pymalloc memory allocator ` every time a new pymalloc object " "arena is created, and on shutdown." msgstr "" -#: ../../using/cmdline.rst:925 +#: ../../using/cmdline.rst:926 msgid "" "This variable is ignored if the :envvar:`PYTHONMALLOC` environment variable " "is used to force the :c:func:`malloc` allocator of the C library, or if " "Python is configured without ``pymalloc`` support." msgstr "" -#: ../../using/cmdline.rst:929 +#: ../../using/cmdline.rst:930 msgid "" "This variable can now also be used on Python compiled in release mode. It " "now has no effect if set to an empty string." msgstr "" -#: ../../using/cmdline.rst:936 +#: ../../using/cmdline.rst:937 msgid "" "If set to a non-empty string, the default :term:`filesystem encoding and " "error handler` mode will revert to their pre-3.6 values of 'mbcs' and " @@ -1187,41 +1186,41 @@ msgid "" "'surrogatepass' are used." msgstr "" -#: ../../using/cmdline.rst:941 +#: ../../using/cmdline.rst:942 msgid "" "This may also be enabled at runtime with :func:`sys." "_enablelegacywindowsfsencoding()`." msgstr "" -#: ../../using/cmdline.rst:944 ../../using/cmdline.rst:958 +#: ../../using/cmdline.rst:945 ../../using/cmdline.rst:959 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" -#: ../../using/cmdline.rst:946 +#: ../../using/cmdline.rst:947 msgid "See :pep:`529` for more details." -msgstr "更多細節請見 :pep:`529`\\ 。" +msgstr "更多細節請見 :pep:`529`。" -#: ../../using/cmdline.rst:951 +#: ../../using/cmdline.rst:952 msgid "" "If set to a non-empty string, does not use the new console reader and " "writer. This means that Unicode characters will be encoded according to the " "active console code page, rather than using utf-8." msgstr "" -#: ../../using/cmdline.rst:955 +#: ../../using/cmdline.rst:956 msgid "" "This variable is ignored if the standard streams are redirected (to files or " "pipes) rather than referring to console buffers." msgstr "" -#: ../../using/cmdline.rst:965 +#: ../../using/cmdline.rst:966 msgid "" "If set to the value ``0``, causes the main Python command line application " "to skip coercing the legacy ASCII-based C and POSIX locales to a more " "capable UTF-8 based alternative." msgstr "" -#: ../../using/cmdline.rst:969 +#: ../../using/cmdline.rst:970 msgid "" "If this variable is *not* set (or is set to a value other than ``0``), the " "``LC_ALL`` locale override environment variable is also not set, and the " @@ -1232,19 +1231,19 @@ msgid "" "runtime:" msgstr "" -#: ../../using/cmdline.rst:977 +#: ../../using/cmdline.rst:978 msgid "``C.UTF-8``" msgstr "``C.UTF-8``" -#: ../../using/cmdline.rst:978 +#: ../../using/cmdline.rst:979 msgid "``C.utf8``" msgstr "``C.utf8``" -#: ../../using/cmdline.rst:979 +#: ../../using/cmdline.rst:980 msgid "``UTF-8``" msgstr "``UTF-8``" -#: ../../using/cmdline.rst:981 +#: ../../using/cmdline.rst:982 msgid "" "If setting one of these locale categories succeeds, then the ``LC_CTYPE`` " "environment variable will also be set accordingly in the current process " @@ -1257,7 +1256,7 @@ msgid "" "(such as Python's own :func:`locale.getdefaultlocale`)." msgstr "" -#: ../../using/cmdline.rst:991 +#: ../../using/cmdline.rst:992 msgid "" "Configuring one of these locales (either explicitly or via the above " "implicit locale coercion) automatically enables the ``surrogateescape`` :ref:" @@ -1267,7 +1266,7 @@ msgid "" "envvar:`PYTHONIOENCODING` as usual." msgstr "" -#: ../../using/cmdline.rst:998 +#: ../../using/cmdline.rst:999 msgid "" "For debugging purposes, setting ``PYTHONCOERCECLOCALE=warn`` will cause " "Python to emit warning messages on ``stderr`` if either the locale coercion " @@ -1275,7 +1274,7 @@ msgid "" "active when the Python runtime is initialized." msgstr "" -#: ../../using/cmdline.rst:1003 +#: ../../using/cmdline.rst:1004 msgid "" "Also note that even when locale coercion is disabled, or when it fails to " "find a suitable target locale, :envvar:`PYTHONUTF8` will still activate by " @@ -1284,15 +1283,15 @@ msgid "" "system interfaces." msgstr "" -#: ../../using/cmdline.rst:1009 +#: ../../using/cmdline.rst:1010 msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" -#: ../../using/cmdline.rst:1011 +#: ../../using/cmdline.rst:1012 msgid "See :pep:`538` for more details." -msgstr "更多細節請見 :pep:`538`\\ 。" +msgstr "更多細節請見 :pep:`538`。" -#: ../../using/cmdline.rst:1017 +#: ../../using/cmdline.rst:1018 msgid "" "If this environment variable is set to a non-empty string, enable :ref:" "`Python Development Mode `, introducing additional runtime checks " @@ -1300,31 +1299,31 @@ msgid "" "setting the :option:`-X` ``dev`` option." msgstr "" -#: ../../using/cmdline.rst:1026 +#: ../../using/cmdline.rst:1027 msgid "If set to ``1``, enable the :ref:`Python UTF-8 Mode `." msgstr "如果設為 ``1``,則啟用 :ref:`Python UTF-8 Mode `。" -#: ../../using/cmdline.rst:1028 +#: ../../using/cmdline.rst:1029 msgid "If set to ``0``, disable the :ref:`Python UTF-8 Mode `." msgstr "如果設為 ``0``,則停用 :ref:`Python UTF-8 Mode `。" -#: ../../using/cmdline.rst:1030 +#: ../../using/cmdline.rst:1031 msgid "" "Setting any other non-empty string causes an error during interpreter " "initialisation." msgstr "" -#: ../../using/cmdline.rst:1037 +#: ../../using/cmdline.rst:1038 msgid "" "If this environment variable is set to a non-empty string, issue a :class:" "`EncodingWarning` when the locale-specific default encoding is used." msgstr "" -#: ../../using/cmdline.rst:1040 +#: ../../using/cmdline.rst:1041 msgid "See :ref:`io-encoding-warning` for details." -msgstr "細節請見 :ref:`io-encoding-warning`\\ 。" +msgstr "細節請見 :ref:`io-encoding-warning`。" -#: ../../using/cmdline.rst:1046 +#: ../../using/cmdline.rst:1047 msgid "" "If this variable is set, it disables the inclusion of the tables mapping " "extra location information (end line, start column offset and end column " @@ -1333,38 +1332,38 @@ msgid "" "visual location indicators when the interpreter displays tracebacks." msgstr "" -#: ../../using/cmdline.rst:1056 +#: ../../using/cmdline.rst:1057 msgid "" "If this variable is set to a nonzero value, it enables support for the Linux " "``perf`` profiler so Python calls can be detected by it." msgstr "" -#: ../../using/cmdline.rst:1059 +#: ../../using/cmdline.rst:1060 msgid "If set to ``0``, disable Linux ``perf`` profiler support." msgstr "" -#: ../../using/cmdline.rst:1061 +#: ../../using/cmdline.rst:1062 msgid "" "See also the :option:`-X perf <-X>` command-line option and :ref:" "`perf_profiling`." msgstr "" -#: ../../using/cmdline.rst:1068 +#: ../../using/cmdline.rst:1069 msgid "Debug-mode variables" msgstr "除錯模式變數" -#: ../../using/cmdline.rst:1072 +#: ../../using/cmdline.rst:1073 msgid "" "If set, Python will dump objects and reference counts still alive after " "shutting down the interpreter." msgstr "" -#: ../../using/cmdline.rst:1075 ../../using/cmdline.rst:1082 +#: ../../using/cmdline.rst:1076 ../../using/cmdline.rst:1083 msgid "" "Need Python configured with the :option:`--with-trace-refs` build option." msgstr "" -#: ../../using/cmdline.rst:1079 +#: ../../using/cmdline.rst:1080 msgid "" "If set, Python will dump objects and reference counts still alive after " "shutting down the interpreter into a file called *FILENAME*." diff --git a/using/configure.po b/using/configure.po index f461e35107..3ea12f723f 100644 --- a/using/configure.po +++ b/using/configure.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-09-09 00:03+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+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-" @@ -20,7 +20,7 @@ msgstr "" #: ../../using/configure.rst:3 msgid "Configure Python" -msgstr "" +msgstr "配置 Python" #: ../../using/configure.rst:6 msgid "Build Requirements" @@ -46,7 +46,7 @@ msgstr "" #: ../../using/configure.rst:19 msgid "Support for threads." -msgstr "" +msgstr "thread 的支援。" #: ../../using/configure.rst:21 msgid "OpenSSL 1.1.1 or newer for the :mod:`ssl` and :mod:`hashlib` modules." @@ -54,7 +54,7 @@ msgstr "" #: ../../using/configure.rst:23 msgid "On Windows, Microsoft Visual Studio 2017 or later is required." -msgstr "" +msgstr "在 Windows 上需要 Microsoft Visual Studio 2017 或更新版本。" #: ../../using/configure.rst:25 msgid "" @@ -68,7 +68,7 @@ msgstr "OpenSSL 1.1.1 現在是必要的。" #: ../../using/configure.rst:32 msgid "Thread support and OpenSSL 1.0.2 are now required." -msgstr "" +msgstr "對執行緒與 OpenSSL 1.0.2 的支援現在是必要的。" #: ../../using/configure.rst:35 msgid "" @@ -123,7 +123,7 @@ msgstr "" msgid "" "See also the :file:`Misc/SpecialBuilds.txt` in the Python source " "distribution." -msgstr "" +msgstr "請見 Python 原始碼發行版中的 :file:`Misc/SpecialBuilds.txt`。" #: ../../using/configure.rst:81 msgid "General Options" @@ -131,8 +131,8 @@ msgstr "一般選項" #: ../../using/configure.rst:85 msgid "" -"Support loadable extensions in the :mod:`_sqlite` extension module (default " -"is no)." +"Support loadable extensions in the :mod:`!_sqlite` extension module (default " +"is no) of the :mod:`sqlite3` module." msgstr "" #: ../../using/configure.rst:88 @@ -140,12 +140,14 @@ msgid "" "See the :meth:`sqlite3.Connection.enable_load_extension` method of the :mod:" "`sqlite3` module." msgstr "" +"請見 :mod:`sqlite3` 模組的 :meth:`sqlite3.Connection.enable_load_extension` " +"方法。" #: ../../using/configure.rst:95 msgid "" "Disable IPv6 support (enabled by default if supported), see the :mod:" "`socket` module." -msgstr "" +msgstr "停用 IPv6 支援(如果支援的話預設是啟用的),請見 :mod:`socket` 模組。" #: ../../using/configure.rst:100 msgid "Define the size in bits of Python :class:`int` digits: 15 or 30 bits." @@ -157,15 +159,15 @@ msgstr "" #: ../../using/configure.rst:104 msgid "Define the ``PYLONG_BITS_IN_DIGIT`` to ``15`` or ``30``." -msgstr "將 ``PYLONG_BITS_IN_DIGIT`` 定義為 ``15`` 或 ``30``\\ 。" +msgstr "將 ``PYLONG_BITS_IN_DIGIT`` 定義為 ``15`` 或 ``30``。" #: ../../using/configure.rst:106 msgid "See :data:`sys.int_info.bits_per_digit `." -msgstr "參閱 :data:`sys.int_info.bits_per_digit `\\ 。" +msgstr "參閱 :data:`sys.int_info.bits_per_digit `。" #: ../../using/configure.rst:110 msgid "Set the Python executable suffix to *SUFFIX*." -msgstr "" +msgstr "將 Python 執行檔的後綴設定為 *SUFFIX*。" #: ../../using/configure.rst:112 msgid "" @@ -174,12 +176,15 @@ msgid "" "wasm`` on WASI, and an empty string on other platforms (``python`` " "executable)." msgstr "" +"在 Windows 和 macOS 上預設的後綴是 ``.exe`` (``python.exe`` 執行檔)、在 " +"Emscripten node 上為 ``.js``、在 Emscripten 瀏覽器為 ``.html``、在 WASI 上為 " +"``.wasm``,以及在其他平台為空字串(``python`` 執行檔)。" #: ../../using/configure.rst:117 msgid "" "The default suffix on WASM platform is one of ``.js``, ``.html`` or ``." "wasm``." -msgstr "" +msgstr "在 WASM 平台上預設的後綴是 ``.js``、``.html`` 或 ``.wasm`` 中的一個。" #: ../../using/configure.rst:123 msgid "" @@ -193,10 +198,12 @@ msgid "" "Default: ``/usr/share/zoneinfo:/usr/lib/zoneinfo:/usr/share/lib/zoneinfo:/" "etc/zoneinfo``." msgstr "" +"預設值:``/usr/share/zoneinfo:/usr/lib/zoneinfo:/usr/share/lib/zoneinfo:/etc/" +"zoneinfo``。" #: ../../using/configure.rst:129 msgid "See :data:`os.pathsep` path separator." -msgstr "" +msgstr "請見 :data:`os.pathsep` 路徑分隔符號。" #: ../../using/configure.rst:135 msgid "" @@ -206,7 +213,7 @@ msgstr "" #: ../../using/configure.rst:138 msgid "See :const:`decimal.HAVE_CONTEXTVAR` and the :mod:`contextvars` module." -msgstr "" +msgstr "請見 :const:`decimal.HAVE_CONTEXTVAR` 與 :mod:`contextvars` 模組。" #: ../../using/configure.rst:144 msgid "Override order to check db backends for the :mod:`dbm` module" @@ -247,7 +254,7 @@ msgstr "" #: ../../using/configure.rst:168 msgid "Python library directory name (default is ``lib``)." -msgstr "" +msgstr "Python 函式庫目錄名稱(預設為 ``lib`` )。" #: ../../using/configure.rst:170 msgid "Fedora and SuSE use ``lib64`` on 64-bit platforms." @@ -255,7 +262,7 @@ msgstr "Fedora 和 SuSE 在 64 位元平台上使用 ``lib64``。" #: ../../using/configure.rst:172 msgid "See :data:`sys.platlibdir`." -msgstr "參閱 :data:`sys.platlibdir`\\ 。" +msgstr "參閱 :data:`sys.platlibdir`。" #: ../../using/configure.rst:178 msgid "" @@ -267,7 +274,7 @@ msgstr "" msgid "" "Some Linux distribution packaging policies recommend against bundling " "dependencies. For example, Fedora installs wheel packages in the ``/usr/" -"share/python-wheels/`` directory and don't install the :mod:`ensurepip." +"share/python-wheels/`` directory and don't install the :mod:`!ensurepip." "_bundled` package." msgstr "" @@ -279,15 +286,15 @@ msgstr "" #: ../../using/configure.rst:193 msgid "``check`` (default): :program:`pkg-config` is optional" -msgstr "" +msgstr "``check`` (預設)::program:`pkg-config` 是可選的" #: ../../using/configure.rst:194 msgid "``yes``: :program:`pkg-config` is mandatory" -msgstr "" +msgstr "``yes``::program:`pkg-config` 是必要的" #: ../../using/configure.rst:195 msgid "``no``: configure does not use :program:`pkg-config` even when present" -msgstr "" +msgstr "``no``:即使存在也不使用 :program:`pkg-config` 來配置" #: ../../using/configure.rst:201 msgid "Turn on internal statistics gathering." @@ -318,7 +325,7 @@ msgstr "" #: ../../using/configure.rst:219 msgid "``node``: NODERAWFS and pthread support." -msgstr "" +msgstr "``node``:對 NODERAWFS 和 pthread 支援。" #: ../../using/configure.rst:225 msgid "Turn on dynamic linking support for WASM." @@ -346,7 +353,7 @@ msgstr "" #: ../../using/configure.rst:247 msgid "This value can be retrieved at runtime using :data:`sys.prefix`." -msgstr "" +msgstr "這個值可以在 runtime 使用 :data:`sys.prefix` 取得。" #: ../../using/configure.rst:249 msgid "" @@ -362,31 +369,33 @@ msgstr "" #: ../../using/configure.rst:256 msgid "This value can be retrieved at runtime using :data:`sys.exec_prefix`." -msgstr "" +msgstr "這個值可以在 runtime 使用 :data:`sys.exec_prefix` 取得" #: ../../using/configure.rst:260 msgid "" "Don't build nor install test modules, like the :mod:`test` package or the :" -"mod:`_testcapi` extension module (built and installed by default)." +"mod:`!_testcapi` extension module (built and installed by default)." msgstr "" #: ../../using/configure.rst:267 msgid "Select the :mod:`ensurepip` command run on Python installation:" -msgstr "" +msgstr "選擇在 Python 安裝時執行的 :mod:`ensurepip` 命令:" #: ../../using/configure.rst:269 msgid "" "``upgrade`` (default): run ``python -m ensurepip --altinstall --upgrade`` " "command." msgstr "" +"``upgrade`` (預設):執行 ``python -m ensurepip --altinstall --upgrade`` 命" +"令。" #: ../../using/configure.rst:271 msgid "``install``: run ``python -m ensurepip --altinstall`` command;" -msgstr "" +msgstr "``install``:執行 ``python -m ensurepip --altinstall`` 命令;" #: ../../using/configure.rst:272 msgid "``no``: don't run ensurepip;" -msgstr "" +msgstr "``no``:不要執行 ensurepip;" #: ../../using/configure.rst:278 msgid "Performance options" @@ -420,7 +429,7 @@ msgstr "" #: ../../using/configure.rst:298 msgid "Use ``-fno-semantic-interposition`` on GCC." -msgstr "" +msgstr "在 GCC 上使用 ``-fno-semantic-interposition``。" #: ../../using/configure.rst:303 msgid "" @@ -430,7 +439,7 @@ msgstr "" #: ../../using/configure.rst:306 msgid "Default: ``-m test --pgo --timeout=$(TESTTIMEOUT)``." -msgstr "" +msgstr "預設值:``-m test --pgo --timeout=$(TESTTIMEOUT)``。" #: ../../using/configure.rst:312 msgid "Enable Link Time Optimization (LTO) in any build (disabled by default)." @@ -508,11 +517,11 @@ msgstr "" #: ../../using/configure.rst:367 msgid "Don't define the ``WITH_DOC_STRINGS`` macro." -msgstr "" +msgstr "不要定義 ``WITH_DOC_STRINGS`` 巨集。" #: ../../using/configure.rst:369 msgid "See the ``PyDoc_STRVAR()`` macro." -msgstr "" +msgstr "請見 ``PyDoc_STRVAR()`` 巨集。" #: ../../using/configure.rst:373 msgid "Enable C-level code profiling with ``gprof`` (disabled by default)." @@ -546,11 +555,11 @@ msgstr "" #: ../../using/configure.rst:393 msgid "Add ``d`` to :data:`sys.abiflags`." -msgstr "" +msgstr "新增 ``d`` 到 :data:`sys.abiflags`。" #: ../../using/configure.rst:394 -msgid "Add :func:`sys.gettotalrefcount` function." -msgstr "新增 :func:`sys.gettotalrefcount` 函式。" +msgid "Add :func:`!sys.gettotalrefcount` function." +msgstr "新增 :func:`!sys.gettotalrefcount` 函式。" #: ../../using/configure.rst:395 msgid "Add :option:`-X showrefcount <-X>` command line option." @@ -614,7 +623,7 @@ msgstr "" #: ../../using/configure.rst:416 msgid "" -"The :c:macro:`Py_SAFE_DOWNCAST()` macro checks for integer underflow and " +"The :c:macro:`!Py_SAFE_DOWNCAST()` macro checks for integer underflow and " "overflow when downcasting from wide types to narrow types." msgstr "" @@ -655,8 +664,8 @@ msgid "Define the ``Py_TRACE_REFS`` macro." msgstr "定義 ``Py_TRACE_REFS`` 巨集。" #: ../../using/configure.rst:444 -msgid "Add :func:`sys.getobjects` function." -msgstr "新增 :func:`sys.getobjects` 函式。" +msgid "Add :func:`!sys.getobjects` function." +msgstr "新增 :func:`!sys.getobjects` 函式。" #: ../../using/configure.rst:445 msgid "Add :envvar:`PYTHONDUMPREFS` environment variable." @@ -739,7 +748,7 @@ msgstr "" #: ../../using/configure.rst:522 msgid "" -"Build the :mod:`pyexpat` module using an installed ``expat`` library " +"Build the :mod:`!pyexpat` module using an installed ``expat`` library " "(default is no)." msgstr "" @@ -1105,8 +1114,8 @@ msgstr "" #: ../../using/configure.rst:772 msgid "" -"The :c:macro:`PyAPI_FUNC()`, :c:macro:`PyAPI_DATA()` and :c:macro:" -"`PyMODINIT_FUNC` macros of :file:`Include/pyport.h` are defined differently " +"The :c:macro:`!PyAPI_FUNC()`, :c:macro:`!PyAPI_DATA()` and :c:macro:" +"`PyMODINIT_FUNC` macros of :file:`Include/exports.h` are defined differently " "depending if the ``Py_BUILD_CORE_MODULE`` macro is defined:" msgstr "" @@ -1121,8 +1130,8 @@ msgstr "否則使用 ``Py_IMPORTED_SYMBOL``。" #: ../../using/configure.rst:779 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." +"built as a shared library, its :samp:`PyInit_{xxx}()` function is not " +"exported, causing an :exc:`ImportError` on import." msgstr "" #: ../../using/configure.rst:785 @@ -1146,8 +1155,8 @@ msgstr "" #: ../../using/configure.rst:801 msgid "" -"(Objective) C/C++ preprocessor flags, e.g. ``-I`` if you have " -"headers in a nonstandard directory ````." +"(Objective) C/C++ preprocessor flags, e.g. :samp:`-I{include_dir}` if you " +"have headers in a nonstandard directory *include_dir*." msgstr "" #: ../../using/configure.rst:804 ../../using/configure.rst:994 @@ -1362,8 +1371,8 @@ msgstr "" #: ../../using/configure.rst:991 msgid "" -"Linker flags, e.g. ``-L`` if you have libraries in a nonstandard " -"directory ````." +"Linker flags, e.g. :samp:`-L{lib_dir}` if you have libraries in a " +"nonstandard directory *lib_dir*." msgstr "" #: ../../using/configure.rst:1000 diff --git a/using/unix.po b/using/unix.po index e52c5fd184..c60e6b9d4a 100644 --- a/using/unix.po +++ b/using/unix.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-10-11 17:13+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-" @@ -69,19 +69,19 @@ msgstr "對於 OpenSuse 用戶" #: ../../using/unix.rst:33 msgid "" -"https://docs-old.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html/" -"RPM_Guide/ch-creating-rpms.html" +"https://docs.fedoraproject.org/en-US/package-maintainers/" +"Packaging_Tutorial_GNU_Hello/" msgstr "" -"https://docs-old.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html/" -"RPM_Guide/ch-creating-rpms.html" +"https://docs.fedoraproject.org/en-US/package-maintainers/" +"Packaging_Tutorial_GNU_Hello/" #: ../../using/unix.rst:34 msgid "for Fedora users" msgstr "對於 Fedora 用戶" #: ../../using/unix.rst:35 -msgid "http://www.slackbook.org/html/package-management-making-packages.html" -msgstr "http://www.slackbook.org/html/package-management-making-packages.html" +msgid "https://slackbook.org/html/package-management-making-packages.html" +msgstr "https://slackbook.org/html/package-management-making-packages.html" #: ../../using/unix.rst:36 msgid "for Slackware users" @@ -296,14 +296,3 @@ msgid "" msgstr "" "OpenSSL 的修補釋出版 (patch releases) 具有向後相容的 ABI。你不需要重新編譯 " "Python 來更新 OpenSSL。使用一個新的版本來替代客製化 OpenSSL 安裝版就可以了。" - -#~ msgid "On OpenSolaris" -#~ msgstr "在 OpenSolaris 系統上" - -#~ msgid "" -#~ "You can get Python from `OpenCSW `_. Various " -#~ "versions of Python are available and can be installed with e.g. ``pkgutil " -#~ "-i python27``." -#~ msgstr "" -#~ "你可以從 `OpenCSW `_ 獲取、安裝及使用各種版本的 " -#~ "Python。比如 ``pkgutil -i python27``。" diff --git a/using/windows.po b/using/windows.po index a210a5b577..bd3c17e947 100644 --- a/using/windows.po +++ b/using/windows.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-17 00:04+0000\n" +"POT-Creation-Date: 2023-10-12 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:19+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1461,8 +1461,8 @@ msgstr "" #: ../../using/windows.rst:890 msgid "" "The \"-64\" suffix is deprecated, and now implies \"any architecture that is " -"not provably i386/32-bit\". To request a specific environment, use the new " -"``-V:`` argument with the complete tag." +"not provably i386/32-bit\". To request a specific environment, use the new :" +"samp:`-V:{TAG}` argument with the complete tag." msgstr "" #: ../../using/windows.rst:894 @@ -1957,19 +1957,19 @@ msgid "" "packages." msgstr "" -#: ../../using/windows.rst:1193 +#: ../../using/windows.rst:1192 msgid "" -"Adds ``._pth`` file support and removes ``applocal`` option from ``pyvenv." +"Add ``._pth`` file support and removes ``applocal`` option from ``pyvenv." "cfg``." msgstr "" -#: ../../using/windows.rst:1195 +#: ../../using/windows.rst:1197 msgid "" -"Adds ``pythonXX.zip`` as a potential landmark when directly adjacent to the " -"executable." +"Add :file:`python{XX}.zip` as a potential landmark when directly adjacent to " +"the executable." msgstr "" -#: ../../using/windows.rst:1201 +#: ../../using/windows.rst:1202 msgid "" "Modules specified in the registry under ``Modules`` (not ``PythonPath``) may " "be imported by :class:`importlib.machinery.WindowsRegistryFinder`. This " @@ -1977,88 +1977,88 @@ msgid "" "explicitly added to :data:`sys.meta_path` in the future." msgstr "" -#: ../../using/windows.rst:1207 +#: ../../using/windows.rst:1208 msgid "Additional modules" msgstr "" -#: ../../using/windows.rst:1209 +#: ../../using/windows.rst:1210 msgid "" "Even though Python aims to be portable among all platforms, there are " "features that are unique to Windows. A couple of modules, both in the " "standard library and external, and snippets exist to use these features." msgstr "" -#: ../../using/windows.rst:1213 +#: ../../using/windows.rst:1214 msgid "" "The Windows-specific standard modules are documented in :ref:`mswin-specific-" "services`." msgstr "" -#: ../../using/windows.rst:1217 +#: ../../using/windows.rst:1218 msgid "PyWin32" msgstr "PyWin32" -#: ../../using/windows.rst:1219 +#: ../../using/windows.rst:1220 msgid "" "The `PyWin32 `_ module by Mark Hammond is " "a collection of modules for advanced Windows-specific support. This " "includes utilities for:" msgstr "" -#: ../../using/windows.rst:1223 +#: ../../using/windows.rst:1224 msgid "" "`Component Object Model `_ (COM)" msgstr "" -#: ../../using/windows.rst:1226 +#: ../../using/windows.rst:1227 msgid "Win32 API calls" msgstr "Win32 API 呼叫" -#: ../../using/windows.rst:1227 +#: ../../using/windows.rst:1228 msgid "Registry" msgstr "登錄檔(Registry)" -#: ../../using/windows.rst:1228 +#: ../../using/windows.rst:1229 msgid "Event log" msgstr "事件日誌(Event log)" -#: ../../using/windows.rst:1229 +#: ../../using/windows.rst:1230 msgid "" "`Microsoft Foundation Classes `_ (MFC) user interfaces" msgstr "" -#: ../../using/windows.rst:1233 +#: ../../using/windows.rst:1234 msgid "" "`PythonWin `_ is a sample MFC application shipped with PyWin32. " "It is an embeddable IDE with a built-in debugger." msgstr "" -#: ../../using/windows.rst:1240 +#: ../../using/windows.rst:1241 msgid "" "`Win32 How Do I...? `_" msgstr "" "`Win32 How Do I...? `_" -#: ../../using/windows.rst:1240 +#: ../../using/windows.rst:1241 msgid "by Tim Golden" msgstr "由 Tim Golden 所著" -#: ../../using/windows.rst:1242 +#: ../../using/windows.rst:1243 msgid "`Python and COM `_" msgstr "`Python and COM `_" -#: ../../using/windows.rst:1243 +#: ../../using/windows.rst:1244 msgid "by David and Paul Boddie" msgstr "由 David 與 Paul Boddie 所著" -#: ../../using/windows.rst:1247 +#: ../../using/windows.rst:1248 msgid "cx_Freeze" msgstr "cx_Freeze" -#: ../../using/windows.rst:1249 +#: ../../using/windows.rst:1250 msgid "" "`cx_Freeze `_ wraps Python " "scripts into executable Windows programs (:file:`{*}.exe` files). When you " @@ -2066,11 +2066,11 @@ msgid "" "users to install Python." msgstr "" -#: ../../using/windows.rst:1256 +#: ../../using/windows.rst:1257 msgid "Compiling Python on Windows" msgstr "編譯 Python 在 Windows" -#: ../../using/windows.rst:1258 +#: ../../using/windows.rst:1259 msgid "" "If you want to compile CPython yourself, first thing you should do is get " "the `source `_. You can download " @@ -2078,48 +2078,48 @@ msgid "" "devguide.python.org/setup/#get-the-source-code>`_." msgstr "" -#: ../../using/windows.rst:1263 +#: ../../using/windows.rst:1264 msgid "" "The source tree contains a build solution and project files for Microsoft " "Visual Studio, which is the compiler used to build the official Python " "releases. These files are in the :file:`PCbuild` directory." msgstr "" -#: ../../using/windows.rst:1267 +#: ../../using/windows.rst:1268 msgid "" "Check :file:`PCbuild/readme.txt` for general information on the build " "process." msgstr "" -#: ../../using/windows.rst:1269 +#: ../../using/windows.rst:1270 msgid "For extension modules, consult :ref:`building-on-windows`." msgstr "" -#: ../../using/windows.rst:1273 +#: ../../using/windows.rst:1274 msgid "Other Platforms" msgstr "其他平台" -#: ../../using/windows.rst:1275 +#: ../../using/windows.rst:1276 msgid "" "With ongoing development of Python, some platforms that used to be supported " "earlier are no longer supported (due to the lack of users or developers). " "Check :pep:`11` for details on all unsupported platforms." msgstr "" -#: ../../using/windows.rst:1279 +#: ../../using/windows.rst:1280 msgid "" "`Windows CE `_ is `no longer supported " "`__ since Python 3 (if it " "ever was)." msgstr "" -#: ../../using/windows.rst:1282 +#: ../../using/windows.rst:1283 msgid "" "The `Cygwin `_ installer offers to install the `Python " "interpreter `__ as well" msgstr "" -#: ../../using/windows.rst:1286 +#: ../../using/windows.rst:1287 msgid "" "See `Python for Windows `_ for " "detailed information about platforms with pre-compiled installers." diff --git a/whatsnew/2.0.po b/whatsnew/2.0.po index 32d093ef5d..b0fba98274 100644 --- a/whatsnew/2.0.po +++ b/whatsnew/2.0.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 10:36+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2018-05-23 16:19+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -212,11 +212,11 @@ msgstr "" #: ../../whatsnew/2.0.rst:155 msgid "" "In Python source code, Unicode strings are written as ``u\"string\"``. " -"Arbitrary Unicode characters can be written using a new escape sequence, " -"``\\uHHHH``, where *HHHH* is a 4-digit hexadecimal number from 0000 to " -"FFFF. The existing ``\\xHHHH`` escape sequence can also be used, and octal " -"escapes can be used for characters up to U+01FF, which is represented by " -"``\\777``." +"Arbitrary Unicode characters can be written using a new escape sequence, :" +"samp:`\\\\u{HHHH}`, where *HHHH* is a 4-digit hexadecimal number from 0000 " +"to FFFF. The existing :samp:`\\\\x{HH}` escape sequence can also be used, " +"and octal escapes can be used for characters up to U+01FF, which is " +"represented by ``\\777``." msgstr "" #: ../../whatsnew/2.0.rst:161 diff --git a/whatsnew/2.3.po b/whatsnew/2.3.po index ea946a8f00..f542f4b572 100644 --- a/whatsnew/2.3.po +++ b/whatsnew/2.3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-23 00:03+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2018-05-23 16:19+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2069,8 +2069,8 @@ msgid "" "The :c:macro:`!DL_EXPORT` and :c:macro:`!DL_IMPORT` macros are now " "deprecated. Initialization functions for Python extension modules should now " "be declared using the new macro :c:macro:`PyMODINIT_FUNC`, while the Python " -"core will generally use the :c:macro:`PyAPI_FUNC` and :c:macro:`PyAPI_DATA` " -"macros." +"core will generally use the :c:macro:`!PyAPI_FUNC` and :c:macro:`!" +"PyAPI_DATA` macros." msgstr "" #: ../../whatsnew/2.3.rst:1894 diff --git a/whatsnew/2.6.po b/whatsnew/2.6.po index 736ee4d980..ac6200eaa8 100644 --- a/whatsnew/2.6.po +++ b/whatsnew/2.6.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-23 00:03+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -130,7 +130,7 @@ msgstr "" #: ../../whatsnew/2.6.rst:128 msgid "" -"The 3xxx series of PEPs, which contains proposals for Python 3.0. :pep:" +"The 3\\ *xxx* series of PEPs, which contains proposals for Python 3.0. :pep:" "`3000` describes the development process for Python 3.0. Start with :pep:" "`3100` that describes the general goals for Python 3.0, and then explore the " "higher-numbered PEPS that propose specific features." @@ -2054,16 +2054,15 @@ msgstr "" #: ../../whatsnew/2.6.rst:1853 msgid "" -"A new data type in the :mod:`collections` module: :class:" -"`namedtuple(typename, fieldnames)` is a factory function that creates " -"subclasses of the standard tuple whose fields are accessible by name as well " -"as index. For example::" +"A new data type in the :mod:`collections` module: ``namedtuple(typename, " +"fieldnames)`` is a factory function that creates subclasses of the standard " +"tuple whose fields are accessible by name as well as index. For example::" msgstr "" #: ../../whatsnew/2.6.rst:1875 msgid "" "Several places in the standard library that returned tuples have been " -"modified to return :class:`namedtuple` instances. For example, the :meth:" +"modified to return :func:`namedtuple` instances. For example, the :meth:" "`Decimal.as_tuple` method now returns a named tuple with :attr:`sign`, :attr:" "`digits`, and :attr:`exponent` fields." msgstr "" diff --git a/whatsnew/3.10.po b/whatsnew/3.10.po index e1f2db7479..1f2d4fac77 100644 --- a/whatsnew/3.10.po +++ b/whatsnew/3.10.po @@ -1,5 +1,4 @@ -# 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. # FIRST AUTHOR , YEAR. # @@ -7,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-23 00:03+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2023-06-26 03:02+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1114,11 +1113,11 @@ msgstr "" #: ../../whatsnew/3.10.rst:880 msgid "" "A :exc:`SyntaxError` (instead of a :exc:`NameError`) will be raised when " -"deleting the :const:`__debug__` constant. (Contributed by Dong-hee Na in :" +"deleting the :const:`__debug__` constant. (Contributed by Donghee Na in :" "issue:`45000`.)" msgstr "" "刪除 :const:`__debug__` 常數時將引發 :exc:`SyntaxError` (而不是 :exc:" -"`NameError`)。(由 Dong-hee Na 在 :issue:`45000` 中貢獻。)" +"`NameError`)。(由 Donghee Na 在 :issue:`45000` 中貢獻。)" #: ../../whatsnew/3.10.rst:883 msgid "" @@ -1241,7 +1240,7 @@ msgid "" "function. (Contributed by Hai Shi in :issue:`41842`.)" msgstr "" "新增 :func:`codecs.unregister` 函式來取消註冊 (unregister) 一個編解碼器的搜索" -"功能。 (Hai Shi在 :issue:`41842` 中貢獻。)" +"功能。 (Hai Shi 在 :issue:`41842` 中貢獻。)" #: ../../whatsnew/3.10.rst:947 msgid "collections.abc" @@ -1796,12 +1795,12 @@ msgstr "" #: ../../whatsnew/3.10.rst:1256 msgid "" "Add :const:`~os.O_EVTONLY`, :const:`~os.O_FSYNC`, :const:`~os.O_SYMLINK` " -"and :const:`~os.O_NOFOLLOW_ANY` for macOS. (Contributed by Dong-hee Na in :" +"and :const:`~os.O_NOFOLLOW_ANY` for macOS. (Contributed by Donghee Na in :" "issue:`43106`.)" msgstr "" "為 macOS 新增 :const:`~os.O_EVTONLY`、:const:`~os.O_FSYNC`、:const:`~os." -"O_SYMLINK` 和 :const:`~os.O_NOFOLLOW_ANY`。(由 Dong-hee Na 在 :issue:" -"`43106` 中貢獻。)" +"O_SYMLINK` 和 :const:`~os.O_NOFOLLOW_ANY`。(由 Donghee Na 在 :issue:`43106` " +"中貢獻。)" #: ../../whatsnew/3.10.rst:1261 msgid "os.path" @@ -2447,13 +2446,13 @@ msgstr "" msgid "" "The following built-in functions now support the faster :pep:`590` " "vectorcall calling convention: :func:`map`, :func:`filter`, :func:" -"`reversed`, :func:`bool` and :func:`float`. (Contributed by Dong-hee Na and " +"`reversed`, :func:`bool` and :func:`float`. (Contributed by Donghee Na and " "Jeroen Demeyer in :issue:`43575`, :issue:`43287`, :issue:`41922`, :issue:" "`41873` and :issue:`41870`.)" msgstr "" "以下內建函式現在支援更快的 :pep:`590` vectorcall 呼叫慣例::func:`map`、:" -"func:`filter`、:func:`reversed`、:func:`bool` 和 :func:`float`。(由 Dong-" -"hee Na 和 Jeroen Demeyer 在 :issue:`43575`、:issue:`43287`、:issue:`41922`、:" +"func:`filter`、:func:`reversed`、:func:`bool` 和 :func:`float`。(由 Donghee " +"Na 和 Jeroen Demeyer 在 :issue:`43575`、:issue:`43287`、:issue:`41922`、:" "issue:`41873` 和 :issue:`41870` 中貢獻。)" #: ../../whatsnew/3.10.rst:1587 @@ -2907,13 +2906,12 @@ msgid "" "somewhat obsolete, little used, and not tested. It was originally scheduled " "to be removed in Python 3.6, but such removals were delayed until after " "Python 2.7 EOL. Existing users should copy whatever classes they use into " -"their code. (Contributed by Dong-hee Na and Terry J. Reedy in :issue:" -"`42299`.)" +"their code. (Contributed by Donghee Na and Terry J. Reedy in :issue:`42299`.)" msgstr "" "刪除了 ``formatter`` 模組,該模組在 Python 3.4 中已棄用。它有些過時、很少被使" "用,也沒有經過測試。它最初計劃在 Python 3.6 中刪除,但此類別的刪除被推遲到 " "Python 2.7 EOL 之後。現有使用者應該將他們使用的任何類別複製到他們的程式碼中。" -"(由 Dong-hee Na 和 Terry J. Reedy 在 :issue:`42299` 中貢獻。)" +"(由 Donghee Na 和 Terry J. Reedy 在 :issue:`42299` 中貢獻。)" #: ../../whatsnew/3.10.rst:1822 msgid "" @@ -3429,7 +3427,7 @@ msgid "" "slot. (Contributed by Hai Shi in :issue:`41832`.)" msgstr "" ":c:func:`PyType_FromModuleAndSpec` 函式現在接受 NULL ``tp_doc`` 槽位。(由 " -"Hai Shi在 :issue:`41832` 中貢獻。)" +"Hai Shi 在 :issue:`41832` 中貢獻。)" #: ../../whatsnew/3.10.rst:2087 msgid "" diff --git a/whatsnew/3.11.po b/whatsnew/3.11.po index 8f1f96a9a8..32a6ae6486 100644 --- a/whatsnew/3.11.po +++ b/whatsnew/3.11.po @@ -1,4 +1,3 @@ -# SOME DESCRIPTIVE TITLE. # Copyright (C) 2001-2023, Python Software Foundation # This file is distributed under the same license as the Python package. # Translators: @@ -8,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-24 00:03+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2023-05-28 18:21+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -33,12 +32,12 @@ msgstr "Pablo Galindo Salgado" #: ../../whatsnew/3.11.rst:47 msgid "" -"This article explains the new features in Python 3.11, compared to 3.10." -msgstr "此文章解釋了 Python 3.11 和 3.10 相比多了哪些新特性。" - -#: ../../whatsnew/3.11.rst:49 -msgid "For full details, see the :ref:`changelog `." -msgstr "若想了解完整細節,請見\\ :ref:`更動日誌 `。" +"This article explains the new features in Python 3.11, compared to 3.10. " +"Python 3.11 was released on October 24, 2022. For full details, see the :ref:" +"`changelog `." +msgstr "" +"此文章解釋了 Python 3.11 和 3.10 相比多了哪些新特性。Python 3.11 於 2022 年 " +"10 月 24 日發布。完整細節請見 :ref:`changelog`。" #: ../../whatsnew/3.11.rst:55 msgid "Summary -- Release highlights" @@ -285,14 +284,15 @@ msgstr "Windows ``py.exe`` 啟動程式 (launcher) 的改進" msgid "" "The copy of the :ref:`launcher` included with Python 3.11 has been " "significantly updated. It now supports company/tag syntax as defined in :pep:" -"`514` using the ``-V:/`` argument instead of the limited ``-" -".``. This allows launching distributions other than " -"``PythonCore``, the one hosted on `python.org `_." +"`514` using the :samp:`-V:{}/{}` argument instead of the " +"limited :samp:`-{}.{}`. This allows launching distributions " +"other than ``PythonCore``, the one hosted on `python.org `_." msgstr "" "Python 3.11 所包含的 :ref:`launcher` 複製品有了顯著的改善。它現在支援 :pep:" -"`514` 所定義的公司/標籤 (tag) 語法,可用 ``-V:/`` 引數來取代受" -"限的 ``-.``。這允許了 `python.org `_ 上" -"的 ``PythonCore`` 以外的發行版本發布。" +"`514` 所定義的公司/標籤 (tag) 語法,可用 :samp:`-V:{}/{}` 引數" +"來取代受限的 :samp:`-{}.{}`。這允許了 `python.org `_ 上的 ``PythonCore`` 以外的發行版本發布。" #: ../../whatsnew/3.11.rst:225 msgid "" @@ -307,21 +307,22 @@ msgstr "" #: ../../whatsnew/3.11.rst:230 msgid "" -"When using the legacy ``-``, ``-.``, ``--" -"`` or ``-.-`` arguments, all existing " -"behaviour should be preserved from past versions, and only releases from " -"``PythonCore`` will be selected. However, the ``-64`` suffix now implies " -"\"not 32-bit\" (not necessarily x86-64), as there are multiple supported 64-" -"bit platforms. 32-bit runtimes are detected by checking the runtime's tag " -"for a ``-32`` suffix. All releases of Python since 3.5 have included this in " -"their 32-bit builds." -msgstr "" -"當使用遺留的 ``-``、``-.``、``--`` 或 " -"``-.-`` 引數時,所有過去版本的行為都應該保留下來,且只" -"有 ``PythonCore`` 中的發布版本會被選用。然而,``-64`` 後綴現在暗示了「非 32-" -"bit」(不用一定要是 x86-64),因為現在有多個支援 64-bit 的平台。32-bit 運行程" -"式會在檢查運行程式之標籤是否帶有 ``-32`` 後綴時被偵測出來。所有 Python 3.5 以" -"後發布版本的 32-bit 建置中都有這個行為。" +"When using the legacy :samp:`-{}`, :samp:`-{}.{}`, :" +"samp:`-{}-{}` or :samp:`-{}.{}-{}` " +"arguments, all existing behaviour should be preserved from past versions, " +"and only releases from ``PythonCore`` will be selected. However, the ``-64`` " +"suffix now implies \"not 32-bit\" (not necessarily x86-64), as there are " +"multiple supported 64-bit platforms. 32-bit runtimes are detected by " +"checking the runtime's tag for a ``-32`` suffix. All releases of Python " +"since 3.5 have included this in their 32-bit builds." +msgstr "" +"當使用遺留的 :samp:`-{}`、:samp:`-{}.{}`、:samp:`-" +"{}-{}` 或 :samp:`-{}.{}-{}` 引數時,所" +"有過去版本的行為都應該保留下來,且只有 ``PythonCore`` 中的發布版本會被選用。" +"然而,``-64`` 後綴現在暗示了「非 32-bit」(不用一定要是 x86-64),因為現在有" +"多個支援 64-bit 的平台。32-bit 運行程式會在檢查運行程式之標籤是否帶有 " +"``-32`` 後綴時被偵測出來。所有 Python 3.5 以後發布版本的 32-bit 建置中都有這" +"個行為。" #: ../../whatsnew/3.11.rst:244 msgid "New Features Related to Type Hints" @@ -669,12 +670,12 @@ msgid "" "The special methods :meth:`~object.__complex__` for :class:`complex` and :" "meth:`~object.__bytes__` for :class:`bytes` are implemented to support the :" "class:`typing.SupportsComplex` and :class:`typing.SupportsBytes` protocols. " -"(Contributed by Mark Dickinson and Dong-hee Na in :issue:`24234`.)" +"(Contributed by Mark Dickinson and Donghee Na in :issue:`24234`.)" msgstr "" "為支援 :class:`typing.SupportsComplex` 與 :class:`typing.SupportsBytes` 協" "定,實作了 :class:`complex` 與 :class:`bytes` 的特殊方法 :meth:`~object." -"__complex__` 與 :meth:`~object.__bytes__`。(由 Mark Dickinson 和 Dong-hee " -"Na 於 :issue:`24234` 中所貢獻。)" +"__complex__` 與 :meth:`~object.__bytes__`。(由 Mark Dickinson 和 Donghee Na " +"於 :issue:`24234` 中所貢獻。)" #: ../../whatsnew/3.11.rst:504 msgid "" @@ -1331,11 +1332,11 @@ msgstr "os" #: ../../whatsnew/3.11.rst:898 msgid "" "On Windows, :func:`os.urandom` now uses ``BCryptGenRandom()``, instead of " -"``CryptGenRandom()`` which is deprecated. (Contributed by Dong-hee Na in :" +"``CryptGenRandom()`` which is deprecated. (Contributed by Donghee Na in :" "issue:`44611`.)" msgstr "" "在 Windows 上,:func:`os.urandom` 現在使用 ``BCryptGenRandom()`` 以取代被棄用" -"的 ``CryptGenRandom()``。(由 Dong-hee Na 於 :issue:`44611` 中所貢獻。)" +"的 ``CryptGenRandom()``。(由 Donghee Na 於 :issue:`44611` 中所貢獻。)" #: ../../whatsnew/3.11.rst:906 msgid "pathlib" @@ -1648,14 +1649,15 @@ msgid "" "on `high-resolution timers `_ which has a resolution of " "100 nanoseconds (10\\ :sup:`-7` seconds). Previously, it had a resolution of " -"1 millisecond (10\\ :sup:`-3` seconds). (Contributed by Benjamin Szőke, Dong-" -"hee Na, Eryk Sun and Victor Stinner in :issue:`21302` and :issue:`45429`.)" +"1 millisecond (10\\ :sup:`-3` seconds). (Contributed by Benjamin Szőke, " +"Donghee Na, Eryk Sun and Victor Stinner in :issue:`21302` and :issue:" +"`45429`.)" msgstr "" "在 Windows 8.1 或更新的平台上,:func:`time.sleep` 現在使用了一個基於\\ `高解" "析度計時器 `_\\ 的可等待 (waitable) 計時器,解析度為 100 奈秒" "(即 10\\ :sup:`-7` 秒)。在這之前,它只有 1 微秒(10\\ :sup:`-3` 秒) 的解析" -"度。(由 Benjamin Szőke、Dong-hee Na、Eryk Sun 和 Victor Stinner 於 :issue:" +"度。(由 Benjamin Szőke、Donghee Na、Eryk Sun 和 Victor Stinner 於 :issue:" "`21302` 與 :issue:`45429` 中貢獻。)" #: ../../whatsnew/3.11.rst:1098 @@ -2043,10 +2045,10 @@ msgstr "" #: ../../whatsnew/3.11.rst:1306 msgid "" ":func:`unicodedata.normalize` now normalizes pure-ASCII strings in constant " -"time. (Contributed by Dong-hee Na in :issue:`44987`.)" +"time. (Contributed by Donghee Na in :issue:`44987`.)" msgstr "" ":func:`unicodedata.normalize` 現在在常數時間內規範化 (normalize) 純 ASCII 字" -"串。(由 Dong-hee Na 在 :issue:`44987` 中貢獻。)" +"串。(由 Donghee Na 在 :issue:`44987` 中貢獻。)" #: ../../whatsnew/3.11.rst:1314 msgid "Faster CPython" @@ -2324,8 +2326,8 @@ msgid "10%" msgstr "10%" #: ../../whatsnew/3.11.rst:1454 -msgid "Mark Shannon, Dong-hee Na, Brandt Bucher, Dennis Sweeney" -msgstr "Mark Shannon, Dong-hee Na, Brandt Bucher, Dennis Sweeney" +msgid "Mark Shannon, Donghee Na, Brandt Bucher, Dennis Sweeney" +msgstr "Mark Shannon, Donghee Na, Brandt Bucher, Dennis Sweeney" #: ../../whatsnew/3.11.rst:1460 msgid "Subscript" @@ -2577,7 +2579,7 @@ msgid "" msgstr "" ":mod:`re` 的正則表達式比對引擎部分被重構,且現在會有支援的平台上使用 " "computed gotos(或者「執行緒程式碼 (threaded code)」),因此 Python 3.11 在執" -"行 `pyperformance正則表達式基準量測 `_\\ 的表現上比起 Python 3.10 快了 10%。(由 " "Brandt Bucher 於 :gh:`91404` 中貢獻。)" @@ -3285,10 +3287,10 @@ msgstr "" msgid "" ":class:`!webbrowser.MacOSX` is deprecated and will be removed in Python " "3.13. It is untested, undocumented, and not used by :mod:`webbrowser` " -"itself. (Contributed by Dong-hee Na in :issue:`42255`.)" +"itself. (Contributed by Donghee Na in :issue:`42255`.)" msgstr "" ":class:`!webbrowser.MacOSX` 已被棄用且將於 Python 3.13 中移除。它並沒有被測試" -"過、沒紀錄於文件、也沒有被 :mod:`webbrowser` 本身使用。(由 Dong-hee Na 於 :" +"過、沒紀錄於文件、也沒有被 :mod:`webbrowser` 本身使用。(由 Donghee Na 於 :" "issue:`42255`。)" #: ../../whatsnew/3.11.rst:1844 @@ -3727,14 +3729,14 @@ msgid "" "output_charset` and :meth:`!NullTranslations.set_output_charset` methods, " "and the *codeset* parameter of :func:`!translation` and :func:`!install`, " "since they are only used for the :func:`!l*gettext` functions. (Contributed " -"by Dong-hee Na and Serhiy Storchaka in :issue:`44235`.)" +"by Donghee Na and Serhiy Storchaka in :issue:`44235`.)" msgstr "" "刪除了已棄用的 :mod:`gettext` 函式 :func:`!lgettext`、:func:`!ldgettext`、:" "func:`!lngettext` 和 :func:`!ldngettext`,也刪除了 :func:`!" "bind_textdomain_codeset` 函式、:meth:`!NullTranslations.output_charset` 和 :" "meth:`!NullTranslations.set_output_charset` 方法,以及 :func:`!translation` " "和 :func:`!install` 的 *codeset* 參數,因為它們僅被用於 :func:`!l*gettext` 函" -"式。 (由 Dong-hee Na 和 Serhiy Storchaka 在 :issue:`44235` 中貢獻。)" +"式。 (由 Donghee Na 和 Serhiy Storchaka 在 :issue:`44235` 中貢獻。)" #: ../../whatsnew/3.11.rst:1989 msgid "Removed from the :mod:`inspect` module:" @@ -3785,10 +3787,10 @@ msgstr "" msgid "" "Removed the :class:`!MailmanProxy` class in the :mod:`smtpd` module, as it " "is unusable without the external :mod:`!mailman` package. (Contributed by " -"Dong-hee Na in :issue:`35800`.)" +"Donghee Na in :issue:`35800`.)" msgstr "" "移除 :mod:`smtpd` 模組中的 :class:`!MailmanProxy` 類別,因為它無法獨立於外部" -"套件 :mod:`!mailman` 使用。(由 Dong-hee Na 於 :issue:`35800` 貢獻。)" +"套件 :mod:`!mailman` 使用。(由 Donghee Na 於 :issue:`35800` 貢獻。)" #: ../../whatsnew/3.11.rst:2014 msgid "" @@ -4062,12 +4064,12 @@ msgstr "" msgid "" "CPython can now be built with the `ThinLTO `_ option via passing ``thin`` to :option:`--with-lto`, i.e. " -"``--with-lto=thin``. (Contributed by Dong-hee Na and Brett Holman in :issue:" +"``--with-lto=thin``. (Contributed by Donghee Na and Brett Holman in :issue:" "`44340`.)" msgstr "" "CPython 現在可以透過將 ``thin`` 傳遞給 :option:`--with-lto`\\ (也就是 ``--" "with-lto=thin``\\ )來以 `ThinLTO `_ 選項建置。(由 Dong-hee Na 與 Brett Holman 於 :issue:`44340` 中所貢" +"html>`_ 選項建置。(由 Donghee Na 與 Brett Holman 於 :issue:`44340` 中所貢" "獻。)" #: ../../whatsnew/3.11.rst:2156 @@ -5146,102 +5148,3 @@ msgid "" msgstr "" "詳情請見 :pep:`624` 與\\ :pep:`搬遷指南 <624#alternative-apis>`。(由 Inada " "Naoki 於 :issue:`44029` 中所貢獻。)" - -#~ msgid "" -#~ "Added :meth:`object.__getstate__`, which provides the default " -#~ "implementation of the :meth:`!__getstate__` method. :mod:`copy`\\ing and :" -#~ "mod:`pickle`\\ing instances of subclasses of builtin types :class:" -#~ "`bytearray`, :class:`set`, :class:`frozenset`, :class:`collections." -#~ "OrderedDict`, :class:`collections.deque`, :class:`weakref.WeakSet`, and :" -#~ "class:`datetime.tzinfo` now copies and pickles instance attributes " -#~ "implemented as :term:`slots <__slots__>`. (Contributed by Serhiy " -#~ "Storchaka in :issue:`26579`.)" -#~ msgstr "" -#~ "添加了 :meth:`object.__getstate__`,它提供 :meth:`!__getstate__` 方法的預" -#~ "設實作。內建型別 :class:`bytearray`、:class:`set`、:class:`frozenset`、:" -#~ "class:`collections.OrderedDict`、:class:`collections.deque`、:class:" -#~ "`weakref.WeakSet` 和 :class:`datetime.tzinfo` 的 :mod:`copy` 和 :mod:" -#~ "`pickle` 實例,現在會以 :term:`slots <__slots__>` 形式複製和 pickle 實例屬" -#~ "性。 (由 Serhiy Storchaka 在 :issue:`26579` 中貢獻。)" - -#~ msgid ":c:func:`PyBuffer_CopyData`" -#~ msgstr ":c:func:`PyBuffer_CopyData`" - -#~ msgid ":c:func:`PySys_AddWarnOptionUnicode`" -#~ msgstr ":c:func:`PySys_AddWarnOptionUnicode`" - -#~ msgid ":c:func:`PySys_AddWarnOption`" -#~ msgstr ":c:func:`PySys_AddWarnOption`" - -#~ msgid ":c:func:`PySys_AddXOption`" -#~ msgstr ":c:func:`PySys_AddXOption`" - -#~ msgid ":c:func:`PySys_HasWarnOptions`" -#~ msgstr ":c:func:`PySys_HasWarnOptions`" - -#~ msgid ":c:func:`PySys_SetArgvEx`" -#~ msgstr ":c:func:`PySys_SetArgvEx`" - -#~ msgid ":c:func:`PySys_SetArgv`" -#~ msgstr ":c:func:`PySys_SetArgv`" - -#~ msgid ":c:func:`PySys_SetPath`" -#~ msgstr ":c:func:`PySys_SetPath`" - -#~ msgid ":c:func:`Py_SetPath`" -#~ msgstr ":c:func:`Py_SetPath`" - -#~ msgid ":c:func:`Py_SetProgramName`" -#~ msgstr ":c:func:`Py_SetProgramName`" - -#~ msgid ":c:func:`Py_SetPythonHome`" -#~ msgstr ":c:func:`Py_SetPythonHome`" - -#~ msgid ":c:func:`Py_SetStandardStreamEncoding`" -#~ msgstr ":c:func:`Py_SetStandardStreamEncoding`" - -#~ msgid ":c:func:`_Py_SetProgramFullPath`" -#~ msgstr ":c:func:`_Py_SetProgramFullPath`" - -#~ msgid ":c:func:`PyUnicode_AS_DATA`" -#~ msgstr ":c:func:`PyUnicode_AS_DATA`" - -#~ msgid ":c:func:`PyUnicode_AS_UNICODE`" -#~ msgstr ":c:func:`PyUnicode_AS_UNICODE`" - -#~ msgid ":c:func:`PyUnicode_AsUnicodeAndSize`" -#~ msgstr ":c:func:`PyUnicode_AsUnicodeAndSize`" - -#~ msgid ":c:func:`PyUnicode_AsUnicode`" -#~ msgstr ":c:func:`PyUnicode_AsUnicode`" - -#~ msgid ":c:func:`PyUnicode_FromUnicode`" -#~ msgstr ":c:func:`PyUnicode_FromUnicode`" - -#~ msgid ":c:func:`PyUnicode_GET_DATA_SIZE`" -#~ msgstr ":c:func:`PyUnicode_GET_DATA_SIZE`" - -#~ msgid ":c:func:`PyUnicode_GET_SIZE`" -#~ msgstr ":c:func:`PyUnicode_GET_SIZE`" - -#~ msgid ":c:func:`PyUnicode_GetSize`" -#~ msgstr ":c:func:`PyUnicode_GetSize`" - -#~ msgid ":c:func:`Py_UNICODE_WSTR_LENGTH`" -#~ msgstr ":c:func:`Py_UNICODE_WSTR_LENGTH`" - -#~ msgid ":c:func:`_PyUnicode_AsUnicode`" -#~ msgstr ":c:func:`_PyUnicode_AsUnicode`" - -#~ msgid ":c:macro:`PyUnicode_WCHAR_KIND`" -#~ msgstr ":c:macro:`PyUnicode_WCHAR_KIND`" - -#~ msgid ":c:func:`PyUnicode_InternImmortal()`" -#~ msgstr ":c:func:`PyUnicode_InternImmortal()`" - -#~ msgid "" -#~ ":c:func:`PyFrame_BlockSetup` and :c:func:`PyFrame_BlockPop` have been " -#~ "removed. (Contributed by Mark Shannon in :issue:`40222`.)" -#~ msgstr "" -#~ "移除 :c:func:`PyFrame_BlockSetup` 和 :c:func:`PyFrame_BlockPop`。(由 " -#~ "Mark Shannon 於 :issue:`40222` 中所貢獻。)" diff --git a/whatsnew/3.12.po b/whatsnew/3.12.po index 0d4fc1eb05..caf6dee4a5 100644 --- a/whatsnew/3.12.po +++ b/whatsnew/3.12.po @@ -1,4 +1,3 @@ -# SOME DESCRIPTIVE TITLE. # Copyright (C) 2001-2023, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. @@ -8,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-09-13 00:03+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -22,157 +21,339 @@ msgid "What's New In Python 3.12" msgstr "Python 3.12 有什麼新功能" #: ../../whatsnew/3.12.rst:0 -msgid "Release" -msgstr "發行版本" +msgid "Editor" +msgstr "編輯者" #: ../../whatsnew/3.12.rst:6 -msgid "|release|" -msgstr "|release|" +msgid "Adam Turner" +msgstr "Adam Turner" -#: ../../whatsnew/3.12.rst:0 -msgid "Date" -msgstr "日期" +#: ../../whatsnew/3.12.rst:48 +msgid "" +"This article explains the new features in Python 3.12, compared to 3.11. " +"Python 3.12 was released on October 2, 2023. For full details, see the :ref:" +"`changelog `." +msgstr "" -#: ../../whatsnew/3.12.rst:7 -msgid "|today|" -msgstr "|today|" +#: ../../whatsnew/3.12.rst:54 +msgid ":pep:`693` -- Python 3.12 Release Schedule" +msgstr ":pep:`693` -- Python 3.12 發佈時程" + +#: ../../whatsnew/3.12.rst:57 +msgid "Summary -- Release highlights" +msgstr "發布重點摘要" -#: ../../whatsnew/3.12.rst:49 +#: ../../whatsnew/3.12.rst:62 msgid "" -"This article explains the new features in Python 3.12, compared to 3.11." -msgstr "此文章解釋了 Python 3.12 和 3.11 相比多了哪些新特性。" +"Python 3.12 is the latest stable release of the Python programming language, " +"with a mix of changes to the language and the standard library. The library " +"changes focus on cleaning up deprecated APIs, usability, and correctness. Of " +"note, the :mod:`!distutils` package has been removed from the standard " +"library. Filesystem support in :mod:`os` and :mod:`pathlib` has seen a " +"number of improvements, and several modules have better performance." +msgstr "" -#: ../../whatsnew/3.12.rst:51 -msgid "For full details, see the :ref:`changelog `." -msgstr "若想了解完整細節,請見\\ :ref:`更動日誌 `。" +#: ../../whatsnew/3.12.rst:69 +msgid "" +"The language changes focus on usability, as :term:`f-strings ` " +"have had many limitations removed and 'Did you mean ...' suggestions " +"continue to improve. The new :ref:`type parameter syntax ` and :keyword:`type` statement improve ergonomics for using :term:" +"`generic types ` and :term:`type aliases ` with " +"static type checkers." +msgstr "" -#: ../../whatsnew/3.12.rst:55 +#: ../../whatsnew/3.12.rst:76 msgid "" -"Prerelease users should be aware that this document is currently in draft " -"form. It will be updated substantially as Python 3.12 moves towards release, " -"so it's worth checking back even after reading earlier versions." +"This article doesn't attempt to provide a complete specification of all new " +"features, but instead gives a convenient overview. For full details, you " +"should refer to the documentation, such as the :ref:`Library Reference " +"` and :ref:`Language Reference `. If you " +"want to understand the complete implementation and design rationale for a " +"change, refer to the PEP for a particular new feature; but note that PEPs " +"usually are not kept up-to-date once a feature has been fully implemented." msgstr "" -#: ../../whatsnew/3.12.rst:61 -msgid "Summary -- Release highlights" -msgstr "發布重點摘要" +#: ../../whatsnew/3.12.rst:90 +msgid "New syntax features:" +msgstr "" -#: ../../whatsnew/3.12.rst:69 +#: ../../whatsnew/3.12.rst:92 +msgid "" +":ref:`PEP 695 `, type parameter syntax and the :keyword:" +"`type` statement" +msgstr "" + +#: ../../whatsnew/3.12.rst:94 msgid "New grammar features:" msgstr "新增語法特性:" -#: ../../whatsnew/3.12.rst:71 -msgid ":ref:`whatsnew312-pep701`" -msgstr ":ref:`whatsnew312-pep701`" +#: ../../whatsnew/3.12.rst:96 +msgid "" +":ref:`PEP 701 `, :term:`f-strings ` in the " +"grammar" +msgstr "" -#: ../../whatsnew/3.12.rst:73 +#: ../../whatsnew/3.12.rst:98 msgid "Interpreter improvements:" msgstr "" -#: ../../whatsnew/3.12.rst:75 -msgid ":ref:`whatsnew312-pep684`" -msgstr ":ref:`whatsnew312-pep684`" +#: ../../whatsnew/3.12.rst:100 +msgid "" +":ref:`PEP 684 `, a unique per-interpreter :term:`GIL " +"`" +msgstr "" -#: ../../whatsnew/3.12.rst:77 -msgid ":ref:`whatsnew312-pep669`" -msgstr ":ref:`whatsnew312-pep669`" +#: ../../whatsnew/3.12.rst:102 +msgid ":ref:`PEP 669 `, low impact monitoring" +msgstr "" -#: ../../whatsnew/3.12.rst:79 -msgid "New typing features:" -msgstr "新增型別特性:" +#: ../../whatsnew/3.12.rst:103 +msgid "" +"`Improved 'Did you mean ...' suggestions `_ for :" +"exc:`NameError`, :exc:`ImportError`, and :exc:`SyntaxError` exceptions" +msgstr "" -#: ../../whatsnew/3.12.rst:81 -msgid ":ref:`whatsnew312-pep688`" -msgstr ":ref:`whatsnew312-pep688`" +#: ../../whatsnew/3.12.rst:106 +msgid "Python data model improvements:" +msgstr "" -#: ../../whatsnew/3.12.rst:83 -msgid ":ref:`whatsnew312-pep692`" -msgstr ":ref:`whatsnew312-pep692`" +#: ../../whatsnew/3.12.rst:108 +msgid "" +":ref:`PEP 688 `, using the :ref:`buffer protocol " +"` from Python" +msgstr "" -#: ../../whatsnew/3.12.rst:85 -msgid ":ref:`whatsnew312-pep695`" -msgstr ":ref:`whatsnew312-pep695`" +#: ../../whatsnew/3.12.rst:111 +msgid "Significant improvements in the standard library:" +msgstr "" -#: ../../whatsnew/3.12.rst:87 -msgid ":ref:`whatsnew312-pep698`" -msgstr ":ref:`whatsnew312-pep698`" +#: ../../whatsnew/3.12.rst:113 +msgid "The :class:`pathlib.Path` class now supports subclassing" +msgstr "" -#: ../../whatsnew/3.12.rst:89 -msgid "Important deprecations, removals or restrictions:" +#: ../../whatsnew/3.12.rst:114 +msgid "The :mod:`os` module received several improvements for Windows support" msgstr "" -#: ../../whatsnew/3.12.rst:91 -msgid ":pep:`623`: Remove wstr from Unicode" +#: ../../whatsnew/3.12.rst:115 +msgid "" +"A :ref:`command-line interface ` has been added to the :mod:" +"`sqlite3` module" msgstr "" -#: ../../whatsnew/3.12.rst:93 +#: ../../whatsnew/3.12.rst:117 msgid "" -":pep:`632`: Remove the ``distutils`` package. See `the migration guide " -"`_ for advice on its " -"replacement." +":func:`isinstance` checks against :func:`runtime-checkable protocols ` enjoy a speed up of between two and 20 times" msgstr "" -#: ../../whatsnew/3.12.rst:98 -msgid "Improved Error Messages" +#: ../../whatsnew/3.12.rst:119 +msgid "" +"The :mod:`asyncio` package has had a number of performance improvements, " +"with some benchmarks showing a 75% speed up." msgstr "" -#: ../../whatsnew/3.12.rst:100 +#: ../../whatsnew/3.12.rst:121 msgid "" -"Modules from the standard library are now potentially suggested as part of " -"the error messages displayed by the interpreter when a :exc:`NameError` is " -"raised to the top level. Contributed by Pablo Galindo in :gh:`98254`." +"A :ref:`command-line interface ` has been added to the :mod:`uuid` " +"module" msgstr "" -#: ../../whatsnew/3.12.rst:109 +#: ../../whatsnew/3.12.rst:123 msgid "" -"Improve the error suggestion for :exc:`NameError` exceptions for instances. " -"Now if a :exc:`NameError` is raised in a method and the instance has an " -"attribute that's exactly equal to the name in the exception, the suggestion " -"will include ``self.`` instead of the closest match in the method " -"scope. Contributed by Pablo Galindo in :gh:`99139`." +"Due to the changes in :ref:`PEP 701 `, producing tokens " +"via the :mod:`tokenize` module is up to 64% faster." +msgstr "" + +#: ../../whatsnew/3.12.rst:126 +msgid "Security improvements:" msgstr "" -#: ../../whatsnew/3.12.rst:130 +#: ../../whatsnew/3.12.rst:128 msgid "" -"Improve the :exc:`SyntaxError` error message when the user types ``import x " -"from y`` instead of ``from y import x``. Contributed by Pablo Galindo in :gh:" -"`98931`." +"Replace the builtin :mod:`hashlib` implementations of SHA1, SHA3, SHA2-384, " +"SHA2-512, and MD5 with formally verified code from the `HACL* `__ project. These builtin implementations " +"remain as fallbacks that are only used when OpenSSL does not provide them." +msgstr "" + +#: ../../whatsnew/3.12.rst:134 +msgid "C API improvements:" +msgstr "" + +#: ../../whatsnew/3.12.rst:136 +msgid ":ref:`PEP 697 `, unstable C API tier" +msgstr "" + +#: ../../whatsnew/3.12.rst:137 +msgid ":ref:`PEP 683 `, immortal objects" msgstr "" -#: ../../whatsnew/3.12.rst:140 +#: ../../whatsnew/3.12.rst:139 +msgid "CPython implementation improvements:" +msgstr "" + +#: ../../whatsnew/3.12.rst:141 +msgid ":ref:`PEP 709 `, comprehension inlining" +msgstr "" + +#: ../../whatsnew/3.12.rst:142 +msgid ":ref:`CPython support ` for the Linux ``perf`` profiler" +msgstr "" + +#: ../../whatsnew/3.12.rst:143 +msgid "Implement stack overflow protection on supported platforms" +msgstr "" + +#: ../../whatsnew/3.12.rst:145 +msgid "New typing features:" +msgstr "新增型別特性:" + +#: ../../whatsnew/3.12.rst:147 msgid "" -":exc:`ImportError` exceptions raised from failed ``from import " -"`` statements now include suggestions for the value of ```` " -"based on the available names in ````. Contributed by Pablo Galindo " -"in :gh:`91058`." +":ref:`PEP 692 `, using :class:`~typing.TypedDict` to " +"annotate :term:`**kwargs `" +msgstr "" + +#: ../../whatsnew/3.12.rst:149 +msgid ":ref:`PEP 698 `, :func:`typing.override` decorator" +msgstr "" + +#: ../../whatsnew/3.12.rst:151 +msgid "Important deprecations, removals or restrictions:" +msgstr "" + +#: ../../whatsnew/3.12.rst:153 +msgid "" +":pep:`623`: Remove ``wstr`` from Unicode objects in Python's C API, reducing " +"the size of every :class:`str` object by at least 8 bytes." +msgstr "" + +#: ../../whatsnew/3.12.rst:156 +msgid "" +":pep:`632`: Remove the :mod:`!distutils` package. See `the migration guide " +"`_ for advice replacing " +"the APIs it provided. The third-party `Setuptools `__ package continues to " +"provide :mod:`!distutils`, if you still require it in Python 3.12 and beyond." +msgstr "" + +#: ../../whatsnew/3.12.rst:163 +msgid "" +":gh:`95299`: Do not pre-install ``setuptools`` in virtual environments " +"created with :mod:`venv`. This means that ``distutils``, ``setuptools``, " +"``pkg_resources``, and ``easy_install`` will no longer available by default; " +"to access these run ``pip install setuptools`` in the :ref:`activated ` virtual environment." msgstr "" -#: ../../whatsnew/3.12.rst:151 ../../whatsnew/3.12.rst:1739 +#: ../../whatsnew/3.12.rst:170 +msgid "" +"The :mod:`!asynchat`, :mod:`!asyncore`, and :mod:`!imp` modules have been " +"removed, along with several :class:`unittest.TestCase` `method aliases " +"`_." +msgstr "" + +#: ../../whatsnew/3.12.rst:176 ../../whatsnew/3.12.rst:1917 msgid "New Features" msgstr "新增特性" -#: ../../whatsnew/3.12.rst:156 +#: ../../whatsnew/3.12.rst:181 +msgid "PEP 695: Type Parameter Syntax" +msgstr "" + +#: ../../whatsnew/3.12.rst:183 +msgid "" +"Generic classes and functions under :pep:`484` were declared using a verbose " +"syntax that left the scope of type parameters unclear and required explicit " +"declarations of variance." +msgstr "" + +#: ../../whatsnew/3.12.rst:187 +msgid "" +":pep:`695` introduces a new, more compact and explicit way to create :ref:" +"`generic classes ` and :ref:`functions `::" +msgstr "" + +#: ../../whatsnew/3.12.rst:200 +msgid "" +"In addition, the PEP introduces a new way to declare :ref:`type aliases " +"` using the :keyword:`type` statement, which creates an " +"instance of :class:`~typing.TypeAliasType`::" +msgstr "" + +#: ../../whatsnew/3.12.rst:206 +msgid "Type aliases can also be :ref:`generic `::" +msgstr "" + +#: ../../whatsnew/3.12.rst:210 +msgid "" +"The new syntax allows declaring :class:`~typing.TypeVarTuple` and :class:" +"`~typing.ParamSpec` parameters, as well as :class:`~typing.TypeVar` " +"parameters with bounds or constraints::" +msgstr "" + +#: ../../whatsnew/3.12.rst:219 +msgid "" +"The value of type aliases and the bound and constraints of type variables " +"created through this syntax are evaluated only on demand (see :ref:`lazy " +"evaluation `). This means type aliases are able to refer to " +"other types defined later in the file." +msgstr "" + +#: ../../whatsnew/3.12.rst:224 +msgid "" +"Type parameters declared through a type parameter list are visible within " +"the scope of the declaration and any nested scopes, but not in the outer " +"scope. For example, they can be used in the type annotations for the methods " +"of a generic class or in the class body. However, they cannot be used in the " +"module scope after the class is defined. See :ref:`type-params` for a " +"detailed description of the runtime semantics of type parameters." +msgstr "" + +#: ../../whatsnew/3.12.rst:231 +msgid "" +"In order to support these scoping semantics, a new kind of scope is " +"introduced, the :ref:`annotation scope `. Annotation " +"scopes behave for the most part like function scopes, but interact " +"differently with enclosing class scopes. In Python 3.13, :term:`annotations " +"` will also be evaluated in annotation scopes." +msgstr "" + +#: ../../whatsnew/3.12.rst:237 +msgid "See :pep:`695` for more details." +msgstr "詳情請見 :pep:`695`。" + +#: ../../whatsnew/3.12.rst:239 +msgid "" +"(PEP written by Eric Traut. Implementation by Jelle Zijlstra, Eric Traut, " +"and others in :gh:`103764`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:245 msgid "PEP 701: Syntactic formalization of f-strings" msgstr "" -#: ../../whatsnew/3.12.rst:158 +#: ../../whatsnew/3.12.rst:247 msgid "" -":pep:`701` lifts some restrictions on the usage of f-strings. Expression " -"components inside f-strings can now be any valid Python expression including " -"backslashes, unicode escaped sequences, multi-line expressions, comments and " -"strings reusing the same quote as the containing f-string. Let's cover these " -"in detail:" +":pep:`701` lifts some restrictions on the usage of :term:`f-strings `. Expression components inside f-strings can now be any valid Python " +"expression, including strings reusing the same quote as the containing f-" +"string, multi-line expressions, comments, backslashes, and unicode escape " +"sequences. Let's cover these in detail:" msgstr "" -#: ../../whatsnew/3.12.rst:163 +#: ../../whatsnew/3.12.rst:253 msgid "" -"Quote reuse: in Python 3.11, reusing the same quotes as the containing f-" +"Quote reuse: in Python 3.11, reusing the same quotes as the enclosing f-" "string raises a :exc:`SyntaxError`, forcing the user to either use other " "available quotes (like using double quotes or triple quotes if the f-string " "uses single quotes). In Python 3.12, you can now do things like this:" msgstr "" -#: ../../whatsnew/3.12.rst:172 +#: ../../whatsnew/3.12.rst:262 msgid "" "Note that before this change there was no explicit limit in how f-strings " "can be nested, but the fact that string quotes cannot be reused inside the " @@ -180,44 +361,43 @@ msgid "" "arbitrarily. In fact, this is the most nested f-string that could be written:" msgstr "" -#: ../../whatsnew/3.12.rst:180 +#: ../../whatsnew/3.12.rst:270 msgid "" "As now f-strings can contain any valid Python expression inside expression " "components, it is now possible to nest f-strings arbitrarily:" msgstr "" -#: ../../whatsnew/3.12.rst:186 +#: ../../whatsnew/3.12.rst:276 msgid "" -"Multi-line expressions and comments: In Python 3.11, f-strings expressions " -"must be defined in a single line even if outside f-strings expressions could " -"span multiple lines (like literal lists being defined over multiple lines), " -"making them harder to read. In Python 3.12 you can now define expressions " -"spanning multiple lines and include comments on them:" +"Multi-line expressions and comments: In Python 3.11, f-string expressions " +"must be defined in a single line, even if the expression within the f-string " +"could normally span multiple lines (like literal lists being defined over " +"multiple lines), making them harder to read. In Python 3.12 you can now " +"define f-strings spanning multiple lines, and add inline comments:" msgstr "" -#: ../../whatsnew/3.12.rst:199 +#: ../../whatsnew/3.12.rst:290 msgid "" "Backslashes and unicode characters: before Python 3.12 f-string expressions " -"couldn't contain any ``\\`` character. This also affected unicode escaped " -"sequences (such as ``\\N{snowman}``) as these contain the ``\\N`` part that " -"previously could not be part of expression components of f-strings. Now, you " -"can define expressions like this:" +"couldn't contain any ``\\`` character. This also affected unicode :ref:" +"`escape sequences ` (such as ``\\N{snowman}``) as these " +"contain the ``\\N`` part that previously could not be part of expression " +"components of f-strings. Now, you can define expressions like this:" msgstr "" -#: ../../whatsnew/3.12.rst:212 +#: ../../whatsnew/3.12.rst:303 msgid "See :pep:`701` for more details." msgstr "詳情請見 :pep:`701`。" -#: ../../whatsnew/3.12.rst:214 +#: ../../whatsnew/3.12.rst:305 msgid "" "As a positive side-effect of how this feature has been implemented (by " -"parsing f-strings with the PEG parser (see :pep:`617`), now error messages " -"for f-strings are more precise and include the exact location of the error. " -"For example, in Python 3.11, the following f-string raises a :exc:" -"`SyntaxError`:" +"parsing f-strings with :pep:`the PEG parser <617>`), now error messages for " +"f-strings are more precise and include the exact location of the error. For " +"example, in Python 3.11, the following f-string raises a :exc:`SyntaxError`:" msgstr "" -#: ../../whatsnew/3.12.rst:227 +#: ../../whatsnew/3.12.rst:318 msgid "" "but the error message doesn't include the exact location of the error within " "the line and also has the expression artificially surrounded by parentheses. " @@ -225,82 +405,72 @@ msgid "" "can be more precise and show the entire line:" msgstr "" -#: ../../whatsnew/3.12.rst:239 +#: ../../whatsnew/3.12.rst:330 msgid "" "(Contributed by Pablo Galindo, Batuhan Taskaya, Lysandros Nikolaou, Cristián " "Maureira-Fredes and Marta Gómez in :gh:`102856`. PEP written by Pablo " "Galindo, Batuhan Taskaya, Lysandros Nikolaou and Marta Gómez)." msgstr "" -#: ../../whatsnew/3.12.rst:246 -msgid "PEP 709: Comprehension inlining" +#: ../../whatsnew/3.12.rst:337 +msgid "PEP 684: A Per-Interpreter GIL" msgstr "" -#: ../../whatsnew/3.12.rst:248 +#: ../../whatsnew/3.12.rst:339 msgid "" -"Dictionary, list, and set comprehensions are now inlined, rather than " -"creating a new single-use function object for each execution of the " -"comprehension. This speeds up execution of a comprehension by up to 2x." +":pep:`684` introduces a per-interpreter :term:`GIL `, so that sub-interpreters may now be created with a unique GIL per " +"interpreter. This allows Python programs to take full advantage of multiple " +"CPU cores. This is currently only available through the C-API, though a " +"Python API is :pep:`anticipated for 3.13 <554>`." msgstr "" -#: ../../whatsnew/3.12.rst:252 +#: ../../whatsnew/3.12.rst:345 msgid "" -"Comprehension iteration variables remain isolated; they don't overwrite a " -"variable of the same name in the outer scope, nor are they visible after the " -"comprehension. This isolation is now maintained via stack/locals " -"manipulation, not via separate function scope." -msgstr "" - -#: ../../whatsnew/3.12.rst:257 -msgid "Inlining does result in a few visible behavior changes:" +"Use the new :c:func:`Py_NewInterpreterFromConfig` function to create an " +"interpreter with its own GIL::" msgstr "" -#: ../../whatsnew/3.12.rst:259 +#: ../../whatsnew/3.12.rst:359 msgid "" -"There is no longer a separate frame for the comprehension in tracebacks, and " -"tracing/profiling no longer shows the comprehension as a function call." +"For further examples how to use the C-API for sub-interpreters with a per-" +"interpreter GIL, see :source:`Modules/_xxsubinterpretersmodule.c`." msgstr "" -#: ../../whatsnew/3.12.rst:261 -msgid "" -"The :mod:`symtable` module will no longer produce child symbol tables for " -"each comprehension; instead, the comprehension's locals will be included in " -"the parent function's symbol table." -msgstr "" +#: ../../whatsnew/3.12.rst:362 +msgid "(Contributed by Eric Snow in :gh:`104210`, etc.)" +msgstr "(由 Eric Snow 於 :gh:`104210` 等貢獻。)" -#: ../../whatsnew/3.12.rst:264 -msgid "" -"Calling :func:`locals` inside a comprehension now includes variables from " -"outside the comprehension, and no longer includes the synthetic ``.0`` " -"variable for the comprehension \"argument\"." +#: ../../whatsnew/3.12.rst:367 +msgid "PEP 669: Low impact monitoring for CPython" msgstr "" -#: ../../whatsnew/3.12.rst:267 +#: ../../whatsnew/3.12.rst:369 msgid "" -"A comprehension iterating directly over ``locals()`` (e.g. ``[k for k in " -"locals()]``) may see \"RuntimeError: dictionary changed size during " -"iteration\" when run under tracing (e.g. code coverage measurement). This is " -"the same behavior already seen in e.g. ``for k in locals():``. To avoid the " -"error, first create a list of keys to iterate over: ``keys = list(locals()); " -"[k for k in keys]``." +":pep:`669` defines a new :mod:`API ` for profilers, " +"debuggers, and other tools to monitor events in CPython. It covers a wide " +"range of events, including calls, returns, lines, exceptions, jumps, and " +"more. This means that you only pay for what you use, providing support for " +"near-zero overhead debuggers and coverage tools. See :mod:`sys.monitoring` " +"for details." msgstr "" -#: ../../whatsnew/3.12.rst:274 -msgid "Contributed by Carl Meyer and Vladimir Matveev in :pep:`709`." +#: ../../whatsnew/3.12.rst:377 +msgid "(Contributed by Mark Shannon in :gh:`103082`.)" msgstr "" -#: ../../whatsnew/3.12.rst:279 +#: ../../whatsnew/3.12.rst:382 msgid "PEP 688: Making the buffer protocol accessible in Python" msgstr "" -#: ../../whatsnew/3.12.rst:281 +#: ../../whatsnew/3.12.rst:384 msgid "" ":pep:`688` introduces a way to use the :ref:`buffer protocol " "` from Python code. Classes that implement the :meth:`~object." "__buffer__` method are now usable as buffer types." msgstr "" -#: ../../whatsnew/3.12.rst:285 +#: ../../whatsnew/3.12.rst:388 msgid "" "The new :class:`collections.abc.Buffer` ABC provides a standard way to " "represent buffer objects, for example in type annotations. The new :class:" @@ -308,92 +478,134 @@ msgid "" "customize buffer creation. (Contributed by Jelle Zijlstra in :gh:`102500`.)" msgstr "" -#: ../../whatsnew/3.12.rst:294 -msgid "PEP 684: A Per-Interpreter GIL" +#: ../../whatsnew/3.12.rst:397 +msgid "PEP 709: Comprehension inlining" msgstr "" -#: ../../whatsnew/3.12.rst:296 +#: ../../whatsnew/3.12.rst:399 msgid "" -"Sub-interpreters may now be created with a unique GIL per interpreter. This " -"allows Python programs to take full advantage of multiple CPU cores." +"Dictionary, list, and set comprehensions are now inlined, rather than " +"creating a new single-use function object for each execution of the " +"comprehension. This speeds up execution of a comprehension by up to two " +"times. See :pep:`709` for further details." msgstr "" -#: ../../whatsnew/3.12.rst:300 +#: ../../whatsnew/3.12.rst:404 msgid "" -"Use the new :c:func:`Py_NewInterpreterFromConfig` function to create an " -"interpreter with its own GIL::" +"Comprehension iteration variables remain isolated and don't overwrite a " +"variable of the same name in the outer scope, nor are they visible after the " +"comprehension. Inlining does result in a few visible behavior changes:" msgstr "" -#: ../../whatsnew/3.12.rst:314 +#: ../../whatsnew/3.12.rst:408 msgid "" -"For further examples how to use the C-API for sub-interpreters with a per-" -"interpreter GIL, see :source:`Modules/_xxsubinterpretersmodule.c`." +"There is no longer a separate frame for the comprehension in tracebacks, and " +"tracing/profiling no longer shows the comprehension as a function call." msgstr "" -#: ../../whatsnew/3.12.rst:317 -msgid "A Python API is anticipated for 3.13. (See :pep:`554`.)" +#: ../../whatsnew/3.12.rst:410 +msgid "" +"The :mod:`symtable` module will no longer produce child symbol tables for " +"each comprehension; instead, the comprehension's locals will be included in " +"the parent function's symbol table." msgstr "" -#: ../../whatsnew/3.12.rst:319 -msgid "(Contributed by Eric Snow in :gh:`104210`, etc.)" -msgstr "(由 Eric Snow 於 :gh:`104210` 等貢獻。)" +#: ../../whatsnew/3.12.rst:413 +msgid "" +"Calling :func:`locals` inside a comprehension now includes variables from " +"outside the comprehension, and no longer includes the synthetic ``.0`` " +"variable for the comprehension \"argument\"." +msgstr "" -#: ../../whatsnew/3.12.rst:324 -msgid "PEP 669: Low impact monitoring for CPython" +#: ../../whatsnew/3.12.rst:416 +msgid "" +"A comprehension iterating directly over ``locals()`` (e.g. ``[k for k in " +"locals()]``) may see \"RuntimeError: dictionary changed size during " +"iteration\" when run under tracing (e.g. code coverage measurement). This is " +"the same behavior already seen in e.g. ``for k in locals():``. To avoid the " +"error, first create a list of keys to iterate over: ``keys = list(locals()); " +"[k for k in keys]``." msgstr "" -#: ../../whatsnew/3.12.rst:326 +#: ../../whatsnew/3.12.rst:423 +msgid "(Contributed by Carl Meyer and Vladimir Matveev in :pep:`709`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:426 +msgid "Improved Error Messages" +msgstr "" + +#: ../../whatsnew/3.12.rst:428 msgid "" -"CPython 3.12 now supports the ability to monitor calls, returns, lines, " -"exceptions and other events using instrumentation. This means that you only " -"pay for what you use, providing support for near-zero overhead debuggers and " -"coverage tools." +"Modules from the standard library are now potentially suggested as part of " +"the error messages displayed by the interpreter when a :exc:`NameError` is " +"raised to the top level. (Contributed by Pablo Galindo in :gh:`98254`.)" msgstr "" -#: ../../whatsnew/3.12.rst:331 -msgid "See :mod:`sys.monitoring` for details." +#: ../../whatsnew/3.12.rst:437 +msgid "" +"Improve the error suggestion for :exc:`NameError` exceptions for instances. " +"Now if a :exc:`NameError` is raised in a method and the instance has an " +"attribute that's exactly equal to the name in the exception, the suggestion " +"will include ``self.`` instead of the closest match in the method " +"scope. (Contributed by Pablo Galindo in :gh:`99139`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:457 +msgid "" +"Improve the :exc:`SyntaxError` error message when the user types ``import x " +"from y`` instead of ``from y import x``. (Contributed by Pablo Galindo in :" +"gh:`98931`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:467 +msgid "" +":exc:`ImportError` exceptions raised from failed ``from import " +"`` statements now include suggestions for the value of ```` " +"based on the available names in ````. (Contributed by Pablo Galindo " +"in :gh:`91058`.)" msgstr "" -#: ../../whatsnew/3.12.rst:335 +#: ../../whatsnew/3.12.rst:478 msgid "New Features Related to Type Hints" msgstr "" -#: ../../whatsnew/3.12.rst:337 +#: ../../whatsnew/3.12.rst:480 msgid "" -"This section covers major changes affecting :pep:`484` type hints and the :" +"This section covers major changes affecting :pep:`type hints <484>` and the :" "mod:`typing` module." msgstr "" -#: ../../whatsnew/3.12.rst:343 +#: ../../whatsnew/3.12.rst:486 msgid "PEP 692: Using ``TypedDict`` for more precise ``**kwargs`` typing" msgstr "" -#: ../../whatsnew/3.12.rst:345 +#: ../../whatsnew/3.12.rst:488 msgid "" "Typing ``**kwargs`` in a function signature as introduced by :pep:`484` " "allowed for valid annotations only in cases where all of the ``**kwargs`` " "were of the same type." msgstr "" -#: ../../whatsnew/3.12.rst:349 +#: ../../whatsnew/3.12.rst:492 msgid "" -"This PEP specifies a more precise way of typing ``**kwargs`` by relying on " +":pep:`692` specifies a more precise way of typing ``**kwargs`` by relying on " "typed dictionaries::" msgstr "" -#: ../../whatsnew/3.12.rst:360 +#: ../../whatsnew/3.12.rst:503 msgid "See :pep:`692` for more details." msgstr "" -#: ../../whatsnew/3.12.rst:362 +#: ../../whatsnew/3.12.rst:505 msgid "(Contributed by Franek Magiera in :gh:`103629`.)" msgstr "(由 Franek Magiera 於 :gh:`103629` 中貢獻。)" -#: ../../whatsnew/3.12.rst:367 +#: ../../whatsnew/3.12.rst:510 msgid "PEP 698: Override Decorator for Static Typing" msgstr "" -#: ../../whatsnew/3.12.rst:369 +#: ../../whatsnew/3.12.rst:512 msgid "" "A new decorator :func:`typing.override` has been added to the :mod:`typing` " "module. It indicates to type checkers that the method is intended to " @@ -402,138 +614,73 @@ msgid "" "class does not in fact do so." msgstr "" -#: ../../whatsnew/3.12.rst:375 +#: ../../whatsnew/3.12.rst:518 msgid "Example::" msgstr "" -#: ../../whatsnew/3.12.rst:393 -msgid "(Contributed by Steven Troxler in :gh:`101561`.)" -msgstr "(由 Steven Troxler 於 :gh:`101561` 中貢獻。)" - -#: ../../whatsnew/3.12.rst:398 -msgid "PEP 695: Type Parameter Syntax" -msgstr "" - -#: ../../whatsnew/3.12.rst:400 -msgid "" -"Generic classes and functions under :pep:`484` were declared using a verbose " -"syntax that left the scope of type parameters unclear and required explicit " -"declarations of variance." -msgstr "" - -#: ../../whatsnew/3.12.rst:404 -msgid "" -":pep:`695` introduces a new, more compact and explicit way to create :ref:" -"`generic classes ` and :ref:`functions `::" -msgstr "" - -#: ../../whatsnew/3.12.rst:417 -msgid "" -"In addition, the PEP introduces a new way to declare :ref:`type aliases " -"` using the :keyword:`type` statement, which creates an " -"instance of :class:`~typing.TypeAliasType`::" -msgstr "" - -#: ../../whatsnew/3.12.rst:423 -msgid "Type aliases can also be :ref:`generic `::" +#: ../../whatsnew/3.12.rst:536 +msgid "See :pep:`698` for more details." msgstr "" -#: ../../whatsnew/3.12.rst:427 -msgid "" -"The new syntax allows declaring :class:`~typing.TypeVarTuple` and :class:" -"`~typing.ParamSpec` parameters, as well as :class:`~typing.TypeVar` " -"parameters with bounds or constraints::" -msgstr "" - -#: ../../whatsnew/3.12.rst:436 -msgid "" -"The value of type aliases and the bound and constraints of type variables " -"created through this syntax are evaluated only on demand (see :ref:`lazy-" -"evaluation`). This means type aliases are able to refer to other types " -"defined later in the file." -msgstr "" - -#: ../../whatsnew/3.12.rst:441 -msgid "" -"Type parameters declared through a type parameter list are visible within " -"the scope of the declaration and any nested scopes, but not in the outer " -"scope. For example, they can be used in the type annotations for the methods " -"of a generic class or in the class body. However, they cannot be used in the " -"module scope after the class is defined. See :ref:`type-params` for a " -"detailed description of the runtime semantics of type parameters." -msgstr "" - -#: ../../whatsnew/3.12.rst:448 -msgid "" -"In order to support these scoping semantics, a new kind of scope is " -"introduced, the :ref:`annotation scope `. Annotation " -"scopes behave for the most part like function scopes, but interact " -"differently with enclosing class scopes. In Python 3.13, :term:`annotations " -"` will also be evaluated in annotation scopes." -msgstr "" - -#: ../../whatsnew/3.12.rst:454 -msgid "See :pep:`695` for more details." -msgstr "詳情請見 :pep:`695`。" - -#: ../../whatsnew/3.12.rst:456 -msgid "" -"(PEP written by Eric Traut. Implementation by Jelle Zijlstra, Eric Traut, " -"and others in :gh:`103764`.)" -msgstr "" +#: ../../whatsnew/3.12.rst:538 +msgid "(Contributed by Steven Troxler in :gh:`101561`.)" +msgstr "(由 Steven Troxler 於 :gh:`101561` 中貢獻。)" -#: ../../whatsnew/3.12.rst:460 +#: ../../whatsnew/3.12.rst:541 msgid "Other Language Changes" msgstr "其他語言更動" -#: ../../whatsnew/3.12.rst:462 +#: ../../whatsnew/3.12.rst:543 msgid "" -"Add :ref:`perf_profiling` through the new environment variable :envvar:" -"`PYTHONPERFSUPPORT`, the new command-line option :option:`-X perf <-X>`, as " -"well as the new :func:`sys.activate_stack_trampoline`, :func:`sys." -"deactivate_stack_trampoline`, and :func:`sys.is_stack_trampoline_active` " -"APIs. (Design by Pablo Galindo. Contributed by Pablo Galindo and Christian " -"Heimes with contributions from Gregory P. Smith [Google] and Mark Shannon " -"in :gh:`96123`.)" +"The parser now raises :exc:`SyntaxError` when parsing source code containing " +"null bytes. (Contributed by Pablo Galindo in :gh:`96670`.)" msgstr "" -#: ../../whatsnew/3.12.rst:472 -msgid "" -"The extraction methods in :mod:`tarfile`, and :func:`shutil.unpack_archive`, " -"have a new a *filter* argument that allows limiting tar features than may be " -"surprising or dangerous, such as creating files outside the destination " -"directory. See :ref:`tarfile-extraction-filter` for details. In Python 3.14, " -"the default will switch to ``'data'``. (Contributed by Petr Viktorin in :pep:" -"`706`.)" +#: ../../whatsnew/3.12.rst:546 +msgid "" +"A backslash-character pair that is not a valid escape sequence now generates " +"a :exc:`SyntaxWarning`, instead of :exc:`DeprecationWarning`. For example, " +"``re.compile(\"\\d+\\.\\d+\")`` now emits a :exc:`SyntaxWarning` " +"(``\"\\d\"`` is an invalid escape sequence, use raw strings for regular " +"expression: ``re.compile(r\"\\d+\\.\\d+\")``). In a future Python version, :" +"exc:`SyntaxError` will eventually be raised, instead of :exc:" +"`SyntaxWarning`. (Contributed by Victor Stinner in :gh:`98401`.)" msgstr "" -#: ../../whatsnew/3.12.rst:480 +#: ../../whatsnew/3.12.rst:555 msgid "" -":class:`types.MappingProxyType` instances are now hashable if the underlying " -"mapping is hashable. (Contributed by Serhiy Storchaka in :gh:`87995`.)" +"Octal escapes with value larger than ``0o377`` (ex: ``\"\\477\"``), " +"deprecated in Python 3.11, now produce a :exc:`SyntaxWarning`, instead of :" +"exc:`DeprecationWarning`. In a future Python version they will be eventually " +"a :exc:`SyntaxError`. (Contributed by Victor Stinner in :gh:`98401`.)" msgstr "" -#: ../../whatsnew/3.12.rst:484 +#: ../../whatsnew/3.12.rst:561 msgid "" -":class:`memoryview` now supports the half-float type (the \"e\" format " -"code). (Contributed by Dong-hee Na and Antoine Pitrou in :gh:`90751`.)" +"Variables used in the target part of comprehensions that are not stored to " +"can now be used in assignment expressions (``:=``). For example, in ``[(b := " +"1) for a, b.prop in some_iter]``, the assignment to ``b`` is now allowed. " +"Note that assigning to variables stored to in the target part of " +"comprehensions (like ``a``) is still disallowed, as per :pep:`572`. " +"(Contributed by Nikita Sobolev in :gh:`100581`.)" msgstr "" -#: ../../whatsnew/3.12.rst:487 +#: ../../whatsnew/3.12.rst:568 msgid "" -"The parser now raises :exc:`SyntaxError` when parsing source code containing " -"null bytes. (Contributed by Pablo Galindo in :gh:`96670`.)" +"Exceptions raised in a class or type's ``__set_name__`` method are no longer " +"wrapped by a :exc:`RuntimeError`. Context information is added to the " +"exception as a :pep:`678` note. (Contributed by Irit Katriel in :gh:`77757`.)" msgstr "" -#: ../../whatsnew/3.12.rst:490 +#: ../../whatsnew/3.12.rst:572 msgid "" -":func:`ast.parse` now raises :exc:`SyntaxError` instead of :exc:`ValueError` " -"when parsing source code containing null bytes. (Contributed by Pablo " -"Galindo in :gh:`96670`.)" +"When a ``try-except*`` construct handles the entire :exc:`ExceptionGroup` " +"and raises one other exception, that exception is no longer wrapped in an :" +"exc:`ExceptionGroup`. Also changed in version 3.11.4. (Contributed by Irit " +"Katriel in :gh:`103590`.)" msgstr "" -#: ../../whatsnew/3.12.rst:494 +#: ../../whatsnew/3.12.rst:577 msgid "" "The Garbage Collector now runs only on the eval breaker mechanism of the " "Python bytecode evaluation loop instead of object allocations. The GC can " @@ -543,98 +690,94 @@ msgid "" "`97922`.)" msgstr "" -#: ../../whatsnew/3.12.rst:501 -msgid "" -"A backslash-character pair that is not a valid escape sequence now generates " -"a :exc:`SyntaxWarning`, instead of :exc:`DeprecationWarning`. For example, " -"``re.compile(\"\\d+\\.\\d+\")`` now emits a :exc:`SyntaxWarning` " -"(``\"\\d\"`` is an invalid escape sequence), use raw strings for regular " -"expression: ``re.compile(r\"\\d+\\.\\d+\")``. In a future Python version, :" -"exc:`SyntaxError` will eventually be raised, instead of :exc:" -"`SyntaxWarning`. (Contributed by Victor Stinner in :gh:`98401`.)" -msgstr "" - -#: ../../whatsnew/3.12.rst:510 -msgid "" -"Octal escapes with value larger than ``0o377`` (ex: ``\"\\477\"``), " -"deprecated in Python 3.11, now produce a :exc:`SyntaxWarning`, instead of :" -"exc:`DeprecationWarning`. In a future Python version they will be eventually " -"a :exc:`SyntaxError`. (Contributed by Victor Stinner in :gh:`98401`.)" -msgstr "" - -#: ../../whatsnew/3.12.rst:516 +#: ../../whatsnew/3.12.rst:584 msgid "" "All builtin and extension callables expecting boolean parameters now accept " "arguments of any type instead of just :class:`bool` and :class:`int`. " "(Contributed by Serhiy Storchaka in :gh:`60203`.)" msgstr "" -#: ../../whatsnew/3.12.rst:520 +#: ../../whatsnew/3.12.rst:588 msgid "" -"Variables used in the target part of comprehensions that are not stored to " -"can now be used in assignment expressions (``:=``). For example, in ``[(b := " -"1) for a, b.prop in some_iter]``, the assignment to ``b`` is now allowed. " -"Note that assigning to variables stored to in the target part of " -"comprehensions (like ``a``) is still disallowed, as per :pep:`572`. " -"(Contributed by Nikita Sobolev in :gh:`100581`.)" +":class:`memoryview` now supports the half-float type (the \"e\" format " +"code). (Contributed by Donghee Na and Antoine Pitrou in :gh:`90751`.)" msgstr "" -#: ../../whatsnew/3.12.rst:527 +#: ../../whatsnew/3.12.rst:591 msgid "" ":class:`slice` objects are now hashable, allowing them to be used as dict " "keys and set items. (Contributed by Will Bradshaw, Furkan Onder, and Raymond " "Hettinger in :gh:`101264`.)" msgstr "" -#: ../../whatsnew/3.12.rst:530 +#: ../../whatsnew/3.12.rst:594 msgid "" -":func:`sum` now uses Neumaier summation to improve accuracy when summing " -"floats or mixed ints and floats. (Contributed by Raymond Hettinger in :gh:" -"`100425`.)" +":func:`sum` now uses Neumaier summation to improve accuracy and " +"commutativity when summing floats or mixed ints and floats. (Contributed by " +"Raymond Hettinger in :gh:`100425`.)" msgstr "" -#: ../../whatsnew/3.12.rst:534 +#: ../../whatsnew/3.12.rst:598 msgid "" -"Exceptions raised in a typeobject's ``__set_name__`` method are no longer " -"wrapped by a :exc:`RuntimeError`. Context information is added to the " -"exception as a :pep:`678` note. (Contributed by Irit Katriel in :gh:`77757`.)" +":func:`ast.parse` now raises :exc:`SyntaxError` instead of :exc:`ValueError` " +"when parsing source code containing null bytes. (Contributed by Pablo " +"Galindo in :gh:`96670`.)" msgstr "" -#: ../../whatsnew/3.12.rst:538 +#: ../../whatsnew/3.12.rst:602 msgid "" -"When a ``try-except*`` construct handles the entire :exc:`ExceptionGroup` " -"and raises one other exception, that exception is no longer wrapped in an :" -"exc:`ExceptionGroup`. Also changed in version 3.11.4. (Contributed by Irit " -"Katriel in :gh:`103590`.)" +"The extraction methods in :mod:`tarfile`, and :func:`shutil.unpack_archive`, " +"have a new a *filter* argument that allows limiting tar features than may be " +"surprising or dangerous, such as creating files outside the destination " +"directory. See :ref:`tarfile extraction filters ` " +"for details. In Python 3.14, the default will switch to ``'data'``. " +"(Contributed by Petr Viktorin in :pep:`706`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:610 +msgid "" +":class:`types.MappingProxyType` instances are now hashable if the underlying " +"mapping is hashable. (Contributed by Serhiy Storchaka in :gh:`87995`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:614 +msgid "" +"Add :ref:`support for the perf profiler ` through the new " +"environment variable :envvar:`PYTHONPERFSUPPORT` and command-line option :" +"option:`-X perf <-X>`, as well as the new :func:`sys." +"activate_stack_trampoline`, :func:`sys.deactivate_stack_trampoline`, and :" +"func:`sys.is_stack_trampoline_active` functions. (Design by Pablo Galindo. " +"Contributed by Pablo Galindo and Christian Heimes with contributions from " +"Gregory P. Smith [Google] and Mark Shannon in :gh:`96123`.)" msgstr "" -#: ../../whatsnew/3.12.rst:545 +#: ../../whatsnew/3.12.rst:626 msgid "New Modules" msgstr "" -#: ../../whatsnew/3.12.rst:547 +#: ../../whatsnew/3.12.rst:628 msgid "None." msgstr "" -#: ../../whatsnew/3.12.rst:551 +#: ../../whatsnew/3.12.rst:632 msgid "Improved Modules" msgstr "" -#: ../../whatsnew/3.12.rst:554 +#: ../../whatsnew/3.12.rst:635 msgid "array" msgstr "array" -#: ../../whatsnew/3.12.rst:556 +#: ../../whatsnew/3.12.rst:637 msgid "" "The :class:`array.array` class now supports subscripting, making it a :term:" "`generic type`. (Contributed by Jelle Zijlstra in :gh:`98658`.)" msgstr "" -#: ../../whatsnew/3.12.rst:560 +#: ../../whatsnew/3.12.rst:641 msgid "asyncio" msgstr "asyncio" -#: ../../whatsnew/3.12.rst:562 +#: ../../whatsnew/3.12.rst:643 msgid "" "The performance of writing to sockets in :mod:`asyncio` has been " "significantly improved. ``asyncio`` now avoids unnecessary copying when " @@ -642,140 +785,134 @@ msgid "" "supports it. (Contributed by Kumar Aditya in :gh:`91166`.)" msgstr "" -#: ../../whatsnew/3.12.rst:567 +#: ../../whatsnew/3.12.rst:648 msgid "" -"Added :func:`asyncio.eager_task_factory` and :func:`asyncio." +"Add :func:`asyncio.eager_task_factory` and :func:`asyncio." "create_eager_task_factory` functions to allow opting an event loop in to " "eager task execution, making some use-cases 2x to 5x faster. (Contributed by " -"Jacob Bower & Itamar O in :gh:`102853`, :gh:`104140`, and :gh:`104138`)" +"Jacob Bower & Itamar Oren in :gh:`102853`, :gh:`104140`, and :gh:`104138`)" msgstr "" -#: ../../whatsnew/3.12.rst:572 +#: ../../whatsnew/3.12.rst:653 msgid "" -"On Linux, :mod:`asyncio` uses :class:`~asyncio.PidfdChildWatcher` by default " +"On Linux, :mod:`asyncio` uses :class:`asyncio.PidfdChildWatcher` by default " "if :func:`os.pidfd_open` is available and functional instead of :class:" -"`~asyncio.ThreadedChildWatcher`. (Contributed by Kumar Aditya in :gh:" -"`98024`.)" -msgstr "" - -#: ../../whatsnew/3.12.rst:577 -msgid "" -"The child watcher classes :class:`~asyncio.MultiLoopChildWatcher`, :class:" -"`~asyncio.FastChildWatcher`, :class:`~asyncio.AbstractChildWatcher` and :" -"class:`~asyncio.SafeChildWatcher` are deprecated and will be removed in " -"Python 3.14. It is recommended to not manually configure a child watcher as " -"the event loop now uses the best available child watcher for each platform (:" -"class:`~asyncio.PidfdChildWatcher` if supported and :class:`~asyncio." -"ThreadedChildWatcher` otherwise). (Contributed by Kumar Aditya in :gh:" -"`94597`.)" +"`asyncio.ThreadedChildWatcher`. (Contributed by Kumar Aditya in :gh:`98024`.)" msgstr "" -#: ../../whatsnew/3.12.rst:586 +#: ../../whatsnew/3.12.rst:658 msgid "" -":func:`asyncio.set_child_watcher`, :func:`asyncio.get_child_watcher`, :meth:" -"`asyncio.AbstractEventLoopPolicy.set_child_watcher` and :meth:`asyncio." -"AbstractEventLoopPolicy.get_child_watcher` are deprecated and will be " -"removed in Python 3.14. (Contributed by Kumar Aditya in :gh:`94597`.)" +"The event loop now uses the best available child watcher for each platform (:" +"class:`asyncio.PidfdChildWatcher` if supported and :class:`asyncio." +"ThreadedChildWatcher` otherwise), so manually configuring a child watcher is " +"not recommended. (Contributed by Kumar Aditya in :gh:`94597`.)" msgstr "" -#: ../../whatsnew/3.12.rst:592 +#: ../../whatsnew/3.12.rst:664 msgid "" "Add *loop_factory* parameter to :func:`asyncio.run` to allow specifying a " "custom event loop factory. (Contributed by Kumar Aditya in :gh:`99388`.)" msgstr "" -#: ../../whatsnew/3.12.rst:596 +#: ../../whatsnew/3.12.rst:668 msgid "" "Add C implementation of :func:`asyncio.current_task` for 4x-6x speedup. " -"(Contributed by Itamar Ostricher and Pranav Thulasiram Bhat in :gh:`100344`.)" +"(Contributed by Itamar Oren and Pranav Thulasiram Bhat in :gh:`100344`.)" msgstr "" -#: ../../whatsnew/3.12.rst:599 +#: ../../whatsnew/3.12.rst:671 msgid "" ":func:`asyncio.iscoroutine` now returns ``False`` for generators as :mod:" "`asyncio` does not support legacy generator-based coroutines. (Contributed " "by Kumar Aditya in :gh:`102748`.)" msgstr "" -#: ../../whatsnew/3.12.rst:603 +#: ../../whatsnew/3.12.rst:675 msgid "" ":func:`asyncio.wait` and :func:`asyncio.as_completed` now accepts generators " "yielding tasks. (Contributed by Kumar Aditya in :gh:`78530`.)" msgstr "" -#: ../../whatsnew/3.12.rst:608 +#: ../../whatsnew/3.12.rst:680 msgid "calendar" msgstr "calendar" -#: ../../whatsnew/3.12.rst:610 +#: ../../whatsnew/3.12.rst:682 msgid "" -"Add enums :data:`~calendar.Month` and :data:`~calendar.Day`. (Contributed by " -"Prince Roshan in :gh:`103636`.)" +"Add enums :data:`calendar.Month` and :data:`calendar.Day` defining months of " +"the year and days of the week. (Contributed by Prince Roshan in :gh:" +"`103636`.)" msgstr "" -#: ../../whatsnew/3.12.rst:614 +#: ../../whatsnew/3.12.rst:687 msgid "csv" msgstr "csv" -#: ../../whatsnew/3.12.rst:616 +#: ../../whatsnew/3.12.rst:689 msgid "" -"Add :const:`~csv.QUOTE_NOTNULL` and :const:`~csv.QUOTE_STRINGS` flags to " -"provide finer grained control of ``None`` and empty strings by :class:`~csv." +"Add :const:`csv.QUOTE_NOTNULL` and :const:`csv.QUOTE_STRINGS` flags to " +"provide finer grained control of ``None`` and empty strings by :class:`csv." "writer` objects." msgstr "" -#: ../../whatsnew/3.12.rst:621 +#: ../../whatsnew/3.12.rst:694 msgid "dis" msgstr "dis" -#: ../../whatsnew/3.12.rst:623 +#: ../../whatsnew/3.12.rst:696 msgid "" "Pseudo instruction opcodes (which are used by the compiler but do not appear " "in executable bytecode) are now exposed in the :mod:`dis` module. :opcode:" "`HAVE_ARGUMENT` is still relevant to real opcodes, but it is not useful for " -"pseudo instructions. Use the new :data:`~dis.hasarg` collection instead. " +"pseudo instructions. Use the new :data:`dis.hasarg` collection instead. " "(Contributed by Irit Katriel in :gh:`94216`.)" msgstr "" -#: ../../whatsnew/3.12.rst:632 +#: ../../whatsnew/3.12.rst:704 +msgid "" +"Add the :data:`dis.hasexc` collection to signify instructions that set an " +"exception handler. (Contributed by Irit Katriel in :gh:`94216`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:708 msgid "fractions" msgstr "fractions" -#: ../../whatsnew/3.12.rst:634 +#: ../../whatsnew/3.12.rst:710 msgid "" "Objects of type :class:`fractions.Fraction` now support float-style " "formatting. (Contributed by Mark Dickinson in :gh:`100161`.)" msgstr "" -#: ../../whatsnew/3.12.rst:638 +#: ../../whatsnew/3.12.rst:714 msgid "importlib.resources" msgstr "" -#: ../../whatsnew/3.12.rst:640 +#: ../../whatsnew/3.12.rst:716 msgid "" ":func:`importlib.resources.as_file` now supports resource directories. " "(Contributed by Jason R. Coombs in :gh:`97930`.)" msgstr "" -#: ../../whatsnew/3.12.rst:644 +#: ../../whatsnew/3.12.rst:720 msgid "inspect" msgstr "inspect" -#: ../../whatsnew/3.12.rst:646 +#: ../../whatsnew/3.12.rst:722 msgid "" "Add :func:`inspect.markcoroutinefunction` to mark sync functions that return " "a :term:`coroutine` for use with :func:`inspect.iscoroutinefunction`. " "(Contributed Carlton Gibson in :gh:`99247`.)" msgstr "" -#: ../../whatsnew/3.12.rst:650 +#: ../../whatsnew/3.12.rst:726 msgid "" "Add :func:`inspect.getasyncgenstate` and :func:`inspect.getasyncgenlocals` " "for determining the current state of asynchronous generators. (Contributed " -"by Thomas Krennwallner in :issue:`35759`.)" +"by Thomas Krennwallner in :gh:`79940`.)" msgstr "" -#: ../../whatsnew/3.12.rst:654 +#: ../../whatsnew/3.12.rst:730 msgid "" "The performance of :func:`inspect.getattr_static` has been considerably " "improved. Most calls to the function should be at least 2x faster than they " @@ -783,60 +920,60 @@ msgid "" "Waygood in :gh:`103193`.)" msgstr "" -#: ../../whatsnew/3.12.rst:660 +#: ../../whatsnew/3.12.rst:736 msgid "itertools" msgstr "itertools" -#: ../../whatsnew/3.12.rst:662 +#: ../../whatsnew/3.12.rst:738 msgid "" -"Added :class:`itertools.batched()` for collecting into even-sized tuples " -"where the last batch may be shorter than the rest. (Contributed by Raymond " +"Add :class:`itertools.batched()` for collecting into even-sized tuples where " +"the last batch may be shorter than the rest. (Contributed by Raymond " "Hettinger in :gh:`98363`.)" msgstr "" -#: ../../whatsnew/3.12.rst:667 +#: ../../whatsnew/3.12.rst:743 msgid "math" msgstr "math" -#: ../../whatsnew/3.12.rst:669 +#: ../../whatsnew/3.12.rst:745 msgid "" -"Added :func:`math.sumprod` for computing a sum of products. (Contributed by " +"Add :func:`math.sumprod` for computing a sum of products. (Contributed by " "Raymond Hettinger in :gh:`100485`.)" msgstr "" -#: ../../whatsnew/3.12.rst:672 +#: ../../whatsnew/3.12.rst:748 msgid "" -"Extended :func:`math.nextafter` to include a *steps* argument for moving up " -"or down multiple steps at a time. (By Matthias Goergens, Mark Dickinson, and " +"Extend :func:`math.nextafter` to include a *steps* argument for moving up or " +"down multiple steps at a time. (By Matthias Goergens, Mark Dickinson, and " "Raymond Hettinger in :gh:`94906`.)" msgstr "" -#: ../../whatsnew/3.12.rst:677 +#: ../../whatsnew/3.12.rst:753 msgid "os" msgstr "os" -#: ../../whatsnew/3.12.rst:679 +#: ../../whatsnew/3.12.rst:755 msgid "" "Add :const:`os.PIDFD_NONBLOCK` to open a file descriptor for a process with :" "func:`os.pidfd_open` in non-blocking mode. (Contributed by Kumar Aditya in :" "gh:`93312`.)" msgstr "" -#: ../../whatsnew/3.12.rst:683 +#: ../../whatsnew/3.12.rst:759 msgid "" ":class:`os.DirEntry` now includes an :meth:`os.DirEntry.is_junction` method " "to check if the entry is a junction. (Contributed by Charles Machalow in :gh:" "`99547`.)" msgstr "" -#: ../../whatsnew/3.12.rst:687 +#: ../../whatsnew/3.12.rst:763 msgid "" "Add :func:`os.listdrives`, :func:`os.listvolumes` and :func:`os.listmounts` " "functions on Windows for enumerating drives, volumes and mount points. " "(Contributed by Steve Dower in :gh:`102519`.)" msgstr "" -#: ../../whatsnew/3.12.rst:691 +#: ../../whatsnew/3.12.rst:767 msgid "" ":func:`os.stat` and :func:`os.lstat` are now more accurate on Windows. The " "``st_birthtime`` field will now be filled with the creation time of the " @@ -849,56 +986,56 @@ msgid "" "`99726`.)" msgstr "" -#: ../../whatsnew/3.12.rst:702 +#: ../../whatsnew/3.12.rst:778 msgid "os.path" msgstr "os.path" -#: ../../whatsnew/3.12.rst:704 +#: ../../whatsnew/3.12.rst:780 msgid "" "Add :func:`os.path.isjunction` to check if a given path is a junction. " "(Contributed by Charles Machalow in :gh:`99547`.)" msgstr "" -#: ../../whatsnew/3.12.rst:707 +#: ../../whatsnew/3.12.rst:783 msgid "" "Add :func:`os.path.splitroot` to split a path into a triad ``(drive, root, " "tail)``. (Contributed by Barney Gale in :gh:`101000`.)" msgstr "" -#: ../../whatsnew/3.12.rst:711 +#: ../../whatsnew/3.12.rst:787 msgid "pathlib" msgstr "pathlib" -#: ../../whatsnew/3.12.rst:713 +#: ../../whatsnew/3.12.rst:789 msgid "" -"Add support for subclassing :class:`pathlib.PurePath` and :class:`~pathlib." +"Add support for subclassing :class:`pathlib.PurePath` and :class:`pathlib." "Path`, plus their Posix- and Windows-specific variants. Subclasses may " -"override the :meth:`~pathlib.PurePath.with_segments` method to pass " +"override the :meth:`pathlib.PurePath.with_segments` method to pass " "information between path instances." msgstr "" -#: ../../whatsnew/3.12.rst:718 +#: ../../whatsnew/3.12.rst:794 msgid "" -"Add :meth:`~pathlib.Path.walk` for walking the directory trees and " -"generating all file or directory names within them, similar to :func:`os." -"walk`. (Contributed by Stanislav Zmiev in :gh:`90385`.)" +"Add :meth:`pathlib.Path.walk` for walking the directory trees and generating " +"all file or directory names within them, similar to :func:`os.walk`. " +"(Contributed by Stanislav Zmiev in :gh:`90385`.)" msgstr "" -#: ../../whatsnew/3.12.rst:722 +#: ../../whatsnew/3.12.rst:798 msgid "" "Add *walk_up* optional parameter to :meth:`pathlib.PurePath.relative_to` to " "allow the insertion of ``..`` entries in the result; this behavior is more " "consistent with :func:`os.path.relpath`. (Contributed by Domenico Ragusa in :" -"issue:`40358`.)" +"gh:`84538`.)" msgstr "" -#: ../../whatsnew/3.12.rst:727 +#: ../../whatsnew/3.12.rst:803 msgid "" "Add :meth:`pathlib.Path.is_junction` as a proxy to :func:`os.path." "isjunction`. (Contributed by Charles Machalow in :gh:`99547`.)" msgstr "" -#: ../../whatsnew/3.12.rst:730 +#: ../../whatsnew/3.12.rst:806 msgid "" "Add *case_sensitive* optional parameter to :meth:`pathlib.Path.glob`, :meth:" "`pathlib.Path.rglob` and :meth:`pathlib.PurePath.match` for matching the " @@ -906,38 +1043,38 @@ msgid "" "process." msgstr "" -#: ../../whatsnew/3.12.rst:735 +#: ../../whatsnew/3.12.rst:811 msgid "pdb" msgstr "pdb" -#: ../../whatsnew/3.12.rst:737 +#: ../../whatsnew/3.12.rst:813 msgid "" "Add convenience variables to hold values temporarily for debug session and " "provide quick access to values like the current frame or the return value. " "(Contributed by Tian Gao in :gh:`103693`.)" msgstr "" -#: ../../whatsnew/3.12.rst:743 +#: ../../whatsnew/3.12.rst:819 msgid "random" msgstr "random" -#: ../../whatsnew/3.12.rst:745 +#: ../../whatsnew/3.12.rst:821 msgid "" -"Added :func:`random.binomialvariate`. (Contributed by Raymond Hettinger in :" -"gh:`81620`.)" +"Add :func:`random.binomialvariate`. (Contributed by Raymond Hettinger in :gh:" +"`81620`.)" msgstr "" -#: ../../whatsnew/3.12.rst:748 +#: ../../whatsnew/3.12.rst:824 msgid "" -"Added a default of ``lamb=1.0`` to :func:`random.expovariate`. (Contributed " +"Add a default of ``lambd=1.0`` to :func:`random.expovariate`. (Contributed " "by Raymond Hettinger in :gh:`100234`.)" msgstr "" -#: ../../whatsnew/3.12.rst:752 +#: ../../whatsnew/3.12.rst:828 msgid "shutil" msgstr "shutil" -#: ../../whatsnew/3.12.rst:754 +#: ../../whatsnew/3.12.rst:830 msgid "" ":func:`shutil.make_archive` now passes the *root_dir* argument to custom " "archivers which support it. In this case it no longer temporarily changes " @@ -945,7 +1082,7 @@ msgid "" "archiving. (Contributed by Serhiy Storchaka in :gh:`74696`.)" msgstr "" -#: ../../whatsnew/3.12.rst:760 +#: ../../whatsnew/3.12.rst:836 msgid "" ":func:`shutil.rmtree` now accepts a new argument *onexc* which is an error " "handler like *onerror* but which expects an exception instance rather than a " @@ -953,14 +1090,14 @@ msgid "" "Python 3.14. (Contributed by Irit Katriel in :gh:`102828`.)" msgstr "" -#: ../../whatsnew/3.12.rst:766 +#: ../../whatsnew/3.12.rst:842 msgid "" ":func:`shutil.which` now consults the *PATHEXT* environment variable to find " "matches within *PATH* on Windows even when the given *cmd* includes a " "directory component. (Contributed by Charles Machalow in :gh:`103179`.)" msgstr "" -#: ../../whatsnew/3.12.rst:771 +#: ../../whatsnew/3.12.rst:847 msgid "" ":func:`shutil.which` will call ``NeedCurrentDirectoryForExePathW`` when " "querying for executables on Windows to determine if the current working " @@ -968,61 +1105,68 @@ msgid "" "Machalow in :gh:`103179`.)" msgstr "" -#: ../../whatsnew/3.12.rst:776 +#: ../../whatsnew/3.12.rst:852 msgid "" ":func:`shutil.which` will return a path matching the *cmd* with a component " "from ``PATHEXT`` prior to a direct match elsewhere in the search path on " "Windows. (Contributed by Charles Machalow in :gh:`103179`.)" msgstr "" -#: ../../whatsnew/3.12.rst:782 ../../whatsnew/3.12.rst:1461 +#: ../../whatsnew/3.12.rst:858 ../../whatsnew/3.12.rst:1637 msgid "sqlite3" msgstr "sqlite3" -#: ../../whatsnew/3.12.rst:784 +#: ../../whatsnew/3.12.rst:860 msgid "" "Add a :ref:`command-line interface `. (Contributed by Erlend E. " "Aasland in :gh:`77617`.)" msgstr "" -#: ../../whatsnew/3.12.rst:787 +#: ../../whatsnew/3.12.rst:863 msgid "" -"Add the :attr:`~sqlite3.Connection.autocommit` attribute to :class:`~sqlite3." -"Connection` and the *autocommit* parameter to :func:`~sqlite3.connect` to " +"Add the :attr:`sqlite3.Connection.autocommit` attribute to :class:`sqlite3." +"Connection` and the *autocommit* parameter to :func:`sqlite3.connect` to " "control :pep:`249`-compliant :ref:`transaction handling `. (Contributed by Erlend E. Aasland in :gh:`83638`.)" msgstr "" -#: ../../whatsnew/3.12.rst:794 +#: ../../whatsnew/3.12.rst:870 msgid "" -"Add *entrypoint* keyword-only parameter to :meth:`~sqlite3.Connection." +"Add *entrypoint* keyword-only parameter to :meth:`sqlite3.Connection." "load_extension`, for overriding the SQLite extension entry point. " "(Contributed by Erlend E. Aasland in :gh:`103015`.)" msgstr "" -#: ../../whatsnew/3.12.rst:799 +#: ../../whatsnew/3.12.rst:875 msgid "" -"Add :meth:`~sqlite3.Connection.getconfig` and :meth:`~sqlite3.Connection." -"setconfig` to :class:`~sqlite3.Connection` to make configuration changes to " -"a database connection. (Contributed by Erlend E. Aasland in :gh:`103489`.)" +"Add :meth:`sqlite3.Connection.getconfig` and :meth:`sqlite3.Connection." +"setconfig` to :class:`sqlite3.Connection` to make configuration changes to a " +"database connection. (Contributed by Erlend E. Aasland in :gh:`103489`.)" msgstr "" -#: ../../whatsnew/3.12.rst:805 +#: ../../whatsnew/3.12.rst:881 msgid "statistics" msgstr "statistics" -#: ../../whatsnew/3.12.rst:807 +#: ../../whatsnew/3.12.rst:883 msgid "" -"Extended :func:`statistics.correlation` to include as a ``ranked`` method " -"for computing the Spearman correlation of ranked data. (Contributed by " -"Raymond Hettinger in :gh:`95861`.)" +"Extend :func:`statistics.correlation` to include as a ``ranked`` method for " +"computing the Spearman correlation of ranked data. (Contributed by Raymond " +"Hettinger in :gh:`95861`.)" msgstr "" -#: ../../whatsnew/3.12.rst:812 +#: ../../whatsnew/3.12.rst:888 msgid "sys" msgstr "sys" -#: ../../whatsnew/3.12.rst:814 +#: ../../whatsnew/3.12.rst:890 +msgid "" +"Add the :mod:`sys.monitoring` namespace to expose the new :ref:`PEP 669 " +"` monitoring API. (Contributed by Mark Shannon in :gh:" +"`103082`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:894 msgid "" "Add :func:`sys.activate_stack_trampoline` and :func:`sys." "deactivate_stack_trampoline` for activating and deactivating stack profiler " @@ -1032,7 +1176,7 @@ msgid "" "Shannon in :gh:`96123`.)" msgstr "" -#: ../../whatsnew/3.12.rst:823 +#: ../../whatsnew/3.12.rst:903 msgid "" "Add :data:`sys.last_exc` which holds the last unhandled exception that was " "raised (for post-mortem debugging use cases). Deprecate the three fields " @@ -1041,14 +1185,14 @@ msgid "" "Katriel in :gh:`102778`.)" msgstr "" -#: ../../whatsnew/3.12.rst:829 ../../whatsnew/3.12.rst:1647 +#: ../../whatsnew/3.12.rst:909 ../../whatsnew/3.12.rst:1825 msgid "" ":func:`sys._current_exceptions` now returns a mapping from thread-id to an " "exception instance, rather than to a ``(typ, exc, tb)`` tuple. (Contributed " "by Irit Katriel in :gh:`103176`.)" msgstr "" -#: ../../whatsnew/3.12.rst:833 +#: ../../whatsnew/3.12.rst:913 msgid "" ":func:`sys.setrecursionlimit` and :func:`sys.getrecursionlimit`. The " "recursion limit now applies only to Python code. Builtin functions do not " @@ -1056,27 +1200,27 @@ msgid "" "prevents recursion from causing a virtual machine crash." msgstr "" -#: ../../whatsnew/3.12.rst:839 +#: ../../whatsnew/3.12.rst:919 msgid "tempfile" msgstr "tempfile" -#: ../../whatsnew/3.12.rst:841 +#: ../../whatsnew/3.12.rst:921 msgid "" "The :class:`tempfile.NamedTemporaryFile` function has a new optional " "parameter *delete_on_close* (Contributed by Evgeny Zorin in :gh:`58451`.)" msgstr "" -#: ../../whatsnew/3.12.rst:843 +#: ../../whatsnew/3.12.rst:923 msgid "" ":func:`tempfile.mkdtemp` now always returns an absolute path, even if the " "argument provided to the *dir* parameter is a relative path." msgstr "" -#: ../../whatsnew/3.12.rst:849 +#: ../../whatsnew/3.12.rst:929 msgid "threading" msgstr "threading" -#: ../../whatsnew/3.12.rst:851 +#: ../../whatsnew/3.12.rst:931 msgid "" "Add :func:`threading.settrace_all_threads` and :func:`threading." "setprofile_all_threads` that allow to set tracing and profiling functions in " @@ -1084,11 +1228,11 @@ msgid "" "Galindo in :gh:`93503`.)" msgstr "" -#: ../../whatsnew/3.12.rst:857 +#: ../../whatsnew/3.12.rst:937 msgid "tkinter" msgstr "tkinter" -#: ../../whatsnew/3.12.rst:859 +#: ../../whatsnew/3.12.rst:939 msgid "" "``tkinter.Canvas.coords()`` now flattens its arguments. It now accepts not " "only coordinates as separate arguments (``x1, y1, x2, y2, ...``) and a " @@ -1098,34 +1242,34 @@ msgid "" "in :gh:`94473`.)" msgstr "" -#: ../../whatsnew/3.12.rst:868 +#: ../../whatsnew/3.12.rst:948 msgid "tokenize" msgstr "tokenize" -#: ../../whatsnew/3.12.rst:870 +#: ../../whatsnew/3.12.rst:950 msgid "" "The :mod:`tokenize` module includes the changes introduced in :pep:`701`. " -"( Contributed by Marta Gómez Macías and Pablo Galindo in :gh:`102856`.) See :" +"(Contributed by Marta Gómez Macías and Pablo Galindo in :gh:`102856`.) See :" "ref:`whatsnew312-porting-to-python312` for more information on the changes " "to the :mod:`tokenize` module." msgstr "" -#: ../../whatsnew/3.12.rst:876 +#: ../../whatsnew/3.12.rst:956 msgid "types" msgstr "types" -#: ../../whatsnew/3.12.rst:878 +#: ../../whatsnew/3.12.rst:958 msgid "" "Add :func:`types.get_original_bases` to allow for further introspection of :" "ref:`user-defined-generics` when subclassed. (Contributed by James Hilton-" "Balfe and Alex Waygood in :gh:`101827`.)" msgstr "" -#: ../../whatsnew/3.12.rst:883 +#: ../../whatsnew/3.12.rst:963 msgid "typing" msgstr "typing" -#: ../../whatsnew/3.12.rst:885 +#: ../../whatsnew/3.12.rst:965 msgid "" ":func:`isinstance` checks against :func:`runtime-checkable protocols ` now use :func:`inspect.getattr_static` rather than :func:" @@ -1138,7 +1282,7 @@ msgid "" "affected by this change. (Contributed by Alex Waygood in :gh:`102433`.)" msgstr "" -#: ../../whatsnew/3.12.rst:896 +#: ../../whatsnew/3.12.rst:976 msgid "" "The members of a runtime-checkable protocol are now considered \"frozen\" at " "runtime as soon as the class has been created. Monkey-patching attributes " @@ -1146,13 +1290,13 @@ msgid "" "on :func:`isinstance` checks comparing objects to the protocol. For example::" msgstr "" -#: ../../whatsnew/3.12.rst:918 +#: ../../whatsnew/3.12.rst:998 msgid "" "This change was made in order to speed up ``isinstance()`` checks against " "runtime-checkable protocols." msgstr "" -#: ../../whatsnew/3.12.rst:921 +#: ../../whatsnew/3.12.rst:1001 msgid "" "The performance profile of :func:`isinstance` checks against :func:`runtime-" "checkable protocols ` has changed significantly. " @@ -1163,71 +1307,71 @@ msgid "" "in :gh:`74690` and :gh:`103193`.)" msgstr "" -#: ../../whatsnew/3.12.rst:929 +#: ../../whatsnew/3.12.rst:1009 msgid "" "All :data:`typing.TypedDict` and :data:`typing.NamedTuple` classes now have " "the ``__orig_bases__`` attribute. (Contributed by Adrian Garcia Badaracco " "in :gh:`103699`.)" msgstr "" -#: ../../whatsnew/3.12.rst:933 +#: ../../whatsnew/3.12.rst:1013 msgid "" "Add ``frozen_default`` parameter to :func:`typing.dataclass_transform`. " "(Contributed by Erik De Bonte in :gh:`99957`.)" msgstr "" -#: ../../whatsnew/3.12.rst:937 +#: ../../whatsnew/3.12.rst:1017 msgid "unicodedata" msgstr "unicodedata" -#: ../../whatsnew/3.12.rst:939 +#: ../../whatsnew/3.12.rst:1019 msgid "" "The Unicode database has been updated to version 15.0.0. (Contributed by " "Benjamin Peterson in :gh:`96734`)." msgstr "" -#: ../../whatsnew/3.12.rst:943 ../../whatsnew/3.12.rst:1502 +#: ../../whatsnew/3.12.rst:1023 ../../whatsnew/3.12.rst:1678 msgid "unittest" msgstr "unittest" -#: ../../whatsnew/3.12.rst:945 +#: ../../whatsnew/3.12.rst:1025 msgid "" -"Added ``--durations`` command line option, showing the N slowest test cases::" +"Add a ``--durations`` command line option, showing the N slowest test cases::" msgstr "" -#: ../../whatsnew/3.12.rst:961 -msgid "(Contributed by Giampaolo Rodola in :issue:`4080`)" -msgstr "(由 Giampaolo Rodola 於 :issue:`4080` 中貢獻。)" +#: ../../whatsnew/3.12.rst:1041 +msgid "(Contributed by Giampaolo Rodola in :gh:`48330`)" +msgstr "" -#: ../../whatsnew/3.12.rst:964 +#: ../../whatsnew/3.12.rst:1044 msgid "uuid" msgstr "uuid" -#: ../../whatsnew/3.12.rst:966 +#: ../../whatsnew/3.12.rst:1046 msgid "" "Add a :ref:`command-line interface `. (Contributed by Adam Chhina " "in :gh:`88597`.)" msgstr "" -#: ../../whatsnew/3.12.rst:971 +#: ../../whatsnew/3.12.rst:1051 msgid "Optimizations" msgstr "最佳化" -#: ../../whatsnew/3.12.rst:973 +#: ../../whatsnew/3.12.rst:1053 msgid "" -"Removed ``wstr`` and ``wstr_length`` members from Unicode objects. It " -"reduces object size by 8 or 16 bytes on 64bit platform. (:pep:`623`) " -"(Contributed by Inada Naoki in :gh:`92536`.)" +"Remove ``wstr`` and ``wstr_length`` members from Unicode objects. It reduces " +"object size by 8 or 16 bytes on 64bit platform. (:pep:`623`) (Contributed by " +"Inada Naoki in :gh:`92536`.)" msgstr "" -#: ../../whatsnew/3.12.rst:977 +#: ../../whatsnew/3.12.rst:1057 msgid "" -"Added experimental support for using the BOLT binary optimizer in the build " +"Add experimental support for using the BOLT binary optimizer in the build " "process, which improves performance by 1-5%. (Contributed by Kevin " -"Modzelewski in :gh:`90536` and tuned by Dong-hee Na in :gh:`101525`)" +"Modzelewski in :gh:`90536` and tuned by Donghee Na in :gh:`101525`)" msgstr "" -#: ../../whatsnew/3.12.rst:981 +#: ../../whatsnew/3.12.rst:1061 msgid "" "Speed up the regular expression substitution (functions :func:`re.sub` and :" "func:`re.subn` and corresponding :class:`!re.Pattern` methods) for " @@ -1235,13 +1379,13 @@ msgid "" "by Serhiy Storchaka in :gh:`91524`.)" msgstr "" -#: ../../whatsnew/3.12.rst:986 +#: ../../whatsnew/3.12.rst:1066 msgid "" "Speed up :class:`asyncio.Task` creation by deferring expensive string " -"formatting. (Contributed by Itamar O in :gh:`103793`.)" +"formatting. (Contributed by Itamar Oren in :gh:`103793`.)" msgstr "" -#: ../../whatsnew/3.12.rst:989 +#: ../../whatsnew/3.12.rst:1069 msgid "" "The :func:`tokenize.tokenize` and :func:`tokenize.generate_tokens` functions " "are up to 64% faster as a side effect of the changes required to cover :pep:" @@ -1249,134 +1393,345 @@ msgid "" "Pablo Galindo in :gh:`102856`.)" msgstr "" -#: ../../whatsnew/3.12.rst:994 +#: ../../whatsnew/3.12.rst:1074 +msgid "" +"Speed up :func:`super` method calls and attribute loads via the new :opcode:" +"`LOAD_SUPER_ATTR` instruction. (Contributed by Carl Meyer and Vladimir " +"Matveev in :gh:`103497`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1080 +msgid "CPython bytecode changes" +msgstr "" + +#: ../../whatsnew/3.12.rst:1082 +msgid "" +"Remove the :opcode:`!LOAD_METHOD` instruction. It has been merged into :" +"opcode:`LOAD_ATTR`. :opcode:`LOAD_ATTR` will now behave like the old :opcode:" +"`!LOAD_METHOD` instruction if the low bit of its oparg is set. (Contributed " +"by Ken Jin in :gh:`93429`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1087 +msgid "" +"Remove the :opcode:`!JUMP_IF_FALSE_OR_POP` and :opcode:`!" +"JUMP_IF_TRUE_OR_POP` instructions. (Contributed by Irit Katriel in :gh:" +"`102859`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1090 +msgid "" +"Remove the :opcode:`!PRECALL` instruction. (Contributed by Mark Shannon in :" +"gh:`92925`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1093 +msgid "" +"Add the :opcode:`BINARY_SLICE` and :opcode:`STORE_SLICE` instructions. " +"(Contributed by Mark Shannon in :gh:`94163`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1096 +msgid "" +"Add the :opcode:`CALL_INTRINSIC_1` instructions. (Contributed by Mark " +"Shannon in :gh:`99005`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1099 +msgid "" +"Add the :opcode:`CALL_INTRINSIC_2` instruction. (Contributed by Irit Katriel " +"in :gh:`101799`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1102 +msgid "" +"Add the :opcode:`CLEANUP_THROW` instruction. (Contributed by Brandt Bucher " +"in :gh:`90997`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1105 +msgid "" +"Add the :opcode:`!END_SEND` instruction. (Contributed by Mark Shannon in :gh:" +"`103082`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1108 +msgid "" +"Add the :opcode:`LOAD_FAST_AND_CLEAR` instruction as part of the " +"implementation of :pep:`709`. (Contributed by Carl Meyer in :gh:`101441`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1111 +msgid "" +"Add the :opcode:`LOAD_FAST_CHECK` instruction. (Contributed by Dennis " +"Sweeney in :gh:`93143`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1114 +msgid "" +"Add the :opcode:`LOAD_FROM_DICT_OR_DEREF`, :opcode:" +"`LOAD_FROM_DICT_OR_GLOBALS`, and :opcode:`LOAD_LOCALS` opcodes as part of " +"the implementation of :pep:`695`. Remove the :opcode:`!LOAD_CLASSDEREF` " +"opcode, which can be replaced with :opcode:`LOAD_LOCALS` plus :opcode:" +"`LOAD_FROM_DICT_OR_DEREF`. (Contributed by Jelle Zijlstra in :gh:`103764`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1120 +msgid "" +"Add the :opcode:`LOAD_SUPER_ATTR` instruction. (Contributed by Carl Meyer " +"and Vladimir Matveev in :gh:`103497`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1123 +msgid "" +"Add the :opcode:`RETURN_CONST` instruction. (Contributed by Wenyang Wang in :" +"gh:`101632`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1126 +msgid "Demos and Tools" +msgstr "" + +#: ../../whatsnew/3.12.rst:1128 +msgid "" +"Remove the ``Tools/demo/`` directory which contained old demo scripts. A " +"copy can be found in the `old-demos project `_. (Contributed by Victor Stinner in :gh:`97681`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1133 +msgid "" +"Remove outdated example scripts of the ``Tools/scripts/`` directory. A copy " +"can be found in the `old-demos project `_. (Contributed by Victor Stinner in :gh:`97669`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1140 ../../whatsnew/3.12.rst:2219 +msgid "Deprecated" +msgstr "已棄用" + +#: ../../whatsnew/3.12.rst:1142 +msgid "" +":mod:`argparse`: The *type*, *choices*, and *metavar* parameters of :class:`!" +"argparse.BooleanOptionalAction` are deprecated and will be removed in 3.14. " +"(Contributed by Nikita Sobolev in :gh:`92248`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1147 +msgid "" +":mod:`ast`: The following :mod:`ast` features have been deprecated in " +"documentation since Python 3.8, now cause a :exc:`DeprecationWarning` to be " +"emitted at runtime when they are accessed or used, and will be removed in " +"Python 3.14:" +msgstr "" + +#: ../../whatsnew/3.12.rst:1151 ../../whatsnew/3.12.rst:1383 +msgid ":class:`!ast.Num`" +msgstr ":class:`!ast.Num`" + +#: ../../whatsnew/3.12.rst:1152 ../../whatsnew/3.12.rst:1384 +msgid ":class:`!ast.Str`" +msgstr ":class:`!ast.Str`" + +#: ../../whatsnew/3.12.rst:1153 ../../whatsnew/3.12.rst:1385 +msgid ":class:`!ast.Bytes`" +msgstr ":class:`!ast.Bytes`" + +#: ../../whatsnew/3.12.rst:1154 ../../whatsnew/3.12.rst:1386 +msgid ":class:`!ast.NameConstant`" +msgstr ":class:`!ast.NameConstant`" + +#: ../../whatsnew/3.12.rst:1155 ../../whatsnew/3.12.rst:1387 +msgid ":class:`!ast.Ellipsis`" +msgstr ":class:`!ast.Ellipsis`" + +#: ../../whatsnew/3.12.rst:1157 +msgid "" +"Use :class:`ast.Constant` instead. (Contributed by Serhiy Storchaka in :gh:" +"`90953`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1160 ../../whatsnew/3.12.rst:1389 +msgid ":mod:`asyncio`:" +msgstr "" + +#: ../../whatsnew/3.12.rst:1162 msgid "" -"Speed up :func:`super` method calls and attribute loads via the new :opcode:" -"`LOAD_SUPER_ATTR` instruction. (Contributed by Carl Meyer and Vladimir " -"Matveev in :gh:`103497`.)" +"The child watcher classes :class:`asyncio.MultiLoopChildWatcher`, :class:" +"`asyncio.FastChildWatcher`, :class:`asyncio.AbstractChildWatcher` and :class:" +"`asyncio.SafeChildWatcher` are deprecated and will be removed in Python " +"3.14. (Contributed by Kumar Aditya in :gh:`94597`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1000 -msgid "CPython bytecode changes" +#: ../../whatsnew/3.12.rst:1168 +msgid "" +":func:`asyncio.set_child_watcher`, :func:`asyncio.get_child_watcher`, :meth:" +"`asyncio.AbstractEventLoopPolicy.set_child_watcher` and :meth:`asyncio." +"AbstractEventLoopPolicy.get_child_watcher` are deprecated and will be " +"removed in Python 3.14. (Contributed by Kumar Aditya in :gh:`94597`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1002 +#: ../../whatsnew/3.12.rst:1174 msgid "" -"Remove the :opcode:`LOAD_METHOD` instruction. It has been merged into :" -"opcode:`LOAD_ATTR`. :opcode:`LOAD_ATTR` will now behave like the old :opcode:" -"`LOAD_METHOD` instruction if the low bit of its oparg is set. (Contributed " -"by Ken Jin in :gh:`93429`.)" +"The :meth:`~asyncio.get_event_loop` method of the default event loop policy " +"now emits a :exc:`DeprecationWarning` if there is no current event loop set " +"and it decides to create one. (Contributed by Serhiy Storchaka and Guido van " +"Rossum in :gh:`100160`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1007 +#: ../../whatsnew/3.12.rst:1179 msgid "" -"Remove the :opcode:`!JUMP_IF_FALSE_OR_POP` and :opcode:`!" -"JUMP_IF_TRUE_OR_POP` instructions. (Contributed by Irit Katriel in :gh:" -"`102859`.)" +":mod:`calendar`: ``calendar.January`` and ``calendar.February`` constants " +"are deprecated and replaced by :data:`calendar.JANUARY` and :data:`calendar." +"FEBRUARY`. (Contributed by Prince Roshan in :gh:`103636`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1010 +#: ../../whatsnew/3.12.rst:1183 msgid "" -"Removed the :opcode:`!PRECALL` instruction. (Contributed by Mark Shannon in :" -"gh:`92925`.)" +":mod:`collections.abc`: Deprecated :class:`collections.abc.ByteString`. " +"Prefer :class:`Sequence` or :class:`collections.abc.Buffer`. For use in " +"typing, prefer a union, like ``bytes | bytearray``, or :class:`collections." +"abc.Buffer`. (Contributed by Shantanu Jain in :gh:`91896`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1013 +#: ../../whatsnew/3.12.rst:1188 msgid "" -"Add the :opcode:`LOAD_FAST_AND_CLEAR` instruction as part of the " -"implementation of :pep:`709`. (Contributed by Carl Meyer in :gh:`101441`.)" +":mod:`datetime`: :class:`datetime.datetime`'s :meth:`~datetime.datetime." +"utcnow` and :meth:`~datetime.datetime.utcfromtimestamp` are deprecated and " +"will be removed in a future version. Instead, use timezone-aware objects to " +"represent datetimes in UTC: respectively, call :meth:`~datetime.datetime." +"now` and :meth:`~datetime.datetime.fromtimestamp` with the *tz* parameter " +"set to :const:`datetime.UTC`. (Contributed by Paul Ganssle in :gh:`103857`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1016 +#: ../../whatsnew/3.12.rst:1196 msgid "" -"Add the :opcode:`LOAD_FROM_DICT_OR_DEREF`, :opcode:" -"`LOAD_FROM_DICT_OR_GLOBALS`, and :opcode:`LOAD_LOCALS` opcodes as part of " -"the implementation of :pep:`695`. Remove the :opcode:`!LOAD_CLASSDEREF` " -"opcode, which can be replaced with :opcode:`LOAD_LOCALS` plus :opcode:" -"`LOAD_FROM_DICT_OR_DEREF`. (Contributed by Jelle Zijlstra in :gh:`103764`.)" +":mod:`email`: Deprecate the *isdst* parameter in :func:`email.utils." +"localtime`. (Contributed by Alan Williams in :gh:`72346`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1022 +#: ../../whatsnew/3.12.rst:1199 msgid "" -"Add the :opcode:`LOAD_SUPER_ATTR` instruction. (Contributed by Carl Meyer " -"and Vladimir Matveev in :gh:`103497`.)" +":mod:`importlib.abc`: Deprecated the following classes, scheduled for " +"removal in Python 3.14:" msgstr "" -#: ../../whatsnew/3.12.rst:1026 -msgid "Demos and Tools" +#: ../../whatsnew/3.12.rst:1202 ../../whatsnew/3.12.rst:1406 +msgid ":class:`!importlib.abc.ResourceReader`" +msgstr ":class:`!importlib.abc.ResourceReader`" + +#: ../../whatsnew/3.12.rst:1203 ../../whatsnew/3.12.rst:1407 +msgid ":class:`!importlib.abc.Traversable`" +msgstr ":class:`!importlib.abc.Traversable`" + +#: ../../whatsnew/3.12.rst:1204 ../../whatsnew/3.12.rst:1408 +msgid ":class:`!importlib.abc.TraversableResources`" +msgstr ":class:`!importlib.abc.TraversableResources`" + +#: ../../whatsnew/3.12.rst:1206 +msgid "Use :mod:`importlib.resources.abc` classes instead:" msgstr "" -#: ../../whatsnew/3.12.rst:1028 +#: ../../whatsnew/3.12.rst:1208 +msgid ":class:`importlib.resources.abc.Traversable`" +msgstr ":class:`importlib.resources.abc.Traversable`" + +#: ../../whatsnew/3.12.rst:1209 +msgid ":class:`importlib.resources.abc.TraversableResources`" +msgstr ":class:`importlib.resources.abc.TraversableResources`" + +#: ../../whatsnew/3.12.rst:1211 +msgid "(Contributed by Jason R. Coombs and Hugo van Kemenade in :gh:`93963`.)" +msgstr "(由 Jason R. Coombs 和 Hugo van Kemenade 於 :gh:`93963` 中貢獻。)" + +#: ../../whatsnew/3.12.rst:1213 msgid "" -"Remove the ``Tools/demo/`` directory which contained old demo scripts. A " -"copy can be found in the `old-demos project `_. (Contributed by Victor Stinner in :gh:`97681`.)" +":mod:`itertools`: Deprecate the support for copy, deepcopy, and pickle " +"operations, which is undocumented, inefficient, historically buggy, and " +"inconsistent. This will be removed in 3.14 for a significant reduction in " +"code volume and maintenance burden. (Contributed by Raymond Hettinger in :gh:" +"`101588`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1033 +#: ../../whatsnew/3.12.rst:1219 msgid "" -"Remove outdated example scripts of the ``Tools/scripts/`` directory. A copy " -"can be found in the `old-demos project `_. (Contributed by Victor Stinner in :gh:`97669`.)" +":mod:`multiprocessing`: In Python 3.14, the default :mod:`multiprocessing` " +"start method will change to a safer one on Linux, BSDs, and other non-macOS " +"POSIX platforms where ``'fork'`` is currently the default (:gh:`84559`). " +"Adding a runtime warning about this was deemed too disruptive as the " +"majority of code is not expected to care. Use the :func:`~multiprocessing." +"get_context` or :func:`~multiprocessing.set_start_method` APIs to explicitly " +"specify when your code *requires* ``'fork'``. See :ref:`contexts and start " +"methods `." msgstr "" -#: ../../whatsnew/3.12.rst:1040 ../../whatsnew/3.12.rst:2038 -msgid "Deprecated" -msgstr "已棄用" +#: ../../whatsnew/3.12.rst:1229 +msgid "" +":mod:`pkgutil`: :func:`pkgutil.find_loader` and :func:`pkgutil.get_loader` " +"are deprecated and will be removed in Python 3.14; use :func:`importlib.util." +"find_spec` instead. (Contributed by Nikita Sobolev in :gh:`97850`.)" +msgstr "" -#: ../../whatsnew/3.12.rst:1042 +#: ../../whatsnew/3.12.rst:1234 msgid "" -":mod:`asyncio`: The :meth:`~asyncio.get_event_loop` method of the default " -"event loop policy now emits a :exc:`DeprecationWarning` if there is no " -"current event loop set and it decides to create one. (Contributed by Serhiy " -"Storchaka and Guido van Rossum in :gh:`100160`.)" +":mod:`pty`: The module has two undocumented ``master_open()`` and " +"``slave_open()`` functions that have been deprecated since Python 2 but only " +"gained a proper :exc:`DeprecationWarning` in 3.12. Remove them in 3.14. " +"(Contributed by Soumendra Ganguly and Gregory P. Smith in :gh:`85984`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1047 +#: ../../whatsnew/3.12.rst:1239 +msgid ":mod:`os`:" +msgstr "" + +#: ../../whatsnew/3.12.rst:1241 msgid "" -":mod:`calendar`: ``calendar.January`` and ``calendar.February`` constants " -"are deprecated and replaced by :data:`calendar.JANUARY` and :data:`calendar." -"FEBRUARY`. (Contributed by Prince Roshan in :gh:`103636`.)" +"The ``st_ctime`` fields return by :func:`os.stat` and :func:`os.lstat` on " +"Windows are deprecated. In a future release, they will contain the last " +"metadata change time, consistent with other platforms. For now, they still " +"contain the creation time, which is also available in the new " +"``st_birthtime`` field. (Contributed by Steve Dower in :gh:`99726`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1051 +#: ../../whatsnew/3.12.rst:1247 msgid "" -":mod:`datetime`: :class:`datetime.datetime`'s :meth:`~datetime.datetime." -"utcnow` and :meth:`~datetime.datetime.utcfromtimestamp` are deprecated and " -"will be removed in a future version. Instead, use timezone-aware objects to " -"represent datetimes in UTC: respectively, call :meth:`~datetime.datetime." -"now` and :meth:`~datetime.datetime.fromtimestamp` with the *tz* parameter " -"set to :const:`datetime.UTC`. (Contributed by Paul Ganssle in :gh:`103857`.)" +"On POSIX platforms, :func:`os.fork` can now raise a :exc:" +"`DeprecationWarning` when it can detect being called from a multithreaded " +"process. There has always been a fundamental incompatibility with the POSIX " +"platform when doing so. Even if such code *appeared* to work. We added the " +"warning to to raise awareness as issues encounted by code doing this are " +"becoming more frequent. See the :func:`os.fork` documentation for more " +"details along with `this discussion on fork being incompatible with threads " +"`_ for *why* we're now surfacing this " +"longstanding platform compatibility problem to developers." msgstr "" -#: ../../whatsnew/3.12.rst:1059 +#: ../../whatsnew/3.12.rst:1257 msgid "" -":mod:`os`: The ``st_ctime`` fields return by :func:`os.stat` and :func:`os." -"lstat` on Windows are deprecated. In a future release, they will contain the " -"last metadata change time, consistent with other platforms. For now, they " -"still contain the creation time, which is also available in the new " -"``st_birthtime`` field. (Contributed by Steve Dower in :gh:`99726`.)" +"When this warning appears due to usage of :mod:`multiprocessing` or :mod:" +"`concurrent.futures` the fix is to use a different :mod:`multiprocessing` " +"start method such as ``\"spawn\"`` or ``\"forkserver\"``." msgstr "" -#: ../../whatsnew/3.12.rst:1065 +#: ../../whatsnew/3.12.rst:1261 msgid "" ":mod:`shutil`: The *onerror* argument of :func:`shutil.rmtree` is deprecated " -"as will be removed in Python 3.14. Use *onexc* instead. (Contributed by Irit " -"Katriel in :gh:`102828`.)" +"and will be removed in Python 3.14. Use *onexc* instead. (Contributed by " +"Irit Katriel in :gh:`102828`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1080 +#: ../../whatsnew/3.12.rst:1264 msgid ":mod:`sqlite3`:" msgstr "" -#: ../../whatsnew/3.12.rst:1069 +#: ../../whatsnew/3.12.rst:1266 msgid "" ":ref:`default adapters and converters ` are now " "deprecated. Instead, use the :ref:`sqlite3-adapter-converter-recipes` and " "tailor them to your needs. (Contributed by Erlend E. Aasland in :gh:`90016`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1075 +#: ../../whatsnew/3.12.rst:1272 msgid "" "In :meth:`~sqlite3.Cursor.execute`, :exc:`DeprecationWarning` is now emitted " "when :ref:`named placeholders ` are used together with " @@ -1386,402 +1741,355 @@ msgid "" "Erlend E. Aasland in :gh:`101698`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1082 +#: ../../whatsnew/3.12.rst:1279 msgid "" ":mod:`sys`: The :data:`sys.last_type`, :data:`sys.last_value` and :data:`sys." "last_traceback` fields are deprecated. Use :data:`sys.last_exc` instead. " "(Contributed by Irit Katriel in :gh:`102778`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1086 +#: ../../whatsnew/3.12.rst:1283 msgid "" ":mod:`tarfile`: Extracting tar archives without specifying *filter* is " "deprecated until Python 3.14, when ``'data'`` filter will become the " "default. See :ref:`tarfile-extraction-filter` for details." msgstr "" -#: ../../whatsnew/3.12.rst:1090 +#: ../../whatsnew/3.12.rst:1287 +msgid ":mod:`typing`:" +msgstr "" + +#: ../../whatsnew/3.12.rst:1289 msgid "" -":mod:`typing`: :class:`typing.Hashable` and :class:`typing.Sized` aliases " -"for :class:`collections.abc.Hashable` and :class:`collections.abc.Sized`. (:" -"gh:`94309`.)" +":class:`typing.Hashable` and :class:`typing.Sized` aliases for :class:" +"`collections.abc.Hashable` and :class:`collections.abc.Sized`. (:gh:`94309`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1093 +#: ../../whatsnew/3.12.rst:1292 +msgid "" +":class:`typing.ByteString`, deprecated since Python 3.9, now causes a :exc:" +"`DeprecationWarning` to be emitted when it is used. (Contributed by Alex " +"Waygood in :gh:`91896`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1296 msgid "" ":mod:`xml.etree.ElementTree`: The module now emits :exc:`DeprecationWarning` " "when testing the truth value of an :class:`xml.etree.ElementTree.Element`. " "Before, the Python implementation emitted :exc:`FutureWarning`, and the C " -"implementation emitted nothing." +"implementation emitted nothing. (Contributed by Jacob Walls in :gh:`83122`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1098 +#: ../../whatsnew/3.12.rst:1302 msgid "" -"The 3-arg signatures (type, value, traceback) of :meth:`~coroutine.throw`, :" -"meth:`~generator.throw` and :meth:`~agen.athrow` are deprecated and may be " -"removed in a future version of Python. Use the single-arg versions of these " -"functions instead. (Contributed by Ofey Chan in :gh:`89874`.)" +"The 3-arg signatures (type, value, traceback) of :meth:`coroutine throw() " +"`, :meth:`generator throw() ` and :meth:" +"`async generator throw() ` are deprecated and may be removed in " +"a future version of Python. Use the single-arg versions of these functions " +"instead. (Contributed by Ofey Chan in :gh:`89874`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1103 +#: ../../whatsnew/3.12.rst:1308 msgid "" ":exc:`DeprecationWarning` is now raised when ``__package__`` on a module " "differs from ``__spec__.parent`` (previously it was :exc:`ImportWarning`). " "(Contributed by Brett Cannon in :gh:`65961`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1108 +#: ../../whatsnew/3.12.rst:1313 msgid "" -"In accordance with :pep:`699`, the ``ma_version_tag`` field in :c:type:" -"`PyDictObject` is deprecated for extension modules. Accessing this field " -"will generate a compiler warning at compile time. This field will be removed " -"in Python 3.14. (Contributed by Ramvikrams and Kumar Aditya in :gh:`101193`. " -"PEP by Ken Jin.)" +"Setting ``__package__`` or ``__cached__`` on a module is deprecated, and " +"will cease to be set or taken into consideration by the import system in " +"Python 3.14. (Contributed by Brett Cannon in :gh:`65961`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1113 +#: ../../whatsnew/3.12.rst:1317 msgid "" "The bitwise inversion operator (``~``) on bool is deprecated. It will throw " "an error in Python 3.14. Use ``not`` for logical negation of bools instead. " "In the rare case that you really need the bitwise inversion of the " -"underlying ``int``, convert to int explicitly with ``~int(x)``. (Contributed " -"by Tim Hoffmann in :gh:`103487`.)" +"underlying ``int``, convert to int explicitly: ``~int(x)``. (Contributed by " +"Tim Hoffmann in :gh:`103487`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1120 +#: ../../whatsnew/3.12.rst:1323 +msgid "" +"Accessing ``co_lnotab`` on code objects was deprecated in Python 3.10 via :" +"pep:`626`, but it only got a proper :exc:`DeprecationWarning` in 3.12, " +"therefore it will be removed in 3.14. (Contributed by Nikita Sobolev in :gh:" +"`101866`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:1329 msgid "Pending Removal in Python 3.13" msgstr "" -#: ../../whatsnew/3.12.rst:1122 +#: ../../whatsnew/3.12.rst:1331 msgid "" "The following modules and APIs have been deprecated in earlier Python " "releases, and will be removed in Python 3.13." msgstr "" -#: ../../whatsnew/3.12.rst:1125 +#: ../../whatsnew/3.12.rst:1334 msgid "Modules (see :pep:`594`):" msgstr "" -#: ../../whatsnew/3.12.rst:1127 +#: ../../whatsnew/3.12.rst:1336 msgid ":mod:`aifc`" msgstr ":mod:`aifc`" -#: ../../whatsnew/3.12.rst:1128 +#: ../../whatsnew/3.12.rst:1337 msgid ":mod:`audioop`" msgstr ":mod:`audioop`" -#: ../../whatsnew/3.12.rst:1129 +#: ../../whatsnew/3.12.rst:1338 msgid ":mod:`cgi`" msgstr ":mod:`cgi`" -#: ../../whatsnew/3.12.rst:1130 +#: ../../whatsnew/3.12.rst:1339 msgid ":mod:`cgitb`" msgstr ":mod:`cgitb`" -#: ../../whatsnew/3.12.rst:1131 +#: ../../whatsnew/3.12.rst:1340 msgid ":mod:`chunk`" msgstr ":mod:`chunk`" -#: ../../whatsnew/3.12.rst:1132 +#: ../../whatsnew/3.12.rst:1341 msgid ":mod:`crypt`" msgstr ":mod:`crypt`" -#: ../../whatsnew/3.12.rst:1133 +#: ../../whatsnew/3.12.rst:1342 msgid ":mod:`imghdr`" msgstr ":mod:`imghdr`" -#: ../../whatsnew/3.12.rst:1134 +#: ../../whatsnew/3.12.rst:1343 msgid ":mod:`mailcap`" msgstr ":mod:`mailcap`" -#: ../../whatsnew/3.12.rst:1135 +#: ../../whatsnew/3.12.rst:1344 msgid ":mod:`msilib`" msgstr ":mod:`msilib`" -#: ../../whatsnew/3.12.rst:1136 +#: ../../whatsnew/3.12.rst:1345 msgid ":mod:`nis`" msgstr ":mod:`nis`" -#: ../../whatsnew/3.12.rst:1137 +#: ../../whatsnew/3.12.rst:1346 msgid ":mod:`nntplib`" msgstr ":mod:`nntplib`" -#: ../../whatsnew/3.12.rst:1138 +#: ../../whatsnew/3.12.rst:1347 msgid ":mod:`ossaudiodev`" msgstr ":mod:`ossaudiodev`" -#: ../../whatsnew/3.12.rst:1139 +#: ../../whatsnew/3.12.rst:1348 msgid ":mod:`pipes`" msgstr ":mod:`pipes`" -#: ../../whatsnew/3.12.rst:1140 +#: ../../whatsnew/3.12.rst:1349 msgid ":mod:`sndhdr`" msgstr ":mod:`sndhdr`" -#: ../../whatsnew/3.12.rst:1141 +#: ../../whatsnew/3.12.rst:1350 msgid ":mod:`spwd`" msgstr ":mod:`spwd`" -#: ../../whatsnew/3.12.rst:1142 +#: ../../whatsnew/3.12.rst:1351 msgid ":mod:`sunau`" msgstr ":mod:`sunau`" -#: ../../whatsnew/3.12.rst:1143 +#: ../../whatsnew/3.12.rst:1352 msgid ":mod:`telnetlib`" msgstr ":mod:`telnetlib`" -#: ../../whatsnew/3.12.rst:1144 +#: ../../whatsnew/3.12.rst:1353 msgid ":mod:`uu`" msgstr ":mod:`uu`" -#: ../../whatsnew/3.12.rst:1145 +#: ../../whatsnew/3.12.rst:1354 msgid ":mod:`xdrlib`" msgstr ":mod:`xdrlib`" -#: ../../whatsnew/3.12.rst:1147 +#: ../../whatsnew/3.12.rst:1356 msgid "Other modules:" msgstr "" -#: ../../whatsnew/3.12.rst:1149 +#: ../../whatsnew/3.12.rst:1358 msgid ":mod:`!lib2to3`, and the :program:`2to3` program (:gh:`84540`)" msgstr "" -#: ../../whatsnew/3.12.rst:1151 +#: ../../whatsnew/3.12.rst:1360 msgid "APIs:" msgstr "" -#: ../../whatsnew/3.12.rst:1153 +#: ../../whatsnew/3.12.rst:1362 msgid ":class:`!configparser.LegacyInterpolation` (:gh:`90765`)" msgstr ":class:`!configparser.LegacyInterpolation` (:gh:`90765`)" -#: ../../whatsnew/3.12.rst:1154 +#: ../../whatsnew/3.12.rst:1363 msgid ":func:`locale.getdefaultlocale` (:gh:`90817`)" msgstr ":func:`locale.getdefaultlocale` (:gh:`90817`)" -#: ../../whatsnew/3.12.rst:1155 +#: ../../whatsnew/3.12.rst:1364 msgid ":meth:`!turtle.RawTurtle.settiltangle` (:gh:`50096`)" msgstr ":meth:`!turtle.RawTurtle.settiltangle` (:gh:`50096`)" -#: ../../whatsnew/3.12.rst:1156 +#: ../../whatsnew/3.12.rst:1365 msgid ":func:`!unittest.findTestCases` (:gh:`50096`)" msgstr ":func:`!unittest.findTestCases` (:gh:`50096`)" -#: ../../whatsnew/3.12.rst:1157 +#: ../../whatsnew/3.12.rst:1366 msgid ":func:`!unittest.getTestCaseNames` (:gh:`50096`)" msgstr ":func:`!unittest.getTestCaseNames` (:gh:`50096`)" -#: ../../whatsnew/3.12.rst:1158 +#: ../../whatsnew/3.12.rst:1367 msgid ":func:`!unittest.makeSuite` (:gh:`50096`)" msgstr ":func:`!unittest.makeSuite` (:gh:`50096`)" -#: ../../whatsnew/3.12.rst:1159 +#: ../../whatsnew/3.12.rst:1368 msgid ":meth:`!unittest.TestProgram.usageExit` (:gh:`67048`)" msgstr ":meth:`!unittest.TestProgram.usageExit` (:gh:`67048`)" -#: ../../whatsnew/3.12.rst:1160 +#: ../../whatsnew/3.12.rst:1369 msgid ":class:`!webbrowser.MacOSX` (:gh:`86421`)" msgstr ":class:`!webbrowser.MacOSX` (:gh:`86421`)" -#: ../../whatsnew/3.12.rst:1161 +#: ../../whatsnew/3.12.rst:1370 msgid ":class:`classmethod` descriptor chaining (:gh:`89519`)" msgstr "" -#: ../../whatsnew/3.12.rst:1164 +#: ../../whatsnew/3.12.rst:1373 ../../whatsnew/3.12.rst:2306 msgid "Pending Removal in Python 3.14" msgstr "" -#: ../../whatsnew/3.12.rst:1166 +#: ../../whatsnew/3.12.rst:1375 msgid "" -":mod:`argparse`: The *type*, *choices*, and *metavar* parameters of :class:`!" -"argparse.BooleanOptionalAction` are deprecated and will be removed in 3.14. " -"(Contributed by Nikita Sobolev in :gh:`92248`.)" +"The following APIs have been deprecated and will be removed in Python 3.14." msgstr "" -#: ../../whatsnew/3.12.rst:1171 +#: ../../whatsnew/3.12.rst:1378 msgid "" -":mod:`ast`: The following :mod:`ast` features have been deprecated in " -"documentation since Python 3.8, now cause a :exc:`DeprecationWarning` to be " -"emitted at runtime when they are accessed or used, and will be removed in " -"Python 3.14:" +":mod:`argparse`: The *type*, *choices*, and *metavar* parameters of :class:`!" +"argparse.BooleanOptionalAction`" msgstr "" -#: ../../whatsnew/3.12.rst:1175 -msgid ":class:`!ast.Num`" -msgstr ":class:`!ast.Num`" - -#: ../../whatsnew/3.12.rst:1176 -msgid ":class:`!ast.Str`" -msgstr ":class:`!ast.Str`" +#: ../../whatsnew/3.12.rst:1381 +msgid ":mod:`ast`:" +msgstr ":mod:`ast`:" -#: ../../whatsnew/3.12.rst:1177 -msgid ":class:`!ast.Bytes`" -msgstr ":class:`!ast.Bytes`" +#: ../../whatsnew/3.12.rst:1391 +msgid ":class:`!asyncio.MultiLoopChildWatcher`" +msgstr ":class:`!asyncio.MultiLoopChildWatcher`" -#: ../../whatsnew/3.12.rst:1178 -msgid ":class:`!ast.NameConstant`" -msgstr ":class:`!ast.NameConstant`" +#: ../../whatsnew/3.12.rst:1392 +msgid ":class:`!asyncio.FastChildWatcher`" +msgstr ":class:`!asyncio.FastChildWatcher`" -#: ../../whatsnew/3.12.rst:1179 -msgid ":class:`!ast.Ellipsis`" -msgstr ":class:`!ast.Ellipsis`" +#: ../../whatsnew/3.12.rst:1393 +msgid ":class:`!asyncio.AbstractChildWatcher`" +msgstr ":class:`!asyncio.AbstractChildWatcher`" -#: ../../whatsnew/3.12.rst:1181 -msgid "" -"Use :class:`ast.Constant` instead. (Contributed by Serhiy Storchaka in :gh:" -"`90953`.)" -msgstr "" +#: ../../whatsnew/3.12.rst:1394 +msgid ":class:`!asyncio.SafeChildWatcher`" +msgstr ":class:`!asyncio.SafeChildWatcher`" -#: ../../whatsnew/3.12.rst:1184 -msgid "" -":mod:`asyncio`: the *msg* parameter of both :meth:`asyncio.Future.cancel` " -"and :meth:`asyncio.Task.cancel` (:gh:`90985`)" -msgstr "" +#: ../../whatsnew/3.12.rst:1395 +msgid ":func:`!asyncio.set_child_watcher`" +msgstr ":func:`!asyncio.set_child_watcher`" -#: ../../whatsnew/3.12.rst:1188 -msgid "" -":mod:`collections.abc`: Deprecated :class:`collections.abc.ByteString`. " -"Prefer :class:`Sequence` or :class:`collections.abc.Buffer`. For use in " -"typing, prefer a union, like ``bytes | bytearray``, or :class:`collections." -"abc.Buffer`. (Contributed by Shantanu Jain in :gh:`91896`.)" -msgstr "" +#: ../../whatsnew/3.12.rst:1396 +msgid ":func:`!asyncio.get_child_watcher`," +msgstr ":func:`!asyncio.get_child_watcher`、" -#: ../../whatsnew/3.12.rst:1193 -msgid "" -":mod:`email`: Deprecated the *isdst* parameter in :func:`email.utils." -"localtime`. (Contributed by Alan Williams in :gh:`72346`.)" -msgstr "" +#: ../../whatsnew/3.12.rst:1397 +msgid ":meth:`!asyncio.AbstractEventLoopPolicy.set_child_watcher`" +msgstr ":meth:`!asyncio.AbstractEventLoopPolicy.set_child_watcher`" -#: ../../whatsnew/3.12.rst:1196 -msgid "" -":mod:`importlib.abc`: Deprecated the following classes, scheduled for " -"removal in Python 3.14:" -msgstr "" +#: ../../whatsnew/3.12.rst:1398 +msgid ":meth:`!asyncio.AbstractEventLoopPolicy.get_child_watcher`" +msgstr ":meth:`!asyncio.AbstractEventLoopPolicy.get_child_watcher`" -#: ../../whatsnew/3.12.rst:1199 -msgid ":class:`!importlib.abc.ResourceReader`" -msgstr ":class:`!importlib.abc.ResourceReader`" +#: ../../whatsnew/3.12.rst:1400 +msgid ":mod:`collections.abc`: :class:`!collections.abc.ByteString`." +msgstr ":mod:`collections.abc`: :class:`!collections.abc.ByteString`。" -#: ../../whatsnew/3.12.rst:1200 -msgid ":class:`!importlib.abc.Traversable`" -msgstr ":class:`!importlib.abc.Traversable`" +#: ../../whatsnew/3.12.rst:1402 +msgid ":mod:`email`: the *isdst* parameter in :func:`email.utils.localtime`." +msgstr "" -#: ../../whatsnew/3.12.rst:1201 -msgid ":class:`!importlib.abc.TraversableResources`" -msgstr ":class:`!importlib.abc.TraversableResources`" +#: ../../whatsnew/3.12.rst:1404 +msgid ":mod:`importlib.abc`:" +msgstr ":mod:`importlib.abc`:" -#: ../../whatsnew/3.12.rst:1203 -msgid "Use :mod:`importlib.resources.abc` classes instead:" +#: ../../whatsnew/3.12.rst:1410 +msgid ":mod:`itertools`: Support for copy, deepcopy, and pickle operations." msgstr "" -#: ../../whatsnew/3.12.rst:1205 -msgid ":class:`importlib.resources.abc.Traversable`" -msgstr ":class:`importlib.resources.abc.Traversable`" - -#: ../../whatsnew/3.12.rst:1206 -msgid ":class:`importlib.resources.abc.TraversableResources`" -msgstr ":class:`importlib.resources.abc.TraversableResources`" +#: ../../whatsnew/3.12.rst:1412 +msgid ":mod:`pkgutil`:" +msgstr ":mod:`pkgutil`:" -#: ../../whatsnew/3.12.rst:1208 -msgid "(Contributed by Jason R. Coombs and Hugo van Kemenade in :gh:`93963`.)" -msgstr "(由 Jason R. Coombs 和 Hugo van Kemenade 於 :gh:`93963` 中貢獻。)" +#: ../../whatsnew/3.12.rst:1414 +msgid ":func:`!pkgutil.find_loader`" +msgstr ":func:`!pkgutil.find_loader`" -#: ../../whatsnew/3.12.rst:1210 -msgid "" -":mod:`itertools`: The module had undocumented, inefficient, historically " -"buggy, and inconsistent support for copy, deepcopy, and pickle operations. " -"This will be removed in 3.14 for a significant reduction in code volume and " -"maintenance burden. (Contributed by Raymond Hettinger in :gh:`101588`.)" -msgstr "" +#: ../../whatsnew/3.12.rst:1415 +msgid ":func:`!pkgutil.get_loader`." +msgstr ":func:`!pkgutil.get_loader`。" -#: ../../whatsnew/3.12.rst:1216 -msgid "" -":mod:`multiprocessing`: The default :mod:`multiprocessing` start method will " -"change to a safer one on Linux, BSDs, and other non-macOS POSIX platforms " -"where ``'fork'`` is currently the default (:gh:`84559`). Adding a runtime " -"warning about this was deemed too disruptive as the majority of code is not " -"expected to care. Use the :func:`~multiprocessing.get_context` or :func:" -"`~multiprocessing.set_start_method` APIs to explicitly specify when your " -"code *requires* ``'fork'``. See :ref:`multiprocessing-start-methods`." -msgstr "" +#: ../../whatsnew/3.12.rst:1417 +msgid ":mod:`pty`:" +msgstr ":mod:`pty`:" -#: ../../whatsnew/3.12.rst:1224 -msgid "" -":mod:`pkgutil`: :func:`pkgutil.find_loader` and :func:`pkgutil.get_loader` " -"now raise :exc:`DeprecationWarning`; use :func:`importlib.util.find_spec` " -"instead. (Contributed by Nikita Sobolev in :gh:`97850`.)" -msgstr "" +#: ../../whatsnew/3.12.rst:1419 +msgid ":func:`!pty.master_open`" +msgstr ":func:`!pty.master_open`" -#: ../../whatsnew/3.12.rst:1229 -msgid "" -":mod:`pty`: The module has two undocumented ``master_open()`` and " -"``slave_open()`` functions that have been deprecated since Python 2 but only " -"gained a proper :exc:`DeprecationWarning` in 3.12. Remove them in 3.14." -msgstr "" +#: ../../whatsnew/3.12.rst:1420 +msgid ":func:`!pty.slave_open`" +msgstr ":func:`!pty.slave_open`" -#: ../../whatsnew/3.12.rst:1233 -msgid "" -":mod:`shutil`: The *onerror* argument of :func:`shutil.rmtree` is deprecated " -"in 3.12, and will be removed in 3.14." +#: ../../whatsnew/3.12.rst:1422 +msgid ":mod:`shutil`: The *onerror* argument of :func:`shutil.rmtree`" msgstr "" -#: ../../whatsnew/3.12.rst:1236 -msgid "" -":mod:`typing`: :class:`typing.ByteString`, deprecated since Python 3.9, now " -"causes a :exc:`DeprecationWarning` to be emitted when it is used." -msgstr "" +#: ../../whatsnew/3.12.rst:1424 +msgid ":mod:`typing`: :class:`!typing.ByteString`" +msgstr ":mod:`typing`::class:`!typing.ByteString`" -#: ../../whatsnew/3.12.rst:1239 +#: ../../whatsnew/3.12.rst:1426 msgid "" ":mod:`xml.etree.ElementTree`: Testing the truth value of an :class:`xml." -"etree.ElementTree.Element` is deprecated and will raise an exception in " -"Python 3.14." -msgstr "" - -#: ../../whatsnew/3.12.rst:1242 -msgid "" -"Creating immutable types (:c:macro:`Py_TPFLAGS_IMMUTABLETYPE`) with mutable " -"bases using the C API (:gh:`95388`)." -msgstr "" - -#: ../../whatsnew/3.12.rst:1245 -msgid "" -"``__package__`` and ``__cached__`` will cease to be set or taken into " -"consideration by the import system (:gh:`97879`)." +"etree.ElementTree.Element`." msgstr "" -#: ../../whatsnew/3.12.rst:1248 -msgid "" -"Accessing ``co_lnotab`` was deprecated in :pep:`626` since 3.10 and was " -"planned to be removed in 3.12 but it only got a proper :exc:" -"`DeprecationWarning` in 3.12. May be removed in 3.14. (Contributed by Nikita " -"Sobolev in :gh:`101866`.)" +#: ../../whatsnew/3.12.rst:1428 +msgid "The ``__package__`` and ``__cached__`` attributes on module objects." msgstr "" -#: ../../whatsnew/3.12.rst:1254 -msgid "" -"Creating :c:data:`immutable types ` with mutable " -"bases using the C API (:gh:`95388`)" +#: ../../whatsnew/3.12.rst:1430 +msgid "The ``co_lnotab`` attribute of code objects." msgstr "" -#: ../../whatsnew/3.12.rst:1258 +#: ../../whatsnew/3.12.rst:1433 ../../whatsnew/3.12.rst:2361 msgid "Pending Removal in Future Versions" msgstr "" -#: ../../whatsnew/3.12.rst:1260 +#: ../../whatsnew/3.12.rst:1435 msgid "" "The following APIs were deprecated in earlier Python versions and will be " "removed, although there is currently no date scheduled for their removal." msgstr "" -#: ../../whatsnew/3.12.rst:1263 +#: ../../whatsnew/3.12.rst:1438 msgid ":mod:`array`'s ``'u'`` format code (:gh:`57281`)" msgstr "" -#: ../../whatsnew/3.12.rst:1265 +#: ../../whatsnew/3.12.rst:1440 msgid ":class:`typing.Text` (:gh:`92332`)" msgstr ":class:`typing.Text` (:gh:`92332`)" -#: ../../whatsnew/3.12.rst:1267 +#: ../../whatsnew/3.12.rst:1442 msgid "" "Currently Python accepts numeric literals immediately followed by keywords, " "for example ``0in x``, ``1or x``, ``0if 1else 2``. It allows confusing and " @@ -1793,54 +2101,54 @@ msgid "" "syntax error. (:gh:`87999`)" msgstr "" -#: ../../whatsnew/3.12.rst:1278 ../../whatsnew/3.12.rst:2120 +#: ../../whatsnew/3.12.rst:1453 ../../whatsnew/3.12.rst:2393 msgid "Removed" msgstr "已移除" -#: ../../whatsnew/3.12.rst:1281 +#: ../../whatsnew/3.12.rst:1456 msgid "asynchat and asyncore" -msgstr "" +msgstr "asynchat 和 asyncore" -#: ../../whatsnew/3.12.rst:1283 +#: ../../whatsnew/3.12.rst:1458 msgid "" "These two modules have been removed according to the schedule in :pep:`594`, " "having been deprecated in Python 3.6. Use :mod:`asyncio` instead. " "(Contributed by Nikita Sobolev in :gh:`96580`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1290 +#: ../../whatsnew/3.12.rst:1465 msgid "configparser" -msgstr "" +msgstr "configparser" -#: ../../whatsnew/3.12.rst:1292 +#: ../../whatsnew/3.12.rst:1467 msgid "" "Several names deprecated in the :mod:`configparser` way back in 3.2 have " "been removed per :gh:`89336`:" msgstr "" -#: ../../whatsnew/3.12.rst:1295 +#: ../../whatsnew/3.12.rst:1470 msgid "" ":class:`configparser.ParsingError` no longer has a ``filename`` attribute or " "argument. Use the ``source`` attribute and argument instead." msgstr "" -#: ../../whatsnew/3.12.rst:1297 +#: ../../whatsnew/3.12.rst:1472 msgid "" ":mod:`configparser` no longer has a ``SafeConfigParser`` class. Use the " "shorter :class:`~configparser.ConfigParser` name instead." msgstr "" -#: ../../whatsnew/3.12.rst:1299 +#: ../../whatsnew/3.12.rst:1474 msgid "" ":class:`configparser.ConfigParser` no longer has a ``readfp`` method. Use :" "meth:`~configparser.ConfigParser.read_file` instead." msgstr "" -#: ../../whatsnew/3.12.rst:1303 +#: ../../whatsnew/3.12.rst:1478 msgid "distutils" -msgstr "" +msgstr "distutils" -#: ../../whatsnew/3.12.rst:1305 +#: ../../whatsnew/3.12.rst:1480 msgid "" "Remove the :py:mod:`!distutils` package. It was deprecated in Python 3.10 " "by :pep:`632` \"Deprecate distutils module\". For projects still using " @@ -1849,17 +2157,17 @@ msgid "" "Victor Stinner in :gh:`92584`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1312 +#: ../../whatsnew/3.12.rst:1487 msgid "ensurepip" -msgstr "" +msgstr "ensurepip" -#: ../../whatsnew/3.12.rst:1314 +#: ../../whatsnew/3.12.rst:1489 msgid "" "Remove the bundled setuptools wheel from :mod:`ensurepip`, and stop " "installing setuptools in environments created by :mod:`venv`." msgstr "" -#: ../../whatsnew/3.12.rst:1317 +#: ../../whatsnew/3.12.rst:1492 msgid "" "``pip (>= 22.1)`` does not require setuptools to be installed in the " "environment. ``setuptools``-based (and ``distutils``-based) packages can " @@ -1867,7 +2175,7 @@ msgid "" "the build environment it uses for building a package." msgstr "" -#: ../../whatsnew/3.12.rst:1323 +#: ../../whatsnew/3.12.rst:1498 msgid "" "``easy_install``, ``pkg_resources``, ``setuptools`` and ``distutils`` are no " "longer provided by default in environments created with ``venv`` or " @@ -1877,35 +2185,35 @@ msgid "" "(typically, using pip)." msgstr "" -#: ../../whatsnew/3.12.rst:1330 +#: ../../whatsnew/3.12.rst:1505 msgid "(Contributed by Pradyun Gedam in :gh:`95299`.)" msgstr "(由 Pradyun Gedam 於 :gh:`95299` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1333 +#: ../../whatsnew/3.12.rst:1508 msgid "enum" -msgstr "" +msgstr "enum" -#: ../../whatsnew/3.12.rst:1335 +#: ../../whatsnew/3.12.rst:1510 msgid "" "Remove :mod:`enum`'s ``EnumMeta.__getattr__``, which is no longer needed for " "enum attribute access. (Contributed by Ethan Furman in :gh:`95083`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1340 +#: ../../whatsnew/3.12.rst:1515 msgid "ftplib" -msgstr "" +msgstr "ftplib" -#: ../../whatsnew/3.12.rst:1342 +#: ../../whatsnew/3.12.rst:1517 msgid "" "Remove :mod:`ftplib`'s ``FTP_TLS.ssl_version`` class attribute: use the " "*context* parameter instead. (Contributed by Victor Stinner in :gh:`94172`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1347 +#: ../../whatsnew/3.12.rst:1522 msgid "gzip" -msgstr "" +msgstr "gzip" -#: ../../whatsnew/3.12.rst:1349 +#: ../../whatsnew/3.12.rst:1524 msgid "" "Remove the ``filename`` attribute of :mod:`gzip`'s :class:`gzip.GzipFile`, " "deprecated since Python 2.6, use the :attr:`~gzip.GzipFile.name` attribute " @@ -1914,11 +2222,11 @@ msgid "" "`94196`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1356 +#: ../../whatsnew/3.12.rst:1531 msgid "hashlib" -msgstr "" +msgstr "hashlib" -#: ../../whatsnew/3.12.rst:1358 +#: ../../whatsnew/3.12.rst:1533 msgid "" "Remove the pure Python implementation of :mod:`hashlib`'s :func:`hashlib." "pbkdf2_hmac()`, deprecated in Python 3.10. Python 3.10 and newer requires " @@ -1927,183 +2235,191 @@ msgid "" "Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1365 ../../whatsnew/3.12.rst:1392 +#: ../../whatsnew/3.12.rst:1540 ../../whatsnew/3.12.rst:1567 msgid "importlib" msgstr "importlib" -#: ../../whatsnew/3.12.rst:1367 +#: ../../whatsnew/3.12.rst:1542 msgid "" "Many previously deprecated cleanups in :mod:`importlib` have now been " "completed:" msgstr "" -#: ../../whatsnew/3.12.rst:1370 +#: ../../whatsnew/3.12.rst:1545 msgid "" "References to, and support for :meth:`!module_repr()` has been removed. " "(Contributed by Barry Warsaw in :gh:`97850`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1373 +#: ../../whatsnew/3.12.rst:1548 msgid "" "``importlib.util.set_package``, ``importlib.util.set_loader`` and " "``importlib.util.module_for_loader`` have all been removed. (Contributed by " "Brett Cannon and Nikita Sobolev in :gh:`65961` and :gh:`97850`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1377 +#: ../../whatsnew/3.12.rst:1552 msgid "" "Support for ``find_loader()`` and ``find_module()`` APIs have been removed. " "(Contributed by Barry Warsaw in :gh:`98040`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1380 +#: ../../whatsnew/3.12.rst:1555 msgid "" "``importlib.abc.Finder``, ``pkgutil.ImpImporter``, and ``pkgutil.ImpLoader`` " "have been removed. (Contributed by Barry Warsaw in :gh:`98040`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1384 ../../whatsnew/3.12.rst:1392 +#: ../../whatsnew/3.12.rst:1559 ../../whatsnew/3.12.rst:1567 msgid "imp" msgstr "imp" -#: ../../whatsnew/3.12.rst:1386 +#: ../../whatsnew/3.12.rst:1561 msgid "" "The :mod:`!imp` module has been removed. (Contributed by Barry Warsaw in :" "gh:`98040`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1389 -msgid "Replace removed :mod:`!imp` functions with :mod:`importlib` functions:" +#: ../../whatsnew/3.12.rst:1564 +msgid "To migrate, consult the following correspondence table:" msgstr "" -#: ../../whatsnew/3.12.rst:1394 +#: ../../whatsnew/3.12.rst:1569 msgid "``imp.NullImporter``" msgstr "``imp.NullImporter``" -#: ../../whatsnew/3.12.rst:1394 +#: ../../whatsnew/3.12.rst:1569 msgid "Insert ``None`` into ``sys.path_importer_cache``" msgstr "" -#: ../../whatsnew/3.12.rst:1395 +#: ../../whatsnew/3.12.rst:1570 msgid "``imp.cache_from_source()``" msgstr "``imp.cache_from_source()``" -#: ../../whatsnew/3.12.rst:1395 +#: ../../whatsnew/3.12.rst:1570 msgid ":func:`importlib.util.cache_from_source`" msgstr ":func:`importlib.util.cache_from_source`" -#: ../../whatsnew/3.12.rst:1396 +#: ../../whatsnew/3.12.rst:1571 msgid "``imp.find_module()``" msgstr "``imp.find_module()``" -#: ../../whatsnew/3.12.rst:1396 +#: ../../whatsnew/3.12.rst:1571 msgid ":func:`importlib.util.find_spec`" msgstr ":func:`importlib.util.find_spec`" -#: ../../whatsnew/3.12.rst:1397 +#: ../../whatsnew/3.12.rst:1572 msgid "``imp.get_magic()``" msgstr "``imp.get_magic()``" -#: ../../whatsnew/3.12.rst:1397 +#: ../../whatsnew/3.12.rst:1572 msgid ":attr:`importlib.util.MAGIC_NUMBER`" msgstr ":attr:`importlib.util.MAGIC_NUMBER`" -#: ../../whatsnew/3.12.rst:1398 +#: ../../whatsnew/3.12.rst:1573 msgid "``imp.get_suffixes()``" msgstr "``imp.get_suffixes()``" -#: ../../whatsnew/3.12.rst:1398 +#: ../../whatsnew/3.12.rst:1573 msgid "" ":attr:`importlib.machinery.SOURCE_SUFFIXES`, :attr:`importlib.machinery." "EXTENSION_SUFFIXES`, and :attr:`importlib.machinery.BYTECODE_SUFFIXES`" msgstr "" -#: ../../whatsnew/3.12.rst:1399 +#: ../../whatsnew/3.12.rst:1574 msgid "``imp.get_tag()``" msgstr "``imp.get_tag()``" -#: ../../whatsnew/3.12.rst:1399 +#: ../../whatsnew/3.12.rst:1574 msgid ":attr:`sys.implementation.cache_tag `" msgstr ":attr:`sys.implementation.cache_tag `" -#: ../../whatsnew/3.12.rst:1400 +#: ../../whatsnew/3.12.rst:1575 msgid "``imp.load_module()``" msgstr "``imp.load_module()``" -#: ../../whatsnew/3.12.rst:1400 +#: ../../whatsnew/3.12.rst:1575 msgid ":func:`importlib.import_module`" msgstr ":func:`importlib.import_module`" -#: ../../whatsnew/3.12.rst:1401 +#: ../../whatsnew/3.12.rst:1576 msgid "``imp.new_module(name)``" msgstr "``imp.new_module(name)``" -#: ../../whatsnew/3.12.rst:1401 +#: ../../whatsnew/3.12.rst:1576 msgid "``types.ModuleType(name)``" msgstr "``types.ModuleType(name)``" -#: ../../whatsnew/3.12.rst:1402 +#: ../../whatsnew/3.12.rst:1577 msgid "``imp.reload()``" msgstr "``imp.reload()``" -#: ../../whatsnew/3.12.rst:1402 +#: ../../whatsnew/3.12.rst:1577 msgid ":func:`importlib.reload`" msgstr ":func:`importlib.reload`" -#: ../../whatsnew/3.12.rst:1403 +#: ../../whatsnew/3.12.rst:1578 msgid "``imp.source_from_cache()``" msgstr "``imp.source_from_cache()``" -#: ../../whatsnew/3.12.rst:1403 +#: ../../whatsnew/3.12.rst:1578 msgid ":func:`importlib.util.source_from_cache`" msgstr ":func:`importlib.util.source_from_cache`" -#: ../../whatsnew/3.12.rst:1406 +#: ../../whatsnew/3.12.rst:1579 +msgid "``imp.load_source()``" +msgstr "``imp.load_source()``" + +#: ../../whatsnew/3.12.rst:1579 +msgid "*See below*" +msgstr "" + +#: ../../whatsnew/3.12.rst:1582 msgid "Replace ``imp.load_source()`` with::" msgstr "" -#: ../../whatsnew/3.12.rst:1421 -msgid "Removed :mod:`!imp` functions and attributes with no replacements:" +#: ../../whatsnew/3.12.rst:1597 +msgid "Remove :mod:`!imp` functions and attributes with no replacements:" msgstr "" -#: ../../whatsnew/3.12.rst:1423 -msgid "undocumented functions:" +#: ../../whatsnew/3.12.rst:1599 +msgid "Undocumented functions:" msgstr "" -#: ../../whatsnew/3.12.rst:1425 +#: ../../whatsnew/3.12.rst:1601 msgid "``imp.init_builtin()``" msgstr "``imp.init_builtin()``" -#: ../../whatsnew/3.12.rst:1426 +#: ../../whatsnew/3.12.rst:1602 msgid "``imp.load_compiled()``" msgstr "``imp.load_compiled()``" -#: ../../whatsnew/3.12.rst:1427 +#: ../../whatsnew/3.12.rst:1603 msgid "``imp.load_dynamic()``" msgstr "``imp.load_dynamic()``" -#: ../../whatsnew/3.12.rst:1428 +#: ../../whatsnew/3.12.rst:1604 msgid "``imp.load_package()``" msgstr "``imp.load_package()``" -#: ../../whatsnew/3.12.rst:1430 +#: ../../whatsnew/3.12.rst:1606 msgid "" "``imp.lock_held()``, ``imp.acquire_lock()``, ``imp.release_lock()``: the " "locking scheme has changed in Python 3.3 to per-module locks." msgstr "" -#: ../../whatsnew/3.12.rst:1432 +#: ../../whatsnew/3.12.rst:1608 msgid "" "``imp.find_module()`` constants: ``SEARCH_ERROR``, ``PY_SOURCE``, " "``PY_COMPILED``, ``C_EXTENSION``, ``PY_RESOURCE``, ``PKG_DIRECTORY``, " "``C_BUILTIN``, ``PY_FROZEN``, ``PY_CODERESOURCE``, ``IMP_HOOK``." msgstr "" -#: ../../whatsnew/3.12.rst:1437 +#: ../../whatsnew/3.12.rst:1613 msgid "io" -msgstr "" +msgstr "io" -#: ../../whatsnew/3.12.rst:1439 +#: ../../whatsnew/3.12.rst:1615 msgid "" "Remove :mod:`io`'s ``io.OpenWrapper`` and ``_pyio.OpenWrapper``, deprecated " "in Python 3.10: just use :func:`open` instead. The :func:`open` (:func:`io." @@ -2112,18 +2428,18 @@ msgid "" "`94169`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1446 +#: ../../whatsnew/3.12.rst:1622 msgid "locale" -msgstr "" +msgstr "locale" -#: ../../whatsnew/3.12.rst:1448 +#: ../../whatsnew/3.12.rst:1624 msgid "" "Remove :mod:`locale`'s :func:`!locale.format` function, deprecated in Python " "3.7: use :func:`locale.format_string` instead. (Contributed by Victor " "Stinner in :gh:`94226`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1452 +#: ../../whatsnew/3.12.rst:1628 msgid "" "``smtpd``: The module has been removed according to the schedule in :pep:" "`594`, having been deprecated in Python 3.4.7 and 3.5.4. Use aiosmtpd_ PyPI " @@ -2131,27 +2447,27 @@ msgid "" "Oleg Iarygin in :gh:`93243`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1463 +#: ../../whatsnew/3.12.rst:1639 msgid "" "The following undocumented :mod:`sqlite3` features, deprecated in Python " "3.10, are now removed:" msgstr "" -#: ../../whatsnew/3.12.rst:1466 +#: ../../whatsnew/3.12.rst:1642 msgid "``sqlite3.enable_shared_cache()``" msgstr "``sqlite3.enable_shared_cache()``" -#: ../../whatsnew/3.12.rst:1467 +#: ../../whatsnew/3.12.rst:1643 msgid "``sqlite3.OptimizedUnicode``" msgstr "``sqlite3.OptimizedUnicode``" -#: ../../whatsnew/3.12.rst:1469 +#: ../../whatsnew/3.12.rst:1645 msgid "" "If a shared cache must be used, open the database in URI mode using the " "``cache=shared`` query parameter." msgstr "" -#: ../../whatsnew/3.12.rst:1472 +#: ../../whatsnew/3.12.rst:1648 msgid "" "The ``sqlite3.OptimizedUnicode`` text factory has been an alias for :class:" "`str` since Python 3.3. Code that previously set the text factory to " @@ -2159,22 +2475,22 @@ msgid "" "default value which is also ``str``." msgstr "" -#: ../../whatsnew/3.12.rst:1477 +#: ../../whatsnew/3.12.rst:1653 msgid "(Contributed by Erlend E. Aasland in :gh:`92548`.)" msgstr "(由 Erlend E. Aasland 於 :gh:`92548` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1480 +#: ../../whatsnew/3.12.rst:1656 msgid "ssl" -msgstr "" +msgstr "ssl" -#: ../../whatsnew/3.12.rst:1482 +#: ../../whatsnew/3.12.rst:1658 msgid "" "Remove :mod:`ssl`'s :func:`!ssl.RAND_pseudo_bytes` function, deprecated in " "Python 3.6: use :func:`os.urandom` or :func:`ssl.RAND_bytes` instead. " "(Contributed by Victor Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1486 +#: ../../whatsnew/3.12.rst:1662 msgid "" "Remove the :func:`!ssl.match_hostname` function. It was deprecated in Python " "3.7. OpenSSL performs hostname matching since Python 3.7, Python no longer " @@ -2182,7 +2498,7 @@ msgid "" "Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1492 +#: ../../whatsnew/3.12.rst:1668 msgid "" "Remove the :func:`!ssl.wrap_socket` function, deprecated in Python 3.7: " "instead, create a :class:`ssl.SSLContext` object and call its :class:`ssl." @@ -2193,189 +2509,189 @@ msgid "" "Validation. (Contributed by Victor Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1504 -msgid "Removed many old deprecated :mod:`unittest` features:" +#: ../../whatsnew/3.12.rst:1680 +msgid "Remove many long-deprecated :mod:`unittest` features:" msgstr "" -#: ../../whatsnew/3.12.rst:1506 +#: ../../whatsnew/3.12.rst:1684 msgid "A number of :class:`~unittest.TestCase` method aliases:" msgstr "" -#: ../../whatsnew/3.12.rst:1509 +#: ../../whatsnew/3.12.rst:1687 msgid "Deprecated alias" -msgstr "" +msgstr "已棄用的別名" -#: ../../whatsnew/3.12.rst:1509 +#: ../../whatsnew/3.12.rst:1687 msgid "Method Name" -msgstr "" +msgstr "方法名稱" -#: ../../whatsnew/3.12.rst:1509 +#: ../../whatsnew/3.12.rst:1687 msgid "Deprecated in" msgstr "" -#: ../../whatsnew/3.12.rst:1511 +#: ../../whatsnew/3.12.rst:1689 msgid "``failUnless``" msgstr "``failUnless``" -#: ../../whatsnew/3.12.rst:1511 ../../whatsnew/3.12.rst:1518 +#: ../../whatsnew/3.12.rst:1689 ../../whatsnew/3.12.rst:1696 msgid ":meth:`.assertTrue`" msgstr ":meth:`.assertTrue`" -#: ../../whatsnew/3.12.rst:1511 ../../whatsnew/3.12.rst:1512 -#: ../../whatsnew/3.12.rst:1513 ../../whatsnew/3.12.rst:1514 -#: ../../whatsnew/3.12.rst:1515 ../../whatsnew/3.12.rst:1516 -#: ../../whatsnew/3.12.rst:1517 +#: ../../whatsnew/3.12.rst:1689 ../../whatsnew/3.12.rst:1690 +#: ../../whatsnew/3.12.rst:1691 ../../whatsnew/3.12.rst:1692 +#: ../../whatsnew/3.12.rst:1693 ../../whatsnew/3.12.rst:1694 +#: ../../whatsnew/3.12.rst:1695 msgid "3.1" msgstr "3.1" -#: ../../whatsnew/3.12.rst:1512 +#: ../../whatsnew/3.12.rst:1690 msgid "``failIf``" msgstr "``failIf``" -#: ../../whatsnew/3.12.rst:1512 +#: ../../whatsnew/3.12.rst:1690 msgid ":meth:`.assertFalse`" msgstr ":meth:`.assertFalse`" -#: ../../whatsnew/3.12.rst:1513 +#: ../../whatsnew/3.12.rst:1691 msgid "``failUnlessEqual``" msgstr "``failUnlessEqual``" -#: ../../whatsnew/3.12.rst:1513 ../../whatsnew/3.12.rst:1519 +#: ../../whatsnew/3.12.rst:1691 ../../whatsnew/3.12.rst:1697 msgid ":meth:`.assertEqual`" msgstr ":meth:`.assertEqual`" -#: ../../whatsnew/3.12.rst:1514 +#: ../../whatsnew/3.12.rst:1692 msgid "``failIfEqual``" msgstr "``failIfEqual``" -#: ../../whatsnew/3.12.rst:1514 ../../whatsnew/3.12.rst:1520 +#: ../../whatsnew/3.12.rst:1692 ../../whatsnew/3.12.rst:1698 msgid ":meth:`.assertNotEqual`" msgstr ":meth:`.assertNotEqual`" -#: ../../whatsnew/3.12.rst:1515 +#: ../../whatsnew/3.12.rst:1693 msgid "``failUnlessAlmostEqual``" msgstr "``failUnlessAlmostEqual``" -#: ../../whatsnew/3.12.rst:1515 ../../whatsnew/3.12.rst:1521 +#: ../../whatsnew/3.12.rst:1693 ../../whatsnew/3.12.rst:1699 msgid ":meth:`.assertAlmostEqual`" msgstr ":meth:`.assertAlmostEqual`" -#: ../../whatsnew/3.12.rst:1516 +#: ../../whatsnew/3.12.rst:1694 msgid "``failIfAlmostEqual``" msgstr "``failIfAlmostEqual``" -#: ../../whatsnew/3.12.rst:1516 ../../whatsnew/3.12.rst:1522 +#: ../../whatsnew/3.12.rst:1694 ../../whatsnew/3.12.rst:1700 msgid ":meth:`.assertNotAlmostEqual`" msgstr ":meth:`.assertNotAlmostEqual`" -#: ../../whatsnew/3.12.rst:1517 +#: ../../whatsnew/3.12.rst:1695 msgid "``failUnlessRaises``" msgstr "``failUnlessRaises``" -#: ../../whatsnew/3.12.rst:1517 +#: ../../whatsnew/3.12.rst:1695 msgid ":meth:`.assertRaises`" msgstr ":meth:`.assertRaises`" -#: ../../whatsnew/3.12.rst:1518 +#: ../../whatsnew/3.12.rst:1696 msgid "``assert_``" msgstr "``assert_``" -#: ../../whatsnew/3.12.rst:1518 ../../whatsnew/3.12.rst:1519 -#: ../../whatsnew/3.12.rst:1520 ../../whatsnew/3.12.rst:1521 -#: ../../whatsnew/3.12.rst:1522 ../../whatsnew/3.12.rst:1523 -#: ../../whatsnew/3.12.rst:1524 +#: ../../whatsnew/3.12.rst:1696 ../../whatsnew/3.12.rst:1697 +#: ../../whatsnew/3.12.rst:1698 ../../whatsnew/3.12.rst:1699 +#: ../../whatsnew/3.12.rst:1700 ../../whatsnew/3.12.rst:1701 +#: ../../whatsnew/3.12.rst:1702 msgid "3.2" msgstr "3.2" -#: ../../whatsnew/3.12.rst:1519 +#: ../../whatsnew/3.12.rst:1697 msgid "``assertEquals``" msgstr "``assertEquals``" -#: ../../whatsnew/3.12.rst:1520 +#: ../../whatsnew/3.12.rst:1698 msgid "``assertNotEquals``" msgstr "``assertNotEquals``" -#: ../../whatsnew/3.12.rst:1521 +#: ../../whatsnew/3.12.rst:1699 msgid "``assertAlmostEquals``" msgstr "``assertAlmostEquals``" -#: ../../whatsnew/3.12.rst:1522 +#: ../../whatsnew/3.12.rst:1700 msgid "``assertNotAlmostEquals``" msgstr "``assertNotAlmostEquals``" -#: ../../whatsnew/3.12.rst:1523 +#: ../../whatsnew/3.12.rst:1701 msgid "``assertRegexpMatches``" msgstr "``assertRegexpMatches``" -#: ../../whatsnew/3.12.rst:1523 +#: ../../whatsnew/3.12.rst:1701 msgid ":meth:`.assertRegex`" msgstr ":meth:`.assertRegex`" -#: ../../whatsnew/3.12.rst:1524 +#: ../../whatsnew/3.12.rst:1702 msgid "``assertRaisesRegexp``" msgstr "``assertRaisesRegexp``" -#: ../../whatsnew/3.12.rst:1524 +#: ../../whatsnew/3.12.rst:1702 msgid ":meth:`.assertRaisesRegex`" msgstr ":meth:`.assertRaisesRegex`" -#: ../../whatsnew/3.12.rst:1525 +#: ../../whatsnew/3.12.rst:1703 msgid "``assertNotRegexpMatches``" msgstr "``assertNotRegexpMatches``" -#: ../../whatsnew/3.12.rst:1525 +#: ../../whatsnew/3.12.rst:1703 msgid ":meth:`.assertNotRegex`" msgstr ":meth:`.assertNotRegex`" -#: ../../whatsnew/3.12.rst:1525 +#: ../../whatsnew/3.12.rst:1703 msgid "3.5" msgstr "3.5" -#: ../../whatsnew/3.12.rst:1528 +#: ../../whatsnew/3.12.rst:1706 msgid "" "You can use https://github.com/isidentical/teyit to automatically modernise " "your unit tests." msgstr "" -#: ../../whatsnew/3.12.rst:1531 +#: ../../whatsnew/3.12.rst:1709 msgid "" "Undocumented and broken :class:`~unittest.TestCase` method " "``assertDictContainsSubset`` (deprecated in Python 3.2)." msgstr "" -#: ../../whatsnew/3.12.rst:1534 +#: ../../whatsnew/3.12.rst:1712 msgid "" "Undocumented :meth:`TestLoader.loadTestsFromModule ` parameter *use_load_tests* (deprecated and ignored " "since Python 3.2)." msgstr "" -#: ../../whatsnew/3.12.rst:1538 +#: ../../whatsnew/3.12.rst:1716 msgid "" "An alias of the :class:`~unittest.TextTestResult` class: ``_TextTestResult`` " "(deprecated in Python 3.2)." msgstr "" -#: ../../whatsnew/3.12.rst:1541 -msgid "(Contributed by Serhiy Storchaka in :issue:`45162`.)" -msgstr "(由 Serhiy Storchaka 於 :issue:`45162` 中貢獻。)" +#: ../../whatsnew/3.12.rst:1719 +msgid "(Contributed by Serhiy Storchaka in :gh:`89325`.)" +msgstr "(由 Serhiy Storchaka 於 :gh:`89325` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1544 +#: ../../whatsnew/3.12.rst:1722 msgid "webbrowser" -msgstr "" +msgstr "webbrowser" -#: ../../whatsnew/3.12.rst:1546 +#: ../../whatsnew/3.12.rst:1724 msgid "" -"Remove support for obsolete browsers from :mod:`webbrowser`. Removed " +"Remove support for obsolete browsers from :mod:`webbrowser`. The removed " "browsers include: Grail, Mosaic, Netscape, Galeon, Skipstone, Iceape, " "Firebird, and Firefox versions 35 and below (:gh:`102871`)." msgstr "" -#: ../../whatsnew/3.12.rst:1551 +#: ../../whatsnew/3.12.rst:1729 msgid "xml.etree.ElementTree" -msgstr "" +msgstr "xml.etree.ElementTree" -#: ../../whatsnew/3.12.rst:1553 +#: ../../whatsnew/3.12.rst:1731 msgid "" "Remove the ``ElementTree.Element.copy()`` method of the pure Python " "implementation, deprecated in Python 3.10, use the :func:`copy.copy` " @@ -2384,29 +2700,30 @@ msgid "" "Stinner in :gh:`94383`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1560 +#: ../../whatsnew/3.12.rst:1738 msgid "zipimport" -msgstr "" +msgstr "zipimport" -#: ../../whatsnew/3.12.rst:1562 +#: ../../whatsnew/3.12.rst:1740 msgid "" "Remove :mod:`zipimport`'s ``find_loader()`` and ``find_module()`` methods, " "deprecated in Python 3.10: use the ``find_spec()`` method instead. See :pep:" "`451` for the rationale. (Contributed by Victor Stinner in :gh:`94379`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1568 +#: ../../whatsnew/3.12.rst:1746 msgid "Others" -msgstr "" +msgstr "其他" -#: ../../whatsnew/3.12.rst:1570 +#: ../../whatsnew/3.12.rst:1748 msgid "" -"Removed the ``suspicious`` rule from the documentation Makefile, and removed " -"``Doc/tools/rstlint.py``, both in favor of `sphinx-lint `_. (Contributed by Julien Palard in :gh:`98179`.)" +"Remove the ``suspicious`` rule from the documentation :file:`Makefile` and :" +"file:`Doc/tools/rstlint.py`, both in favor of `sphinx-lint `_. (Contributed by Julien Palard in :gh:" +"`98179`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1575 +#: ../../whatsnew/3.12.rst:1753 msgid "" "Remove the *keyfile* and *certfile* parameters from the :mod:`ftplib`, :mod:" "`imaplib`, :mod:`poplib` and :mod:`smtplib` modules, and the *key_file*, " @@ -2416,21 +2733,21 @@ msgid "" "in :gh:`94172`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1586 ../../whatsnew/3.12.rst:1898 +#: ../../whatsnew/3.12.rst:1764 ../../whatsnew/3.12.rst:2079 msgid "Porting to Python 3.12" msgstr "" -#: ../../whatsnew/3.12.rst:1588 +#: ../../whatsnew/3.12.rst:1766 msgid "" "This section lists previously described changes and other bugfixes that may " "require changes to your code." msgstr "" -#: ../../whatsnew/3.12.rst:1592 +#: ../../whatsnew/3.12.rst:1770 msgid "Changes in the Python API" msgstr "" -#: ../../whatsnew/3.12.rst:1594 +#: ../../whatsnew/3.12.rst:1772 msgid "" "More strict rules are now applied for numerical group references and group " "names in regular expressions. Only sequence of ASCII digits is now accepted " @@ -2439,9 +2756,9 @@ msgid "" "(Contributed by Serhiy Storchaka in :gh:`91760`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1601 +#: ../../whatsnew/3.12.rst:1779 msgid "" -"Removed ``randrange()`` functionality deprecated since Python 3.10. " +"Remove ``randrange()`` functionality deprecated since Python 3.10. " "Formerly, ``randrange(10.0)`` losslessly converted to ``randrange(10)``. " "Now, it raises a :exc:`TypeError`. Also, the exception raised for non-" "integer values such as ``randrange(10.5)`` or ``randrange('10')`` has been " @@ -2451,7 +2768,7 @@ msgid "" "`86388`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1609 +#: ../../whatsnew/3.12.rst:1787 msgid "" ":class:`argparse.ArgumentParser` changed encoding and error handler for " "reading arguments from file (e.g. ``fromfile_prefix_chars`` option) from " @@ -2461,21 +2778,21 @@ msgid "" "on Windows." msgstr "" -#: ../../whatsnew/3.12.rst:1615 +#: ../../whatsnew/3.12.rst:1793 msgid "" -"Removed the ``asyncore``-based ``smtpd`` module deprecated in Python 3.4.7 " +"Remove the ``asyncore``-based ``smtpd`` module deprecated in Python 3.4.7 " "and 3.5.4. A recommended replacement is the :mod:`asyncio`-based aiosmtpd_ " "PyPI module." msgstr "" -#: ../../whatsnew/3.12.rst:1619 +#: ../../whatsnew/3.12.rst:1797 msgid "" ":func:`shlex.split`: Passing ``None`` for *s* argument now raises an " "exception, rather than reading :data:`sys.stdin`. The feature was deprecated " "in Python 3.9. (Contributed by Victor Stinner in :gh:`94352`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1624 +#: ../../whatsnew/3.12.rst:1802 msgid "" "The :mod:`os` module no longer accepts bytes-like paths, like :class:" "`bytearray` and :class:`memoryview` types: only the exact :class:`bytes` " @@ -2483,7 +2800,7 @@ msgid "" "`98393`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1629 +#: ../../whatsnew/3.12.rst:1807 msgid "" ":func:`syslog.openlog` and :func:`syslog.closelog` now fail if used in " "subinterpreters. :func:`syslog.syslog` may still be used in subinterpreters, " @@ -2492,10 +2809,10 @@ msgid "" "only a very small set of users might be affected. This change helps with " "interpreter isolation. Furthermore, :mod:`syslog` is a wrapper around " "process-global resources, which are best managed from the main interpreter. " -"(Contributed by Dong-hee Na in :gh:`99127`.)" +"(Contributed by Donghee Na in :gh:`99127`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1638 +#: ../../whatsnew/3.12.rst:1816 msgid "" "The undocumented locking behavior of :func:`~functools.cached_property` is " "removed, because it locked across all instances of the class, leading to " @@ -2507,14 +2824,14 @@ msgid "" "property getter function or around multi-threaded access points." msgstr "" -#: ../../whatsnew/3.12.rst:1651 +#: ../../whatsnew/3.12.rst:1829 msgid "" "When extracting tar files using :mod:`tarfile` or :func:`shutil." "unpack_archive`, pass the *filter* argument to limit features that may be " "surprising or dangerous. See :ref:`tarfile-extraction-filter` for details." msgstr "" -#: ../../whatsnew/3.12.rst:1656 +#: ../../whatsnew/3.12.rst:1834 msgid "" "The output of the :func:`tokenize.tokenize` and :func:`tokenize." "generate_tokens` functions is now changed due to the changes introduced in :" @@ -2526,231 +2843,231 @@ msgid "" "``f\"start {1+1} end\"`` the old version of the tokenizer emitted::" msgstr "" -#: ../../whatsnew/3.12.rst:1667 +#: ../../whatsnew/3.12.rst:1845 msgid "while the new version emits::" msgstr "" -#: ../../whatsnew/3.12.rst:1679 +#: ../../whatsnew/3.12.rst:1857 msgid "" "Additionally, there may be some minor behavioral changes as a consequence of " "the changes required to support :pep:`701`. Some of these changes include:" msgstr "" -#: ../../whatsnew/3.12.rst:1682 +#: ../../whatsnew/3.12.rst:1860 msgid "" "The ``type`` attribute of the tokens emitted when tokenizing some invalid " "Python characters such as ``!`` has changed from ``ERRORTOKEN`` to ``OP``." msgstr "" -#: ../../whatsnew/3.12.rst:1685 +#: ../../whatsnew/3.12.rst:1863 msgid "" "Incomplete single-line strings now also raise :exc:`tokenize.TokenError` as " "incomplete multiline strings do." msgstr "" -#: ../../whatsnew/3.12.rst:1688 +#: ../../whatsnew/3.12.rst:1866 msgid "" "Some incomplete or invalid Python code now raises :exc:`tokenize.TokenError` " "instead of returning arbitrary ``ERRORTOKEN`` tokens when tokenizing it." msgstr "" -#: ../../whatsnew/3.12.rst:1691 +#: ../../whatsnew/3.12.rst:1869 msgid "" "Mixing tabs and spaces as indentation in the same file is not supported " "anymore and will raise a :exc:`TabError`." msgstr "" -#: ../../whatsnew/3.12.rst:1695 +#: ../../whatsnew/3.12.rst:1873 msgid "Build Changes" msgstr "" -#: ../../whatsnew/3.12.rst:1697 +#: ../../whatsnew/3.12.rst:1875 msgid "" -"Python no longer uses ``setup.py`` to build shared C extension modules. " +"Python no longer uses :file:`setup.py` to build shared C extension modules. " "Build parameters like headers and libraries are detected in ``configure`` " -"script. Extensions are built by ``Makefile``. Most extensions use ``pkg-" +"script. Extensions are built by :file:`Makefile`. Most extensions use ``pkg-" "config`` and fall back to manual detection. (Contributed by Christian Heimes " "in :gh:`93939`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1703 +#: ../../whatsnew/3.12.rst:1881 msgid "" "``va_start()`` with two parameters, like ``va_start(args, format),`` is now " "required to build Python. ``va_start()`` is no longer called with a single " "parameter. (Contributed by Kumar Aditya in :gh:`93207`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1708 +#: ../../whatsnew/3.12.rst:1886 msgid "" "CPython now uses the ThinLTO option as the default link time optimization " -"policy if the Clang compiler accepts the flag. (Contributed by Dong-hee Na " +"policy if the Clang compiler accepts the flag. (Contributed by Donghee Na " "in :gh:`89536`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1712 +#: ../../whatsnew/3.12.rst:1890 msgid "" -"Add ``COMPILEALL_OPTS`` variable in Makefile to override :mod:`compileall` " -"options (default: ``-j0``) in ``make install``. Also merged the 3 " -"``compileall`` commands into a single command to build .pyc files for all " +"Add ``COMPILEALL_OPTS`` variable in :file:`Makefile` to override :mod:" +"`compileall` options (default: ``-j0``) in ``make install``. Also merged the " +"3 ``compileall`` commands into a single command to build .pyc files for all " "optimization levels (0, 1, 2) at once. (Contributed by Victor Stinner in :gh:" "`99289`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1718 +#: ../../whatsnew/3.12.rst:1896 msgid "Add platform triplets for 64-bit LoongArch:" msgstr "" -#: ../../whatsnew/3.12.rst:1720 +#: ../../whatsnew/3.12.rst:1898 msgid "loongarch64-linux-gnusf" msgstr "loongarch64-linux-gnusf" -#: ../../whatsnew/3.12.rst:1721 +#: ../../whatsnew/3.12.rst:1899 msgid "loongarch64-linux-gnuf32" msgstr "loongarch64-linux-gnuf32" -#: ../../whatsnew/3.12.rst:1722 +#: ../../whatsnew/3.12.rst:1900 msgid "loongarch64-linux-gnu" msgstr "loongarch64-linux-gnu" -#: ../../whatsnew/3.12.rst:1724 +#: ../../whatsnew/3.12.rst:1902 msgid "(Contributed by Zhang Na in :gh:`90656`.)" msgstr "(由 Zhang Na 於 :gh:`90656` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1726 +#: ../../whatsnew/3.12.rst:1904 msgid "``PYTHON_FOR_REGEN`` now require Python 3.10 or newer." msgstr "" -#: ../../whatsnew/3.12.rst:1728 +#: ../../whatsnew/3.12.rst:1906 msgid "" "Autoconf 2.71 and aclocal 1.16.4 is now required to regenerate :file:`!" "configure`. (Contributed by Christian Heimes in :gh:`89886`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1732 +#: ../../whatsnew/3.12.rst:1910 msgid "" "Windows builds and macOS installers from python.org now use OpenSSL 3.0." msgstr "" -#: ../../whatsnew/3.12.rst:1736 +#: ../../whatsnew/3.12.rst:1914 msgid "C API Changes" msgstr "" -#: ../../whatsnew/3.12.rst:1742 +#: ../../whatsnew/3.12.rst:1921 msgid "" -":pep:`697`: Introduced the :ref:`Unstable C API tier `, " +":pep:`697`: Introduce the :ref:`Unstable C API tier `, " "intended for low-level tools like debuggers and JIT compilers. This API may " "change in each minor release of CPython without deprecation warnings. Its " "contents are marked by the ``PyUnstable_`` prefix in names." msgstr "" -#: ../../whatsnew/3.12.rst:1748 +#: ../../whatsnew/3.12.rst:1927 msgid "Code object constructors:" msgstr "" -#: ../../whatsnew/3.12.rst:1750 +#: ../../whatsnew/3.12.rst:1929 msgid "``PyUnstable_Code_New()`` (renamed from ``PyCode_New``)" msgstr "" -#: ../../whatsnew/3.12.rst:1751 +#: ../../whatsnew/3.12.rst:1930 msgid "" "``PyUnstable_Code_NewWithPosOnlyArgs()`` (renamed from " "``PyCode_NewWithPosOnlyArgs``)" msgstr "" -#: ../../whatsnew/3.12.rst:1753 +#: ../../whatsnew/3.12.rst:1932 msgid "Extra storage for code objects (:pep:`523`):" msgstr "" -#: ../../whatsnew/3.12.rst:1755 +#: ../../whatsnew/3.12.rst:1934 msgid "" "``PyUnstable_Eval_RequestCodeExtraIndex()`` (renamed from " "``_PyEval_RequestCodeExtraIndex``)" msgstr "" -#: ../../whatsnew/3.12.rst:1756 +#: ../../whatsnew/3.12.rst:1935 msgid "``PyUnstable_Code_GetExtra()`` (renamed from ``_PyCode_GetExtra``)" msgstr "" -#: ../../whatsnew/3.12.rst:1757 +#: ../../whatsnew/3.12.rst:1936 msgid "``PyUnstable_Code_SetExtra()`` (renamed from ``_PyCode_SetExtra``)" msgstr "" -#: ../../whatsnew/3.12.rst:1759 +#: ../../whatsnew/3.12.rst:1938 msgid "" "The original names will continue to be available until the respective API " "changes." msgstr "" -#: ../../whatsnew/3.12.rst:1762 +#: ../../whatsnew/3.12.rst:1941 msgid "(Contributed by Petr Viktorin in :gh:`101101`.)" msgstr "(由 Petr Viktorin 於 :gh:`101101` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1764 +#: ../../whatsnew/3.12.rst:1943 msgid "" -":pep:`697`: Added API for extending types whose instance memory layout is " +":pep:`697`: Add an API for extending types whose instance memory layout is " "opaque:" msgstr "" -#: ../../whatsnew/3.12.rst:1767 +#: ../../whatsnew/3.12.rst:1946 msgid "" ":c:member:`PyType_Spec.basicsize` can be zero or negative to specify " "inheriting or extending the base class size." msgstr "" -#: ../../whatsnew/3.12.rst:1769 +#: ../../whatsnew/3.12.rst:1948 msgid "" ":c:func:`PyObject_GetTypeData` and :c:func:`PyType_GetTypeDataSize` added to " "allow access to subclass-specific instance data." msgstr "" -#: ../../whatsnew/3.12.rst:1771 +#: ../../whatsnew/3.12.rst:1950 msgid "" ":c:macro:`Py_TPFLAGS_ITEMS_AT_END` and :c:func:`PyObject_GetItemData` added " "to allow safely extending certain variable-sized types, including :c:var:" "`PyType_Type`." msgstr "" -#: ../../whatsnew/3.12.rst:1774 +#: ../../whatsnew/3.12.rst:1953 msgid "" ":c:macro:`Py_RELATIVE_OFFSET` added to allow defining :c:type:`members " "` in terms of a subclass-specific struct." msgstr "" -#: ../../whatsnew/3.12.rst:1777 +#: ../../whatsnew/3.12.rst:1956 msgid "(Contributed by Petr Viktorin in :gh:`103509`.)" msgstr "(由 Petr Viktorin 於 :gh:`103509` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1779 +#: ../../whatsnew/3.12.rst:1958 msgid "" -"Added the new :ref:`limited C API ` function :c:func:" +"Add the new :ref:`limited C API ` function :c:func:" "`PyType_FromMetaclass`, which generalizes the existing :c:func:" "`PyType_FromModuleAndSpec` using an additional metaclass argument. " "(Contributed by Wenzel Jakob in :gh:`93012`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1784 +#: ../../whatsnew/3.12.rst:1963 msgid "" "API for creating objects that can be called using :ref:`the vectorcall " "protocol ` was added to the :ref:`Limited API `:" msgstr "" -#: ../../whatsnew/3.12.rst:1788 +#: ../../whatsnew/3.12.rst:1967 msgid ":c:macro:`Py_TPFLAGS_HAVE_VECTORCALL`" msgstr "" -#: ../../whatsnew/3.12.rst:1789 +#: ../../whatsnew/3.12.rst:1968 msgid ":c:func:`PyVectorcall_NARGS`" msgstr ":c:func:`PyVectorcall_NARGS`" -#: ../../whatsnew/3.12.rst:1790 +#: ../../whatsnew/3.12.rst:1969 msgid ":c:func:`PyVectorcall_Call`" msgstr ":c:func:`PyVectorcall_Call`" -#: ../../whatsnew/3.12.rst:1791 +#: ../../whatsnew/3.12.rst:1970 msgid ":c:type:`vectorcallfunc`" msgstr ":c:type:`vectorcallfunc`" -#: ../../whatsnew/3.12.rst:1793 +#: ../../whatsnew/3.12.rst:1972 msgid "" "The :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` flag is now removed from a class " "when the class's :py:meth:`~object.__call__` method is reassigned. This " @@ -2761,7 +3078,7 @@ msgid "" "`93274`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1801 +#: ../../whatsnew/3.12.rst:1980 msgid "" "The :c:macro:`Py_TPFLAGS_MANAGED_DICT` and :c:macro:" "`Py_TPFLAGS_MANAGED_WEAKREF` flags have been added. This allows extensions " @@ -2769,47 +3086,47 @@ msgid "" "using less memory and with faster access." msgstr "" -#: ../../whatsnew/3.12.rst:1806 +#: ../../whatsnew/3.12.rst:1985 msgid "" "API for performing calls using :ref:`the vectorcall protocol ` " "was added to the :ref:`Limited API `:" msgstr "" -#: ../../whatsnew/3.12.rst:1810 +#: ../../whatsnew/3.12.rst:1989 msgid ":c:func:`PyObject_Vectorcall`" msgstr ":c:func:`PyObject_Vectorcall`" -#: ../../whatsnew/3.12.rst:1811 +#: ../../whatsnew/3.12.rst:1990 msgid ":c:func:`PyObject_VectorcallMethod`" msgstr ":c:func:`PyObject_VectorcallMethod`" -#: ../../whatsnew/3.12.rst:1812 +#: ../../whatsnew/3.12.rst:1991 msgid ":c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET`" -msgstr "" +msgstr ":c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET`" -#: ../../whatsnew/3.12.rst:1814 +#: ../../whatsnew/3.12.rst:1993 msgid "" "This means that both the incoming and outgoing ends of the vector call " "protocol are now available in the :ref:`Limited API `. (Contributed " "by Wenzel Jakob in :gh:`98586`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1818 +#: ../../whatsnew/3.12.rst:1997 msgid "" -"Added two new public functions, :c:func:`PyEval_SetProfileAllThreads` and :c:" +"Add two new public functions, :c:func:`PyEval_SetProfileAllThreads` and :c:" "func:`PyEval_SetTraceAllThreads`, that allow to set tracing and profiling " "functions in all running threads in addition to the calling one. " "(Contributed by Pablo Galindo in :gh:`93503`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1824 +#: ../../whatsnew/3.12.rst:2003 msgid "" -"Added new function :c:func:`PyFunction_SetVectorcall` to the C API which " -"sets the vectorcall field of a given :c:type:`PyFunctionObject`. " -"(Contributed by Andrew Frost in :gh:`92257`.)" +"Add new function :c:func:`PyFunction_SetVectorcall` to the C API which sets " +"the vectorcall field of a given :c:type:`PyFunctionObject`. (Contributed by " +"Andrew Frost in :gh:`92257`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1828 +#: ../../whatsnew/3.12.rst:2007 msgid "" "The C API now permits registering callbacks via :c:func:" "`PyDict_AddWatcher`, :c:func:`PyDict_Watch` and related APIs to be called " @@ -2818,28 +3135,28 @@ msgid "" "`91052`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1834 +#: ../../whatsnew/3.12.rst:2013 msgid "" -"Added :c:func:`PyType_AddWatcher` and :c:func:`PyType_Watch` API to register " +"Add :c:func:`PyType_AddWatcher` and :c:func:`PyType_Watch` API to register " "callbacks to receive notification on changes to a type. (Contributed by Carl " "Meyer in :gh:`91051`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1838 +#: ../../whatsnew/3.12.rst:2017 msgid "" -"Added :c:func:`PyCode_AddWatcher` and :c:func:`PyCode_ClearWatcher` APIs to " +"Add :c:func:`PyCode_AddWatcher` and :c:func:`PyCode_ClearWatcher` APIs to " "register callbacks to receive notification on creation and destruction of " -"code objects. (Contributed by Itamar Ostricher in :gh:`91054`.)" +"code objects. (Contributed by Itamar Oren in :gh:`91054`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1843 +#: ../../whatsnew/3.12.rst:2022 msgid "" "Add :c:func:`PyFrame_GetVar` and :c:func:`PyFrame_GetVarString` functions to " "get a frame variable by its name. (Contributed by Victor Stinner in :gh:" "`91248`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1847 +#: ../../whatsnew/3.12.rst:2026 msgid "" "Add :c:func:`PyErr_GetRaisedException` and :c:func:" "`PyErr_SetRaisedException` for saving and restoring the current exception. " @@ -2849,14 +3166,14 @@ msgid "" "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1855 +#: ../../whatsnew/3.12.rst:2034 msgid "" "Add ``_PyErr_ChainExceptions1``, which takes an exception instance, to " "replace the legacy-API ``_PyErr_ChainExceptions``, which is now deprecated. " "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1859 +#: ../../whatsnew/3.12.rst:2038 msgid "" "Add :c:func:`PyException_GetArgs` and :c:func:`PyException_SetArgs` as " "convenience functions for retrieving and modifying the :attr:`~BaseException." @@ -2864,99 +3181,99 @@ msgid "" "in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1864 +#: ../../whatsnew/3.12.rst:2043 msgid "" "Add :c:func:`PyErr_DisplayException`, which takes an exception instance, to " "replace the legacy-api :c:func:`!PyErr_Display`. (Contributed by Irit " "Katriel in :gh:`102755`)." msgstr "" -#: ../../whatsnew/3.12.rst:1868 +#: ../../whatsnew/3.12.rst:2049 msgid "" -":pep:`683`: Introduced Immortal Objects to Python which allows objects to " -"bypass reference counts and introduced changes to the C-API:" +":pep:`683`: Introduce *Immortal Objects*, which allows objects to bypass " +"reference counts, and related changes to the C-API:" msgstr "" -#: ../../whatsnew/3.12.rst:1871 +#: ../../whatsnew/3.12.rst:2052 msgid "``_Py_IMMORTAL_REFCNT``: The reference count that defines an object" msgstr "" -#: ../../whatsnew/3.12.rst:1872 +#: ../../whatsnew/3.12.rst:2053 msgid "as immortal." msgstr "" -#: ../../whatsnew/3.12.rst:1873 +#: ../../whatsnew/3.12.rst:2054 msgid "" "``_Py_IsImmortal`` Checks if an object has the immortal reference count." msgstr "" -#: ../../whatsnew/3.12.rst:1874 +#: ../../whatsnew/3.12.rst:2055 msgid "``PyObject_HEAD_INIT`` This will now initialize reference count to" msgstr "" -#: ../../whatsnew/3.12.rst:1875 +#: ../../whatsnew/3.12.rst:2056 msgid "``_Py_IMMORTAL_REFCNT`` when used with ``Py_BUILD_CORE``." msgstr "" -#: ../../whatsnew/3.12.rst:1876 +#: ../../whatsnew/3.12.rst:2057 msgid "``SSTATE_INTERNED_IMMORTAL`` An identifier for interned unicode objects" msgstr "" -#: ../../whatsnew/3.12.rst:1877 +#: ../../whatsnew/3.12.rst:2058 msgid "that are immortal." msgstr "" -#: ../../whatsnew/3.12.rst:1878 +#: ../../whatsnew/3.12.rst:2059 msgid "``SSTATE_INTERNED_IMMORTAL_STATIC`` An identifier for interned unicode" msgstr "" -#: ../../whatsnew/3.12.rst:1879 +#: ../../whatsnew/3.12.rst:2060 msgid "objects that are immortal and static" msgstr "" -#: ../../whatsnew/3.12.rst:1882 +#: ../../whatsnew/3.12.rst:2063 msgid "``sys.getunicodeinternedsize`` This returns the total number of unicode" msgstr "" -#: ../../whatsnew/3.12.rst:1881 +#: ../../whatsnew/3.12.rst:2062 msgid "" -"objects that have been interned. This is now needed for refleak.py to " -"correctly track reference counts and allocated blocks" +"objects that have been interned. This is now needed for :file:`refleak.py` " +"to correctly track reference counts and allocated blocks" msgstr "" -#: ../../whatsnew/3.12.rst:1884 +#: ../../whatsnew/3.12.rst:2065 msgid "(Contributed by Eddie Elizondo in :gh:`84436`.)" msgstr "(由 Eddie Elizondo 於 :gh:`84436` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1886 +#: ../../whatsnew/3.12.rst:2067 msgid "" -":pep:`684`: Added the new :c:func:`Py_NewInterpreterFromConfig` function " -"and :c:type:`PyInterpreterConfig`, which may be used to create sub-" -"interpreters with their own GILs. (See :ref:`whatsnew312-pep684` for more " -"info.) (Contributed by Eric Snow in :gh:`104110`.)" +":pep:`684`: Add the new :c:func:`Py_NewInterpreterFromConfig` function and :" +"c:type:`PyInterpreterConfig`, which may be used to create sub-interpreters " +"with their own GILs. (See :ref:`whatsnew312-pep684` for more info.) " +"(Contributed by Eric Snow in :gh:`104110`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1892 +#: ../../whatsnew/3.12.rst:2073 msgid "" "In the limited C API version 3.12, :c:func:`Py_INCREF` and :c:func:" "`Py_DECREF` functions are now implemented as opaque function calls to hide " "implementation details. (Contributed by Victor Stinner in :gh:`105387`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1900 +#: ../../whatsnew/3.12.rst:2081 msgid "" "Legacy Unicode APIs based on ``Py_UNICODE*`` representation has been " "removed. Please migrate to APIs based on UTF-8 or ``wchar_t*``." msgstr "" -#: ../../whatsnew/3.12.rst:1903 +#: ../../whatsnew/3.12.rst:2084 msgid "" "Argument parsing functions like :c:func:`PyArg_ParseTuple` doesn't support " "``Py_UNICODE*`` based format (e.g. ``u``, ``Z``) anymore. Please migrate to " "other formats for Unicode like ``s``, ``z``, ``es``, and ``U``." msgstr "" -#: ../../whatsnew/3.12.rst:1907 +#: ../../whatsnew/3.12.rst:2088 msgid "" "``tp_weaklist`` for all static builtin types is always ``NULL``. This is an " "internal-only field on ``PyTypeObject`` but we're pointing out the change in " @@ -2965,7 +3282,7 @@ msgid "" "necessary, the (internal-only) ``_PyObject_GET_WEAKREFS_LISTPTR()`` macro." msgstr "" -#: ../../whatsnew/3.12.rst:1914 +#: ../../whatsnew/3.12.rst:2095 msgid "" "This internal-only :c:member:`PyTypeObject.tp_subclasses` may now not be a " "valid object pointer. Its type was changed to :c:expr:`void *` to reflect " @@ -2973,13 +3290,13 @@ msgid "" "only field directly." msgstr "" -#: ../../whatsnew/3.12.rst:1919 +#: ../../whatsnew/3.12.rst:2100 msgid "" "To get a list of subclasses, call the Python method :py:meth:`~class." "__subclasses__` (using :c:func:`PyObject_CallMethod`, for example)." msgstr "" -#: ../../whatsnew/3.12.rst:1923 +#: ../../whatsnew/3.12.rst:2104 msgid "" "Add support of more formatting options (left aligning, octals, uppercase " "hexadecimals, :c:type:`intmax_t`, :c:type:`ptrdiff_t`, :c:type:`wchar_t` C " @@ -2988,7 +3305,7 @@ msgid "" "`98836`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1929 +#: ../../whatsnew/3.12.rst:2110 msgid "" "An unrecognized format character in :c:func:`PyUnicode_FromFormat` and :c:" "func:`PyUnicode_FromFormatV` now sets a :exc:`SystemError`. In previous " @@ -2997,13 +3314,13 @@ msgid "" "Storchaka in :gh:`95781`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1935 +#: ../../whatsnew/3.12.rst:2116 msgid "" -"Fixed wrong sign placement in :c:func:`PyUnicode_FromFormat` and :c:func:" +"Fix wrong sign placement in :c:func:`PyUnicode_FromFormat` and :c:func:" "`PyUnicode_FromFormatV`. (Contributed by Philip Georgi in :gh:`95504`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1939 +#: ../../whatsnew/3.12.rst:2120 msgid "" "Extension classes wanting to add a ``__dict__`` or weak reference slot " "should use :c:macro:`Py_TPFLAGS_MANAGED_DICT` and :c:macro:" @@ -3017,7 +3334,7 @@ msgid "" "func:`PyObject_ClearWeakRefs`, as before." msgstr "" -#: ../../whatsnew/3.12.rst:1951 +#: ../../whatsnew/3.12.rst:2132 msgid "" "The :c:func:`PyUnicode_FSDecoder` function no longer accepts bytes-like " "paths, like :class:`bytearray` and :class:`memoryview` types: only the " @@ -3025,7 +3342,7 @@ msgid "" "Victor Stinner in :gh:`98393`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1956 +#: ../../whatsnew/3.12.rst:2137 msgid "" "The :c:macro:`Py_CLEAR`, :c:macro:`Py_SETREF` and :c:macro:`Py_XSETREF` " "macros now only evaluate their arguments once. If an argument has side " @@ -3033,7 +3350,7 @@ msgid "" "Stinner in :gh:`98724`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1961 +#: ../../whatsnew/3.12.rst:2142 msgid "" "The interpreter's error indicator is now always normalized. This means that :" "c:func:`PyErr_SetObject`, :c:func:`PyErr_SetString` and the other functions " @@ -3041,7 +3358,7 @@ msgid "" "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1966 +#: ../../whatsnew/3.12.rst:2147 msgid "" "``_Py_RefTotal`` is no longer authoritative and only kept around for ABI " "compatibility. Note that it is an internal global and only available on " @@ -3049,25 +3366,25 @@ msgid "" "``_Py_GetGlobalRefTotal()``." msgstr "" -#: ../../whatsnew/3.12.rst:1971 +#: ../../whatsnew/3.12.rst:2152 msgid "" "The following functions now select an appropriate metaclass for the newly " "created type:" msgstr "" -#: ../../whatsnew/3.12.rst:1974 +#: ../../whatsnew/3.12.rst:2155 msgid ":c:func:`PyType_FromSpec`" msgstr ":c:func:`PyType_FromSpec`" -#: ../../whatsnew/3.12.rst:1975 +#: ../../whatsnew/3.12.rst:2156 msgid ":c:func:`PyType_FromSpecWithBases`" msgstr ":c:func:`PyType_FromSpecWithBases`" -#: ../../whatsnew/3.12.rst:1976 +#: ../../whatsnew/3.12.rst:2157 msgid ":c:func:`PyType_FromModuleAndSpec`" msgstr ":c:func:`PyType_FromModuleAndSpec`" -#: ../../whatsnew/3.12.rst:1978 +#: ../../whatsnew/3.12.rst:2159 msgid "" "Creating classes whose metaclass overrides :c:member:`~PyTypeObject.tp_new` " "is deprecated, and in Python 3.14+ it will be disallowed. Note that these " @@ -3075,14 +3392,14 @@ msgid "" "initialization." msgstr "" -#: ../../whatsnew/3.12.rst:1983 +#: ../../whatsnew/3.12.rst:2164 msgid "" "Note that :c:func:`PyType_FromMetaclass` (added in Python 3.12) already " "disallows creating classes whose metaclass overrides ``tp_new`` (:meth:" "`~object.__new__` in Python)." msgstr "" -#: ../../whatsnew/3.12.rst:1987 +#: ../../whatsnew/3.12.rst:2168 msgid "" "Since ``tp_new`` overrides almost everything ``PyType_From*`` functions do, " "the two are incompatible with each other. The existing behavior -- ignoring " @@ -3091,17 +3408,17 @@ msgid "" "general workaround. One of the following may work for you:" msgstr "" -#: ../../whatsnew/3.12.rst:1994 +#: ../../whatsnew/3.12.rst:2175 msgid "If you control the metaclass, avoid using ``tp_new`` in it:" msgstr "" -#: ../../whatsnew/3.12.rst:1996 +#: ../../whatsnew/3.12.rst:2177 msgid "" "If initialization can be skipped, it can be done in :c:member:`~PyTypeObject." "tp_init` instead." msgstr "" -#: ../../whatsnew/3.12.rst:1998 +#: ../../whatsnew/3.12.rst:2179 msgid "" "If the metaclass doesn't need to be instantiated from Python, set its " "``tp_new`` to ``NULL`` using the :c:macro:" @@ -3109,20 +3426,20 @@ msgid "" "``PyType_From*`` functions." msgstr "" -#: ../../whatsnew/3.12.rst:2003 +#: ../../whatsnew/3.12.rst:2184 msgid "" "Avoid ``PyType_From*`` functions: if you don't need C-specific features " "(slots or setting the instance size), create types by :ref:`calling ` " "the metaclass." msgstr "" -#: ../../whatsnew/3.12.rst:2007 +#: ../../whatsnew/3.12.rst:2188 msgid "" "If you *know* the ``tp_new`` can be skipped safely, filter the deprecation " "warning out using :func:`warnings.catch_warnings` from Python." msgstr "" -#: ../../whatsnew/3.12.rst:2010 +#: ../../whatsnew/3.12.rst:2191 msgid "" ":c:var:`PyOS_InputHook` and :c:var:`PyOS_ReadlineFunctionPointer` are no " "longer called in :ref:`subinterpreters `. This is " @@ -3130,14 +3447,14 @@ msgid "" "callbacks have no way of recovering extension module state)." msgstr "" -#: ../../whatsnew/3.12.rst:2015 +#: ../../whatsnew/3.12.rst:2196 msgid "" "This also avoids situations where extensions may find themselves running in " "a subinterpreter that they don't support (or haven't yet been loaded in). " "See :gh:`104668` for more info." msgstr "" -#: ../../whatsnew/3.12.rst:2019 +#: ../../whatsnew/3.12.rst:2200 msgid "" ":c:struct:`PyLongObject` has had its internals changed for better " "performance. Although the internals of :c:struct:`PyLongObject` are private, " @@ -3148,15 +3465,15 @@ msgid "" "a single machine word:" msgstr "" -#: ../../whatsnew/3.12.rst:2027 +#: ../../whatsnew/3.12.rst:2208 msgid ":c:func:`PyUnstable_Long_IsCompact`" -msgstr "" +msgstr ":c:func:`PyUnstable_Long_IsCompact`" -#: ../../whatsnew/3.12.rst:2028 +#: ../../whatsnew/3.12.rst:2209 msgid ":c:func:`PyUnstable_Long_CompactValue`" -msgstr "" +msgstr ":c:func:`PyUnstable_Long_CompactValue`" -#: ../../whatsnew/3.12.rst:2030 +#: ../../whatsnew/3.12.rst:2211 msgid "" "Custom allocators, set via :c:func:`PyMem_SetAllocator`, are now required to " "be thread-safe, regardless of memory domain. Allocators that don't have " @@ -3165,291 +3482,472 @@ msgid "" "create a new GitHub issue and CC ``@ericsnowcurrently``." msgstr "" -#: ../../whatsnew/3.12.rst:2040 +#: ../../whatsnew/3.12.rst:2221 +msgid "" +"In accordance with :pep:`699`, the ``ma_version_tag`` field in :c:type:" +"`PyDictObject` is deprecated for extension modules. Accessing this field " +"will generate a compiler warning at compile time. This field will be removed " +"in Python 3.14. (Contributed by Ramvikrams and Kumar Aditya in :gh:`101193`. " +"PEP by Ken Jin.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:2226 msgid "Deprecate global configuration variable:" msgstr "" -#: ../../whatsnew/3.12.rst:2042 +#: ../../whatsnew/3.12.rst:2228 ../../whatsnew/3.12.rst:2313 msgid ":c:var:`Py_DebugFlag`: use :c:member:`PyConfig.parser_debug`" msgstr "" -#: ../../whatsnew/3.12.rst:2043 +#: ../../whatsnew/3.12.rst:2229 ../../whatsnew/3.12.rst:2314 msgid ":c:var:`Py_VerboseFlag`: use :c:member:`PyConfig.verbose`" msgstr "" -#: ../../whatsnew/3.12.rst:2044 +#: ../../whatsnew/3.12.rst:2230 ../../whatsnew/3.12.rst:2315 msgid ":c:var:`Py_QuietFlag`: use :c:member:`PyConfig.quiet`" msgstr "" -#: ../../whatsnew/3.12.rst:2045 +#: ../../whatsnew/3.12.rst:2231 ../../whatsnew/3.12.rst:2316 msgid ":c:var:`Py_InteractiveFlag`: use :c:member:`PyConfig.interactive`" msgstr "" -#: ../../whatsnew/3.12.rst:2046 +#: ../../whatsnew/3.12.rst:2232 ../../whatsnew/3.12.rst:2317 msgid ":c:var:`Py_InspectFlag`: use :c:member:`PyConfig.inspect`" msgstr "" -#: ../../whatsnew/3.12.rst:2047 +#: ../../whatsnew/3.12.rst:2233 ../../whatsnew/3.12.rst:2318 msgid ":c:var:`Py_OptimizeFlag`: use :c:member:`PyConfig.optimization_level`" msgstr "" -#: ../../whatsnew/3.12.rst:2048 +#: ../../whatsnew/3.12.rst:2234 ../../whatsnew/3.12.rst:2319 msgid ":c:var:`Py_NoSiteFlag`: use :c:member:`PyConfig.site_import`" msgstr "" -#: ../../whatsnew/3.12.rst:2049 +#: ../../whatsnew/3.12.rst:2235 ../../whatsnew/3.12.rst:2320 msgid ":c:var:`Py_BytesWarningFlag`: use :c:member:`PyConfig.bytes_warning`" msgstr "" -#: ../../whatsnew/3.12.rst:2050 +#: ../../whatsnew/3.12.rst:2236 ../../whatsnew/3.12.rst:2321 msgid ":c:var:`Py_FrozenFlag`: use :c:member:`PyConfig.pathconfig_warnings`" msgstr "" -#: ../../whatsnew/3.12.rst:2051 +#: ../../whatsnew/3.12.rst:2237 ../../whatsnew/3.12.rst:2322 msgid "" ":c:var:`Py_IgnoreEnvironmentFlag`: use :c:member:`PyConfig.use_environment`" msgstr "" -#: ../../whatsnew/3.12.rst:2052 +#: ../../whatsnew/3.12.rst:2238 ../../whatsnew/3.12.rst:2323 msgid "" ":c:var:`Py_DontWriteBytecodeFlag`: use :c:member:`PyConfig.write_bytecode`" msgstr "" -#: ../../whatsnew/3.12.rst:2053 +#: ../../whatsnew/3.12.rst:2239 ../../whatsnew/3.12.rst:2324 msgid "" ":c:var:`Py_NoUserSiteDirectory`: use :c:member:`PyConfig.user_site_directory`" msgstr "" -#: ../../whatsnew/3.12.rst:2054 +#: ../../whatsnew/3.12.rst:2240 ../../whatsnew/3.12.rst:2325 msgid "" ":c:var:`Py_UnbufferedStdioFlag`: use :c:member:`PyConfig.buffered_stdio`" msgstr "" -#: ../../whatsnew/3.12.rst:2055 +#: ../../whatsnew/3.12.rst:2241 ../../whatsnew/3.12.rst:2326 msgid "" ":c:var:`Py_HashRandomizationFlag`: use :c:member:`PyConfig.use_hash_seed` " "and :c:member:`PyConfig.hash_seed`" msgstr "" -#: ../../whatsnew/3.12.rst:2057 +#: ../../whatsnew/3.12.rst:2243 ../../whatsnew/3.12.rst:2328 msgid ":c:var:`Py_IsolatedFlag`: use :c:member:`PyConfig.isolated`" msgstr "" -#: ../../whatsnew/3.12.rst:2058 +#: ../../whatsnew/3.12.rst:2244 ../../whatsnew/3.12.rst:2329 msgid "" ":c:var:`Py_LegacyWindowsFSEncodingFlag`: use :c:member:`PyPreConfig." "legacy_windows_fs_encoding`" msgstr "" -#: ../../whatsnew/3.12.rst:2059 +#: ../../whatsnew/3.12.rst:2245 ../../whatsnew/3.12.rst:2330 msgid "" ":c:var:`Py_LegacyWindowsStdioFlag`: use :c:member:`PyConfig." "legacy_windows_stdio`" msgstr "" -#: ../../whatsnew/3.12.rst:2060 +#: ../../whatsnew/3.12.rst:2246 ../../whatsnew/3.12.rst:2331 msgid "" ":c:var:`!Py_FileSystemDefaultEncoding`: use :c:member:`PyConfig." "filesystem_encoding`" msgstr "" -#: ../../whatsnew/3.12.rst:2061 +#: ../../whatsnew/3.12.rst:2247 ../../whatsnew/3.12.rst:2332 msgid "" ":c:var:`!Py_HasFileSystemDefaultEncoding`: use :c:member:`PyConfig." "filesystem_encoding`" msgstr "" -#: ../../whatsnew/3.12.rst:2062 +#: ../../whatsnew/3.12.rst:2248 ../../whatsnew/3.12.rst:2333 msgid "" ":c:var:`!Py_FileSystemDefaultEncodeErrors`: use :c:member:`PyConfig." "filesystem_errors`" msgstr "" -#: ../../whatsnew/3.12.rst:2063 +#: ../../whatsnew/3.12.rst:2249 ../../whatsnew/3.12.rst:2334 msgid "" ":c:var:`!Py_UTF8Mode`: use :c:member:`PyPreConfig.utf8_mode` (see :c:func:" "`Py_PreInitialize`)" msgstr "" -#: ../../whatsnew/3.12.rst:2065 +#: ../../whatsnew/3.12.rst:2251 msgid "" "The :c:func:`Py_InitializeFromConfig` API should be used with :c:type:" "`PyConfig` instead. (Contributed by Victor Stinner in :gh:`77782`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2069 +#: ../../whatsnew/3.12.rst:2255 msgid "" -"Creating immutable types (:c:macro:`Py_TPFLAGS_IMMUTABLETYPE`) with mutable " -"bases is deprecated and will be disabled in Python 3.14." +"Creating :c:data:`immutable types ` with mutable " +"bases is deprecated and will be disabled in Python 3.14. (:gh:`95388`)" msgstr "" -#: ../../whatsnew/3.12.rst:2072 +#: ../../whatsnew/3.12.rst:2258 msgid "" -"The ``structmember.h`` header is deprecated, though it continues to be " +"The :file:`structmember.h` header is deprecated, though it continues to be " "available and there are no plans to remove it." msgstr "" -#: ../../whatsnew/3.12.rst:2075 +#: ../../whatsnew/3.12.rst:2261 msgid "" -"Its contents are now available just by including ``Python.h``, with a ``Py`` " -"prefix added if it was missing:" +"Its contents are now available just by including :file:`Python.h`, with a " +"``Py`` prefix added if it was missing:" msgstr "" -#: ../../whatsnew/3.12.rst:2078 +#: ../../whatsnew/3.12.rst:2264 msgid "" ":c:struct:`PyMemberDef`, :c:func:`PyMember_GetOne` and :c:func:" "`PyMember_SetOne`" msgstr "" +":c:struct:`PyMemberDef`、:c:func:`PyMember_GetOne` 和 :c:func:" +"`PyMember_SetOne`" -#: ../../whatsnew/3.12.rst:2080 +#: ../../whatsnew/3.12.rst:2266 msgid "" "Type macros like :c:macro:`Py_T_INT`, :c:macro:`Py_T_DOUBLE`, etc. " "(previously ``T_INT``, ``T_DOUBLE``, etc.)" msgstr "" -#: ../../whatsnew/3.12.rst:2082 +#: ../../whatsnew/3.12.rst:2268 msgid "" "The flags :c:macro:`Py_READONLY` (previously ``READONLY``) and :c:macro:" "`Py_AUDIT_READ` (previously all uppercase)" msgstr "" -#: ../../whatsnew/3.12.rst:2085 -msgid "Several items are not exposed from ``Python.h``:" +#: ../../whatsnew/3.12.rst:2271 +msgid "Several items are not exposed from :file:`Python.h`:" msgstr "" -#: ../../whatsnew/3.12.rst:2087 +#: ../../whatsnew/3.12.rst:2273 msgid ":c:macro:`T_OBJECT` (use :c:macro:`Py_T_OBJECT_EX`)" msgstr "" -#: ../../whatsnew/3.12.rst:2088 +#: ../../whatsnew/3.12.rst:2274 msgid ":c:macro:`T_NONE` (previously undocumented, and pretty quirky)" msgstr "" -#: ../../whatsnew/3.12.rst:2089 +#: ../../whatsnew/3.12.rst:2275 msgid "The macro ``WRITE_RESTRICTED`` which does nothing." msgstr "" -#: ../../whatsnew/3.12.rst:2090 +#: ../../whatsnew/3.12.rst:2276 msgid "" "The macros ``RESTRICTED`` and ``READ_RESTRICTED``, equivalents of :c:macro:" "`Py_AUDIT_READ`." msgstr "" -#: ../../whatsnew/3.12.rst:2092 +#: ../../whatsnew/3.12.rst:2278 msgid "" -"In some configurations, ```` is not included from ``Python.h``. It " -"should be included manually when using ``offsetof()``." +"In some configurations, ```` is not included from :file:`Python." +"h`. It should be included manually when using ``offsetof()``." msgstr "" -#: ../../whatsnew/3.12.rst:2095 +#: ../../whatsnew/3.12.rst:2281 msgid "" "The deprecated header continues to provide its original contents under the " "original names. Your old code can stay unchanged, unless the extra include " "and non-namespaced macros bother you greatly." msgstr "" -#: ../../whatsnew/3.12.rst:2100 +#: ../../whatsnew/3.12.rst:2286 msgid "" "(Contributed in :gh:`47146` by Petr Viktorin, based on earlier work by " "Alexander Belopolsky and Matthias Braun.)" msgstr "" -#: ../../whatsnew/3.12.rst:2103 +#: ../../whatsnew/3.12.rst:2289 msgid "" ":c:func:`PyErr_Fetch` and :c:func:`PyErr_Restore` are deprecated. Use :c:" "func:`PyErr_GetRaisedException` and :c:func:`PyErr_SetRaisedException` " "instead. (Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2108 +#: ../../whatsnew/3.12.rst:2294 msgid "" ":c:func:`!PyErr_Display` is deprecated. Use :c:func:`PyErr_DisplayException` " "instead. (Contributed by Irit Katriel in :gh:`102755`)." msgstr "" -#: ../../whatsnew/3.12.rst:2111 +#: ../../whatsnew/3.12.rst:2297 msgid "" "``_PyErr_ChainExceptions`` is deprecated. Use ``_PyErr_ChainExceptions1`` " "instead. (Contributed by Irit Katriel in :gh:`102192`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2114 +#: ../../whatsnew/3.12.rst:2300 msgid "" "Using :c:func:`PyType_FromSpec`, :c:func:`PyType_FromSpecWithBases` or :c:" "func:`PyType_FromModuleAndSpec` to create a class whose metaclass overrides :" "c:member:`~PyTypeObject.tp_new` is deprecated. Call the metaclass instead." msgstr "" -#: ../../whatsnew/3.12.rst:2122 +#: ../../whatsnew/3.12.rst:2308 +msgid "" +"The ``ma_version_tag`` field in :c:type:`PyDictObject` for extension modules " +"(:pep:`699`; :gh:`101193`)." +msgstr "" + +#: ../../whatsnew/3.12.rst:2311 +msgid "Global configuration variables:" +msgstr "" + +#: ../../whatsnew/3.12.rst:2336 +msgid "" +"The :c:func:`Py_InitializeFromConfig` API should be used with :c:type:" +"`PyConfig` instead." +msgstr "" + +#: ../../whatsnew/3.12.rst:2339 +msgid "" +"Creating :c:data:`immutable types ` with mutable " +"bases (:gh:`95388`)." +msgstr "" + +#: ../../whatsnew/3.12.rst:2343 +msgid "Pending Removal in Python 3.15" +msgstr "" + +#: ../../whatsnew/3.12.rst:2345 +msgid "" +":c:func:`PyImport_ImportModuleNoBlock`: use :c:func:`PyImport_ImportModule`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2346 +msgid ":c:type:`!Py_UNICODE_WIDE` type: use :c:type:`wchar_t`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2347 +msgid ":c:type:`Py_UNICODE` type: use :c:type:`wchar_t`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2348 +msgid "Python initialization functions:" +msgstr "" + +#: ../../whatsnew/3.12.rst:2350 +msgid "" +":c:func:`PySys_ResetWarnOptions`: clear :data:`sys.warnoptions` and :data:`!" +"warnings.filters`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2352 +msgid ":c:func:`Py_GetExecPrefix`: get :data:`sys.exec_prefix`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2353 +msgid ":c:func:`Py_GetPath`: get :data:`sys.path`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2354 +msgid ":c:func:`Py_GetPrefix`: get :data:`sys.prefix`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2355 +msgid ":c:func:`Py_GetProgramFullPath`: get :data:`sys.executable`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2356 +msgid ":c:func:`Py_GetProgramName`: get :data:`sys.executable`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2357 +msgid "" +":c:func:`Py_GetPythonHome`: get :c:member:`PyConfig.home` or the :envvar:" +"`PYTHONHOME` environment variable" +msgstr "" + +#: ../../whatsnew/3.12.rst:2363 +msgid "" +"The following APIs are deprecated and will be removed, although there is " +"currently no date scheduled for their removal." +msgstr "" + +#: ../../whatsnew/3.12.rst:2366 +msgid ":c:macro:`Py_TPFLAGS_HAVE_FINALIZE`: unneeded since Python 3.8" +msgstr "" + +#: ../../whatsnew/3.12.rst:2367 +msgid ":c:func:`PyErr_Fetch`: use :c:func:`PyErr_GetRaisedException`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2368 +msgid "" +":c:func:`PyErr_NormalizeException`: use :c:func:`PyErr_GetRaisedException`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2369 +msgid ":c:func:`PyErr_Restore`: use :c:func:`PyErr_SetRaisedException`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2370 +msgid "" +":c:func:`PyModule_GetFilename`: use :c:func:`PyModule_GetFilenameObject`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2371 +msgid ":c:func:`PyOS_AfterFork`: use :c:func:`PyOS_AfterFork_Child`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2372 +msgid "" +":c:func:`PySlice_GetIndicesEx`: use :c:func:`PySlice_Unpack` and :c:func:" +"`PySlice_AdjustIndices`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2373 +msgid ":c:func:`!PyUnicode_AsDecodedObject`: use :c:func:`PyCodec_Decode`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2374 +msgid ":c:func:`!PyUnicode_AsDecodedUnicode`: use :c:func:`PyCodec_Decode`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2375 +msgid ":c:func:`!PyUnicode_AsEncodedObject`: use :c:func:`PyCodec_Encode`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2376 +msgid ":c:func:`!PyUnicode_AsEncodedUnicode`: use :c:func:`PyCodec_Encode`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2377 +msgid ":c:func:`PyUnicode_READY`: unneeded since Python 3.12" +msgstr "" + +#: ../../whatsnew/3.12.rst:2378 +msgid ":c:func:`!PyErr_Display`: use :c:func:`PyErr_DisplayException`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2379 +msgid ":c:func:`!_PyErr_ChainExceptions`: use ``_PyErr_ChainExceptions1``" +msgstr "" + +#: ../../whatsnew/3.12.rst:2380 +msgid "" +":c:member:`!PyBytesObject.ob_shash` member: call :c:func:`PyObject_Hash` " +"instead" +msgstr "" + +#: ../../whatsnew/3.12.rst:2382 +msgid ":c:member:`!PyDictObject.ma_version_tag` member" +msgstr ":c:member:`!PyDictObject.ma_version_tag` 成員" + +#: ../../whatsnew/3.12.rst:2383 +msgid "Thread Local Storage (TLS) API:" +msgstr "" + +#: ../../whatsnew/3.12.rst:2385 +msgid ":c:func:`PyThread_create_key`: use :c:func:`PyThread_tss_alloc`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2386 +msgid ":c:func:`PyThread_delete_key`: use :c:func:`PyThread_tss_free`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2387 +msgid ":c:func:`PyThread_set_key_value`: use :c:func:`PyThread_tss_set`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2388 +msgid ":c:func:`PyThread_get_key_value`: use :c:func:`PyThread_tss_get`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2389 +msgid ":c:func:`PyThread_delete_key_value`: use :c:func:`PyThread_tss_delete`" +msgstr "" + +#: ../../whatsnew/3.12.rst:2390 +msgid ":c:func:`PyThread_ReInitTLS`: unneeded since Python 3.7" +msgstr "" + +#: ../../whatsnew/3.12.rst:2395 msgid "" -"Remove the ``token.h`` header file. There was never any public tokenizer C " -"API. The ``token.h`` header file was only designed to be used by Python " -"internals. (Contributed by Victor Stinner in :gh:`92651`.)" +"Remove the :file:`token.h` header file. There was never any public tokenizer " +"C API. The :file:`token.h` header file was only designed to be used by " +"Python internals. (Contributed by Victor Stinner in :gh:`92651`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2127 +#: ../../whatsnew/3.12.rst:2400 msgid "Legacy Unicode APIs have been removed. See :pep:`623` for detail." msgstr "" -#: ../../whatsnew/3.12.rst:2129 +#: ../../whatsnew/3.12.rst:2402 msgid ":c:macro:`!PyUnicode_WCHAR_KIND`" msgstr ":c:macro:`!PyUnicode_WCHAR_KIND`" -#: ../../whatsnew/3.12.rst:2130 +#: ../../whatsnew/3.12.rst:2403 msgid ":c:func:`!PyUnicode_AS_UNICODE`" msgstr ":c:func:`!PyUnicode_AS_UNICODE`" -#: ../../whatsnew/3.12.rst:2131 +#: ../../whatsnew/3.12.rst:2404 msgid ":c:func:`!PyUnicode_AsUnicode`" msgstr ":c:func:`!PyUnicode_AsUnicode`" -#: ../../whatsnew/3.12.rst:2132 +#: ../../whatsnew/3.12.rst:2405 msgid ":c:func:`!PyUnicode_AsUnicodeAndSize`" msgstr ":c:func:`!PyUnicode_AsUnicodeAndSize`" -#: ../../whatsnew/3.12.rst:2133 +#: ../../whatsnew/3.12.rst:2406 msgid ":c:func:`!PyUnicode_AS_DATA`" msgstr ":c:func:`!PyUnicode_AS_DATA`" -#: ../../whatsnew/3.12.rst:2134 +#: ../../whatsnew/3.12.rst:2407 msgid ":c:func:`!PyUnicode_FromUnicode`" msgstr ":c:func:`!PyUnicode_FromUnicode`" -#: ../../whatsnew/3.12.rst:2135 +#: ../../whatsnew/3.12.rst:2408 msgid ":c:func:`!PyUnicode_GET_SIZE`" msgstr ":c:func:`!PyUnicode_GET_SIZE`" -#: ../../whatsnew/3.12.rst:2136 +#: ../../whatsnew/3.12.rst:2409 msgid ":c:func:`!PyUnicode_GetSize`" msgstr ":c:func:`!PyUnicode_GetSize`" -#: ../../whatsnew/3.12.rst:2137 +#: ../../whatsnew/3.12.rst:2410 msgid ":c:func:`!PyUnicode_GET_DATA_SIZE`" msgstr ":c:func:`!PyUnicode_GET_DATA_SIZE`" -#: ../../whatsnew/3.12.rst:2139 +#: ../../whatsnew/3.12.rst:2412 msgid "" "Remove the ``PyUnicode_InternImmortal()`` function macro. (Contributed by " "Victor Stinner in :gh:`85858`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2142 +#: ../../whatsnew/3.12.rst:2415 msgid "" "Remove ``Jython`` compatibility hacks from several stdlib modules and tests. " "(Contributed by Nikita Sobolev in :gh:`99482`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2145 +#: ../../whatsnew/3.12.rst:2418 msgid "" "Remove ``_use_broken_old_ctypes_structure_semantics_`` flag from :mod:" "`ctypes` module. (Contributed by Nikita Sobolev in :gh:`99285`.)" msgstr "" - -#~ msgid ":const:`Py_TPFLAGS_HAVE_VECTORCALL`" -#~ msgstr ":const:`Py_TPFLAGS_HAVE_VECTORCALL`" - -#~ msgid ":const:`PY_VECTORCALL_ARGUMENTS_OFFSET`" -#~ msgstr ":const:`PY_VECTORCALL_ARGUMENTS_OFFSET`" - -#~ msgid "email" -#~ msgstr "email" diff --git a/whatsnew/3.3.po b/whatsnew/3.3.po index 7ba13abbd8..0914591a50 100644 --- a/whatsnew/3.3.po +++ b/whatsnew/3.3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-27 18:15+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2773,6 +2773,8 @@ msgid "" "(https://en.wikipedia.org/wiki/Socketcan), on Linux (https://lwn.net/" "Articles/253425)." msgstr "" +":class:`~socket.socket` 類別現在支援 Linux (https://lwn.net/Articles/253425) " +"上的 PF_CAN 協議系列 (https://en.wikipedia.org/wiki/Socketcan)。" #: ../../whatsnew/3.3.rst:1892 msgid "" @@ -3072,12 +3074,12 @@ msgstr "其他新功能:" #: ../../whatsnew/3.3.rst:2069 msgid "" ":func:`~time.clock_getres`, :func:`~time.clock_gettime` and :func:`~time." -"clock_settime` functions with ``CLOCK_xxx`` constants. (Contributed by " +"clock_settime` functions with :samp:`CLOCK_{xxx}` constants. (Contributed by " "Victor Stinner in :issue:`10278`.)" msgstr "" ":func:`~time.clock_getres`、:func:`~time.clock_gettime` 和 :func:`~time." -"clock_settime` 函式帶有 ``CLOCK_xxx`` 常數。 (由 Victor Stinner 在 :issue:" -"`10278` 中貢獻。)" +"clock_settime` 函式帶有 :samp:`CLOCK_{xxx}` 常數。 (由 Victor Stinner 在 :" +"issue:`10278` 中貢獻。)" #: ../../whatsnew/3.3.rst:2073 msgid "" @@ -3943,10 +3945,3 @@ msgstr "yield" #: ../../whatsnew/3.3.rst:396 msgid "yield from (in What's New)" msgstr "yield from(在有什麼新功能中)" - -#~ msgid "" -#~ "The :class:`~socket.socket` class now supports the PF_CAN protocol family " -#~ "(https://en.wikipedia.org/wiki/Socketcan), on Linux ." -#~ msgstr "" -#~ "~socket.socket` 類別現在支援 Linux (https://lwn.net/Articles/253425) 上的 " -#~ "PF_CAN 協議系列 (https://en.wikipedia.org/wiki/Socketcan)。" diff --git a/whatsnew/3.4.po b/whatsnew/3.4.po index a0e58c3027..2c35922a63 100644 --- a/whatsnew/3.4.po +++ b/whatsnew/3.4.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+0000\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -495,7 +495,8 @@ msgid "" "(Contributed by Nick Coghlan in :issue:`7475`, :issue:`17827`, :issue:" "`17828` and :issue:`19619`.)" msgstr "" -"(由 Nick Coghlan 在 :issue:`7475`、:issue:`17827`、:issue:`17828` 和 :issue:`19619` 中貢獻。)" +"(由 Nick Coghlan 在 :issue:`7475`、:issue:`17827`、:issue:`17828` 和 :issue:" +"`19619` 中貢獻。)" #: ../../whatsnew/3.4.rst:381 msgid "PEP 451: A ModuleSpec Type for the Import System" @@ -1018,8 +1019,8 @@ msgid "" "(Contributed by Nick Coghlan, Ryan Kelly and Thomas Kluyver in :issue:" "`11816` and Claudiu Popa in :issue:`17916`.)" msgstr "" -"(由 Nick Coghlan、Ryan Kelly 和 Thomas Kluyver 在 :issue:`11816` 中以及 Claudiu " -"Popa 在 :issue:`17916` 中貢獻。)" +"(由 Nick Coghlan、Ryan Kelly 和 Thomas Kluyver 在 :issue:`11816` 中以及 " +"Claudiu Popa 在 :issue:`17916` 中貢獻。)" #: ../../whatsnew/3.4.rst:770 msgid "" @@ -2852,18 +2853,18 @@ msgid "" "find_spec`; :meth:`!importlib.abc.MetaPathFinder.find_module` is replaced " "by :meth:`importlib.abc.MetaPathFinder.find_spec`; :meth:`!importlib.abc." "PathEntryFinder.find_loader` and :meth:`!find_module` are replaced by :meth:" -"`importlib.abc.PathEntryFinder.find_spec`; all of the ``xxxLoader`` ABC " -"``load_module`` methods (:meth:`!importlib.abc.Loader.load_module`, :meth:`!" -"importlib.abc.InspectLoader.load_module`, :meth:`!importlib.abc.FileLoader." -"load_module`, :meth:`!importlib.abc.SourceLoader.load_module`) should no " -"longer be implemented, instead loaders should implement an ``exec_module`` " -"method (:meth:`importlib.abc.Loader.exec_module`, :meth:`importlib.abc." -"InspectLoader.exec_module` :meth:`importlib.abc.SourceLoader.exec_module`) " -"and let the import system take care of the rest; and :meth:`!importlib.abc." -"Loader.module_repr`, :meth:`!importlib.util.module_for_loader`, :meth:`!" -"importlib.util.set_loader`, and :meth:`!importlib.util.set_package` are no " -"longer needed because their functions are now handled automatically by the " -"import system." +"`importlib.abc.PathEntryFinder.find_spec`; all of the :samp:`{xxx}Loader` " +"ABC ``load_module`` methods (:meth:`!importlib.abc.Loader.load_module`, :" +"meth:`!importlib.abc.InspectLoader.load_module`, :meth:`!importlib.abc." +"FileLoader.load_module`, :meth:`!importlib.abc.SourceLoader.load_module`) " +"should no longer be implemented, instead loaders should implement an " +"``exec_module`` method (:meth:`importlib.abc.Loader.exec_module`, :meth:" +"`importlib.abc.InspectLoader.exec_module` :meth:`importlib.abc.SourceLoader." +"exec_module`) and let the import system take care of the rest; and :meth:`!" +"importlib.abc.Loader.module_repr`, :meth:`!importlib.util." +"module_for_loader`, :meth:`!importlib.util.set_loader`, and :meth:`!" +"importlib.util.set_package` are no longer needed because their functions are " +"now handled automatically by the import system." msgstr "" #: ../../whatsnew/3.4.rst:2104 diff --git a/whatsnew/3.7.po b/whatsnew/3.7.po index 1c567304b2..29981b965a 100644 --- a/whatsnew/3.7.po +++ b/whatsnew/3.7.po @@ -2251,8 +2251,8 @@ msgid "" "(Contributed by Nick Coghlan and Victor Stinner in :issue:`20361`, :issue:" "`32043`, and :issue:`32230`.)" msgstr "" -"(由 Nick Coghlan 和 Victor Stinner 在 :issue:`20361`、:issue:" -"`32043` 和 :issue:`32230` 中貢獻。)" +"(由 Nick Coghlan 和 Victor Stinner 在 :issue:`20361`、:issue:`32043` 和 :" +"issue:`32230` 中貢獻。)" #: ../../whatsnew/3.7.rst:1597 msgid "" diff --git a/whatsnew/3.8.po b/whatsnew/3.8.po index 876384f4a2..40a1f64f79 100644 --- a/whatsnew/3.8.po +++ b/whatsnew/3.8.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-23 00:03+0000\n" +"POT-Creation-Date: 2023-10-13 00:03+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-" @@ -106,8 +106,8 @@ msgid "" "There is a new function parameter syntax ``/`` to indicate that some " "function parameters must be specified positionally and cannot be used as " "keyword arguments. This is the same notation shown by ``help()`` for C " -"functions annotated with Larry Hastings' :ref:`Argument Clinic ` tool." +"functions annotated with Larry Hastings' `Argument Clinic `__ tool." msgstr "" #: ../../whatsnew/3.8.rst:128 @@ -550,7 +550,8 @@ msgstr "" #: ../../whatsnew/3.8.rst:407 msgid "" -"Added support of ``\\N{name}`` escapes in :mod:`regular expressions `::" +"Added support of :samp:`\\\\N\\\\{{name}\\\\}` escapes in :mod:`regular " +"expressions `::" msgstr "" #: ../../whatsnew/3.8.rst:414 @@ -1153,7 +1154,7 @@ msgstr "" #: ../../whatsnew/3.8.rst:950 msgid "" -"(Suggested by Raymond Hettinger, implemented by Dong-hee Na, and reviewed by " +"(Suggested by Raymond Hettinger, implemented by Donghee Na, and reviewed by " "Vinay Sajip in :issue:`33897`.)" msgstr "" @@ -2191,7 +2192,7 @@ msgstr "" #: ../../whatsnew/3.8.rst:1715 msgid "" "The :meth:`~threading.Thread.isAlive()` method of :class:`threading.Thread` " -"has been deprecated. (Contributed by Dong-hee Na in :issue:`35283`.)" +"has been deprecated. (Contributed by Donghee Na in :issue:`35283`.)" msgstr "" #: ../../whatsnew/3.8.rst:1719 diff --git a/whatsnew/3.9.po b/whatsnew/3.9.po index 05e821457f..08cc7c79e0 100644 --- a/whatsnew/3.9.po +++ b/whatsnew/3.9.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-23 00:03+0000\n" +"POT-Creation-Date: 2023-10-11 17:13+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-" @@ -33,83 +33,80 @@ msgstr "Łukasz Langa" #: ../../whatsnew/3.9.rst:45 msgid "" "This article explains the new features in Python 3.9, compared to 3.8. " -"Python 3.9 was released on October 5, 2020." +"Python 3.9 was released on October 5, 2020. For full details, see the :ref:" +"`changelog `." msgstr "" -#: ../../whatsnew/3.9.rst:48 -msgid "For full details, see the :ref:`changelog `." -msgstr "" - -#: ../../whatsnew/3.9.rst:52 +#: ../../whatsnew/3.9.rst:51 msgid ":pep:`596` - Python 3.9 Release Schedule" msgstr "" -#: ../../whatsnew/3.9.rst:56 +#: ../../whatsnew/3.9.rst:55 msgid "Summary -- Release highlights" msgstr "" -#: ../../whatsnew/3.9.rst:61 +#: ../../whatsnew/3.9.rst:60 msgid "New syntax features:" msgstr "" -#: ../../whatsnew/3.9.rst:63 +#: ../../whatsnew/3.9.rst:62 msgid ":pep:`584`, union operators added to ``dict``;" msgstr "" -#: ../../whatsnew/3.9.rst:64 +#: ../../whatsnew/3.9.rst:63 msgid ":pep:`585`, type hinting generics in standard collections;" msgstr "" -#: ../../whatsnew/3.9.rst:65 +#: ../../whatsnew/3.9.rst:64 msgid ":pep:`614`, relaxed grammar restrictions on decorators." msgstr "" -#: ../../whatsnew/3.9.rst:67 +#: ../../whatsnew/3.9.rst:66 msgid "New built-in features:" msgstr "" -#: ../../whatsnew/3.9.rst:69 +#: ../../whatsnew/3.9.rst:68 msgid ":pep:`616`, string methods to remove prefixes and suffixes." msgstr "" -#: ../../whatsnew/3.9.rst:71 +#: ../../whatsnew/3.9.rst:70 msgid "New features in the standard library:" msgstr "" -#: ../../whatsnew/3.9.rst:73 +#: ../../whatsnew/3.9.rst:72 msgid ":pep:`593`, flexible function and variable annotations;" msgstr "" -#: ../../whatsnew/3.9.rst:74 +#: ../../whatsnew/3.9.rst:73 msgid "" ":func:`os.pidfd_open` added that allows process management without races and " "signals." msgstr "" -#: ../../whatsnew/3.9.rst:77 +#: ../../whatsnew/3.9.rst:76 msgid "Interpreter improvements:" msgstr "" -#: ../../whatsnew/3.9.rst:79 +#: ../../whatsnew/3.9.rst:78 msgid "" ":pep:`573`, fast access to module state from methods of C extension types;" msgstr "" -#: ../../whatsnew/3.9.rst:81 +#: ../../whatsnew/3.9.rst:80 msgid ":pep:`617`, CPython now uses a new parser based on PEG;" msgstr "" -#: ../../whatsnew/3.9.rst:82 +#: ../../whatsnew/3.9.rst:81 msgid "" "a number of Python builtins (range, tuple, set, frozenset, list, dict) are " "now sped up using :pep:`590` vectorcall;" msgstr "" -#: ../../whatsnew/3.9.rst:84 +#: ../../whatsnew/3.9.rst:83 msgid "garbage collection does not block on resurrected objects;" msgstr "" -#: ../../whatsnew/3.9.rst:85 +#: ../../whatsnew/3.9.rst:84 msgid "" "a number of Python modules (:mod:`_abc`, :mod:`audioop`, :mod:`_bz2`, :mod:" "`_codecs`, :mod:`_contextvars`, :mod:`_crypt`, :mod:`_functools`, :mod:" @@ -118,7 +115,7 @@ msgid "" "489;" msgstr "" -#: ../../whatsnew/3.9.rst:90 +#: ../../whatsnew/3.9.rst:89 msgid "" "a number of standard library modules (:mod:`audioop`, :mod:`ast`, :mod:" "`grp`, :mod:`_hashlib`, :mod:`pwd`, :mod:`_posixsubprocess`, :mod:`random`, :" @@ -126,35 +123,35 @@ msgid "" "stable ABI defined by PEP 384." msgstr "" -#: ../../whatsnew/3.9.rst:95 +#: ../../whatsnew/3.9.rst:94 msgid "New library modules:" msgstr "" -#: ../../whatsnew/3.9.rst:97 +#: ../../whatsnew/3.9.rst:96 msgid "" ":pep:`615`, the IANA Time Zone Database is now present in the standard " "library in the :mod:`zoneinfo` module;" msgstr "" -#: ../../whatsnew/3.9.rst:99 +#: ../../whatsnew/3.9.rst:98 msgid "" "an implementation of a topological sort of a graph is now provided in the " "new :mod:`graphlib` module." msgstr "" -#: ../../whatsnew/3.9.rst:102 +#: ../../whatsnew/3.9.rst:101 msgid "Release process changes:" msgstr "" -#: ../../whatsnew/3.9.rst:104 +#: ../../whatsnew/3.9.rst:103 msgid ":pep:`602`, CPython adopts an annual release cycle." msgstr "" -#: ../../whatsnew/3.9.rst:108 +#: ../../whatsnew/3.9.rst:107 msgid "You should check for DeprecationWarning in your code" msgstr "" -#: ../../whatsnew/3.9.rst:110 +#: ../../whatsnew/3.9.rst:109 msgid "" "When Python 2.7 was still supported, a lot of functionality in Python 3 was " "kept for backward compatibility with Python 2.7. With the end of Python 2 " @@ -165,7 +162,7 @@ msgid "" "3.3, released in 2012." msgstr "" -#: ../../whatsnew/3.9.rst:118 +#: ../../whatsnew/3.9.rst:117 msgid "" "Test your application with the :option:`-W` ``default`` command-line option " "to see :exc:`DeprecationWarning` and :exc:`PendingDeprecationWarning`, or " @@ -174,14 +171,14 @@ msgid "" "code." msgstr "" -#: ../../whatsnew/3.9.rst:123 +#: ../../whatsnew/3.9.rst:122 msgid "" "Python 3.9 is the last version providing those Python 2 backward " "compatibility layers, to give more time to Python projects maintainers to " "organize the removal of the Python 2 support and add support for Python 3.9." msgstr "" -#: ../../whatsnew/3.9.rst:127 +#: ../../whatsnew/3.9.rst:126 msgid "" "Aliases to :ref:`Abstract Base Classes ` " "in the :mod:`collections` module, like ``collections.Mapping`` alias to :" @@ -189,52 +186,52 @@ msgid "" "compatibility. They will be removed from Python 3.10." msgstr "" -#: ../../whatsnew/3.9.rst:132 +#: ../../whatsnew/3.9.rst:131 msgid "" "More generally, try to run your tests in the :ref:`Python Development Mode " "` which helps to prepare your code to make it compatible with the " "next Python version." msgstr "" -#: ../../whatsnew/3.9.rst:136 +#: ../../whatsnew/3.9.rst:135 msgid "" "Note: a number of pre-existing deprecations were removed in this version of " "Python as well. Consult the :ref:`removed-in-python-39` section." msgstr "" -#: ../../whatsnew/3.9.rst:141 ../../whatsnew/3.9.rst:1274 +#: ../../whatsnew/3.9.rst:140 ../../whatsnew/3.9.rst:1273 msgid "New Features" msgstr "" -#: ../../whatsnew/3.9.rst:144 +#: ../../whatsnew/3.9.rst:143 msgid "Dictionary Merge & Update Operators" msgstr "" -#: ../../whatsnew/3.9.rst:146 +#: ../../whatsnew/3.9.rst:145 msgid "" "Merge (``|``) and update (``|=``) operators have been added to the built-in :" "class:`dict` class. Those complement the existing ``dict.update`` and " "``{**d1, **d2}`` methods of merging dictionaries." msgstr "" -#: ../../whatsnew/3.9.rst:150 ../../whatsnew/3.9.rst:283 +#: ../../whatsnew/3.9.rst:149 ../../whatsnew/3.9.rst:282 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../whatsnew/3.9.rst:159 +#: ../../whatsnew/3.9.rst:158 msgid "" "See :pep:`584` for a full description. (Contributed by Brandt Bucher in :" "issue:`36144`.)" msgstr "" -#: ../../whatsnew/3.9.rst:163 +#: ../../whatsnew/3.9.rst:162 msgid "New String Methods to Remove Prefixes and Suffixes" msgstr "" -#: ../../whatsnew/3.9.rst:165 +#: ../../whatsnew/3.9.rst:164 msgid "" ":meth:`str.removeprefix(prefix)` and :meth:`str." "removesuffix(suffix)` have been added to easily remove an " @@ -244,11 +241,11 @@ msgid "" "issue:`39939`.)" msgstr "" -#: ../../whatsnew/3.9.rst:173 +#: ../../whatsnew/3.9.rst:172 msgid "Type Hinting Generics in Standard Collections" msgstr "" -#: ../../whatsnew/3.9.rst:175 +#: ../../whatsnew/3.9.rst:174 msgid "" "In type annotations you can now use built-in collection types such as " "``list`` and ``dict`` as generic types instead of importing the " @@ -257,21 +254,21 @@ msgid "" "for example ``queue.Queue``." msgstr "" -#: ../../whatsnew/3.9.rst:181 ../../whatsnew/3.9.rst:1162 +#: ../../whatsnew/3.9.rst:180 ../../whatsnew/3.9.rst:1161 msgid "Example:" msgstr "範例:" -#: ../../whatsnew/3.9.rst:189 +#: ../../whatsnew/3.9.rst:188 msgid "" "See :pep:`585` for more details. (Contributed by Guido van Rossum, Ethan " "Smith, and Batuhan Taşkaya in :issue:`39481`.)" msgstr "" -#: ../../whatsnew/3.9.rst:193 +#: ../../whatsnew/3.9.rst:192 msgid "New Parser" msgstr "" -#: ../../whatsnew/3.9.rst:195 +#: ../../whatsnew/3.9.rst:194 msgid "" "Python 3.9 uses a new parser, based on `PEG `_ instead of `LL(1) ` and in :ref:`debug build " "`, the *encoding* and *errors* arguments are now checked for " @@ -332,14 +329,14 @@ msgid "" "encode` and :meth:`bytes.decode`." msgstr "" -#: ../../whatsnew/3.9.rst:237 +#: ../../whatsnew/3.9.rst:236 msgid "" "By default, for best performance, the *errors* argument is only checked at " "the first encoding/decoding error and the *encoding* argument is sometimes " "ignored for empty strings. (Contributed by Victor Stinner in :issue:`37388`.)" msgstr "" -#: ../../whatsnew/3.9.rst:242 +#: ../../whatsnew/3.9.rst:241 msgid "" "``\"\".replace(\"\", s, n)`` now returns ``s`` instead of an empty string " "for all non-zero ``n``. It is now consistent with ``\"\".replace(\"\", " @@ -347,14 +344,14 @@ msgid "" "objects. (Contributed by Serhiy Storchaka in :issue:`28029`.)" msgstr "" -#: ../../whatsnew/3.9.rst:247 +#: ../../whatsnew/3.9.rst:246 msgid "" "Any valid expression can now be used as a :term:`decorator`. Previously, " "the grammar was much more restrictive. See :pep:`614` for details. " "(Contributed by Brandt Bucher in :issue:`39702`.)" msgstr "" -#: ../../whatsnew/3.9.rst:251 +#: ../../whatsnew/3.9.rst:250 msgid "" "Improved help for the :mod:`typing` module. Docstrings are now shown for all " "special forms and special generic aliases (like ``Union`` and ``List``). " @@ -363,7 +360,7 @@ msgid "" "Serhiy Storchaka in :issue:`40257`.)" msgstr "" -#: ../../whatsnew/3.9.rst:257 +#: ../../whatsnew/3.9.rst:256 msgid "" "Parallel running of :meth:`~agen.aclose` / :meth:`~agen.asend` / :meth:" "`~agen.athrow` is now prohibited, and ``ag_running`` now reflects the actual " @@ -371,7 +368,7 @@ msgid "" "issue:`30773`.)" msgstr "" -#: ../../whatsnew/3.9.rst:262 +#: ../../whatsnew/3.9.rst:261 msgid "" "Unexpected errors in calling the ``__iter__`` method are no longer masked by " "``TypeError`` in the :keyword:`in` operator and functions :func:`~operator." @@ -379,49 +376,49 @@ msgid "" "mod:`operator` module. (Contributed by Serhiy Storchaka in :issue:`40824`.)" msgstr "" -#: ../../whatsnew/3.9.rst:268 +#: ../../whatsnew/3.9.rst:267 msgid "" "Unparenthesized lambda expressions can no longer be the expression part in " "an ``if`` clause in comprehensions and generator expressions. See :issue:" "`41848` and :issue:`43755` for details." msgstr "" -#: ../../whatsnew/3.9.rst:274 +#: ../../whatsnew/3.9.rst:273 msgid "New Modules" msgstr "新模組" -#: ../../whatsnew/3.9.rst:277 +#: ../../whatsnew/3.9.rst:276 msgid "zoneinfo" msgstr "zoneinfo" -#: ../../whatsnew/3.9.rst:279 +#: ../../whatsnew/3.9.rst:278 msgid "" "The :mod:`zoneinfo` module brings support for the IANA time zone database to " "the standard library. It adds :class:`zoneinfo.ZoneInfo`, a concrete :class:" "`datetime.tzinfo` implementation backed by the system's time zone data." msgstr "" -#: ../../whatsnew/3.9.rst:303 +#: ../../whatsnew/3.9.rst:302 msgid "" "As a fall-back source of data for platforms that don't ship the IANA " "database, the |tzdata|_ module was released as a first-party package -- " "distributed via PyPI and maintained by the CPython core team." msgstr "" -#: ../../whatsnew/3.9.rst:312 +#: ../../whatsnew/3.9.rst:311 msgid "" ":pep:`615` -- Support for the IANA Time Zone Database in the Standard Library" msgstr "" -#: ../../whatsnew/3.9.rst:313 +#: ../../whatsnew/3.9.rst:312 msgid "PEP written and implemented by Paul Ganssle" msgstr "由 Paul Ganssle 撰寫 PEP 與實作" -#: ../../whatsnew/3.9.rst:317 +#: ../../whatsnew/3.9.rst:316 msgid "graphlib" msgstr "graphlib" -#: ../../whatsnew/3.9.rst:319 +#: ../../whatsnew/3.9.rst:318 msgid "" "A new module, :mod:`graphlib`, was added that contains the :class:`graphlib." "TopologicalSorter` class to offer functionality to perform topological " @@ -429,22 +426,22 @@ msgid "" "Hastings in :issue:`17005`.)" msgstr "" -#: ../../whatsnew/3.9.rst:326 +#: ../../whatsnew/3.9.rst:325 msgid "Improved Modules" msgstr "" -#: ../../whatsnew/3.9.rst:329 +#: ../../whatsnew/3.9.rst:328 msgid "ast" msgstr "ast" -#: ../../whatsnew/3.9.rst:331 +#: ../../whatsnew/3.9.rst:330 msgid "" "Added the *indent* option to :func:`~ast.dump` which allows it to produce a " "multiline indented output. (Contributed by Serhiy Storchaka in :issue:" "`37995`.)" msgstr "" -#: ../../whatsnew/3.9.rst:335 +#: ../../whatsnew/3.9.rst:334 msgid "" "Added :func:`ast.unparse` as a function in the :mod:`ast` module that can be " "used to unparse an :class:`ast.AST` object and produce a string with code " @@ -452,17 +449,17 @@ msgid "" "(Contributed by Pablo Galindo and Batuhan Taskaya in :issue:`38870`.)" msgstr "" -#: ../../whatsnew/3.9.rst:340 +#: ../../whatsnew/3.9.rst:339 msgid "" "Added docstrings to AST nodes that contains the ASDL signature used to " "construct that node. (Contributed by Batuhan Taskaya in :issue:`39638`.)" msgstr "" -#: ../../whatsnew/3.9.rst:344 +#: ../../whatsnew/3.9.rst:343 msgid "asyncio" msgstr "asyncio" -#: ../../whatsnew/3.9.rst:346 +#: ../../whatsnew/3.9.rst:345 msgid "" "Due to significant security concerns, the *reuse_address* parameter of :meth:" "`asyncio.loop.create_datagram_endpoint` is no longer supported. This is " @@ -472,7 +469,7 @@ msgid "" "`37228`.)" msgstr "" -#: ../../whatsnew/3.9.rst:353 +#: ../../whatsnew/3.9.rst:352 msgid "" "Added a new :term:`coroutine` :meth:`~asyncio.loop." "shutdown_default_executor` that schedules a shutdown for the default " @@ -481,13 +478,13 @@ msgid "" "new :term:`coroutine`. (Contributed by Kyle Stanley in :issue:`34037`.)" msgstr "" -#: ../../whatsnew/3.9.rst:359 +#: ../../whatsnew/3.9.rst:358 msgid "" "Added :class:`asyncio.PidfdChildWatcher`, a Linux-specific child watcher " "implementation that polls process file descriptors. (:issue:`38692`)" msgstr "" -#: ../../whatsnew/3.9.rst:362 +#: ../../whatsnew/3.9.rst:361 msgid "" "Added a new :term:`coroutine` :func:`asyncio.to_thread`. It is mainly used " "for running IO-bound functions in a separate thread to avoid blocking the " @@ -496,7 +493,7 @@ msgid "" "by Kyle Stanley and Yury Selivanov in :issue:`32309`.)" msgstr "" -#: ../../whatsnew/3.9.rst:368 +#: ../../whatsnew/3.9.rst:367 msgid "" "When cancelling the task due to a timeout, :meth:`asyncio.wait_for` will now " "wait until the cancellation is complete also in the case when *timeout* is " @@ -504,25 +501,25 @@ msgid "" "Pranskevichus in :issue:`32751`.)" msgstr "" -#: ../../whatsnew/3.9.rst:373 +#: ../../whatsnew/3.9.rst:372 msgid "" ":mod:`asyncio` now raises :exc:`TyperError` when calling incompatible " "methods with an :class:`ssl.SSLSocket` socket. (Contributed by Ido Michael " "in :issue:`37404`.)" msgstr "" -#: ../../whatsnew/3.9.rst:378 +#: ../../whatsnew/3.9.rst:377 msgid "compileall" msgstr "compileall" -#: ../../whatsnew/3.9.rst:380 +#: ../../whatsnew/3.9.rst:379 msgid "" "Added new possibility to use hardlinks for duplicated ``.pyc`` files: " "*hardlink_dupes* parameter and --hardlink-dupes command line option. " "(Contributed by Lumír 'Frenzy' Balhar in :issue:`40495`.)" msgstr "" -#: ../../whatsnew/3.9.rst:383 +#: ../../whatsnew/3.9.rst:382 msgid "" "Added new options for path manipulation in resulting ``.pyc`` files: " "*stripdir*, *prependdir*, *limit_sl_dest* parameters and -s, -p, -e command " @@ -531,11 +528,11 @@ msgid "" "issue:`38112`.)" msgstr "" -#: ../../whatsnew/3.9.rst:388 +#: ../../whatsnew/3.9.rst:387 msgid "concurrent.futures" msgstr "concurrent.futures" -#: ../../whatsnew/3.9.rst:390 +#: ../../whatsnew/3.9.rst:389 msgid "" "Added a new *cancel_futures* parameter to :meth:`concurrent.futures.Executor." "shutdown` that cancels all pending futures which have not started running, " @@ -543,7 +540,7 @@ msgid "" "(Contributed by Kyle Stanley in :issue:`39349`.)" msgstr "" -#: ../../whatsnew/3.9.rst:396 +#: ../../whatsnew/3.9.rst:395 msgid "" "Removed daemon threads from :class:`~concurrent.futures.ThreadPoolExecutor` " "and :class:`~concurrent.futures.ProcessPoolExecutor`. This improves " @@ -551,7 +548,7 @@ msgid "" "processes. (Contributed by Kyle Stanley in :issue:`39812`.)" msgstr "" -#: ../../whatsnew/3.9.rst:401 +#: ../../whatsnew/3.9.rst:400 msgid "" "Workers in :class:`~concurrent.futures.ProcessPoolExecutor` are now spawned " "on demand, only when there are no available idle workers to reuse. This " @@ -559,68 +556,68 @@ msgid "" "workers. (Contributed by Kyle Stanley in :issue:`39207`.)" msgstr "" -#: ../../whatsnew/3.9.rst:407 +#: ../../whatsnew/3.9.rst:406 msgid "curses" msgstr "curses" -#: ../../whatsnew/3.9.rst:409 +#: ../../whatsnew/3.9.rst:408 msgid "" "Added :func:`curses.get_escdelay`, :func:`curses.set_escdelay`, :func:" "`curses.get_tabsize`, and :func:`curses.set_tabsize` functions. (Contributed " "by Anthony Sottile in :issue:`38312`.)" msgstr "" -#: ../../whatsnew/3.9.rst:414 +#: ../../whatsnew/3.9.rst:413 msgid "datetime" msgstr "datetime" -#: ../../whatsnew/3.9.rst:415 +#: ../../whatsnew/3.9.rst:414 msgid "" "The :meth:`~datetime.date.isocalendar()` of :class:`datetime.date` and :meth:" "`~datetime.datetime.isocalendar()` of :class:`datetime.datetime` methods now " "returns a :func:`~collections.namedtuple` instead of a :class:`tuple`. " -"(Contributed by Dong-hee Na in :issue:`24416`.)" +"(Contributed by Donghee Na in :issue:`24416`.)" msgstr "" -#: ../../whatsnew/3.9.rst:421 +#: ../../whatsnew/3.9.rst:420 msgid "distutils" msgstr "distutils" -#: ../../whatsnew/3.9.rst:423 +#: ../../whatsnew/3.9.rst:422 msgid "" "The :command:`upload` command now creates SHA2-256 and Blake2b-256 hash " "digests. It skips MD5 on platforms that block MD5 digest. (Contributed by " "Christian Heimes in :issue:`40698`.)" msgstr "" -#: ../../whatsnew/3.9.rst:428 +#: ../../whatsnew/3.9.rst:427 msgid "fcntl" msgstr "fcntl" -#: ../../whatsnew/3.9.rst:430 +#: ../../whatsnew/3.9.rst:429 msgid "" "Added constants :const:`~fcntl.F_OFD_GETLK`, :const:`~fcntl.F_OFD_SETLK` " -"and :const:`~fcntl.F_OFD_SETLKW`. (Contributed by Dong-hee Na in :issue:" +"and :const:`~fcntl.F_OFD_SETLKW`. (Contributed by Donghee Na in :issue:" "`38602`.)" msgstr "" -#: ../../whatsnew/3.9.rst:435 +#: ../../whatsnew/3.9.rst:434 msgid "ftplib" msgstr "ftplib" -#: ../../whatsnew/3.9.rst:437 +#: ../../whatsnew/3.9.rst:436 msgid "" ":class:`~ftplib.FTP` and :class:`~ftplib.FTP_TLS` now raise a :class:" "`ValueError` if the given timeout for their constructor is zero to prevent " -"the creation of a non-blocking socket. (Contributed by Dong-hee Na in :issue:" +"the creation of a non-blocking socket. (Contributed by Donghee Na in :issue:" "`39259`.)" msgstr "" -#: ../../whatsnew/3.9.rst:442 +#: ../../whatsnew/3.9.rst:441 msgid "gc" msgstr "gc" -#: ../../whatsnew/3.9.rst:444 +#: ../../whatsnew/3.9.rst:443 msgid "" "When the garbage collector makes a collection in which some objects " "resurrect (they are reachable from outside the isolated cycles after the " @@ -629,24 +626,24 @@ msgid "" "issue:`38379`.)" msgstr "" -#: ../../whatsnew/3.9.rst:449 +#: ../../whatsnew/3.9.rst:448 msgid "" "Added a new function :func:`gc.is_finalized` to check if an object has been " "finalized by the garbage collector. (Contributed by Pablo Galindo in :issue:" "`39322`.)" msgstr "" -#: ../../whatsnew/3.9.rst:454 +#: ../../whatsnew/3.9.rst:453 msgid "hashlib" msgstr "hashlib" -#: ../../whatsnew/3.9.rst:456 +#: ../../whatsnew/3.9.rst:455 msgid "" "The :mod:`hashlib` module can now use SHA3 hashes and SHAKE XOF from OpenSSL " "when available. (Contributed by Christian Heimes in :issue:`37630`.)" msgstr "" -#: ../../whatsnew/3.9.rst:460 +#: ../../whatsnew/3.9.rst:459 msgid "" "Builtin hash modules can now be disabled with ``./configure --without-" "builtin-hashlib-hashes`` or selectively enabled with e.g. ``./configure --" @@ -654,55 +651,55 @@ msgid "" "implementation. (Contributed by Christian Heimes in :issue:`40479`)" msgstr "" -#: ../../whatsnew/3.9.rst:468 +#: ../../whatsnew/3.9.rst:467 msgid "http" msgstr "http" -#: ../../whatsnew/3.9.rst:470 +#: ../../whatsnew/3.9.rst:469 msgid "" "HTTP status codes ``103 EARLY_HINTS``, ``418 IM_A_TEAPOT`` and ``425 " -"TOO_EARLY`` are added to :class:`http.HTTPStatus`. (Contributed by Dong-hee " +"TOO_EARLY`` are added to :class:`http.HTTPStatus`. (Contributed by Donghee " "Na in :issue:`39509` and Ross Rhodes in :issue:`39507`.)" msgstr "" -#: ../../whatsnew/3.9.rst:474 +#: ../../whatsnew/3.9.rst:473 msgid "IDLE and idlelib" msgstr "" -#: ../../whatsnew/3.9.rst:476 +#: ../../whatsnew/3.9.rst:475 msgid "" "Added option to toggle cursor blink off. (Contributed by Zackery Spytz in :" "issue:`4603`.)" msgstr "" -#: ../../whatsnew/3.9.rst:479 +#: ../../whatsnew/3.9.rst:478 msgid "" "Escape key now closes IDLE completion windows. (Contributed by Johnny " "Najera in :issue:`38944`.)" msgstr "" -#: ../../whatsnew/3.9.rst:482 +#: ../../whatsnew/3.9.rst:481 msgid "" "Added keywords to module name completion list. (Contributed by Terry J. " "Reedy in :issue:`37765`.)" msgstr "" -#: ../../whatsnew/3.9.rst:485 +#: ../../whatsnew/3.9.rst:484 msgid "New in 3.9 maintenance releases" msgstr "" -#: ../../whatsnew/3.9.rst:487 +#: ../../whatsnew/3.9.rst:486 msgid "" "Make IDLE invoke :func:`sys.excepthook` (when started without '-n'). User " "hooks were previously ignored. (Contributed by Ken Hilton in :issue:" "`43008`.)" msgstr "" -#: ../../whatsnew/3.9.rst:491 +#: ../../whatsnew/3.9.rst:490 msgid "The changes above have been backported to 3.8 maintenance releases." msgstr "" -#: ../../whatsnew/3.9.rst:493 +#: ../../whatsnew/3.9.rst:492 msgid "" "Rearrange the settings dialog. Split the General tab into Windows and Shell/" "Ed tabs. Move help sources, which extend the Help menu, to the Extensions " @@ -713,41 +710,41 @@ msgid "" "`33962`.)" msgstr "" -#: ../../whatsnew/3.9.rst:501 +#: ../../whatsnew/3.9.rst:500 msgid "" "Apply syntax highlighting to ``.pyi`` files. (Contributed by Alex Waygood " "and Terry Jan Reedy in :issue:`45447`.)" msgstr "" -#: ../../whatsnew/3.9.rst:505 +#: ../../whatsnew/3.9.rst:504 msgid "imaplib" msgstr "imaplib" -#: ../../whatsnew/3.9.rst:507 +#: ../../whatsnew/3.9.rst:506 msgid "" ":class:`~imaplib.IMAP4` and :class:`~imaplib.IMAP4_SSL` now have an optional " "*timeout* parameter for their constructors. Also, the :meth:`~imaplib.IMAP4." "open` method now has an optional *timeout* parameter with this change. The " "overridden methods of :class:`~imaplib.IMAP4_SSL` and :class:`~imaplib." -"IMAP4_stream` were applied to this change. (Contributed by Dong-hee Na in :" +"IMAP4_stream` were applied to this change. (Contributed by Donghee Na in :" "issue:`38615`.)" msgstr "" -#: ../../whatsnew/3.9.rst:514 +#: ../../whatsnew/3.9.rst:513 msgid "" ":meth:`imaplib.IMAP4.unselect` is added. :meth:`imaplib.IMAP4.unselect` " "frees server's resources associated with the selected mailbox and returns " "the server to the authenticated state. This command performs the same " "actions as :meth:`imaplib.IMAP4.close`, except that no messages are " "permanently removed from the currently selected mailbox. (Contributed by " -"Dong-hee Na in :issue:`40375`.)" +"Donghee Na in :issue:`40375`.)" msgstr "" -#: ../../whatsnew/3.9.rst:522 +#: ../../whatsnew/3.9.rst:521 msgid "importlib" msgstr "importlib" -#: ../../whatsnew/3.9.rst:524 +#: ../../whatsnew/3.9.rst:523 msgid "" "To improve consistency with import statements, :func:`importlib.util." "resolve_name` now raises :exc:`ImportError` instead of :exc:`ValueError` for " @@ -755,47 +752,47 @@ msgid "" "`37444`.)" msgstr "" -#: ../../whatsnew/3.9.rst:529 +#: ../../whatsnew/3.9.rst:528 msgid "" "Import loaders which publish immutable module objects can now publish " "immutable packages in addition to individual modules. (Contributed by Dino " "Viehland in :issue:`39336`.)" msgstr "" -#: ../../whatsnew/3.9.rst:533 +#: ../../whatsnew/3.9.rst:532 msgid "" "Added :func:`importlib.resources.files` function with support for " "subdirectories in package data, matching backport in ``importlib_resources`` " "version 1.5. (Contributed by Jason R. Coombs in :issue:`39791`.)" msgstr "" -#: ../../whatsnew/3.9.rst:538 +#: ../../whatsnew/3.9.rst:537 msgid "" "Refreshed ``importlib.metadata`` from ``importlib_metadata`` version 1.6.1." msgstr "" -#: ../../whatsnew/3.9.rst:541 +#: ../../whatsnew/3.9.rst:540 msgid "inspect" msgstr "inspect" -#: ../../whatsnew/3.9.rst:543 +#: ../../whatsnew/3.9.rst:542 msgid "" ":attr:`inspect.BoundArguments.arguments` is changed from ``OrderedDict`` to " "regular dict. (Contributed by Inada Naoki in :issue:`36350` and :issue:" "`39775`.)" msgstr "" -#: ../../whatsnew/3.9.rst:547 +#: ../../whatsnew/3.9.rst:546 msgid "ipaddress" msgstr "ipaddress" -#: ../../whatsnew/3.9.rst:549 +#: ../../whatsnew/3.9.rst:548 msgid "" ":mod:`ipaddress` now supports IPv6 Scoped Addresses (IPv6 address with " "suffix ``%``)." msgstr "" -#: ../../whatsnew/3.9.rst:551 +#: ../../whatsnew/3.9.rst:550 msgid "" "Scoped IPv6 addresses can be parsed using :class:`ipaddress.IPv6Address`. If " "present, scope zone ID is available through the :attr:`~ipaddress." @@ -803,221 +800,221 @@ msgid "" "`34788`.)" msgstr "" -#: ../../whatsnew/3.9.rst:555 +#: ../../whatsnew/3.9.rst:554 msgid "" "Starting with Python 3.9.5 the :mod:`ipaddress` module no longer accepts any " "leading zeros in IPv4 address strings. (Contributed by Christian Heimes in :" "issue:`36384`)." msgstr "" -#: ../../whatsnew/3.9.rst:560 +#: ../../whatsnew/3.9.rst:559 msgid "math" msgstr "math" -#: ../../whatsnew/3.9.rst:562 +#: ../../whatsnew/3.9.rst:561 msgid "" "Expanded the :func:`math.gcd` function to handle multiple arguments. " "Formerly, it only supported two arguments. (Contributed by Serhiy Storchaka " "in :issue:`39648`.)" msgstr "" -#: ../../whatsnew/3.9.rst:566 +#: ../../whatsnew/3.9.rst:565 msgid "" "Added :func:`math.lcm`: return the least common multiple of specified " "arguments. (Contributed by Mark Dickinson, Ananthakrishnan and Serhiy " "Storchaka in :issue:`39479` and :issue:`39648`.)" msgstr "" -#: ../../whatsnew/3.9.rst:570 +#: ../../whatsnew/3.9.rst:569 msgid "" "Added :func:`math.nextafter`: return the next floating-point value after *x* " "towards *y*. (Contributed by Victor Stinner in :issue:`39288`.)" msgstr "" -#: ../../whatsnew/3.9.rst:574 +#: ../../whatsnew/3.9.rst:573 msgid "" "Added :func:`math.ulp`: return the value of the least significant bit of a " "float. (Contributed by Victor Stinner in :issue:`39310`.)" msgstr "" -#: ../../whatsnew/3.9.rst:579 +#: ../../whatsnew/3.9.rst:578 msgid "multiprocessing" msgstr "multiprocessing" -#: ../../whatsnew/3.9.rst:581 +#: ../../whatsnew/3.9.rst:580 msgid "" "The :class:`multiprocessing.SimpleQueue` class has a new :meth:" "`~multiprocessing.SimpleQueue.close` method to explicitly close the queue. " "(Contributed by Victor Stinner in :issue:`30966`.)" msgstr "" -#: ../../whatsnew/3.9.rst:587 +#: ../../whatsnew/3.9.rst:586 msgid "nntplib" msgstr "nntplib" -#: ../../whatsnew/3.9.rst:589 +#: ../../whatsnew/3.9.rst:588 msgid "" ":class:`~nntplib.NNTP` and :class:`~nntplib.NNTP_SSL` now raise a :class:" "`ValueError` if the given timeout for their constructor is zero to prevent " -"the creation of a non-blocking socket. (Contributed by Dong-hee Na in :issue:" +"the creation of a non-blocking socket. (Contributed by Donghee Na in :issue:" "`39259`.)" msgstr "" -#: ../../whatsnew/3.9.rst:594 +#: ../../whatsnew/3.9.rst:593 msgid "os" msgstr "os" -#: ../../whatsnew/3.9.rst:596 +#: ../../whatsnew/3.9.rst:595 msgid "" "Added :const:`~os.CLD_KILLED` and :const:`~os.CLD_STOPPED` for :attr:" -"`si_code`. (Contributed by Dong-hee Na in :issue:`38493`.)" +"`si_code`. (Contributed by Donghee Na in :issue:`38493`.)" msgstr "" -#: ../../whatsnew/3.9.rst:599 +#: ../../whatsnew/3.9.rst:598 msgid "" "Exposed the Linux-specific :func:`os.pidfd_open` (:issue:`38692`) and :const:" "`os.P_PIDFD` (:issue:`38713`) for process management with file descriptors." msgstr "" -#: ../../whatsnew/3.9.rst:603 +#: ../../whatsnew/3.9.rst:602 msgid "" "The :func:`os.unsetenv` function is now also available on Windows. " "(Contributed by Victor Stinner in :issue:`39413`.)" msgstr "" -#: ../../whatsnew/3.9.rst:606 +#: ../../whatsnew/3.9.rst:605 msgid "" "The :func:`os.putenv` and :func:`os.unsetenv` functions are now always " "available. (Contributed by Victor Stinner in :issue:`39395`.)" msgstr "" -#: ../../whatsnew/3.9.rst:610 +#: ../../whatsnew/3.9.rst:609 msgid "" "Added :func:`os.waitstatus_to_exitcode` function: convert a wait status to " "an exit code. (Contributed by Victor Stinner in :issue:`40094`.)" msgstr "" -#: ../../whatsnew/3.9.rst:615 +#: ../../whatsnew/3.9.rst:614 msgid "pathlib" msgstr "pathlib" -#: ../../whatsnew/3.9.rst:617 +#: ../../whatsnew/3.9.rst:616 msgid "" "Added :meth:`pathlib.Path.readlink()` which acts similarly to :func:`os." "readlink`. (Contributed by Girts Folkmanis in :issue:`30618`)" msgstr "" -#: ../../whatsnew/3.9.rst:622 +#: ../../whatsnew/3.9.rst:621 msgid "pdb" msgstr "pdb" -#: ../../whatsnew/3.9.rst:624 +#: ../../whatsnew/3.9.rst:623 msgid "" "On Windows now :class:`~pdb.Pdb` supports ``~/.pdbrc``. (Contributed by Tim " "Hopper and Dan Lidral-Porter in :issue:`20523`.)" msgstr "" -#: ../../whatsnew/3.9.rst:628 +#: ../../whatsnew/3.9.rst:627 msgid "poplib" msgstr "poplib" -#: ../../whatsnew/3.9.rst:630 +#: ../../whatsnew/3.9.rst:629 msgid "" ":class:`~poplib.POP3` and :class:`~poplib.POP3_SSL` now raise a :class:" "`ValueError` if the given timeout for their constructor is zero to prevent " -"the creation of a non-blocking socket. (Contributed by Dong-hee Na in :issue:" +"the creation of a non-blocking socket. (Contributed by Donghee Na in :issue:" "`39259`.)" msgstr "" -#: ../../whatsnew/3.9.rst:635 +#: ../../whatsnew/3.9.rst:634 msgid "pprint" msgstr "pprint" -#: ../../whatsnew/3.9.rst:637 +#: ../../whatsnew/3.9.rst:636 msgid "" ":mod:`pprint` can now pretty-print :class:`types.SimpleNamespace`. " "(Contributed by Carl Bordum Hansen in :issue:`37376`.)" msgstr "" -#: ../../whatsnew/3.9.rst:641 +#: ../../whatsnew/3.9.rst:640 msgid "pydoc" msgstr "pydoc" -#: ../../whatsnew/3.9.rst:643 +#: ../../whatsnew/3.9.rst:642 msgid "" "The documentation string is now shown not only for class, function, method " "etc, but for any object that has its own ``__doc__`` attribute. (Contributed " "by Serhiy Storchaka in :issue:`40257`.)" msgstr "" -#: ../../whatsnew/3.9.rst:648 +#: ../../whatsnew/3.9.rst:647 msgid "random" msgstr "random" -#: ../../whatsnew/3.9.rst:650 +#: ../../whatsnew/3.9.rst:649 msgid "" "Added a new :attr:`random.Random.randbytes` method: generate random bytes. " "(Contributed by Victor Stinner in :issue:`40286`.)" msgstr "" -#: ../../whatsnew/3.9.rst:654 +#: ../../whatsnew/3.9.rst:653 msgid "signal" msgstr "signal" -#: ../../whatsnew/3.9.rst:656 +#: ../../whatsnew/3.9.rst:655 msgid "" "Exposed the Linux-specific :func:`signal.pidfd_send_signal` for sending to " "signals to a process using a file descriptor instead of a pid. (:issue:" "`38712`)" msgstr "" -#: ../../whatsnew/3.9.rst:660 +#: ../../whatsnew/3.9.rst:659 msgid "smtplib" msgstr "smtplib" -#: ../../whatsnew/3.9.rst:662 +#: ../../whatsnew/3.9.rst:661 msgid "" ":class:`~smtplib.SMTP` and :class:`~smtplib.SMTP_SSL` now raise a :class:" "`ValueError` if the given timeout for their constructor is zero to prevent " -"the creation of a non-blocking socket. (Contributed by Dong-hee Na in :issue:" +"the creation of a non-blocking socket. (Contributed by Donghee Na in :issue:" "`39259`.)" msgstr "" -#: ../../whatsnew/3.9.rst:666 +#: ../../whatsnew/3.9.rst:665 msgid "" ":class:`~smtplib.LMTP` constructor now has an optional *timeout* parameter. " -"(Contributed by Dong-hee Na in :issue:`39329`.)" +"(Contributed by Donghee Na in :issue:`39329`.)" msgstr "" -#: ../../whatsnew/3.9.rst:670 +#: ../../whatsnew/3.9.rst:669 msgid "socket" msgstr "socket" -#: ../../whatsnew/3.9.rst:672 +#: ../../whatsnew/3.9.rst:671 msgid "" "The :mod:`socket` module now exports the :const:`~socket." "CAN_RAW_JOIN_FILTERS` constant on Linux 4.1 and greater. (Contributed by " "Stefan Tatschner and Zackery Spytz in :issue:`25780`.)" msgstr "" -#: ../../whatsnew/3.9.rst:676 +#: ../../whatsnew/3.9.rst:675 msgid "" "The socket module now supports the :const:`~socket.CAN_J1939` protocol on " "platforms that support it. (Contributed by Karl Ding in :issue:`40291`.)" msgstr "" -#: ../../whatsnew/3.9.rst:679 +#: ../../whatsnew/3.9.rst:678 msgid "" "The socket module now has the :func:`socket.send_fds` and :func:`socket." "recv_fds` functions. (Contributed by Joannah Nanjekye, Shinya Okano and " "Victor Stinner in :issue:`28724`.)" msgstr "" -#: ../../whatsnew/3.9.rst:685 +#: ../../whatsnew/3.9.rst:684 msgid "time" msgstr "time" -#: ../../whatsnew/3.9.rst:687 +#: ../../whatsnew/3.9.rst:686 msgid "" "On AIX, :func:`~time.thread_time` is now implemented with " "``thread_cputime()`` which has nanosecond resolution, rather than " @@ -1025,11 +1022,11 @@ msgid "" "milliseconds. (Contributed by Batuhan Taskaya in :issue:`40192`)" msgstr "" -#: ../../whatsnew/3.9.rst:693 +#: ../../whatsnew/3.9.rst:692 msgid "sys" msgstr "sys" -#: ../../whatsnew/3.9.rst:695 +#: ../../whatsnew/3.9.rst:694 msgid "" "Added a new :data:`sys.platlibdir` attribute: name of the platform-specific " "library directory. It is used to build the path of standard library and the " @@ -1039,29 +1036,29 @@ msgid "" "and Victor Stinner in :issue:`1294959`.)" msgstr "" -#: ../../whatsnew/3.9.rst:701 +#: ../../whatsnew/3.9.rst:700 msgid "" "Previously, :data:`sys.stderr` was block-buffered when non-interactive. Now " "``stderr`` defaults to always being line-buffered. (Contributed by Jendrik " "Seipp in :issue:`13601`.)" msgstr "" -#: ../../whatsnew/3.9.rst:706 +#: ../../whatsnew/3.9.rst:705 msgid "tracemalloc" msgstr "tracemalloc" -#: ../../whatsnew/3.9.rst:708 +#: ../../whatsnew/3.9.rst:707 msgid "" "Added :func:`tracemalloc.reset_peak` to set the peak size of traced memory " "blocks to the current size, to measure the peak of specific pieces of code. " "(Contributed by Huon Wilson in :issue:`40630`.)" msgstr "" -#: ../../whatsnew/3.9.rst:713 ../../whatsnew/3.9.rst:1496 +#: ../../whatsnew/3.9.rst:712 ../../whatsnew/3.9.rst:1495 msgid "typing" msgstr "typing" -#: ../../whatsnew/3.9.rst:715 +#: ../../whatsnew/3.9.rst:714 msgid "" ":pep:`593` introduced an :data:`typing.Annotated` type to decorate existing " "types with context-specific metadata and new ``include_extras`` parameter " @@ -1069,20 +1066,20 @@ msgid "" "(Contributed by Till Varoquaux and Konstantin Kashin.)" msgstr "" -#: ../../whatsnew/3.9.rst:721 +#: ../../whatsnew/3.9.rst:720 msgid "unicodedata" msgstr "unicodedata" -#: ../../whatsnew/3.9.rst:723 +#: ../../whatsnew/3.9.rst:722 msgid "" "The Unicode database has been updated to version 13.0.0. (:issue:`39926`)." msgstr "" -#: ../../whatsnew/3.9.rst:726 +#: ../../whatsnew/3.9.rst:725 msgid "venv" msgstr "venv" -#: ../../whatsnew/3.9.rst:728 +#: ../../whatsnew/3.9.rst:727 msgid "" "The activation scripts provided by :mod:`venv` now all specify their prompt " "customization consistently by always using the value specified by " @@ -1092,11 +1089,11 @@ msgid "" "Cannon in :issue:`37663`.)" msgstr "" -#: ../../whatsnew/3.9.rst:736 +#: ../../whatsnew/3.9.rst:735 msgid "xml" msgstr "xml" -#: ../../whatsnew/3.9.rst:738 +#: ../../whatsnew/3.9.rst:737 msgid "" "White space characters within attributes are now preserved when serializing :" "mod:`xml.etree.ElementTree` to XML file. EOLNs are no longer normalized to " @@ -1104,32 +1101,32 @@ msgid "" "2.11 of XML spec. (Contributed by Mefistotelis in :issue:`39011`.)" msgstr "" -#: ../../whatsnew/3.9.rst:746 +#: ../../whatsnew/3.9.rst:745 msgid "Optimizations" msgstr "最佳化" -#: ../../whatsnew/3.9.rst:748 +#: ../../whatsnew/3.9.rst:747 msgid "" "Optimized the idiom for assignment a temporary variable in comprehensions. " "Now ``for y in [expr]`` in comprehensions is as fast as a simple assignment " "``y = expr``. For example:" msgstr "" -#: ../../whatsnew/3.9.rst:752 +#: ../../whatsnew/3.9.rst:751 msgid "sums = [s for s in [0] for x in data for s in [s + x]]" -msgstr "" +msgstr "sums = [s for s in [0] for x in data for s in [s + x]]" -#: ../../whatsnew/3.9.rst:754 +#: ../../whatsnew/3.9.rst:753 msgid "" "Unlike the ``:=`` operator this idiom does not leak a variable to the outer " "scope." msgstr "" -#: ../../whatsnew/3.9.rst:757 +#: ../../whatsnew/3.9.rst:756 msgid "(Contributed by Serhiy Storchaka in :issue:`32856`.)" msgstr "(由 Serhiy Storchaka 在 :issue:`32856` 中貢獻。)" -#: ../../whatsnew/3.9.rst:759 +#: ../../whatsnew/3.9.rst:758 msgid "" "Optimized signal handling in multithreaded applications. If a thread " "different than the main thread gets a signal, the bytecode evaluation loop " @@ -1138,42 +1135,42 @@ msgid "" "interpreter can handle signals." msgstr "" -#: ../../whatsnew/3.9.rst:765 +#: ../../whatsnew/3.9.rst:764 msgid "" "Previously, the bytecode evaluation loop was interrupted at each instruction " "until the main thread handles signals. (Contributed by Victor Stinner in :" "issue:`40010`.)" msgstr "" -#: ../../whatsnew/3.9.rst:769 +#: ../../whatsnew/3.9.rst:768 msgid "" "Optimized the :mod:`subprocess` module on FreeBSD using ``closefrom()``. " "(Contributed by Ed Maste, Conrad Meyer, Kyle Evans, Kubilay Kocak and Victor " "Stinner in :issue:`38061`.)" msgstr "" -#: ../../whatsnew/3.9.rst:773 +#: ../../whatsnew/3.9.rst:772 msgid "" ":c:func:`PyLong_FromDouble` is now up to 1.87x faster for values that fit " "into :c:expr:`long`. (Contributed by Sergey Fedoseev in :issue:`37986`.)" msgstr "" -#: ../../whatsnew/3.9.rst:777 +#: ../../whatsnew/3.9.rst:776 msgid "" "A number of Python builtins (:class:`range`, :class:`tuple`, :class:`set`, :" "class:`frozenset`, :class:`list`, :class:`dict`) are now sped up by using :" -"pep:`590` vectorcall protocol. (Contributed by Dong-hee Na, Mark Shannon, " +"pep:`590` vectorcall protocol. (Contributed by Donghee Na, Mark Shannon, " "Jeroen Demeyer and Petr Viktorin in :issue:`37207`.)" msgstr "" -#: ../../whatsnew/3.9.rst:782 +#: ../../whatsnew/3.9.rst:781 msgid "" "Optimized :func:`~set.difference_update` for the case when the other set is " "much larger than the base set. (Suggested by Evgeny Kapun with code " "contributed by Michele Orrù in :issue:`8425`.)" msgstr "" -#: ../../whatsnew/3.9.rst:786 +#: ../../whatsnew/3.9.rst:785 msgid "" "Python's small object allocator (``obmalloc.c``) now allows (no more than) " "one empty arena to remain available for immediate reuse, without returning " @@ -1182,26 +1179,26 @@ msgid "" "in :issue:`37257`.)" msgstr "" -#: ../../whatsnew/3.9.rst:792 +#: ../../whatsnew/3.9.rst:791 msgid "" ":term:`floor division` of float operation now has a better performance. Also " "the message of :exc:`ZeroDivisionError` for this operation is updated. " -"(Contributed by Dong-hee Na in :issue:`39434`.)" +"(Contributed by Donghee Na in :issue:`39434`.)" msgstr "" -#: ../../whatsnew/3.9.rst:796 +#: ../../whatsnew/3.9.rst:795 msgid "" "Decoding short ASCII strings with UTF-8 and ascii codecs is now about 15% " "faster. (Contributed by Inada Naoki in :issue:`37348`.)" msgstr "" -#: ../../whatsnew/3.9.rst:799 +#: ../../whatsnew/3.9.rst:798 msgid "" "Here's a summary of performance improvements from Python 3.4 through Python " "3.9:" msgstr "" -#: ../../whatsnew/3.9.rst:846 +#: ../../whatsnew/3.9.rst:845 msgid "" "These results were generated from the variable access benchmark script at: " "``Tools/scripts/var_access_benchmark.py``. The benchmark script displays " @@ -1212,18 +1209,18 @@ msgid "" "python.org/downloads/macos/>`_." msgstr "" -#: ../../whatsnew/3.9.rst:856 +#: ../../whatsnew/3.9.rst:855 msgid "Deprecated" msgstr "已棄用" -#: ../../whatsnew/3.9.rst:858 +#: ../../whatsnew/3.9.rst:857 msgid "" "The distutils ``bdist_msi`` command is now deprecated, use ``bdist_wheel`` " "(wheel packages) instead. (Contributed by Hugo van Kemenade in :issue:" "`39586`.)" msgstr "" -#: ../../whatsnew/3.9.rst:862 +#: ../../whatsnew/3.9.rst:861 msgid "" "Currently :func:`math.factorial` accepts :class:`float` instances with non-" "negative integer values (like ``5.0``). It raises a :exc:`ValueError` for " @@ -1232,7 +1229,7 @@ msgid "" "Serhiy Storchaka in :issue:`37315`.)" msgstr "" -#: ../../whatsnew/3.9.rst:868 +#: ../../whatsnew/3.9.rst:867 msgid "" "The :mod:`parser` and :mod:`symbol` modules are deprecated and will be " "removed in future versions of Python. For the majority of use cases, users " @@ -1240,7 +1237,7 @@ msgid "" "stage, using the :mod:`ast` module." msgstr "" -#: ../../whatsnew/3.9.rst:873 +#: ../../whatsnew/3.9.rst:872 msgid "" "The Public C API functions :c:func:`!PyParser_SimpleParseStringFlags`, :c:" "func:`!PyParser_SimpleParseStringFlagsFilename`, :c:func:`!" @@ -1248,7 +1245,7 @@ msgid "" "and will be removed in Python 3.10 together with the old parser." msgstr "" -#: ../../whatsnew/3.9.rst:878 +#: ../../whatsnew/3.9.rst:877 msgid "" "Using :data:`NotImplemented` in a boolean context has been deprecated, as it " "is almost exclusively the result of incorrect rich comparator " @@ -1256,7 +1253,7 @@ msgid "" "Python. (Contributed by Josh Rosenberg in :issue:`35712`.)" msgstr "" -#: ../../whatsnew/3.9.rst:884 +#: ../../whatsnew/3.9.rst:883 msgid "" "The :mod:`random` module currently accepts any hashable type as a possible " "seed value. Unfortunately, some of those types are not guaranteed to have a " @@ -1265,7 +1262,7 @@ msgid "" "`bytes`, and :class:`bytearray`." msgstr "" -#: ../../whatsnew/3.9.rst:890 +#: ../../whatsnew/3.9.rst:889 msgid "" "Opening the :class:`~gzip.GzipFile` file for writing without specifying the " "*mode* argument is deprecated. In future Python versions it will always be " @@ -1274,39 +1271,39 @@ msgid "" "issue:`28286`.)" msgstr "" -#: ../../whatsnew/3.9.rst:896 +#: ../../whatsnew/3.9.rst:895 msgid "" "Deprecated the ``split()`` method of :class:`_tkinter.TkappType` in favour " "of the ``splitlist()`` method which has more consistent and predicable " "behavior. (Contributed by Serhiy Storchaka in :issue:`38371`.)" msgstr "" -#: ../../whatsnew/3.9.rst:901 +#: ../../whatsnew/3.9.rst:900 msgid "" "The explicit passing of coroutine objects to :func:`asyncio.wait` has been " "deprecated and will be removed in version 3.11. (Contributed by Yury " "Selivanov and Kyle Stanley in :issue:`34790`.)" msgstr "" -#: ../../whatsnew/3.9.rst:905 +#: ../../whatsnew/3.9.rst:904 msgid "" "binhex4 and hexbin4 standards are now deprecated. The :mod:`binhex` module " "and the following :mod:`binascii` functions are now deprecated:" msgstr "" -#: ../../whatsnew/3.9.rst:908 +#: ../../whatsnew/3.9.rst:907 msgid ":func:`~binascii.b2a_hqx`, :func:`~binascii.a2b_hqx`" msgstr ":func:`~binascii.b2a_hqx`\\ 、\\ :func:`~binascii.a2b_hqx`" -#: ../../whatsnew/3.9.rst:909 +#: ../../whatsnew/3.9.rst:908 msgid ":func:`~binascii.rlecode_hqx`, :func:`~binascii.rledecode_hqx`" msgstr ":func:`~binascii.rlecode_hqx`\\ 、\\ :func:`~binascii.rledecode_hqx`" -#: ../../whatsnew/3.9.rst:911 +#: ../../whatsnew/3.9.rst:910 msgid "(Contributed by Victor Stinner in :issue:`39353`.)" msgstr "(由 Victor Stinner 在 :issue:`39353` 中貢獻。)" -#: ../../whatsnew/3.9.rst:913 +#: ../../whatsnew/3.9.rst:912 msgid "" ":mod:`ast` classes ``slice``, ``Index`` and ``ExtSlice`` are considered " "deprecated and will be removed in future Python versions. ``value`` itself " @@ -1315,7 +1312,7 @@ msgid "" "Storchaka in :issue:`34822`.)" msgstr "" -#: ../../whatsnew/3.9.rst:919 +#: ../../whatsnew/3.9.rst:918 msgid "" ":mod:`ast` classes ``Suite``, ``Param``, ``AugLoad`` and ``AugStore`` are " "considered deprecated and will be removed in future Python versions. They " @@ -1324,7 +1321,7 @@ msgid "" "`39969` and Serhiy Storchaka in :issue:`39988`.)" msgstr "" -#: ../../whatsnew/3.9.rst:926 +#: ../../whatsnew/3.9.rst:925 msgid "" "The :c:func:`!PyEval_InitThreads` and :c:func:`!PyEval_ThreadsInitialized` " "functions are now deprecated and will be removed in Python 3.11. Calling :c:" @@ -1333,20 +1330,20 @@ msgid "" "in :issue:`39877`.)" msgstr "" -#: ../../whatsnew/3.9.rst:932 +#: ../../whatsnew/3.9.rst:931 msgid "" "Passing ``None`` as the first argument to the :func:`shlex.split` function " "has been deprecated. (Contributed by Zackery Spytz in :issue:`33262`.)" msgstr "" -#: ../../whatsnew/3.9.rst:935 +#: ../../whatsnew/3.9.rst:934 msgid "" ":func:`smtpd.MailmanProxy` is now deprecated as it is unusable without an " "external module, ``mailman``. (Contributed by Samuel Colvin in :issue:" "`35800`.)" msgstr "" -#: ../../whatsnew/3.9.rst:938 +#: ../../whatsnew/3.9.rst:937 msgid "" "The :mod:`lib2to3` module now emits a :exc:`PendingDeprecationWarning`. " "Python 3.9 switched to a PEG parser (see :pep:`617`), and Python 3.10 may " @@ -1356,39 +1353,39 @@ msgid "" "`parso`_. (Contributed by Carl Meyer in :issue:`40360`.)" msgstr "" -#: ../../whatsnew/3.9.rst:946 +#: ../../whatsnew/3.9.rst:945 msgid "" "The *random* parameter of :func:`random.shuffle` has been deprecated. " "(Contributed by Raymond Hettinger in :issue:`40465`)" msgstr "" -#: ../../whatsnew/3.9.rst:955 ../../whatsnew/3.9.rst:1410 +#: ../../whatsnew/3.9.rst:954 ../../whatsnew/3.9.rst:1409 msgid "Removed" msgstr "已移除" -#: ../../whatsnew/3.9.rst:957 +#: ../../whatsnew/3.9.rst:956 msgid "" "The erroneous version at :data:`unittest.mock.__version__` has been removed." msgstr "" -#: ../../whatsnew/3.9.rst:959 +#: ../../whatsnew/3.9.rst:958 msgid "" ":class:`nntplib.NNTP`: ``xpath()`` and ``xgtitle()`` methods have been " "removed. These methods are deprecated since Python 3.3. Generally, these " "extensions are not supported or not enabled by NNTP server administrators. " "For ``xgtitle()``, please use :meth:`nntplib.NNTP.descriptions` or :meth:" -"`nntplib.NNTP.description` instead. (Contributed by Dong-hee Na in :issue:" +"`nntplib.NNTP.description` instead. (Contributed by Donghee Na in :issue:" "`39366`.)" msgstr "" -#: ../../whatsnew/3.9.rst:966 +#: ../../whatsnew/3.9.rst:965 msgid "" ":class:`array.array`: ``tostring()`` and ``fromstring()`` methods have been " "removed. They were aliases to ``tobytes()`` and ``frombytes()``, deprecated " "since Python 3.2. (Contributed by Victor Stinner in :issue:`38916`.)" msgstr "" -#: ../../whatsnew/3.9.rst:971 +#: ../../whatsnew/3.9.rst:970 msgid "" "The undocumented ``sys.callstats()`` function has been removed. Since Python " "3.7, it was deprecated and always returned :const:`None`. It required a " @@ -1396,7 +1393,7 @@ msgid "" "3.7. (Contributed by Victor Stinner in :issue:`37414`.)" msgstr "" -#: ../../whatsnew/3.9.rst:976 +#: ../../whatsnew/3.9.rst:975 msgid "" "The ``sys.getcheckinterval()`` and ``sys.setcheckinterval()`` functions have " "been removed. They were deprecated since Python 3.2. Use :func:`sys." @@ -1404,21 +1401,21 @@ msgid "" "by Victor Stinner in :issue:`37392`.)" msgstr "" -#: ../../whatsnew/3.9.rst:981 +#: ../../whatsnew/3.9.rst:980 msgid "" "The C function ``PyImport_Cleanup()`` has been removed. It was documented " "as: \"Empty the module table. For internal use only.\" (Contributed by " "Victor Stinner in :issue:`36710`.)" msgstr "" -#: ../../whatsnew/3.9.rst:985 +#: ../../whatsnew/3.9.rst:984 msgid "" "``_dummy_thread`` and ``dummy_threading`` modules have been removed. These " "modules were deprecated since Python 3.7 which requires threading support. " "(Contributed by Victor Stinner in :issue:`37312`.)" msgstr "" -#: ../../whatsnew/3.9.rst:989 +#: ../../whatsnew/3.9.rst:988 msgid "" "``aifc.openfp()`` alias to ``aifc.open()``, ``sunau.openfp()`` alias to " "``sunau.open()``, and ``wave.openfp()`` alias to :func:`wave.open()` have " @@ -1426,14 +1423,14 @@ msgid "" "Stinner in :issue:`37320`.)" msgstr "" -#: ../../whatsnew/3.9.rst:994 +#: ../../whatsnew/3.9.rst:993 msgid "" "The :meth:`~threading.Thread.isAlive()` method of :class:`threading.Thread` " "has been removed. It was deprecated since Python 3.8. Use :meth:`~threading." -"Thread.is_alive()` instead. (Contributed by Dong-hee Na in :issue:`37804`.)" +"Thread.is_alive()` instead. (Contributed by Donghee Na in :issue:`37804`.)" msgstr "" -#: ../../whatsnew/3.9.rst:999 +#: ../../whatsnew/3.9.rst:998 msgid "" "Methods ``getchildren()`` and ``getiterator()`` of classes :class:`~xml." "etree.ElementTree.ElementTree` and :class:`~xml.etree.ElementTree.Element` " @@ -1443,7 +1440,7 @@ msgid "" "getiterator()``. (Contributed by Serhiy Storchaka in :issue:`36543`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1007 +#: ../../whatsnew/3.9.rst:1006 msgid "" "The old :mod:`plistlib` API has been removed, it was deprecated since Python " "3.4. Use the :func:`~plistlib.load`, :func:`~plistlib.loads`, :func:" @@ -1452,7 +1449,7 @@ msgid "" "are always used instead. (Contributed by Jon Janzen in :issue:`36409`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1013 +#: ../../whatsnew/3.9.rst:1012 msgid "" "The C function ``PyGen_NeedsFinalizing`` has been removed. It was not " "documented, tested, or used anywhere within CPython after the implementation " @@ -1460,7 +1457,7 @@ msgid "" "in :issue:`15088`)" msgstr "" -#: ../../whatsnew/3.9.rst:1018 +#: ../../whatsnew/3.9.rst:1017 msgid "" "``base64.encodestring()`` and ``base64.decodestring()``, aliases deprecated " "since Python 3.1, have been removed: use :func:`base64.encodebytes` and :" @@ -1468,14 +1465,14 @@ msgid "" "`39351`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1023 +#: ../../whatsnew/3.9.rst:1022 msgid "" "``fractions.gcd()`` function has been removed, it was deprecated since " "Python 3.5 (:issue:`22486`): use :func:`math.gcd` instead. (Contributed by " "Victor Stinner in :issue:`39350`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1027 +#: ../../whatsnew/3.9.rst:1026 msgid "" "The *buffering* parameter of :class:`bz2.BZ2File` has been removed. Since " "Python 3.0, it was ignored and using it emitted a :exc:`DeprecationWarning`. " @@ -1483,7 +1480,7 @@ msgid "" "Victor Stinner in :issue:`39357`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1032 +#: ../../whatsnew/3.9.rst:1031 msgid "" "The *encoding* parameter of :func:`json.loads` has been removed. As of " "Python 3.1, it was deprecated and ignored; using it has emitted a :exc:" @@ -1491,7 +1488,7 @@ msgid "" "`39377`)" msgstr "" -#: ../../whatsnew/3.9.rst:1037 +#: ../../whatsnew/3.9.rst:1036 msgid "" "``with (await asyncio.lock):`` and ``with (yield from asyncio.lock):`` " "statements are not longer supported, use ``async with lock`` instead. The " @@ -1499,7 +1496,7 @@ msgid "" "(Contributed by Andrew Svetlov in :issue:`34793`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1042 +#: ../../whatsnew/3.9.rst:1041 msgid "" "The :func:`sys.getcounts` function, the ``-X showalloccount`` command line " "option and the ``show_alloc_count`` field of the C structure :c:type:" @@ -1508,7 +1505,7 @@ msgid "" "`39489`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1048 +#: ../../whatsnew/3.9.rst:1047 msgid "" "The ``_field_types`` attribute of the :class:`typing.NamedTuple` class has " "been removed. It was deprecated since Python 3.8. Use the " @@ -1516,14 +1513,14 @@ msgid "" "issue:`40182`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1053 +#: ../../whatsnew/3.9.rst:1052 msgid "" "The :meth:`symtable.SymbolTable.has_exec` method has been removed. It was " "deprecated since 2006, and only returning ``False`` when it's called. " "(Contributed by Batuhan Taskaya in :issue:`40208`)" msgstr "" -#: ../../whatsnew/3.9.rst:1057 +#: ../../whatsnew/3.9.rst:1056 msgid "" "The :meth:`asyncio.Task.current_task` and :meth:`asyncio.Task.all_tasks` " "have been removed. They were deprecated since Python 3.7 and you can use :" @@ -1531,7 +1528,7 @@ msgid "" "(Contributed by Rémi Lapeyre in :issue:`40967`)" msgstr "" -#: ../../whatsnew/3.9.rst:1062 +#: ../../whatsnew/3.9.rst:1061 msgid "" "The ``unescape()`` method in the :class:`html.parser.HTMLParser` class has " "been removed (it was deprecated since Python 3.4). :func:`html.unescape` " @@ -1539,21 +1536,21 @@ msgid "" "unicode characters." msgstr "" -#: ../../whatsnew/3.9.rst:1069 ../../whatsnew/3.9.rst:1336 +#: ../../whatsnew/3.9.rst:1068 ../../whatsnew/3.9.rst:1335 msgid "Porting to Python 3.9" msgstr "" -#: ../../whatsnew/3.9.rst:1071 +#: ../../whatsnew/3.9.rst:1070 msgid "" "This section lists previously described changes and other bugfixes that may " "require changes to your code." msgstr "" -#: ../../whatsnew/3.9.rst:1076 +#: ../../whatsnew/3.9.rst:1075 msgid "Changes in the Python API" msgstr "" -#: ../../whatsnew/3.9.rst:1078 +#: ../../whatsnew/3.9.rst:1077 msgid "" ":func:`__import__` and :func:`importlib.util.resolve_name` now raise :exc:" "`ImportError` where it previously raised :exc:`ValueError`. Callers catching " @@ -1561,26 +1558,26 @@ msgid "" "versions will need to catch both using ``except (ImportError, ValueError):``." msgstr "" -#: ../../whatsnew/3.9.rst:1083 +#: ../../whatsnew/3.9.rst:1082 msgid "" "The :mod:`venv` activation scripts no longer special-case when " "``__VENV_PROMPT__`` is set to ``\"\"``." msgstr "" -#: ../../whatsnew/3.9.rst:1086 +#: ../../whatsnew/3.9.rst:1085 msgid "" "The :meth:`select.epoll.unregister` method no longer ignores the :const:" "`~errno.EBADF` error. (Contributed by Victor Stinner in :issue:`39239`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1090 +#: ../../whatsnew/3.9.rst:1089 msgid "" "The *compresslevel* parameter of :class:`bz2.BZ2File` became keyword-only, " "since the *buffering* parameter has been removed. (Contributed by Victor " "Stinner in :issue:`39357`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1094 +#: ../../whatsnew/3.9.rst:1093 msgid "" "Simplified AST for subscription. Simple indices will be represented by their " "value, extended slices will be represented as tuples. ``Index(value)`` will " @@ -1588,21 +1585,21 @@ msgid "" "Load())``. (Contributed by Serhiy Storchaka in :issue:`34822`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1100 +#: ../../whatsnew/3.9.rst:1099 msgid "" "The :mod:`importlib` module now ignores the :envvar:`PYTHONCASEOK` " "environment variable when the :option:`-E` or :option:`-I` command line " "options are being used." msgstr "" -#: ../../whatsnew/3.9.rst:1104 +#: ../../whatsnew/3.9.rst:1103 msgid "" "The *encoding* parameter has been added to the classes :class:`ftplib.FTP` " "and :class:`ftplib.FTP_TLS` as a keyword-only parameter, and the default " "encoding is changed from Latin-1 to UTF-8 to follow :rfc:`2640`." msgstr "" -#: ../../whatsnew/3.9.rst:1108 +#: ../../whatsnew/3.9.rst:1107 msgid "" ":meth:`asyncio.loop.shutdown_default_executor` has been added to :class:" "`~asyncio.AbstractEventLoop`, meaning alternative event loops that inherit " @@ -1610,7 +1607,7 @@ msgid "" "issue:`34037`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1113 +#: ../../whatsnew/3.9.rst:1112 msgid "" "The constant values of future flags in the :mod:`__future__` module is " "updated in order to prevent collision with compiler flags. Previously " @@ -1618,7 +1615,7 @@ msgid "" "(Contributed by Batuhan Taskaya in :issue:`39562`)" msgstr "" -#: ../../whatsnew/3.9.rst:1118 +#: ../../whatsnew/3.9.rst:1117 msgid "" "``array('u')`` now uses :c:type:`wchar_t` as C type instead of " "``Py_UNICODE``. This change doesn't affect to its behavior because " @@ -1626,7 +1623,7 @@ msgid "" "by Inada Naoki in :issue:`34538`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1123 +#: ../../whatsnew/3.9.rst:1122 msgid "" "The :func:`logging.getLogger` API now returns the root logger when passed " "the name ``'root'``, whereas previously it returned a non-root logger named " @@ -1636,7 +1633,7 @@ msgid "" "(Contributed by Vinay Sajip in :issue:`37742`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1130 +#: ../../whatsnew/3.9.rst:1129 msgid "" "Division handling of :class:`~pathlib.PurePath` now returns " "``NotImplemented`` instead of raising a :exc:`TypeError` when passed " @@ -1645,7 +1642,7 @@ msgid "" "mentioned types. (Contributed by Roger Aiudi in :issue:`34775`)." msgstr "" -#: ../../whatsnew/3.9.rst:1136 +#: ../../whatsnew/3.9.rst:1135 msgid "" "Starting with Python 3.9.5 the :mod:`ipaddress` module no longer accepts any " "leading zeros in IPv4 address strings. Leading zeros are ambiguous and " @@ -1655,7 +1652,7 @@ msgid "" "leading zeros. (Contributed by Christian Heimes in :issue:`36384`)." msgstr "" -#: ../../whatsnew/3.9.rst:1144 +#: ../../whatsnew/3.9.rst:1143 msgid "" ":func:`codecs.lookup` now normalizes the encoding name the same way as :func:" "`encodings.normalize_encoding`, except that :func:`codecs.lookup` also " @@ -1664,11 +1661,11 @@ msgid "" "in :issue:`37751`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1152 +#: ../../whatsnew/3.9.rst:1151 msgid "Changes in the C API" msgstr "C API 中的改動" -#: ../../whatsnew/3.9.rst:1154 +#: ../../whatsnew/3.9.rst:1153 msgid "" "Instances of :ref:`heap-allocated types ` (such as those created " "with :c:func:`PyType_FromSpec` and similar APIs) hold a reference to their " @@ -1679,7 +1676,7 @@ msgid "" "heap-allocated types visit the object's type." msgstr "" -#: ../../whatsnew/3.9.rst:1175 +#: ../../whatsnew/3.9.rst:1174 msgid "" "If your traverse function delegates to ``tp_traverse`` of its base class (or " "another type), ensure that ``Py_TYPE(self)`` is visited only once. Note that " @@ -1687,19 +1684,19 @@ msgid "" "``tp_traverse``." msgstr "" -#: ../../whatsnew/3.9.rst:1180 +#: ../../whatsnew/3.9.rst:1179 msgid "For example, if your ``tp_traverse`` function includes:" msgstr "" -#: ../../whatsnew/3.9.rst:1186 +#: ../../whatsnew/3.9.rst:1185 msgid "then add:" msgstr "" -#: ../../whatsnew/3.9.rst:1199 +#: ../../whatsnew/3.9.rst:1198 msgid "(See :issue:`35810` and :issue:`40217` for more information.)" msgstr "(更多資訊請見 :issue:`35810` 與 :issue:`40217`\\ 。)" -#: ../../whatsnew/3.9.rst:1201 +#: ../../whatsnew/3.9.rst:1200 msgid "" "The functions ``PyEval_CallObject``, ``PyEval_CallFunction``, " "``PyEval_CallMethod`` and ``PyEval_CallObjectWithKeywords`` are deprecated. " @@ -1707,11 +1704,11 @@ msgid "" "issue:`29548`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1207 +#: ../../whatsnew/3.9.rst:1206 msgid "CPython bytecode changes" msgstr "" -#: ../../whatsnew/3.9.rst:1209 +#: ../../whatsnew/3.9.rst:1208 msgid "" "The :opcode:`LOAD_ASSERTION_ERROR` opcode was added for handling the :" "keyword:`assert` statement. Previously, the assert statement would not work " @@ -1719,37 +1716,37 @@ msgid "" "(Contributed by Zackery Spytz in :issue:`34880`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1214 +#: ../../whatsnew/3.9.rst:1213 msgid "" "The :opcode:`COMPARE_OP` opcode was split into four distinct instructions:" msgstr "" -#: ../../whatsnew/3.9.rst:1216 +#: ../../whatsnew/3.9.rst:1215 msgid "``COMPARE_OP`` for rich comparisons" msgstr "" -#: ../../whatsnew/3.9.rst:1217 +#: ../../whatsnew/3.9.rst:1216 msgid "``IS_OP`` for 'is' and 'is not' tests" msgstr "" -#: ../../whatsnew/3.9.rst:1218 +#: ../../whatsnew/3.9.rst:1217 msgid "``CONTAINS_OP`` for 'in' and 'not in' tests" msgstr "" -#: ../../whatsnew/3.9.rst:1219 +#: ../../whatsnew/3.9.rst:1218 msgid "" "``JUMP_IF_NOT_EXC_MATCH`` for checking exceptions in 'try-except' statements." msgstr "" -#: ../../whatsnew/3.9.rst:1222 +#: ../../whatsnew/3.9.rst:1221 msgid "(Contributed by Mark Shannon in :issue:`39156`.)" msgstr "(由 Mark Shannon 在 :issue:`39156` 中貢獻。)" -#: ../../whatsnew/3.9.rst:1226 +#: ../../whatsnew/3.9.rst:1225 msgid "Build Changes" msgstr "" -#: ../../whatsnew/3.9.rst:1228 +#: ../../whatsnew/3.9.rst:1227 msgid "" "Added ``--with-platlibdir`` option to the ``configure`` script: name of the " "platform-specific library directory, stored in the new :data:`sys." @@ -1758,26 +1755,26 @@ msgid "" "and Victor Stinner in :issue:`1294959`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1234 +#: ../../whatsnew/3.9.rst:1233 msgid "" "The ``COUNT_ALLOCS`` special build macro has been removed. (Contributed by " "Victor Stinner in :issue:`39489`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1237 +#: ../../whatsnew/3.9.rst:1236 msgid "" "On non-Windows platforms, the :c:func:`setenv` and :c:func:`unsetenv` " "functions are now required to build Python. (Contributed by Victor Stinner " "in :issue:`39395`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1241 +#: ../../whatsnew/3.9.rst:1240 msgid "" "On non-Windows platforms, creating ``bdist_wininst`` installers is now " "officially unsupported. (See :issue:`10945` for more details.)" msgstr "" -#: ../../whatsnew/3.9.rst:1244 +#: ../../whatsnew/3.9.rst:1243 msgid "" "When building Python on macOS from source, ``_tkinter`` now links with non-" "system Tcl and Tk frameworks if they are installed in ``/Library/" @@ -1788,13 +1785,13 @@ msgid "" "(Contributed by Ned Deily in :issue:`34956`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1253 +#: ../../whatsnew/3.9.rst:1252 msgid "" "Python can now be built for Windows 10 ARM64. (Contributed by Steve Dower " "in :issue:`33125`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1256 +#: ../../whatsnew/3.9.rst:1255 msgid "" "Some individual tests are now skipped when ``--pgo`` is used. The tests in " "question increased the PGO task time significantly and likely didn't help " @@ -1810,11 +1807,11 @@ msgid "" "details.)" msgstr "" -#: ../../whatsnew/3.9.rst:1271 +#: ../../whatsnew/3.9.rst:1270 msgid "C API Changes" msgstr "" -#: ../../whatsnew/3.9.rst:1276 +#: ../../whatsnew/3.9.rst:1275 msgid "" ":pep:`573`: Added :c:func:`PyType_FromModuleAndSpec` to associate a module " "with a class; :c:func:`PyType_GetModule` and :c:func:`PyType_GetModuleState` " @@ -1823,20 +1820,20 @@ msgid "" "(Contributed by Marcel Plch and Petr Viktorin in :issue:`38787`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1283 +#: ../../whatsnew/3.9.rst:1282 msgid "" "Added :c:func:`PyFrame_GetCode` function: get a frame code. Added :c:func:" "`PyFrame_GetBack` function: get the frame next outer frame. (Contributed by " "Victor Stinner in :issue:`40421`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1287 +#: ../../whatsnew/3.9.rst:1286 msgid "" "Added :c:func:`PyFrame_GetLineNumber` to the limited C API. (Contributed by " "Victor Stinner in :issue:`40421`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1290 +#: ../../whatsnew/3.9.rst:1289 msgid "" "Added :c:func:`PyThreadState_GetInterpreter` and :c:func:" "`PyInterpreterState_Get` functions to get the interpreter. Added :c:func:" @@ -1846,7 +1843,7 @@ msgid "" "issue:`39947`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1298 +#: ../../whatsnew/3.9.rst:1297 msgid "" "Added a new public :c:func:`PyObject_CallNoArgs` function to the C API, " "which calls a callable Python object without any arguments. It is the most " @@ -1854,11 +1851,11 @@ msgid "" "(Contributed by Victor Stinner in :issue:`37194`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1303 ../../whatsnew/3.9.rst:1421 +#: ../../whatsnew/3.9.rst:1302 ../../whatsnew/3.9.rst:1420 msgid "Changes in the limited C API (if ``Py_LIMITED_API`` macro is defined):" msgstr "" -#: ../../whatsnew/3.9.rst:1305 +#: ../../whatsnew/3.9.rst:1304 msgid "" "Provide :c:func:`Py_EnterRecursiveCall` and :c:func:`Py_LeaveRecursiveCall` " "as regular functions for the limited API. Previously, there were defined as " @@ -1867,23 +1864,23 @@ msgid "" "the limited C API)." msgstr "" -#: ../../whatsnew/3.9.rst:1311 +#: ../../whatsnew/3.9.rst:1310 msgid "" "``PyObject_INIT()`` and ``PyObject_INIT_VAR()`` become regular \"opaque\" " "function to hide implementation details." msgstr "" -#: ../../whatsnew/3.9.rst:1314 ../../whatsnew/3.9.rst:1448 +#: ../../whatsnew/3.9.rst:1313 ../../whatsnew/3.9.rst:1447 msgid "(Contributed by Victor Stinner in :issue:`38644` and :issue:`39542`.)" msgstr "(由 Victor Stinner 在 38644 和 39542 中貢獻。)" -#: ../../whatsnew/3.9.rst:1316 +#: ../../whatsnew/3.9.rst:1315 msgid "" "The :c:func:`PyModule_AddType` function is added to help adding a type to a " -"module. (Contributed by Dong-hee Na in :issue:`40024`.)" +"module. (Contributed by Donghee Na in :issue:`40024`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1320 +#: ../../whatsnew/3.9.rst:1319 msgid "" "Added the functions :c:func:`PyObject_GC_IsTracked` and :c:func:" "`PyObject_GC_IsFinalized` to the public API to allow to query if Python " @@ -1892,27 +1889,27 @@ msgid "" "issue:`40241`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1326 +#: ../../whatsnew/3.9.rst:1325 msgid "" "Added :c:func:`_PyObject_FunctionStr` to get a user-friendly string " "representation of a function-like object. (Patch by Jeroen Demeyer in :issue:" "`37645`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1330 +#: ../../whatsnew/3.9.rst:1329 msgid "" "Added :c:func:`PyObject_CallOneArg` for calling an object with one " "positional argument (Patch by Jeroen Demeyer in :issue:`37483`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1338 +#: ../../whatsnew/3.9.rst:1337 msgid "" "``PyInterpreterState.eval_frame`` (:pep:`523`) now requires a new mandatory " "*tstate* parameter (``PyThreadState*``). (Contributed by Victor Stinner in :" "issue:`38500`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1342 +#: ../../whatsnew/3.9.rst:1341 msgid "" "Extension modules: :c:member:`~PyModuleDef.m_traverse`, :c:member:" "`~PyModuleDef.m_clear` and :c:member:`~PyModuleDef.m_free` functions of :c:" @@ -1924,12 +1921,12 @@ msgid "" "`PyModule_GetState`) is ``NULL``." msgstr "" -#: ../../whatsnew/3.9.rst:1351 +#: ../../whatsnew/3.9.rst:1350 msgid "" "Extension modules without module state (``m_size <= 0``) are not affected." msgstr "" -#: ../../whatsnew/3.9.rst:1353 +#: ../../whatsnew/3.9.rst:1352 msgid "" "If :c:func:`Py_AddPendingCall` is called in a subinterpreter, the function " "is now scheduled to be called from the subinterpreter, rather than being " @@ -1937,7 +1934,7 @@ msgid "" "of scheduled calls. (Contributed by Victor Stinner in :issue:`39984`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1359 +#: ../../whatsnew/3.9.rst:1358 msgid "" "The Windows registry is no longer used to initialize :data:`sys.path` when " "the ``-E`` option is used (if :c:member:`PyConfig.use_environment` is set to " @@ -1945,21 +1942,21 @@ msgid "" "by Zackery Spytz in :issue:`8901`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1364 +#: ../../whatsnew/3.9.rst:1363 msgid "" "The global variable :c:data:`PyStructSequence_UnnamedField` is now a " "constant and refers to a constant string. (Contributed by Serhiy Storchaka " "in :issue:`38650`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1368 +#: ../../whatsnew/3.9.rst:1367 msgid "" "The :c:type:`PyGC_Head` structure is now opaque. It is only defined in the " "internal C API (``pycore_gc.h``). (Contributed by Victor Stinner in :issue:" "`40241`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1372 +#: ../../whatsnew/3.9.rst:1371 msgid "" "The ``Py_UNICODE_COPY``, ``Py_UNICODE_FILL``, ``PyUnicode_WSTR_LENGTH``, :c:" "func:`!PyUnicode_FromUnicode`, :c:func:`!PyUnicode_AsUnicode`, " @@ -1968,7 +1965,7 @@ msgid "" "Python 3.3. (Contributed by Inada Naoki in :issue:`36346`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1379 +#: ../../whatsnew/3.9.rst:1378 msgid "" "The :c:func:`Py_FatalError` function is replaced with a macro which logs " "automatically the name of the current function, unless the " @@ -1976,22 +1973,22 @@ msgid "" "issue:`39882`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1384 +#: ../../whatsnew/3.9.rst:1383 msgid "" "The vectorcall protocol now requires that the caller passes only strings as " "keyword names. (See :issue:`37540` for more information.)" msgstr "" -#: ../../whatsnew/3.9.rst:1387 +#: ../../whatsnew/3.9.rst:1386 msgid "" "Implementation details of a number of macros and functions are now hidden:" msgstr "" -#: ../../whatsnew/3.9.rst:1389 +#: ../../whatsnew/3.9.rst:1388 msgid ":c:func:`PyObject_IS_GC` macro was converted to a function." msgstr "" -#: ../../whatsnew/3.9.rst:1391 +#: ../../whatsnew/3.9.rst:1390 msgid "" "The :c:func:`PyObject_NEW` macro becomes an alias to the :c:macro:" "`PyObject_New` macro, and the :c:func:`PyObject_NEW_VAR` macro becomes an " @@ -1999,38 +1996,38 @@ msgid "" "directly the :c:member:`PyTypeObject.tp_basicsize` member." msgstr "" -#: ../../whatsnew/3.9.rst:1396 +#: ../../whatsnew/3.9.rst:1395 msgid "" ":c:func:`PyObject_GET_WEAKREFS_LISTPTR` macro was converted to a function: " "the macro accessed directly the :c:member:`PyTypeObject.tp_weaklistoffset` " "member." msgstr "" -#: ../../whatsnew/3.9.rst:1400 +#: ../../whatsnew/3.9.rst:1399 msgid "" ":c:func:`PyObject_CheckBuffer` macro was converted to a function: the macro " "accessed directly the :c:member:`PyTypeObject.tp_as_buffer` member." msgstr "" -#: ../../whatsnew/3.9.rst:1403 +#: ../../whatsnew/3.9.rst:1402 msgid "" ":c:func:`PyIndex_Check` is now always declared as an opaque function to hide " "implementation details: removed the ``PyIndex_Check()`` macro. The macro " "accessed directly the :c:member:`PyTypeObject.tp_as_number` member." msgstr "" -#: ../../whatsnew/3.9.rst:1407 +#: ../../whatsnew/3.9.rst:1406 msgid "(See :issue:`40170` for more details.)" msgstr "(更多資訊請見 :issue:`40170`\\ 。)" -#: ../../whatsnew/3.9.rst:1412 +#: ../../whatsnew/3.9.rst:1411 msgid "" "Excluded ``PyFPE_START_PROTECT()`` and ``PyFPE_END_PROTECT()`` macros of " "``pyfpe.h`` from the limited C API. (Contributed by Victor Stinner in :issue:" "`38835`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1416 +#: ../../whatsnew/3.9.rst:1415 msgid "" "The ``tp_print`` slot of :ref:`PyTypeObject ` has been " "removed. It was used for printing objects to files in Python 2.7 and before. " @@ -2038,89 +2035,89 @@ msgid "" "Demeyer in :issue:`36974`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1423 +#: ../../whatsnew/3.9.rst:1422 msgid "Excluded the following functions from the limited C API:" msgstr "" -#: ../../whatsnew/3.9.rst:1425 +#: ../../whatsnew/3.9.rst:1424 msgid "" "``PyThreadState_DeleteCurrent()`` (Contributed by Joannah Nanjekye in :issue:" "`37878`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1427 +#: ../../whatsnew/3.9.rst:1426 msgid "``_Py_CheckRecursionLimit``" msgstr "``_Py_CheckRecursionLimit``" -#: ../../whatsnew/3.9.rst:1428 +#: ../../whatsnew/3.9.rst:1427 msgid "``_Py_NewReference()``" msgstr "``_Py_NewReference()``" -#: ../../whatsnew/3.9.rst:1429 +#: ../../whatsnew/3.9.rst:1428 msgid "``_Py_ForgetReference()``" msgstr "``_Py_ForgetReference()``" -#: ../../whatsnew/3.9.rst:1430 +#: ../../whatsnew/3.9.rst:1429 msgid "``_PyTraceMalloc_NewReference()``" msgstr "``_PyTraceMalloc_NewReference()``" -#: ../../whatsnew/3.9.rst:1431 +#: ../../whatsnew/3.9.rst:1430 msgid "``_Py_GetRefTotal()``" msgstr "``_Py_GetRefTotal()``" -#: ../../whatsnew/3.9.rst:1432 +#: ../../whatsnew/3.9.rst:1431 msgid "The trashcan mechanism which never worked in the limited C API." msgstr "" -#: ../../whatsnew/3.9.rst:1433 +#: ../../whatsnew/3.9.rst:1432 msgid "``PyTrash_UNWIND_LEVEL``" msgstr "``PyTrash_UNWIND_LEVEL``" -#: ../../whatsnew/3.9.rst:1434 +#: ../../whatsnew/3.9.rst:1433 msgid "``Py_TRASHCAN_BEGIN_CONDITION``" msgstr "``Py_TRASHCAN_BEGIN_CONDITION``" -#: ../../whatsnew/3.9.rst:1435 +#: ../../whatsnew/3.9.rst:1434 msgid "``Py_TRASHCAN_BEGIN``" msgstr "``Py_TRASHCAN_BEGIN``" -#: ../../whatsnew/3.9.rst:1436 +#: ../../whatsnew/3.9.rst:1435 msgid "``Py_TRASHCAN_END``" msgstr "``Py_TRASHCAN_END``" -#: ../../whatsnew/3.9.rst:1437 +#: ../../whatsnew/3.9.rst:1436 msgid "``Py_TRASHCAN_SAFE_BEGIN``" msgstr "``Py_TRASHCAN_SAFE_BEGIN``" -#: ../../whatsnew/3.9.rst:1438 +#: ../../whatsnew/3.9.rst:1437 msgid "``Py_TRASHCAN_SAFE_END``" msgstr "``Py_TRASHCAN_SAFE_END``" -#: ../../whatsnew/3.9.rst:1440 +#: ../../whatsnew/3.9.rst:1439 msgid "Moved following functions and definitions to the internal C API:" msgstr "" -#: ../../whatsnew/3.9.rst:1442 +#: ../../whatsnew/3.9.rst:1441 msgid "``_PyDebug_PrintTotalRefs()``" msgstr "``_PyDebug_PrintTotalRefs()``" -#: ../../whatsnew/3.9.rst:1443 +#: ../../whatsnew/3.9.rst:1442 msgid "``_Py_PrintReferences()``" msgstr "``_Py_PrintReferences()``" -#: ../../whatsnew/3.9.rst:1444 +#: ../../whatsnew/3.9.rst:1443 msgid "``_Py_PrintReferenceAddresses()``" msgstr "``_Py_PrintReferenceAddresses()``" -#: ../../whatsnew/3.9.rst:1445 +#: ../../whatsnew/3.9.rst:1444 msgid "``_Py_tracemalloc_config``" msgstr "``_Py_tracemalloc_config``" -#: ../../whatsnew/3.9.rst:1446 +#: ../../whatsnew/3.9.rst:1445 msgid "``_Py_AddToAllObjects()`` (specific to ``Py_TRACE_REFS`` build)" msgstr "" -#: ../../whatsnew/3.9.rst:1450 +#: ../../whatsnew/3.9.rst:1449 msgid "" "Removed ``_PyRuntime.getframe`` hook and removed ``_PyThreadState_GetFrame`` " "macro which was an alias to ``_PyRuntime.getframe``. They were only exposed " @@ -2128,72 +2125,72 @@ msgid "" "(Contributed by Victor Stinner in :issue:`39946`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1455 +#: ../../whatsnew/3.9.rst:1454 msgid "" "Removed the following functions from the C API. Call :c:func:`PyGC_Collect` " "explicitly to clear all free lists. (Contributed by Inada Naoki and Victor " "Stinner in :issue:`37340`, :issue:`38896` and :issue:`40428`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1460 +#: ../../whatsnew/3.9.rst:1459 msgid "``PyAsyncGen_ClearFreeLists()``" msgstr "``PyAsyncGen_ClearFreeLists()``" -#: ../../whatsnew/3.9.rst:1461 +#: ../../whatsnew/3.9.rst:1460 msgid "``PyContext_ClearFreeList()``" msgstr "``PyContext_ClearFreeList()``" -#: ../../whatsnew/3.9.rst:1462 +#: ../../whatsnew/3.9.rst:1461 msgid "``PyDict_ClearFreeList()``" msgstr "``PyDict_ClearFreeList()``" -#: ../../whatsnew/3.9.rst:1463 +#: ../../whatsnew/3.9.rst:1462 msgid "``PyFloat_ClearFreeList()``" msgstr "``PyFloat_ClearFreeList()``" -#: ../../whatsnew/3.9.rst:1464 +#: ../../whatsnew/3.9.rst:1463 msgid "``PyFrame_ClearFreeList()``" msgstr "``PyFrame_ClearFreeList()``" -#: ../../whatsnew/3.9.rst:1465 +#: ../../whatsnew/3.9.rst:1464 msgid "``PyList_ClearFreeList()``" msgstr "``PyList_ClearFreeList()``" -#: ../../whatsnew/3.9.rst:1466 +#: ../../whatsnew/3.9.rst:1465 msgid "" "``PyMethod_ClearFreeList()`` and ``PyCFunction_ClearFreeList()``: the free " "lists of bound method objects have been removed." msgstr "" -#: ../../whatsnew/3.9.rst:1468 +#: ../../whatsnew/3.9.rst:1467 msgid "" "``PySet_ClearFreeList()``: the set free list has been removed in Python 3.4." msgstr "" -#: ../../whatsnew/3.9.rst:1470 +#: ../../whatsnew/3.9.rst:1469 msgid "``PyTuple_ClearFreeList()``" msgstr "``PyTuple_ClearFreeList()``" -#: ../../whatsnew/3.9.rst:1471 +#: ../../whatsnew/3.9.rst:1470 msgid "" "``PyUnicode_ClearFreeList()``: the Unicode free list has been removed in " "Python 3.3." msgstr "" -#: ../../whatsnew/3.9.rst:1474 +#: ../../whatsnew/3.9.rst:1473 msgid "" "Removed ``_PyUnicode_ClearStaticStrings()`` function. (Contributed by Victor " "Stinner in :issue:`39465`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1477 +#: ../../whatsnew/3.9.rst:1476 msgid "" "Removed ``Py_UNICODE_MATCH``. It has been deprecated by :pep:`393`, and " "broken since Python 3.3. The :c:func:`PyUnicode_Tailmatch` function can be " "used instead. (Contributed by Inada Naoki in :issue:`36346`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1482 +#: ../../whatsnew/3.9.rst:1481 msgid "" "Cleaned header files of interfaces defined but with no implementation. The " "public API symbols being removed are: " @@ -2206,26 +2203,26 @@ msgid "" "`39372`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1493 +#: ../../whatsnew/3.9.rst:1492 msgid "Notable changes in Python 3.9.1" msgstr "" -#: ../../whatsnew/3.9.rst:1498 +#: ../../whatsnew/3.9.rst:1497 msgid "" "The behavior of :class:`typing.Literal` was changed to conform with :pep:" "`586` and to match the behavior of static type checkers specified in the PEP." msgstr "" -#: ../../whatsnew/3.9.rst:1501 +#: ../../whatsnew/3.9.rst:1500 msgid "``Literal`` now de-duplicates parameters." msgstr "" -#: ../../whatsnew/3.9.rst:1502 +#: ../../whatsnew/3.9.rst:1501 msgid "" "Equality comparisons between ``Literal`` objects are now order independent." msgstr "" -#: ../../whatsnew/3.9.rst:1503 +#: ../../whatsnew/3.9.rst:1502 msgid "" "``Literal`` comparisons now respect types. For example, ``Literal[0] == " "Literal[False]`` previously evaluated to ``True``. It is now ``False``. To " @@ -2233,7 +2230,7 @@ msgid "" "differentiating types." msgstr "" -#: ../../whatsnew/3.9.rst:1507 +#: ../../whatsnew/3.9.rst:1506 msgid "" "``Literal`` objects will now raise a :exc:`TypeError` exception during " "equality comparisons if any of their parameters are not :term:`hashable`. " @@ -2241,15 +2238,15 @@ msgid "" "error::" msgstr "" -#: ../../whatsnew/3.9.rst:1519 +#: ../../whatsnew/3.9.rst:1518 msgid "(Contributed by Yurii Karabas in :issue:`42345`.)" msgstr "(由 Yurii Karabas 在 :issue:`42345` 中貢獻。)" -#: ../../whatsnew/3.9.rst:1522 +#: ../../whatsnew/3.9.rst:1521 msgid "macOS 11.0 (Big Sur) and Apple Silicon Mac support" msgstr "" -#: ../../whatsnew/3.9.rst:1524 +#: ../../whatsnew/3.9.rst:1523 msgid "" "As of 3.9.1, Python now fully supports building and running on macOS 11.0 " "(Big Sur) and on Apple Silicon Macs (based on the ``ARM64`` architecture). A " @@ -2261,19 +2258,19 @@ msgid "" "version in use at runtime (\"weaklinking\")." msgstr "" -#: ../../whatsnew/3.9.rst:1533 +#: ../../whatsnew/3.9.rst:1532 msgid "(Contributed by Ronald Oussoren and Lawrence D'Anna in :issue:`41100`.)" msgstr "(由 Ronald Oussoren 和 Lawrence D'Anna 在 :issue:`41100` 中貢獻。)" -#: ../../whatsnew/3.9.rst:1536 +#: ../../whatsnew/3.9.rst:1535 msgid "Notable changes in Python 3.9.2" msgstr "" -#: ../../whatsnew/3.9.rst:1539 +#: ../../whatsnew/3.9.rst:1538 msgid "collections.abc" msgstr "collections.abc" -#: ../../whatsnew/3.9.rst:1541 +#: ../../whatsnew/3.9.rst:1540 msgid "" ":class:`collections.abc.Callable` generic now flattens type parameters, " "similar to what :data:`typing.Callable` currently does. This means that " @@ -2289,11 +2286,11 @@ msgid "" "Python 3.10. (Contributed by Ken Jin in :issue:`42195`.)" msgstr "" -#: ../../whatsnew/3.9.rst:1555 +#: ../../whatsnew/3.9.rst:1554 msgid "urllib.parse" msgstr "urllib.parse" -#: ../../whatsnew/3.9.rst:1557 +#: ../../whatsnew/3.9.rst:1556 msgid "" "Earlier Python versions allowed using both ``;`` and ``&`` as query " "parameter separators in :func:`urllib.parse.parse_qs` and :func:`urllib." @@ -2304,15 +2301,3 @@ msgid "" "For more details, please see their respective documentation. (Contributed by " "Adam Goldschmidt, Senthil Kumaran and Ken Jin in :issue:`42967`.)" msgstr "" - -#~ msgid "Release" -#~ msgstr "發行版本" - -#~ msgid "|release|" -#~ msgstr "|release|" - -#~ msgid "Date" -#~ msgstr "日期" - -#~ msgid "|today|" -#~ msgstr "|today|" From b4c1a8f108d07013488186464040943095c2c3d7 Mon Sep 17 00:00:00 2001 From: idkidkidkidkidkidkidkidk <57472359+idkidkidkidkidkidkidkidk@users.noreply.github.com> Date: Sun, 22 Oct 2023 11:09:07 +0800 Subject: [PATCH 03/39] Translate rst:375 --- library/string.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/string.po b/library/string.po index e90d211cfe..f9815e9c69 100644 --- a/library/string.po +++ b/library/string.po @@ -469,7 +469,7 @@ msgstr "``'+'``" msgid "" "indicates that a sign should be used for both positive as well as negative " "numbers." -msgstr "" +msgstr "表示正數與負數均需使用符號。" #: ../../library/string.rst:378 msgid "``'-'``" From cb329130366735d1400913019af4dcb6dc573157 Mon Sep 17 00:00:00 2001 From: robinsonweng Date: Sun, 22 Oct 2023 11:14:15 +0800 Subject: [PATCH 04/39] translate library/string.po:rst:54 --- library/string.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/string.po b/library/string.po index e90d211cfe..ceea9a4d06 100644 --- a/library/string.po +++ b/library/string.po @@ -71,7 +71,7 @@ msgstr "" #: ../../library/string.rst:54 msgid "The string ``'01234567'``." -msgstr "" +msgstr "字串 ``'01234567'``。" #: ../../library/string.rst:59 msgid "" From c51ce38f8f9bc18208ac8fb009949858a9db1df1 Mon Sep 17 00:00:00 2001 From: calvin0310 Date: Sun, 22 Oct 2023 11:20:00 +0800 Subject: [PATCH 05/39] Translate rst:381 --- library/string.po | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/library/string.po b/library/string.po index e90d211cfe..078c9caa14 100644 --- a/library/string.po +++ b/library/string.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" -"PO-Revision-Date: 2018-05-23 16:11+0000\n" +"PO-Revision-Date: 2023-10-22 11:04+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -17,6 +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.4\n" #: ../../library/string.rst:2 msgid ":mod:`string` --- Common string operations" @@ -489,7 +490,7 @@ msgstr "" msgid "" "indicates that a leading space should be used on positive numbers, and a " "minus sign on negative numbers." -msgstr "" +msgstr "表示正數應使用前導空格,負數應使用減號。" #: ../../library/string.rst:388 msgid "" From 4e9385a8be37fc2877a07cd4fe808ad5d8b4c713 Mon Sep 17 00:00:00 2001 From: HannahLo Date: Sun, 22 Oct 2023 12:10:36 +0800 Subject: [PATCH 06/39] Translate library/string.po rst:901 (#672) * translate rst:901 * word adjustment for template * fix translate of class --- library/string.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/string.po b/library/string.po index 1be9264fb9..1a590d5a97 100644 --- a/library/string.po +++ b/library/string.po @@ -1105,7 +1105,7 @@ msgstr "" msgid "" "The methods on this class will raise :exc:`ValueError` if the pattern " "matches the template without one of these named groups matching." -msgstr "" +msgstr "當格式符合樣板卻沒有符合這些命名組之一,此類別的方法將引發 :exc:`ValueError`。" #: ../../library/string.rst:906 msgid "Helper functions" From 1dff59bdc1c4f7c883358ac8c7b08703ccc3b3a2 Mon Sep 17 00:00:00 2001 From: swchen1282 Date: Sun, 22 Oct 2023 14:02:02 +0800 Subject: [PATCH 07/39] working on string (rst187) (#680) --- library/string.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/string.po b/library/string.po index 1a590d5a97..d2e52f1513 100644 --- a/library/string.po +++ b/library/string.po @@ -230,7 +230,7 @@ msgstr "" #: ../../library/string.rst:187 msgid "Format String Syntax" -msgstr "" +msgstr "格式化文字語法" #: ../../library/string.rst:189 msgid "" From 576b7ae1d6f7810de4839e8f11f78d7151d12b7f Mon Sep 17 00:00:00 2001 From: RitaLi117 <40754918+RitaLi117@users.noreply.github.com> Date: Sun, 22 Oct 2023 14:02:27 +0800 Subject: [PATCH 08/39] Translate rst:21 (#678) Co-authored-by: Tsai Ying Li Co-authored-by: Wei-Hsiang (Matt) Wang --- library/string.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/string.po b/library/string.po index d2e52f1513..c04cfb15fd 100644 --- a/library/string.po +++ b/library/string.po @@ -41,7 +41,7 @@ msgstr "" #: ../../library/string.rst:21 msgid "The constants defined in this module are:" -msgstr "" +msgstr "此模組中定義的常數為:" #: ../../library/string.rst:26 msgid "" From 36c3540ac020bfff6cc0297832681012041f728a Mon Sep 17 00:00:00 2001 From: Vina Chang Date: Sun, 22 Oct 2023 14:03:20 +0800 Subject: [PATCH 09/39] translate library/string.rst:478 & 481 (#675) * translate library/string.rst:478 & 481 * add space between chinese character and english character * Update library/string.po --------- Co-authored-by: Wei-Hsiang (Matt) Wang --- library/string.po | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/library/string.po b/library/string.po index c04cfb15fd..0b9e2cbfbb 100644 --- a/library/string.po +++ b/library/string.po @@ -648,7 +648,7 @@ msgstr "``'x'``" msgid "" "Hex format. Outputs the number in base 16, using lower-case letters for the " "digits above 9." -msgstr "" +msgstr "十六進位格式。輸出以 16 為基數的數字,9 以上的數字使用小寫字母。" #: ../../library/string.rst:481 msgid "``'X'``" @@ -660,6 +660,8 @@ msgid "" "digits above 9. In case ``'#'`` is specified, the prefix ``'0x'`` will be " "upper-cased to ``'0X'`` as well." msgstr "" +"十六進位格式。輸出以 16 為基數的數字,9 以上的數字使用大寫字母。如果指定了" +"``'#'``,則前綴 ``'0x'`` 也會被轉成大寫的 ``'0X'``。" #: ../../library/string.rst:486 ../../library/string.rst:570 msgid "``'n'``" From 49ed1684b6a9da7d6c473695ce124396f4697583 Mon Sep 17 00:00:00 2001 From: jason zheng <101104044@nccu.edu.tw> Date: Sun, 22 Oct 2023 14:05:24 +0800 Subject: [PATCH 10/39] Translate library/string rst:815 (#670) * Translate library/string rst:815 * Translate library/string rst:815 --------- Co-authored-by: Wei-Hsiang (Matt) Wang --- library/string.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/string.po b/library/string.po index 0b9e2cbfbb..58167517ec 100644 --- a/library/string.po +++ b/library/string.po @@ -1002,7 +1002,7 @@ msgstr "" #: ../../library/string.rst:815 msgid ":class:`Template` instances also provide one public data attribute:" -msgstr "" +msgstr ":class:`Template` 實例也提供一個公開的資料屬性:" #: ../../library/string.rst:819 msgid "" From a8db361d31df1591828c5018635348a016c5f2cd Mon Sep 17 00:00:00 2001 From: 0gien <147908325+0gien@users.noreply.github.com> Date: Sun, 22 Oct 2023 14:05:51 +0800 Subject: [PATCH 11/39] Working on String. (#679) Co-authored-by: Zoe Huang Co-authored-by: Wei-Hsiang (Matt) Wang --- library/string.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/string.po b/library/string.po index 58167517ec..2553de93b8 100644 --- a/library/string.po +++ b/library/string.po @@ -460,7 +460,7 @@ msgstr "" msgid "" "The *sign* option is only valid for number types, and can be one of the " "following:" -msgstr "" +msgstr "*sign* 選項只適用於數字型別,並可為以下之一:" #: ../../library/string.rst:375 msgid "``'+'``" From 9fc86cfa67f45d8c2eba7b1f131bcb2a7022d857 Mon Sep 17 00:00:00 2001 From: mar120434 <38751052+mar120434@users.noreply.github.com> Date: Sun, 22 Oct 2023 14:07:03 +0800 Subject: [PATCH 12/39] translate ./library/string.po rst:906 (#676) Co-authored-by: Josix --- library/string.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/string.po b/library/string.po index 2553de93b8..9b48a0bba4 100644 --- a/library/string.po +++ b/library/string.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" -"PO-Revision-Date: 2023-10-22 11:04+0800\n" +"PO-Revision-Date: 2023-10-22 11:42+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -1111,7 +1111,7 @@ msgstr "當格式符合樣板卻沒有符合這些命名組之一,此類別的 #: ../../library/string.rst:906 msgid "Helper functions" -msgstr "" +msgstr "輔助函式" #: ../../library/string.rst:910 msgid "" From ff93069f7f025f24fa52a437126fb66a76ca5349 Mon Sep 17 00:00:00 2001 From: Satty Date: Sun, 22 Oct 2023 14:07:33 +0800 Subject: [PATCH 13/39] Translate library/string.po rst:32 (#674) * [update] library/string.po rst:32 * update format * Update library/string.po Co-authored-by: Wei-Hsiang (Matt) Wang --------- Co-authored-by: Wei-Hsiang (Matt) Wang Co-authored-by: Josix --- library/string.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/string.po b/library/string.po index 9b48a0bba4..928ee822a2 100644 --- a/library/string.po +++ b/library/string.po @@ -54,7 +54,7 @@ msgstr "" msgid "" "The lowercase letters ``'abcdefghijklmnopqrstuvwxyz'``. This value is not " "locale-dependent and will not change." -msgstr "" +msgstr "小寫字母 ``'abcdefghijklmnopqrstuvwxyz'``。該值與地區設定無關且不會改變。" #: ../../library/string.rst:38 msgid "" From 1aa0d889d350c4d9c2111360e85122951ee83492 Mon Sep 17 00:00:00 2001 From: holisHsu <52438637+holisHsu@users.noreply.github.com> Date: Sun, 22 Oct 2023 14:08:58 +0800 Subject: [PATCH 14/39] Translate rst:296, 298 (#668) --- library/string.po | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/library/string.po b/library/string.po index 928ee822a2..edd09d174a 100644 --- a/library/string.po +++ b/library/string.po @@ -355,7 +355,7 @@ msgstr "範例請見 :ref:`formatexamples`\\ 。" #: ../../library/string.rst:296 msgid "Format Specification Mini-Language" -msgstr "" +msgstr "格式規格 (Format Specification) 迷你語言" #: ../../library/string.rst:298 msgid "" @@ -365,6 +365,10 @@ msgid "" "to the built-in :func:`format` function. Each formattable type may define " "how the format specification is to be interpreted." msgstr "" +"“格式規格” 在格式字串 (format string) 中包含的替換欄位中使用,以定義各個值如" +"何被呈現(請參考 :ref:`formatstrings` and :ref:`f-strings` )。它們也能夠直接" +"傳遞給內建的 :fun:`format` 函式。每個可格式化型別 (formattable type) 可以定義" +"格式規格如何被直譯。" #: ../../library/string.rst:305 msgid "" From 149fc0ba0cf0ffe52af3c0995ce3bccf86a0e018 Mon Sep 17 00:00:00 2001 From: "Wei-Hsiang (Matt) Wang" Date: Sun, 22 Oct 2023 14:17:41 +0800 Subject: [PATCH 15/39] fix(library/string): typo --- library/string.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/string.po b/library/string.po index edd09d174a..8855b9722e 100644 --- a/library/string.po +++ b/library/string.po @@ -367,7 +367,7 @@ msgid "" msgstr "" "“格式規格” 在格式字串 (format string) 中包含的替換欄位中使用,以定義各個值如" "何被呈現(請參考 :ref:`formatstrings` and :ref:`f-strings` )。它們也能夠直接" -"傳遞給內建的 :fun:`format` 函式。每個可格式化型別 (formattable type) 可以定義" +"傳遞給內建的 :func:`format` 函式。每個可格式化型別 (formattable type) 可以定義" "格式規格如何被直譯。" #: ../../library/string.rst:305 From a4719a1e1605163e886fad5c3783bdac250f0db9 Mon Sep 17 00:00:00 2001 From: Song-Lin Tsai <55531306+Bradley-Tsai@users.noreply.github.com> Date: Sun, 22 Oct 2023 20:57:23 +0800 Subject: [PATCH 16/39] Translate library/string.po rst, 2, 19, 26 (#677) * translate: rst: 2, 19, 26 * fix: change some terms * fix: change the translation of constant * Apply suggestions from code review --------- Co-authored-by: Wei-Hsiang (Matt) Wang --- library/string.po | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/library/string.po b/library/string.po index 8855b9722e..4f144dbb77 100644 --- a/library/string.po +++ b/library/string.po @@ -21,7 +21,7 @@ msgstr "" #: ../../library/string.rst:2 msgid ":mod:`string` --- Common string operations" -msgstr "" +msgstr ":mod:`string` --- 常見的字串操作" #: ../../library/string.rst:7 msgid "**Source code:** :source:`Lib/string.py`" @@ -37,7 +37,7 @@ msgstr ":ref:`string-methods`" #: ../../library/string.rst:19 msgid "String constants" -msgstr "" +msgstr "字串常數" #: ../../library/string.rst:21 msgid "The constants defined in this module are:" @@ -49,6 +49,7 @@ msgid "" "`ascii_uppercase` constants described below. This value is not locale-" "dependent." msgstr "" +"下文描述的 :const:`ascii_lowercase` 和 :const:`ascii_uppercase` 常數的串接,該值不依賴於區域設定。" #: ../../library/string.rst:32 msgid "" From f24fd11929f41176367f42559c62b808e7468b2d Mon Sep 17 00:00:00 2001 From: Sylvia <137799667+sylviachangtw@users.noreply.github.com> Date: Fri, 27 Oct 2023 12:56:24 +0800 Subject: [PATCH 17/39] translate rst:373 (#688) --- library/string.po | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/library/string.po b/library/string.po index 4f144dbb77..879d07e95a 100644 --- a/library/string.po +++ b/library/string.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" -"PO-Revision-Date: 2023-10-22 11:42+0800\n" +"PO-Revision-Date: 2023-10-22 20:52+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -55,7 +55,8 @@ msgstr "" msgid "" "The lowercase letters ``'abcdefghijklmnopqrstuvwxyz'``. This value is not " "locale-dependent and will not change." -msgstr "小寫字母 ``'abcdefghijklmnopqrstuvwxyz'``。該值與地區設定無關且不會改變。" +msgstr "" +"小寫字母 ``'abcdefghijklmnopqrstuvwxyz'``。該值與地區設定無關且不會改變。" #: ../../library/string.rst:38 msgid "" @@ -368,8 +369,8 @@ msgid "" msgstr "" "“格式規格” 在格式字串 (format string) 中包含的替換欄位中使用,以定義各個值如" "何被呈現(請參考 :ref:`formatstrings` and :ref:`f-strings` )。它們也能夠直接" -"傳遞給內建的 :func:`format` 函式。每個可格式化型別 (formattable type) 可以定義" -"格式規格如何被直譯。" +"傳遞給內建的 :func:`format` 函式。每個可格式化型別 (formattable type) 可以定" +"義格式規格如何被直譯。" #: ../../library/string.rst:305 msgid "" @@ -406,7 +407,7 @@ msgstr "" #: ../../library/string.rst:342 ../../library/string.rst:373 msgid "Option" -msgstr "" +msgstr "選項" #: ../../library/string.rst:342 ../../library/string.rst:373 #: ../../library/string.rst:456 ../../library/string.rst:467 @@ -1112,7 +1113,9 @@ msgstr "" msgid "" "The methods on this class will raise :exc:`ValueError` if the pattern " "matches the template without one of these named groups matching." -msgstr "當格式符合樣板卻沒有符合這些命名組之一,此類別的方法將引發 :exc:`ValueError`。" +msgstr "" +"當格式符合樣板卻沒有符合這些命名組之一,此類別的方法將引發 :exc:" +"`ValueError`。" #: ../../library/string.rst:906 msgid "Helper functions" From 2b560a6a05f93093fb54268418c2ad27f39f2931 Mon Sep 17 00:00:00 2001 From: Becca <61359625+Tzu-Han5667@users.noreply.github.com> Date: Fri, 27 Oct 2023 12:57:28 +0800 Subject: [PATCH 18/39] Translate library/string.po rst:117 (#687) * 1022_meetup_library/string_rst117 * rst:117 v2 * rst:117 v3 --- library/string.po | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/library/string.po b/library/string.po index 879d07e95a..2b92fee6ae 100644 --- a/library/string.po +++ b/library/string.po @@ -150,6 +150,10 @@ msgid "" "by :meth:`vformat` to break the string into either literal text, or " "replacement fields." msgstr "" +"將 format_string 放入迴圈,並回傳一個可疊代物件,其元素為 " +"(*literal_text*, *field_name*, *format_spec*, *conversion*)。這會被" +" :meth:`vformat` 用於將字串裁切為字面文本或" +"替換欄位。" #: ../../library/string.rst:122 msgid "" From 7355970edb3bc44a3df37bbbdbec1e19d15c8a2c Mon Sep 17 00:00:00 2001 From: robinsonweng Date: Fri, 27 Oct 2023 13:58:37 +0900 Subject: [PATCH 19/39] Translate /libary/asyncio-runner.po from rst:6 to rst:13 (#685) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Translate /libary/asyncio-runner from rst:6 to rst:13, #683 * fix: Add the missing word '場景' * fix: Change Simplfiy Chinese word to Traditional Chinese & escape space for rst syntax in rst:13 * fix: Update translation for 'primitives' * fix: Note source 'Runners' * fix: Patch missing text --- library/asyncio-runner.po | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/library/asyncio-runner.po b/library/asyncio-runner.po index 682cea2052..3cb6c222b4 100644 --- a/library/asyncio-runner.po +++ b/library/asyncio-runner.po @@ -19,7 +19,7 @@ msgstr "" #: ../../library/asyncio-runner.rst:6 msgid "Runners" -msgstr "" +msgstr "Runners (執行器)" #: ../../library/asyncio-runner.rst:8 msgid "**Source code:** :source:`Lib/asyncio/runners.py`" @@ -29,12 +29,14 @@ msgstr "**原始碼:**\\ :source:`Lib/asyncio/runners.py`" msgid "" "This section outlines high-level asyncio primitives to run asyncio code." msgstr "" +"這個章節概述用於執行 asyncio 程式碼的高階 asyncio 原始物件。" #: ../../library/asyncio-runner.rst:13 msgid "" "They are built on top of an :ref:`event loop ` with the " "aim to simplify async code usage for common wide-spread scenarios." msgstr "" +"他們是基於一個\\ :ref:`事件迴圈 `,目的是為了簡化常見且廣泛運用場景的非同步程式碼。" #: ../../library/asyncio-runner.rst:23 msgid "Running an asyncio Program" From eaccd60ee755daee77d4fe24707c1a2ec6059bfb Mon Sep 17 00:00:00 2001 From: HannahLo Date: Fri, 27 Oct 2023 15:42:25 +0800 Subject: [PATCH 20/39] Translate library/string.po rst:736, rst:738 (#684) * Translate rst:736, rst:738 * Add space between zh and en --------- Co-authored-by: hannahlo --- library/string.po | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/library/string.po b/library/string.po index 2b92fee6ae..89796f864a 100644 --- a/library/string.po +++ b/library/string.po @@ -915,7 +915,7 @@ msgstr "" #: ../../library/string.rst:736 msgid "Template strings" -msgstr "" +msgstr "樣板字串" #: ../../library/string.rst:738 msgid "" @@ -926,6 +926,12 @@ msgid "" "Python. As an example of a library built on template strings for i18n, see " "the `flufl.i18n `_ package." msgstr "" +"樣板字串提供如 :pep:`292` 所述更簡單的字串替換。" +"樣板字串的主要用例是國際化 (i18n)," +"因為在這種情況下,更簡單的語法和功能使得它" +"比其他 Python 內建字串格式化工具更容易翻譯。" +"基於樣板字串建構的 i18n 函式庫範例,請參閱 " +"`flufl.i18n `_ 套件。" #: ../../library/string.rst:748 msgid "" From 9264e885bab6a90f7065401b491cdf8e95d07012 Mon Sep 17 00:00:00 2001 From: Payon Date: Sun, 5 Nov 2023 17:49:13 +0800 Subject: [PATCH 21/39] Translate library/unittest.mock.po from rst:384 to 817 (#662) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs: mock 翻譯 from rst:384 to 492 * docs: mock 翻譯 from rst:498 to 646 * Update library/unittest.mock.po * Update library/unittest.mock.po * docs: mock 翻譯 from rst:652 to 817 * fix: 修正member翻譯為成員 * Update library/unittest.mock.po Co-authored-by: RockLeon <34214497+rockleona@users.noreply.github.com> * Update library/unittest.mock.po Co-authored-by: Wei-Hsiang (Matt) Wang --------- Co-authored-by: RockLeon <34214497+rockleona@users.noreply.github.com> Co-authored-by: Wei-Hsiang (Matt) Wang --- library/unittest.mock.po | 129 +++++++++++++++++++++++++++++++-------- 1 file changed, 103 insertions(+), 26 deletions(-) diff --git a/library/unittest.mock.po b/library/unittest.mock.po index 8067ed10cc..17cf967b7f 100644 --- a/library/unittest.mock.po +++ b/library/unittest.mock.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-22 00:04+0000\n" -"PO-Revision-Date: 2023-09-09 23:07+0800\n" +"PO-Revision-Date: 2023-10-10 21:59+0800\n" "Last-Translator: Adrian Liaw \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.3.2\n" +"X-Generator: Poedit 3.4\n" #: ../../library/unittest.mock.rst:3 msgid ":mod:`unittest.mock` --- mock object library" @@ -253,16 +253,16 @@ msgid "" "class of :class:`Mock` using the *new_callable* argument to :func:`patch`." msgstr "" ":func:`patch` 裝飾器可以輕鬆地用 :class:`Mock` 物件臨時替換特定模組中的類別。" -"預設情況下,:func:`patch` 會為你建立一個 :class:`MagicMock`。你可以使" -"用 :func:`patch` 的 *new_callable* 引數指定 :class:`Mock` 的替代類別。" +"預設情況下,:func:`patch` 會為你建立一個 :class:`MagicMock`。你可以使用 :" +"func:`patch` 的 *new_callable* 引數指定 :class:`Mock` 的替代類別。" #: ../../library/unittest.mock.rst:231 msgid "" "Create a new :class:`Mock` object. :class:`Mock` takes several optional " "arguments that specify the behaviour of the Mock object:" msgstr "" -"建立一個新的 :class:`Mock` 物件。:class:`Mock` 接受數個可選的引數來指定 " -"Mock 物件的行為:" +"建立一個新的 :class:`Mock` 物件。:class:`Mock` 接受數個可選的引數來指定 Mock " +"物件的行為:" #: ../../library/unittest.mock.rst:234 msgid "" @@ -428,8 +428,8 @@ msgid "" "assert the mock has been called with the specified calls. The :attr:" "`mock_calls` list is checked for the calls." msgstr "" -"斷言 mock 已經使用指定的呼叫方式來呼叫。此斷言會檢查 :attr:`mock_calls` 串列中的" -"呼叫。" +"斷言 mock 已經使用指定的呼叫方式來呼叫。此斷言會檢查 :attr:`mock_calls` 串列" +"中的呼叫。" #: ../../library/unittest.mock.rst:365 msgid "" @@ -449,15 +449,15 @@ msgstr "" #: ../../library/unittest.mock.rst:384 msgid "Assert the mock was never called." -msgstr "" +msgstr "斷言 mock 從未被呼叫。" #: ../../library/unittest.mock.rst:399 msgid "The reset_mock method resets all the call attributes on a mock object:" -msgstr "" +msgstr "reset_mock 方法重置 mock 物件上的所有呼叫屬性:" #: ../../library/unittest.mock.rst:409 msgid "Added two keyword-only arguments to the reset_mock function." -msgstr "" +msgstr "reset_mock 函式新增了兩個僅限關鍵字引數 (keyword-only arguments)。" #: ../../library/unittest.mock.rst:412 msgid "" @@ -468,20 +468,26 @@ msgid "" "`side_effect`, then pass the corresponding parameter as ``True``. Child " "mocks and the return value mock (if any) are reset as well." msgstr "" +"這在你想要進行一系列重複使用同一物件的斷言時非常有用。請注意,預設情況下,:" +"meth:`reset_mock` *不會*\\ 清除回傳值、:attr:`side_effect` 或使用普通賦值設定的" +"任何子屬性。如果你想要重置 *return_value* 或 :attr:`side_effect`,則將相應的" +"參數設置為 ``True``。Child mock 和回傳值 mock(如果有的話)也會被重置。" #: ../../library/unittest.mock.rst:420 msgid "*return_value*, and :attr:`side_effect` are keyword-only arguments." -msgstr "" +msgstr "*return_value* 和 :attr:`side_effect` 是僅限關鍵字引數。" #: ../../library/unittest.mock.rst:426 msgid "" "Add a spec to a mock. *spec* can either be an object or a list of strings. " "Only attributes on the *spec* can be fetched as attributes from the mock." msgstr "" +"向 mock 增加一個規格 (spec)。*spec* 可以是一個物件或一個字串串列 (list of " +"strings)。只有在 *spec* 上的屬性才能作為 mock 的屬性被取得。" #: ../../library/unittest.mock.rst:430 msgid "If *spec_set* is true then only attributes on the spec can be set." -msgstr "" +msgstr "如果 *spec_set* 為 true,那麼只能設定在規格中的屬性。" #: ../../library/unittest.mock.rst:435 msgid "" @@ -489,26 +495,32 @@ msgid "" "Calls to the attached mock will be recorded in the :attr:`method_calls` and :" "attr:`mock_calls` attributes of this one." msgstr "" +"將一個 mock 作為這個 Mock 的屬性附加,取代它的名稱和上代 (parent)。對附加的 " +"mock 的呼叫將被記錄在這個 Mock 的 :attr:`method_calls` 和 :attr:`mock_calls` " +"屬性中。" #: ../../library/unittest.mock.rst:442 msgid "Set attributes on the mock through keyword arguments." -msgstr "" +msgstr "透過關鍵字引數在 mock 上設定屬性。" #: ../../library/unittest.mock.rst:444 msgid "" "Attributes plus return values and side effects can be set on child mocks " "using standard dot notation and unpacking a dictionary in the method call:" msgstr "" +"可以在使用 method(方法)呼叫時,使用標準點記法 (dot notation) 並將字典拆開," +"為 child mock 設定屬性、回傳值和 side effects:" #: ../../library/unittest.mock.rst:458 msgid "The same thing can be achieved in the constructor call to mocks:" -msgstr "" +msgstr "同樣的事情可以在 mock 的建構函式呼叫中實現:" #: ../../library/unittest.mock.rst:471 msgid "" ":meth:`configure_mock` exists to make it easier to do configuration after " "the mock has been created." msgstr "" +":meth:`configure_mock` 的存在是為了在 mock 被建立後更容易進行組態設定。" #: ../../library/unittest.mock.rst:477 msgid "" @@ -516,12 +528,14 @@ msgid "" "results. For mocks with a *spec* this includes all the permitted attributes " "for the mock." msgstr "" +":class:`Mock` 物件限制了 ``dir(some_mock)`` 僅顯示有用的結果。對於具有 " +"*spec* 的 mock,這包含所有被允許的 mock 屬性。" #: ../../library/unittest.mock.rst:481 msgid "" "See :data:`FILTER_DIR` for what this filtering does, and how to switch it " "off." -msgstr "" +msgstr "請參閱 :data:`FILTER_DIR` 以了解這種過濾行為的作用,以及如何關閉它。" #: ../../library/unittest.mock.rst:487 msgid "" @@ -529,40 +543,44 @@ msgid "" "mocks will be the same type as the parent. Subclasses of Mock may want to " "override this to customize the way child mocks are made." msgstr "" +"建立為了得到屬性和回傳值的 child mock。預設情況下,child mock 將與其上代是相" +"同的型別。Mock 的子類別可能會想要置換此行為,以自定義 child mock 的建立方式。" #: ../../library/unittest.mock.rst:492 msgid "" "For non-callable mocks the callable variant will be used (rather than any " "custom subclass)." -msgstr "" +msgstr "對於不可呼叫的 mock,將使用可呼叫的變體,而不是任何的自定義子類別。" #: ../../library/unittest.mock.rst:498 msgid "A boolean representing whether or not the mock object has been called:" -msgstr "" +msgstr "一個 boolean(布林),表述 mock 物件是否已經被呼叫:" #: ../../library/unittest.mock.rst:509 msgid "An integer telling you how many times the mock object has been called:" -msgstr "" +msgstr "一個整數,告訴你 mock 物件被呼叫的次數:" #: ../../library/unittest.mock.rst:521 msgid "Set this to configure the value returned by calling the mock:" -msgstr "" +msgstr "設定此值以配置呼叫 mock 時回傳的值:" #: ../../library/unittest.mock.rst:528 msgid "" "The default return value is a mock object and you can configure it in the " "normal way:" -msgstr "" +msgstr "預設的回傳值是一個 mock 物件,你也可以按照正常的方式配置它:" #: ../../library/unittest.mock.rst:537 msgid ":attr:`return_value` can also be set in the constructor:" -msgstr "" +msgstr ":attr:`return_value` 也可以在建構函式中設定:" #: ../../library/unittest.mock.rst:548 msgid "" "This can either be a function to be called when the mock is called, an " "iterable or an exception (class or instance) to be raised." msgstr "" +"這可以是一個在呼叫 mock 時要呼叫的函式、一個可疊代物件,或者要引發的例外(類" +"別或實例)。" #: ../../library/unittest.mock.rst:551 msgid "" @@ -572,6 +590,10 @@ msgid "" "returns :data:`DEFAULT` then the mock will return its normal value (from " "the :attr:`return_value`)." msgstr "" +"如果你傳遞一個函式,它將被呼叫,其引數與 mock 相同,且除非該函式回傳 :data:" +"`DEFAULT` 單例 (singleton),否則對 mock 的呼叫將回傳函式回傳的任何值。如果函" +"式回傳 :data:`DEFAULT`,那麼 mock 將回傳其正常的回傳值(從 :attr:" +"`return_value` 得到)。" #: ../../library/unittest.mock.rst:557 msgid "" @@ -580,30 +602,35 @@ msgid "" "to be raised, or a value to be returned from the call to the mock (:data:" "`DEFAULT` handling is identical to the function case)." msgstr "" +"如果你傳遞一個可疊代物件,它將被用於檢索一個疊代器,該疊代器必須在每次呼叫時" +"產出 (yield) 一個值。這個值可以是要引發的例外實例,或者是對 mock 呼叫時要回傳" +"的值(處理 :data:`DEFAULT` 的方式與函式的狀況相同)。" #: ../../library/unittest.mock.rst:562 msgid "" "An example of a mock that raises an exception (to test exception handling of " "an API):" -msgstr "" +msgstr "以下是一個引發例外的 mock 的範例(用於測試 API 的例外處理):" #: ../../library/unittest.mock.rst:572 msgid "Using :attr:`side_effect` to return a sequence of values:" -msgstr "" +msgstr "使用 :attr:`side_effect` 回傳一連串值的範例:" #: ../../library/unittest.mock.rst:579 msgid "Using a callable:" -msgstr "" +msgstr "使用可被呼叫物件的範例:" #: ../../library/unittest.mock.rst:589 msgid "" ":attr:`side_effect` can be set in the constructor. Here's an example that " "adds one to the value the mock is called with and returns it:" msgstr "" +":attr:`side_effect` 可以在建構函式中設定。以下是一個範例,它將 mock 被呼叫時" +"給的值加一並回傳:" #: ../../library/unittest.mock.rst:599 msgid "Setting :attr:`side_effect` to ``None`` clears it:" -msgstr "" +msgstr "將 :attr:`side_effect` 設定為 ``None`` 可以清除它:" #: ../../library/unittest.mock.rst:613 msgid "" @@ -614,6 +641,10 @@ msgid "" "second member, which can also be accessed through the ``kwargs`` property, " "is any keyword arguments (or an empty dictionary)." msgstr "" +"這會是 ``None``(如果 mock 尚未被呼叫),或是 mock 上次被呼叫時使用的引數。這" +"將以元組的形式呈現:第一個成員 (member),其可以通過 ``args`` 屬性訪問,是 " +"mock 被呼叫時傳遞的所有有序引數(或一個空元組)。第二個成員,其可以通過 " +"``kwargs`` 屬性訪問,是所有關鍵字引數(或一個空字典)。" #: ../../library/unittest.mock.rst:646 msgid "" @@ -622,6 +653,10 @@ msgid "" "are tuples, so they can be unpacked to get at the individual arguments and " "make more complex assertions. See :ref:`calls as tuples `." msgstr "" +":attr:`call_args`,以及串列 :attr:`call_args_list`、:attr:`method_calls` 和 :" +"attr:`mock_calls` 的成員都是 :data:`call` 物件。這些都是元組,因此可以解包以" +"獲取各個引數並進行更複雜的斷言。參見 :ref:`calls as tuples `。" #: ../../library/unittest.mock.rst:652 msgid "Added ``args`` and ``kwargs`` properties." @@ -635,6 +670,9 @@ msgid "" "used for conveniently constructing lists of calls to compare with :attr:" "`call_args_list`." msgstr "" +"這是按順序列出所有呼叫 mock 物件的串列(因此串列的長度表示它被呼叫的次數)。" +"在任何呼叫發生之前,它會是一個空的串列。 :data:`call` 物件可用於方便地建構呼" +"叫的串列,以便與 :attr:`call_args_list` 進行比較。" #: ../../library/unittest.mock.rst:674 msgid "" @@ -642,12 +680,16 @@ msgid "" "unpacked as tuples to get at the individual arguments. See :ref:`calls as " "tuples `." msgstr "" +":attr:`call_args_list` 的成員都是 :data:`call` 物件。這些物件可以被拆包為元" +"組,以取得各個引數。參見 :ref:`calls as tuples `。" #: ../../library/unittest.mock.rst:681 msgid "" "As well as tracking calls to themselves, mocks also track calls to methods " "and attributes, and *their* methods and attributes:" msgstr "" +"除了追蹤對自身的呼叫之外,mock 還會追蹤對方法和屬性的呼降,以及*它們(這些方" +"法和屬性)*的方法和屬性:" #: ../../library/unittest.mock.rst:692 msgid "" @@ -655,12 +697,16 @@ msgid "" "unpacked as tuples to get at the individual arguments. See :ref:`calls as " "tuples `." msgstr "" +":attr:`method_calls` 的成員都是 :data:`call` 物件。這些物件可以拆包為元組,以" +"取得各個引數。參見 :ref:`calls as tuples `。" #: ../../library/unittest.mock.rst:699 msgid "" ":attr:`mock_calls` records *all* calls to the mock object, its methods, " "magic methods *and* return value mocks." msgstr "" +":attr:`mock_calls` 記錄了 *所有* 對 mock 物件的呼叫,包含其方法、魔術方法以及" +"回傳值 mock。" #: ../../library/unittest.mock.rst:717 msgid "" @@ -668,6 +714,8 @@ msgid "" "unpacked as tuples to get at the individual arguments. See :ref:`calls as " "tuples `." msgstr "" +":attr:`method_calls` 的成員都是 :data:`call` 物件。這些物件可以拆包為元組,以" +"取得各個引數。參見 :ref:`calls as tuples `。" #: ../../library/unittest.mock.rst:723 msgid "" @@ -675,6 +723,8 @@ msgid "" "made, the parameters of ancestor calls are not recorded and so will always " "compare equal:" msgstr "" +":attr:`mock_calls` 記錄的方式意味著在進行嵌套呼叫時,上代 (ancestor) 呼叫的參" +"數不會被記錄,因此在比較時它們將始終相等:" #: ../../library/unittest.mock.rst:737 msgid "" @@ -683,12 +733,17 @@ msgid "" "instead. This allows mock objects to pass :func:`isinstance` tests for the " "object they are replacing / masquerading as:" msgstr "" +"通常,物件的 :attr:`__class__` 屬性會回傳它的型別。但對於擁有 :attr:`spec` " +"的 mock 物件,``__class__`` 會回傳 spec 的類別。這允許 mock 物件通過對它們所" +"替代或偽裝的物件進行的 :func:`isinstance` 測試:" #: ../../library/unittest.mock.rst:746 msgid "" ":attr:`__class__` is assignable to, this allows a mock to pass an :func:" "`isinstance` check without forcing you to use a spec:" msgstr "" +":attr:`__class__` 可以被指定,這允許 mock 通過 :func:`isinstance` 檢查,而不" +"需要強制使用 spec:" #: ../../library/unittest.mock.rst:756 msgid "" @@ -696,18 +751,24 @@ msgid "" "same meaning of :class:`Mock`, with the exception of *return_value* and " "*side_effect* which have no meaning on a non-callable mock." msgstr "" +":class:`Mock` 的一個不可呼叫版本。建構函式參數的意義與 :class:`Mock` 相同,其" +"例外為 *return_value* 和 *side_effect* 在不可呼叫的 mock 上無意義。" #: ../../library/unittest.mock.rst:760 msgid "" "Mock objects that use a class or an instance as a :attr:`spec` or :attr:" "`spec_set` are able to pass :func:`isinstance` tests:" msgstr "" +"使用類別或實例作為 :attr:`spec` 或 :attr:`spec_set` 的 mock 物件能夠通過 :" +"func:`isinstance` 測試:" #: ../../library/unittest.mock.rst:770 msgid "" "The :class:`Mock` classes have support for mocking magic methods. See :ref:" "`magic methods ` for the full details." msgstr "" +":class:`Mock` 類別支援 mock 魔術方法。細節請參考\\ :ref:`魔術方法 `。" #: ../../library/unittest.mock.rst:773 msgid "" @@ -716,6 +777,9 @@ msgid "" "are passed to the constructor of the mock being created. The keyword " "arguments are for configuring attributes of the mock:" msgstr "" +"Mock類別和 :func:`patch` 裝飾器於組態時接受任意的關鍵字引數。對於 :func:" +"`patch` 裝飾器,這些關鍵字會傳遞給正在建立 mock 的建構函式。這些關鍵字引數用" +"於配置 mock 的屬性:" #: ../../library/unittest.mock.rst:784 msgid "" @@ -723,6 +787,8 @@ msgid "" "using dotted notation. As you can't use dotted names directly in a call you " "have to create a dictionary and unpack it using ``**``:" msgstr "" +"Child mock 的回傳值和 side effect 可以使用使用點記法進行設置。由於你無法直接" +"在呼叫中使用帶有點 (.) 的名稱,因此你必須建立一個字典並使用 ``**`` 解包:" #: ../../library/unittest.mock.rst:799 msgid "" @@ -731,6 +797,11 @@ msgid "" "mock. Therefore, it can match the actual call's arguments regardless of " "whether they were passed positionally or by name::" msgstr "" +"在匹配對 mock 的呼叫時,使用 *spec*(或 *spec_set*)建立的可呼叫 mock 將會內" +"省規格物件的簽名 (signature)。因此,它可以匹配實際呼叫的引數,無論它們是按位" +"置傳遞還是按名稱傳遞:\n" +"\n" +"::" #: ../../library/unittest.mock.rst:812 msgid "" @@ -739,10 +810,16 @@ msgid "" "assert_any_call`. When :ref:`auto-speccing`, it will also apply to method " "calls on the mock object." msgstr "" +"這適用於 :meth:`~Mock.assert_called_with`、:meth:`~Mock." +"assert_called_once_with`、:meth:`~Mock.assert_has_calls` 和 :meth:`~Mock." +"assert_any_call`。在使用 :ref:`auto-speccing` ,它還適用於 mock 物件的方法呼" +"叫。" #: ../../library/unittest.mock.rst:817 msgid "Added signature introspection on specced and autospecced mock objects." msgstr "" +"對於已經設置了規格(spec)和自動規格(autospec)的 mock 物件,新增簽名內省功" +"能。" #: ../../library/unittest.mock.rst:823 msgid "" From 3fa37c2f995768c283582dcb7369ccd896642943 Mon Sep 17 00:00:00 2001 From: mindihx Date: Sun, 5 Nov 2023 18:00:36 +0800 Subject: [PATCH 22/39] Translate library/enum part 2/2 (#652) --- library/enum.po | 181 ++++++++++++++++++++++++++++++++++-------------- 1 file changed, 130 insertions(+), 51 deletions(-) diff --git a/library/enum.po b/library/enum.po index 74ea042065..b6f514ad6a 100644 --- a/library/enum.po +++ b/library/enum.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-08-23 00:03+0000\n" -"PO-Revision-Date: 2023-09-04 13:48+0800\n" +"PO-Revision-Date: 2023-09-11 14:08+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -412,7 +412,7 @@ msgstr "boundary" #: ../../library/enum.rst:192 msgid "" "How to handle out-of-range values from bit operations (:class:`Flag` only)." -msgstr "在位元操作時怎麼處理不在範圍內的值(只有 :class:`Flag` 會用到)" +msgstr "在位元操作時怎麼處理範圍外的值(只有 :class:`Flag` 會用到)" #: ../../library/enum.rst:196 msgid "Returns ``True`` if member belongs to the ``cls``::" @@ -481,7 +481,7 @@ msgid "" "appropriate value will be chosen for you. See :class:`auto` for the details." msgstr "" "成員的值可以是任何值::class:`int`、:class:`str` 等等。如果實際使用什麼值並不" -"重要,你可以使用 :class:`auto` 實例,它會為你選擇適合的值。更多細節請參考 :" +"重要,你可以使用 :class:`auto` 實例,它會為你選擇合適的值。更多細節請參考 :" "class:`auto`。" #: ../../library/enum.rst:276 @@ -560,24 +560,30 @@ msgid "" "Returns the string used for *repr()* calls. By default, returns the *Enum* " "name, member name, and value, but can be overridden::" msgstr "" +"回傳呼叫 *repr()* 時使用的字串。預設回傳 *Enum* 名稱、成員名稱及值,但可以被" +"覆寫: ::" #: ../../library/enum.rst:370 msgid "" "Returns the string used for *str()* calls. By default, returns the *Enum* " "name and member name, but can be overridden::" msgstr "" +"回傳呼叫 *str()* 時使用的字串。預設回傳 *Enum* 名稱及成員名稱,但可以被覆" +"寫: ::" #: ../../library/enum.rst:385 msgid "" "Returns the string used for *format()* and *f-string* calls. By default, " "returns :meth:`__str__` return value, but can be overridden::" msgstr "" +"回傳呼叫 *format()* 及 *f-string* 時使用的字串。預設回傳 :meth:`__str__` 的回" +"傳值,但可以被覆寫: ::" #: ../../library/enum.rst:400 msgid "" "Using :class:`auto` with :class:`Enum` results in integers of increasing " "value, starting with ``1``." -msgstr "" +msgstr ":class:`Enum` 使用 :class:`auto` 會產生從 ``1`` 開始遞增的整數。" #: ../../library/enum.rst:403 msgid "Added :ref:`enum-dataclass-support`" @@ -590,12 +596,14 @@ msgid "" "performed with an *IntEnum* member, the resulting value loses its " "enumeration status." msgstr "" +"*IntEnum* 和 *Enum* 一樣,但其成員同時也是整數而可以被用在任何使用整數的地" +"方。如果 *IntEnum* 成員經過任何整數運算,其結果會失去列舉狀態。" #: ../../library/enum.rst:429 msgid "" "Using :class:`auto` with :class:`IntEnum` results in integers of increasing " "value, starting with ``1``." -msgstr "" +msgstr ":class:`IntEnum` 使用 :class:`auto` 會產生從 ``1`` 開始遞增的整數。" #: ../../library/enum.rst:432 msgid "" @@ -603,6 +611,9 @@ msgid "" "*replacement of existing constants* use-case. :meth:`~object.__format__` was " "already :meth:`!int.__format__` for that same reason." msgstr "" +"為了更好地支援\\ *現存常數取代 (replacement of existing constants)* 的使用情" +"境,:meth:`~object.__str__` 現在會是 :meth:`!int.__str__`。為了同樣的理由,:" +"meth:`~object.__format__` 已經是 :meth:`!int.__format__`。" #: ../../library/enum.rst:439 msgid "" @@ -611,6 +622,8 @@ msgid "" "any string operation performed on or with a *StrEnum* member is not part of " "the enumeration." msgstr "" +"*StrEnum* 和 *Enum* 一樣,但其成員同時也是字串而可以被用在幾乎所有使用字串的" +"地方。*StrEnum* 成員經過任何字串操作的結果會不再是列舉的一部份。" #: ../../library/enum.rst:445 msgid "" @@ -619,12 +632,15 @@ msgid "" "``isinstance(unknown, str)``), and in those locations you will need to use " "``str(StrEnum.member)``." msgstr "" +"stdlib 裡有些地方會檢查只能是 :class:`str` 而不是 :class:`str` 的子類別(也就" +"是 ``type(unknown) == str`` 而不是 ``isinstance(unknown, str)``),在這些地方" +"你需要使用 ``str(StrEnum.member)``。" #: ../../library/enum.rst:452 msgid "" "Using :class:`auto` with :class:`StrEnum` results in the lower-cased member " "name as the value." -msgstr "" +msgstr ":class:`StrEnum` 使用 :class:`auto` 會產生小寫的成員名稱當作值。" #: ../../library/enum.rst:457 msgid "" @@ -632,6 +648,9 @@ msgid "" "*replacement of existing constants* use-case. :meth:`~object.__format__` is " "likewise :meth:`!str.__format__` for that same reason." msgstr "" +"為了更好地支援\\ *現存常數取代 (replacement of existing constants)* 的使用情" +"境,:meth:`~object.__str__` 現在會是 :meth:`!str.__str__`。為了同樣的理由,:" +"meth:`~object.__format__` 也會是 :meth:`!str.__format__`。" #: ../../library/enum.rst:465 msgid "" @@ -639,94 +658,101 @@ msgid "" "``^`` (*XOR*), and ``~`` (*INVERT*); the results of those operators are " "members of the enumeration." msgstr "" +"*Flag* 成員支援位元操作 ``&`` (*AND*)、``|`` (*OR*)、``^`` (*XOR*) 及 ``~`` " +"(*INVERT*);這些操作的結果會是列舉成員。" #: ../../library/enum.rst:471 msgid "Returns *True* if value is in self::" -msgstr "" +msgstr "如果 value 在 self 裡則回傳 *True*: ::" #: ../../library/enum.rst:492 msgid "Returns all contained non-alias members::" -msgstr "" +msgstr "回傳所有包含的非別名成員: ::" #: ../../library/enum.rst:501 msgid "Aliases are no longer returned during iteration." -msgstr "" +msgstr "疊代時不會再回傳別名。" #: ../../library/enum.rst:505 msgid "Returns number of members in flag::" -msgstr "" +msgstr "回傳旗標裡的成員數量: ::" #: ../../library/enum.rst:514 msgid "Returns *True* if any members in flag, *False* otherwise::" -msgstr "" +msgstr "如果成員在旗標裡則回傳 *True*,否則回傳 *False*: ::" #: ../../library/enum.rst:526 msgid "Returns current flag binary or'ed with other::" -msgstr "" +msgstr "回傳和 other 做 OR 過後的二進位旗標: ::" #: ../../library/enum.rst:533 msgid "Returns current flag binary and'ed with other::" -msgstr "" +msgstr "回傳和 other 做 AND 過後的二進位旗標: ::" #: ../../library/enum.rst:542 msgid "Returns current flag binary xor'ed with other::" -msgstr "" +msgstr "回傳和 other 做 XOR 過後的二進位旗標: ::" #: ../../library/enum.rst:551 msgid "Returns all the flags in *type(self)* that are not in self::" -msgstr "" +msgstr "回傳所有在 *type(self)* 但不在 self 裡的旗標: ::" #: ../../library/enum.rst:562 msgid "" "Function used to format any remaining unnamed numeric values. Default is " "the value's repr; common choices are :func:`hex` and :func:`oct`." msgstr "" +"用來格式化任何剩下未命名數值的函式。預設是值的 repr,常見選擇是 :func:`hex` " +"和 :func:`oct`。" #: ../../library/enum.rst:567 msgid "" "Using :class:`auto` with :class:`Flag` results in integers that are powers " "of two, starting with ``1``." -msgstr "" +msgstr ":class:`Flag` 使用 :class:`auto` 會產生從 ``1`` 開始 2 的次方的整數。" #: ../../library/enum.rst:570 msgid "The *repr()* of zero-valued flags has changed. It is now::" -msgstr "" +msgstr "值為 0 的旗標的 *repr()* 已改變。現在是: ::" #: ../../library/enum.rst:578 msgid "" "*IntFlag* is the same as *Flag*, but its members are also integers and can " "be used anywhere that an integer can be used." msgstr "" +"*IntFlag* 和 *Flag* 一樣,但其成員同時也是整數而可以被用在任何使用整數的地" +"方。" #: ../../library/enum.rst:592 msgid "" "If any integer operation is performed with an *IntFlag* member, the result " "is not an *IntFlag*::" -msgstr "" +msgstr "如果 *IntFlag* 成員經過任何整數運算,其結果不是 *IntFlag*: ::" #: ../../library/enum.rst:598 msgid "If a *Flag* operation is performed with an *IntFlag* member and:" -msgstr "" +msgstr "如果 *IntFlag* 成員經過 *Flag* 操作且:" #: ../../library/enum.rst:600 msgid "the result is a valid *IntFlag*: an *IntFlag* is returned" -msgstr "" +msgstr "結果是合法的 *IntFlag*:回傳 *IntFlag*" #: ../../library/enum.rst:601 msgid "" "the result is not a valid *IntFlag*: the result depends on the " "*FlagBoundary* setting" -msgstr "" +msgstr "結果不是合法的 *IntFlag*:結果會根據 *FlagBoundary* 的設定" #: ../../library/enum.rst:603 msgid "The *repr()* of unnamed zero-valued flags has changed. It is now:" -msgstr "" +msgstr "未命名且值為 0 的旗標的 *repr()* 已改變。現在是: ::" #: ../../library/enum.rst:610 msgid "" "Using :class:`auto` with :class:`IntFlag` results in integers that are " "powers of two, starting with ``1``." msgstr "" +":class:`IntFlag` 使用 :class:`auto` 會產生從 ``1`` 開始 2 的次方的整數。" #: ../../library/enum.rst:615 msgid "" @@ -734,6 +760,9 @@ msgid "" "*replacement of existing constants* use-case. :meth:`~object.__format__` " "was already :meth:`!int.__format__` for that same reason." msgstr "" +"為了更好地支援\\ *現存常數取代 (replacement of existing constants)* 的使用情" +"境,:meth:`~object.__str__` 現在會是 :meth:`!int.__str__`。為了同樣的理由,:" +"meth:`~object.__format__` 已經是 :meth:`!int.__format__`。" #: ../../library/enum.rst:619 msgid "" @@ -741,20 +770,24 @@ msgid "" "union of all flags not in the given flag, rather than a negative value. This " "matches the existing :class:`Flag` behavior." msgstr "" +":class:`!IntFlag` 的反轉 (inversion) 現在會回傳正值,該值是不在給定旗標的所有" +"旗標聯集,而不是一個負值。這符合現有 :class:`Flag` 的行為。" #: ../../library/enum.rst:625 msgid "" ":class:`!ReprEnum` uses the :meth:`repr() ` of :class:`Enum`, " "but the :class:`str() ` of the mixed-in data type:" msgstr "" +":class:`!ReprEnum` 使用 :class:`Enum` 的 :meth:`repr() `,但使" +"用混合資料類型的 :class:`str() `:" #: ../../library/enum.rst:628 msgid ":meth:`!int.__str__` for :class:`IntEnum` and :class:`IntFlag`" -msgstr "" +msgstr "對 :class:`IntEnum` 和 :class:`IntFlag` 是 :meth:`!int.__str__`" #: ../../library/enum.rst:629 msgid ":meth:`!str.__str__` for :class:`StrEnum`" -msgstr "" +msgstr "對 :class:`StrEnum` 是 :meth:`!str.__str__`" #: ../../library/enum.rst:631 msgid "" @@ -762,72 +795,82 @@ msgid "" "`format` of the mixed-in data type instead of using the :class:`Enum`-" "default :meth:`str() `." msgstr "" +"繼承 :class:`!ReprEnum` 來保留混合資料類型的 :class:`str() ` / :func:" +"`format`,而不是使用 :class:`Enum` 預設的 :meth:`str() `。" #: ../../library/enum.rst:640 msgid "" "*EnumCheck* contains the options used by the :func:`verify` decorator to " "ensure various constraints; failed constraints result in a :exc:`ValueError`." msgstr "" +"*EnumCheck* 包含 :func:`verify` 裝飾器使用的選項,以確保多樣的限制,不符合限" +"制會產生 :exc:`ValueError`。" #: ../../library/enum.rst:645 msgid "Ensure that each value has only one name::" -msgstr "" +msgstr "確保每個值只有一個名稱: ::" #: ../../library/enum.rst:661 msgid "" "Ensure that there are no missing values between the lowest-valued member and " "the highest-valued member::" -msgstr "" +msgstr "確保在最小值成員跟最大值成員間沒有缺少值: ::" #: ../../library/enum.rst:676 msgid "" "Ensure that any flag groups/masks contain only named flags -- useful when " "values are specified instead of being generated by :func:`auto`::" msgstr "" +"確保任何旗標群組 / 遮罩只包含命名旗標 -- 當值是用指定而不是透過 :func:`auto` " +"產生時是很實用的: ::" #: ../../library/enum.rst:693 msgid "" "CONTINUOUS and NAMED_FLAGS are designed to work with integer-valued members." -msgstr "" +msgstr "CONTINUOUS 和 NAMED_FLAGS 是設計用來運作在整數值的成員上。" #: ../../library/enum.rst:699 msgid "" "*FlagBoundary* controls how out-of-range values are handled in *Flag* and " "its subclasses." -msgstr "" +msgstr "*FlagBoundary* 控制在 *Flag* 及其子類別中如何處理範圍外的值。" #: ../../library/enum.rst:704 msgid "" "Out-of-range values cause a :exc:`ValueError` to be raised. This is the " "default for :class:`Flag`::" -msgstr "" +msgstr "範圍外的值會引發 :exc:`ValueError`。這是 :class:`Flag` 的預設行為: ::" #: ../../library/enum.rst:722 msgid "" "Out-of-range values have invalid values removed, leaving a valid *Flag* " "value::" -msgstr "" +msgstr "範圍外的值會移除非法值,留下合法的 *Flag* 值: ::" #: ../../library/enum.rst:736 msgid "" "Out-of-range values lose their *Flag* membership and revert to :class:`int`." -msgstr "" +msgstr "範圍外的值會失去它們的 *Flag* 成員資格且恢復成 :class:`int`。" #: ../../library/enum.rst:749 msgid "" "Out-of-range values are kept, and the *Flag* membership is kept. This is the " "default for :class:`IntFlag`::" msgstr "" +"範圍外的值會被保留,*Flag* 成員資格也會被保留。這是 :class:`IntFlag` 的預設行" +"為: ::" #: ../../library/enum.rst:766 msgid "Supported ``__dunder__`` names" -msgstr "" +msgstr "支援 ``__dunder__`` 名稱" #: ../../library/enum.rst:768 msgid "" ":attr:`~EnumType.__members__` is a read-only ordered mapping of " "``member_name``:``member`` items. It is only available on the class." msgstr "" +":attr:`~EnumType.__members__` 是一個唯讀有序的\\ ``成員名稱``:``成員``\\ 項目的" +"對映。只有在類別上可用。" #: ../../library/enum.rst:771 msgid "" @@ -835,25 +878,28 @@ msgid "" "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 "" +"如果指定了 :meth:`~object.__new__`,它必須建立並回傳列舉成員;適當地設定成員" +"的 :attr:`!_value_` 也是一個很好的主意。一旦所有成員都建立之後就不會再被用" +"到。" #: ../../library/enum.rst:777 msgid "Supported ``_sunder_`` names" -msgstr "" +msgstr "支援 ``_sunder_`` 名稱" #: ../../library/enum.rst:779 msgid "``_name_`` -- name of the member" -msgstr "" +msgstr "``_name_`` -- 成員名稱" #: ../../library/enum.rst:780 msgid "" "``_value_`` -- value of the member; can be set / modified in ``__new__``" -msgstr "" +msgstr "``_value_`` -- 成員的值;可以在 ``__new__`` 設定或修改" #: ../../library/enum.rst:782 msgid "" "``_missing_`` -- a lookup function used when a value is not found; may be " "overridden" -msgstr "" +msgstr "``_missing_`` -- 當值沒有被找到時會使用的查詢函式;可以被覆寫" #: ../../library/enum.rst:784 msgid "" @@ -861,30 +907,37 @@ msgid "" "`str`, that will not be transformed into members, and will be removed from " "the final class" msgstr "" +"``_ignore_`` -- 可以是 :class:`list` 或 :class:`str` 的名稱串列,它不會被轉換" +"成成員,且在最後的類別上會被移除" #: ../../library/enum.rst:787 msgid "" "``_order_`` -- used in Python 2/3 code to ensure member order is consistent " "(class attribute, removed during class creation)" msgstr "" +"``_order_`` -- 在 Python 2/3 的程式裡用來確保成員順序是一致的(類別屬性,在類" +"別建立時移除)" #: ../../library/enum.rst:789 msgid "" "``_generate_next_value_`` -- used to get an appropriate value for an enum " "member; may be overridden" -msgstr "" +msgstr "``_generate_next_value_`` -- 用來為列舉成員取得合適的值;可以被覆寫" #: ../../library/enum.rst:794 msgid "" "For standard :class:`Enum` classes the next value chosen is the last value " "seen incremented by one." msgstr "" +"對標準的 :class:`Enum` 類別來說,下一個被選擇的值是最後一個看見的值加一。" #: ../../library/enum.rst:797 msgid "" "For :class:`Flag` classes the next value chosen will be the next highest " "power-of-two, regardless of the last value seen." msgstr "" +"對 :class:`Flag` 類別來說,下一個被選擇的值是下一個最大的 2 的次方,不管最後" +"一個看見的值是什麼。" #: ../../library/enum.rst:800 msgid "``_missing_``, ``_order_``, ``_generate_next_value_``" @@ -896,7 +949,7 @@ msgstr "``_ignore_``" #: ../../library/enum.rst:806 msgid "Utilities and Decorators" -msgstr "" +msgstr "通用項目與裝飾器" #: ../../library/enum.rst:810 msgid "" @@ -908,43 +961,51 @@ msgid "" "version of the member's name. Care must be taken if mixing *auto()* with " "manually specified values." msgstr "" +"*auto* 可以用來取代給值。如果使用的話,*Enum* 系統會呼叫 *Enum* 的 :meth:" +"`~Enum._generate_next_value_` 來取得合適的值。對 *Enum* 和 *IntEnum* 來說,合" +"適的值是最後一個值加一;對 *Flag* 和 *IntFlag* 來說,是第一個比最大值還大的 " +"2 的次方的數字;對 *StrEnum* 來說,是成員名稱的小寫版本。如果混用 *auto()* 和" +"手動指定值的話要特別注意。" #: ../../library/enum.rst:818 msgid "" "*auto* instances are only resolved when at the top level of an assignment:" -msgstr "" +msgstr "*auto* 實例只有在最上層的賦值時才會被解析:" #: ../../library/enum.rst:820 msgid "``FIRST = auto()`` will work (auto() is replaced with ``1``);" -msgstr "" +msgstr "``FIRST = auto()`` 可以運作(auto() 會被取代成 ``1``)" #: ../../library/enum.rst:821 msgid "" "``SECOND = auto(), -2`` will work (auto is replaced with ``2``, so ``2, -2`` " "is" msgstr "" +"``SECOND = auto(), -2`` 可以運作(auto 會被取代成 ``2``, 因此 ``2, -2`` 會" #: ../../library/enum.rst:822 msgid "used to create the ``SECOND`` enum member;" -msgstr "" +msgstr "被用來建立列舉成員 ``SECOND``;" #: ../../library/enum.rst:823 msgid "" "``THREE = [auto(), -3]`` will *not* work (``, -3`` is used to " "create the ``THREE`` enum member)" msgstr "" +"``THREE = [auto(), -3]`` *無法*\\ 運作(\\ ``, -3`` 會被用來建立列" +"舉成員 ``THREE``)" #: ../../library/enum.rst:828 msgid "" "In prior versions, ``auto()`` had to be the only thing on the assignment " "line to work properly." -msgstr "" +msgstr "在之前的版本中,``auto()`` 必須是賦值行裡的唯一內容才能運作正確。" #: ../../library/enum.rst:831 msgid "" "``_generate_next_value_`` can be overridden to customize the values used by " "*auto*." -msgstr "" +msgstr "可以覆寫 ``_generate_next_value_`` 來客製 *auto* 使用的值。" #: ../../library/enum.rst:834 msgid "" @@ -952,6 +1013,8 @@ msgid "" "member value incremented by 1, and will fail if any member is an " "incompatible type." msgstr "" +"在 3.13 預設 ``_generate_next_value_`` 總是回傳最大的成員值加一,如果任何成員" +"是不相容的類型就會失敗。" #: ../../library/enum.rst:840 msgid "" @@ -959,6 +1022,8 @@ msgid "" "enumerations. It allows member attributes to have the same names as members " "themselves." msgstr "" +"和內建的 *property* 相似的裝飾器,但只專門針對列舉。它允許成員屬性和成員本身" +"有相同名稱。" #: ../../library/enum.rst:844 msgid "" @@ -967,6 +1032,8 @@ msgid "" "and *Enum* subclasses can define members with the names ``value`` and " "``name``." msgstr "" +"*屬性*\\ 和成員必須定義在分開的類別裡;例如 *value* 和 *name* 屬性定義在 " +"*Enum* 類別而 *Enum* 子類別可以定義成員名稱為 ``value`` 和 ``name``。" #: ../../library/enum.rst:853 msgid "" @@ -974,6 +1041,9 @@ msgid "" "enumeration's :attr:`~EnumType.__members__`, gathering any aliases it finds; " "if any are found :exc:`ValueError` is raised with the details::" msgstr "" +"專門針對列舉的 :keyword:`class` 裝飾器。它搜尋列舉的 :attr:`~EnumType." +"__members__`,蒐集任何它找到的別名;如果有找到任何別名則引發 :exc:" +"`ValueError` 並附上細節: ::" #: ../../library/enum.rst:871 msgid "" @@ -981,14 +1051,16 @@ msgid "" "class:`EnumCheck` are used to specify which constraints should be checked on " "the decorated enumeration." msgstr "" +"專門針對列舉的 :keyword:`class` 裝飾器。使用 :class:`EnumCheck` 裡的成員來指" +"定在裝飾的列舉上應該檢查什麼限制。" #: ../../library/enum.rst:879 msgid "A decorator for use in enums: its target will become a member." -msgstr "" +msgstr "列舉所使用的裝飾器:其目標會變成成員。" #: ../../library/enum.rst:885 msgid "A decorator for use in enums: its target will not become a member." -msgstr "" +msgstr "列舉所使用的裝飾器:其目標不會變成成員。" #: ../../library/enum.rst:891 msgid "" @@ -997,44 +1069,51 @@ msgid "" "only be used when the enum members are exported to the module global " "namespace (see :class:`re.RegexFlag` for an example)." msgstr "" +"修改列舉的 :class:`str() ` 及 :func:`repr` 的裝飾器,讓成員顯示為屬於模" +"組而不是其類別。應該只有當列舉成員被匯出到模組的全域命名空間才使用(範例請參" +"考 :class:`re.RegexFlag`)。" #: ../../library/enum.rst:901 msgid "Return a list of all power-of-two integers contained in a flag *value*." -msgstr "" +msgstr "回傳在旗標\\ *值*\\ 中包含的所有 2 的次方的整數串列。" #: ../../library/enum.rst:908 msgid "Notes" -msgstr "" +msgstr "備註" #: ../../library/enum.rst:910 msgid ":class:`IntEnum`, :class:`StrEnum`, and :class:`IntFlag`" -msgstr "" +msgstr ":class:`IntEnum`、:class:`StrEnum` 及 :class:`IntFlag`" #: ../../library/enum.rst:912 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:915 msgid "``__str__`` uses the value and not the name of the enum member" -msgstr "" +msgstr "``__str__`` 使用值而不是列舉成員的名稱" #: ../../library/enum.rst:917 msgid "" "``__format__``, because it uses ``__str__``, will also use the value of the " "enum member instead of its name" -msgstr "" +msgstr "``__format__`` 因為使用 ``__str__``,也會使用值而不是列舉成員的名稱" #: ../../library/enum.rst:920 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 "" +"如果你不需要或不想要這些限制,你可以透過混合 ``int`` 或 ``str`` 類型來建立自" +"己的基礎類別: ::" #: ../../library/enum.rst:927 msgid "or you can reassign the appropriate :meth:`str`, etc., in your enum::" -msgstr "" +msgstr "或者你也可以在你的列舉重新給定合適的 :meth:`str`: ::" #~ msgid "The *start* parameter was added." #~ msgstr "新增 *start* 參數。" From 317d61fdbbf1d043569ab93d56bae2c9175b69b0 Mon Sep 17 00:00:00 2001 From: "pydoc-zh-tw[bot]" <90344106+pydoc-zh-tw[bot]@users.noreply.github.com> Date: Mon, 6 Nov 2023 01:21:30 +0800 Subject: [PATCH 23/39] Sync with CPython 3.12 (#666) * sync with cpython 744f752f * sync with cpython 7de3c8b7 * sync with cpython 94525a7a * sync with cpython ae838afe * sync with cpython d3121357 * sync with cpython 41dfae8f * sync with cpython 727f8ee3 * sync with cpython f2f89bf1 * sync with cpython 9e73c71a * sync with cpython 38578dd6 * sync with cpython a4eb2e30 * sync with cpython 7cce26bc * sync with cpython 2398036e * sync with cpython f7ce4021 * sync with cpython e5b6744f * sync with cpython 1675c254 * sync with cpython 21c8fbf2 * sync with cpython 99f0dd88 * sync with cpython 1c84a480 * sync with cpython 1a95ad68 * sync with cpython 9c583f36 * sync with cpython e0c2bf46 * fix: resolve fuzzy entries --------- Co-authored-by: github-actions[bot] Co-authored-by: Matt Wang --- bugs.po | 9 +- c-api/call.po | 178 ++-- c-api/exceptions.po | 723 ++++++++-------- c-api/memory.po | 68 +- c-api/set.po | 7 +- glossary.po | 46 +- howto/descriptor.po | 128 +-- howto/enum.po | 330 +++---- howto/regex.po | 444 +++++----- library/abc.po | 14 +- library/asyncio-eventloop.po | 619 +++++++------- library/asyncio.po | 14 +- library/bz2.po | 121 ++- library/codecs.po | 886 +++++++++---------- library/collections.abc.po | 24 +- library/collections.po | 22 +- library/contextlib.po | 35 +- library/difflib.po | 207 ++--- library/dis.po | 723 ++++++++-------- library/doctest.po | 583 +++++++------ library/email.compat32-message.po | 6 +- library/email.message.po | 6 +- library/enum.po | 229 +++-- library/fcntl.po | 33 +- library/functions.po | 24 +- library/getpass.po | 12 +- library/grp.po | 25 +- library/inspect.po | 374 ++++---- library/itertools.po | 6 +- library/locale.po | 71 +- library/logging.handlers.po | 286 ++++--- library/mailbox.po | 4 +- library/mmap.po | 10 +- library/multiprocessing.po | 7 +- library/operator.po | 26 +- library/posix.po | 38 +- library/pty.po | 34 +- library/pwd.po | 25 +- library/resource.po | 29 +- library/selectors.po | 6 +- library/socket.po | 619 +++++++------- library/sqlite3.po | 532 ++++++------ library/sys.monitoring.po | 474 ++++++----- library/sys.po | 848 +++++++++--------- library/syslog.po | 35 +- library/tempfile.po | 12 +- library/termios.po | 53 +- library/test.po | 463 +++++----- library/time.po | 583 +++++++------ library/tkinter.messagebox.po | 211 ++++- library/tty.po | 22 +- library/typing.po | 772 ++++++++--------- library/unittest.mock.po | 10 +- library/wsgiref.po | 18 +- library/xml.dom.pulldom.po | 4 +- library/xml.etree.elementtree.po | 468 +++++----- reference/compound_stmts.po | 41 +- reference/datamodel.po | 12 +- reference/expressions.po | 36 +- reference/import.po | 10 +- reference/introduction.po | 19 +- tutorial/introduction.po | 6 +- whatsnew/2.0.po | 8 +- whatsnew/2.2.po | 38 +- whatsnew/2.3.po | 10 +- whatsnew/2.5.po | 60 +- whatsnew/2.6.po | 78 +- whatsnew/2.7.po | 20 +- whatsnew/3.11.po | 8 +- whatsnew/3.12.po | 1325 +++++++++++++++-------------- whatsnew/3.3.po | 2 +- whatsnew/3.4.po | 6 +- whatsnew/3.5.po | 8 +- whatsnew/3.6.po | 6 +- whatsnew/3.7.po | 8 +- whatsnew/3.8.po | 12 +- whatsnew/3.9.po | 8 +- 77 files changed, 6867 insertions(+), 6410 deletions(-) diff --git a/bugs.po b/bugs.po index 1c81ad8567..4269ebaa0d 100644 --- a/bugs.po +++ b/bugs.po @@ -13,7 +13,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-27 00:17+0000\n" +"POT-Creation-Date: 2023-11-05 09:50+0000\n" "PO-Revision-Date: 2022-08-31 12:34+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -117,9 +117,10 @@ msgstr "給有意成為 Python 說明文件貢獻者的綜合指南。" #: ../../bugs.rst:41 msgid "" -"`Documentation Translations `_" -msgstr "`說明文件翻譯 `_" +"`Documentation Translations `_" +msgstr "" +"`說明文件翻譯 `_" #: ../../bugs.rst:42 msgid "" diff --git a/c-api/call.po b/c-api/call.po index d125073afb..737b538f4d 100644 --- a/c-api/call.po +++ b/c-api/call.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-10-24 00:03+0000\n" "PO-Revision-Date: 2022-10-16 03:20+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -166,8 +166,8 @@ msgid "" ":c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET` flag. To get the actual number of " "positional arguments from *nargsf*, use :c:func:`PyVectorcall_NARGS`." msgstr "" -":c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET` 旗標。如果要從 *nargsf* 獲得實際的位" -"置引數數量,請使用 :c:func:`PyVectorcall_NARGS`。" +":c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET` 旗標。如果要從 *nargsf* 獲得實際的" +"位置引數數量,請使用 :c:func:`PyVectorcall_NARGS`。" #: ../../c-api/call.rst:94 msgid "*kwnames* is a tuple containing the names of the keyword arguments;" @@ -210,11 +210,11 @@ msgid "" "include a prepended *self* argument) very efficiently." msgstr "" "當可以以幾乎無代價的方式(無需佔據額外的記憶體)來達成,那麼會推薦呼叫者使" -"用 :c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET`。這樣做會讓如 bound method(繫結方" -"法)之類的可呼叫函式非常有效地繼續向前呼叫(這類函式包含一個在首位的 *self* " -"引數)。" +"用 :c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET`。這樣做會讓如 bound method(繫結" +"方法)之類的可呼叫函式非常有效地繼續向前呼叫(這類函式包含一個在首位的 " +"*self* 引數)。" -#: ../../c-api/call.rst:111 +#: ../../c-api/call.rst:113 msgid "" "To call an object that implements vectorcall, use a :ref:`call API ` function as with any other callable. :c:func:`PyObject_Vectorcall` " @@ -223,7 +223,7 @@ msgstr "" "要呼叫一個實作了 vectorcall 的物件,請就像其他可呼叫物件一樣使用\\ :ref:`呼" "叫 API` 中的函式。:c:func:`PyObject_Vectorcall` 通常是最有效率的。" -#: ../../c-api/call.rst:118 +#: ../../c-api/call.rst:120 msgid "" "In CPython 3.8, the vectorcall API and related functions were available " "provisionally under names with a leading underscore: " @@ -242,11 +242,11 @@ msgstr "" "``_PyObject_FastCallDict`` 名稱提供。這些舊名稱仍有被定義,做為不帶底線的新名" "稱的別名。" -#: ../../c-api/call.rst:130 +#: ../../c-api/call.rst:132 msgid "Recursion Control" msgstr "遞迴控制" -#: ../../c-api/call.rst:132 +#: ../../c-api/call.rst:134 msgid "" "When using *tp_call*, callees do not need to worry about :ref:`recursion " "`: CPython uses :c:func:`Py_EnterRecursiveCall` and :c:func:" @@ -256,7 +256,7 @@ msgstr "" "使用 *tp_call* 的呼叫會使用 :c:func:`Py_EnterRecursiveCall` 和 :c:func:" "`Py_LeaveRecursiveCall`。" -#: ../../c-api/call.rst:137 +#: ../../c-api/call.rst:139 msgid "" "For efficiency, this is not the case for calls done using vectorcall: the " "callee should use *Py_EnterRecursiveCall* and *Py_LeaveRecursiveCall* if " @@ -265,11 +265,11 @@ msgstr "" "為保證效率,這不適用於使用 vectorcall 的呼叫:被呼叫方在需要時應當使用 " "*Py_EnterRecursiveCall* 和 *Py_LeaveRecursiveCall*。" -#: ../../c-api/call.rst:143 +#: ../../c-api/call.rst:145 msgid "Vectorcall Support API" msgstr "Vectorcall 支援 API" -#: ../../c-api/call.rst:147 +#: ../../c-api/call.rst:149 msgid "" "Given a vectorcall *nargsf* argument, return the actual number of arguments. " "Currently equivalent to::" @@ -278,13 +278,13 @@ msgstr "" "\n" "::" -#: ../../c-api/call.rst:153 +#: ../../c-api/call.rst:155 msgid "" "However, the function ``PyVectorcall_NARGS`` should be used to allow for " "future extensions." msgstr "然而,應使用 ``PyVectorcall_NARGS`` 函式以便將來需要擴充。" -#: ../../c-api/call.rst:160 +#: ../../c-api/call.rst:162 msgid "" "If *op* does not support the vectorcall protocol (either because the type " "does not or because the specific instance does not), return *NULL*. " @@ -295,7 +295,7 @@ msgstr "" "*NULL*。否則,回傳儲存在 *op* 中的 vectorcall 函式指標。這個函式不會引發例" "外。" -#: ../../c-api/call.rst:165 +#: ../../c-api/call.rst:167 msgid "" "This is mostly useful to check whether or not *op* supports vectorcall, " "which can be done by checking ``PyVectorcall_Function(op) != NULL``." @@ -303,7 +303,7 @@ msgstr "" "這大多在檢查 *op* 是否支援 vectorcall 時能派上用場,可以透過檢查 " "``PyVectorcall_Function(op) != NULL`` 來達成。" -#: ../../c-api/call.rst:172 +#: ../../c-api/call.rst:174 msgid "" "Call *callable*'s :c:type:`vectorcallfunc` with positional and keyword " "arguments given in a tuple and dict, respectively." @@ -311,7 +311,7 @@ msgstr "" "呼叫 *callable* 的 :c:type:`vectorcallfunc`,其位置引數和關鍵字引數分別以 " "tuple 和 dict 格式給定。" -#: ../../c-api/call.rst:175 +#: ../../c-api/call.rst:177 msgid "" "This is a specialized function, intended to be put in the :c:member:" "`~PyTypeObject.tp_call` slot or be used in an implementation of ``tp_call``. " @@ -319,14 +319,14 @@ msgid "" "not fall back to ``tp_call``." msgstr "" "這是一個專門函式,其目的是被放入 :c:member:`~PyTypeObject.tp_call` 擴充槽或是" -"用於 ``tp_call`` 的實作。它不會檢查 :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` 旗標" -"並且它不會退回 (fall back) 使用 ``tp_call``。" +"用於 ``tp_call`` 的實作。它不會檢查 :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` 旗" +"標並且它不會退回 (fall back) 使用 ``tp_call``。" -#: ../../c-api/call.rst:186 +#: ../../c-api/call.rst:188 msgid "Object Calling API" msgstr "物件呼叫 API" -#: ../../c-api/call.rst:188 +#: ../../c-api/call.rst:190 msgid "" "Various functions are available for calling a Python object. Each converts " "its arguments to a convention supported by the called object – either " @@ -337,133 +337,133 @@ msgstr "" "的慣用形式 – 可以是 *tp_call* 或 vectorcall。為了儘可能減少轉換的進行,請選擇" "一個適合你所擁有資料格式的函式。" -#: ../../c-api/call.rst:194 +#: ../../c-api/call.rst:196 msgid "" "The following table summarizes the available functions; please see " "individual documentation for details." msgstr "下表總結了可用的函式;請參閱各個說明文件以瞭解詳情。" -#: ../../c-api/call.rst:198 +#: ../../c-api/call.rst:200 msgid "Function" msgstr "函式" -#: ../../c-api/call.rst:198 +#: ../../c-api/call.rst:200 msgid "callable" msgstr "callable" -#: ../../c-api/call.rst:198 +#: ../../c-api/call.rst:200 msgid "args" msgstr "args" -#: ../../c-api/call.rst:198 +#: ../../c-api/call.rst:200 msgid "kwargs" msgstr "kwargs" -#: ../../c-api/call.rst:200 +#: ../../c-api/call.rst:202 msgid ":c:func:`PyObject_Call`" msgstr ":c:func:`PyObject_Call`" -#: ../../c-api/call.rst:200 ../../c-api/call.rst:202 ../../c-api/call.rst:204 -#: ../../c-api/call.rst:206 ../../c-api/call.rst:208 ../../c-api/call.rst:212 -#: ../../c-api/call.rst:220 ../../c-api/call.rst:222 +#: ../../c-api/call.rst:202 ../../c-api/call.rst:204 ../../c-api/call.rst:206 +#: ../../c-api/call.rst:208 ../../c-api/call.rst:210 ../../c-api/call.rst:214 +#: ../../c-api/call.rst:222 ../../c-api/call.rst:224 msgid "``PyObject *``" msgstr "``PyObject *``" -#: ../../c-api/call.rst:200 +#: ../../c-api/call.rst:202 msgid "tuple" msgstr "tuple" -#: ../../c-api/call.rst:200 ../../c-api/call.rst:222 +#: ../../c-api/call.rst:202 ../../c-api/call.rst:224 msgid "dict/``NULL``" msgstr "dict/``NULL``" -#: ../../c-api/call.rst:202 +#: ../../c-api/call.rst:204 msgid ":c:func:`PyObject_CallNoArgs`" msgstr ":c:func:`PyObject_CallNoArgs`" -#: ../../c-api/call.rst:202 ../../c-api/call.rst:204 ../../c-api/call.rst:206 -#: ../../c-api/call.rst:208 ../../c-api/call.rst:210 ../../c-api/call.rst:212 -#: ../../c-api/call.rst:214 ../../c-api/call.rst:216 ../../c-api/call.rst:218 +#: ../../c-api/call.rst:204 ../../c-api/call.rst:206 ../../c-api/call.rst:208 +#: ../../c-api/call.rst:210 ../../c-api/call.rst:212 ../../c-api/call.rst:214 +#: ../../c-api/call.rst:216 ../../c-api/call.rst:218 ../../c-api/call.rst:220 msgid "---" msgstr "---" -#: ../../c-api/call.rst:204 +#: ../../c-api/call.rst:206 msgid ":c:func:`PyObject_CallOneArg`" msgstr ":c:func:`PyObject_CallOneArg`" -#: ../../c-api/call.rst:204 ../../c-api/call.rst:218 +#: ../../c-api/call.rst:206 ../../c-api/call.rst:220 msgid "1 object" msgstr "一個物件" -#: ../../c-api/call.rst:206 +#: ../../c-api/call.rst:208 msgid ":c:func:`PyObject_CallObject`" msgstr ":c:func:`PyObject_CallObject`" -#: ../../c-api/call.rst:206 +#: ../../c-api/call.rst:208 msgid "tuple/``NULL``" msgstr "tuple/``NULL``" -#: ../../c-api/call.rst:208 +#: ../../c-api/call.rst:210 msgid ":c:func:`PyObject_CallFunction`" msgstr ":c:func:`PyObject_CallFunction`" -#: ../../c-api/call.rst:208 ../../c-api/call.rst:210 +#: ../../c-api/call.rst:210 ../../c-api/call.rst:212 msgid "format" msgstr "format" -#: ../../c-api/call.rst:210 +#: ../../c-api/call.rst:212 msgid ":c:func:`PyObject_CallMethod`" msgstr ":c:func:`PyObject_CallMethod`" -#: ../../c-api/call.rst:210 +#: ../../c-api/call.rst:212 msgid "obj + ``char*``" msgstr "物件 + ``char*``" -#: ../../c-api/call.rst:212 +#: ../../c-api/call.rst:214 msgid ":c:func:`PyObject_CallFunctionObjArgs`" msgstr ":c:func:`PyObject_CallFunctionObjArgs`" -#: ../../c-api/call.rst:212 ../../c-api/call.rst:214 +#: ../../c-api/call.rst:214 ../../c-api/call.rst:216 msgid "variadic" msgstr "可變引數" -#: ../../c-api/call.rst:214 +#: ../../c-api/call.rst:216 msgid ":c:func:`PyObject_CallMethodObjArgs`" msgstr ":c:func:`PyObject_CallMethodObjArgs`" -#: ../../c-api/call.rst:214 ../../c-api/call.rst:216 ../../c-api/call.rst:218 +#: ../../c-api/call.rst:216 ../../c-api/call.rst:218 ../../c-api/call.rst:220 msgid "obj + name" msgstr "物件 + 名稱" -#: ../../c-api/call.rst:216 +#: ../../c-api/call.rst:218 msgid ":c:func:`PyObject_CallMethodNoArgs`" msgstr ":c:func:`PyObject_CallMethodNoArgs`" -#: ../../c-api/call.rst:218 +#: ../../c-api/call.rst:220 msgid ":c:func:`PyObject_CallMethodOneArg`" msgstr ":c:func:`PyObject_CallMethodOneArg`" -#: ../../c-api/call.rst:220 +#: ../../c-api/call.rst:222 msgid ":c:func:`PyObject_Vectorcall`" msgstr ":c:func:`PyObject_Vectorcall`" -#: ../../c-api/call.rst:220 ../../c-api/call.rst:222 ../../c-api/call.rst:224 +#: ../../c-api/call.rst:222 ../../c-api/call.rst:224 ../../c-api/call.rst:226 msgid "vectorcall" msgstr "vectorcall" -#: ../../c-api/call.rst:222 +#: ../../c-api/call.rst:224 msgid ":c:func:`PyObject_VectorcallDict`" msgstr ":c:func:`PyObject_VectorcallDict`" -#: ../../c-api/call.rst:224 +#: ../../c-api/call.rst:226 msgid ":c:func:`PyObject_VectorcallMethod`" msgstr ":c:func:`PyObject_VectorcallMethod`" -#: ../../c-api/call.rst:224 +#: ../../c-api/call.rst:226 msgid "arg + name" msgstr "引數 + 名稱" -#: ../../c-api/call.rst:230 +#: ../../c-api/call.rst:232 msgid "" "Call a callable Python object *callable*, with arguments given by the tuple " "*args*, and named arguments given by the dictionary *kwargs*." @@ -471,7 +471,7 @@ msgstr "" "呼叫一個可呼叫的 Python 物件 *callable*,附帶由 tuple *args* 所給定的引數及由" "字典 *kwargs* 所給定的關鍵字引數。" -#: ../../c-api/call.rst:233 +#: ../../c-api/call.rst:235 msgid "" "*args* must not be *NULL*; use an empty tuple if no arguments are needed. If " "no named arguments are needed, *kwargs* can be *NULL*." @@ -479,22 +479,22 @@ msgstr "" "*args* 必須不為 *NULL*;如果不需要引數,請使用一個空 tuple。如果不需要關鍵字" "引數,則 *kwargs* 可以為 *NULL*。" -#: ../../c-api/call.rst:236 ../../c-api/call.rst:248 ../../c-api/call.rst:259 -#: ../../c-api/call.rst:270 ../../c-api/call.rst:282 ../../c-api/call.rst:302 -#: ../../c-api/call.rst:321 ../../c-api/call.rst:335 ../../c-api/call.rst:344 -#: ../../c-api/call.rst:356 ../../c-api/call.rst:369 ../../c-api/call.rst:403 +#: ../../c-api/call.rst:238 ../../c-api/call.rst:250 ../../c-api/call.rst:261 +#: ../../c-api/call.rst:272 ../../c-api/call.rst:284 ../../c-api/call.rst:304 +#: ../../c-api/call.rst:323 ../../c-api/call.rst:337 ../../c-api/call.rst:346 +#: ../../c-api/call.rst:358 ../../c-api/call.rst:371 ../../c-api/call.rst:405 msgid "" "Return the result of the call on success, or raise an exception and return " "*NULL* on failure." msgstr "成功時回傳結果,或在失敗時引發一個例外並回傳 *NULL*。" -#: ../../c-api/call.rst:239 +#: ../../c-api/call.rst:241 msgid "" "This is the equivalent of the Python expression: ``callable(*args, " "**kwargs)``." msgstr "這等價於 Python 運算式 ``callable(*args, **kwargs)``。" -#: ../../c-api/call.rst:245 +#: ../../c-api/call.rst:247 msgid "" "Call a callable Python object *callable* without any arguments. It is the " "most efficient way to call a callable Python object without any argument." @@ -502,7 +502,7 @@ msgstr "" "呼叫一個可呼叫的 Python 物件 *callable* 並不附帶任何引數。這是不帶引數呼叫 " "Python 可呼叫物件的最有效方式。" -#: ../../c-api/call.rst:256 +#: ../../c-api/call.rst:258 msgid "" "Call a callable Python object *callable* with exactly 1 positional argument " "*arg* and no keyword arguments." @@ -510,7 +510,7 @@ msgstr "" "呼叫一個可呼叫的 Python 物件 *callable* 並附帶正好一個位置引數 *arg* 而沒有關" "鍵字引數。" -#: ../../c-api/call.rst:267 +#: ../../c-api/call.rst:269 msgid "" "Call a callable Python object *callable*, with arguments given by the tuple " "*args*. If no arguments are needed, then *args* can be *NULL*." @@ -518,11 +518,11 @@ msgstr "" "呼叫一個可呼叫的 Python 物件 *callable*,附帶由 tuple *args* 所給定的引數。如" "果不需要傳入引數,則 *args* 可以為 *NULL*。" -#: ../../c-api/call.rst:273 ../../c-api/call.rst:285 +#: ../../c-api/call.rst:275 ../../c-api/call.rst:287 msgid "This is the equivalent of the Python expression: ``callable(*args)``." msgstr "這等價於 Python 運算式 ``callable(*args)``。" -#: ../../c-api/call.rst:278 +#: ../../c-api/call.rst:280 msgid "" "Call a callable Python object *callable*, with a variable number of C " "arguments. The C arguments are described using a :c:func:`Py_BuildValue` " @@ -533,7 +533,7 @@ msgstr "" "用 :c:func:`Py_BuildValue` 風格的格式字串來描述。格式可以為 *NULL*,表示沒有" "提供任何引數。" -#: ../../c-api/call.rst:287 +#: ../../c-api/call.rst:289 msgid "" "Note that if you only pass :c:expr:`PyObject *` args, :c:func:" "`PyObject_CallFunctionObjArgs` is a faster alternative." @@ -541,11 +541,11 @@ msgstr "" "注意,如果你只傳入 :c:expr:`PyObject *` 引數,則 :c:func:" "`PyObject_CallFunctionObjArgs` 是另一個更快速的選擇。" -#: ../../c-api/call.rst:290 +#: ../../c-api/call.rst:292 msgid "The type of *format* was changed from ``char *``." msgstr "這個 *format* 的型別已從 ``char *`` 更改。" -#: ../../c-api/call.rst:296 +#: ../../c-api/call.rst:298 msgid "" "Call the method named *name* of object *obj* with a variable number of C " "arguments. The C arguments are described by a :c:func:`Py_BuildValue` " @@ -554,17 +554,17 @@ msgstr "" "呼叫 *obj* 物件中名為 *name* 的 method 並附帶數量可變的 C 引數。這些 C 引數" "由 :c:func:`Py_BuildValue` 格式字串來描述,並應當生成一個 tuple。" -#: ../../c-api/call.rst:300 +#: ../../c-api/call.rst:302 msgid "The format can be *NULL*, indicating that no arguments are provided." msgstr "格式可以為 *NULL*,表示沒有提供任何引數。" -#: ../../c-api/call.rst:305 +#: ../../c-api/call.rst:307 msgid "" "This is the equivalent of the Python expression: ``obj.name(arg1, " "arg2, ...)``." msgstr "這等價於 Python 運算式 ``obj.name(arg1, arg2, ...)``。" -#: ../../c-api/call.rst:308 +#: ../../c-api/call.rst:310 msgid "" "Note that if you only pass :c:expr:`PyObject *` args, :c:func:" "`PyObject_CallMethodObjArgs` is a faster alternative." @@ -572,11 +572,11 @@ msgstr "" "注意,如果你只傳入 :c:expr:`PyObject *` 引數,則 :c:func:" "`PyObject_CallMethodObjArgs` 是另一個更快速的選擇。" -#: ../../c-api/call.rst:311 +#: ../../c-api/call.rst:313 msgid "The types of *name* and *format* were changed from ``char *``." msgstr "*name* 和 *format* 的型別已從 ``char *`` 更改。" -#: ../../c-api/call.rst:317 +#: ../../c-api/call.rst:319 msgid "" "Call a callable Python object *callable*, with a variable number of :c:expr:" "`PyObject *` arguments. The arguments are provided as a variable number of " @@ -585,13 +585,13 @@ msgstr "" "呼叫一個可呼叫的 Python 物件 *callable*,附帶數量可變的 :c:expr:`PyObject *` " "引數。這些引數是以位置在 *NULL* 後面、數量可變的參數來提供。" -#: ../../c-api/call.rst:324 +#: ../../c-api/call.rst:326 msgid "" "This is the equivalent of the Python expression: ``callable(arg1, " "arg2, ...)``." msgstr "這等價於 Python 運算式 ``callable(arg1, arg2, ...)``。" -#: ../../c-api/call.rst:330 +#: ../../c-api/call.rst:332 msgid "" "Call a method of the Python object *obj*, where the name of the method is " "given as a Python string object in *name*. It is called with a variable " @@ -602,7 +602,7 @@ msgstr "" "Python 字串物件給定。被呼叫時會附帶數量可變的 :c:expr:`PyObject *` 引數。這些" "引數是以位置在 *NULL* 後面、且數量可變的參數來提供。" -#: ../../c-api/call.rst:341 +#: ../../c-api/call.rst:343 msgid "" "Call a method of the Python object *obj* without arguments, where the name " "of the method is given as a Python string object in *name*." @@ -610,7 +610,7 @@ msgstr "" "不附帶任何引數地呼叫 Python 物件 *obj* 中的一個 method,其中 method 名稱由 " "*name* 中的 Python 字串物件給定。" -#: ../../c-api/call.rst:352 +#: ../../c-api/call.rst:354 msgid "" "Call a method of the Python object *obj* with a single positional argument " "*arg*, where the name of the method is given as a Python string object in " @@ -619,7 +619,7 @@ msgstr "" "附帶一個位置引數 *arg* 地呼叫 Python 物件 *obj* 中的一個 method,其中 method " "名稱由 *name* 中的 Python 字串物件給定。" -#: ../../c-api/call.rst:364 +#: ../../c-api/call.rst:366 msgid "" "Call a callable Python object *callable*. The arguments are the same as for :" "c:type:`vectorcallfunc`. If *callable* supports vectorcall_, this directly " @@ -629,7 +629,7 @@ msgstr "" "的相同。如果 *callable* 支援 vectorcall_,則它會直接呼叫存放在 *callable* 中" "的 vectorcall 函式。" -#: ../../c-api/call.rst:376 +#: ../../c-api/call.rst:378 msgid "" "Call *callable* with positional arguments passed exactly as in the " "vectorcall_ protocol, but with keyword arguments passed as a dictionary " @@ -638,7 +638,7 @@ msgstr "" "附帶與在 vectorcall_ 協定中傳入的相同位置引數來呼叫 *callable*,但會加上以字" "典 *kwdict* 格式傳入的關鍵字引數。*args* 陣列將只包含位置引數。" -#: ../../c-api/call.rst:380 +#: ../../c-api/call.rst:382 msgid "" "Regardless of which protocol is used internally, a conversion of arguments " "needs to be done. Therefore, this function should only be used if the caller " @@ -648,7 +648,7 @@ msgstr "" "無論內部使用了哪一種協定,都會需要進行引數的轉換。因此,此函式應該只有在呼叫" "方已經擁有一個要作為關鍵字引數的字典、但沒有作為位置引數的 tuple 時才被使用。" -#: ../../c-api/call.rst:390 +#: ../../c-api/call.rst:392 msgid "" "Call a method using the vectorcall calling convention. The name of the " "method is given as a Python string *name*. The object whose method is called " @@ -666,19 +666,19 @@ msgstr "" "加上 :c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET`。關鍵字引數可以像在 :c:func:" "`PyObject_Vectorcall` 中一樣被傳入。" -#: ../../c-api/call.rst:399 +#: ../../c-api/call.rst:401 msgid "" "If the object has the :c:macro:`Py_TPFLAGS_METHOD_DESCRIPTOR` feature, this " "will call the unbound method object with the full *args* vector as arguments." msgstr "" -"如果物件具有 :c:macro:`Py_TPFLAGS_METHOD_DESCRIPTOR` 特性,這將以完整的 *args* " -"向量作為引數來呼叫 unbound method(未繫結方法)物件。" +"如果物件具有 :c:macro:`Py_TPFLAGS_METHOD_DESCRIPTOR` 特性,這將以完整的 " +"*args* 向量作為引數來呼叫 unbound method(未繫結方法)物件。" -#: ../../c-api/call.rst:410 +#: ../../c-api/call.rst:412 msgid "Call Support API" msgstr "呼叫支援 API" -#: ../../c-api/call.rst:414 +#: ../../c-api/call.rst:416 msgid "" "Determine if the object *o* is callable. Return ``1`` if the object is " "callable and ``0`` otherwise. This function always succeeds." diff --git a/c-api/exceptions.po b/c-api/exceptions.po index 023dd83533..5c6767c7db 100644 --- a/c-api/exceptions.po +++ b/c-api/exceptions.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-11 17:13+0000\n" +"POT-Creation-Date: 2023-10-31 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:05+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -125,31 +125,40 @@ msgstr "" msgid "" "The function is called with a single argument *obj* that identifies the " "context in which the unraisable exception occurred. If possible, the repr of " -"*obj* will be printed in the warning message." +"*obj* will be printed in the warning message. If *obj* is ``NULL``, only the " +"traceback is printed." msgstr "" -#: ../../c-api/exceptions.rst:92 +#: ../../c-api/exceptions.rst:93 msgid "An exception must be set when calling this function." msgstr "" -#: ../../c-api/exceptions.rst:96 +#: ../../c-api/exceptions.rst:95 +msgid "Print a traceback. Print only traceback if *obj* is ``NULL``." +msgstr "" + +#: ../../c-api/exceptions.rst:98 +msgid "Use :func:`sys.unraisablehook`." +msgstr "" + +#: ../../c-api/exceptions.rst:104 msgid "" "Print the standard traceback display of ``exc`` to ``sys.stderr``, including " "chained exceptions and notes." msgstr "" -#: ../../c-api/exceptions.rst:102 +#: ../../c-api/exceptions.rst:110 msgid "Raising exceptions" msgstr "" -#: ../../c-api/exceptions.rst:104 +#: ../../c-api/exceptions.rst:112 msgid "" "These functions help you set the current thread's error indicator. For " "convenience, some of these functions will always return a ``NULL`` pointer " "for use in a ``return`` statement." msgstr "" -#: ../../c-api/exceptions.rst:111 +#: ../../c-api/exceptions.rst:119 msgid "" "This is the most common way to set the error indicator. The first argument " "specifies the exception type; it is normally one of the standard exceptions, " @@ -158,13 +167,13 @@ msgid "" "error message; it is decoded from ``'utf-8'``." msgstr "" -#: ../../c-api/exceptions.rst:120 +#: ../../c-api/exceptions.rst:128 msgid "" "This function is similar to :c:func:`PyErr_SetString` but lets you specify " "an arbitrary Python object for the \"value\" of the exception." msgstr "" -#: ../../c-api/exceptions.rst:126 +#: ../../c-api/exceptions.rst:134 msgid "" "This function sets the error indicator and returns ``NULL``. *exception* " "should be a Python exception class. The *format* and subsequent parameters " @@ -172,31 +181,31 @@ msgid "" "c:func:`PyUnicode_FromFormat`. *format* is an ASCII-encoded string." msgstr "" -#: ../../c-api/exceptions.rst:135 +#: ../../c-api/exceptions.rst:143 msgid "" "Same as :c:func:`PyErr_Format`, but taking a :c:type:`va_list` argument " "rather than a variable number of arguments." msgstr "" -#: ../../c-api/exceptions.rst:143 +#: ../../c-api/exceptions.rst:151 msgid "This is a shorthand for ``PyErr_SetObject(type, Py_None)``." msgstr "" -#: ../../c-api/exceptions.rst:148 +#: ../../c-api/exceptions.rst:156 msgid "" "This is a shorthand for ``PyErr_SetString(PyExc_TypeError, message)``, where " "*message* indicates that a built-in operation was invoked with an illegal " "argument. It is mostly for internal use." msgstr "" -#: ../../c-api/exceptions.rst:155 +#: ../../c-api/exceptions.rst:163 msgid "" "This is a shorthand for ``PyErr_SetNone(PyExc_MemoryError)``; it returns " "``NULL`` so an object allocation function can write ``return " "PyErr_NoMemory();`` when it runs out of memory." msgstr "" -#: ../../c-api/exceptions.rst:164 +#: ../../c-api/exceptions.rst:172 msgid "" "This is a convenience function to raise an exception when a C library " "function has returned an error and set the C variable :c:data:`errno`. It " @@ -210,7 +219,7 @@ msgid "" "``return PyErr_SetFromErrno(type);`` when the system call returns an error." msgstr "" -#: ../../c-api/exceptions.rst:178 +#: ../../c-api/exceptions.rst:186 msgid "" "Similar to :c:func:`PyErr_SetFromErrno`, with the additional behavior that " "if *filenameObject* is not ``NULL``, it is passed to the constructor of " @@ -218,21 +227,21 @@ msgid "" "is used to define the :attr:`!filename` attribute of the exception instance." msgstr "" -#: ../../c-api/exceptions.rst:187 +#: ../../c-api/exceptions.rst:195 msgid "" "Similar to :c:func:`PyErr_SetFromErrnoWithFilenameObject`, but takes a " "second filename object, for raising errors when a function that takes two " "filenames fails." msgstr "" -#: ../../c-api/exceptions.rst:196 +#: ../../c-api/exceptions.rst:204 msgid "" "Similar to :c:func:`PyErr_SetFromErrnoWithFilenameObject`, but the filename " "is given as a C string. *filename* is decoded from the :term:`filesystem " "encoding and error handler`." msgstr "" -#: ../../c-api/exceptions.rst:203 +#: ../../c-api/exceptions.rst:211 msgid "" "This is a convenience function to raise :exc:`WindowsError`. If called with " "*ierr* of ``0``, the error code returned by a call to :c:func:`!" @@ -245,19 +254,19 @@ msgid "" "returns ``NULL``." msgstr "" -#: ../../c-api/exceptions.rst:212 ../../c-api/exceptions.rst:220 -#: ../../c-api/exceptions.rst:231 ../../c-api/exceptions.rst:241 -#: ../../c-api/exceptions.rst:249 ../../c-api/exceptions.rst:259 +#: ../../c-api/exceptions.rst:220 ../../c-api/exceptions.rst:228 +#: ../../c-api/exceptions.rst:239 ../../c-api/exceptions.rst:249 +#: ../../c-api/exceptions.rst:257 ../../c-api/exceptions.rst:267 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" -#: ../../c-api/exceptions.rst:217 +#: ../../c-api/exceptions.rst:225 msgid "" "Similar to :c:func:`PyErr_SetFromWindowsErr`, with an additional parameter " "specifying the exception type to be raised." msgstr "" -#: ../../c-api/exceptions.rst:225 +#: ../../c-api/exceptions.rst:233 msgid "" "Similar to :c:func:`PyErr_SetFromWindowsErr`, with the additional behavior " "that if *filename* is not ``NULL``, it is decoded from the filesystem " @@ -266,7 +275,7 @@ msgid "" "attribute of the exception instance." msgstr "" -#: ../../c-api/exceptions.rst:236 +#: ../../c-api/exceptions.rst:244 msgid "" "Similar to :c:func:`PyErr_SetExcFromWindowsErr`, with the additional " "behavior that if *filename* is not ``NULL``, it is passed to the constructor " @@ -274,19 +283,19 @@ msgid "" "filename` attribute of the exception instance." msgstr "" -#: ../../c-api/exceptions.rst:246 +#: ../../c-api/exceptions.rst:254 msgid "" "Similar to :c:func:`PyErr_SetExcFromWindowsErrWithFilenameObject`, but " "accepts a second filename object." msgstr "" -#: ../../c-api/exceptions.rst:256 +#: ../../c-api/exceptions.rst:264 msgid "" "Similar to :c:func:`PyErr_SetFromWindowsErrWithFilename`, with an additional " "parameter specifying the exception type to be raised." msgstr "" -#: ../../c-api/exceptions.rst:264 +#: ../../c-api/exceptions.rst:272 msgid "" "This is a convenience function to raise :exc:`ImportError`. *msg* will be " "set as the exception's message string. *name* and *path*, both of which can " @@ -294,13 +303,13 @@ msgid "" "``path`` attributes." msgstr "" -#: ../../c-api/exceptions.rst:274 +#: ../../c-api/exceptions.rst:282 msgid "" "Much like :c:func:`PyErr_SetImportError` but this function allows for " "specifying a subclass of :exc:`ImportError` to raise." msgstr "" -#: ../../c-api/exceptions.rst:282 +#: ../../c-api/exceptions.rst:290 msgid "" "Set file, line, and offset information for the current exception. If the " "current exception is not a :exc:`SyntaxError`, then it sets additional " @@ -308,19 +317,19 @@ msgid "" "is a :exc:`SyntaxError`." msgstr "" -#: ../../c-api/exceptions.rst:292 +#: ../../c-api/exceptions.rst:300 msgid "" "Like :c:func:`PyErr_SyntaxLocationObject`, but *filename* is a byte string " "decoded from the :term:`filesystem encoding and error handler`." msgstr "" -#: ../../c-api/exceptions.rst:300 +#: ../../c-api/exceptions.rst:308 msgid "" "Like :c:func:`PyErr_SyntaxLocationEx`, but the *col_offset* parameter is " "omitted." msgstr "" -#: ../../c-api/exceptions.rst:306 +#: ../../c-api/exceptions.rst:314 msgid "" "This is a shorthand for ``PyErr_SetString(PyExc_SystemError, message)``, " "where *message* indicates that an internal operation (e.g. a Python/C API " @@ -328,11 +337,11 @@ msgid "" "use." msgstr "" -#: ../../c-api/exceptions.rst:313 +#: ../../c-api/exceptions.rst:321 msgid "Issuing warnings" msgstr "" -#: ../../c-api/exceptions.rst:315 +#: ../../c-api/exceptions.rst:323 msgid "" "Use these functions to issue warnings from C code. They mirror similar " "functions exported by the Python :mod:`warnings` module. They normally " @@ -348,7 +357,7 @@ msgid "" "return an error value)." msgstr "" -#: ../../c-api/exceptions.rst:330 +#: ../../c-api/exceptions.rst:338 msgid "" "Issue a warning message. The *category* argument is a warning category (see " "below) or ``NULL``; the *message* argument is a UTF-8 encoded string. " @@ -358,7 +367,7 @@ msgid "" "`PyErr_WarnEx`, 2 is the function above that, and so forth." msgstr "" -#: ../../c-api/exceptions.rst:337 +#: ../../c-api/exceptions.rst:345 msgid "" "Warning categories must be subclasses of :c:data:`PyExc_Warning`; :c:data:" "`PyExc_Warning` is a subclass of :c:data:`PyExc_Exception`; the default " @@ -367,14 +376,14 @@ msgid "" "enumerated at :ref:`standardwarningcategories`." msgstr "" -#: ../../c-api/exceptions.rst:343 +#: ../../c-api/exceptions.rst:351 msgid "" "For information about warning control, see the documentation for the :mod:" "`warnings` module and the :option:`-W` option in the command line " "documentation. There is no C API for warning control." msgstr "" -#: ../../c-api/exceptions.rst:350 +#: ../../c-api/exceptions.rst:358 msgid "" "Issue a warning message with explicit control over all warning attributes. " "This is a straightforward wrapper around the Python function :func:`warnings." @@ -382,31 +391,31 @@ msgid "" "arguments may be set to ``NULL`` to get the default effect described there." msgstr "" -#: ../../c-api/exceptions.rst:361 +#: ../../c-api/exceptions.rst:369 msgid "" "Similar to :c:func:`PyErr_WarnExplicitObject` except that *message* and " "*module* are UTF-8 encoded strings, and *filename* is decoded from the :term:" "`filesystem encoding and error handler`." msgstr "" -#: ../../c-api/exceptions.rst:368 +#: ../../c-api/exceptions.rst:376 msgid "" "Function similar to :c:func:`PyErr_WarnEx`, but use :c:func:" "`PyUnicode_FromFormat` to format the warning message. *format* is an ASCII-" "encoded string." msgstr "" -#: ../../c-api/exceptions.rst:377 +#: ../../c-api/exceptions.rst:385 msgid "" "Function similar to :c:func:`PyErr_WarnFormat`, but *category* is :exc:" "`ResourceWarning` and it passes *source* to :func:`warnings.WarningMessage`." msgstr "" -#: ../../c-api/exceptions.rst:384 +#: ../../c-api/exceptions.rst:392 msgid "Querying the error indicator" msgstr "" -#: ../../c-api/exceptions.rst:388 +#: ../../c-api/exceptions.rst:396 msgid "" "Test whether the error indicator is set. If set, return the exception " "*type* (the first argument to the last call to one of the ``PyErr_Set*`` " @@ -415,11 +424,11 @@ msgid "" "`Py_DECREF` it." msgstr "" -#: ../../c-api/exceptions.rst:394 +#: ../../c-api/exceptions.rst:402 msgid "The caller must hold the GIL." msgstr "" -#: ../../c-api/exceptions.rst:398 +#: ../../c-api/exceptions.rst:406 msgid "" "Do not compare the return value to a specific exception; use :c:func:" "`PyErr_ExceptionMatches` instead, shown below. (The comparison could easily " @@ -427,14 +436,14 @@ msgid "" "of a class exception, or it may be a subclass of the expected exception.)" msgstr "" -#: ../../c-api/exceptions.rst:406 +#: ../../c-api/exceptions.rst:414 msgid "" "Equivalent to ``PyErr_GivenExceptionMatches(PyErr_Occurred(), exc)``. This " "should only be called when an exception is actually set; a memory access " "violation will occur if no exception has been raised." msgstr "" -#: ../../c-api/exceptions.rst:413 +#: ../../c-api/exceptions.rst:421 msgid "" "Return true if the *given* exception matches the exception type in *exc*. " "If *exc* is a class object, this also returns true when *given* is an " @@ -442,43 +451,43 @@ msgid "" "tuple (and recursively in subtuples) are searched for a match." msgstr "" -#: ../../c-api/exceptions.rst:421 +#: ../../c-api/exceptions.rst:429 msgid "" "Return the exception currently being raised, clearing the error indicator at " "the same time." msgstr "" -#: ../../c-api/exceptions.rst:424 +#: ../../c-api/exceptions.rst:432 msgid "" "This function is used by code that needs to catch exceptions, or code that " "needs to save and restore the error indicator temporarily." msgstr "" -#: ../../c-api/exceptions.rst:427 ../../c-api/exceptions.rst:471 +#: ../../c-api/exceptions.rst:435 ../../c-api/exceptions.rst:479 msgid "For example::" msgstr "" -#: ../../c-api/exceptions.rst:437 +#: ../../c-api/exceptions.rst:445 msgid "" ":c:func:`PyErr_GetHandledException`, to save the exception currently being " "handled." msgstr "" -#: ../../c-api/exceptions.rst:445 +#: ../../c-api/exceptions.rst:453 msgid "" "Set *exc* as the exception currently being raised, clearing the existing " "exception if one is set." msgstr "" -#: ../../c-api/exceptions.rst:450 +#: ../../c-api/exceptions.rst:458 msgid "This call steals a reference to *exc*, which must be a valid exception." msgstr "" -#: ../../c-api/exceptions.rst:459 +#: ../../c-api/exceptions.rst:467 msgid "Use :c:func:`PyErr_GetRaisedException` instead." msgstr "" -#: ../../c-api/exceptions.rst:461 +#: ../../c-api/exceptions.rst:469 msgid "" "Retrieve the error indicator into three variables whose addresses are " "passed. If the error indicator is not set, set all three variables to " @@ -487,17 +496,17 @@ msgid "" "the type object is not." msgstr "" -#: ../../c-api/exceptions.rst:468 +#: ../../c-api/exceptions.rst:476 msgid "" "This function is normally only used by legacy code that needs to catch " "exceptions or save and restore the error indicator temporarily." msgstr "" -#: ../../c-api/exceptions.rst:487 +#: ../../c-api/exceptions.rst:495 msgid "Use :c:func:`PyErr_SetRaisedException` instead." msgstr "" -#: ../../c-api/exceptions.rst:489 +#: ../../c-api/exceptions.rst:497 msgid "" "Set the error indicator from the three objects, *type*, *value*, and " "*traceback*, clearing the existing exception if one is set. If the objects " @@ -510,20 +519,20 @@ msgid "" "don't use this function. I warned you.)" msgstr "" -#: ../../c-api/exceptions.rst:503 +#: ../../c-api/exceptions.rst:511 msgid "" "This function is normally only used by legacy code that needs to save and " "restore the error indicator temporarily. Use :c:func:`PyErr_Fetch` to save " "the current error indicator." msgstr "" -#: ../../c-api/exceptions.rst:512 +#: ../../c-api/exceptions.rst:520 msgid "" "Use :c:func:`PyErr_GetRaisedException` instead, to avoid any possible de-" "normalization." msgstr "" -#: ../../c-api/exceptions.rst:515 +#: ../../c-api/exceptions.rst:523 msgid "" "Under certain circumstances, the values returned by :c:func:`PyErr_Fetch` " "below can be \"unnormalized\", meaning that ``*exc`` is a class object but " @@ -533,14 +542,14 @@ msgid "" "improve performance." msgstr "" -#: ../../c-api/exceptions.rst:523 +#: ../../c-api/exceptions.rst:531 msgid "" "This function *does not* implicitly set the ``__traceback__`` attribute on " "the exception value. If setting the traceback appropriately is desired, the " "following additional snippet is needed::" msgstr "" -#: ../../c-api/exceptions.rst:534 +#: ../../c-api/exceptions.rst:542 msgid "" "Retrieve the active exception instance, as would be returned by :func:`sys." "exception`. This refers to an exception that was *already caught*, not to an " @@ -548,7 +557,7 @@ msgid "" "or ``NULL``. Does not modify the interpreter's exception state." msgstr "" -#: ../../c-api/exceptions.rst:541 +#: ../../c-api/exceptions.rst:549 msgid "" "This function is not normally used by code that wants to handle exceptions. " "Rather, it can be used when code needs to save and restore the exception " @@ -556,14 +565,14 @@ msgid "" "clear the exception state." msgstr "" -#: ../../c-api/exceptions.rst:550 +#: ../../c-api/exceptions.rst:558 msgid "" "Set the active exception, as known from ``sys.exception()``. This refers to " "an exception that was *already caught*, not to an exception that was freshly " "raised. To clear the exception state, pass ``NULL``." msgstr "" -#: ../../c-api/exceptions.rst:557 +#: ../../c-api/exceptions.rst:565 msgid "" "This function is not normally used by code that wants to handle exceptions. " "Rather, it can be used when code needs to save and restore the exception " @@ -571,7 +580,7 @@ msgid "" "exception state." msgstr "" -#: ../../c-api/exceptions.rst:566 +#: ../../c-api/exceptions.rst:574 msgid "" "Retrieve the old-style representation of the exception info, as known from :" "func:`sys.exc_info`. This refers to an exception that was *already caught*, " @@ -581,7 +590,7 @@ msgid "" "using :c:func:`PyErr_GetHandledException`." msgstr "" -#: ../../c-api/exceptions.rst:575 +#: ../../c-api/exceptions.rst:583 msgid "" "This function is not normally used by code that wants to handle exceptions. " "Rather, it can be used when code needs to save and restore the exception " @@ -589,7 +598,7 @@ msgid "" "exception state." msgstr "" -#: ../../c-api/exceptions.rst:585 +#: ../../c-api/exceptions.rst:593 msgid "" "Set the exception info, as known from ``sys.exc_info()``. This refers to an " "exception that was *already caught*, not to an exception that was freshly " @@ -599,7 +608,7 @@ msgid "" "`PyErr_SetHandledException`." msgstr "" -#: ../../c-api/exceptions.rst:594 +#: ../../c-api/exceptions.rst:602 msgid "" "This function is not normally used by code that wants to handle exceptions. " "Rather, it can be used when code needs to save and restore the exception " @@ -607,22 +616,22 @@ msgid "" "state." msgstr "" -#: ../../c-api/exceptions.rst:601 +#: ../../c-api/exceptions.rst:609 msgid "" "The ``type`` and ``traceback`` arguments are no longer used and can be NULL. " "The interpreter now derives them from the exception instance (the ``value`` " "argument). The function still steals references of all three arguments." msgstr "" -#: ../../c-api/exceptions.rst:609 +#: ../../c-api/exceptions.rst:617 msgid "Signal Handling" msgstr "" -#: ../../c-api/exceptions.rst:619 +#: ../../c-api/exceptions.rst:627 msgid "This function interacts with Python's signal handling." msgstr "" -#: ../../c-api/exceptions.rst:621 +#: ../../c-api/exceptions.rst:629 msgid "" "If the function is called from the main thread and under the main Python " "interpreter, it checks whether a signal has been sent to the processes and " @@ -630,7 +639,7 @@ msgid "" "module is supported, this can invoke a signal handler written in Python." msgstr "" -#: ../../c-api/exceptions.rst:626 +#: ../../c-api/exceptions.rst:634 msgid "" "The function attempts to handle all pending signals, and then returns ``0``. " "However, if a Python signal handler raises an exception, the error indicator " @@ -639,44 +648,44 @@ msgid "" "`PyErr_CheckSignals()` invocation)." msgstr "" -#: ../../c-api/exceptions.rst:632 +#: ../../c-api/exceptions.rst:640 msgid "" "If the function is called from a non-main thread, or under a non-main Python " "interpreter, it does nothing and returns ``0``." msgstr "" -#: ../../c-api/exceptions.rst:635 +#: ../../c-api/exceptions.rst:643 msgid "" "This function can be called by long-running C code that wants to be " "interruptible by user requests (such as by pressing Ctrl-C)." msgstr "" -#: ../../c-api/exceptions.rst:639 +#: ../../c-api/exceptions.rst:647 msgid "" "The default Python signal handler for :c:macro:`!SIGINT` raises the :exc:" "`KeyboardInterrupt` exception." msgstr "" -#: ../../c-api/exceptions.rst:650 +#: ../../c-api/exceptions.rst:658 msgid "" "Simulate the effect of a :c:macro:`!SIGINT` signal arriving. This is " "equivalent to ``PyErr_SetInterruptEx(SIGINT)``." msgstr "" -#: ../../c-api/exceptions.rst:654 ../../c-api/exceptions.rst:681 +#: ../../c-api/exceptions.rst:662 ../../c-api/exceptions.rst:689 msgid "" "This function is async-signal-safe. It can be called without the :term:" "`GIL` and from a C signal handler." msgstr "" -#: ../../c-api/exceptions.rst:664 +#: ../../c-api/exceptions.rst:672 msgid "" "Simulate the effect of a signal arriving. The next time :c:func:" "`PyErr_CheckSignals` is called, the Python signal handler for the given " "signal number will be called." msgstr "" -#: ../../c-api/exceptions.rst:668 +#: ../../c-api/exceptions.rst:676 msgid "" "This function can be called by C code that sets up its own signal handling " "and wants Python signal handlers to be invoked as expected when an " @@ -684,27 +693,27 @@ msgid "" "interrupt an operation)." msgstr "" -#: ../../c-api/exceptions.rst:673 +#: ../../c-api/exceptions.rst:681 msgid "" "If the given signal isn't handled by Python (it was set to :py:const:`signal." "SIG_DFL` or :py:const:`signal.SIG_IGN`), it will be ignored." msgstr "" -#: ../../c-api/exceptions.rst:676 +#: ../../c-api/exceptions.rst:684 msgid "" "If *signum* is outside of the allowed range of signal numbers, ``-1`` is " "returned. Otherwise, ``0`` is returned. The error indicator is never " "changed by this function." msgstr "" -#: ../../c-api/exceptions.rst:689 +#: ../../c-api/exceptions.rst:697 msgid "" "This utility function specifies a file descriptor to which the signal number " "is written as a single byte whenever a signal is received. *fd* must be non-" "blocking. It returns the previous such file descriptor." msgstr "" -#: ../../c-api/exceptions.rst:693 +#: ../../c-api/exceptions.rst:701 msgid "" "The value ``-1`` disables the feature; this is the initial state. This is " "equivalent to :func:`signal.set_wakeup_fd` in Python, but without any error " @@ -712,15 +721,15 @@ msgid "" "be called from the main thread." msgstr "" -#: ../../c-api/exceptions.rst:698 +#: ../../c-api/exceptions.rst:706 msgid "On Windows, the function now also supports socket handles." msgstr "" -#: ../../c-api/exceptions.rst:703 +#: ../../c-api/exceptions.rst:711 msgid "Exception Classes" msgstr "例外類別" -#: ../../c-api/exceptions.rst:707 +#: ../../c-api/exceptions.rst:715 msgid "" "This utility function creates and returns a new exception class. The *name* " "argument must be the name of the new exception, a C string of the form " @@ -729,7 +738,7 @@ msgid "" "(accessible in C as :c:data:`PyExc_Exception`)." msgstr "" -#: ../../c-api/exceptions.rst:713 +#: ../../c-api/exceptions.rst:721 msgid "" "The :attr:`__module__` attribute of the new class is set to the first part " "(up to the last dot) of the *name* argument, and the class name is set to " @@ -739,31 +748,31 @@ msgid "" "variables and methods." msgstr "" -#: ../../c-api/exceptions.rst:722 +#: ../../c-api/exceptions.rst:730 msgid "" "Same as :c:func:`PyErr_NewException`, except that the new exception class " "can easily be given a docstring: If *doc* is non-``NULL``, it will be used " "as the docstring for the exception class." msgstr "" -#: ../../c-api/exceptions.rst:730 +#: ../../c-api/exceptions.rst:738 msgid "Exception Objects" msgstr "例外物件" -#: ../../c-api/exceptions.rst:734 +#: ../../c-api/exceptions.rst:742 msgid "" "Return the traceback associated with the exception as a new reference, as " "accessible from Python through :attr:`__traceback__`. If there is no " "traceback associated, this returns ``NULL``." msgstr "" -#: ../../c-api/exceptions.rst:741 +#: ../../c-api/exceptions.rst:749 msgid "" "Set the traceback associated with the exception to *tb*. Use ``Py_None`` to " "clear it." msgstr "" -#: ../../c-api/exceptions.rst:747 +#: ../../c-api/exceptions.rst:755 msgid "" "Return the context (another exception instance during whose handling *ex* " "was raised) associated with the exception as a new reference, as accessible " @@ -771,41 +780,41 @@ msgid "" "this returns ``NULL``." msgstr "" -#: ../../c-api/exceptions.rst:755 +#: ../../c-api/exceptions.rst:763 msgid "" "Set the context associated with the exception to *ctx*. Use ``NULL`` to " "clear it. There is no type check to make sure that *ctx* is an exception " "instance. This steals a reference to *ctx*." msgstr "" -#: ../../c-api/exceptions.rst:762 +#: ../../c-api/exceptions.rst:770 msgid "" "Return the cause (either an exception instance, or ``None``, set by " "``raise ... from ...``) associated with the exception as a new reference, as " "accessible from Python through :attr:`__cause__`." msgstr "" -#: ../../c-api/exceptions.rst:769 +#: ../../c-api/exceptions.rst:777 msgid "" "Set the cause associated with the exception to *cause*. Use ``NULL`` to " "clear it. There is no type check to make sure that *cause* is either an " "exception instance or ``None``. This steals a reference to *cause*." msgstr "" -#: ../../c-api/exceptions.rst:773 +#: ../../c-api/exceptions.rst:781 msgid "" ":attr:`__suppress_context__` is implicitly set to ``True`` by this function." msgstr "" -#: ../../c-api/exceptions.rst:778 +#: ../../c-api/exceptions.rst:786 msgid "Return :attr:`~BaseException.args` of exception *ex*." msgstr "" -#: ../../c-api/exceptions.rst:783 +#: ../../c-api/exceptions.rst:791 msgid "Set :attr:`~BaseException.args` of exception *ex* to *args*." msgstr "" -#: ../../c-api/exceptions.rst:787 +#: ../../c-api/exceptions.rst:795 msgid "" "Implement part of the interpreter's implementation of :keyword:`!except*`. " "*orig* is the original exception that was caught, and *excs* is the list of " @@ -817,72 +826,72 @@ msgid "" "if there is nothing to reraise." msgstr "" -#: ../../c-api/exceptions.rst:801 +#: ../../c-api/exceptions.rst:809 msgid "Unicode Exception Objects" msgstr "" -#: ../../c-api/exceptions.rst:803 +#: ../../c-api/exceptions.rst:811 msgid "" "The following functions are used to create and modify Unicode exceptions " "from C." msgstr "" -#: ../../c-api/exceptions.rst:807 +#: ../../c-api/exceptions.rst:815 msgid "" "Create a :class:`UnicodeDecodeError` object with the attributes *encoding*, " "*object*, *length*, *start*, *end* and *reason*. *encoding* and *reason* are " "UTF-8 encoded strings." msgstr "" -#: ../../c-api/exceptions.rst:814 +#: ../../c-api/exceptions.rst:822 msgid "Return the *encoding* attribute of the given exception object." msgstr "" -#: ../../c-api/exceptions.rst:820 +#: ../../c-api/exceptions.rst:828 msgid "Return the *object* attribute of the given exception object." msgstr "" -#: ../../c-api/exceptions.rst:826 +#: ../../c-api/exceptions.rst:834 msgid "" "Get the *start* attribute of the given exception object and place it into " "*\\*start*. *start* must not be ``NULL``. Return ``0`` on success, ``-1`` " "on failure." msgstr "" -#: ../../c-api/exceptions.rst:834 +#: ../../c-api/exceptions.rst:842 msgid "" "Set the *start* attribute of the given exception object to *start*. Return " "``0`` on success, ``-1`` on failure." msgstr "" -#: ../../c-api/exceptions.rst:841 +#: ../../c-api/exceptions.rst:849 msgid "" "Get the *end* attribute of the given exception object and place it into " "*\\*end*. *end* must not be ``NULL``. Return ``0`` on success, ``-1`` on " "failure." msgstr "" -#: ../../c-api/exceptions.rst:849 +#: ../../c-api/exceptions.rst:857 msgid "" "Set the *end* attribute of the given exception object to *end*. Return " "``0`` on success, ``-1`` on failure." msgstr "" -#: ../../c-api/exceptions.rst:856 +#: ../../c-api/exceptions.rst:864 msgid "Return the *reason* attribute of the given exception object." msgstr "" -#: ../../c-api/exceptions.rst:862 +#: ../../c-api/exceptions.rst:870 msgid "" "Set the *reason* attribute of the given exception object to *reason*. " "Return ``0`` on success, ``-1`` on failure." msgstr "" -#: ../../c-api/exceptions.rst:869 +#: ../../c-api/exceptions.rst:877 msgid "Recursion Control" msgstr "" -#: ../../c-api/exceptions.rst:871 +#: ../../c-api/exceptions.rst:879 msgid "" "These two functions provide a way to perform safe recursive calls at the C " "level, both in the core and in extension modules. They are needed if the " @@ -892,44 +901,44 @@ msgid "" "recursion handling." msgstr "" -#: ../../c-api/exceptions.rst:880 +#: ../../c-api/exceptions.rst:888 msgid "Marks a point where a recursive C-level call is about to be performed." msgstr "" -#: ../../c-api/exceptions.rst:882 +#: ../../c-api/exceptions.rst:890 msgid "" "If :c:macro:`USE_STACKCHECK` is defined, this function checks if the OS " "stack overflowed using :c:func:`PyOS_CheckStack`. In this is the case, it " "sets a :exc:`MemoryError` and returns a nonzero value." msgstr "" -#: ../../c-api/exceptions.rst:886 +#: ../../c-api/exceptions.rst:894 msgid "" "The function then checks if the recursion limit is reached. If this is the " "case, a :exc:`RecursionError` is set and a nonzero value is returned. " "Otherwise, zero is returned." msgstr "" -#: ../../c-api/exceptions.rst:890 +#: ../../c-api/exceptions.rst:898 msgid "" "*where* should be a UTF-8 encoded string such as ``\" in instance check\"`` " "to be concatenated to the :exc:`RecursionError` message caused by the " "recursion depth limit." msgstr "" -#: ../../c-api/exceptions.rst:894 ../../c-api/exceptions.rst:902 +#: ../../c-api/exceptions.rst:902 ../../c-api/exceptions.rst:910 msgid "" "This function is now also available in the :ref:`limited API `." msgstr "" -#: ../../c-api/exceptions.rst:899 +#: ../../c-api/exceptions.rst:907 msgid "" "Ends a :c:func:`Py_EnterRecursiveCall`. Must be called once for each " "*successful* invocation of :c:func:`Py_EnterRecursiveCall`." msgstr "" -#: ../../c-api/exceptions.rst:905 +#: ../../c-api/exceptions.rst:913 msgid "" "Properly implementing :c:member:`~PyTypeObject.tp_repr` for container types " "requires special recursion handling. In addition to protecting the stack, :" @@ -938,13 +947,13 @@ msgid "" "Effectively, these are the C equivalent to :func:`reprlib.recursive_repr`." msgstr "" -#: ../../c-api/exceptions.rst:913 +#: ../../c-api/exceptions.rst:921 msgid "" "Called at the beginning of the :c:member:`~PyTypeObject.tp_repr` " "implementation to detect cycles." msgstr "" -#: ../../c-api/exceptions.rst:916 +#: ../../c-api/exceptions.rst:924 msgid "" "If the object has already been processed, the function returns a positive " "integer. In that case the :c:member:`~PyTypeObject.tp_repr` implementation " @@ -952,30 +961,30 @@ msgid "" "`dict` objects return ``{...}`` and :class:`list` objects return ``[...]``." msgstr "" -#: ../../c-api/exceptions.rst:922 +#: ../../c-api/exceptions.rst:930 msgid "" "The function will return a negative integer if the recursion limit is " "reached. In that case the :c:member:`~PyTypeObject.tp_repr` implementation " "should typically return ``NULL``." msgstr "" -#: ../../c-api/exceptions.rst:926 +#: ../../c-api/exceptions.rst:934 msgid "" "Otherwise, the function returns zero and the :c:member:`~PyTypeObject." "tp_repr` implementation can continue normally." msgstr "" -#: ../../c-api/exceptions.rst:931 +#: ../../c-api/exceptions.rst:939 msgid "" "Ends a :c:func:`Py_ReprEnter`. Must be called once for each invocation of :" "c:func:`Py_ReprEnter` that returns zero." msgstr "" -#: ../../c-api/exceptions.rst:938 +#: ../../c-api/exceptions.rst:946 msgid "Standard Exceptions" msgstr "" -#: ../../c-api/exceptions.rst:940 +#: ../../c-api/exceptions.rst:948 msgid "" "All standard Python exceptions are available as global variables whose names " "are ``PyExc_`` followed by the Python exception name. These have the type :" @@ -983,451 +992,451 @@ msgid "" "all the variables:" msgstr "" -#: ../../c-api/exceptions.rst:1001 ../../c-api/exceptions.rst:1134 -#: ../../c-api/exceptions.rst:1179 +#: ../../c-api/exceptions.rst:1009 ../../c-api/exceptions.rst:1142 +#: ../../c-api/exceptions.rst:1187 msgid "C Name" msgstr "" -#: ../../c-api/exceptions.rst:1001 ../../c-api/exceptions.rst:1179 +#: ../../c-api/exceptions.rst:1009 ../../c-api/exceptions.rst:1187 msgid "Python Name" msgstr "" -#: ../../c-api/exceptions.rst:1001 ../../c-api/exceptions.rst:1134 -#: ../../c-api/exceptions.rst:1179 +#: ../../c-api/exceptions.rst:1009 ../../c-api/exceptions.rst:1142 +#: ../../c-api/exceptions.rst:1187 msgid "Notes" msgstr "註解" -#: ../../c-api/exceptions.rst:1003 +#: ../../c-api/exceptions.rst:1011 msgid ":c:data:`PyExc_BaseException`" msgstr ":c:data:`PyExc_BaseException`" -#: ../../c-api/exceptions.rst:1003 +#: ../../c-api/exceptions.rst:1011 msgid ":exc:`BaseException`" msgstr ":exc:`BaseException`" -#: ../../c-api/exceptions.rst:1003 ../../c-api/exceptions.rst:1005 -#: ../../c-api/exceptions.rst:1007 ../../c-api/exceptions.rst:1053 -#: ../../c-api/exceptions.rst:1065 +#: ../../c-api/exceptions.rst:1011 ../../c-api/exceptions.rst:1013 +#: ../../c-api/exceptions.rst:1015 ../../c-api/exceptions.rst:1061 +#: ../../c-api/exceptions.rst:1073 msgid "[1]_" msgstr "[1]_" -#: ../../c-api/exceptions.rst:1005 +#: ../../c-api/exceptions.rst:1013 msgid ":c:data:`PyExc_Exception`" msgstr ":c:data:`PyExc_Exception`" -#: ../../c-api/exceptions.rst:1005 +#: ../../c-api/exceptions.rst:1013 msgid ":exc:`Exception`" msgstr ":exc:`Exception`" -#: ../../c-api/exceptions.rst:1007 +#: ../../c-api/exceptions.rst:1015 msgid ":c:data:`PyExc_ArithmeticError`" msgstr ":c:data:`PyExc_ArithmeticError`" -#: ../../c-api/exceptions.rst:1007 +#: ../../c-api/exceptions.rst:1015 msgid ":exc:`ArithmeticError`" msgstr ":exc:`ArithmeticError`" -#: ../../c-api/exceptions.rst:1009 +#: ../../c-api/exceptions.rst:1017 msgid ":c:data:`PyExc_AssertionError`" msgstr ":c:data:`PyExc_AssertionError`" -#: ../../c-api/exceptions.rst:1009 +#: ../../c-api/exceptions.rst:1017 msgid ":exc:`AssertionError`" msgstr ":exc:`AssertionError`" -#: ../../c-api/exceptions.rst:1011 +#: ../../c-api/exceptions.rst:1019 msgid ":c:data:`PyExc_AttributeError`" msgstr ":c:data:`PyExc_AttributeError`" -#: ../../c-api/exceptions.rst:1011 +#: ../../c-api/exceptions.rst:1019 msgid ":exc:`AttributeError`" msgstr ":exc:`AttributeError`" -#: ../../c-api/exceptions.rst:1013 +#: ../../c-api/exceptions.rst:1021 msgid ":c:data:`PyExc_BlockingIOError`" msgstr ":c:data:`PyExc_BlockingIOError`" -#: ../../c-api/exceptions.rst:1013 +#: ../../c-api/exceptions.rst:1021 msgid ":exc:`BlockingIOError`" msgstr ":exc:`BlockingIOError`" -#: ../../c-api/exceptions.rst:1015 +#: ../../c-api/exceptions.rst:1023 msgid ":c:data:`PyExc_BrokenPipeError`" msgstr ":c:data:`PyExc_BrokenPipeError`" -#: ../../c-api/exceptions.rst:1015 +#: ../../c-api/exceptions.rst:1023 msgid ":exc:`BrokenPipeError`" msgstr ":exc:`BrokenPipeError`" -#: ../../c-api/exceptions.rst:1017 +#: ../../c-api/exceptions.rst:1025 msgid ":c:data:`PyExc_BufferError`" msgstr ":c:data:`PyExc_BufferError`" -#: ../../c-api/exceptions.rst:1017 +#: ../../c-api/exceptions.rst:1025 msgid ":exc:`BufferError`" msgstr ":exc:`BufferError`" -#: ../../c-api/exceptions.rst:1019 +#: ../../c-api/exceptions.rst:1027 msgid ":c:data:`PyExc_ChildProcessError`" msgstr ":c:data:`PyExc_ChildProcessError`" -#: ../../c-api/exceptions.rst:1019 +#: ../../c-api/exceptions.rst:1027 msgid ":exc:`ChildProcessError`" msgstr ":exc:`ChildProcessError`" -#: ../../c-api/exceptions.rst:1021 +#: ../../c-api/exceptions.rst:1029 msgid ":c:data:`PyExc_ConnectionAbortedError`" msgstr ":c:data:`PyExc_ConnectionAbortedError`" -#: ../../c-api/exceptions.rst:1021 +#: ../../c-api/exceptions.rst:1029 msgid ":exc:`ConnectionAbortedError`" msgstr ":exc:`ConnectionAbortedError`" -#: ../../c-api/exceptions.rst:1023 +#: ../../c-api/exceptions.rst:1031 msgid ":c:data:`PyExc_ConnectionError`" msgstr ":c:data:`PyExc_ConnectionError`" -#: ../../c-api/exceptions.rst:1023 +#: ../../c-api/exceptions.rst:1031 msgid ":exc:`ConnectionError`" msgstr ":exc:`ConnectionError`" -#: ../../c-api/exceptions.rst:1025 +#: ../../c-api/exceptions.rst:1033 msgid ":c:data:`PyExc_ConnectionRefusedError`" msgstr ":c:data:`PyExc_ConnectionRefusedError`" -#: ../../c-api/exceptions.rst:1025 +#: ../../c-api/exceptions.rst:1033 msgid ":exc:`ConnectionRefusedError`" msgstr ":exc:`ConnectionRefusedError`" -#: ../../c-api/exceptions.rst:1027 +#: ../../c-api/exceptions.rst:1035 msgid ":c:data:`PyExc_ConnectionResetError`" msgstr ":c:data:`PyExc_ConnectionResetError`" -#: ../../c-api/exceptions.rst:1027 +#: ../../c-api/exceptions.rst:1035 msgid ":exc:`ConnectionResetError`" msgstr ":exc:`ConnectionResetError`" -#: ../../c-api/exceptions.rst:1029 +#: ../../c-api/exceptions.rst:1037 msgid ":c:data:`PyExc_EOFError`" msgstr ":c:data:`PyExc_EOFError`" -#: ../../c-api/exceptions.rst:1029 +#: ../../c-api/exceptions.rst:1037 msgid ":exc:`EOFError`" msgstr ":exc:`EOFError`" -#: ../../c-api/exceptions.rst:1031 +#: ../../c-api/exceptions.rst:1039 msgid ":c:data:`PyExc_FileExistsError`" msgstr ":c:data:`PyExc_FileExistsError`" -#: ../../c-api/exceptions.rst:1031 +#: ../../c-api/exceptions.rst:1039 msgid ":exc:`FileExistsError`" msgstr ":exc:`FileExistsError`" -#: ../../c-api/exceptions.rst:1033 +#: ../../c-api/exceptions.rst:1041 msgid ":c:data:`PyExc_FileNotFoundError`" msgstr ":c:data:`PyExc_FileNotFoundError`" -#: ../../c-api/exceptions.rst:1033 +#: ../../c-api/exceptions.rst:1041 msgid ":exc:`FileNotFoundError`" msgstr ":exc:`FileNotFoundError`" -#: ../../c-api/exceptions.rst:1035 +#: ../../c-api/exceptions.rst:1043 msgid ":c:data:`PyExc_FloatingPointError`" msgstr ":c:data:`PyExc_FloatingPointError`" -#: ../../c-api/exceptions.rst:1035 +#: ../../c-api/exceptions.rst:1043 msgid ":exc:`FloatingPointError`" msgstr ":exc:`FloatingPointError`" -#: ../../c-api/exceptions.rst:1037 +#: ../../c-api/exceptions.rst:1045 msgid ":c:data:`PyExc_GeneratorExit`" msgstr ":c:data:`PyExc_GeneratorExit`" -#: ../../c-api/exceptions.rst:1037 +#: ../../c-api/exceptions.rst:1045 msgid ":exc:`GeneratorExit`" msgstr ":exc:`GeneratorExit`" -#: ../../c-api/exceptions.rst:1039 +#: ../../c-api/exceptions.rst:1047 msgid ":c:data:`PyExc_ImportError`" msgstr ":c:data:`PyExc_ImportError`" -#: ../../c-api/exceptions.rst:1039 +#: ../../c-api/exceptions.rst:1047 msgid ":exc:`ImportError`" msgstr ":exc:`ImportError`" -#: ../../c-api/exceptions.rst:1041 +#: ../../c-api/exceptions.rst:1049 msgid ":c:data:`PyExc_IndentationError`" msgstr ":c:data:`PyExc_IndentationError`" -#: ../../c-api/exceptions.rst:1041 +#: ../../c-api/exceptions.rst:1049 msgid ":exc:`IndentationError`" msgstr ":exc:`IndentationError`" -#: ../../c-api/exceptions.rst:1043 +#: ../../c-api/exceptions.rst:1051 msgid ":c:data:`PyExc_IndexError`" msgstr ":c:data:`PyExc_IndexError`" -#: ../../c-api/exceptions.rst:1043 +#: ../../c-api/exceptions.rst:1051 msgid ":exc:`IndexError`" msgstr ":exc:`IndexError`" -#: ../../c-api/exceptions.rst:1045 +#: ../../c-api/exceptions.rst:1053 msgid ":c:data:`PyExc_InterruptedError`" msgstr ":c:data:`PyExc_InterruptedError`" -#: ../../c-api/exceptions.rst:1045 +#: ../../c-api/exceptions.rst:1053 msgid ":exc:`InterruptedError`" msgstr ":exc:`InterruptedError`" -#: ../../c-api/exceptions.rst:1047 +#: ../../c-api/exceptions.rst:1055 msgid ":c:data:`PyExc_IsADirectoryError`" msgstr ":c:data:`PyExc_IsADirectoryError`" -#: ../../c-api/exceptions.rst:1047 +#: ../../c-api/exceptions.rst:1055 msgid ":exc:`IsADirectoryError`" msgstr ":exc:`IsADirectoryError`" -#: ../../c-api/exceptions.rst:1049 +#: ../../c-api/exceptions.rst:1057 msgid ":c:data:`PyExc_KeyError`" msgstr ":c:data:`PyExc_KeyError`" -#: ../../c-api/exceptions.rst:1049 +#: ../../c-api/exceptions.rst:1057 msgid ":exc:`KeyError`" msgstr ":exc:`KeyError`" -#: ../../c-api/exceptions.rst:1051 +#: ../../c-api/exceptions.rst:1059 msgid ":c:data:`PyExc_KeyboardInterrupt`" msgstr ":c:data:`PyExc_KeyboardInterrupt`" -#: ../../c-api/exceptions.rst:1051 +#: ../../c-api/exceptions.rst:1059 msgid ":exc:`KeyboardInterrupt`" msgstr ":exc:`KeyboardInterrupt`" -#: ../../c-api/exceptions.rst:1053 +#: ../../c-api/exceptions.rst:1061 msgid ":c:data:`PyExc_LookupError`" msgstr ":c:data:`PyExc_LookupError`" -#: ../../c-api/exceptions.rst:1053 +#: ../../c-api/exceptions.rst:1061 msgid ":exc:`LookupError`" msgstr ":exc:`LookupError`" -#: ../../c-api/exceptions.rst:1055 +#: ../../c-api/exceptions.rst:1063 msgid ":c:data:`PyExc_MemoryError`" msgstr ":c:data:`PyExc_MemoryError`" -#: ../../c-api/exceptions.rst:1055 +#: ../../c-api/exceptions.rst:1063 msgid ":exc:`MemoryError`" msgstr ":exc:`MemoryError`" -#: ../../c-api/exceptions.rst:1057 +#: ../../c-api/exceptions.rst:1065 msgid ":c:data:`PyExc_ModuleNotFoundError`" msgstr ":c:data:`PyExc_ModuleNotFoundError`" -#: ../../c-api/exceptions.rst:1057 +#: ../../c-api/exceptions.rst:1065 msgid ":exc:`ModuleNotFoundError`" msgstr ":exc:`ModuleNotFoundError`" -#: ../../c-api/exceptions.rst:1059 +#: ../../c-api/exceptions.rst:1067 msgid ":c:data:`PyExc_NameError`" msgstr ":c:data:`PyExc_NameError`" -#: ../../c-api/exceptions.rst:1059 +#: ../../c-api/exceptions.rst:1067 msgid ":exc:`NameError`" msgstr ":exc:`NameError`" -#: ../../c-api/exceptions.rst:1061 +#: ../../c-api/exceptions.rst:1069 msgid ":c:data:`PyExc_NotADirectoryError`" msgstr ":c:data:`PyExc_NotADirectoryError`" -#: ../../c-api/exceptions.rst:1061 +#: ../../c-api/exceptions.rst:1069 msgid ":exc:`NotADirectoryError`" msgstr ":exc:`NotADirectoryError`" -#: ../../c-api/exceptions.rst:1063 +#: ../../c-api/exceptions.rst:1071 msgid ":c:data:`PyExc_NotImplementedError`" msgstr ":c:data:`PyExc_NotImplementedError`" -#: ../../c-api/exceptions.rst:1063 +#: ../../c-api/exceptions.rst:1071 msgid ":exc:`NotImplementedError`" msgstr ":exc:`NotImplementedError`" -#: ../../c-api/exceptions.rst:1065 +#: ../../c-api/exceptions.rst:1073 msgid ":c:data:`PyExc_OSError`" msgstr ":c:data:`PyExc_OSError`" -#: ../../c-api/exceptions.rst:1065 +#: ../../c-api/exceptions.rst:1073 msgid ":exc:`OSError`" msgstr ":exc:`OSError`" -#: ../../c-api/exceptions.rst:1067 +#: ../../c-api/exceptions.rst:1075 msgid ":c:data:`PyExc_OverflowError`" msgstr ":c:data:`PyExc_OverflowError`" -#: ../../c-api/exceptions.rst:1067 +#: ../../c-api/exceptions.rst:1075 msgid ":exc:`OverflowError`" msgstr ":exc:`OverflowError`" -#: ../../c-api/exceptions.rst:1069 +#: ../../c-api/exceptions.rst:1077 msgid ":c:data:`PyExc_PermissionError`" msgstr ":c:data:`PyExc_PermissionError`" -#: ../../c-api/exceptions.rst:1069 +#: ../../c-api/exceptions.rst:1077 msgid ":exc:`PermissionError`" msgstr ":exc:`PermissionError`" -#: ../../c-api/exceptions.rst:1071 +#: ../../c-api/exceptions.rst:1079 msgid ":c:data:`PyExc_ProcessLookupError`" msgstr ":c:data:`PyExc_ProcessLookupError`" -#: ../../c-api/exceptions.rst:1071 +#: ../../c-api/exceptions.rst:1079 msgid ":exc:`ProcessLookupError`" msgstr ":exc:`ProcessLookupError`" -#: ../../c-api/exceptions.rst:1073 +#: ../../c-api/exceptions.rst:1081 msgid ":c:data:`PyExc_RecursionError`" msgstr ":c:data:`PyExc_RecursionError`" -#: ../../c-api/exceptions.rst:1073 +#: ../../c-api/exceptions.rst:1081 msgid ":exc:`RecursionError`" msgstr ":exc:`RecursionError`" -#: ../../c-api/exceptions.rst:1075 +#: ../../c-api/exceptions.rst:1083 msgid ":c:data:`PyExc_ReferenceError`" msgstr ":c:data:`PyExc_ReferenceError`" -#: ../../c-api/exceptions.rst:1075 +#: ../../c-api/exceptions.rst:1083 msgid ":exc:`ReferenceError`" msgstr ":exc:`ReferenceError`" -#: ../../c-api/exceptions.rst:1077 +#: ../../c-api/exceptions.rst:1085 msgid ":c:data:`PyExc_RuntimeError`" msgstr ":c:data:`PyExc_RuntimeError`" -#: ../../c-api/exceptions.rst:1077 +#: ../../c-api/exceptions.rst:1085 msgid ":exc:`RuntimeError`" msgstr ":exc:`RuntimeError`" -#: ../../c-api/exceptions.rst:1079 +#: ../../c-api/exceptions.rst:1087 msgid ":c:data:`PyExc_StopAsyncIteration`" msgstr ":c:data:`PyExc_StopAsyncIteration`" -#: ../../c-api/exceptions.rst:1079 +#: ../../c-api/exceptions.rst:1087 msgid ":exc:`StopAsyncIteration`" msgstr ":exc:`StopAsyncIteration`" -#: ../../c-api/exceptions.rst:1081 +#: ../../c-api/exceptions.rst:1089 msgid ":c:data:`PyExc_StopIteration`" msgstr ":c:data:`PyExc_StopIteration`" -#: ../../c-api/exceptions.rst:1081 +#: ../../c-api/exceptions.rst:1089 msgid ":exc:`StopIteration`" msgstr ":exc:`StopIteration`" -#: ../../c-api/exceptions.rst:1083 +#: ../../c-api/exceptions.rst:1091 msgid ":c:data:`PyExc_SyntaxError`" msgstr ":c:data:`PyExc_SyntaxError`" -#: ../../c-api/exceptions.rst:1083 +#: ../../c-api/exceptions.rst:1091 msgid ":exc:`SyntaxError`" msgstr ":exc:`SyntaxError`" -#: ../../c-api/exceptions.rst:1085 +#: ../../c-api/exceptions.rst:1093 msgid ":c:data:`PyExc_SystemError`" msgstr ":c:data:`PyExc_SystemError`" -#: ../../c-api/exceptions.rst:1085 +#: ../../c-api/exceptions.rst:1093 msgid ":exc:`SystemError`" msgstr ":exc:`SystemError`" -#: ../../c-api/exceptions.rst:1087 +#: ../../c-api/exceptions.rst:1095 msgid ":c:data:`PyExc_SystemExit`" msgstr ":c:data:`PyExc_SystemExit`" -#: ../../c-api/exceptions.rst:1087 +#: ../../c-api/exceptions.rst:1095 msgid ":exc:`SystemExit`" msgstr ":exc:`SystemExit`" -#: ../../c-api/exceptions.rst:1089 +#: ../../c-api/exceptions.rst:1097 msgid ":c:data:`PyExc_TabError`" msgstr ":c:data:`PyExc_TabError`" -#: ../../c-api/exceptions.rst:1089 +#: ../../c-api/exceptions.rst:1097 msgid ":exc:`TabError`" msgstr ":exc:`TabError`" -#: ../../c-api/exceptions.rst:1091 +#: ../../c-api/exceptions.rst:1099 msgid ":c:data:`PyExc_TimeoutError`" msgstr ":c:data:`PyExc_TimeoutError`" -#: ../../c-api/exceptions.rst:1091 +#: ../../c-api/exceptions.rst:1099 msgid ":exc:`TimeoutError`" msgstr ":exc:`TimeoutError`" -#: ../../c-api/exceptions.rst:1093 +#: ../../c-api/exceptions.rst:1101 msgid ":c:data:`PyExc_TypeError`" msgstr ":c:data:`PyExc_TypeError`" -#: ../../c-api/exceptions.rst:1093 +#: ../../c-api/exceptions.rst:1101 msgid ":exc:`TypeError`" msgstr ":exc:`TypeError`" -#: ../../c-api/exceptions.rst:1095 +#: ../../c-api/exceptions.rst:1103 msgid ":c:data:`PyExc_UnboundLocalError`" msgstr ":c:data:`PyExc_UnboundLocalError`" -#: ../../c-api/exceptions.rst:1095 +#: ../../c-api/exceptions.rst:1103 msgid ":exc:`UnboundLocalError`" msgstr ":exc:`UnboundLocalError`" -#: ../../c-api/exceptions.rst:1097 +#: ../../c-api/exceptions.rst:1105 msgid ":c:data:`PyExc_UnicodeDecodeError`" msgstr ":c:data:`PyExc_UnicodeDecodeError`" -#: ../../c-api/exceptions.rst:1097 +#: ../../c-api/exceptions.rst:1105 msgid ":exc:`UnicodeDecodeError`" msgstr ":exc:`UnicodeDecodeError`" -#: ../../c-api/exceptions.rst:1099 +#: ../../c-api/exceptions.rst:1107 msgid ":c:data:`PyExc_UnicodeEncodeError`" msgstr ":c:data:`PyExc_UnicodeEncodeError`" -#: ../../c-api/exceptions.rst:1099 +#: ../../c-api/exceptions.rst:1107 msgid ":exc:`UnicodeEncodeError`" msgstr ":exc:`UnicodeEncodeError`" -#: ../../c-api/exceptions.rst:1101 +#: ../../c-api/exceptions.rst:1109 msgid ":c:data:`PyExc_UnicodeError`" msgstr ":c:data:`PyExc_UnicodeError`" -#: ../../c-api/exceptions.rst:1101 +#: ../../c-api/exceptions.rst:1109 msgid ":exc:`UnicodeError`" msgstr ":exc:`UnicodeError`" -#: ../../c-api/exceptions.rst:1103 +#: ../../c-api/exceptions.rst:1111 msgid ":c:data:`PyExc_UnicodeTranslateError`" msgstr ":c:data:`PyExc_UnicodeTranslateError`" -#: ../../c-api/exceptions.rst:1103 +#: ../../c-api/exceptions.rst:1111 msgid ":exc:`UnicodeTranslateError`" msgstr ":exc:`UnicodeTranslateError`" -#: ../../c-api/exceptions.rst:1105 +#: ../../c-api/exceptions.rst:1113 msgid ":c:data:`PyExc_ValueError`" msgstr ":c:data:`PyExc_ValueError`" -#: ../../c-api/exceptions.rst:1105 +#: ../../c-api/exceptions.rst:1113 msgid ":exc:`ValueError`" msgstr ":exc:`ValueError`" -#: ../../c-api/exceptions.rst:1107 +#: ../../c-api/exceptions.rst:1115 msgid ":c:data:`PyExc_ZeroDivisionError`" msgstr ":c:data:`PyExc_ZeroDivisionError`" -#: ../../c-api/exceptions.rst:1107 +#: ../../c-api/exceptions.rst:1115 msgid ":exc:`ZeroDivisionError`" msgstr ":exc:`ZeroDivisionError`" -#: ../../c-api/exceptions.rst:1110 +#: ../../c-api/exceptions.rst:1118 msgid "" ":c:data:`PyExc_BlockingIOError`, :c:data:`PyExc_BrokenPipeError`, :c:data:" "`PyExc_ChildProcessError`, :c:data:`PyExc_ConnectionError`, :c:data:" @@ -1447,58 +1456,58 @@ msgstr "" "`PyExc_PermissionError`, :c:data:`PyExc_ProcessLookupError` 和 :c:data:" "`PyExc_TimeoutError` 是在 :pep:`3151` 被引入。" -#: ../../c-api/exceptions.rst:1120 +#: ../../c-api/exceptions.rst:1128 msgid ":c:data:`PyExc_StopAsyncIteration` and :c:data:`PyExc_RecursionError`." msgstr "" ":c:data:`PyExc_StopAsyncIteration` 和 :c:data:`PyExc_RecursionError`\\ 。" -#: ../../c-api/exceptions.rst:1123 +#: ../../c-api/exceptions.rst:1131 msgid ":c:data:`PyExc_ModuleNotFoundError`." msgstr ":c:data:`PyExc_ModuleNotFoundError`\\ 。" -#: ../../c-api/exceptions.rst:1126 +#: ../../c-api/exceptions.rst:1134 msgid "These are compatibility aliases to :c:data:`PyExc_OSError`:" msgstr "" -#: ../../c-api/exceptions.rst:1136 +#: ../../c-api/exceptions.rst:1144 msgid ":c:data:`PyExc_EnvironmentError`" msgstr ":c:data:`PyExc_EnvironmentError`" -#: ../../c-api/exceptions.rst:1138 +#: ../../c-api/exceptions.rst:1146 msgid ":c:data:`PyExc_IOError`" msgstr ":c:data:`PyExc_IOError`" -#: ../../c-api/exceptions.rst:1140 +#: ../../c-api/exceptions.rst:1148 msgid ":c:data:`PyExc_WindowsError`" msgstr ":c:data:`PyExc_WindowsError`" -#: ../../c-api/exceptions.rst:1140 +#: ../../c-api/exceptions.rst:1148 msgid "[2]_" msgstr "[2]_" -#: ../../c-api/exceptions.rst:1143 +#: ../../c-api/exceptions.rst:1151 msgid "These aliases used to be separate exception types." msgstr "" -#: ../../c-api/exceptions.rst:1146 ../../c-api/exceptions.rst:1207 +#: ../../c-api/exceptions.rst:1154 ../../c-api/exceptions.rst:1215 msgid "Notes:" msgstr "註解:" -#: ../../c-api/exceptions.rst:1149 +#: ../../c-api/exceptions.rst:1157 msgid "This is a base class for other standard exceptions." msgstr "" -#: ../../c-api/exceptions.rst:1152 +#: ../../c-api/exceptions.rst:1160 msgid "" "Only defined on Windows; protect code that uses this by testing that the " "preprocessor macro ``MS_WINDOWS`` is defined." msgstr "" -#: ../../c-api/exceptions.rst:1158 +#: ../../c-api/exceptions.rst:1166 msgid "Standard Warning Categories" msgstr "" -#: ../../c-api/exceptions.rst:1160 +#: ../../c-api/exceptions.rst:1168 msgid "" "All standard Python warning categories are available as global variables " "whose names are ``PyExc_`` followed by the Python exception name. These have " @@ -1506,393 +1515,393 @@ msgid "" "here are all the variables:" msgstr "" -#: ../../c-api/exceptions.rst:1181 +#: ../../c-api/exceptions.rst:1189 msgid ":c:data:`PyExc_Warning`" msgstr ":c:data:`PyExc_Warning`" -#: ../../c-api/exceptions.rst:1181 +#: ../../c-api/exceptions.rst:1189 msgid ":exc:`Warning`" msgstr ":exc:`Warning`" -#: ../../c-api/exceptions.rst:1181 +#: ../../c-api/exceptions.rst:1189 msgid "[3]_" msgstr "[3]_" -#: ../../c-api/exceptions.rst:1183 +#: ../../c-api/exceptions.rst:1191 msgid ":c:data:`PyExc_BytesWarning`" msgstr ":c:data:`PyExc_BytesWarning`" -#: ../../c-api/exceptions.rst:1183 +#: ../../c-api/exceptions.rst:1191 msgid ":exc:`BytesWarning`" msgstr ":exc:`BytesWarning`" -#: ../../c-api/exceptions.rst:1185 +#: ../../c-api/exceptions.rst:1193 msgid ":c:data:`PyExc_DeprecationWarning`" msgstr ":c:data:`PyExc_DeprecationWarning`" -#: ../../c-api/exceptions.rst:1185 +#: ../../c-api/exceptions.rst:1193 msgid ":exc:`DeprecationWarning`" msgstr ":exc:`DeprecationWarning`" -#: ../../c-api/exceptions.rst:1187 +#: ../../c-api/exceptions.rst:1195 msgid ":c:data:`PyExc_FutureWarning`" msgstr ":c:data:`PyExc_FutureWarning`" -#: ../../c-api/exceptions.rst:1187 +#: ../../c-api/exceptions.rst:1195 msgid ":exc:`FutureWarning`" msgstr ":exc:`FutureWarning`" -#: ../../c-api/exceptions.rst:1189 +#: ../../c-api/exceptions.rst:1197 msgid ":c:data:`PyExc_ImportWarning`" msgstr ":c:data:`PyExc_ImportWarning`" -#: ../../c-api/exceptions.rst:1189 +#: ../../c-api/exceptions.rst:1197 msgid ":exc:`ImportWarning`" msgstr ":exc:`ImportWarning`" -#: ../../c-api/exceptions.rst:1191 +#: ../../c-api/exceptions.rst:1199 msgid ":c:data:`PyExc_PendingDeprecationWarning`" msgstr ":c:data:`PyExc_PendingDeprecationWarning`" -#: ../../c-api/exceptions.rst:1191 +#: ../../c-api/exceptions.rst:1199 msgid ":exc:`PendingDeprecationWarning`" msgstr ":exc:`PendingDeprecationWarning`" -#: ../../c-api/exceptions.rst:1193 +#: ../../c-api/exceptions.rst:1201 msgid ":c:data:`PyExc_ResourceWarning`" msgstr ":c:data:`PyExc_ResourceWarning`" -#: ../../c-api/exceptions.rst:1193 +#: ../../c-api/exceptions.rst:1201 msgid ":exc:`ResourceWarning`" msgstr ":exc:`ResourceWarning`" -#: ../../c-api/exceptions.rst:1195 +#: ../../c-api/exceptions.rst:1203 msgid ":c:data:`PyExc_RuntimeWarning`" msgstr ":c:data:`PyExc_RuntimeWarning`" -#: ../../c-api/exceptions.rst:1195 +#: ../../c-api/exceptions.rst:1203 msgid ":exc:`RuntimeWarning`" msgstr ":exc:`RuntimeWarning`" -#: ../../c-api/exceptions.rst:1197 +#: ../../c-api/exceptions.rst:1205 msgid ":c:data:`PyExc_SyntaxWarning`" msgstr ":c:data:`PyExc_SyntaxWarning`" -#: ../../c-api/exceptions.rst:1197 +#: ../../c-api/exceptions.rst:1205 msgid ":exc:`SyntaxWarning`" msgstr ":exc:`SyntaxWarning`" -#: ../../c-api/exceptions.rst:1199 +#: ../../c-api/exceptions.rst:1207 msgid ":c:data:`PyExc_UnicodeWarning`" msgstr ":c:data:`PyExc_UnicodeWarning`" -#: ../../c-api/exceptions.rst:1199 +#: ../../c-api/exceptions.rst:1207 msgid ":exc:`UnicodeWarning`" msgstr ":exc:`UnicodeWarning`" -#: ../../c-api/exceptions.rst:1201 +#: ../../c-api/exceptions.rst:1209 msgid ":c:data:`PyExc_UserWarning`" msgstr ":c:data:`PyExc_UserWarning`" -#: ../../c-api/exceptions.rst:1201 +#: ../../c-api/exceptions.rst:1209 msgid ":exc:`UserWarning`" msgstr ":exc:`UserWarning`" -#: ../../c-api/exceptions.rst:1204 +#: ../../c-api/exceptions.rst:1212 msgid ":c:data:`PyExc_ResourceWarning`." msgstr ":c:data:`PyExc_ResourceWarning`." -#: ../../c-api/exceptions.rst:1210 +#: ../../c-api/exceptions.rst:1218 msgid "This is a base class for other standard warning categories." msgstr "" -#: ../../c-api/exceptions.rst:162 +#: ../../c-api/exceptions.rst:170 msgid "strerror()" msgstr "strerror()" -#: ../../c-api/exceptions.rst:614 ../../c-api/exceptions.rst:645 -#: ../../c-api/exceptions.rst:660 +#: ../../c-api/exceptions.rst:622 ../../c-api/exceptions.rst:653 +#: ../../c-api/exceptions.rst:668 msgid "module" msgstr "module(模組)" -#: ../../c-api/exceptions.rst:614 ../../c-api/exceptions.rst:645 -#: ../../c-api/exceptions.rst:660 +#: ../../c-api/exceptions.rst:622 ../../c-api/exceptions.rst:653 +#: ../../c-api/exceptions.rst:668 msgid "signal" msgstr "signal(訊號)" -#: ../../c-api/exceptions.rst:614 ../../c-api/exceptions.rst:645 +#: ../../c-api/exceptions.rst:622 ../../c-api/exceptions.rst:653 msgid "SIGINT" msgstr "SIGINT" -#: ../../c-api/exceptions.rst:614 ../../c-api/exceptions.rst:645 -#: ../../c-api/exceptions.rst:660 +#: ../../c-api/exceptions.rst:622 ../../c-api/exceptions.rst:653 +#: ../../c-api/exceptions.rst:668 msgid "KeyboardInterrupt (built-in exception)" msgstr "KeyboardInterrupt(內建例外)" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_BaseException" msgstr "PyExc_BaseException" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_Exception" msgstr "PyExc_Exception" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_ArithmeticError" msgstr "PyExc_ArithmeticError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_AssertionError" msgstr "PyExc_AssertionError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_AttributeError" msgstr "PyExc_AttributeError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_BlockingIOError" msgstr "PyExc_BlockingIOError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_BrokenPipeError" msgstr "PyExc_BrokenPipeError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_BufferError" msgstr "PyExc_BufferError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_ChildProcessError" msgstr "PyExc_ChildProcessError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_ConnectionAbortedError" msgstr "PyExc_ConnectionAbortedError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_ConnectionError" msgstr "PyExc_ConnectionError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_ConnectionRefusedError" msgstr "PyExc_ConnectionRefusedError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_ConnectionResetError" msgstr "PyExc_ConnectionResetError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_EOFError" msgstr "PyExc_EOFError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_FileExistsError" msgstr "PyExc_FileExistsError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_FileNotFoundError" msgstr "PyExc_FileNotFoundError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_FloatingPointError" msgstr "PyExc_FloatingPointError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_GeneratorExit" msgstr "PyExc_GeneratorExit" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_ImportError" msgstr "PyExc_ImportError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_IndentationError" msgstr "PyExc_IndentationError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_IndexError" msgstr "PyExc_IndexError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_InterruptedError" msgstr "PyExc_InterruptedError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_IsADirectoryError" msgstr "PyExc_IsADirectoryError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_KeyError" msgstr "PyExc_KeyError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_KeyboardInterrupt" msgstr "PyExc_KeyboardInterrupt" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_LookupError" msgstr "PyExc_LookupError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_MemoryError" msgstr "PyExc_MemoryError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_ModuleNotFoundError" msgstr "PyExc_ModuleNotFoundError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_NameError" msgstr "PyExc_NameError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_NotADirectoryError" msgstr "PyExc_NotADirectoryError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_NotImplementedError" msgstr "PyExc_NotImplementedError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_OSError" msgstr "PyExc_OSError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_OverflowError" msgstr "PyExc_OverflowError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_PermissionError" msgstr "PyExc_PermissionError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_ProcessLookupError" msgstr "PyExc_ProcessLookupError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_RecursionError" msgstr "PyExc_RecursionError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_ReferenceError" msgstr "PyExc_ReferenceError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_RuntimeError" msgstr "PyExc_RuntimeError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_StopAsyncIteration" msgstr "PyExc_StopAsyncIteration" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_StopIteration" msgstr "PyExc_StopIteration" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_SyntaxError" msgstr "PyExc_SyntaxError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_SystemError" msgstr "PyExc_SystemError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_SystemExit" msgstr "PyExc_SystemExit" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_TabError" msgstr "PyExc_TabError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_TimeoutError" msgstr "PyExc_TimeoutError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_TypeError" msgstr "PyExc_TypeError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_UnboundLocalError" msgstr "PyExc_UnboundLocalError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_UnicodeDecodeError" msgstr "PyExc_UnicodeDecodeError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_UnicodeEncodeError" msgstr "PyExc_UnicodeEncodeError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_UnicodeError" msgstr "PyExc_UnicodeError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_UnicodeTranslateError" msgstr "PyExc_UnicodeTranslateError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_ValueError" msgstr "PyExc_ValueError" -#: ../../c-api/exceptions.rst:945 +#: ../../c-api/exceptions.rst:953 msgid "PyExc_ZeroDivisionError" msgstr "PyExc_ZeroDivisionError" -#: ../../c-api/exceptions.rst:1128 +#: ../../c-api/exceptions.rst:1136 msgid "PyExc_EnvironmentError" msgstr "PyExc_EnvironmentError" -#: ../../c-api/exceptions.rst:1128 +#: ../../c-api/exceptions.rst:1136 msgid "PyExc_IOError" msgstr "PyExc_IOError" -#: ../../c-api/exceptions.rst:1128 +#: ../../c-api/exceptions.rst:1136 msgid "PyExc_WindowsError" msgstr "PyExc_WindowsError" -#: ../../c-api/exceptions.rst:1165 +#: ../../c-api/exceptions.rst:1173 msgid "PyExc_Warning" msgstr "PyExc_Warning" -#: ../../c-api/exceptions.rst:1165 +#: ../../c-api/exceptions.rst:1173 msgid "PyExc_BytesWarning" msgstr "PyExc_BytesWarning" -#: ../../c-api/exceptions.rst:1165 +#: ../../c-api/exceptions.rst:1173 msgid "PyExc_DeprecationWarning" msgstr "PyExc_DeprecationWarning" -#: ../../c-api/exceptions.rst:1165 +#: ../../c-api/exceptions.rst:1173 msgid "PyExc_FutureWarning" msgstr "PyExc_FutureWarning" -#: ../../c-api/exceptions.rst:1165 +#: ../../c-api/exceptions.rst:1173 msgid "PyExc_ImportWarning" msgstr "PyExc_ImportWarning" -#: ../../c-api/exceptions.rst:1165 +#: ../../c-api/exceptions.rst:1173 msgid "PyExc_PendingDeprecationWarning" msgstr "PyExc_PendingDeprecationWarning" -#: ../../c-api/exceptions.rst:1165 +#: ../../c-api/exceptions.rst:1173 msgid "PyExc_ResourceWarning" msgstr "PyExc_ResourceWarning" -#: ../../c-api/exceptions.rst:1165 +#: ../../c-api/exceptions.rst:1173 msgid "PyExc_RuntimeWarning" msgstr "PyExc_RuntimeWarning" -#: ../../c-api/exceptions.rst:1165 +#: ../../c-api/exceptions.rst:1173 msgid "PyExc_SyntaxWarning" msgstr "PyExc_SyntaxWarning" -#: ../../c-api/exceptions.rst:1165 +#: ../../c-api/exceptions.rst:1173 msgid "PyExc_UnicodeWarning" msgstr "PyExc_UnicodeWarning" -#: ../../c-api/exceptions.rst:1165 +#: ../../c-api/exceptions.rst:1173 msgid "PyExc_UserWarning" msgstr "PyExc_UserWarning" diff --git a/c-api/memory.po b/c-api/memory.po index 9a8b640b46..e2929793b8 100644 --- a/c-api/memory.po +++ b/c-api/memory.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-01 00:03+0000\n" +"POT-Creation-Date: 2023-10-17 00:03+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-" @@ -557,19 +557,19 @@ msgid "" "following fields:" msgstr "" -#: ../../c-api/memory.rst:411 ../../c-api/memory.rst:657 +#: ../../c-api/memory.rst:411 ../../c-api/memory.rst:658 msgid "Field" msgstr "" -#: ../../c-api/memory.rst:411 ../../c-api/memory.rst:657 +#: ../../c-api/memory.rst:411 ../../c-api/memory.rst:658 msgid "Meaning" msgstr "" -#: ../../c-api/memory.rst:413 ../../c-api/memory.rst:659 +#: ../../c-api/memory.rst:413 ../../c-api/memory.rst:660 msgid "``void *ctx``" msgstr "``void *ctx``" -#: ../../c-api/memory.rst:413 ../../c-api/memory.rst:659 +#: ../../c-api/memory.rst:413 ../../c-api/memory.rst:660 msgid "user context passed as first argument" msgstr "" @@ -938,119 +938,119 @@ msgstr "" msgid "" "Python has a *pymalloc* allocator optimized for small objects (smaller or " "equal to 512 bytes) with a short lifetime. It uses memory mappings called " -"\"arenas\" with a fixed size of 256 KiB. It falls back to :c:func:" -"`PyMem_RawMalloc` and :c:func:`PyMem_RawRealloc` for allocations larger than " -"512 bytes." +"\"arenas\" with a fixed size of either 256 KiB on 32-bit platforms or 1 MiB " +"on 64-bit platforms. It falls back to :c:func:`PyMem_RawMalloc` and :c:func:" +"`PyMem_RawRealloc` for allocations larger than 512 bytes." msgstr "" -#: ../../c-api/memory.rst:632 +#: ../../c-api/memory.rst:633 msgid "" "*pymalloc* is the :ref:`default allocator ` of " "the :c:macro:`PYMEM_DOMAIN_MEM` (ex: :c:func:`PyMem_Malloc`) and :c:macro:" "`PYMEM_DOMAIN_OBJ` (ex: :c:func:`PyObject_Malloc`) domains." msgstr "" -#: ../../c-api/memory.rst:636 +#: ../../c-api/memory.rst:637 msgid "The arena allocator uses the following functions:" msgstr "" -#: ../../c-api/memory.rst:638 +#: ../../c-api/memory.rst:639 msgid ":c:func:`!VirtualAlloc` and :c:func:`!VirtualFree` on Windows," msgstr "" -#: ../../c-api/memory.rst:639 +#: ../../c-api/memory.rst:640 msgid ":c:func:`!mmap` and :c:func:`!munmap` if available," msgstr "" -#: ../../c-api/memory.rst:640 +#: ../../c-api/memory.rst:641 msgid ":c:func:`malloc` and :c:func:`free` otherwise." msgstr "" -#: ../../c-api/memory.rst:642 +#: ../../c-api/memory.rst:643 msgid "" "This allocator is disabled if Python is configured with the :option:`--" "without-pymalloc` option. It can also be disabled at runtime using the :" "envvar:`PYTHONMALLOC` environment variable (ex: ``PYTHONMALLOC=malloc``)." msgstr "" -#: ../../c-api/memory.rst:647 +#: ../../c-api/memory.rst:648 msgid "Customize pymalloc Arena Allocator" msgstr "" -#: ../../c-api/memory.rst:653 +#: ../../c-api/memory.rst:654 msgid "" "Structure used to describe an arena allocator. The structure has three " "fields:" msgstr "" -#: ../../c-api/memory.rst:661 +#: ../../c-api/memory.rst:662 msgid "``void* alloc(void *ctx, size_t size)``" msgstr "``void* alloc(void *ctx, size_t size)``" -#: ../../c-api/memory.rst:661 +#: ../../c-api/memory.rst:662 msgid "allocate an arena of size bytes" msgstr "" -#: ../../c-api/memory.rst:663 +#: ../../c-api/memory.rst:664 msgid "``void free(void *ctx, void *ptr, size_t size)``" msgstr "``void free(void *ctx, void *ptr, size_t size)``" -#: ../../c-api/memory.rst:663 +#: ../../c-api/memory.rst:664 msgid "free an arena" msgstr "" -#: ../../c-api/memory.rst:668 +#: ../../c-api/memory.rst:669 msgid "Get the arena allocator." msgstr "" -#: ../../c-api/memory.rst:672 +#: ../../c-api/memory.rst:673 msgid "Set the arena allocator." msgstr "" -#: ../../c-api/memory.rst:676 +#: ../../c-api/memory.rst:677 msgid "tracemalloc C API" msgstr "" -#: ../../c-api/memory.rst:682 +#: ../../c-api/memory.rst:683 msgid "Track an allocated memory block in the :mod:`tracemalloc` module." msgstr "" -#: ../../c-api/memory.rst:684 +#: ../../c-api/memory.rst:685 msgid "" "Return ``0`` on success, return ``-1`` on error (failed to allocate memory " "to store the trace). Return ``-2`` if tracemalloc is disabled." msgstr "" -#: ../../c-api/memory.rst:687 +#: ../../c-api/memory.rst:688 msgid "If memory block is already tracked, update the existing trace." msgstr "" -#: ../../c-api/memory.rst:691 +#: ../../c-api/memory.rst:692 msgid "" "Untrack an allocated memory block in the :mod:`tracemalloc` module. Do " "nothing if the block was not tracked." msgstr "" -#: ../../c-api/memory.rst:694 +#: ../../c-api/memory.rst:695 msgid "Return ``-2`` if tracemalloc is disabled, otherwise return ``0``." msgstr "" -#: ../../c-api/memory.rst:700 +#: ../../c-api/memory.rst:701 msgid "Examples" msgstr "範例" -#: ../../c-api/memory.rst:702 +#: ../../c-api/memory.rst:703 msgid "" "Here is the example from section :ref:`memoryoverview`, rewritten so that " "the I/O buffer is allocated from the Python heap by using the first function " "set::" msgstr "" -#: ../../c-api/memory.rst:715 +#: ../../c-api/memory.rst:716 msgid "The same code using the type-oriented function set::" msgstr "" -#: ../../c-api/memory.rst:727 +#: ../../c-api/memory.rst:728 msgid "" "Note that in the two examples above, the buffer is always manipulated via " "functions belonging to the same set. Indeed, it is required to use the same " @@ -1060,14 +1060,14 @@ msgid "" "different allocators operating on different heaps. ::" msgstr "" -#: ../../c-api/memory.rst:742 +#: ../../c-api/memory.rst:743 msgid "" "In addition to the functions aimed at handling raw memory blocks from the " "Python heap, objects in Python are allocated and released with :c:macro:" "`PyObject_New`, :c:macro:`PyObject_NewVar` and :c:func:`PyObject_Del`." msgstr "" -#: ../../c-api/memory.rst:746 +#: ../../c-api/memory.rst:747 msgid "" "These will be explained in the next chapter on defining and implementing new " "object types in C." diff --git a/c-api/set.po b/c-api/set.po index b347ab2d3b..828de9f04b 100644 --- a/c-api/set.po +++ b/c-api/set.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 00:03+0000\n" +"POT-Creation-Date: 2023-10-17 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -182,7 +182,10 @@ msgid "" msgstr "" #: ../../c-api/set.rst:166 -msgid "Empty an existing set of all elements." +msgid "" +"Empty an existing set of all elements. Return ``0`` on success. Return " +"``-1`` and raise :exc:`SystemError` if *set* is not an instance of :class:" +"`set` or its subtype." msgstr "" #: ../../c-api/set.rst:11 diff --git a/glossary.po b/glossary.po index e3237f4157..a1aa90ab1e 100644 --- a/glossary.po +++ b/glossary.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-09 00:03+0000\n" +"POT-Creation-Date: 2023-10-20 00:03+0000\n" "PO-Revision-Date: 2023-07-02 22:47+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -573,10 +573,12 @@ msgstr "context manager(情境管理器)" #: ../../glossary.rst:250 msgid "" "An object which controls the environment seen in a :keyword:`with` statement " -"by defining :meth:`__enter__` and :meth:`__exit__` methods. See :pep:`343`." +"by defining :meth:`~object.__enter__` and :meth:`~object.__exit__` methods. " +"See :pep:`343`." msgstr "" "一個可以控制 :keyword:`with` 陳述式中所見環境的物件,而它是透過定義 :meth:" -"`__enter__` 和 :meth:`__exit__` method 來控制的。請參閱 :pep:`343`。" +"`~object.__enter__` 和 :meth:`~object.__exit__` method 來控制的。請參閱 :pep:" +"`343`。" #: ../../glossary.rst:253 msgid "context variable" @@ -1444,14 +1446,14 @@ msgid "" "iterables include all sequence types (such as :class:`list`, :class:`str`, " "and :class:`tuple`) and some non-sequence types like :class:`dict`, :term:" "`file objects `, and objects of any classes you define with an :" -"meth:`__iter__` method or with a :meth:`__getitem__` method that implements :" -"term:`sequence` semantics." +"meth:`__iter__` method or with a :meth:`~object.__getitem__` method that " +"implements :term:`sequence` semantics." msgstr "" "一種能夠一次回傳一個其中成員的物件。可疊代物件的例子包括所有的序列型別(像" "是 :class:`list`、:class:`str` 和 :class:`tuple`\\ )和某些非序列型別,像是 :" "class:`dict`、:term:`檔案物件 `,以及你所定義的任何 class 物件," "只要那些 class 有 :meth:`__iter__` method 或是實作 :term:`sequence`\\ (序" -"列)語意的 :meth:`__getitem__` method,該物件就是可疊代物件。" +"列)語意的 :meth:`~object.__getitem__` method,該物件就是可疊代物件。" #: ../../glossary.rst:651 msgid "" @@ -2398,31 +2400,33 @@ msgstr "sequence(序列)" #: ../../glossary.rst:1089 msgid "" "An :term:`iterable` which supports efficient element access using integer " -"indices via the :meth:`__getitem__` special method and defines a :meth:" -"`__len__` method that returns the length of the sequence. Some built-in " +"indices via the :meth:`~object.__getitem__` special method and defines a :" +"meth:`__len__` method that returns the length of the sequence. Some built-in " "sequence types are :class:`list`, :class:`str`, :class:`tuple`, and :class:" -"`bytes`. Note that :class:`dict` also supports :meth:`__getitem__` and :meth:" -"`__len__`, but is considered a mapping rather than a sequence because the " -"lookups use arbitrary :term:`immutable` keys rather than integers." -msgstr "" -"一個 :term:`iterable`\\ (可疊代物件),它透過 :meth:`__getitem__` special " -"method(特殊方法),使用整數索引來支援高效率的元素存取,並定義了一個 :meth:" -"`__len__` method 來回傳該序列的長度。一些內建序列型別包括 :class:`list`、:" -"class:`str`、:class:`tuple` 和 :class:`bytes`。請注意,雖然 :class:`dict` 也" -"支援 :meth:`__getitem__` 和 :meth:`__len__`,但它被視為對映 (mapping) 而不是" -"序列,因為其查找方式是使用任意的 :term:`immutable` 鍵,而不是整數。" +"`bytes`. Note that :class:`dict` also supports :meth:`~object.__getitem__` " +"and :meth:`__len__`, but is considered a mapping rather than a sequence " +"because the lookups use arbitrary :term:`immutable` keys rather than " +"integers." +msgstr "" +"一個 :term:`iterable`\\ (可疊代物件),它透過 :meth:`~object.__getitem__` " +"special method(特殊方法),使用整數索引來支援高效率的元素存取,並定義了一" +"個 :meth:`__len__` method 來回傳該序列的長度。一些內建序列型別包括 :class:" +"`list`、:class:`str`、:class:`tuple` 和 :class:`bytes`。請注意,雖然 :class:" +"`dict` 也支援 :meth:`~object.__getitem__` 和 :meth:`__len__`,但它被視為對映 " +"(mapping) 而不是序列,因為其查找方式是使用任意的 :term:`immutable` 鍵,而不是" +"整數。" #: ../../glossary.rst:1098 msgid "" "The :class:`collections.abc.Sequence` abstract base class defines a much " -"richer interface that goes beyond just :meth:`__getitem__` and :meth:" +"richer interface that goes beyond just :meth:`~object.__getitem__` and :meth:" "`__len__`, adding :meth:`count`, :meth:`index`, :meth:`__contains__`, and :" "meth:`__reversed__`. Types that implement this expanded interface can be " "registered explicitly using :func:`~abc.ABCMeta.register`." msgstr "" "抽象基底類別 (abstract base class) :class:`collections.abc.Sequence` 定義了一" -"個更加豐富的介面,並不僅止於 :meth:`__getitem__` 和 :meth:`__len__`,還增加" -"了 :meth:`count`、:meth:`index`、:meth:`__contains__` 和 :meth:" +"個更加豐富的介面,並不僅止於 :meth:`~object.__getitem__` 和 :meth:`__len__`," +"還增加了 :meth:`count`、:meth:`index`、:meth:`__contains__` 和 :meth:" "`__reversed__`。實作此擴充介面的型別,可以使用 :func:`~abc.ABCMeta.register` " "被明確地註冊。" diff --git a/howto/descriptor.po b/howto/descriptor.po index 4b624d303c..d78cea245b 100644 --- a/howto/descriptor.po +++ b/howto/descriptor.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 00:03+0000\n" +"POT-Creation-Date: 2023-11-05 00:03+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-" @@ -689,11 +689,11 @@ msgid "" "it can be updated:" msgstr "" -#: ../../howto/descriptor.rst:948 +#: ../../howto/descriptor.rst:952 msgid "Pure Python Equivalents" msgstr "" -#: ../../howto/descriptor.rst:950 +#: ../../howto/descriptor.rst:954 msgid "" "The descriptor protocol is simple and offers exciting possibilities. " "Several use cases are so common that they have been prepackaged into built-" @@ -701,36 +701,36 @@ msgid "" "\\_\\_slots\\_\\_ are all based on the descriptor protocol." msgstr "" -#: ../../howto/descriptor.rst:957 +#: ../../howto/descriptor.rst:961 msgid "Properties" msgstr "" -#: ../../howto/descriptor.rst:959 +#: ../../howto/descriptor.rst:963 msgid "" "Calling :func:`property` is a succinct way of building a data descriptor " "that triggers a function call upon access to an attribute. Its signature " "is::" msgstr "" -#: ../../howto/descriptor.rst:964 +#: ../../howto/descriptor.rst:968 msgid "" "The documentation shows a typical use to define a managed attribute ``x``:" msgstr "" -#: ../../howto/descriptor.rst:988 +#: ../../howto/descriptor.rst:992 msgid "" "To see how :func:`property` is implemented in terms of the descriptor " "protocol, here is a pure Python equivalent:" msgstr "" -#: ../../howto/descriptor.rst:1091 +#: ../../howto/descriptor.rst:1095 msgid "" "The :func:`property` builtin helps whenever a user interface has granted " "attribute access and then subsequent changes require the intervention of a " "method." msgstr "" -#: ../../howto/descriptor.rst:1095 +#: ../../howto/descriptor.rst:1099 msgid "" "For instance, a spreadsheet class may grant access to a cell value through " "``Cell('b10').value``. Subsequent improvements to the program require the " @@ -740,23 +740,23 @@ msgid "" "descriptor:" msgstr "" -#: ../../howto/descriptor.rst:1112 +#: ../../howto/descriptor.rst:1116 msgid "" "Either the built-in :func:`property` or our :func:`Property` equivalent " "would work in this example." msgstr "" -#: ../../howto/descriptor.rst:1117 +#: ../../howto/descriptor.rst:1121 msgid "Functions and methods" msgstr "" -#: ../../howto/descriptor.rst:1119 +#: ../../howto/descriptor.rst:1123 msgid "" "Python's object oriented features are built upon a function based " "environment. Using non-data descriptors, the two are merged seamlessly." msgstr "" -#: ../../howto/descriptor.rst:1122 +#: ../../howto/descriptor.rst:1126 msgid "" "Functions stored in class dictionaries get turned into methods when invoked. " "Methods only differ from regular functions in that the object instance is " @@ -764,13 +764,13 @@ msgid "" "*self* but could be called *this* or any other variable name." msgstr "" -#: ../../howto/descriptor.rst:1127 +#: ../../howto/descriptor.rst:1131 msgid "" "Methods can be created manually with :class:`types.MethodType` which is " "roughly equivalent to:" msgstr "" -#: ../../howto/descriptor.rst:1144 +#: ../../howto/descriptor.rst:1148 msgid "" "To support automatic creation of methods, functions include the :meth:" "`__get__` method for binding methods during attribute access. This means " @@ -778,58 +778,58 @@ msgid "" "dotted lookup from an instance. Here's how it works:" msgstr "" -#: ../../howto/descriptor.rst:1160 +#: ../../howto/descriptor.rst:1164 msgid "" "Running the following class in the interpreter shows how the function " "descriptor works in practice:" msgstr "" -#: ../../howto/descriptor.rst:1169 +#: ../../howto/descriptor.rst:1173 msgid "" "The function has a :term:`qualified name` attribute to support introspection:" msgstr "" -#: ../../howto/descriptor.rst:1176 +#: ../../howto/descriptor.rst:1180 msgid "" "Accessing the function through the class dictionary does not invoke :meth:" "`__get__`. Instead, it just returns the underlying function object::" msgstr "" -#: ../../howto/descriptor.rst:1182 +#: ../../howto/descriptor.rst:1186 msgid "" "Dotted access from a class calls :meth:`__get__` which just returns the " "underlying function unchanged::" msgstr "" -#: ../../howto/descriptor.rst:1188 +#: ../../howto/descriptor.rst:1192 msgid "" "The interesting behavior occurs during dotted access from an instance. The " "dotted lookup calls :meth:`__get__` which returns a bound method object::" msgstr "" -#: ../../howto/descriptor.rst:1195 +#: ../../howto/descriptor.rst:1199 msgid "" "Internally, the bound method stores the underlying function and the bound " "instance::" msgstr "" -#: ../../howto/descriptor.rst:1204 +#: ../../howto/descriptor.rst:1208 msgid "" "If you have ever wondered where *self* comes from in regular methods or " "where *cls* comes from in class methods, this is it!" msgstr "" -#: ../../howto/descriptor.rst:1209 +#: ../../howto/descriptor.rst:1213 msgid "Kinds of methods" msgstr "" -#: ../../howto/descriptor.rst:1211 +#: ../../howto/descriptor.rst:1215 msgid "" "Non-data descriptors provide a simple mechanism for variations on the usual " "patterns of binding functions into methods." msgstr "" -#: ../../howto/descriptor.rst:1214 +#: ../../howto/descriptor.rst:1218 msgid "" "To recap, functions have a :meth:`__get__` method so that they can be " "converted to a method when accessed as attributes. The non-data descriptor " @@ -837,55 +837,55 @@ msgid "" "f(*args)`` becomes ``f(*args)``." msgstr "" -#: ../../howto/descriptor.rst:1219 +#: ../../howto/descriptor.rst:1223 msgid "This chart summarizes the binding and its two most useful variants:" msgstr "" -#: ../../howto/descriptor.rst:1222 +#: ../../howto/descriptor.rst:1226 msgid "Transformation" msgstr "" -#: ../../howto/descriptor.rst:1222 +#: ../../howto/descriptor.rst:1226 msgid "Called from an object" msgstr "" -#: ../../howto/descriptor.rst:1222 +#: ../../howto/descriptor.rst:1226 msgid "Called from a class" msgstr "" -#: ../../howto/descriptor.rst:1225 +#: ../../howto/descriptor.rst:1229 msgid "function" msgstr "函式" -#: ../../howto/descriptor.rst:1225 +#: ../../howto/descriptor.rst:1229 msgid "f(obj, \\*args)" msgstr "f(obj, \\*args)" -#: ../../howto/descriptor.rst:1225 ../../howto/descriptor.rst:1227 +#: ../../howto/descriptor.rst:1229 ../../howto/descriptor.rst:1231 msgid "f(\\*args)" msgstr "f(\\*args)" -#: ../../howto/descriptor.rst:1227 +#: ../../howto/descriptor.rst:1231 msgid "staticmethod" msgstr "staticmethod" -#: ../../howto/descriptor.rst:1229 +#: ../../howto/descriptor.rst:1233 msgid "classmethod" msgstr "classmethod" -#: ../../howto/descriptor.rst:1229 +#: ../../howto/descriptor.rst:1233 msgid "f(type(obj), \\*args)" msgstr "f(type(obj), \\*args)" -#: ../../howto/descriptor.rst:1229 +#: ../../howto/descriptor.rst:1233 msgid "f(cls, \\*args)" msgstr "f(cls, \\*args)" -#: ../../howto/descriptor.rst:1234 +#: ../../howto/descriptor.rst:1238 msgid "Static methods" msgstr "" -#: ../../howto/descriptor.rst:1236 +#: ../../howto/descriptor.rst:1240 msgid "" "Static methods return the underlying function without changes. Calling " "either ``c.f`` or ``C.f`` is the equivalent of a direct lookup into ``object." @@ -894,13 +894,13 @@ msgid "" "a class." msgstr "" -#: ../../howto/descriptor.rst:1242 +#: ../../howto/descriptor.rst:1246 msgid "" "Good candidates for static methods are methods that do not reference the " "``self`` variable." msgstr "" -#: ../../howto/descriptor.rst:1245 +#: ../../howto/descriptor.rst:1249 msgid "" "For instance, a statistics package may include a container class for " "experimental data. The class provides normal methods for computing the " @@ -912,19 +912,19 @@ msgid "" "``s.erf(1.5) --> .9332`` or ``Sample.erf(1.5) --> .9332``." msgstr "" -#: ../../howto/descriptor.rst:1254 +#: ../../howto/descriptor.rst:1258 msgid "" "Since static methods return the underlying function with no changes, the " "example calls are unexciting:" msgstr "" -#: ../../howto/descriptor.rst:1271 +#: ../../howto/descriptor.rst:1275 msgid "" "Using the non-data descriptor protocol, a pure Python version of :func:" "`staticmethod` would look like this:" msgstr "" -#: ../../howto/descriptor.rst:1291 +#: ../../howto/descriptor.rst:1295 msgid "" "The :func:`functools.update_wrapper` call adds a ``__wrapped__`` attribute " "that refers to the underlying function. Also it carries forward the " @@ -932,18 +932,18 @@ msgid "" "``__name__``, ``__qualname__``, ``__doc__``, and ``__annotations__``." msgstr "" -#: ../../howto/descriptor.rst:1359 +#: ../../howto/descriptor.rst:1363 msgid "Class methods" msgstr "" -#: ../../howto/descriptor.rst:1361 +#: ../../howto/descriptor.rst:1365 msgid "" "Unlike static methods, class methods prepend the class reference to the " "argument list before calling the function. This format is the same for " "whether the caller is an object or a class:" msgstr "" -#: ../../howto/descriptor.rst:1379 +#: ../../howto/descriptor.rst:1383 msgid "" "This behavior is useful whenever the method only needs to have a class " "reference and does not rely on data stored in a specific instance. One use " @@ -952,17 +952,17 @@ msgid "" "of keys. The pure Python equivalent is:" msgstr "" -#: ../../howto/descriptor.rst:1396 +#: ../../howto/descriptor.rst:1400 msgid "Now a new dictionary of unique keys can be constructed like this:" msgstr "" -#: ../../howto/descriptor.rst:1406 +#: ../../howto/descriptor.rst:1410 msgid "" "Using the non-data descriptor protocol, a pure Python version of :func:" "`classmethod` would look like this:" msgstr "" -#: ../../howto/descriptor.rst:1484 +#: ../../howto/descriptor.rst:1488 msgid "" "The code path for ``hasattr(type(self.f), '__get__')`` was added in Python " "3.9 and makes it possible for :func:`classmethod` to support chained " @@ -970,7 +970,7 @@ msgid "" "together. In Python 3.11, this functionality was deprecated." msgstr "" -#: ../../howto/descriptor.rst:1502 +#: ../../howto/descriptor.rst:1506 msgid "" "The :func:`functools.update_wrapper` call in ``ClassMethod`` adds a " "``__wrapped__`` attribute that refers to the underlying function. Also it " @@ -979,30 +979,30 @@ msgid "" "``__annotations__``." msgstr "" -#: ../../howto/descriptor.rst:1510 +#: ../../howto/descriptor.rst:1514 msgid "Member objects and __slots__" msgstr "" -#: ../../howto/descriptor.rst:1512 +#: ../../howto/descriptor.rst:1516 msgid "" "When a class defines ``__slots__``, it replaces instance dictionaries with a " "fixed-length array of slot values. From a user point of view that has " "several effects:" msgstr "" -#: ../../howto/descriptor.rst:1516 +#: ../../howto/descriptor.rst:1520 msgid "" "1. Provides immediate detection of bugs due to misspelled attribute " "assignments. Only attribute names specified in ``__slots__`` are allowed:" msgstr "" -#: ../../howto/descriptor.rst:1532 +#: ../../howto/descriptor.rst:1536 msgid "" "2. Helps create immutable objects where descriptors manage access to private " "attributes stored in ``__slots__``:" msgstr "" -#: ../../howto/descriptor.rst:1567 +#: ../../howto/descriptor.rst:1571 msgid "" "3. Saves memory. On a 64-bit Linux build, an instance with two attributes " "takes 48 bytes with ``__slots__`` and 152 bytes without. This `flyweight " @@ -1010,19 +1010,19 @@ msgid "" "only matters when a large number of instances are going to be created." msgstr "" -#: ../../howto/descriptor.rst:1572 +#: ../../howto/descriptor.rst:1576 msgid "" "4. Improves speed. Reading instance variables is 35% faster with " "``__slots__`` (as measured with Python 3.10 on an Apple M1 processor)." msgstr "" -#: ../../howto/descriptor.rst:1575 +#: ../../howto/descriptor.rst:1579 msgid "" "5. Blocks tools like :func:`functools.cached_property` which require an " "instance dictionary to function correctly:" msgstr "" -#: ../../howto/descriptor.rst:1597 +#: ../../howto/descriptor.rst:1601 msgid "" "It is not possible to create an exact drop-in pure Python version of " "``__slots__`` because it requires direct access to C structures and control " @@ -1032,36 +1032,36 @@ msgid "" "managed by member descriptors:" msgstr "" -#: ../../howto/descriptor.rst:1642 +#: ../../howto/descriptor.rst:1646 msgid "" "The :meth:`type.__new__` method takes care of adding member objects to class " "variables:" msgstr "" -#: ../../howto/descriptor.rst:1658 +#: ../../howto/descriptor.rst:1662 msgid "" "The :meth:`object.__new__` method takes care of creating instances that have " "slots instead of an instance dictionary. Here is a rough simulation in pure " "Python:" msgstr "" -#: ../../howto/descriptor.rst:1693 +#: ../../howto/descriptor.rst:1697 msgid "" "To use the simulation in a real class, just inherit from :class:`Object` and " "set the :term:`metaclass` to :class:`Type`:" msgstr "" -#: ../../howto/descriptor.rst:1707 +#: ../../howto/descriptor.rst:1711 msgid "" "At this point, the metaclass has loaded member objects for *x* and *y*::" msgstr "" -#: ../../howto/descriptor.rst:1728 +#: ../../howto/descriptor.rst:1732 msgid "" "When instances are created, they have a ``slot_values`` list where the " "attributes are stored:" msgstr "" -#: ../../howto/descriptor.rst:1740 +#: ../../howto/descriptor.rst:1744 msgid "Misspelled or unassigned attributes will raise an exception:" msgstr "" diff --git a/howto/enum.po b/howto/enum.po index d581267153..18448fd07a 100644 --- a/howto/enum.po +++ b/howto/enum.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-12 00:03+0000\n" +"POT-Creation-Date: 2023-11-01 00:03+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -375,68 +375,68 @@ msgid "" "__repr__` omits the inherited class' name. For example::" msgstr "" -#: ../../howto/enum.rst:499 +#: ../../howto/enum.rst:500 msgid "" "Use the :func:`!dataclass` argument ``repr=False`` to use the standard :func:" "`repr`." msgstr "" -#: ../../howto/enum.rst:502 +#: ../../howto/enum.rst:503 msgid "" "Only the dataclass fields are shown in the value area, not the dataclass' " "name." msgstr "" -#: ../../howto/enum.rst:508 +#: ../../howto/enum.rst:509 msgid "Pickling" msgstr "" -#: ../../howto/enum.rst:510 +#: ../../howto/enum.rst:511 msgid "Enumerations can be pickled and unpickled::" msgstr "" -#: ../../howto/enum.rst:517 +#: ../../howto/enum.rst:518 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:523 +#: ../../howto/enum.rst:524 msgid "" "With pickle protocol version 4 it is possible to easily pickle enums nested " "in other classes." msgstr "" -#: ../../howto/enum.rst:526 +#: ../../howto/enum.rst:527 msgid "" "It is possible to modify how enum members are pickled/unpickled by defining :" "meth:`__reduce_ex__` in the enumeration class. The default method is by-" "value, but enums with complicated values may want to use by-name::" msgstr "" -#: ../../howto/enum.rst:535 +#: ../../howto/enum.rst:537 msgid "" "Using by-name for flags is not recommended, as unnamed aliases will not " "unpickle." msgstr "" -#: ../../howto/enum.rst:540 +#: ../../howto/enum.rst:542 msgid "Functional API" msgstr "" -#: ../../howto/enum.rst:542 +#: ../../howto/enum.rst:544 msgid "" "The :class:`Enum` class is callable, providing the following functional API::" msgstr "" -#: ../../howto/enum.rst:552 +#: ../../howto/enum.rst:554 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:555 +#: ../../howto/enum.rst:557 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-" @@ -448,14 +448,14 @@ msgid "" "assignment to :class:`Animal` is equivalent to::" msgstr "" -#: ../../howto/enum.rst:571 +#: ../../howto/enum.rst:573 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:575 +#: ../../howto/enum.rst:577 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 " @@ -464,14 +464,14 @@ msgid "" "Jython). The solution is to specify the module name explicitly as follows::" msgstr "" -#: ../../howto/enum.rst:585 +#: ../../howto/enum.rst:587 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:589 +#: ../../howto/enum.rst:591 msgid "" "The new pickle protocol 4 also, in some circumstances, relies on :attr:" "`~definition.__qualname__` being set to the location where pickle will be " @@ -479,7 +479,7 @@ msgid "" "class SomeData in the global scope::" msgstr "" -#: ../../howto/enum.rst:596 +#: ../../howto/enum.rst:598 msgid "The complete signature is::" msgstr "" @@ -487,7 +487,7 @@ msgstr "" msgid "value" msgstr "" -#: ../../howto/enum.rst:608 +#: ../../howto/enum.rst:610 msgid "What the new enum class will record as its name." msgstr "" @@ -495,21 +495,21 @@ msgstr "" msgid "names" msgstr "" -#: ../../howto/enum.rst:610 +#: ../../howto/enum.rst:612 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:615 +#: ../../howto/enum.rst:617 msgid "or an iterator of names::" msgstr "" -#: ../../howto/enum.rst:619 +#: ../../howto/enum.rst:621 msgid "or an iterator of (name, value) pairs::" msgstr "" -#: ../../howto/enum.rst:623 +#: ../../howto/enum.rst:625 msgid "or a mapping::" msgstr "" @@ -517,7 +517,7 @@ msgstr "" msgid "module" msgstr "" -#: ../../howto/enum.rst:627 +#: ../../howto/enum.rst:629 msgid "name of module where new enum class can be found." msgstr "" @@ -525,7 +525,7 @@ msgstr "" msgid "qualname" msgstr "" -#: ../../howto/enum.rst:629 +#: ../../howto/enum.rst:631 msgid "where in module new enum class can be found." msgstr "" @@ -533,7 +533,7 @@ msgstr "" msgid "type" msgstr "" -#: ../../howto/enum.rst:631 +#: ../../howto/enum.rst:633 msgid "type to mix in to new enum class." msgstr "" @@ -541,23 +541,23 @@ msgstr "" msgid "start" msgstr "" -#: ../../howto/enum.rst:633 +#: ../../howto/enum.rst:635 msgid "number to start counting at if only names are passed in." msgstr "" -#: ../../howto/enum.rst:635 +#: ../../howto/enum.rst:637 msgid "The *start* parameter was added." msgstr "" -#: ../../howto/enum.rst:640 +#: ../../howto/enum.rst:642 msgid "Derived Enumerations" msgstr "" -#: ../../howto/enum.rst:643 +#: ../../howto/enum.rst:645 msgid "IntEnum" msgstr "" -#: ../../howto/enum.rst:645 +#: ../../howto/enum.rst:647 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 " @@ -565,22 +565,22 @@ msgid "" "each other::" msgstr "" -#: ../../howto/enum.rst:666 +#: ../../howto/enum.rst:668 msgid "" "However, they still can't be compared to standard :class:`Enum` " "enumerations::" msgstr "" -#: ../../howto/enum.rst:679 +#: ../../howto/enum.rst:681 msgid "" ":class:`IntEnum` values behave like integers in other ways you'd expect::" msgstr "" -#: ../../howto/enum.rst:690 +#: ../../howto/enum.rst:692 msgid "StrEnum" msgstr "" -#: ../../howto/enum.rst:692 +#: ../../howto/enum.rst:694 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; " @@ -588,11 +588,11 @@ msgid "" "each other." msgstr "" -#: ../../howto/enum.rst:701 +#: ../../howto/enum.rst:703 msgid "IntFlag" msgstr "" -#: ../../howto/enum.rst:703 +#: ../../howto/enum.rst:705 msgid "" "The next variation of :class:`Enum` provided, :class:`IntFlag`, is also " "based on :class:`int`. The difference being :class:`IntFlag` members can be " @@ -602,60 +602,60 @@ msgid "" "is used." msgstr "" -#: ../../howto/enum.rst:711 +#: ../../howto/enum.rst:713 msgid "" "Any operation on an :class:`IntFlag` member besides the bit-wise operations " "will lose the :class:`IntFlag` membership." msgstr "" -#: ../../howto/enum.rst:714 +#: ../../howto/enum.rst:716 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:721 +#: ../../howto/enum.rst:723 msgid "Sample :class:`IntFlag` class::" msgstr "" -#: ../../howto/enum.rst:737 +#: ../../howto/enum.rst:739 msgid "It is also possible to name the combinations::" msgstr "" -#: ../../howto/enum.rst:754 +#: ../../howto/enum.rst:756 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:759 +#: ../../howto/enum.rst:761 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:767 +#: ../../howto/enum.rst:769 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:778 +#: ../../howto/enum.rst:780 msgid "" "The negation operator, ``~``, always returns an :class:`IntFlag` member with " "a positive value::" msgstr "" -#: ../../howto/enum.rst:784 +#: ../../howto/enum.rst:786 msgid ":class:`IntFlag` members can also be iterated over::" msgstr "" -#: ../../howto/enum.rst:793 +#: ../../howto/enum.rst:795 msgid "Flag" msgstr "" -#: ../../howto/enum.rst:795 +#: ../../howto/enum.rst:797 msgid "" "The last variation is :class:`Flag`. Like :class:`IntFlag`, :class:`Flag` " "members can be combined using the bitwise operators (&, \\|, ^, ~). Unlike :" @@ -665,29 +665,29 @@ msgid "" "value and let :class:`Flag` select an appropriate value." msgstr "" -#: ../../howto/enum.rst:804 +#: ../../howto/enum.rst:806 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:818 +#: ../../howto/enum.rst:820 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:830 +#: ../../howto/enum.rst:832 msgid "" "Giving a name to the \"no flags set\" condition does not change its boolean " "value::" msgstr "" -#: ../../howto/enum.rst:844 +#: ../../howto/enum.rst:846 msgid ":class:`Flag` members can also be iterated over::" msgstr "" -#: ../../howto/enum.rst:854 +#: ../../howto/enum.rst:856 msgid "" "For the majority of new code, :class:`Enum` and :class:`Flag` are strongly " "recommended, since :class:`IntEnum` and :class:`IntFlag` break some semantic " @@ -698,42 +698,42 @@ msgid "" "enumerations, or for interoperability with other systems." msgstr "" -#: ../../howto/enum.rst:864 +#: ../../howto/enum.rst:866 msgid "Others" msgstr "" -#: ../../howto/enum.rst:866 +#: ../../howto/enum.rst:868 msgid "" "While :class:`IntEnum` is part of the :mod:`enum` module, it would be very " "simple to implement independently::" msgstr "" -#: ../../howto/enum.rst:872 +#: ../../howto/enum.rst:874 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:875 +#: ../../howto/enum.rst:877 msgid "Some rules:" msgstr "" -#: ../../howto/enum.rst:877 +#: ../../howto/enum.rst:879 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:880 +#: ../../howto/enum.rst:882 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:883 +#: ../../howto/enum.rst:885 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:" @@ -741,169 +741,169 @@ msgid "" "methods and don't specify another type." msgstr "" -#: ../../howto/enum.rst:887 +#: ../../howto/enum.rst:889 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:890 +#: ../../howto/enum.rst:892 msgid "" "A ``data type`` is a mixin that defines :meth:`__new__`, or a :class:" "`~dataclasses.dataclass`" msgstr "" -#: ../../howto/enum.rst:892 +#: ../../howto/enum.rst:894 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:895 +#: ../../howto/enum.rst:897 msgid "" ":ref:`Formatted string literals `, :meth:`str.format`, and :func:" "`format` will use the enum's :meth:`__str__` method." msgstr "" -#: ../../howto/enum.rst:900 +#: ../../howto/enum.rst:902 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:908 +#: ../../howto/enum.rst:910 msgid "When to use :meth:`__new__` vs. :meth:`__init__`" msgstr "" -#: ../../howto/enum.rst:910 +#: ../../howto/enum.rst:912 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:914 +#: ../../howto/enum.rst:916 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:941 +#: ../../howto/enum.rst:943 msgid "" "*Do not* call ``super().__new__()``, as the lookup-only ``__new__`` is the " "one that is found; instead, use the data type directly." msgstr "" -#: ../../howto/enum.rst:946 +#: ../../howto/enum.rst:948 msgid "Finer Points" msgstr "" -#: ../../howto/enum.rst:949 +#: ../../howto/enum.rst:951 msgid "Supported ``__dunder__`` names" msgstr "" -#: ../../howto/enum.rst:951 +#: ../../howto/enum.rst:953 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:954 +#: ../../howto/enum.rst:956 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:960 +#: ../../howto/enum.rst:962 msgid "Supported ``_sunder_`` names" msgstr "" -#: ../../howto/enum.rst:962 +#: ../../howto/enum.rst:964 msgid "``_name_`` -- name of the member" msgstr "" -#: ../../howto/enum.rst:963 +#: ../../howto/enum.rst:965 msgid "" "``_value_`` -- value of the member; can be set / modified in ``__new__``" msgstr "" -#: ../../howto/enum.rst:965 +#: ../../howto/enum.rst:967 msgid "" "``_missing_`` -- a lookup function used when a value is not found; may be " "overridden" msgstr "" -#: ../../howto/enum.rst:967 +#: ../../howto/enum.rst:969 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:970 +#: ../../howto/enum.rst:972 msgid "" "``_order_`` -- used in Python 2/3 code to ensure member order is consistent " "(class attribute, removed during class creation)" msgstr "" -#: ../../howto/enum.rst:972 +#: ../../howto/enum.rst:974 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:978 +#: ../../howto/enum.rst:980 msgid "" "For standard :class:`Enum` classes the next value chosen is the last value " "seen incremented by one." msgstr "" -#: ../../howto/enum.rst:981 +#: ../../howto/enum.rst:983 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:984 +#: ../../howto/enum.rst:986 msgid "``_missing_``, ``_order_``, ``_generate_next_value_``" msgstr "" -#: ../../howto/enum.rst:985 +#: ../../howto/enum.rst:987 msgid "``_ignore_``" msgstr "" -#: ../../howto/enum.rst:987 +#: ../../howto/enum.rst:989 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:1005 +#: ../../howto/enum.rst:1007 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:1010 +#: ../../howto/enum.rst:1012 msgid "_Private__names" msgstr "" -#: ../../howto/enum.rst:1012 +#: ../../howto/enum.rst:1014 msgid "" ":ref:`Private names ` are not converted to enum " "members, but remain normal attributes." msgstr "" -#: ../../howto/enum.rst:1019 +#: ../../howto/enum.rst:1021 msgid "``Enum`` member type" msgstr "" -#: ../../howto/enum.rst:1021 +#: ../../howto/enum.rst:1023 msgid "" "Enum members are instances of their enum class, and are normally accessed as " "``EnumClass.member``. In certain situations, such as writing custom enum " @@ -913,22 +913,22 @@ msgid "" "strongly recommended." msgstr "" -#: ../../howto/enum.rst:1032 +#: ../../howto/enum.rst:1034 msgid "Creating members that are mixed with other data types" msgstr "" -#: ../../howto/enum.rst:1034 +#: ../../howto/enum.rst:1036 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:1046 +#: ../../howto/enum.rst:1048 msgid "Boolean value of ``Enum`` classes and members" msgstr "" -#: ../../howto/enum.rst:1048 +#: ../../howto/enum.rst:1050 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 " @@ -937,137 +937,137 @@ msgid "" "your class::" msgstr "" -#: ../../howto/enum.rst:1057 +#: ../../howto/enum.rst:1059 msgid "Plain :class:`Enum` classes always evaluate as :data:`True`." msgstr "" -#: ../../howto/enum.rst:1061 +#: ../../howto/enum.rst:1063 msgid "``Enum`` classes with methods" msgstr "" -#: ../../howto/enum.rst:1063 +#: ../../howto/enum.rst:1065 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:1074 +#: ../../howto/enum.rst:1076 msgid "Combining members of ``Flag``" msgstr "" -#: ../../howto/enum.rst:1076 +#: ../../howto/enum.rst:1078 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:1094 +#: ../../howto/enum.rst:1096 msgid "``Flag`` and ``IntFlag`` minutia" msgstr "" -#: ../../howto/enum.rst:1096 +#: ../../howto/enum.rst:1098 msgid "Using the following snippet for our examples::" msgstr "" -#: ../../howto/enum.rst:1107 +#: ../../howto/enum.rst:1109 msgid "the following are true:" msgstr "" -#: ../../howto/enum.rst:1109 +#: ../../howto/enum.rst:1111 msgid "single-bit flags are canonical" msgstr "" -#: ../../howto/enum.rst:1110 +#: ../../howto/enum.rst:1112 msgid "multi-bit and zero-bit flags are aliases" msgstr "" -#: ../../howto/enum.rst:1111 +#: ../../howto/enum.rst:1113 msgid "only canonical flags are returned during iteration::" msgstr "" -#: ../../howto/enum.rst:1116 +#: ../../howto/enum.rst:1118 msgid "" "negating a flag or flag set returns a new flag/flag set with the " "corresponding positive integer value::" msgstr "" -#: ../../howto/enum.rst:1125 +#: ../../howto/enum.rst:1127 msgid "names of pseudo-flags are constructed from their members' names::" msgstr "" -#: ../../howto/enum.rst:1130 +#: ../../howto/enum.rst:1132 msgid "multi-bit flags, aka aliases, can be returned from operations::" msgstr "" -#: ../../howto/enum.rst:1141 +#: ../../howto/enum.rst:1143 msgid "" "membership / containment checking: zero-valued flags are always considered " "to be contained::" msgstr "" -#: ../../howto/enum.rst:1147 +#: ../../howto/enum.rst:1149 msgid "" "otherwise, only if all bits of one flag are in the other flag will True be " "returned::" msgstr "" -#: ../../howto/enum.rst:1156 +#: ../../howto/enum.rst:1158 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:1159 +#: ../../howto/enum.rst:1161 msgid "STRICT --> raises an exception when presented with invalid values" msgstr "" -#: ../../howto/enum.rst:1160 +#: ../../howto/enum.rst:1162 msgid "CONFORM --> discards any invalid bits" msgstr "" -#: ../../howto/enum.rst:1161 +#: ../../howto/enum.rst:1163 msgid "EJECT --> lose Flag status and become a normal int with the given value" msgstr "" -#: ../../howto/enum.rst:1162 +#: ../../howto/enum.rst:1164 msgid "KEEP --> keep the extra bits" msgstr "" -#: ../../howto/enum.rst:1164 +#: ../../howto/enum.rst:1166 msgid "keeps Flag status and extra bits" msgstr "" -#: ../../howto/enum.rst:1165 +#: ../../howto/enum.rst:1167 msgid "extra bits do not show up in iteration" msgstr "" -#: ../../howto/enum.rst:1166 +#: ../../howto/enum.rst:1168 msgid "extra bits do show up in repr() and str()" msgstr "" -#: ../../howto/enum.rst:1168 +#: ../../howto/enum.rst:1170 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:1176 +#: ../../howto/enum.rst:1178 msgid "How are Enums and Flags different?" msgstr "" -#: ../../howto/enum.rst:1178 +#: ../../howto/enum.rst:1180 msgid "" "Enums have a custom metaclass that affects many aspects of both derived :" "class:`Enum` classes and their instances (members)." msgstr "" -#: ../../howto/enum.rst:1183 +#: ../../howto/enum.rst:1185 msgid "Enum Classes" msgstr "" -#: ../../howto/enum.rst:1185 +#: ../../howto/enum.rst:1187 msgid "" "The :class:`EnumType` metaclass is responsible for providing the :meth:" "`__contains__`, :meth:`__dir__`, :meth:`__iter__` and other methods that " @@ -1078,11 +1078,11 @@ msgid "" "`__getnewargs__`, :meth:`__str__` and :meth:`__repr__`)." msgstr "" -#: ../../howto/enum.rst:1194 +#: ../../howto/enum.rst:1196 msgid "Flag Classes" msgstr "" -#: ../../howto/enum.rst:1196 +#: ../../howto/enum.rst:1198 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 " @@ -1091,11 +1091,11 @@ msgid "" "considered an alias." msgstr "" -#: ../../howto/enum.rst:1202 +#: ../../howto/enum.rst:1204 msgid "Enum Members (aka instances)" msgstr "" -#: ../../howto/enum.rst:1204 +#: ../../howto/enum.rst:1206 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 " @@ -1104,37 +1104,37 @@ msgid "" "instances." msgstr "" -#: ../../howto/enum.rst:1210 +#: ../../howto/enum.rst:1212 msgid "Flag Members" msgstr "" -#: ../../howto/enum.rst:1212 +#: ../../howto/enum.rst:1214 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:1218 +#: ../../howto/enum.rst:1220 msgid "(Note that ``BLACK``, ``PURPLE``, and ``WHITE`` do not show up.)" msgstr "" -#: ../../howto/enum.rst:1220 +#: ../../howto/enum.rst:1222 msgid "" "Inverting a flag member returns the corresponding positive value, rather " "than a negative value --- for example::" msgstr "" -#: ../../howto/enum.rst:1226 +#: ../../howto/enum.rst:1228 msgid "" "Flag members have a length corresponding to the number of power-of-two " "values they contain. For example::" msgstr "" -#: ../../howto/enum.rst:1236 +#: ../../howto/enum.rst:1238 msgid "Enum Cookbook" msgstr "" -#: ../../howto/enum.rst:1239 +#: ../../howto/enum.rst:1241 msgid "" "While :class:`Enum`, :class:`IntEnum`, :class:`StrEnum`, :class:`Flag`, and :" "class:`IntFlag` are expected to cover the majority of use-cases, they cannot " @@ -1142,155 +1142,155 @@ msgid "" "that can be used directly, or as examples for creating one's own." msgstr "" -#: ../../howto/enum.rst:1246 +#: ../../howto/enum.rst:1248 msgid "Omitting values" msgstr "" -#: ../../howto/enum.rst:1248 +#: ../../howto/enum.rst:1250 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:1251 +#: ../../howto/enum.rst:1253 msgid "use instances of :class:`auto` for the value" msgstr "" -#: ../../howto/enum.rst:1252 +#: ../../howto/enum.rst:1254 msgid "use instances of :class:`object` as the value" msgstr "" -#: ../../howto/enum.rst:1253 +#: ../../howto/enum.rst:1255 msgid "use a descriptive string as the value" msgstr "" -#: ../../howto/enum.rst:1254 +#: ../../howto/enum.rst:1256 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:1257 +#: ../../howto/enum.rst:1259 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:1263 +#: ../../howto/enum.rst:1265 msgid "Using :class:`auto`" msgstr "" -#: ../../howto/enum.rst:1265 +#: ../../howto/enum.rst:1267 msgid "Using :class:`auto` would look like::" msgstr "" -#: ../../howto/enum.rst:1277 +#: ../../howto/enum.rst:1279 msgid "Using :class:`object`" msgstr "" -#: ../../howto/enum.rst:1279 +#: ../../howto/enum.rst:1281 msgid "Using :class:`object` would look like::" msgstr "" -#: ../../howto/enum.rst:1289 +#: ../../howto/enum.rst:1291 msgid "" "This is also a good example of why you might want to write your own :meth:" "`__repr__`::" msgstr "" -#: ../../howto/enum.rst:1305 +#: ../../howto/enum.rst:1307 msgid "Using a descriptive string" msgstr "" -#: ../../howto/enum.rst:1307 +#: ../../howto/enum.rst:1309 msgid "Using a string as the value would look like::" msgstr "" -#: ../../howto/enum.rst:1319 +#: ../../howto/enum.rst:1321 msgid "Using a custom :meth:`__new__`" msgstr "" -#: ../../howto/enum.rst:1321 +#: ../../howto/enum.rst:1323 msgid "Using an auto-numbering :meth:`__new__` would look like::" msgstr "" -#: ../../howto/enum.rst:1338 +#: ../../howto/enum.rst:1340 msgid "" "To make a more general purpose ``AutoNumber``, add ``*args`` to the " "signature::" msgstr "" -#: ../../howto/enum.rst:1348 +#: ../../howto/enum.rst:1350 msgid "" "Then when you inherit from ``AutoNumber`` you can write your own " "``__init__`` to handle any extra arguments::" msgstr "" -#: ../../howto/enum.rst:1367 +#: ../../howto/enum.rst:1369 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:1373 +#: ../../howto/enum.rst:1375 msgid "" "*Do not* call ``super().__new__()``, as the lookup-only ``__new__`` is the " "one that is found; instead, use the data type directly -- e.g.::" msgstr "" -#: ../../howto/enum.rst:1380 +#: ../../howto/enum.rst:1382 msgid "OrderedEnum" msgstr "" -#: ../../howto/enum.rst:1382 +#: ../../howto/enum.rst:1384 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:1416 +#: ../../howto/enum.rst:1418 msgid "DuplicateFreeEnum" msgstr "" -#: ../../howto/enum.rst:1418 +#: ../../howto/enum.rst:1420 msgid "" "Raises an error if a duplicate member value is found instead of creating an " "alias::" msgstr "" -#: ../../howto/enum.rst:1443 +#: ../../howto/enum.rst:1446 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:1449 +#: ../../howto/enum.rst:1452 msgid "Planet" msgstr "" -#: ../../howto/enum.rst:1451 +#: ../../howto/enum.rst:1454 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:1480 +#: ../../howto/enum.rst:1483 msgid "TimePeriod" msgstr "" -#: ../../howto/enum.rst:1482 +#: ../../howto/enum.rst:1485 msgid "An example to show the :attr:`_ignore_` attribute in use::" msgstr "" -#: ../../howto/enum.rst:1501 +#: ../../howto/enum.rst:1504 msgid "Subclassing EnumType" msgstr "" -#: ../../howto/enum.rst:1503 +#: ../../howto/enum.rst:1506 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/regex.po b/howto/regex.po index e9df685f6d..79836d436a 100644 --- a/howto/regex.po +++ b/howto/regex.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-24 00:03+0000\n" +"POT-Creation-Date: 2023-10-24 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:37+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -455,6 +455,12 @@ msgstr "" #: ../../howto/regex.rst:248 msgid "" +"The simplest case ``{m}`` matches the preceding item exactly *m* times. For " +"example, ``a/{2}b`` will only match ``'a//b'``." +msgstr "" + +#: ../../howto/regex.rst:251 +msgid "" "Readers of a reductionist bent may notice that the three other quantifiers " "can all be expressed using this notation. ``{0,}`` is the same as ``*``, " "``{1,}`` is equivalent to ``+``, and ``{0,1}`` is the same as ``?``. It's " @@ -462,11 +468,11 @@ msgid "" "shorter and easier to read." msgstr "" -#: ../../howto/regex.rst:256 +#: ../../howto/regex.rst:259 msgid "Using Regular Expressions" msgstr "" -#: ../../howto/regex.rst:258 +#: ../../howto/regex.rst:261 msgid "" "Now that we've looked at some simple regular expressions, how do we actually " "use them in Python? The :mod:`re` module provides an interface to the " @@ -474,25 +480,25 @@ msgid "" "perform matches with them." msgstr "" -#: ../../howto/regex.rst:265 +#: ../../howto/regex.rst:268 msgid "Compiling Regular Expressions" msgstr "" -#: ../../howto/regex.rst:267 +#: ../../howto/regex.rst:270 msgid "" "Regular expressions are compiled into pattern objects, which have methods " "for various operations such as searching for pattern matches or performing " "string substitutions. ::" msgstr "" -#: ../../howto/regex.rst:276 +#: ../../howto/regex.rst:279 msgid "" ":func:`re.compile` also accepts an optional *flags* argument, used to enable " "various special features and syntax variations. We'll go over the available " "settings later, but for now a single example will do::" msgstr "" -#: ../../howto/regex.rst:282 +#: ../../howto/regex.rst:285 msgid "" "The RE is passed to :func:`re.compile` as a string. REs are handled as " "strings because regular expressions aren't part of the core Python language, " @@ -503,17 +509,17 @@ msgid "" "`socket` or :mod:`zlib` modules." msgstr "" -#: ../../howto/regex.rst:289 +#: ../../howto/regex.rst:292 msgid "" "Putting REs in strings keeps the Python language simpler, but has one " "disadvantage which is the topic of the next section." msgstr "" -#: ../../howto/regex.rst:296 +#: ../../howto/regex.rst:299 msgid "The Backslash Plague" msgstr "" -#: ../../howto/regex.rst:298 +#: ../../howto/regex.rst:301 msgid "" "As stated earlier, regular expressions use the backslash character " "(``'\\'``) to indicate special forms or to allow special characters to be " @@ -521,7 +527,7 @@ msgid "" "usage of the same character for the same purpose in string literals." msgstr "" -#: ../../howto/regex.rst:303 +#: ../../howto/regex.rst:306 msgid "" "Let's say you want to write a RE that matches the string ``\\section``, " "which might be found in a LaTeX file. To figure out what to write in the " @@ -533,39 +539,39 @@ msgid "" "*again*." msgstr "" -#: ../../howto/regex.rst:312 +#: ../../howto/regex.rst:315 msgid "Characters" msgstr "" -#: ../../howto/regex.rst:312 +#: ../../howto/regex.rst:315 msgid "Stage" msgstr "" -#: ../../howto/regex.rst:314 +#: ../../howto/regex.rst:317 msgid "``\\section``" msgstr "``\\section``" -#: ../../howto/regex.rst:314 +#: ../../howto/regex.rst:317 msgid "Text string to be matched" msgstr "" -#: ../../howto/regex.rst:316 +#: ../../howto/regex.rst:319 msgid "``\\\\section``" msgstr "``\\\\section``" -#: ../../howto/regex.rst:316 +#: ../../howto/regex.rst:319 msgid "Escaped backslash for :func:`re.compile`" msgstr "" -#: ../../howto/regex.rst:318 ../../howto/regex.rst:345 +#: ../../howto/regex.rst:321 ../../howto/regex.rst:348 msgid "``\"\\\\\\\\section\"``" msgstr "``\"\\\\\\\\section\"``" -#: ../../howto/regex.rst:318 +#: ../../howto/regex.rst:321 msgid "Escaped backslashes for a string literal" msgstr "" -#: ../../howto/regex.rst:321 +#: ../../howto/regex.rst:324 msgid "" "In short, to match a literal backslash, one has to write ``'\\\\\\\\'`` as " "the RE string, because the regular expression must be ``\\\\``, and each " @@ -574,7 +580,7 @@ msgid "" "repeated backslashes and makes the resulting strings difficult to understand." msgstr "" -#: ../../howto/regex.rst:327 +#: ../../howto/regex.rst:330 msgid "" "The solution is to use Python's raw string notation for regular expressions; " "backslashes are not handled in any special way in a string literal prefixed " @@ -584,7 +590,7 @@ msgid "" "raw string notation." msgstr "" -#: ../../howto/regex.rst:333 +#: ../../howto/regex.rst:336 msgid "" "In addition, special escape sequences that are valid in regular expressions, " "but not valid as Python string literals, now result in a :exc:" @@ -593,39 +599,39 @@ msgid "" "backslashes isn't used." msgstr "" -#: ../../howto/regex.rst:341 +#: ../../howto/regex.rst:344 msgid "Regular String" msgstr "" -#: ../../howto/regex.rst:341 +#: ../../howto/regex.rst:344 msgid "Raw string" msgstr "" -#: ../../howto/regex.rst:343 +#: ../../howto/regex.rst:346 msgid "``\"ab*\"``" msgstr "``\"ab*\"``" -#: ../../howto/regex.rst:343 +#: ../../howto/regex.rst:346 msgid "``r\"ab*\"``" msgstr "``r\"ab*\"``" -#: ../../howto/regex.rst:345 +#: ../../howto/regex.rst:348 msgid "``r\"\\\\section\"``" msgstr "``r\"\\\\section\"``" -#: ../../howto/regex.rst:347 +#: ../../howto/regex.rst:350 msgid "``\"\\\\w+\\\\s+\\\\1\"``" msgstr "``\"\\\\w+\\\\s+\\\\1\"``" -#: ../../howto/regex.rst:347 +#: ../../howto/regex.rst:350 msgid "``r\"\\w+\\s+\\1\"``" msgstr "``r\"\\w+\\s+\\1\"``" -#: ../../howto/regex.rst:352 +#: ../../howto/regex.rst:355 msgid "Performing Matches" msgstr "" -#: ../../howto/regex.rst:354 +#: ../../howto/regex.rst:357 msgid "" "Once you have an object representing a compiled regular expression, what do " "you do with it? Pattern objects have several methods and attributes. Only " @@ -633,51 +639,51 @@ msgid "" "for a complete listing." msgstr "" -#: ../../howto/regex.rst:360 ../../howto/regex.rst:414 -#: ../../howto/regex.rst:1062 +#: ../../howto/regex.rst:363 ../../howto/regex.rst:417 +#: ../../howto/regex.rst:1065 msgid "Method/Attribute" msgstr "" -#: ../../howto/regex.rst:360 ../../howto/regex.rst:414 -#: ../../howto/regex.rst:1062 +#: ../../howto/regex.rst:363 ../../howto/regex.rst:417 +#: ../../howto/regex.rst:1065 msgid "Purpose" msgstr "" -#: ../../howto/regex.rst:362 +#: ../../howto/regex.rst:365 msgid "``match()``" msgstr "``match()``" -#: ../../howto/regex.rst:362 +#: ../../howto/regex.rst:365 msgid "Determine if the RE matches at the beginning of the string." msgstr "" -#: ../../howto/regex.rst:365 +#: ../../howto/regex.rst:368 msgid "``search()``" msgstr "``search()``" -#: ../../howto/regex.rst:365 +#: ../../howto/regex.rst:368 msgid "Scan through a string, looking for any location where this RE matches." msgstr "" -#: ../../howto/regex.rst:368 +#: ../../howto/regex.rst:371 msgid "``findall()``" msgstr "``findall()``" -#: ../../howto/regex.rst:368 +#: ../../howto/regex.rst:371 msgid "Find all substrings where the RE matches, and returns them as a list." msgstr "" -#: ../../howto/regex.rst:371 +#: ../../howto/regex.rst:374 msgid "``finditer()``" msgstr "``finditer()``" -#: ../../howto/regex.rst:371 +#: ../../howto/regex.rst:374 msgid "" "Find all substrings where the RE matches, and returns them as an :term:" "`iterator`." msgstr "" -#: ../../howto/regex.rst:375 +#: ../../howto/regex.rst:378 msgid "" ":meth:`~re.Pattern.match` and :meth:`~re.Pattern.search` return ``None`` if " "no match can be found. If they're successful, a :ref:`match object `, so you should store the result in a variable for later use. ::" msgstr "" -#: ../../howto/regex.rst:409 +#: ../../howto/regex.rst:412 msgid "" "Now you can query the :ref:`match object ` for information " "about the matching string. Match object instances also have several methods " "and attributes; the most important ones are:" msgstr "" -#: ../../howto/regex.rst:416 +#: ../../howto/regex.rst:419 msgid "``group()``" msgstr "``group()``" -#: ../../howto/regex.rst:416 +#: ../../howto/regex.rst:419 msgid "Return the string matched by the RE" msgstr "" -#: ../../howto/regex.rst:418 +#: ../../howto/regex.rst:421 msgid "``start()``" msgstr "``start()``" -#: ../../howto/regex.rst:418 +#: ../../howto/regex.rst:421 msgid "Return the starting position of the match" msgstr "" -#: ../../howto/regex.rst:420 +#: ../../howto/regex.rst:423 msgid "``end()``" msgstr "``end()``" -#: ../../howto/regex.rst:420 +#: ../../howto/regex.rst:423 msgid "Return the ending position of the match" msgstr "" -#: ../../howto/regex.rst:422 +#: ../../howto/regex.rst:425 msgid "``span()``" msgstr "``span()``" -#: ../../howto/regex.rst:422 +#: ../../howto/regex.rst:425 msgid "Return a tuple containing the (start, end) positions of the match" msgstr "" -#: ../../howto/regex.rst:426 +#: ../../howto/regex.rst:429 msgid "Trying these methods will soon clarify their meaning::" msgstr "" -#: ../../howto/regex.rst:435 +#: ../../howto/regex.rst:438 msgid "" ":meth:`~re.Match.group` returns the substring that was matched by the RE. :" "meth:`~re.Match.start` and :meth:`~re.Match.end` return the starting and " @@ -768,20 +774,20 @@ msgid "" "case. ::" msgstr "" -#: ../../howto/regex.rst:452 +#: ../../howto/regex.rst:455 msgid "" "In actual programs, the most common style is to store the :ref:`match object " "` in a variable, and then check if it was ``None``. This " "usually looks like::" msgstr "" -#: ../../howto/regex.rst:463 +#: ../../howto/regex.rst:466 msgid "" "Two pattern methods return all of the matches for a pattern. :meth:`~re." "Pattern.findall` returns a list of matching strings::" msgstr "" -#: ../../howto/regex.rst:470 +#: ../../howto/regex.rst:473 msgid "" "The ``r`` prefix, making the literal a raw string literal, is needed in this " "example because escape sequences in a normal \"cooked\" string literal that " @@ -790,7 +796,7 @@ msgid "" "`SyntaxError`. See :ref:`the-backslash-plague`." msgstr "" -#: ../../howto/regex.rst:476 +#: ../../howto/regex.rst:479 msgid "" ":meth:`~re.Pattern.findall` has to create the entire list before it can be " "returned as the result. The :meth:`~re.Pattern.finditer` method returns a " @@ -798,11 +804,11 @@ msgid "" "`iterator`::" msgstr "" -#: ../../howto/regex.rst:492 +#: ../../howto/regex.rst:495 msgid "Module-Level Functions" msgstr "" -#: ../../howto/regex.rst:494 +#: ../../howto/regex.rst:497 msgid "" "You don't have to create a pattern object and call its methods; the :mod:" "`re` module also provides top-level functions called :func:`~re.match`, :" @@ -812,7 +818,7 @@ msgid "" "``None`` or a :ref:`match object ` instance. ::" msgstr "" -#: ../../howto/regex.rst:506 +#: ../../howto/regex.rst:509 msgid "" "Under the hood, these functions simply create a pattern object for you and " "call the appropriate method on it. They also store the compiled object in a " @@ -820,7 +826,7 @@ msgid "" "again and again." msgstr "" -#: ../../howto/regex.rst:511 +#: ../../howto/regex.rst:514 msgid "" "Should you use these module-level functions, or should you get the pattern " "and call its methods yourself? If you're accessing a regex within a loop, " @@ -828,11 +834,11 @@ msgid "" "not much difference thanks to the internal cache." msgstr "" -#: ../../howto/regex.rst:519 +#: ../../howto/regex.rst:522 msgid "Compilation Flags" msgstr "" -#: ../../howto/regex.rst:523 +#: ../../howto/regex.rst:526 msgid "" "Compilation flags let you modify some aspects of how regular expressions " "work. Flags are available in the :mod:`re` module under two names, a long " @@ -844,72 +850,72 @@ msgid "" "example." msgstr "" -#: ../../howto/regex.rst:531 +#: ../../howto/regex.rst:534 msgid "" "Here's a table of the available flags, followed by a more detailed " "explanation of each one." msgstr "" -#: ../../howto/regex.rst:535 +#: ../../howto/regex.rst:538 msgid "Flag" msgstr "" -#: ../../howto/regex.rst:535 +#: ../../howto/regex.rst:538 msgid "Meaning" msgstr "" -#: ../../howto/regex.rst:537 +#: ../../howto/regex.rst:540 msgid ":const:`ASCII`, :const:`A`" msgstr ":const:`ASCII`, :const:`A`" -#: ../../howto/regex.rst:537 +#: ../../howto/regex.rst:540 msgid "" "Makes several escapes like ``\\w``, ``\\b``, ``\\s`` and ``\\d`` match only " "on ASCII characters with the respective property." msgstr "" -#: ../../howto/regex.rst:541 +#: ../../howto/regex.rst:544 msgid ":const:`DOTALL`, :const:`S`" msgstr ":const:`DOTALL`, :const:`S`" -#: ../../howto/regex.rst:541 +#: ../../howto/regex.rst:544 msgid "Make ``.`` match any character, including newlines." msgstr "" -#: ../../howto/regex.rst:544 +#: ../../howto/regex.rst:547 msgid ":const:`IGNORECASE`, :const:`I`" msgstr ":const:`IGNORECASE`, :const:`I`" -#: ../../howto/regex.rst:544 +#: ../../howto/regex.rst:547 msgid "Do case-insensitive matches." msgstr "" -#: ../../howto/regex.rst:546 +#: ../../howto/regex.rst:549 msgid ":const:`LOCALE`, :const:`L`" msgstr ":const:`LOCALE`, :const:`L`" -#: ../../howto/regex.rst:546 +#: ../../howto/regex.rst:549 msgid "Do a locale-aware match." msgstr "" -#: ../../howto/regex.rst:548 +#: ../../howto/regex.rst:551 msgid ":const:`MULTILINE`, :const:`M`" msgstr ":const:`MULTILINE`, :const:`M`" -#: ../../howto/regex.rst:548 +#: ../../howto/regex.rst:551 msgid "Multi-line matching, affecting ``^`` and ``$``." msgstr "" -#: ../../howto/regex.rst:551 +#: ../../howto/regex.rst:554 msgid ":const:`VERBOSE`, :const:`X` (for 'extended')" msgstr "" -#: ../../howto/regex.rst:551 +#: ../../howto/regex.rst:554 msgid "" "Enable verbose REs, which can be organized more cleanly and understandably." msgstr "" -#: ../../howto/regex.rst:560 +#: ../../howto/regex.rst:563 msgid "" "Perform case-insensitive matching; character class and literal strings will " "match letters by ignoring case. For example, ``[A-Z]`` will match lowercase " @@ -925,13 +931,13 @@ msgid "" "also set the :const:`LOCALE` flag." msgstr "" -#: ../../howto/regex.rst:578 +#: ../../howto/regex.rst:581 msgid "" "Make ``\\w``, ``\\W``, ``\\b``, ``\\B`` and case-insensitive matching " "dependent on the current locale instead of the Unicode database." msgstr "" -#: ../../howto/regex.rst:581 +#: ../../howto/regex.rst:584 msgid "" "Locales are a feature of the C library intended to help in writing programs " "that take account of language differences. For example, if you're " @@ -950,13 +956,13 @@ msgid "" "patterns, and it is able to handle different locales/languages." msgstr "" -#: ../../howto/regex.rst:603 +#: ../../howto/regex.rst:606 msgid "" "(``^`` and ``$`` haven't been explained yet; they'll be introduced in " "section :ref:`more-metacharacters`.)" msgstr "" -#: ../../howto/regex.rst:606 +#: ../../howto/regex.rst:609 msgid "" "Usually ``^`` matches only at the beginning of the string, and ``$`` matches " "only at the end of the string and immediately before the newline (if any) at " @@ -967,20 +973,20 @@ msgid "" "(immediately preceding each newline)." msgstr "" -#: ../../howto/regex.rst:619 +#: ../../howto/regex.rst:622 msgid "" "Makes the ``'.'`` special character match any character at all, including a " "newline; without this flag, ``'.'`` will match anything *except* a newline." msgstr "" -#: ../../howto/regex.rst:627 +#: ../../howto/regex.rst:630 msgid "" "Make ``\\w``, ``\\W``, ``\\b``, ``\\B``, ``\\s`` and ``\\S`` perform ASCII-" "only matching instead of full Unicode matching. This is only meaningful for " "Unicode patterns, and is ignored for byte patterns." msgstr "" -#: ../../howto/regex.rst:636 +#: ../../howto/regex.rst:639 msgid "" "This flag allows you to write regular expressions that are more readable by " "granting you more flexibility in how you can format them. When this flag " @@ -992,45 +998,45 @@ msgid "" "preceded by an unescaped backslash." msgstr "" -#: ../../howto/regex.rst:645 +#: ../../howto/regex.rst:648 msgid "" "For example, here's a RE that uses :const:`re.VERBOSE`; see how much easier " "it is to read? ::" msgstr "" -#: ../../howto/regex.rst:658 +#: ../../howto/regex.rst:661 msgid "Without the verbose setting, the RE would look like this::" msgstr "" -#: ../../howto/regex.rst:664 +#: ../../howto/regex.rst:667 msgid "" "In the above example, Python's automatic concatenation of string literals " "has been used to break up the RE into smaller pieces, but it's still more " "difficult to understand than the version using :const:`re.VERBOSE`." msgstr "" -#: ../../howto/regex.rst:670 +#: ../../howto/regex.rst:673 msgid "More Pattern Power" msgstr "" -#: ../../howto/regex.rst:672 +#: ../../howto/regex.rst:675 msgid "" "So far we've only covered a part of the features of regular expressions. In " "this section, we'll cover some new metacharacters, and how to use groups to " "retrieve portions of the text that was matched." msgstr "" -#: ../../howto/regex.rst:680 +#: ../../howto/regex.rst:683 msgid "More Metacharacters" msgstr "" -#: ../../howto/regex.rst:682 +#: ../../howto/regex.rst:685 msgid "" "There are some metacharacters that we haven't covered yet. Most of them " "will be covered in this section." msgstr "" -#: ../../howto/regex.rst:685 +#: ../../howto/regex.rst:688 msgid "" "Some of the remaining metacharacters to be discussed are :dfn:`zero-width " "assertions`. They don't cause the engine to advance through the string; " @@ -1042,11 +1048,11 @@ msgid "" "of times." msgstr "" -#: ../../howto/regex.rst:701 +#: ../../howto/regex.rst:704 msgid "``|``" msgstr "``|``" -#: ../../howto/regex.rst:694 +#: ../../howto/regex.rst:697 msgid "" "Alternation, or the \"or\" operator. If *A* and *B* are regular " "expressions, ``A|B`` will match any string that matches either *A* or *B*. " @@ -1056,17 +1062,17 @@ msgid "" "``'ervo'``." msgstr "" -#: ../../howto/regex.rst:700 +#: ../../howto/regex.rst:703 msgid "" "To match a literal ``'|'``, use ``\\|``, or enclose it inside a character " "class, as in ``[|]``." msgstr "" -#: ../../howto/regex.rst:716 +#: ../../howto/regex.rst:719 msgid "``^``" msgstr "``^``" -#: ../../howto/regex.rst:704 +#: ../../howto/regex.rst:707 msgid "" "Matches at the beginning of lines. Unless the :const:`MULTILINE` flag has " "been set, this will only match at the beginning of the string. In :const:" @@ -1074,37 +1080,37 @@ msgid "" "the string." msgstr "" -#: ../../howto/regex.rst:708 +#: ../../howto/regex.rst:711 msgid "" "For example, if you wish to match the word ``From`` only at the beginning of " "a line, the RE to use is ``^From``. ::" msgstr "" -#: ../../howto/regex.rst:716 +#: ../../howto/regex.rst:719 msgid "To match a literal ``'^'``, use ``\\^``." msgstr "" -#: ../../howto/regex.rst:730 +#: ../../howto/regex.rst:733 msgid "``$``" msgstr "``$``" -#: ../../howto/regex.rst:719 +#: ../../howto/regex.rst:722 msgid "" "Matches at the end of a line, which is defined as either the end of the " "string, or any location followed by a newline character. ::" msgstr "" -#: ../../howto/regex.rst:729 +#: ../../howto/regex.rst:732 msgid "" "To match a literal ``'$'``, use ``\\$`` or enclose it inside a character " "class, as in ``[$]``." msgstr "" -#: ../../howto/regex.rst:736 +#: ../../howto/regex.rst:739 msgid "``\\A``" msgstr "``\\A``" -#: ../../howto/regex.rst:733 +#: ../../howto/regex.rst:736 msgid "" "Matches only at the start of the string. When not in :const:`MULTILINE` " "mode, ``\\A`` and ``^`` are effectively the same. In :const:`MULTILINE` " @@ -1113,19 +1119,19 @@ msgid "" "newline character." msgstr "" -#: ../../howto/regex.rst:739 +#: ../../howto/regex.rst:742 msgid "``\\Z``" msgstr "``\\Z``" -#: ../../howto/regex.rst:739 +#: ../../howto/regex.rst:742 msgid "Matches only at the end of the string." msgstr "" -#: ../../howto/regex.rst:774 +#: ../../howto/regex.rst:777 msgid "``\\b``" msgstr "``\\b``" -#: ../../howto/regex.rst:742 +#: ../../howto/regex.rst:745 msgid "" "Word boundary. This is a zero-width assertion that matches only at the " "beginning or end of a word. A word is defined as a sequence of alphanumeric " @@ -1133,13 +1139,13 @@ msgid "" "alphanumeric character." msgstr "" -#: ../../howto/regex.rst:747 +#: ../../howto/regex.rst:750 msgid "" "The following example matches ``class`` only when it's a complete word; it " "won't match when it's contained inside another word. ::" msgstr "" -#: ../../howto/regex.rst:758 +#: ../../howto/regex.rst:761 msgid "" "There are two subtleties you should remember when using this special " "sequence. First, this is the worst collision between Python's string " @@ -1150,28 +1156,28 @@ msgid "" "previous RE, but omits the ``'r'`` in front of the RE string. ::" msgstr "" -#: ../../howto/regex.rst:772 +#: ../../howto/regex.rst:775 msgid "" "Second, inside a character class, where there's no use for this assertion, " "``\\b`` represents the backspace character, for compatibility with Python's " "string literals." msgstr "" -#: ../../howto/regex.rst:779 +#: ../../howto/regex.rst:782 msgid "``\\B``" msgstr "``\\B``" -#: ../../howto/regex.rst:777 +#: ../../howto/regex.rst:780 msgid "" "Another zero-width assertion, this is the opposite of ``\\b``, only matching " "when the current position is not at a word boundary." msgstr "" -#: ../../howto/regex.rst:782 +#: ../../howto/regex.rst:785 msgid "Grouping" msgstr "" -#: ../../howto/regex.rst:784 +#: ../../howto/regex.rst:787 msgid "" "Frequently you need to obtain more information than just whether the RE " "matched or not. Regular expressions are often used to dissect strings by " @@ -1180,14 +1186,14 @@ msgid "" "name and a value, separated by a ``':'``, like this:" msgstr "" -#: ../../howto/regex.rst:797 +#: ../../howto/regex.rst:800 msgid "" "This can be handled by writing a regular expression which matches an entire " "header line, and has one group which matches the header name, and another " "group which matches the header's value." msgstr "" -#: ../../howto/regex.rst:801 +#: ../../howto/regex.rst:804 msgid "" "Groups are marked by the ``'('``, ``')'`` metacharacters. ``'('`` and " "``')'`` have much the same meaning as they do in mathematical expressions; " @@ -1197,7 +1203,7 @@ msgid "" "repetitions of ``ab``. ::" msgstr "" -#: ../../howto/regex.rst:812 +#: ../../howto/regex.rst:815 msgid "" "Groups indicated with ``'('``, ``')'`` also capture the starting and ending " "index of the text that they match; this can be retrieved by passing an " @@ -1209,27 +1215,27 @@ msgid "" "they match. ::" msgstr "" -#: ../../howto/regex.rst:828 +#: ../../howto/regex.rst:831 msgid "" "Subgroups are numbered from left to right, from 1 upward. Groups can be " "nested; to determine the number, just count the opening parenthesis " "characters, going from left to right. ::" msgstr "" -#: ../../howto/regex.rst:841 +#: ../../howto/regex.rst:844 msgid "" ":meth:`~re.Match.group` can be passed multiple group numbers at a time, in " "which case it will return a tuple containing the corresponding values for " "those groups. ::" msgstr "" -#: ../../howto/regex.rst:847 +#: ../../howto/regex.rst:850 msgid "" "The :meth:`~re.Match.groups` method returns a tuple containing the strings " "for all the subgroups, from 1 up to however many there are. ::" msgstr "" -#: ../../howto/regex.rst:853 +#: ../../howto/regex.rst:856 msgid "" "Backreferences in a pattern allow you to specify that the contents of an " "earlier capturing group must also be found at the current location in the " @@ -1240,11 +1246,11 @@ msgid "" "when incorporating backreferences in a RE." msgstr "" -#: ../../howto/regex.rst:861 +#: ../../howto/regex.rst:864 msgid "For example, the following RE detects doubled words in a string. ::" msgstr "" -#: ../../howto/regex.rst:867 +#: ../../howto/regex.rst:870 msgid "" "Backreferences like this aren't often useful for just searching through a " "string --- there are few text formats which repeat data in this way --- but " @@ -1252,11 +1258,11 @@ msgid "" "substitutions." msgstr "" -#: ../../howto/regex.rst:873 +#: ../../howto/regex.rst:876 msgid "Non-capturing and Named Groups" msgstr "" -#: ../../howto/regex.rst:875 +#: ../../howto/regex.rst:878 msgid "" "Elaborate REs may use many groups, both to capture substrings of interest, " "and to group and structure the RE itself. In complex REs, it becomes " @@ -1265,7 +1271,7 @@ msgid "" "expression extensions, so we'll look at that first." msgstr "" -#: ../../howto/regex.rst:881 +#: ../../howto/regex.rst:884 msgid "" "Perl 5 is well known for its powerful additions to standard regular " "expressions. For these new features the Perl developers couldn't choose new " @@ -1276,7 +1282,7 @@ msgid "" "wouldn't have escaped it by writing ``\\&`` or ``[&]``." msgstr "" -#: ../../howto/regex.rst:888 +#: ../../howto/regex.rst:891 msgid "" "The solution chosen by the Perl developers was to use ``(?...)`` as the " "extension syntax. ``?`` immediately after a parenthesis was a syntax error " @@ -1287,20 +1293,20 @@ msgid "" "capturing group containing the subexpression ``foo``)." msgstr "" -#: ../../howto/regex.rst:896 +#: ../../howto/regex.rst:899 msgid "" "Python supports several of Perl's extensions and adds an extension syntax to " "Perl's extension syntax. If the first character after the question mark is " "a ``P``, you know that it's an extension that's specific to Python." msgstr "" -#: ../../howto/regex.rst:901 +#: ../../howto/regex.rst:904 msgid "" "Now that we've looked at the general extension syntax, we can return to the " "features that simplify working with groups in complex REs." msgstr "" -#: ../../howto/regex.rst:904 +#: ../../howto/regex.rst:907 msgid "" "Sometimes you'll want to use a group to denote a part of a regular " "expression, but aren't interested in retrieving the group's contents. You " @@ -1308,7 +1314,7 @@ msgid "" "where you can replace the ``...`` with any other regular expression. ::" msgstr "" -#: ../../howto/regex.rst:916 +#: ../../howto/regex.rst:919 msgid "" "Except for the fact that you can't retrieve the contents of what the group " "matched, a non-capturing group behaves exactly the same as a capturing " @@ -1321,13 +1327,13 @@ msgid "" "groups; neither form is any faster than the other." msgstr "" -#: ../../howto/regex.rst:925 +#: ../../howto/regex.rst:928 msgid "" "A more significant feature is named groups: instead of referring to them by " "numbers, groups can be referenced by a name." msgstr "" -#: ../../howto/regex.rst:928 +#: ../../howto/regex.rst:931 msgid "" "The syntax for a named group is one of the Python-specific extensions: ``(?" "P...)``. *name* is, obviously, the name of the group. Named groups " @@ -1339,26 +1345,26 @@ msgid "" "ways::" msgstr "" -#: ../../howto/regex.rst:943 +#: ../../howto/regex.rst:946 msgid "" "Additionally, you can retrieve named groups as a dictionary with :meth:`~re." "Match.groupdict`::" msgstr "" -#: ../../howto/regex.rst:950 +#: ../../howto/regex.rst:953 msgid "" "Named groups are handy because they let you use easily remembered names, " "instead of having to remember numbers. Here's an example RE from the :mod:" "`imaplib` module::" msgstr "" -#: ../../howto/regex.rst:961 +#: ../../howto/regex.rst:964 msgid "" "It's obviously much easier to retrieve ``m.group('zonem')``, instead of " "having to remember to retrieve group 9." msgstr "" -#: ../../howto/regex.rst:964 +#: ../../howto/regex.rst:967 msgid "" "The syntax for backreferences in an expression such as ``(...)\\1`` refers " "to the number of the group. There's naturally a variant that uses the group " @@ -1369,22 +1375,22 @@ msgid "" "P\\w+)\\s+(?P=word)\\b``::" msgstr "" -#: ../../howto/regex.rst:977 +#: ../../howto/regex.rst:980 msgid "Lookahead Assertions" msgstr "" -#: ../../howto/regex.rst:979 +#: ../../howto/regex.rst:982 msgid "" "Another zero-width assertion is the lookahead assertion. Lookahead " "assertions are available in both positive and negative form, and look like " "this:" msgstr "" -#: ../../howto/regex.rst:987 +#: ../../howto/regex.rst:990 msgid "``(?=...)``" msgstr "``(?=...)``" -#: ../../howto/regex.rst:983 +#: ../../howto/regex.rst:986 msgid "" "Positive lookahead assertion. This succeeds if the contained regular " "expression, represented here by ``...``, successfully matches at the current " @@ -1393,18 +1399,18 @@ msgid "" "is tried right where the assertion started." msgstr "" -#: ../../howto/regex.rst:992 +#: ../../howto/regex.rst:995 msgid "``(?!...)``" msgstr "``(?!...)``" -#: ../../howto/regex.rst:990 +#: ../../howto/regex.rst:993 msgid "" "Negative lookahead assertion. This is the opposite of the positive " "assertion; it succeeds if the contained expression *doesn't* match at the " "current position in the string." msgstr "" -#: ../../howto/regex.rst:994 +#: ../../howto/regex.rst:997 msgid "" "To make this concrete, let's look at a case where a lookahead is useful. " "Consider a simple pattern to match a filename and split it apart into a base " @@ -1412,15 +1418,15 @@ msgid "" "``news`` is the base name, and ``rc`` is the filename's extension." msgstr "" -#: ../../howto/regex.rst:999 +#: ../../howto/regex.rst:1002 msgid "The pattern to match this is quite simple:" msgstr "" -#: ../../howto/regex.rst:1001 +#: ../../howto/regex.rst:1004 msgid "``.*[.].*$``" msgstr "``.*[.].*$``" -#: ../../howto/regex.rst:1003 +#: ../../howto/regex.rst:1006 msgid "" "Notice that the ``.`` needs to be treated specially because it's a " "metacharacter, so it's inside a character class to only match that specific " @@ -1430,24 +1436,24 @@ msgid "" "``printers.conf``." msgstr "" -#: ../../howto/regex.rst:1010 +#: ../../howto/regex.rst:1013 msgid "" "Now, consider complicating the problem a bit; what if you want to match " "filenames where the extension is not ``bat``? Some incorrect attempts:" msgstr "" -#: ../../howto/regex.rst:1013 +#: ../../howto/regex.rst:1016 msgid "" "``.*[.][^b].*$`` The first attempt above tries to exclude ``bat`` by " "requiring that the first character of the extension is not a ``b``. This is " "wrong, because the pattern also doesn't match ``foo.bar``." msgstr "" -#: ../../howto/regex.rst:1017 +#: ../../howto/regex.rst:1020 msgid "``.*[.]([^b]..|.[^a].|..[^t])$``" msgstr "``.*[.]([^b]..|.[^a].|..[^t])$``" -#: ../../howto/regex.rst:1019 +#: ../../howto/regex.rst:1022 msgid "" "The expression gets messier when you try to patch up the first solution by " "requiring one of the following cases to match: the first character of the " @@ -1458,18 +1464,18 @@ msgid "" "pattern again in an effort to fix it." msgstr "" -#: ../../howto/regex.rst:1027 +#: ../../howto/regex.rst:1030 msgid "``.*[.]([^b].?.?|.[^a]?.?|..?[^t]?)$``" msgstr "``.*[.]([^b].?.?|.[^a]?.?|..?[^t]?)$``" -#: ../../howto/regex.rst:1029 +#: ../../howto/regex.rst:1032 msgid "" "In the third attempt, the second and third letters are all made optional in " "order to allow matching extensions shorter than three characters, such as " "``sendmail.cf``." msgstr "" -#: ../../howto/regex.rst:1033 +#: ../../howto/regex.rst:1036 msgid "" "The pattern's getting really complicated now, which makes it hard to read " "and understand. Worse, if the problem changes and you want to exclude both " @@ -1477,11 +1483,11 @@ msgid "" "complicated and confusing." msgstr "" -#: ../../howto/regex.rst:1038 +#: ../../howto/regex.rst:1041 msgid "A negative lookahead cuts through all this confusion:" msgstr "" -#: ../../howto/regex.rst:1040 +#: ../../howto/regex.rst:1043 msgid "" "``.*[.](?!bat$)[^.]*$`` The negative lookahead means: if the expression " "``bat`` doesn't match at this point, try the rest of the pattern; if " @@ -1491,61 +1497,61 @@ msgid "" "the pattern works when there are multiple dots in the filename." msgstr "" -#: ../../howto/regex.rst:1047 +#: ../../howto/regex.rst:1050 msgid "" "Excluding another filename extension is now easy; simply add it as an " "alternative inside the assertion. The following pattern excludes filenames " "that end in either ``bat`` or ``exe``:" msgstr "" -#: ../../howto/regex.rst:1051 +#: ../../howto/regex.rst:1054 msgid "``.*[.](?!bat$|exe$)[^.]*$``" msgstr "``.*[.](?!bat$|exe$)[^.]*$``" -#: ../../howto/regex.rst:1055 +#: ../../howto/regex.rst:1058 msgid "Modifying Strings" msgstr "" -#: ../../howto/regex.rst:1057 +#: ../../howto/regex.rst:1060 msgid "" "Up to this point, we've simply performed searches against a static string. " "Regular expressions are also commonly used to modify strings in various " "ways, using the following pattern methods:" msgstr "" -#: ../../howto/regex.rst:1064 +#: ../../howto/regex.rst:1067 msgid "``split()``" msgstr "``split()``" -#: ../../howto/regex.rst:1064 +#: ../../howto/regex.rst:1067 msgid "Split the string into a list, splitting it wherever the RE matches" msgstr "" -#: ../../howto/regex.rst:1067 +#: ../../howto/regex.rst:1070 msgid "``sub()``" msgstr "``sub()``" -#: ../../howto/regex.rst:1067 +#: ../../howto/regex.rst:1070 msgid "" "Find all substrings where the RE matches, and replace them with a different " "string" msgstr "" -#: ../../howto/regex.rst:1070 +#: ../../howto/regex.rst:1073 msgid "``subn()``" msgstr "``subn()``" -#: ../../howto/regex.rst:1070 +#: ../../howto/regex.rst:1073 msgid "" "Does the same thing as :meth:`!sub`, but returns the new string and the " "number of replacements" msgstr "" -#: ../../howto/regex.rst:1077 +#: ../../howto/regex.rst:1080 msgid "Splitting Strings" msgstr "" -#: ../../howto/regex.rst:1079 +#: ../../howto/regex.rst:1082 msgid "" "The :meth:`~re.Pattern.split` method of a pattern splits a string apart " "wherever the RE matches, returning a list of the pieces. It's similar to " @@ -1555,7 +1561,7 @@ msgid "" "module-level :func:`re.split` function, too." msgstr "" -#: ../../howto/regex.rst:1090 +#: ../../howto/regex.rst:1093 msgid "" "Split *string* by the matches of the regular expression. If capturing " "parentheses are used in the RE, then their contents will also be returned as " @@ -1563,7 +1569,7 @@ msgid "" "splits are performed." msgstr "" -#: ../../howto/regex.rst:1095 +#: ../../howto/regex.rst:1098 msgid "" "You can limit the number of splits made, by passing a value for *maxsplit*. " "When *maxsplit* is nonzero, at most *maxsplit* splits will be made, and the " @@ -1572,7 +1578,7 @@ msgid "" "characters. ::" msgstr "" -#: ../../howto/regex.rst:1107 +#: ../../howto/regex.rst:1110 msgid "" "Sometimes you're not only interested in what the text between delimiters is, " "but also need to know what the delimiter was. If capturing parentheses are " @@ -1580,17 +1586,17 @@ msgid "" "Compare the following calls::" msgstr "" -#: ../../howto/regex.rst:1119 +#: ../../howto/regex.rst:1122 msgid "" "The module-level function :func:`re.split` adds the RE to be used as the " "first argument, but is otherwise the same. ::" msgstr "" -#: ../../howto/regex.rst:1131 +#: ../../howto/regex.rst:1134 msgid "Search and Replace" msgstr "" -#: ../../howto/regex.rst:1133 +#: ../../howto/regex.rst:1136 msgid "" "Another common task is to find all the matches for a pattern, and replace " "them with a different string. The :meth:`~re.Pattern.sub` method takes a " @@ -1598,40 +1604,40 @@ msgid "" "string to be processed." msgstr "" -#: ../../howto/regex.rst:1140 +#: ../../howto/regex.rst:1143 msgid "" "Returns the string obtained by replacing the leftmost non-overlapping " "occurrences of the RE in *string* by the replacement *replacement*. If the " "pattern isn't found, *string* is returned unchanged." msgstr "" -#: ../../howto/regex.rst:1144 +#: ../../howto/regex.rst:1147 msgid "" "The optional argument *count* is the maximum number of pattern occurrences " "to be replaced; *count* must be a non-negative integer. The default value " "of 0 means to replace all occurrences." msgstr "" -#: ../../howto/regex.rst:1148 +#: ../../howto/regex.rst:1151 msgid "" "Here's a simple example of using the :meth:`~re.Pattern.sub` method. It " "replaces colour names with the word ``colour``::" msgstr "" -#: ../../howto/regex.rst:1157 +#: ../../howto/regex.rst:1160 msgid "" "The :meth:`~re.Pattern.subn` method does the same work, but returns a 2-" "tuple containing the new string value and the number of replacements that " "were performed::" msgstr "" -#: ../../howto/regex.rst:1166 +#: ../../howto/regex.rst:1169 msgid "" "Empty matches are replaced only when they're not adjacent to a previous " "empty match. ::" msgstr "" -#: ../../howto/regex.rst:1173 +#: ../../howto/regex.rst:1176 msgid "" "If *replacement* is a string, any backslash escapes in it are processed. " "That is, ``\\n`` is converted to a single newline character, ``\\r`` is " @@ -1642,13 +1648,13 @@ msgid "" "string." msgstr "" -#: ../../howto/regex.rst:1180 +#: ../../howto/regex.rst:1183 msgid "" "This example matches the word ``section`` followed by a string enclosed in " "``{``, ``}``, and changes ``section`` to ``subsection``::" msgstr "" -#: ../../howto/regex.rst:1187 +#: ../../howto/regex.rst:1190 msgid "" "There's also a syntax for referring to named groups as defined by the ``(?" "P...)`` syntax. ``\\g`` will use the substring matched by the " @@ -1660,7 +1666,7 @@ msgid "" "but use all three variations of the replacement string. ::" msgstr "" -#: ../../howto/regex.rst:1204 +#: ../../howto/regex.rst:1207 msgid "" "*replacement* can also be a function, which gives you even more control. If " "*replacement* is a function, the function is called for every non-" @@ -1669,13 +1675,13 @@ msgid "" "this information to compute the desired replacement string and return it." msgstr "" -#: ../../howto/regex.rst:1210 +#: ../../howto/regex.rst:1213 msgid "" "In the following example, the replacement function translates decimals into " "hexadecimal::" msgstr "" -#: ../../howto/regex.rst:1222 +#: ../../howto/regex.rst:1225 msgid "" "When using the module-level :func:`re.sub` function, the pattern is passed " "as the first argument. The pattern may be provided as an object or as a " @@ -1685,11 +1691,11 @@ msgid "" "x'``." msgstr "" -#: ../../howto/regex.rst:1230 +#: ../../howto/regex.rst:1233 msgid "Common Problems" msgstr "" -#: ../../howto/regex.rst:1232 +#: ../../howto/regex.rst:1235 msgid "" "Regular expressions are a powerful tool for some applications, but in some " "ways their behaviour isn't intuitive and at times they don't behave the way " @@ -1697,11 +1703,11 @@ msgid "" "pitfalls." msgstr "" -#: ../../howto/regex.rst:1238 +#: ../../howto/regex.rst:1241 msgid "Use String Methods" msgstr "" -#: ../../howto/regex.rst:1240 +#: ../../howto/regex.rst:1243 msgid "" "Sometimes using the :mod:`re` module is a mistake. If you're matching a " "fixed string, or a single character class, and you're not using any :mod:" @@ -1713,7 +1719,7 @@ msgid "" "engine." msgstr "" -#: ../../howto/regex.rst:1248 +#: ../../howto/regex.rst:1251 msgid "" "One example might be replacing a single fixed string with another one; for " "example, you might replace ``word`` with ``deed``. :func:`re.sub` seems " @@ -1726,7 +1732,7 @@ msgid "" "meth:`!replace`'s abilities.)" msgstr "" -#: ../../howto/regex.rst:1257 +#: ../../howto/regex.rst:1260 msgid "" "Another common task is deleting every occurrence of a single character from " "a string or replacing it with another single character. You might do this " @@ -1735,17 +1741,17 @@ msgid "" "operation can be." msgstr "" -#: ../../howto/regex.rst:1263 +#: ../../howto/regex.rst:1266 msgid "" "In short, before turning to the :mod:`re` module, consider whether your " "problem can be solved with a faster and simpler string method." msgstr "" -#: ../../howto/regex.rst:1268 +#: ../../howto/regex.rst:1271 msgid "match() versus search()" msgstr "" -#: ../../howto/regex.rst:1270 +#: ../../howto/regex.rst:1273 msgid "" "The :func:`~re.match` function only checks if the RE matches at the " "beginning of the string while :func:`~re.search` will scan forward through " @@ -1755,13 +1761,13 @@ msgid "" "report it. ::" msgstr "" -#: ../../howto/regex.rst:1281 +#: ../../howto/regex.rst:1284 msgid "" "On the other hand, :func:`~re.search` will scan forward through the string, " "reporting the first match it finds. ::" msgstr "" -#: ../../howto/regex.rst:1289 +#: ../../howto/regex.rst:1292 msgid "" "Sometimes you'll be tempted to keep using :func:`re.match`, and just add ``." "*`` to the front of your RE. Resist this temptation and use :func:`re." @@ -1773,18 +1779,18 @@ msgid "" "starting character, only trying the full match if a ``'C'`` is found." msgstr "" -#: ../../howto/regex.rst:1298 +#: ../../howto/regex.rst:1301 msgid "" "Adding ``.*`` defeats this optimization, requiring scanning to the end of " "the string and then backtracking to find a match for the rest of the RE. " "Use :func:`re.search` instead." msgstr "" -#: ../../howto/regex.rst:1304 +#: ../../howto/regex.rst:1307 msgid "Greedy versus Non-Greedy" msgstr "" -#: ../../howto/regex.rst:1306 +#: ../../howto/regex.rst:1309 msgid "" "When repeating a regular expression, as in ``a*``, the resulting action is " "to consume as much of the pattern as possible. This fact often bites you " @@ -1793,7 +1799,7 @@ msgid "" "HTML tag doesn't work because of the greedy nature of ``.*``. ::" msgstr "" -#: ../../howto/regex.rst:1320 +#: ../../howto/regex.rst:1323 msgid "" "The RE matches the ``'<'`` in ``''``, and the ``.*`` consumes the rest " "of the string. There's still more left in the RE, though, and the ``>`` " @@ -1803,7 +1809,7 @@ msgid "" "``''``, which isn't what you want." msgstr "" -#: ../../howto/regex.rst:1327 +#: ../../howto/regex.rst:1330 msgid "" "In this case, the solution is to use the non-greedy quantifiers ``*?``, ``+?" "``, ``??``, or ``{m,n}?``, which match as *little* text as possible. In the " @@ -1812,7 +1818,7 @@ msgid "" "retrying the ``'>'`` at every step. This produces just the right result::" msgstr "" -#: ../../howto/regex.rst:1336 +#: ../../howto/regex.rst:1339 msgid "" "(Note that parsing HTML or XML with regular expressions is painful. Quick-" "and-dirty patterns will handle common cases, but HTML and XML have special " @@ -1822,11 +1828,11 @@ msgid "" "such tasks.)" msgstr "" -#: ../../howto/regex.rst:1344 +#: ../../howto/regex.rst:1347 msgid "Using re.VERBOSE" msgstr "" -#: ../../howto/regex.rst:1346 +#: ../../howto/regex.rst:1349 msgid "" "By now you've probably noticed that regular expressions are a very compact " "notation, but they're not terribly readable. REs of moderate complexity can " @@ -1834,14 +1840,14 @@ msgid "" "making them difficult to read and understand." msgstr "" -#: ../../howto/regex.rst:1351 +#: ../../howto/regex.rst:1354 msgid "" "For such REs, specifying the :const:`re.VERBOSE` flag when compiling the " "regular expression can be helpful, because it allows you to format the " "regular expression more clearly." msgstr "" -#: ../../howto/regex.rst:1355 +#: ../../howto/regex.rst:1358 msgid "" "The ``re.VERBOSE`` flag has several effects. Whitespace in the regular " "expression that *isn't* inside a character class is ignored. This means " @@ -1852,15 +1858,15 @@ msgid "" "quoted strings, this enables REs to be formatted more neatly::" msgstr "" -#: ../../howto/regex.rst:1372 +#: ../../howto/regex.rst:1375 msgid "This is far more readable than::" msgstr "" -#: ../../howto/regex.rst:1378 +#: ../../howto/regex.rst:1381 msgid "Feedback" msgstr "" -#: ../../howto/regex.rst:1380 +#: ../../howto/regex.rst:1383 msgid "" "Regular expressions are a complicated topic. Did this document help you " "understand them? Were there parts that were unclear, or Problems you " @@ -1868,7 +1874,7 @@ msgid "" "improvements to the author." msgstr "" -#: ../../howto/regex.rst:1385 +#: ../../howto/regex.rst:1388 msgid "" "The most complete book on regular expressions is almost certainly Jeffrey " "Friedl's Mastering Regular Expressions, published by O'Reilly. " diff --git a/library/abc.po b/library/abc.po index d6810e2883..36c2de8375 100644 --- a/library/abc.po +++ b/library/abc.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-15 00:17+0000\n" +"POT-Creation-Date: 2023-10-20 00:03+0000\n" "PO-Revision-Date: 2022-11-16 03:29+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -51,8 +51,8 @@ msgid "" msgstr "" ":mod:`collections` 模組中有一些衍生自 ABC 的具體類別;當然這些類別還可以進一" "步衍生出其他類別。此外,:mod:`collections.abc` 子模組中有一些 ABC 可被用於測" -"試一個類別或實例是否提供特定介面,例如它是否\\ :term:`可雜湊 (hashable) ` 或它是否為對映 " -"(mapping)。" +"試一個類別或實例是否提供特定介面,例如它是否\\ :term:`可雜湊 (hashable) " +"` 或它是否為對映 (mapping)。" #: ../../library/abc.rst:27 msgid "" @@ -205,13 +205,13 @@ msgid "" "Finally, the last line makes ``Foo`` a virtual subclass of ``MyIterable``, " "even though it does not define an :meth:`~iterator.__iter__` method (it uses " "the old-style iterable protocol, defined in terms of :meth:`__len__` and :" -"meth:`__getitem__`). Note that this will not make ``get_iterator`` " +"meth:`~object.__getitem__`). Note that this will not make ``get_iterator`` " "available as a method of ``Foo``, so it is provided separately." msgstr "" "最後,即使 ``Foo`` 沒有定義 :meth:`~iterator.__iter__` 方法(它使用了以 :" -"meth:`__len__` 和 :meth:`__getitem__` 所定義的舊式可疊代物件協定),最末一行" -"使其成為 ``MyIterable`` 的一個虛擬子類別。請注意這不會使 ``get_iterator`` 成" -"為 ``Foo`` 的一個可用方法,所以它是需要被另外提供的。" +"meth:`__len__` 和 :meth:`~object.__getitem__` 所定義的舊式可疊代物件協定)," +"最末一行使其成為 ``MyIterable`` 的一個虛擬子類別。請注意這不會使 " +"``get_iterator`` 成為 ``Foo`` 的一個可用方法,所以它是需要被另外提供的。" #: ../../library/abc.rst:163 msgid "The :mod:`abc` module also provides the following decorator:" diff --git a/library/asyncio-eventloop.po b/library/asyncio-eventloop.po index 372e08e38e..ff4ea8f2f0 100644 --- a/library/asyncio-eventloop.po +++ b/library/asyncio-eventloop.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-23 00:03+0000\n" +"POT-Creation-Date: 2023-10-30 00:03+0000\n" "PO-Revision-Date: 2022-02-20 12:36+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -258,8 +258,8 @@ msgid "" msgstr "" #: ../../library/asyncio-eventloop.rst:176 -#: ../../library/asyncio-eventloop.rst:1236 -#: ../../library/asyncio-eventloop.rst:1643 +#: ../../library/asyncio-eventloop.rst:1242 +#: ../../library/asyncio-eventloop.rst:1660 msgid "Example::" msgstr "" "範例:\n" @@ -540,8 +540,8 @@ msgid "The socket type will be :py:const:`~socket.SOCK_STREAM`." msgstr "" #: ../../library/asyncio-eventloop.rst:412 -#: ../../library/asyncio-eventloop.rst:1152 -#: ../../library/asyncio-eventloop.rst:1168 +#: ../../library/asyncio-eventloop.rst:1156 +#: ../../library/asyncio-eventloop.rst:1172 msgid "" "*protocol_factory* must be a callable returning an :ref:`asyncio protocol " "` implementation." @@ -652,7 +652,7 @@ msgstr "" #: ../../library/asyncio-eventloop.rst:482 #: ../../library/asyncio-eventloop.rst:597 -#: ../../library/asyncio-eventloop.rst:821 +#: ../../library/asyncio-eventloop.rst:825 msgid "" "The *sock* argument transfers ownership of the socket to the transport " "created. To close the socket, call the transport's :meth:`~asyncio." @@ -667,7 +667,7 @@ msgid "" msgstr "" #: ../../library/asyncio-eventloop.rst:490 -#: ../../library/asyncio-eventloop.rst:915 +#: ../../library/asyncio-eventloop.rst:919 msgid "" "*ssl_handshake_timeout* is (for a TLS connection) the time in seconds to " "wait for the TLS handshake to complete before aborting the connection. " @@ -675,9 +675,9 @@ msgid "" msgstr "" #: ../../library/asyncio-eventloop.rst:494 -#: ../../library/asyncio-eventloop.rst:738 -#: ../../library/asyncio-eventloop.rst:832 -#: ../../library/asyncio-eventloop.rst:919 +#: ../../library/asyncio-eventloop.rst:742 +#: ../../library/asyncio-eventloop.rst:836 +#: ../../library/asyncio-eventloop.rst:923 msgid "" "*ssl_shutdown_timeout* is the time in seconds to wait for the SSL shutdown " "to complete before aborting the connection. ``30.0`` seconds if ``None`` " @@ -695,18 +695,20 @@ msgid "" msgstr "" #: ../../library/asyncio-eventloop.rst:508 -#: ../../library/asyncio-eventloop.rst:750 +#: ../../library/asyncio-eventloop.rst:754 msgid "Added support for SSL/TLS in :class:`ProactorEventLoop`." msgstr "新增 :class:`ProactorEventLoop` 中的 SSL/TLS 支援。" #: ../../library/asyncio-eventloop.rst:512 msgid "" -"The socket option :py:const:`~socket.TCP_NODELAY` is set by default for all " -"TCP connections." +"The socket option :ref:`socket.TCP_NODELAY ` is set " +"by default for all TCP connections." msgstr "" +"所有 TCP 連線都預設有 :ref:`socket.TCP_NODELAY ` " +"socket 選項。" #: ../../library/asyncio-eventloop.rst:517 -#: ../../library/asyncio-eventloop.rst:842 +#: ../../library/asyncio-eventloop.rst:846 msgid "Added the *ssl_handshake_timeout* parameter." msgstr "增加 *ssl_handshake_timeout* 參數。" @@ -730,11 +732,11 @@ msgid "For more information: https://datatracker.ietf.org/doc/html/rfc6555" msgstr "更多資訊請見: https://datatracker.ietf.org/doc/html/rfc6555" #: ../../library/asyncio-eventloop.rst:536 -#: ../../library/asyncio-eventloop.rst:658 -#: ../../library/asyncio-eventloop.rst:764 -#: ../../library/asyncio-eventloop.rst:799 -#: ../../library/asyncio-eventloop.rst:846 -#: ../../library/asyncio-eventloop.rst:927 +#: ../../library/asyncio-eventloop.rst:660 +#: ../../library/asyncio-eventloop.rst:768 +#: ../../library/asyncio-eventloop.rst:803 +#: ../../library/asyncio-eventloop.rst:850 +#: ../../library/asyncio-eventloop.rst:931 msgid "Added the *ssl_shutdown_timeout* parameter." msgstr "增加 *ssl_shutdown_timeout* 參數。" @@ -765,15 +767,15 @@ msgid "The socket type will be :py:const:`~socket.SOCK_DGRAM`." msgstr "" #: ../../library/asyncio-eventloop.rst:561 -#: ../../library/asyncio-eventloop.rst:681 -#: ../../library/asyncio-eventloop.rst:813 +#: ../../library/asyncio-eventloop.rst:685 +#: ../../library/asyncio-eventloop.rst:817 msgid "" "*protocol_factory* must be a callable returning a :ref:`protocol ` implementation." msgstr "" #: ../../library/asyncio-eventloop.rst:564 -#: ../../library/asyncio-eventloop.rst:640 +#: ../../library/asyncio-eventloop.rst:642 msgid "A tuple of ``(transport, protocol)`` is returned on success." msgstr "" @@ -804,8 +806,8 @@ msgid "" "*reuse_port* tells the kernel to allow this endpoint to be bound to the same " "port as other existing endpoints are bound to, so long as they all set this " "flag when being created. This option is not supported on Windows and some " -"Unixes. If the :py:const:`~socket.SO_REUSEPORT` constant is not defined then " -"this capability is unsupported." +"Unixes. If the :ref:`socket.SO_REUSEPORT ` constant " +"is not defined then this capability is unsupported." msgstr "" #: ../../library/asyncio-eventloop.rst:587 @@ -836,115 +838,115 @@ msgstr "" #: ../../library/asyncio-eventloop.rst:608 msgid "" -"The *reuse_address* parameter is no longer supported, as using :py:const:" -"`~sockets.SO_REUSEADDR` poses a significant security concern for UDP. " -"Explicitly passing ``reuse_address=True`` will raise an exception." +"The *reuse_address* parameter is no longer supported, as using :ref:`socket." +"SO_REUSEADDR ` poses a significant security concern " +"for UDP. Explicitly passing ``reuse_address=True`` will raise an exception." msgstr "" -#: ../../library/asyncio-eventloop.rst:613 +#: ../../library/asyncio-eventloop.rst:614 msgid "" "When multiple processes with differing UIDs assign sockets to an identical " "UDP socket address with ``SO_REUSEADDR``, incoming packets can become " "randomly distributed among the sockets." msgstr "" -#: ../../library/asyncio-eventloop.rst:617 +#: ../../library/asyncio-eventloop.rst:618 msgid "" "For supported platforms, *reuse_port* can be used as a replacement for " -"similar functionality. With *reuse_port*, :py:const:`~sockets.SO_REUSEPORT` " -"is used instead, which specifically prevents processes with differing UIDs " -"from assigning sockets to the same socket address." +"similar functionality. With *reuse_port*, :ref:`socket.SO_REUSEPORT ` is used instead, which specifically prevents processes with " +"differing UIDs from assigning sockets to the same socket address." msgstr "" -#: ../../library/asyncio-eventloop.rst:623 +#: ../../library/asyncio-eventloop.rst:625 msgid "Added support for Windows." msgstr "新增對於 Windows 的支援。" -#: ../../library/asyncio-eventloop.rst:626 +#: ../../library/asyncio-eventloop.rst:628 msgid "" "The *reuse_address* parameter, disabled since Python 3.9.0, 3.8.1, 3.7.6 and " "3.6.10, has been entirely removed." msgstr "" -#: ../../library/asyncio-eventloop.rst:635 +#: ../../library/asyncio-eventloop.rst:637 msgid "Create a Unix connection." msgstr "" -#: ../../library/asyncio-eventloop.rst:637 +#: ../../library/asyncio-eventloop.rst:639 msgid "" "The socket family will be :py:const:`~socket.AF_UNIX`; socket type will be :" "py:const:`~socket.SOCK_STREAM`." msgstr "" -#: ../../library/asyncio-eventloop.rst:642 +#: ../../library/asyncio-eventloop.rst:644 msgid "" "*path* is the name of a Unix domain socket and is required, unless a *sock* " "parameter is specified. Abstract Unix sockets, :class:`str`, :class:" "`bytes`, and :class:`~pathlib.Path` paths are supported." msgstr "" -#: ../../library/asyncio-eventloop.rst:647 +#: ../../library/asyncio-eventloop.rst:649 msgid "" "See the documentation of the :meth:`loop.create_connection` method for " "information about arguments to this method." msgstr "" -#: ../../library/asyncio-eventloop.rst:650 -#: ../../library/asyncio-eventloop.rst:790 -#: ../../library/asyncio-eventloop.rst:1219 +#: ../../library/asyncio-eventloop.rst:652 +#: ../../library/asyncio-eventloop.rst:794 +#: ../../library/asyncio-eventloop.rst:1225 msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" -#: ../../library/asyncio-eventloop.rst:652 +#: ../../library/asyncio-eventloop.rst:654 msgid "" "Added the *ssl_handshake_timeout* parameter. The *path* parameter can now be " "a :term:`path-like object`." msgstr "" -#: ../../library/asyncio-eventloop.rst:662 +#: ../../library/asyncio-eventloop.rst:664 msgid "Creating network servers" msgstr "" -#: ../../library/asyncio-eventloop.rst:674 +#: ../../library/asyncio-eventloop.rst:678 msgid "" "Create a TCP server (socket type :const:`~socket.SOCK_STREAM`) listening on " "*port* of the *host* address." msgstr "" -#: ../../library/asyncio-eventloop.rst:677 +#: ../../library/asyncio-eventloop.rst:681 msgid "Returns a :class:`Server` object." msgstr "" -#: ../../library/asyncio-eventloop.rst:679 +#: ../../library/asyncio-eventloop.rst:683 msgid "Arguments:" msgstr "引數:" -#: ../../library/asyncio-eventloop.rst:684 +#: ../../library/asyncio-eventloop.rst:688 msgid "" "The *host* parameter can be set to several types which determine where the " "server would be listening:" msgstr "" -#: ../../library/asyncio-eventloop.rst:687 +#: ../../library/asyncio-eventloop.rst:691 msgid "" "If *host* is a string, the TCP server is bound to a single network interface " "specified by *host*." msgstr "" -#: ../../library/asyncio-eventloop.rst:690 +#: ../../library/asyncio-eventloop.rst:694 msgid "" "If *host* is a sequence of strings, the TCP server is bound to all network " "interfaces specified by the sequence." msgstr "" -#: ../../library/asyncio-eventloop.rst:693 +#: ../../library/asyncio-eventloop.rst:697 msgid "" "If *host* is an empty string or ``None``, all interfaces are assumed and a " "list of multiple sockets will be returned (most likely one for IPv4 and " "another one for IPv6)." msgstr "" -#: ../../library/asyncio-eventloop.rst:697 +#: ../../library/asyncio-eventloop.rst:701 msgid "" "The *port* parameter can be set to specify which port the server should " "listen on. If ``0`` or ``None`` (the default), a random unused port will be " @@ -952,63 +954,63 @@ msgid "" "different random port will be selected for each interface)." msgstr "" -#: ../../library/asyncio-eventloop.rst:702 +#: ../../library/asyncio-eventloop.rst:706 msgid "" "*family* can be set to either :const:`socket.AF_INET` or :const:`~socket." "AF_INET6` to force the socket to use IPv4 or IPv6. If not set, the *family* " "will be determined from host name (defaults to :const:`~socket.AF_UNSPEC`)." msgstr "" -#: ../../library/asyncio-eventloop.rst:707 +#: ../../library/asyncio-eventloop.rst:711 msgid "*flags* is a bitmask for :meth:`getaddrinfo`." msgstr "" -#: ../../library/asyncio-eventloop.rst:709 +#: ../../library/asyncio-eventloop.rst:713 msgid "" "*sock* can optionally be specified in order to use a preexisting socket " "object. If specified, *host* and *port* must not be specified." msgstr "" -#: ../../library/asyncio-eventloop.rst:714 +#: ../../library/asyncio-eventloop.rst:718 msgid "" "The *sock* argument transfers ownership of the socket to the server created. " "To close the socket, call the server's :meth:`~asyncio.Server.close` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:718 +#: ../../library/asyncio-eventloop.rst:722 msgid "" "*backlog* is the maximum number of queued connections passed to :meth:" "`~socket.socket.listen` (defaults to 100)." msgstr "" -#: ../../library/asyncio-eventloop.rst:721 +#: ../../library/asyncio-eventloop.rst:725 msgid "" "*ssl* can be set to an :class:`~ssl.SSLContext` instance to enable TLS over " "the accepted connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:724 +#: ../../library/asyncio-eventloop.rst:728 msgid "" "*reuse_address* tells the kernel to reuse a local socket in ``TIME_WAIT`` " "state, without waiting for its natural timeout to expire. If not specified " "will automatically be set to ``True`` on Unix." msgstr "" -#: ../../library/asyncio-eventloop.rst:729 +#: ../../library/asyncio-eventloop.rst:733 msgid "" "*reuse_port* tells the kernel to allow this endpoint to be bound to the same " "port as other existing endpoints are bound to, so long as they all set this " "flag when being created. This option is not supported on Windows." msgstr "" -#: ../../library/asyncio-eventloop.rst:734 +#: ../../library/asyncio-eventloop.rst:738 msgid "" "*ssl_handshake_timeout* is (for a TLS server) the time in seconds to wait " "for the TLS handshake to complete before aborting the connection. ``60.0`` " "seconds if ``None`` (default)." msgstr "" -#: ../../library/asyncio-eventloop.rst:742 +#: ../../library/asyncio-eventloop.rst:746 msgid "" "*start_serving* set to ``True`` (the default) causes the created server to " "start accepting connections immediately. When set to ``False``, the user " @@ -1016,46 +1018,46 @@ msgid "" "to make the server to start accepting connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:754 +#: ../../library/asyncio-eventloop.rst:758 msgid "The *host* parameter can be a sequence of strings." msgstr "" -#: ../../library/asyncio-eventloop.rst:758 +#: ../../library/asyncio-eventloop.rst:762 msgid "" "Added *ssl_handshake_timeout* and *start_serving* parameters. The socket " -"option :py:const:`~socket.TCP_NODELAY` is set by default for all TCP " -"connections." +"option :ref:`socket.TCP_NODELAY ` is set by default " +"for all TCP connections." msgstr "" "新增 *ssl_handshake_timeout* 與 *start_serving* 參數。所有 TCP 連線都預設有 :" -"py:const:`~socket.TCP_NODELAY` socket 選項。" +"ref:`socket.TCP_NODELAY ` socket 選項。" -#: ../../library/asyncio-eventloop.rst:768 +#: ../../library/asyncio-eventloop.rst:772 msgid "" "The :func:`start_server` function is a higher-level alternative API that " "returns a pair of :class:`StreamReader` and :class:`StreamWriter` that can " "be used in an async/await code." msgstr "" -#: ../../library/asyncio-eventloop.rst:779 +#: ../../library/asyncio-eventloop.rst:783 msgid "" "Similar to :meth:`loop.create_server` but works with the :py:const:`~socket." "AF_UNIX` socket family." msgstr "" -#: ../../library/asyncio-eventloop.rst:782 +#: ../../library/asyncio-eventloop.rst:786 msgid "" "*path* is the name of a Unix domain socket, and is required, unless a *sock* " "argument is provided. Abstract Unix sockets, :class:`str`, :class:`bytes`, " "and :class:`~pathlib.Path` paths are supported." msgstr "" -#: ../../library/asyncio-eventloop.rst:787 +#: ../../library/asyncio-eventloop.rst:791 msgid "" "See the documentation of the :meth:`loop.create_server` method for " "information about arguments to this method." msgstr "" -#: ../../library/asyncio-eventloop.rst:794 +#: ../../library/asyncio-eventloop.rst:798 msgid "" "Added the *ssl_handshake_timeout* and *start_serving* parameters. The *path* " "parameter can now be a :class:`~pathlib.Path` object." @@ -1063,63 +1065,63 @@ msgstr "" "新增 *ssl_handshake_timeout* 與 *start_serving* 參數。\\ *path* 參數現在可為" "一個 :class:`~pathlib.Path` 物件。" -#: ../../library/asyncio-eventloop.rst:806 +#: ../../library/asyncio-eventloop.rst:810 msgid "Wrap an already accepted connection into a transport/protocol pair." msgstr "" -#: ../../library/asyncio-eventloop.rst:808 +#: ../../library/asyncio-eventloop.rst:812 msgid "" "This method can be used by servers that accept connections outside of " "asyncio but that use asyncio to handle them." msgstr "" -#: ../../library/asyncio-eventloop.rst:811 -#: ../../library/asyncio-eventloop.rst:901 +#: ../../library/asyncio-eventloop.rst:815 +#: ../../library/asyncio-eventloop.rst:905 msgid "Parameters:" msgstr "參數:" -#: ../../library/asyncio-eventloop.rst:816 +#: ../../library/asyncio-eventloop.rst:820 msgid "" "*sock* is a preexisting socket object returned from :meth:`socket.accept " "`." msgstr "" -#: ../../library/asyncio-eventloop.rst:825 +#: ../../library/asyncio-eventloop.rst:829 msgid "" "*ssl* can be set to an :class:`~ssl.SSLContext` to enable SSL over the " "accepted connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:828 +#: ../../library/asyncio-eventloop.rst:832 msgid "" "*ssl_handshake_timeout* is (for an SSL connection) the time in seconds to " "wait for the SSL handshake to complete before aborting the connection. " "``60.0`` seconds if ``None`` (default)." msgstr "" -#: ../../library/asyncio-eventloop.rst:836 +#: ../../library/asyncio-eventloop.rst:840 msgid "Returns a ``(transport, protocol)`` pair." msgstr "" -#: ../../library/asyncio-eventloop.rst:850 +#: ../../library/asyncio-eventloop.rst:854 msgid "Transferring files" msgstr "" -#: ../../library/asyncio-eventloop.rst:855 +#: ../../library/asyncio-eventloop.rst:859 msgid "" "Send a *file* over a *transport*. Return the total number of bytes sent." msgstr "" -#: ../../library/asyncio-eventloop.rst:858 +#: ../../library/asyncio-eventloop.rst:862 msgid "The method uses high-performance :meth:`os.sendfile` if available." msgstr "" -#: ../../library/asyncio-eventloop.rst:860 +#: ../../library/asyncio-eventloop.rst:864 msgid "*file* must be a regular file object opened in binary mode." msgstr "" -#: ../../library/asyncio-eventloop.rst:862 -#: ../../library/asyncio-eventloop.rst:1107 +#: ../../library/asyncio-eventloop.rst:866 +#: ../../library/asyncio-eventloop.rst:1111 msgid "" "*offset* tells from where to start reading the file. If specified, *count* " "is the total number of bytes to transmit as opposed to sending the file " @@ -1128,35 +1130,35 @@ msgid "" "obtain the actual number of bytes sent." msgstr "" -#: ../../library/asyncio-eventloop.rst:869 +#: ../../library/asyncio-eventloop.rst:873 msgid "" "*fallback* set to ``True`` makes asyncio to manually read and send the file " "when the platform does not support the sendfile system call (e.g. Windows or " "SSL socket on Unix)." msgstr "" -#: ../../library/asyncio-eventloop.rst:873 +#: ../../library/asyncio-eventloop.rst:877 msgid "" "Raise :exc:`SendfileNotAvailableError` if the system does not support the " "*sendfile* syscall and *fallback* is ``False``." msgstr "" -#: ../../library/asyncio-eventloop.rst:880 +#: ../../library/asyncio-eventloop.rst:884 msgid "TLS Upgrade" msgstr "" -#: ../../library/asyncio-eventloop.rst:887 +#: ../../library/asyncio-eventloop.rst:891 msgid "Upgrade an existing transport-based connection to TLS." msgstr "" -#: ../../library/asyncio-eventloop.rst:889 +#: ../../library/asyncio-eventloop.rst:893 msgid "" "Create a TLS coder/decoder instance and insert it between the *transport* " "and the *protocol*. The coder/decoder implements both *transport*-facing " "protocol and *protocol*-facing transport." msgstr "" -#: ../../library/asyncio-eventloop.rst:893 +#: ../../library/asyncio-eventloop.rst:897 msgid "" "Return the created two-interface instance. After *await*, the *protocol* " "must stop using the original *transport* and communicate with the returned " @@ -1164,80 +1166,80 @@ msgid "" "exchanges extra TLS session packets with *transport*." msgstr "" -#: ../../library/asyncio-eventloop.rst:898 +#: ../../library/asyncio-eventloop.rst:902 msgid "" "In some situations (e.g. when the passed transport is already closing) this " "may return ``None``." msgstr "" -#: ../../library/asyncio-eventloop.rst:903 +#: ../../library/asyncio-eventloop.rst:907 msgid "" "*transport* and *protocol* instances that methods like :meth:`~loop." "create_server` and :meth:`~loop.create_connection` return." msgstr "" -#: ../../library/asyncio-eventloop.rst:907 +#: ../../library/asyncio-eventloop.rst:911 msgid "*sslcontext*: a configured instance of :class:`~ssl.SSLContext`." msgstr "" -#: ../../library/asyncio-eventloop.rst:909 +#: ../../library/asyncio-eventloop.rst:913 msgid "" "*server_side* pass ``True`` when a server-side connection is being upgraded " "(like the one created by :meth:`~loop.create_server`)." msgstr "" -#: ../../library/asyncio-eventloop.rst:912 +#: ../../library/asyncio-eventloop.rst:916 msgid "" "*server_hostname*: sets or overrides the host name that the target server's " "certificate will be matched against." msgstr "" -#: ../../library/asyncio-eventloop.rst:932 +#: ../../library/asyncio-eventloop.rst:936 msgid "Watching file descriptors" msgstr "" -#: ../../library/asyncio-eventloop.rst:936 +#: ../../library/asyncio-eventloop.rst:940 msgid "" "Start monitoring the *fd* file descriptor for read availability and invoke " "*callback* with the specified arguments once *fd* is available for reading." msgstr "" -#: ../../library/asyncio-eventloop.rst:942 +#: ../../library/asyncio-eventloop.rst:946 msgid "" "Stop monitoring the *fd* file descriptor for read availability. Returns " "``True`` if *fd* was previously being monitored for reads." msgstr "" -#: ../../library/asyncio-eventloop.rst:947 +#: ../../library/asyncio-eventloop.rst:951 msgid "" "Start monitoring the *fd* file descriptor for write availability and invoke " "*callback* with the specified arguments once *fd* is available for writing." msgstr "" -#: ../../library/asyncio-eventloop.rst:951 -#: ../../library/asyncio-eventloop.rst:1206 +#: ../../library/asyncio-eventloop.rst:955 +#: ../../library/asyncio-eventloop.rst:1212 msgid "" "Use :func:`functools.partial` :ref:`to pass keyword arguments ` to *callback*." msgstr "" -#: ../../library/asyncio-eventloop.rst:956 +#: ../../library/asyncio-eventloop.rst:960 msgid "" "Stop monitoring the *fd* file descriptor for write availability. Returns " "``True`` if *fd* was previously being monitored for writes." msgstr "" -#: ../../library/asyncio-eventloop.rst:959 +#: ../../library/asyncio-eventloop.rst:963 msgid "" "See also :ref:`Platform Support ` section for some " "limitations of these methods." msgstr "" -#: ../../library/asyncio-eventloop.rst:964 +#: ../../library/asyncio-eventloop.rst:968 msgid "Working with socket objects directly" msgstr "" -#: ../../library/asyncio-eventloop.rst:966 +#: ../../library/asyncio-eventloop.rst:970 msgid "" "In general, protocol implementations that use transport-based APIs such as :" "meth:`loop.create_connection` and :meth:`loop.create_server` are faster than " @@ -1246,72 +1248,72 @@ msgid "" "socket` objects directly is more convenient." msgstr "" -#: ../../library/asyncio-eventloop.rst:975 +#: ../../library/asyncio-eventloop.rst:979 msgid "" "Receive up to *nbytes* from *sock*. Asynchronous version of :meth:`socket." "recv() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:978 +#: ../../library/asyncio-eventloop.rst:982 msgid "Return the received data as a bytes object." msgstr "" -#: ../../library/asyncio-eventloop.rst:980 -#: ../../library/asyncio-eventloop.rst:994 -#: ../../library/asyncio-eventloop.rst:1005 -#: ../../library/asyncio-eventloop.rst:1017 -#: ../../library/asyncio-eventloop.rst:1032 -#: ../../library/asyncio-eventloop.rst:1047 -#: ../../library/asyncio-eventloop.rst:1057 -#: ../../library/asyncio-eventloop.rst:1083 -#: ../../library/asyncio-eventloop.rst:1121 +#: ../../library/asyncio-eventloop.rst:984 +#: ../../library/asyncio-eventloop.rst:998 +#: ../../library/asyncio-eventloop.rst:1009 +#: ../../library/asyncio-eventloop.rst:1021 +#: ../../library/asyncio-eventloop.rst:1036 +#: ../../library/asyncio-eventloop.rst:1051 +#: ../../library/asyncio-eventloop.rst:1061 +#: ../../library/asyncio-eventloop.rst:1087 +#: ../../library/asyncio-eventloop.rst:1125 msgid "*sock* must be a non-blocking socket." msgstr "" -#: ../../library/asyncio-eventloop.rst:982 +#: ../../library/asyncio-eventloop.rst:986 msgid "" "Even though this method was always documented as a coroutine method, " "releases before Python 3.7 returned a :class:`Future`. Since Python 3.7 this " "is an ``async def`` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:989 +#: ../../library/asyncio-eventloop.rst:993 msgid "" "Receive data from *sock* into the *buf* buffer. Modeled after the blocking :" "meth:`socket.recv_into() ` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:992 +#: ../../library/asyncio-eventloop.rst:996 msgid "Return the number of bytes written to the buffer." msgstr "" -#: ../../library/asyncio-eventloop.rst:1000 +#: ../../library/asyncio-eventloop.rst:1004 msgid "" "Receive a datagram of up to *bufsize* from *sock*. Asynchronous version of :" "meth:`socket.recvfrom() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1003 +#: ../../library/asyncio-eventloop.rst:1007 msgid "Return a tuple of (received data, remote address)." msgstr "" -#: ../../library/asyncio-eventloop.rst:1011 +#: ../../library/asyncio-eventloop.rst:1015 msgid "" "Receive a datagram of up to *nbytes* from *sock* into *buf*. Asynchronous " "version of :meth:`socket.recvfrom_into() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1015 +#: ../../library/asyncio-eventloop.rst:1019 msgid "Return a tuple of (number of bytes received, remote address)." msgstr "" -#: ../../library/asyncio-eventloop.rst:1023 +#: ../../library/asyncio-eventloop.rst:1027 msgid "" "Send *data* to the *sock* socket. Asynchronous version of :meth:`socket." "sendall() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1026 +#: ../../library/asyncio-eventloop.rst:1030 msgid "" "This method continues to send to the socket until either all data in *data* " "has been sent or an error occurs. ``None`` is returned on success. On " @@ -1320,34 +1322,34 @@ msgid "" "the connection." msgstr "" -#: ../../library/asyncio-eventloop.rst:1034 -#: ../../library/asyncio-eventloop.rst:1085 +#: ../../library/asyncio-eventloop.rst:1038 +#: ../../library/asyncio-eventloop.rst:1089 msgid "" "Even though the method was always documented as a coroutine method, before " "Python 3.7 it returned a :class:`Future`. Since Python 3.7, this is an " "``async def`` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:1041 +#: ../../library/asyncio-eventloop.rst:1045 msgid "" "Send a datagram from *sock* to *address*. Asynchronous version of :meth:" "`socket.sendto() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1045 +#: ../../library/asyncio-eventloop.rst:1049 msgid "Return the number of bytes sent." msgstr "" -#: ../../library/asyncio-eventloop.rst:1053 +#: ../../library/asyncio-eventloop.rst:1057 msgid "Connect *sock* to a remote socket at *address*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1055 +#: ../../library/asyncio-eventloop.rst:1059 msgid "" "Asynchronous version of :meth:`socket.connect() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1059 +#: ../../library/asyncio-eventloop.rst:1063 msgid "" "``address`` no longer needs to be resolved. ``sock_connect`` will try to " "check if the *address* is already resolved by calling :func:`socket." @@ -1355,19 +1357,19 @@ msgid "" "*address*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1068 +#: ../../library/asyncio-eventloop.rst:1072 msgid "" ":meth:`loop.create_connection` and :func:`asyncio.open_connection() " "`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1074 +#: ../../library/asyncio-eventloop.rst:1078 msgid "" "Accept a connection. Modeled after the blocking :meth:`socket.accept() " "` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:1077 +#: ../../library/asyncio-eventloop.rst:1081 msgid "" "The socket must be bound to an address and listening for connections. The " "return value is a pair ``(conn, address)`` where *conn* is a *new* socket " @@ -1375,57 +1377,57 @@ msgid "" "the address bound to the socket on the other end of the connection." msgstr "" -#: ../../library/asyncio-eventloop.rst:1092 +#: ../../library/asyncio-eventloop.rst:1096 msgid ":meth:`loop.create_server` and :func:`start_server`." msgstr ":meth:`loop.create_server` 和 :func:`start_server`\\ 。" -#: ../../library/asyncio-eventloop.rst:1097 +#: ../../library/asyncio-eventloop.rst:1101 msgid "" "Send a file using high-performance :mod:`os.sendfile` if possible. Return " "the total number of bytes sent." msgstr "" -#: ../../library/asyncio-eventloop.rst:1100 +#: ../../library/asyncio-eventloop.rst:1104 msgid "" "Asynchronous version of :meth:`socket.sendfile() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1102 +#: ../../library/asyncio-eventloop.rst:1106 msgid "" "*sock* must be a non-blocking :const:`socket.SOCK_STREAM` :class:`~socket." "socket`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1105 +#: ../../library/asyncio-eventloop.rst:1109 msgid "*file* must be a regular file object open in binary mode." msgstr "" -#: ../../library/asyncio-eventloop.rst:1114 +#: ../../library/asyncio-eventloop.rst:1118 msgid "" "*fallback*, when set to ``True``, makes asyncio manually read and send the " "file when the platform does not support the sendfile syscall (e.g. Windows " "or SSL socket on Unix)." msgstr "" -#: ../../library/asyncio-eventloop.rst:1118 +#: ../../library/asyncio-eventloop.rst:1122 msgid "" "Raise :exc:`SendfileNotAvailableError` if the system does not support " "*sendfile* syscall and *fallback* is ``False``." msgstr "" -#: ../../library/asyncio-eventloop.rst:1127 +#: ../../library/asyncio-eventloop.rst:1131 msgid "DNS" msgstr "DNS" -#: ../../library/asyncio-eventloop.rst:1132 +#: ../../library/asyncio-eventloop.rst:1136 msgid "Asynchronous version of :meth:`socket.getaddrinfo`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1136 +#: ../../library/asyncio-eventloop.rst:1140 msgid "Asynchronous version of :meth:`socket.getnameinfo`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1138 +#: ../../library/asyncio-eventloop.rst:1142 msgid "" "Both *getaddrinfo* and *getnameinfo* methods were always documented to " "return a coroutine, but prior to Python 3.7 they were, in fact, returning :" @@ -1433,67 +1435,67 @@ msgid "" "coroutines." msgstr "" -#: ../../library/asyncio-eventloop.rst:1146 +#: ../../library/asyncio-eventloop.rst:1150 msgid "Working with pipes" msgstr "" -#: ../../library/asyncio-eventloop.rst:1150 +#: ../../library/asyncio-eventloop.rst:1154 msgid "Register the read end of *pipe* in the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1155 +#: ../../library/asyncio-eventloop.rst:1159 msgid "*pipe* is a :term:`file-like object `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1157 +#: ../../library/asyncio-eventloop.rst:1161 msgid "" "Return pair ``(transport, protocol)``, where *transport* supports the :class:" "`ReadTransport` interface and *protocol* is an object instantiated by the " "*protocol_factory*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1161 -#: ../../library/asyncio-eventloop.rst:1177 +#: ../../library/asyncio-eventloop.rst:1165 +#: ../../library/asyncio-eventloop.rst:1181 msgid "" "With :class:`SelectorEventLoop` event loop, the *pipe* is set to non-" "blocking mode." msgstr "" -#: ../../library/asyncio-eventloop.rst:1166 +#: ../../library/asyncio-eventloop.rst:1170 msgid "Register the write end of *pipe* in the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1171 +#: ../../library/asyncio-eventloop.rst:1175 msgid "*pipe* is :term:`file-like object `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1173 +#: ../../library/asyncio-eventloop.rst:1177 msgid "" "Return pair ``(transport, protocol)``, where *transport* supports :class:" "`WriteTransport` interface and *protocol* is an object instantiated by the " "*protocol_factory*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1182 +#: ../../library/asyncio-eventloop.rst:1186 msgid "" ":class:`SelectorEventLoop` does not support the above methods on Windows. " "Use :class:`ProactorEventLoop` instead for Windows." msgstr "" -#: ../../library/asyncio-eventloop.rst:1187 +#: ../../library/asyncio-eventloop.rst:1191 msgid "" "The :meth:`loop.subprocess_exec` and :meth:`loop.subprocess_shell` methods." msgstr "" -#: ../../library/asyncio-eventloop.rst:1192 +#: ../../library/asyncio-eventloop.rst:1196 msgid "Unix signals" msgstr "" -#: ../../library/asyncio-eventloop.rst:1196 +#: ../../library/asyncio-eventloop.rst:1202 msgid "Set *callback* as the handler for the *signum* signal." msgstr "" -#: ../../library/asyncio-eventloop.rst:1198 +#: ../../library/asyncio-eventloop.rst:1204 msgid "" "The callback will be invoked by *loop*, along with other queued callbacks " "and runnable coroutines of that event loop. Unlike signal handlers " @@ -1501,46 +1503,46 @@ msgid "" "function is allowed to interact with the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1203 +#: ../../library/asyncio-eventloop.rst:1209 msgid "" "Raise :exc:`ValueError` if the signal number is invalid or uncatchable. " "Raise :exc:`RuntimeError` if there is a problem setting up the handler." msgstr "" -#: ../../library/asyncio-eventloop.rst:1209 +#: ../../library/asyncio-eventloop.rst:1215 msgid "" "Like :func:`signal.signal`, this function must be invoked in the main thread." msgstr "" -#: ../../library/asyncio-eventloop.rst:1214 +#: ../../library/asyncio-eventloop.rst:1220 msgid "Remove the handler for the *sig* signal." msgstr "" -#: ../../library/asyncio-eventloop.rst:1216 +#: ../../library/asyncio-eventloop.rst:1222 msgid "" "Return ``True`` if the signal handler was removed, or ``False`` if no " "handler was set for the given signal." msgstr "" -#: ../../library/asyncio-eventloop.rst:1223 +#: ../../library/asyncio-eventloop.rst:1229 msgid "The :mod:`signal` module." msgstr "" -#: ../../library/asyncio-eventloop.rst:1227 +#: ../../library/asyncio-eventloop.rst:1233 msgid "Executing code in thread or process pools" msgstr "" -#: ../../library/asyncio-eventloop.rst:1231 +#: ../../library/asyncio-eventloop.rst:1237 msgid "Arrange for *func* to be called in the specified executor." msgstr "" -#: ../../library/asyncio-eventloop.rst:1233 +#: ../../library/asyncio-eventloop.rst:1239 msgid "" "The *executor* argument should be an :class:`concurrent.futures.Executor` " "instance. The default executor is used if *executor* is ``None``." msgstr "" -#: ../../library/asyncio-eventloop.rst:1278 +#: ../../library/asyncio-eventloop.rst:1284 msgid "" "Note that the entry point guard (``if __name__ == '__main__'``) is required " "for option 3 due to the peculiarities of :mod:`multiprocessing`, which is " @@ -1548,17 +1550,17 @@ msgid "" "importing of main module `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1283 +#: ../../library/asyncio-eventloop.rst:1289 msgid "This method returns a :class:`asyncio.Future` object." msgstr "" -#: ../../library/asyncio-eventloop.rst:1285 +#: ../../library/asyncio-eventloop.rst:1291 msgid "" "Use :func:`functools.partial` :ref:`to pass keyword arguments ` to *func*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1288 +#: ../../library/asyncio-eventloop.rst:1294 msgid "" ":meth:`loop.run_in_executor` no longer configures the ``max_workers`` of the " "thread pool executor it creates, instead leaving it up to the thread pool " @@ -1566,32 +1568,32 @@ msgid "" "default." msgstr "" -#: ../../library/asyncio-eventloop.rst:1297 +#: ../../library/asyncio-eventloop.rst:1303 msgid "" "Set *executor* as the default executor used by :meth:`run_in_executor`. " "*executor* must be an instance of :class:`~concurrent.futures." "ThreadPoolExecutor`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1301 +#: ../../library/asyncio-eventloop.rst:1307 msgid "" "*executor* must be an instance of :class:`~concurrent.futures." "ThreadPoolExecutor`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1307 +#: ../../library/asyncio-eventloop.rst:1313 msgid "Error Handling API" msgstr "" -#: ../../library/asyncio-eventloop.rst:1309 +#: ../../library/asyncio-eventloop.rst:1315 msgid "Allows customizing how exceptions are handled in the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1313 +#: ../../library/asyncio-eventloop.rst:1319 msgid "Set *handler* as the new event loop exception handler." msgstr "" -#: ../../library/asyncio-eventloop.rst:1315 +#: ../../library/asyncio-eventloop.rst:1321 msgid "" "If *handler* is ``None``, the default exception handler will be set. " "Otherwise, *handler* must be a callable with the signature matching ``(loop, " @@ -1600,171 +1602,182 @@ msgid "" "(see :meth:`call_exception_handler` documentation for details about context)." msgstr "" -#: ../../library/asyncio-eventloop.rst:1323 +#: ../../library/asyncio-eventloop.rst:1329 msgid "" "If the handler is called on behalf of a :class:`~asyncio.Task` or :class:" "`~asyncio.Handle`, it is run in the :class:`contextvars.Context` of that " "task or callback handle." msgstr "" -#: ../../library/asyncio-eventloop.rst:1329 +#: ../../library/asyncio-eventloop.rst:1335 msgid "" "The handler may be called in the :class:`~contextvars.Context` of the task " "or handle where the exception originated." msgstr "" -#: ../../library/asyncio-eventloop.rst:1334 +#: ../../library/asyncio-eventloop.rst:1340 msgid "" "Return the current exception handler, or ``None`` if no custom exception " "handler was set." msgstr "" -#: ../../library/asyncio-eventloop.rst:1341 +#: ../../library/asyncio-eventloop.rst:1347 msgid "Default exception handler." msgstr "" -#: ../../library/asyncio-eventloop.rst:1343 +#: ../../library/asyncio-eventloop.rst:1349 msgid "" "This is called when an exception occurs and no exception handler is set. " "This can be called by a custom exception handler that wants to defer to the " "default handler behavior." msgstr "" -#: ../../library/asyncio-eventloop.rst:1347 +#: ../../library/asyncio-eventloop.rst:1353 msgid "" "*context* parameter has the same meaning as in :meth:" "`call_exception_handler`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1352 +#: ../../library/asyncio-eventloop.rst:1358 msgid "Call the current event loop exception handler." msgstr "" -#: ../../library/asyncio-eventloop.rst:1354 +#: ../../library/asyncio-eventloop.rst:1360 msgid "" "*context* is a ``dict`` object containing the following keys (new keys may " "be introduced in future Python versions):" msgstr "" -#: ../../library/asyncio-eventloop.rst:1357 +#: ../../library/asyncio-eventloop.rst:1363 msgid "'message': Error message;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1358 +#: ../../library/asyncio-eventloop.rst:1364 msgid "'exception' (optional): Exception object;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1359 +#: ../../library/asyncio-eventloop.rst:1365 msgid "'future' (optional): :class:`asyncio.Future` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1360 +#: ../../library/asyncio-eventloop.rst:1366 msgid "'task' (optional): :class:`asyncio.Task` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1361 +#: ../../library/asyncio-eventloop.rst:1367 msgid "'handle' (optional): :class:`asyncio.Handle` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1362 +#: ../../library/asyncio-eventloop.rst:1368 msgid "'protocol' (optional): :ref:`Protocol ` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1363 +#: ../../library/asyncio-eventloop.rst:1369 msgid "'transport' (optional): :ref:`Transport ` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1364 +#: ../../library/asyncio-eventloop.rst:1370 msgid "'socket' (optional): :class:`socket.socket` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1366 +#: ../../library/asyncio-eventloop.rst:1372 msgid "'asyncgen' (optional): Asynchronous generator that caused" msgstr "" -#: ../../library/asyncio-eventloop.rst:1366 +#: ../../library/asyncio-eventloop.rst:1372 msgid "the exception." msgstr "" -#: ../../library/asyncio-eventloop.rst:1370 +#: ../../library/asyncio-eventloop.rst:1376 msgid "" "This method should not be overloaded in subclassed event loops. For custom " "exception handling, use the :meth:`set_exception_handler()` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:1375 +#: ../../library/asyncio-eventloop.rst:1381 msgid "Enabling debug mode" msgstr "" -#: ../../library/asyncio-eventloop.rst:1379 +#: ../../library/asyncio-eventloop.rst:1385 msgid "Get the debug mode (:class:`bool`) of the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1381 +#: ../../library/asyncio-eventloop.rst:1387 msgid "" "The default value is ``True`` if the environment variable :envvar:" "`PYTHONASYNCIODEBUG` is set to a non-empty string, ``False`` otherwise." msgstr "" -#: ../../library/asyncio-eventloop.rst:1387 +#: ../../library/asyncio-eventloop.rst:1393 msgid "Set the debug mode of the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1391 +#: ../../library/asyncio-eventloop.rst:1397 msgid "" "The new :ref:`Python Development Mode ` can now also be used to " "enable the debug mode." msgstr "" -#: ../../library/asyncio-eventloop.rst:1396 +#: ../../library/asyncio-eventloop.rst:1402 +msgid "" +"This attribute can be used to set the minimum execution duration in seconds " +"that is considered \"slow\". When debug mode is enabled, \"slow\" callbacks " +"are logged." +msgstr "" + +#: ../../library/asyncio-eventloop.rst:1406 +msgid "Default value is 100 milliseconds." +msgstr "" + +#: ../../library/asyncio-eventloop.rst:1410 msgid "The :ref:`debug mode of asyncio `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1400 +#: ../../library/asyncio-eventloop.rst:1414 msgid "Running Subprocesses" msgstr "" -#: ../../library/asyncio-eventloop.rst:1402 +#: ../../library/asyncio-eventloop.rst:1416 msgid "" "Methods described in this subsections are low-level. In regular async/await " "code consider using the high-level :func:`asyncio.create_subprocess_shell` " "and :func:`asyncio.create_subprocess_exec` convenience functions instead." msgstr "" -#: ../../library/asyncio-eventloop.rst:1409 +#: ../../library/asyncio-eventloop.rst:1423 msgid "" "On Windows, the default event loop :class:`ProactorEventLoop` supports " "subprocesses, whereas :class:`SelectorEventLoop` does not. See :ref:" "`Subprocess Support on Windows ` for details." msgstr "" -#: ../../library/asyncio-eventloop.rst:1418 +#: ../../library/asyncio-eventloop.rst:1434 msgid "" "Create a subprocess from one or more string arguments specified by *args*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1421 +#: ../../library/asyncio-eventloop.rst:1437 msgid "*args* must be a list of strings represented by:" msgstr "" -#: ../../library/asyncio-eventloop.rst:1423 +#: ../../library/asyncio-eventloop.rst:1439 msgid ":class:`str`;" msgstr ":class:`str`\\ ;" -#: ../../library/asyncio-eventloop.rst:1424 +#: ../../library/asyncio-eventloop.rst:1440 msgid "" "or :class:`bytes`, encoded to the :ref:`filesystem encoding `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1427 +#: ../../library/asyncio-eventloop.rst:1443 msgid "" "The first string specifies the program executable, and the remaining strings " "specify the arguments. Together, string arguments form the ``argv`` of the " "program." msgstr "" -#: ../../library/asyncio-eventloop.rst:1431 +#: ../../library/asyncio-eventloop.rst:1447 msgid "" "This is similar to the standard library :class:`subprocess.Popen` class " "called with ``shell=False`` and the list of strings passed as the first " @@ -1772,85 +1785,85 @@ msgid "" "which is list of strings, *subprocess_exec* takes multiple string arguments." msgstr "" -#: ../../library/asyncio-eventloop.rst:1437 +#: ../../library/asyncio-eventloop.rst:1453 msgid "" "The *protocol_factory* must be a callable returning a subclass of the :class:" "`asyncio.SubprocessProtocol` class." msgstr "" -#: ../../library/asyncio-eventloop.rst:1440 +#: ../../library/asyncio-eventloop.rst:1456 msgid "Other parameters:" msgstr "其他參數:" -#: ../../library/asyncio-eventloop.rst:1442 +#: ../../library/asyncio-eventloop.rst:1458 msgid "*stdin* can be any of these:" msgstr "" -#: ../../library/asyncio-eventloop.rst:1444 -#: ../../library/asyncio-eventloop.rst:1455 -#: ../../library/asyncio-eventloop.rst:1465 +#: ../../library/asyncio-eventloop.rst:1460 +#: ../../library/asyncio-eventloop.rst:1471 +#: ../../library/asyncio-eventloop.rst:1481 msgid "a file-like object" msgstr "" -#: ../../library/asyncio-eventloop.rst:1445 +#: ../../library/asyncio-eventloop.rst:1461 msgid "" "an existing file descriptor (a positive integer), for example those created " "with :meth:`os.pipe()`" msgstr "" -#: ../../library/asyncio-eventloop.rst:1446 -#: ../../library/asyncio-eventloop.rst:1456 -#: ../../library/asyncio-eventloop.rst:1466 +#: ../../library/asyncio-eventloop.rst:1462 +#: ../../library/asyncio-eventloop.rst:1472 +#: ../../library/asyncio-eventloop.rst:1482 msgid "" "the :const:`subprocess.PIPE` constant (default) which will create a new pipe " "and connect it," msgstr "" -#: ../../library/asyncio-eventloop.rst:1448 -#: ../../library/asyncio-eventloop.rst:1458 -#: ../../library/asyncio-eventloop.rst:1468 +#: ../../library/asyncio-eventloop.rst:1464 +#: ../../library/asyncio-eventloop.rst:1474 +#: ../../library/asyncio-eventloop.rst:1484 msgid "" "the value ``None`` which will make the subprocess inherit the file " "descriptor from this process" msgstr "" -#: ../../library/asyncio-eventloop.rst:1450 -#: ../../library/asyncio-eventloop.rst:1460 -#: ../../library/asyncio-eventloop.rst:1470 +#: ../../library/asyncio-eventloop.rst:1466 +#: ../../library/asyncio-eventloop.rst:1476 +#: ../../library/asyncio-eventloop.rst:1486 msgid "" "the :const:`subprocess.DEVNULL` constant which indicates that the special :" "data:`os.devnull` file will be used" msgstr "" -#: ../../library/asyncio-eventloop.rst:1453 +#: ../../library/asyncio-eventloop.rst:1469 msgid "*stdout* can be any of these:" msgstr "" -#: ../../library/asyncio-eventloop.rst:1463 +#: ../../library/asyncio-eventloop.rst:1479 msgid "*stderr* can be any of these:" msgstr "" -#: ../../library/asyncio-eventloop.rst:1472 +#: ../../library/asyncio-eventloop.rst:1488 msgid "" "the :const:`subprocess.STDOUT` constant which will connect the standard " "error stream to the process' standard output stream" msgstr "" -#: ../../library/asyncio-eventloop.rst:1475 +#: ../../library/asyncio-eventloop.rst:1491 msgid "" "All other keyword arguments are passed to :class:`subprocess.Popen` without " "interpretation, except for *bufsize*, *universal_newlines*, *shell*, *text*, " "*encoding* and *errors*, which should not be specified at all." msgstr "" -#: ../../library/asyncio-eventloop.rst:1480 +#: ../../library/asyncio-eventloop.rst:1496 msgid "" "The ``asyncio`` subprocess API does not support decoding the streams as " "text. :func:`bytes.decode` can be used to convert the bytes returned from " "the stream to text." msgstr "" -#: ../../library/asyncio-eventloop.rst:1484 +#: ../../library/asyncio-eventloop.rst:1500 msgid "" "If a file-like object passed as *stdin*, *stdout* or *stderr* represents a " "pipe, then the other side of this pipe should be registered with :meth:" @@ -1858,52 +1871,52 @@ msgid "" "the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1489 +#: ../../library/asyncio-eventloop.rst:1505 msgid "" "See the constructor of the :class:`subprocess.Popen` class for documentation " "on other arguments." msgstr "" -#: ../../library/asyncio-eventloop.rst:1492 +#: ../../library/asyncio-eventloop.rst:1508 msgid "" "Returns a pair of ``(transport, protocol)``, where *transport* conforms to " "the :class:`asyncio.SubprocessTransport` base class and *protocol* is an " "object instantiated by the *protocol_factory*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1500 +#: ../../library/asyncio-eventloop.rst:1516 msgid "" "Create a subprocess from *cmd*, which can be a :class:`str` or a :class:" "`bytes` string encoded to the :ref:`filesystem encoding `, using the platform's \"shell\" syntax." msgstr "" -#: ../../library/asyncio-eventloop.rst:1505 +#: ../../library/asyncio-eventloop.rst:1521 msgid "" "This is similar to the standard library :class:`subprocess.Popen` class " "called with ``shell=True``." msgstr "" -#: ../../library/asyncio-eventloop.rst:1508 +#: ../../library/asyncio-eventloop.rst:1524 msgid "" "The *protocol_factory* must be a callable returning a subclass of the :class:" "`SubprocessProtocol` class." msgstr "" -#: ../../library/asyncio-eventloop.rst:1511 +#: ../../library/asyncio-eventloop.rst:1527 msgid "" "See :meth:`~loop.subprocess_exec` for more details about the remaining " "arguments." msgstr "" -#: ../../library/asyncio-eventloop.rst:1514 +#: ../../library/asyncio-eventloop.rst:1530 msgid "" "Returns a pair of ``(transport, protocol)``, where *transport* conforms to " "the :class:`SubprocessTransport` base class and *protocol* is an object " "instantiated by the *protocol_factory*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1519 +#: ../../library/asyncio-eventloop.rst:1535 msgid "" "It is the application's responsibility to ensure that all whitespace and " "special characters are quoted appropriately to avoid `shell injection " @@ -1913,116 +1926,116 @@ msgid "" "used to construct shell commands." msgstr "" -#: ../../library/asyncio-eventloop.rst:1528 +#: ../../library/asyncio-eventloop.rst:1544 msgid "Callback Handles" msgstr "" -#: ../../library/asyncio-eventloop.rst:1532 +#: ../../library/asyncio-eventloop.rst:1548 msgid "" "A callback wrapper object returned by :meth:`loop.call_soon`, :meth:`loop." "call_soon_threadsafe`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1537 +#: ../../library/asyncio-eventloop.rst:1553 msgid "" "Return the :class:`contextvars.Context` object associated with the handle." msgstr "" -#: ../../library/asyncio-eventloop.rst:1544 +#: ../../library/asyncio-eventloop.rst:1560 msgid "" "Cancel the callback. If the callback has already been canceled or executed, " "this method has no effect." msgstr "" -#: ../../library/asyncio-eventloop.rst:1549 +#: ../../library/asyncio-eventloop.rst:1565 msgid "Return ``True`` if the callback was cancelled." msgstr "" -#: ../../library/asyncio-eventloop.rst:1555 +#: ../../library/asyncio-eventloop.rst:1571 msgid "" "A callback wrapper object returned by :meth:`loop.call_later`, and :meth:" "`loop.call_at`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1558 +#: ../../library/asyncio-eventloop.rst:1574 msgid "This class is a subclass of :class:`Handle`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1562 +#: ../../library/asyncio-eventloop.rst:1578 msgid "Return a scheduled callback time as :class:`float` seconds." msgstr "" -#: ../../library/asyncio-eventloop.rst:1564 +#: ../../library/asyncio-eventloop.rst:1580 msgid "" "The time is an absolute timestamp, using the same time reference as :meth:" "`loop.time`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1571 +#: ../../library/asyncio-eventloop.rst:1587 msgid "Server Objects" msgstr "" -#: ../../library/asyncio-eventloop.rst:1573 +#: ../../library/asyncio-eventloop.rst:1589 msgid "" "Server objects are created by :meth:`loop.create_server`, :meth:`loop." "create_unix_server`, :func:`start_server`, and :func:`start_unix_server` " "functions." msgstr "" -#: ../../library/asyncio-eventloop.rst:1577 +#: ../../library/asyncio-eventloop.rst:1593 msgid "Do not instantiate the :class:`Server` class directly." msgstr "" -#: ../../library/asyncio-eventloop.rst:1581 +#: ../../library/asyncio-eventloop.rst:1597 msgid "" "*Server* objects are asynchronous context managers. When used in an ``async " "with`` statement, it's guaranteed that the Server object is closed and not " "accepting new connections when the ``async with`` statement is completed::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1594 +#: ../../library/asyncio-eventloop.rst:1610 msgid "Server object is an asynchronous context manager since Python 3.7." msgstr "" -#: ../../library/asyncio-eventloop.rst:1597 +#: ../../library/asyncio-eventloop.rst:1613 msgid "" "This class was exposed publicly as ``asyncio.Server`` in Python 3.9.11, " "3.10.3 and 3.11." msgstr "" -#: ../../library/asyncio-eventloop.rst:1602 +#: ../../library/asyncio-eventloop.rst:1618 msgid "" "Stop serving: close listening sockets and set the :attr:`sockets` attribute " "to ``None``." msgstr "" -#: ../../library/asyncio-eventloop.rst:1605 +#: ../../library/asyncio-eventloop.rst:1621 msgid "" "The sockets that represent existing incoming client connections are left " "open." msgstr "" -#: ../../library/asyncio-eventloop.rst:1608 +#: ../../library/asyncio-eventloop.rst:1624 msgid "" -"The server is closed asynchronously, use the :meth:`wait_closed` coroutine " -"to wait until the server is closed." +"The server is closed asynchronously; use the :meth:`wait_closed` coroutine " +"to wait until the server is closed (and no more connections are active)." msgstr "" -#: ../../library/asyncio-eventloop.rst:1613 +#: ../../library/asyncio-eventloop.rst:1630 msgid "Return the event loop associated with the server object." msgstr "" -#: ../../library/asyncio-eventloop.rst:1619 +#: ../../library/asyncio-eventloop.rst:1636 msgid "Start accepting connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:1621 +#: ../../library/asyncio-eventloop.rst:1638 msgid "" "This method is idempotent, so it can be called when the server is already " "serving." msgstr "" -#: ../../library/asyncio-eventloop.rst:1624 +#: ../../library/asyncio-eventloop.rst:1641 msgid "" "The *start_serving* keyword-only parameter to :meth:`loop.create_server` " "and :meth:`asyncio.start_server` allows creating a Server object that is not " @@ -2031,98 +2044,100 @@ msgid "" "accepting connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:1635 +#: ../../library/asyncio-eventloop.rst:1652 msgid "" "Start accepting connections until the coroutine is cancelled. Cancellation " "of ``serve_forever`` task causes the server to be closed." msgstr "" -#: ../../library/asyncio-eventloop.rst:1639 +#: ../../library/asyncio-eventloop.rst:1656 msgid "" "This method can be called if the server is already accepting connections. " "Only one ``serve_forever`` task can exist per one *Server* object." msgstr "" -#: ../../library/asyncio-eventloop.rst:1661 +#: ../../library/asyncio-eventloop.rst:1678 msgid "Return ``True`` if the server is accepting new connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:1667 -msgid "Wait until the :meth:`close` method completes." +#: ../../library/asyncio-eventloop.rst:1684 +msgid "" +"Wait until the :meth:`close` method completes and all active connections " +"have finished." msgstr "" -#: ../../library/asyncio-eventloop.rst:1671 +#: ../../library/asyncio-eventloop.rst:1689 msgid "" "List of socket-like objects, ``asyncio.trsock.TransportSocket``, which the " "server is listening on." msgstr "" -#: ../../library/asyncio-eventloop.rst:1674 +#: ../../library/asyncio-eventloop.rst:1692 msgid "" "Prior to Python 3.7 ``Server.sockets`` used to return an internal list of " "server sockets directly. In 3.7 a copy of that list is returned." msgstr "" -#: ../../library/asyncio-eventloop.rst:1684 +#: ../../library/asyncio-eventloop.rst:1702 msgid "Event Loop Implementations" msgstr "" -#: ../../library/asyncio-eventloop.rst:1686 +#: ../../library/asyncio-eventloop.rst:1704 msgid "" "asyncio ships with two different event loop implementations: :class:" "`SelectorEventLoop` and :class:`ProactorEventLoop`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1689 +#: ../../library/asyncio-eventloop.rst:1707 msgid "" "By default asyncio is configured to use :class:`SelectorEventLoop` on Unix " "and :class:`ProactorEventLoop` on Windows." msgstr "" -#: ../../library/asyncio-eventloop.rst:1695 +#: ../../library/asyncio-eventloop.rst:1713 msgid "An event loop based on the :mod:`selectors` module." msgstr "" -#: ../../library/asyncio-eventloop.rst:1697 +#: ../../library/asyncio-eventloop.rst:1715 msgid "" "Uses the most efficient *selector* available for the given platform. It is " "also possible to manually configure the exact selector implementation to be " "used::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1712 +#: ../../library/asyncio-eventloop.rst:1730 msgid ":ref:`Availability `: Unix, Windows." msgstr ":ref:`適用 `:Unix、Windows。" -#: ../../library/asyncio-eventloop.rst:1717 +#: ../../library/asyncio-eventloop.rst:1735 msgid "An event loop for Windows that uses \"I/O Completion Ports\" (IOCP)." msgstr "" -#: ../../library/asyncio-eventloop.rst:1719 +#: ../../library/asyncio-eventloop.rst:1737 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" -#: ../../library/asyncio-eventloop.rst:1723 +#: ../../library/asyncio-eventloop.rst:1741 msgid "" "`MSDN documentation on I/O Completion Ports `_." msgstr "" -#: ../../library/asyncio-eventloop.rst:1729 +#: ../../library/asyncio-eventloop.rst:1747 msgid "Abstract base class for asyncio-compliant event loops." msgstr "" -#: ../../library/asyncio-eventloop.rst:1731 +#: ../../library/asyncio-eventloop.rst:1749 msgid "" "The :ref:`asyncio-event-loop-methods` section lists all methods that an " "alternative implementation of ``AbstractEventLoop`` should have defined." msgstr "" -#: ../../library/asyncio-eventloop.rst:1737 +#: ../../library/asyncio-eventloop.rst:1755 msgid "Examples" msgstr "範例" -#: ../../library/asyncio-eventloop.rst:1739 +#: ../../library/asyncio-eventloop.rst:1757 msgid "" "Note that all examples in this section **purposefully** show how to use the " "low-level event loop APIs, such as :meth:`loop.run_forever` and :meth:`loop." @@ -2130,71 +2145,71 @@ msgid "" "consider using the high-level functions like :func:`asyncio.run`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1749 +#: ../../library/asyncio-eventloop.rst:1767 msgid "Hello World with call_soon()" msgstr "" -#: ../../library/asyncio-eventloop.rst:1751 +#: ../../library/asyncio-eventloop.rst:1769 msgid "" "An example using the :meth:`loop.call_soon` method to schedule a callback. " "The callback displays ``\"Hello World\"`` and then stops the event loop::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1775 +#: ../../library/asyncio-eventloop.rst:1793 msgid "" "A similar :ref:`Hello World ` example created with a coroutine " "and the :func:`run` function." msgstr "" -#: ../../library/asyncio-eventloop.rst:1782 +#: ../../library/asyncio-eventloop.rst:1800 msgid "Display the current date with call_later()" msgstr "" -#: ../../library/asyncio-eventloop.rst:1784 +#: ../../library/asyncio-eventloop.rst:1802 msgid "" "An example of a callback displaying the current date every second. The " "callback uses the :meth:`loop.call_later` method to reschedule itself after " "5 seconds, and then stops the event loop::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1812 +#: ../../library/asyncio-eventloop.rst:1830 msgid "" "A similar :ref:`current date ` example created with a " "coroutine and the :func:`run` function." msgstr "" -#: ../../library/asyncio-eventloop.rst:1819 +#: ../../library/asyncio-eventloop.rst:1837 msgid "Watch a file descriptor for read events" msgstr "" -#: ../../library/asyncio-eventloop.rst:1821 +#: ../../library/asyncio-eventloop.rst:1839 msgid "" "Wait until a file descriptor received some data using the :meth:`loop." "add_reader` method and then close the event loop::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1859 +#: ../../library/asyncio-eventloop.rst:1877 msgid "" "A similar :ref:`example ` using " "transports, protocols, and the :meth:`loop.create_connection` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:1863 +#: ../../library/asyncio-eventloop.rst:1881 msgid "" "Another similar :ref:`example ` " "using the high-level :func:`asyncio.open_connection` function and streams." msgstr "" -#: ../../library/asyncio-eventloop.rst:1871 +#: ../../library/asyncio-eventloop.rst:1889 msgid "Set signal handlers for SIGINT and SIGTERM" msgstr "" -#: ../../library/asyncio-eventloop.rst:1873 +#: ../../library/asyncio-eventloop.rst:1891 msgid "(This ``signals`` example only works on Unix.)" msgstr "" -#: ../../library/asyncio-eventloop.rst:1875 +#: ../../library/asyncio-eventloop.rst:1893 msgid "" -"Register handlers for signals :py:data:`SIGINT` and :py:data:`SIGTERM` using " -"the :meth:`loop.add_signal_handler` method::" +"Register handlers for signals :const:`~signal.SIGINT` and :const:`~signal." +"SIGTERM` using the :meth:`loop.add_signal_handler` method::" msgstr "" diff --git a/library/asyncio.po b/library/asyncio.po index c05bfecad4..8aaf1d8947 100644 --- a/library/asyncio.po +++ b/library/asyncio.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-12 00:03+0000\n" +"POT-Creation-Date: 2023-10-25 00:03+0000\n" "PO-Revision-Date: 2021-11-23 12:40+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -102,14 +102,14 @@ msgstr "" #: ../../library/asyncio.rst:48 msgid "" "create and manage :ref:`event loops `, which provide " -"asynchronous APIs for :meth:`networking `, running :meth:" -"`subprocesses `, handling :meth:`OS signals `, etc;" +"asynchronous APIs for :ref:`networking `, running :ref:" +"`subprocesses `, handling :ref:`OS signals " +"`, etc;" msgstr "" "建立與管理 :ref:`event loops(事件迴圈) `,它提供了能被" -"用於\\ :meth:`網路 `\\ 、執行\\ :meth:`子行程 `、處理\\ :meth:`作業系統訊號 `\\ 等" -"任務的非同步 API;" +"用於\\ :ref:`網路 `、執行\\ :ref:`子行程 " +"`、處理\\ :ref:`作業系統訊號 " +"`\\ 等任務的非同步 API;" #: ../../library/asyncio.rst:53 msgid "" diff --git a/library/bz2.po b/library/bz2.po index e031a1d32b..8fe1ff50cc 100644 --- a/library/bz2.po +++ b/library/bz2.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 10:36+0000\n" +"POT-Creation-Date: 2023-10-24 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:40+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -99,11 +99,11 @@ msgid "" "handling behavior, and line ending(s)." msgstr "" -#: ../../library/bz2.rst:59 ../../library/bz2.rst:125 +#: ../../library/bz2.rst:59 ../../library/bz2.rst:163 msgid "The ``'x'`` (exclusive creation) mode was added." msgstr "" -#: ../../library/bz2.rst:62 ../../library/bz2.rst:132 +#: ../../library/bz2.rst:62 ../../library/bz2.rst:170 msgid "Accepts a :term:`path-like object`." msgstr "" @@ -153,7 +153,7 @@ msgid "" msgstr "" #: ../../library/bz2.rst:94 -msgid ":class:`BZ2File` also provides the following method:" +msgid ":class:`BZ2File` also provides the following methods:" msgstr "" #: ../../library/bz2.rst:98 @@ -171,99 +171,128 @@ msgid "" "*filename*)." msgstr "" -#: ../../library/bz2.rst:110 -msgid "Support for the :keyword:`with` statement was added." +#: ../../library/bz2.rst:111 +msgid "Return the file descriptor for the underlying file." +msgstr "" + +#: ../../library/bz2.rst:117 +msgid "Return whether the file was opened for reading." +msgstr "" + +#: ../../library/bz2.rst:123 +msgid "Return whether the file supports seeking." +msgstr "" + +#: ../../library/bz2.rst:129 +msgid "Return whether the file was opened for writing." msgstr "" -#: ../../library/bz2.rst:113 +#: ../../library/bz2.rst:135 msgid "" -"The :meth:`fileno`, :meth:`readable`, :meth:`seekable`, :meth:`writable`, :" -"meth:`read1` and :meth:`readinto` methods were added." +"Read up to *size* uncompressed bytes, while trying to avoid making multiple " +"reads from the underlying stream. Reads up to a buffer's worth of data if " +"size is negative." msgstr "" -#: ../../library/bz2.rst:117 +#: ../../library/bz2.rst:139 +msgid "Returns ``b''`` if the file is at EOF." +msgstr "" + +#: ../../library/bz2.rst:145 +msgid "Read bytes into *b*." +msgstr "" + +#: ../../library/bz2.rst:147 +msgid "Returns the number of bytes read (0 for EOF)." +msgstr "" + +#: ../../library/bz2.rst:152 +msgid "Support for the :keyword:`with` statement was added." +msgstr "" + +#: ../../library/bz2.rst:155 msgid "" "Support was added for *filename* being a :term:`file object` instead of an " "actual filename." msgstr "" -#: ../../library/bz2.rst:121 +#: ../../library/bz2.rst:159 msgid "" "The ``'a'`` (append) mode was added, along with support for reading multi-" "stream files." msgstr "" -#: ../../library/bz2.rst:128 +#: ../../library/bz2.rst:166 msgid "" "The :meth:`~io.BufferedIOBase.read` method now accepts an argument of " "``None``." msgstr "" -#: ../../library/bz2.rst:135 +#: ../../library/bz2.rst:173 msgid "" "The *buffering* parameter has been removed. It was ignored and deprecated " "since Python 3.0. Pass an open file object to control how the file is opened." msgstr "" -#: ../../library/bz2.rst:140 +#: ../../library/bz2.rst:178 msgid "The *compresslevel* parameter became keyword-only." msgstr "" -#: ../../library/bz2.rst:142 +#: ../../library/bz2.rst:180 msgid "" "This class is thread unsafe in the face of multiple simultaneous readers or " "writers, just like its equivalent classes in :mod:`gzip` and :mod:`lzma` " "have always been." msgstr "" -#: ../../library/bz2.rst:149 +#: ../../library/bz2.rst:187 msgid "Incremental (de)compression" msgstr "" -#: ../../library/bz2.rst:153 +#: ../../library/bz2.rst:191 msgid "" "Create a new compressor object. This object may be used to compress data " "incrementally. For one-shot compression, use the :func:`compress` function " "instead." msgstr "" -#: ../../library/bz2.rst:157 ../../library/bz2.rst:245 +#: ../../library/bz2.rst:195 ../../library/bz2.rst:283 msgid "" "*compresslevel*, if given, must be an integer between ``1`` and ``9``. The " "default is ``9``." msgstr "" -#: ../../library/bz2.rst:162 +#: ../../library/bz2.rst:200 msgid "" "Provide data to the compressor object. Returns a chunk of compressed data if " "possible, or an empty byte string otherwise." msgstr "" -#: ../../library/bz2.rst:165 +#: ../../library/bz2.rst:203 msgid "" "When you have finished providing data to the compressor, call the :meth:" "`flush` method to finish the compression process." msgstr "" -#: ../../library/bz2.rst:171 +#: ../../library/bz2.rst:209 msgid "" "Finish the compression process. Returns the compressed data left in internal " "buffers." msgstr "" -#: ../../library/bz2.rst:174 +#: ../../library/bz2.rst:212 msgid "" "The compressor object may not be used after this method has been called." msgstr "" -#: ../../library/bz2.rst:179 +#: ../../library/bz2.rst:217 msgid "" "Create a new decompressor object. This object may be used to decompress data " "incrementally. For one-shot compression, use the :func:`decompress` function " "instead." msgstr "" -#: ../../library/bz2.rst:184 +#: ../../library/bz2.rst:222 msgid "" "This class does not transparently handle inputs containing multiple " "compressed streams, unlike :func:`decompress` and :class:`BZ2File`. If you " @@ -271,7 +300,7 @@ msgid "" "must use a new decompressor for each stream." msgstr "" -#: ../../library/bz2.rst:191 +#: ../../library/bz2.rst:229 msgid "" "Decompress *data* (a :term:`bytes-like object`), returning uncompressed data " "as bytes. Some of *data* may be buffered internally, for use in later calls " @@ -279,7 +308,7 @@ msgid "" "output of any previous calls to :meth:`decompress`." msgstr "" -#: ../../library/bz2.rst:197 +#: ../../library/bz2.rst:235 msgid "" "If *max_length* is nonnegative, returns at most *max_length* bytes of " "decompressed data. If this limit is reached and further output can be " @@ -288,99 +317,99 @@ msgid "" "``b''`` to obtain more of the output." msgstr "" -#: ../../library/bz2.rst:204 +#: ../../library/bz2.rst:242 msgid "" "If all of the input data was decompressed and returned (either because this " "was less than *max_length* bytes, or because *max_length* was negative), " "the :attr:`~.needs_input` attribute will be set to ``True``." msgstr "" -#: ../../library/bz2.rst:209 +#: ../../library/bz2.rst:247 msgid "" "Attempting to decompress data after the end of stream is reached raises an :" "exc:`EOFError`. Any data found after the end of the stream is ignored and " "saved in the :attr:`~.unused_data` attribute." msgstr "" -#: ../../library/bz2.rst:213 +#: ../../library/bz2.rst:251 msgid "Added the *max_length* parameter." msgstr "新增 *max_length* 參數。" -#: ../../library/bz2.rst:218 +#: ../../library/bz2.rst:256 msgid "``True`` if the end-of-stream marker has been reached." msgstr "" -#: ../../library/bz2.rst:225 +#: ../../library/bz2.rst:263 msgid "Data found after the end of the compressed stream." msgstr "" -#: ../../library/bz2.rst:227 +#: ../../library/bz2.rst:265 msgid "" "If this attribute is accessed before the end of the stream has been reached, " "its value will be ``b''``." msgstr "" -#: ../../library/bz2.rst:232 +#: ../../library/bz2.rst:270 msgid "" "``False`` if the :meth:`.decompress` method can provide more decompressed " "data before requiring new uncompressed input." msgstr "" -#: ../../library/bz2.rst:239 +#: ../../library/bz2.rst:277 msgid "One-shot (de)compression" msgstr "" -#: ../../library/bz2.rst:243 +#: ../../library/bz2.rst:281 msgid "Compress *data*, a :term:`bytes-like object `." msgstr "" -#: ../../library/bz2.rst:248 +#: ../../library/bz2.rst:286 msgid "For incremental compression, use a :class:`BZ2Compressor` instead." msgstr "" -#: ../../library/bz2.rst:253 +#: ../../library/bz2.rst:291 msgid "Decompress *data*, a :term:`bytes-like object `." msgstr "" -#: ../../library/bz2.rst:255 +#: ../../library/bz2.rst:293 msgid "" "If *data* is the concatenation of multiple compressed streams, decompress " "all of the streams." msgstr "" -#: ../../library/bz2.rst:258 +#: ../../library/bz2.rst:296 msgid "For incremental decompression, use a :class:`BZ2Decompressor` instead." msgstr "" -#: ../../library/bz2.rst:260 +#: ../../library/bz2.rst:298 msgid "Support for multi-stream inputs was added." msgstr "" -#: ../../library/bz2.rst:266 +#: ../../library/bz2.rst:304 msgid "Examples of usage" msgstr "用法範例" -#: ../../library/bz2.rst:268 +#: ../../library/bz2.rst:306 msgid "Below are some examples of typical usage of the :mod:`bz2` module." msgstr "" -#: ../../library/bz2.rst:270 +#: ../../library/bz2.rst:308 msgid "" "Using :func:`compress` and :func:`decompress` to demonstrate round-trip " "compression:" msgstr "" -#: ../../library/bz2.rst:288 +#: ../../library/bz2.rst:326 msgid "Using :class:`BZ2Compressor` for incremental compression:" msgstr "" -#: ../../library/bz2.rst:306 +#: ../../library/bz2.rst:344 msgid "" "The example above uses a very \"nonrandom\" stream of data (a stream of " "``b\"z\"`` chunks). Random data tends to compress poorly, while ordered, " "repetitive data usually yields a high compression ratio." msgstr "" -#: ../../library/bz2.rst:310 +#: ../../library/bz2.rst:348 msgid "Writing and reading a bzip2-compressed file in binary mode:" msgstr "" diff --git a/library/codecs.po b/library/codecs.po index c619a48de8..2ff557ff55 100644 --- a/library/codecs.po +++ b/library/codecs.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-11 17:13+0000\n" +"POT-Creation-Date: 2023-10-21 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:40+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -369,8 +369,8 @@ msgid "Value" msgstr "" #: ../../library/codecs.rst:330 ../../library/codecs.rst:373 -#: ../../library/codecs.rst:393 ../../library/codecs.rst:1327 -#: ../../library/codecs.rst:1395 ../../library/codecs.rst:1450 +#: ../../library/codecs.rst:393 ../../library/codecs.rst:1330 +#: ../../library/codecs.rst:1398 ../../library/codecs.rst:1455 msgid "Meaning" msgstr "" @@ -637,7 +637,7 @@ msgid "" "function interfaces of the stateless encoder and decoder:" msgstr "" -#: ../../library/codecs.rst:525 +#: ../../library/codecs.rst:527 msgid "" "Encodes the object *input* and returns a tuple (output object, length " "consumed). For instance, :term:`text encoding` converts a string object to a " @@ -645,26 +645,26 @@ msgid "" "``iso-8859-1``)." msgstr "" -#: ../../library/codecs.rst:530 ../../library/codecs.rst:552 +#: ../../library/codecs.rst:532 ../../library/codecs.rst:554 msgid "" "The *errors* argument defines the error handling to apply. It defaults to " "``'strict'`` handling." msgstr "" -#: ../../library/codecs.rst:533 +#: ../../library/codecs.rst:535 msgid "" "The method may not store state in the :class:`Codec` instance. Use :class:" "`StreamWriter` for codecs which have to keep state in order to make encoding " "efficient." msgstr "" -#: ../../library/codecs.rst:537 +#: ../../library/codecs.rst:539 msgid "" "The encoder must be able to handle zero length input and return an empty " "object of the output object type in this situation." msgstr "" -#: ../../library/codecs.rst:543 +#: ../../library/codecs.rst:545 msgid "" "Decodes the object *input* and returns a tuple (output object, length " "consumed). For instance, for a :term:`text encoding`, decoding converts a " @@ -672,31 +672,31 @@ msgid "" "object." msgstr "" -#: ../../library/codecs.rst:548 +#: ../../library/codecs.rst:550 msgid "" "For text encodings and bytes-to-bytes codecs, *input* must be a bytes object " "or one which provides the read-only buffer interface -- for example, buffer " "objects and memory mapped files." msgstr "" -#: ../../library/codecs.rst:555 +#: ../../library/codecs.rst:557 msgid "" "The method may not store state in the :class:`Codec` instance. Use :class:" "`StreamReader` for codecs which have to keep state in order to make decoding " "efficient." msgstr "" -#: ../../library/codecs.rst:559 +#: ../../library/codecs.rst:561 msgid "" "The decoder must be able to handle zero length input and return an empty " "object of the output object type in this situation." msgstr "" -#: ../../library/codecs.rst:564 +#: ../../library/codecs.rst:566 msgid "Incremental Encoding and Decoding" msgstr "" -#: ../../library/codecs.rst:566 +#: ../../library/codecs.rst:568 msgid "" "The :class:`IncrementalEncoder` and :class:`IncrementalDecoder` classes " "provide the basic interface for incremental encoding and decoding. Encoding/" @@ -707,7 +707,7 @@ msgid "" "during method calls." msgstr "" -#: ../../library/codecs.rst:574 +#: ../../library/codecs.rst:576 msgid "" "The joined output of calls to the :meth:`~IncrementalEncoder.encode`/:meth:" "`~IncrementalDecoder.decode` method is the same as if all the single inputs " @@ -715,36 +715,36 @@ msgid "" "encoder/decoder." msgstr "" -#: ../../library/codecs.rst:583 +#: ../../library/codecs.rst:585 msgid "IncrementalEncoder Objects" msgstr "IncrementalEncoder 物件" -#: ../../library/codecs.rst:585 +#: ../../library/codecs.rst:587 msgid "" "The :class:`IncrementalEncoder` class is used for encoding an input in " "multiple steps. It defines the following methods which every incremental " "encoder must define in order to be compatible with the Python codec registry." msgstr "" -#: ../../library/codecs.rst:592 +#: ../../library/codecs.rst:594 msgid "Constructor for an :class:`IncrementalEncoder` instance." msgstr "" -#: ../../library/codecs.rst:594 +#: ../../library/codecs.rst:596 msgid "" "All incremental encoders must provide this constructor interface. They are " "free to add additional keyword arguments, but only the ones defined here are " "used by the Python codec registry." msgstr "" -#: ../../library/codecs.rst:598 +#: ../../library/codecs.rst:600 msgid "" "The :class:`IncrementalEncoder` may implement different error handling " "schemes by providing the *errors* keyword argument. See :ref:`error-" "handlers` for possible values." msgstr "" -#: ../../library/codecs.rst:602 +#: ../../library/codecs.rst:604 msgid "" "The *errors* argument will be assigned to an attribute of the same name. " "Assigning to this attribute makes it possible to switch between different " @@ -752,21 +752,21 @@ msgid "" "`IncrementalEncoder` object." msgstr "" -#: ../../library/codecs.rst:610 +#: ../../library/codecs.rst:612 msgid "" "Encodes *object* (taking the current state of the encoder into account) and " "returns the resulting encoded object. If this is the last call to :meth:" "`encode` *final* must be true (the default is false)." msgstr "" -#: ../../library/codecs.rst:617 +#: ../../library/codecs.rst:619 msgid "" "Reset the encoder to the initial state. The output is discarded: call ``." "encode(object, final=True)``, passing an empty byte or text string if " "necessary, to reset the encoder and to get the output." msgstr "" -#: ../../library/codecs.rst:624 +#: ../../library/codecs.rst:626 msgid "" "Return the current state of the encoder which must be an integer. The " "implementation should make sure that ``0`` is the most common state. (States " @@ -775,42 +775,42 @@ msgid "" "into an integer.)" msgstr "" -#: ../../library/codecs.rst:633 +#: ../../library/codecs.rst:635 msgid "" "Set the state of the encoder to *state*. *state* must be an encoder state " "returned by :meth:`getstate`." msgstr "" -#: ../../library/codecs.rst:640 +#: ../../library/codecs.rst:642 msgid "IncrementalDecoder Objects" msgstr "IncrementalDecoder 物件" -#: ../../library/codecs.rst:642 +#: ../../library/codecs.rst:644 msgid "" "The :class:`IncrementalDecoder` class is used for decoding an input in " "multiple steps. It defines the following methods which every incremental " "decoder must define in order to be compatible with the Python codec registry." msgstr "" -#: ../../library/codecs.rst:649 +#: ../../library/codecs.rst:651 msgid "Constructor for an :class:`IncrementalDecoder` instance." msgstr "" -#: ../../library/codecs.rst:651 +#: ../../library/codecs.rst:653 msgid "" "All incremental decoders must provide this constructor interface. They are " "free to add additional keyword arguments, but only the ones defined here are " "used by the Python codec registry." msgstr "" -#: ../../library/codecs.rst:655 +#: ../../library/codecs.rst:657 msgid "" "The :class:`IncrementalDecoder` may implement different error handling " "schemes by providing the *errors* keyword argument. See :ref:`error-" "handlers` for possible values." msgstr "" -#: ../../library/codecs.rst:659 +#: ../../library/codecs.rst:661 msgid "" "The *errors* argument will be assigned to an attribute of the same name. " "Assigning to this attribute makes it possible to switch between different " @@ -818,7 +818,7 @@ msgid "" "`IncrementalDecoder` object." msgstr "" -#: ../../library/codecs.rst:667 +#: ../../library/codecs.rst:669 msgid "" "Decodes *object* (taking the current state of the decoder into account) and " "returns the resulting decoded object. If this is the last call to :meth:" @@ -829,11 +829,11 @@ msgid "" "(which might raise an exception)." msgstr "" -#: ../../library/codecs.rst:678 +#: ../../library/codecs.rst:680 msgid "Reset the decoder to the initial state." msgstr "" -#: ../../library/codecs.rst:683 +#: ../../library/codecs.rst:685 msgid "" "Return the current state of the decoder. This must be a tuple with two " "items, the first must be the buffer containing the still undecoded input. " @@ -848,59 +848,59 @@ msgid "" "bytes of the resulting string into an integer.)" msgstr "" -#: ../../library/codecs.rst:698 +#: ../../library/codecs.rst:700 msgid "" "Set the state of the decoder to *state*. *state* must be a decoder state " "returned by :meth:`getstate`." msgstr "" -#: ../../library/codecs.rst:703 +#: ../../library/codecs.rst:705 msgid "Stream Encoding and Decoding" msgstr "" -#: ../../library/codecs.rst:706 +#: ../../library/codecs.rst:708 msgid "" "The :class:`StreamWriter` and :class:`StreamReader` classes provide generic " "working interfaces which can be used to implement new encoding submodules " -"very easily. See :mod:`encodings.utf_8` for an example of how this is done." +"very easily. See :mod:`!encodings.utf_8` for an example of how this is done." msgstr "" -#: ../../library/codecs.rst:714 +#: ../../library/codecs.rst:716 msgid "StreamWriter Objects" msgstr "StreamWriter 物件" -#: ../../library/codecs.rst:716 +#: ../../library/codecs.rst:718 msgid "" "The :class:`StreamWriter` class is a subclass of :class:`Codec` and defines " "the following methods which every stream writer must define in order to be " "compatible with the Python codec registry." msgstr "" -#: ../../library/codecs.rst:723 +#: ../../library/codecs.rst:725 msgid "Constructor for a :class:`StreamWriter` instance." msgstr "" -#: ../../library/codecs.rst:725 +#: ../../library/codecs.rst:727 msgid "" "All stream writers must provide this constructor interface. They are free to " "add additional keyword arguments, but only the ones defined here are used by " "the Python codec registry." msgstr "" -#: ../../library/codecs.rst:729 +#: ../../library/codecs.rst:731 msgid "" "The *stream* argument must be a file-like object open for writing text or " "binary data, as appropriate for the specific codec." msgstr "" -#: ../../library/codecs.rst:732 +#: ../../library/codecs.rst:734 msgid "" "The :class:`StreamWriter` may implement different error handling schemes by " "providing the *errors* keyword argument. See :ref:`error-handlers` for the " "standard error handlers the underlying stream codec may support." msgstr "" -#: ../../library/codecs.rst:736 +#: ../../library/codecs.rst:738 msgid "" "The *errors* argument will be assigned to an attribute of the same name. " "Assigning to this attribute makes it possible to switch between different " @@ -908,70 +908,70 @@ msgid "" "object." msgstr "" -#: ../../library/codecs.rst:742 +#: ../../library/codecs.rst:744 msgid "Writes the object's contents encoded to the stream." msgstr "" -#: ../../library/codecs.rst:747 +#: ../../library/codecs.rst:749 msgid "" "Writes the concatenated iterable of strings to the stream (possibly by " "reusing the :meth:`write` method). Infinite or very large iterables are not " "supported. The standard bytes-to-bytes codecs do not support this method." msgstr "" -#: ../../library/codecs.rst:755 ../../library/codecs.rst:850 +#: ../../library/codecs.rst:757 ../../library/codecs.rst:852 msgid "Resets the codec buffers used for keeping internal state." msgstr "" -#: ../../library/codecs.rst:757 +#: ../../library/codecs.rst:759 msgid "" "Calling this method should ensure that the data on the output is put into a " "clean state that allows appending of new fresh data without having to rescan " "the whole stream to recover state." msgstr "" -#: ../../library/codecs.rst:762 +#: ../../library/codecs.rst:764 msgid "" "In addition to the above methods, the :class:`StreamWriter` must also " "inherit all other methods and attributes from the underlying stream." msgstr "" -#: ../../library/codecs.rst:769 +#: ../../library/codecs.rst:771 msgid "StreamReader Objects" msgstr "StreamReader 物件" -#: ../../library/codecs.rst:771 +#: ../../library/codecs.rst:773 msgid "" "The :class:`StreamReader` class is a subclass of :class:`Codec` and defines " "the following methods which every stream reader must define in order to be " "compatible with the Python codec registry." msgstr "" -#: ../../library/codecs.rst:778 +#: ../../library/codecs.rst:780 msgid "Constructor for a :class:`StreamReader` instance." msgstr "" -#: ../../library/codecs.rst:780 +#: ../../library/codecs.rst:782 msgid "" "All stream readers must provide this constructor interface. They are free to " "add additional keyword arguments, but only the ones defined here are used by " "the Python codec registry." msgstr "" -#: ../../library/codecs.rst:784 +#: ../../library/codecs.rst:786 msgid "" "The *stream* argument must be a file-like object open for reading text or " "binary data, as appropriate for the specific codec." msgstr "" -#: ../../library/codecs.rst:787 +#: ../../library/codecs.rst:789 msgid "" "The :class:`StreamReader` may implement different error handling schemes by " "providing the *errors* keyword argument. See :ref:`error-handlers` for the " "standard error handlers the underlying stream codec may support." msgstr "" -#: ../../library/codecs.rst:791 +#: ../../library/codecs.rst:793 msgid "" "The *errors* argument will be assigned to an attribute of the same name. " "Assigning to this attribute makes it possible to switch between different " @@ -979,24 +979,24 @@ msgid "" "object." msgstr "" -#: ../../library/codecs.rst:795 +#: ../../library/codecs.rst:797 msgid "" "The set of allowed values for the *errors* argument can be extended with :" "func:`register_error`." msgstr "" -#: ../../library/codecs.rst:801 +#: ../../library/codecs.rst:803 msgid "Decodes data from the stream and returns the resulting object." msgstr "" -#: ../../library/codecs.rst:803 +#: ../../library/codecs.rst:805 msgid "" "The *chars* argument indicates the number of decoded code points or bytes to " "return. The :func:`read` method will never return more data than requested, " "but it might return less, if there is not enough available." msgstr "" -#: ../../library/codecs.rst:808 +#: ../../library/codecs.rst:810 msgid "" "The *size* argument indicates the approximate maximum number of encoded " "bytes or code points to read for decoding. The decoder can modify this " @@ -1005,13 +1005,13 @@ msgid "" "huge files in one step." msgstr "" -#: ../../library/codecs.rst:815 +#: ../../library/codecs.rst:817 msgid "" "The *firstline* flag indicates that it would be sufficient to only return " "the first line, if there are decoding errors on later lines." msgstr "" -#: ../../library/codecs.rst:819 +#: ../../library/codecs.rst:821 msgid "" "The method should use a greedy read strategy meaning that it should read as " "much data as is allowed within the definition of the encoding and the given " @@ -1019,68 +1019,68 @@ msgid "" "the stream, these should be read too." msgstr "" -#: ../../library/codecs.rst:827 +#: ../../library/codecs.rst:829 msgid "Read one line from the input stream and return the decoded data." msgstr "" -#: ../../library/codecs.rst:829 +#: ../../library/codecs.rst:831 msgid "" "*size*, if given, is passed as size argument to the stream's :meth:`read` " "method." msgstr "" -#: ../../library/codecs.rst:832 +#: ../../library/codecs.rst:834 msgid "" "If *keepends* is false line-endings will be stripped from the lines returned." msgstr "" -#: ../../library/codecs.rst:838 +#: ../../library/codecs.rst:840 msgid "" "Read all lines available on the input stream and return them as a list of " "lines." msgstr "" -#: ../../library/codecs.rst:841 +#: ../../library/codecs.rst:843 msgid "" "Line-endings are implemented using the codec's :meth:`decode` method and are " "included in the list entries if *keepends* is true." msgstr "" -#: ../../library/codecs.rst:844 +#: ../../library/codecs.rst:846 msgid "" "*sizehint*, if given, is passed as the *size* argument to the stream's :meth:" "`read` method." msgstr "" -#: ../../library/codecs.rst:852 +#: ../../library/codecs.rst:854 msgid "" "Note that no stream repositioning should take place. This method is " "primarily intended to be able to recover from decoding errors." msgstr "" -#: ../../library/codecs.rst:856 +#: ../../library/codecs.rst:858 msgid "" "In addition to the above methods, the :class:`StreamReader` must also " "inherit all other methods and attributes from the underlying stream." msgstr "" -#: ../../library/codecs.rst:862 +#: ../../library/codecs.rst:864 msgid "StreamReaderWriter Objects" msgstr "StreamReaderWriter 物件" -#: ../../library/codecs.rst:864 +#: ../../library/codecs.rst:866 msgid "" "The :class:`StreamReaderWriter` is a convenience class that allows wrapping " "streams which work in both read and write modes." msgstr "" -#: ../../library/codecs.rst:867 ../../library/codecs.rst:891 +#: ../../library/codecs.rst:869 ../../library/codecs.rst:893 msgid "" "The design is such that one can use the factory functions returned by the :" "func:`lookup` function to construct the instance." msgstr "" -#: ../../library/codecs.rst:873 +#: ../../library/codecs.rst:875 msgid "" "Creates a :class:`StreamReaderWriter` instance. *stream* must be a file-like " "object. *Reader* and *Writer* must be factory functions or classes providing " @@ -1089,42 +1089,42 @@ msgid "" "writers." msgstr "" -#: ../../library/codecs.rst:878 +#: ../../library/codecs.rst:880 msgid "" ":class:`StreamReaderWriter` instances define the combined interfaces of :" "class:`StreamReader` and :class:`StreamWriter` classes. They inherit all " "other methods and attributes from the underlying stream." msgstr "" -#: ../../library/codecs.rst:886 +#: ../../library/codecs.rst:888 msgid "StreamRecoder Objects" msgstr "StreamRecoder 物件" -#: ../../library/codecs.rst:888 +#: ../../library/codecs.rst:890 msgid "" "The :class:`StreamRecoder` translates data from one encoding to another, " "which is sometimes useful when dealing with different encoding environments." msgstr "" -#: ../../library/codecs.rst:897 +#: ../../library/codecs.rst:899 msgid "" "Creates a :class:`StreamRecoder` instance which implements a two-way " -"conversion: *encode* and *decode* work on the frontend — the data visible to " -"code calling :meth:`read` and :meth:`write`, while *Reader* and *Writer* " -"work on the backend — the data in *stream*." +"conversion: *encode* and *decode* work on the frontend — the data visible to " +"code calling :meth:`~StreamReader.read` and :meth:`~StreamWriter.write`, " +"while *Reader* and *Writer* work on the backend — the data in *stream*." msgstr "" -#: ../../library/codecs.rst:902 +#: ../../library/codecs.rst:905 msgid "" "You can use these objects to do transparent transcodings, e.g., from Latin-1 " "to UTF-8 and back." msgstr "" -#: ../../library/codecs.rst:905 +#: ../../library/codecs.rst:908 msgid "The *stream* argument must be a file-like object." msgstr "" -#: ../../library/codecs.rst:907 +#: ../../library/codecs.rst:910 msgid "" "The *encode* and *decode* arguments must adhere to the :class:`Codec` " "interface. *Reader* and *Writer* must be factory functions or classes " @@ -1132,24 +1132,24 @@ msgid "" "interface respectively." msgstr "" -#: ../../library/codecs.rst:912 +#: ../../library/codecs.rst:915 msgid "" "Error handling is done in the same way as defined for the stream readers and " "writers." msgstr "" -#: ../../library/codecs.rst:916 +#: ../../library/codecs.rst:919 msgid "" ":class:`StreamRecoder` instances define the combined interfaces of :class:" "`StreamReader` and :class:`StreamWriter` classes. They inherit all other " "methods and attributes from the underlying stream." msgstr "" -#: ../../library/codecs.rst:924 +#: ../../library/codecs.rst:927 msgid "Encodings and Unicode" msgstr "" -#: ../../library/codecs.rst:926 +#: ../../library/codecs.rst:929 msgid "" "Strings are stored internally as sequences of code points in range " "``U+0000``--``U+10FFFF``. (See :pep:`393` for more details about the " @@ -1161,7 +1161,7 @@ msgid "" "which are collectivity referred to as :term:`text encodings `." msgstr "" -#: ../../library/codecs.rst:936 +#: ../../library/codecs.rst:939 msgid "" "The simplest text encoding (called ``'latin-1'`` or ``'iso-8859-1'``) maps " "the code points 0--255 to the bytes ``0x0``--``0xff``, which means that a " @@ -1172,7 +1172,7 @@ msgid "" "position 3: ordinal not in range(256)``." msgstr "" -#: ../../library/codecs.rst:944 +#: ../../library/codecs.rst:947 msgid "" "There's another group of encodings (the so called charmap encodings) that " "choose a different subset of all Unicode code points and how these code " @@ -1182,7 +1182,7 @@ msgid "" "that shows you which character is mapped to which byte value." msgstr "" -#: ../../library/codecs.rst:951 +#: ../../library/codecs.rst:954 msgid "" "All of these encodings can only encode 256 of the 1114112 code points " "defined in Unicode. A simple and straightforward way that can store each " @@ -1212,7 +1212,7 @@ msgid "" "normal character that will be decoded like any other." msgstr "" -#: ../../library/codecs.rst:977 +#: ../../library/codecs.rst:980 msgid "" "There's another encoding that is able to encode the full range of Unicode " "characters: UTF-8. UTF-8 is an 8-bit encoding, which means there are no " @@ -1223,59 +1223,59 @@ msgid "" "which when concatenated give the Unicode character):" msgstr "" -#: ../../library/codecs.rst:986 +#: ../../library/codecs.rst:989 msgid "Range" msgstr "" -#: ../../library/codecs.rst:986 +#: ../../library/codecs.rst:989 msgid "Encoding" msgstr "" -#: ../../library/codecs.rst:988 +#: ../../library/codecs.rst:991 msgid "``U-00000000`` ... ``U-0000007F``" msgstr "``U-00000000`` ... ``U-0000007F``" -#: ../../library/codecs.rst:988 +#: ../../library/codecs.rst:991 msgid "0xxxxxxx" msgstr "0xxxxxxx" -#: ../../library/codecs.rst:990 +#: ../../library/codecs.rst:993 msgid "``U-00000080`` ... ``U-000007FF``" msgstr "``U-00000080`` ... ``U-000007FF``" -#: ../../library/codecs.rst:990 +#: ../../library/codecs.rst:993 msgid "110xxxxx 10xxxxxx" msgstr "110xxxxx 10xxxxxx" -#: ../../library/codecs.rst:992 +#: ../../library/codecs.rst:995 msgid "``U-00000800`` ... ``U-0000FFFF``" msgstr "``U-00000800`` ... ``U-0000FFFF``" -#: ../../library/codecs.rst:992 +#: ../../library/codecs.rst:995 msgid "1110xxxx 10xxxxxx 10xxxxxx" msgstr "1110xxxx 10xxxxxx 10xxxxxx" -#: ../../library/codecs.rst:994 +#: ../../library/codecs.rst:997 msgid "``U-00010000`` ... ``U-0010FFFF``" msgstr "``U-00010000`` ... ``U-0010FFFF``" -#: ../../library/codecs.rst:994 +#: ../../library/codecs.rst:997 msgid "11110xxx 10xxxxxx 10xxxxxx 10xxxxxx" msgstr "11110xxx 10xxxxxx 10xxxxxx 10xxxxxx" -#: ../../library/codecs.rst:997 +#: ../../library/codecs.rst:1000 msgid "" "The least significant bit of the Unicode character is the rightmost x bit." msgstr "" -#: ../../library/codecs.rst:999 +#: ../../library/codecs.rst:1002 msgid "" "As UTF-8 is an 8-bit encoding no BOM is required and any ``U+FEFF`` " "character in the decoded string (even if it's the first character) is " "treated as a ``ZERO WIDTH NO-BREAK SPACE``." msgstr "" -#: ../../library/codecs.rst:1003 +#: ../../library/codecs.rst:1006 msgid "" "Without external information it's impossible to reliably determine which " "encoding was used for encoding a string. Each charmap encoding can decode " @@ -1301,7 +1301,7 @@ msgstr "" msgid "INVERTED QUESTION MARK" msgstr "" -#: ../../library/codecs.rst:1019 +#: ../../library/codecs.rst:1022 msgid "" "in iso-8859-1), this increases the probability that a ``utf-8-sig`` encoding " "can be correctly guessed from the byte sequence. So here the BOM is not used " @@ -1313,11 +1313,11 @@ msgid "" "the use of the BOM is discouraged and should generally be avoided." msgstr "" -#: ../../library/codecs.rst:1032 +#: ../../library/codecs.rst:1035 msgid "Standard Encodings" msgstr "" -#: ../../library/codecs.rst:1034 +#: ../../library/codecs.rst:1037 msgid "" "Python comes with a number of codecs built-in, either implemented as C " "functions or with dictionaries as mapping tables. The following table lists " @@ -1329,7 +1329,7 @@ msgid "" "alias for the ``'utf_8'`` codec." msgstr "" -#: ../../library/codecs.rst:1044 +#: ../../library/codecs.rst:1047 msgid "" "Some common encodings can bypass the codecs lookup machinery to improve " "performance. These optimization opportunities are only recognized by CPython " @@ -1339,11 +1339,11 @@ msgid "" "Using alternative aliases for these encodings may result in slower execution." msgstr "" -#: ../../library/codecs.rst:1052 +#: ../../library/codecs.rst:1055 msgid "Optimization opportunity recognized for us-ascii." msgstr "" -#: ../../library/codecs.rst:1055 +#: ../../library/codecs.rst:1058 msgid "" "Many of the character sets support the same languages. They vary in " "individual characters (e.g. whether the EURO SIGN is supported or not), and " @@ -1351,504 +1351,504 @@ msgid "" "languages in particular, the following variants typically exist:" msgstr "" -#: ../../library/codecs.rst:1060 +#: ../../library/codecs.rst:1063 msgid "an ISO 8859 codeset" msgstr "" -#: ../../library/codecs.rst:1062 +#: ../../library/codecs.rst:1065 msgid "" "a Microsoft Windows code page, which is typically derived from an 8859 " "codeset, but replaces control characters with additional graphic characters" msgstr "" -#: ../../library/codecs.rst:1065 +#: ../../library/codecs.rst:1068 msgid "an IBM EBCDIC code page" msgstr "" -#: ../../library/codecs.rst:1067 +#: ../../library/codecs.rst:1070 msgid "an IBM PC code page, which is ASCII compatible" msgstr "" -#: ../../library/codecs.rst:1072 ../../library/codecs.rst:1327 -#: ../../library/codecs.rst:1395 ../../library/codecs.rst:1450 +#: ../../library/codecs.rst:1075 ../../library/codecs.rst:1330 +#: ../../library/codecs.rst:1398 ../../library/codecs.rst:1455 msgid "Codec" msgstr "" -#: ../../library/codecs.rst:1072 ../../library/codecs.rst:1327 -#: ../../library/codecs.rst:1395 ../../library/codecs.rst:1450 +#: ../../library/codecs.rst:1075 ../../library/codecs.rst:1330 +#: ../../library/codecs.rst:1398 ../../library/codecs.rst:1455 msgid "Aliases" msgstr "" -#: ../../library/codecs.rst:1072 +#: ../../library/codecs.rst:1075 msgid "Languages" msgstr "語言" -#: ../../library/codecs.rst:1074 +#: ../../library/codecs.rst:1077 msgid "ascii" msgstr "ascii" -#: ../../library/codecs.rst:1074 +#: ../../library/codecs.rst:1077 msgid "646, us-ascii" msgstr "646, us-ascii" -#: ../../library/codecs.rst:1074 ../../library/codecs.rst:1080 -#: ../../library/codecs.rst:1088 +#: ../../library/codecs.rst:1077 ../../library/codecs.rst:1083 +#: ../../library/codecs.rst:1091 msgid "English" msgstr "英文" -#: ../../library/codecs.rst:1076 +#: ../../library/codecs.rst:1079 msgid "big5" msgstr "big5" -#: ../../library/codecs.rst:1076 +#: ../../library/codecs.rst:1079 msgid "big5-tw, csbig5" msgstr "big5-tw, csbig5" -#: ../../library/codecs.rst:1076 ../../library/codecs.rst:1078 -#: ../../library/codecs.rst:1136 +#: ../../library/codecs.rst:1079 ../../library/codecs.rst:1081 +#: ../../library/codecs.rst:1139 msgid "Traditional Chinese" msgstr "繁體中文" -#: ../../library/codecs.rst:1078 +#: ../../library/codecs.rst:1081 msgid "big5hkscs" msgstr "big5hkscs" -#: ../../library/codecs.rst:1078 +#: ../../library/codecs.rst:1081 msgid "big5-hkscs, hkscs" msgstr "big5-hkscs, hkscs" -#: ../../library/codecs.rst:1080 +#: ../../library/codecs.rst:1083 msgid "cp037" msgstr "cp037" -#: ../../library/codecs.rst:1080 +#: ../../library/codecs.rst:1083 msgid "IBM037, IBM039" msgstr "IBM037, IBM039" -#: ../../library/codecs.rst:1082 +#: ../../library/codecs.rst:1085 msgid "cp273" msgstr "cp273" -#: ../../library/codecs.rst:1082 +#: ../../library/codecs.rst:1085 msgid "273, IBM273, csIBM273" msgstr "273, IBM273, csIBM273" -#: ../../library/codecs.rst:1082 +#: ../../library/codecs.rst:1085 msgid "German" msgstr "德文" -#: ../../library/codecs.rst:1086 +#: ../../library/codecs.rst:1089 msgid "cp424" msgstr "cp424" -#: ../../library/codecs.rst:1086 +#: ../../library/codecs.rst:1089 msgid "EBCDIC-CP-HE, IBM424" msgstr "EBCDIC-CP-HE, IBM424" -#: ../../library/codecs.rst:1086 ../../library/codecs.rst:1106 -#: ../../library/codecs.rst:1116 ../../library/codecs.rst:1159 -#: ../../library/codecs.rst:1222 +#: ../../library/codecs.rst:1089 ../../library/codecs.rst:1109 +#: ../../library/codecs.rst:1119 ../../library/codecs.rst:1162 +#: ../../library/codecs.rst:1225 msgid "Hebrew" msgstr "希伯來文" -#: ../../library/codecs.rst:1088 +#: ../../library/codecs.rst:1091 msgid "cp437" msgstr "cp437" -#: ../../library/codecs.rst:1088 +#: ../../library/codecs.rst:1091 msgid "437, IBM437" msgstr "437, IBM437" -#: ../../library/codecs.rst:1090 +#: ../../library/codecs.rst:1093 msgid "cp500" msgstr "cp500" -#: ../../library/codecs.rst:1090 +#: ../../library/codecs.rst:1093 msgid "EBCDIC-CP-BE, EBCDIC-CP-CH, IBM500" msgstr "EBCDIC-CP-BE, EBCDIC-CP-CH, IBM500" -#: ../../library/codecs.rst:1090 ../../library/codecs.rst:1099 -#: ../../library/codecs.rst:1110 ../../library/codecs.rst:1146 -#: ../../library/codecs.rst:1153 ../../library/codecs.rst:1206 -#: ../../library/codecs.rst:1234 ../../library/codecs.rst:1262 +#: ../../library/codecs.rst:1093 ../../library/codecs.rst:1102 +#: ../../library/codecs.rst:1113 ../../library/codecs.rst:1149 +#: ../../library/codecs.rst:1156 ../../library/codecs.rst:1209 +#: ../../library/codecs.rst:1237 ../../library/codecs.rst:1265 msgid "Western Europe" msgstr "" -#: ../../library/codecs.rst:1093 +#: ../../library/codecs.rst:1096 msgid "cp720" msgstr "cp720" -#: ../../library/codecs.rst:1093 ../../library/codecs.rst:1120 -#: ../../library/codecs.rst:1161 ../../library/codecs.rst:1218 +#: ../../library/codecs.rst:1096 ../../library/codecs.rst:1123 +#: ../../library/codecs.rst:1164 ../../library/codecs.rst:1221 msgid "Arabic" msgstr "阿拉伯文" -#: ../../library/codecs.rst:1095 +#: ../../library/codecs.rst:1098 msgid "cp737" msgstr "cp737" -#: ../../library/codecs.rst:1095 ../../library/codecs.rst:1126 -#: ../../library/codecs.rst:1130 ../../library/codecs.rst:1155 -#: ../../library/codecs.rst:1220 ../../library/codecs.rst:1255 +#: ../../library/codecs.rst:1098 ../../library/codecs.rst:1129 +#: ../../library/codecs.rst:1133 ../../library/codecs.rst:1158 +#: ../../library/codecs.rst:1223 ../../library/codecs.rst:1258 msgid "Greek" msgstr "希臘文" -#: ../../library/codecs.rst:1097 +#: ../../library/codecs.rst:1100 msgid "cp775" msgstr "cp775" -#: ../../library/codecs.rst:1097 +#: ../../library/codecs.rst:1100 msgid "IBM775" msgstr "IBM775" -#: ../../library/codecs.rst:1097 ../../library/codecs.rst:1163 -#: ../../library/codecs.rst:1213 ../../library/codecs.rst:1230 +#: ../../library/codecs.rst:1100 ../../library/codecs.rst:1166 +#: ../../library/codecs.rst:1216 ../../library/codecs.rst:1233 msgid "Baltic languages" msgstr "" -#: ../../library/codecs.rst:1099 +#: ../../library/codecs.rst:1102 msgid "cp850" msgstr "cp850" -#: ../../library/codecs.rst:1099 +#: ../../library/codecs.rst:1102 msgid "850, IBM850" msgstr "850, IBM850" -#: ../../library/codecs.rst:1101 +#: ../../library/codecs.rst:1104 msgid "cp852" msgstr "cp852" -#: ../../library/codecs.rst:1101 +#: ../../library/codecs.rst:1104 msgid "852, IBM852" msgstr "852, IBM852" -#: ../../library/codecs.rst:1101 ../../library/codecs.rst:1148 -#: ../../library/codecs.rst:1209 ../../library/codecs.rst:1259 +#: ../../library/codecs.rst:1104 ../../library/codecs.rst:1151 +#: ../../library/codecs.rst:1212 ../../library/codecs.rst:1262 msgid "Central and Eastern Europe" msgstr "" -#: ../../library/codecs.rst:1103 +#: ../../library/codecs.rst:1106 msgid "cp855" msgstr "cp855" -#: ../../library/codecs.rst:1103 +#: ../../library/codecs.rst:1106 msgid "855, IBM855" msgstr "855, IBM855" -#: ../../library/codecs.rst:1103 ../../library/codecs.rst:1150 -#: ../../library/codecs.rst:1215 ../../library/codecs.rst:1252 +#: ../../library/codecs.rst:1106 ../../library/codecs.rst:1153 +#: ../../library/codecs.rst:1218 ../../library/codecs.rst:1255 msgid "Bulgarian, Byelorussian, Macedonian, Russian, Serbian" msgstr "" -#: ../../library/codecs.rst:1106 +#: ../../library/codecs.rst:1109 msgid "cp856" msgstr "cp856" -#: ../../library/codecs.rst:1108 +#: ../../library/codecs.rst:1111 msgid "cp857" msgstr "cp857" -#: ../../library/codecs.rst:1108 +#: ../../library/codecs.rst:1111 msgid "857, IBM857" msgstr "857, IBM857" -#: ../../library/codecs.rst:1108 ../../library/codecs.rst:1140 -#: ../../library/codecs.rst:1157 ../../library/codecs.rst:1224 -#: ../../library/codecs.rst:1264 +#: ../../library/codecs.rst:1111 ../../library/codecs.rst:1143 +#: ../../library/codecs.rst:1160 ../../library/codecs.rst:1227 +#: ../../library/codecs.rst:1267 msgid "Turkish" msgstr "土耳其文" -#: ../../library/codecs.rst:1110 +#: ../../library/codecs.rst:1113 msgid "cp858" msgstr "cp858" -#: ../../library/codecs.rst:1110 +#: ../../library/codecs.rst:1113 msgid "858, IBM858" msgstr "858, IBM858" -#: ../../library/codecs.rst:1112 +#: ../../library/codecs.rst:1115 msgid "cp860" msgstr "cp860" -#: ../../library/codecs.rst:1112 +#: ../../library/codecs.rst:1115 msgid "860, IBM860" msgstr "860, IBM860" -#: ../../library/codecs.rst:1112 +#: ../../library/codecs.rst:1115 msgid "Portuguese" msgstr "" -#: ../../library/codecs.rst:1114 +#: ../../library/codecs.rst:1117 msgid "cp861" msgstr "cp861" -#: ../../library/codecs.rst:1114 +#: ../../library/codecs.rst:1117 msgid "861, CP-IS, IBM861" msgstr "861, CP-IS, IBM861" -#: ../../library/codecs.rst:1114 ../../library/codecs.rst:1257 +#: ../../library/codecs.rst:1117 ../../library/codecs.rst:1260 msgid "Icelandic" msgstr "" -#: ../../library/codecs.rst:1116 +#: ../../library/codecs.rst:1119 msgid "cp862" msgstr "cp862" -#: ../../library/codecs.rst:1116 +#: ../../library/codecs.rst:1119 msgid "862, IBM862" msgstr "862, IBM862" -#: ../../library/codecs.rst:1118 +#: ../../library/codecs.rst:1121 msgid "cp863" msgstr "cp863" -#: ../../library/codecs.rst:1118 +#: ../../library/codecs.rst:1121 msgid "863, IBM863" msgstr "863, IBM863" -#: ../../library/codecs.rst:1118 +#: ../../library/codecs.rst:1121 msgid "Canadian" msgstr "" -#: ../../library/codecs.rst:1120 +#: ../../library/codecs.rst:1123 msgid "cp864" msgstr "cp864" -#: ../../library/codecs.rst:1120 +#: ../../library/codecs.rst:1123 msgid "IBM864" msgstr "IBM864" -#: ../../library/codecs.rst:1122 +#: ../../library/codecs.rst:1125 msgid "cp865" msgstr "cp865" -#: ../../library/codecs.rst:1122 +#: ../../library/codecs.rst:1125 msgid "865, IBM865" msgstr "865, IBM865" -#: ../../library/codecs.rst:1122 +#: ../../library/codecs.rst:1125 msgid "Danish, Norwegian" msgstr "" -#: ../../library/codecs.rst:1124 +#: ../../library/codecs.rst:1127 msgid "cp866" msgstr "cp866" -#: ../../library/codecs.rst:1124 +#: ../../library/codecs.rst:1127 msgid "866, IBM866" msgstr "866, IBM866" -#: ../../library/codecs.rst:1124 ../../library/codecs.rst:1240 +#: ../../library/codecs.rst:1127 ../../library/codecs.rst:1243 msgid "Russian" msgstr "俄羅斯文" -#: ../../library/codecs.rst:1126 +#: ../../library/codecs.rst:1129 msgid "cp869" msgstr "cp869" -#: ../../library/codecs.rst:1126 +#: ../../library/codecs.rst:1129 msgid "869, CP-GR, IBM869" msgstr "869, CP-GR, IBM869" -#: ../../library/codecs.rst:1128 +#: ../../library/codecs.rst:1131 msgid "cp874" msgstr "cp874" -#: ../../library/codecs.rst:1128 +#: ../../library/codecs.rst:1131 msgid "Thai" msgstr "泰文" -#: ../../library/codecs.rst:1130 +#: ../../library/codecs.rst:1133 msgid "cp875" msgstr "cp875" -#: ../../library/codecs.rst:1132 +#: ../../library/codecs.rst:1135 msgid "cp932" msgstr "cp932" -#: ../../library/codecs.rst:1132 +#: ../../library/codecs.rst:1135 msgid "932, ms932, mskanji, ms-kanji" msgstr "932, ms932, mskanji, ms-kanji" -#: ../../library/codecs.rst:1132 ../../library/codecs.rst:1167 -#: ../../library/codecs.rst:1169 ../../library/codecs.rst:1171 -#: ../../library/codecs.rst:1188 ../../library/codecs.rst:1191 -#: ../../library/codecs.rst:1196 ../../library/codecs.rst:1199 -#: ../../library/codecs.rst:1201 ../../library/codecs.rst:1269 -#: ../../library/codecs.rst:1272 ../../library/codecs.rst:1275 +#: ../../library/codecs.rst:1135 ../../library/codecs.rst:1170 +#: ../../library/codecs.rst:1172 ../../library/codecs.rst:1174 +#: ../../library/codecs.rst:1191 ../../library/codecs.rst:1194 +#: ../../library/codecs.rst:1199 ../../library/codecs.rst:1202 +#: ../../library/codecs.rst:1204 ../../library/codecs.rst:1272 +#: ../../library/codecs.rst:1275 ../../library/codecs.rst:1278 msgid "Japanese" msgstr "日文" -#: ../../library/codecs.rst:1134 +#: ../../library/codecs.rst:1137 msgid "cp949" msgstr "cp949" -#: ../../library/codecs.rst:1134 +#: ../../library/codecs.rst:1137 msgid "949, ms949, uhc" msgstr "949, ms949, uhc" -#: ../../library/codecs.rst:1134 ../../library/codecs.rst:1173 -#: ../../library/codecs.rst:1203 ../../library/codecs.rst:1238 +#: ../../library/codecs.rst:1137 ../../library/codecs.rst:1176 +#: ../../library/codecs.rst:1206 ../../library/codecs.rst:1241 msgid "Korean" msgstr "韓文" -#: ../../library/codecs.rst:1136 +#: ../../library/codecs.rst:1139 msgid "cp950" msgstr "cp950" -#: ../../library/codecs.rst:1136 +#: ../../library/codecs.rst:1139 msgid "950, ms950" msgstr "950, ms950" -#: ../../library/codecs.rst:1138 +#: ../../library/codecs.rst:1141 msgid "cp1006" msgstr "cp1006" -#: ../../library/codecs.rst:1138 +#: ../../library/codecs.rst:1141 msgid "Urdu" msgstr "" -#: ../../library/codecs.rst:1140 +#: ../../library/codecs.rst:1143 msgid "cp1026" msgstr "cp1026" -#: ../../library/codecs.rst:1140 +#: ../../library/codecs.rst:1143 msgid "ibm1026" msgstr "ibm1026" -#: ../../library/codecs.rst:1142 +#: ../../library/codecs.rst:1145 msgid "cp1125" msgstr "cp1125" -#: ../../library/codecs.rst:1142 +#: ../../library/codecs.rst:1145 msgid "1125, ibm1125, cp866u, ruscii" msgstr "1125, ibm1125, cp866u, ruscii" -#: ../../library/codecs.rst:1142 ../../library/codecs.rst:1246 +#: ../../library/codecs.rst:1145 ../../library/codecs.rst:1249 msgid "Ukrainian" msgstr "烏克蘭文" -#: ../../library/codecs.rst:1146 +#: ../../library/codecs.rst:1149 msgid "cp1140" msgstr "cp1140" -#: ../../library/codecs.rst:1146 +#: ../../library/codecs.rst:1149 msgid "ibm1140" msgstr "ibm1140" -#: ../../library/codecs.rst:1148 +#: ../../library/codecs.rst:1151 msgid "cp1250" msgstr "cp1250" -#: ../../library/codecs.rst:1148 +#: ../../library/codecs.rst:1151 msgid "windows-1250" msgstr "windows-1250" -#: ../../library/codecs.rst:1150 +#: ../../library/codecs.rst:1153 msgid "cp1251" msgstr "cp1251" -#: ../../library/codecs.rst:1150 +#: ../../library/codecs.rst:1153 msgid "windows-1251" msgstr "windows-1251" -#: ../../library/codecs.rst:1153 +#: ../../library/codecs.rst:1156 msgid "cp1252" msgstr "cp1252" -#: ../../library/codecs.rst:1153 +#: ../../library/codecs.rst:1156 msgid "windows-1252" msgstr "windows-1252" -#: ../../library/codecs.rst:1155 +#: ../../library/codecs.rst:1158 msgid "cp1253" msgstr "cp1253" -#: ../../library/codecs.rst:1155 +#: ../../library/codecs.rst:1158 msgid "windows-1253" msgstr "windows-1253" -#: ../../library/codecs.rst:1157 +#: ../../library/codecs.rst:1160 msgid "cp1254" msgstr "cp1254" -#: ../../library/codecs.rst:1157 +#: ../../library/codecs.rst:1160 msgid "windows-1254" msgstr "windows-1254" -#: ../../library/codecs.rst:1159 +#: ../../library/codecs.rst:1162 msgid "cp1255" msgstr "cp1255" -#: ../../library/codecs.rst:1159 +#: ../../library/codecs.rst:1162 msgid "windows-1255" msgstr "windows-1255" -#: ../../library/codecs.rst:1161 +#: ../../library/codecs.rst:1164 msgid "cp1256" msgstr "cp1256" -#: ../../library/codecs.rst:1161 +#: ../../library/codecs.rst:1164 msgid "windows-1256" msgstr "windows-1256" -#: ../../library/codecs.rst:1163 +#: ../../library/codecs.rst:1166 msgid "cp1257" msgstr "cp1257" -#: ../../library/codecs.rst:1163 +#: ../../library/codecs.rst:1166 msgid "windows-1257" msgstr "windows-1257" -#: ../../library/codecs.rst:1165 +#: ../../library/codecs.rst:1168 msgid "cp1258" msgstr "cp1258" -#: ../../library/codecs.rst:1165 +#: ../../library/codecs.rst:1168 msgid "windows-1258" msgstr "windows-1258" -#: ../../library/codecs.rst:1165 +#: ../../library/codecs.rst:1168 msgid "Vietnamese" msgstr "越南文" -#: ../../library/codecs.rst:1167 +#: ../../library/codecs.rst:1170 msgid "euc_jp" msgstr "euc_jp" -#: ../../library/codecs.rst:1167 +#: ../../library/codecs.rst:1170 msgid "eucjp, ujis, u-jis" msgstr "eucjp, ujis, u-jis" -#: ../../library/codecs.rst:1169 +#: ../../library/codecs.rst:1172 msgid "euc_jis_2004" msgstr "euc_jis_2004" -#: ../../library/codecs.rst:1169 +#: ../../library/codecs.rst:1172 msgid "jisx0213, eucjis2004" msgstr "jisx0213, eucjis2004" -#: ../../library/codecs.rst:1171 +#: ../../library/codecs.rst:1174 msgid "euc_jisx0213" msgstr "euc_jisx0213" -#: ../../library/codecs.rst:1171 +#: ../../library/codecs.rst:1174 msgid "eucjisx0213" msgstr "eucjisx0213" -#: ../../library/codecs.rst:1173 +#: ../../library/codecs.rst:1176 msgid "euc_kr" msgstr "euc_kr" -#: ../../library/codecs.rst:1173 +#: ../../library/codecs.rst:1176 msgid "euckr, korean, ksc5601, ks_c-5601, ks_c-5601-1987, ksx1001, ks_x-1001" msgstr "euckr, korean, ksc5601, ks_c-5601, ks_c-5601-1987, ksx1001, ks_x-1001" -#: ../../library/codecs.rst:1177 +#: ../../library/codecs.rst:1180 msgid "gb2312" msgstr "gb2312" -#: ../../library/codecs.rst:1177 +#: ../../library/codecs.rst:1180 msgid "" "chinese, csiso58gb231280, euc-cn, euccn, eucgb2312-cn, gb2312-1980, " "gb2312-80, iso-ir-58" @@ -1856,446 +1856,446 @@ msgstr "" "chinese, csiso58gb231280, euc-cn, euccn, eucgb2312-cn, gb2312-1980, " "gb2312-80, iso-ir-58" -#: ../../library/codecs.rst:1177 ../../library/codecs.rst:1186 +#: ../../library/codecs.rst:1180 ../../library/codecs.rst:1189 msgid "Simplified Chinese" msgstr "簡體中文" -#: ../../library/codecs.rst:1182 +#: ../../library/codecs.rst:1185 msgid "gbk" msgstr "gbk" -#: ../../library/codecs.rst:1182 +#: ../../library/codecs.rst:1185 msgid "936, cp936, ms936" msgstr "936, cp936, ms936" -#: ../../library/codecs.rst:1182 ../../library/codecs.rst:1184 +#: ../../library/codecs.rst:1185 ../../library/codecs.rst:1187 msgid "Unified Chinese" msgstr "" -#: ../../library/codecs.rst:1184 +#: ../../library/codecs.rst:1187 msgid "gb18030" msgstr "gb18030" -#: ../../library/codecs.rst:1184 +#: ../../library/codecs.rst:1187 msgid "gb18030-2000" msgstr "gb18030-2000" -#: ../../library/codecs.rst:1186 +#: ../../library/codecs.rst:1189 msgid "hz" msgstr "" -#: ../../library/codecs.rst:1186 +#: ../../library/codecs.rst:1189 msgid "hzgb, hz-gb, hz-gb-2312" msgstr "hzgb, hz-gb, hz-gb-2312" -#: ../../library/codecs.rst:1188 +#: ../../library/codecs.rst:1191 msgid "iso2022_jp" msgstr "iso2022_jp" -#: ../../library/codecs.rst:1188 +#: ../../library/codecs.rst:1191 msgid "csiso2022jp, iso2022jp, iso-2022-jp" msgstr "csiso2022jp, iso2022jp, iso-2022-jp" -#: ../../library/codecs.rst:1191 +#: ../../library/codecs.rst:1194 msgid "iso2022_jp_1" msgstr "iso2022_jp_1" -#: ../../library/codecs.rst:1191 +#: ../../library/codecs.rst:1194 msgid "iso2022jp-1, iso-2022-jp-1" msgstr "iso2022jp-1, iso-2022-jp-1" -#: ../../library/codecs.rst:1193 +#: ../../library/codecs.rst:1196 msgid "iso2022_jp_2" msgstr "iso2022_jp_2" -#: ../../library/codecs.rst:1193 +#: ../../library/codecs.rst:1196 msgid "iso2022jp-2, iso-2022-jp-2" msgstr "iso2022jp-2, iso-2022-jp-2" -#: ../../library/codecs.rst:1193 +#: ../../library/codecs.rst:1196 msgid "Japanese, Korean, Simplified Chinese, Western Europe, Greek" msgstr "" -#: ../../library/codecs.rst:1196 +#: ../../library/codecs.rst:1199 msgid "iso2022_jp_2004" msgstr "iso2022_jp_2004" -#: ../../library/codecs.rst:1196 +#: ../../library/codecs.rst:1199 msgid "iso2022jp-2004, iso-2022-jp-2004" msgstr "iso2022jp-2004, iso-2022-jp-2004" -#: ../../library/codecs.rst:1199 +#: ../../library/codecs.rst:1202 msgid "iso2022_jp_3" msgstr "iso2022_jp_3" -#: ../../library/codecs.rst:1199 +#: ../../library/codecs.rst:1202 msgid "iso2022jp-3, iso-2022-jp-3" msgstr "iso2022jp-3, iso-2022-jp-3" -#: ../../library/codecs.rst:1201 +#: ../../library/codecs.rst:1204 msgid "iso2022_jp_ext" msgstr "iso2022_jp_ext" -#: ../../library/codecs.rst:1201 +#: ../../library/codecs.rst:1204 msgid "iso2022jp-ext, iso-2022-jp-ext" msgstr "iso2022jp-ext, iso-2022-jp-ext" -#: ../../library/codecs.rst:1203 +#: ../../library/codecs.rst:1206 msgid "iso2022_kr" msgstr "iso2022_kr" -#: ../../library/codecs.rst:1203 +#: ../../library/codecs.rst:1206 msgid "csiso2022kr, iso2022kr, iso-2022-kr" msgstr "csiso2022kr, iso2022kr, iso-2022-kr" -#: ../../library/codecs.rst:1206 +#: ../../library/codecs.rst:1209 msgid "latin_1" msgstr "latin_1" -#: ../../library/codecs.rst:1206 +#: ../../library/codecs.rst:1209 msgid "iso-8859-1, iso8859-1, 8859, cp819, latin, latin1, L1" msgstr "iso-8859-1, iso8859-1, 8859, cp819, latin, latin1, L1" -#: ../../library/codecs.rst:1209 +#: ../../library/codecs.rst:1212 msgid "iso8859_2" msgstr "iso8859_2" -#: ../../library/codecs.rst:1209 +#: ../../library/codecs.rst:1212 msgid "iso-8859-2, latin2, L2" msgstr "iso-8859-2, latin2, L2" -#: ../../library/codecs.rst:1211 +#: ../../library/codecs.rst:1214 msgid "iso8859_3" msgstr "iso8859_3" -#: ../../library/codecs.rst:1211 +#: ../../library/codecs.rst:1214 msgid "iso-8859-3, latin3, L3" msgstr "iso-8859-3, latin3, L3" -#: ../../library/codecs.rst:1211 +#: ../../library/codecs.rst:1214 msgid "Esperanto, Maltese" msgstr "" -#: ../../library/codecs.rst:1213 +#: ../../library/codecs.rst:1216 msgid "iso8859_4" msgstr "iso8859_4" -#: ../../library/codecs.rst:1213 +#: ../../library/codecs.rst:1216 msgid "iso-8859-4, latin4, L4" msgstr "iso-8859-4, latin4, L4" -#: ../../library/codecs.rst:1215 +#: ../../library/codecs.rst:1218 msgid "iso8859_5" msgstr "iso8859_5" -#: ../../library/codecs.rst:1215 +#: ../../library/codecs.rst:1218 msgid "iso-8859-5, cyrillic" msgstr "iso-8859-5, cyrillic" -#: ../../library/codecs.rst:1218 +#: ../../library/codecs.rst:1221 msgid "iso8859_6" msgstr "iso8859_6" -#: ../../library/codecs.rst:1218 +#: ../../library/codecs.rst:1221 msgid "iso-8859-6, arabic" msgstr "iso-8859-6, arabic" -#: ../../library/codecs.rst:1220 +#: ../../library/codecs.rst:1223 msgid "iso8859_7" msgstr "iso8859_7" -#: ../../library/codecs.rst:1220 +#: ../../library/codecs.rst:1223 msgid "iso-8859-7, greek, greek8" msgstr "iso-8859-7, greek, greek8" -#: ../../library/codecs.rst:1222 +#: ../../library/codecs.rst:1225 msgid "iso8859_8" msgstr "iso8859_8" -#: ../../library/codecs.rst:1222 +#: ../../library/codecs.rst:1225 msgid "iso-8859-8, hebrew" msgstr "iso-8859-8, hebrew" -#: ../../library/codecs.rst:1224 +#: ../../library/codecs.rst:1227 msgid "iso8859_9" msgstr "iso8859_9" -#: ../../library/codecs.rst:1224 +#: ../../library/codecs.rst:1227 msgid "iso-8859-9, latin5, L5" msgstr "iso-8859-9, latin5, L5" -#: ../../library/codecs.rst:1226 +#: ../../library/codecs.rst:1229 msgid "iso8859_10" msgstr "iso8859_10" -#: ../../library/codecs.rst:1226 +#: ../../library/codecs.rst:1229 msgid "iso-8859-10, latin6, L6" msgstr "iso-8859-10, latin6, L6" -#: ../../library/codecs.rst:1226 +#: ../../library/codecs.rst:1229 msgid "Nordic languages" msgstr "" -#: ../../library/codecs.rst:1228 +#: ../../library/codecs.rst:1231 msgid "iso8859_11" msgstr "iso8859_11" -#: ../../library/codecs.rst:1228 +#: ../../library/codecs.rst:1231 msgid "iso-8859-11, thai" msgstr "iso-8859-11, thai" -#: ../../library/codecs.rst:1228 +#: ../../library/codecs.rst:1231 msgid "Thai languages" msgstr "" -#: ../../library/codecs.rst:1230 +#: ../../library/codecs.rst:1233 msgid "iso8859_13" msgstr "iso8859_13" -#: ../../library/codecs.rst:1230 +#: ../../library/codecs.rst:1233 msgid "iso-8859-13, latin7, L7" msgstr "iso-8859-13, latin7, L7" -#: ../../library/codecs.rst:1232 +#: ../../library/codecs.rst:1235 msgid "iso8859_14" msgstr "iso8859_14" -#: ../../library/codecs.rst:1232 +#: ../../library/codecs.rst:1235 msgid "iso-8859-14, latin8, L8" msgstr "iso-8859-14, latin8, L8" -#: ../../library/codecs.rst:1232 +#: ../../library/codecs.rst:1235 msgid "Celtic languages" msgstr "" -#: ../../library/codecs.rst:1234 +#: ../../library/codecs.rst:1237 msgid "iso8859_15" msgstr "iso8859_15" -#: ../../library/codecs.rst:1234 +#: ../../library/codecs.rst:1237 msgid "iso-8859-15, latin9, L9" msgstr "iso-8859-15, latin9, L9" -#: ../../library/codecs.rst:1236 +#: ../../library/codecs.rst:1239 msgid "iso8859_16" msgstr "iso8859_16" -#: ../../library/codecs.rst:1236 +#: ../../library/codecs.rst:1239 msgid "iso-8859-16, latin10, L10" msgstr "iso-8859-16, latin10, L10" -#: ../../library/codecs.rst:1236 +#: ../../library/codecs.rst:1239 msgid "South-Eastern Europe" msgstr "" -#: ../../library/codecs.rst:1238 +#: ../../library/codecs.rst:1241 msgid "johab" msgstr "" -#: ../../library/codecs.rst:1238 +#: ../../library/codecs.rst:1241 msgid "cp1361, ms1361" msgstr "cp1361, ms1361" -#: ../../library/codecs.rst:1240 +#: ../../library/codecs.rst:1243 msgid "koi8_r" msgstr "koi8_r" -#: ../../library/codecs.rst:1242 +#: ../../library/codecs.rst:1245 msgid "koi8_t" msgstr "koi8_t" -#: ../../library/codecs.rst:1242 +#: ../../library/codecs.rst:1245 msgid "Tajik" msgstr "" -#: ../../library/codecs.rst:1246 +#: ../../library/codecs.rst:1249 msgid "koi8_u" msgstr "koi8_u" -#: ../../library/codecs.rst:1248 +#: ../../library/codecs.rst:1251 msgid "kz1048" msgstr "kz1048" -#: ../../library/codecs.rst:1248 +#: ../../library/codecs.rst:1251 msgid "kz_1048, strk1048_2002, rk1048" msgstr "kz_1048, strk1048_2002, rk1048" -#: ../../library/codecs.rst:1248 ../../library/codecs.rst:1266 +#: ../../library/codecs.rst:1251 ../../library/codecs.rst:1269 msgid "Kazakh" msgstr "" -#: ../../library/codecs.rst:1252 +#: ../../library/codecs.rst:1255 msgid "mac_cyrillic" msgstr "mac_cyrillic" -#: ../../library/codecs.rst:1252 +#: ../../library/codecs.rst:1255 msgid "maccyrillic" msgstr "" -#: ../../library/codecs.rst:1255 +#: ../../library/codecs.rst:1258 msgid "mac_greek" msgstr "mac_greek" -#: ../../library/codecs.rst:1255 +#: ../../library/codecs.rst:1258 msgid "macgreek" msgstr "" -#: ../../library/codecs.rst:1257 +#: ../../library/codecs.rst:1260 msgid "mac_iceland" msgstr "mac_iceland" -#: ../../library/codecs.rst:1257 +#: ../../library/codecs.rst:1260 msgid "maciceland" msgstr "" -#: ../../library/codecs.rst:1259 +#: ../../library/codecs.rst:1262 msgid "mac_latin2" msgstr "mac_latin2" -#: ../../library/codecs.rst:1259 +#: ../../library/codecs.rst:1262 msgid "maclatin2, maccentraleurope, mac_centeuro" msgstr "maclatin2, maccentraleurope, mac_centeuro" -#: ../../library/codecs.rst:1262 +#: ../../library/codecs.rst:1265 msgid "mac_roman" msgstr "mac_roman" -#: ../../library/codecs.rst:1262 +#: ../../library/codecs.rst:1265 msgid "macroman, macintosh" msgstr "macroman, macintosh" -#: ../../library/codecs.rst:1264 +#: ../../library/codecs.rst:1267 msgid "mac_turkish" msgstr "mac_turkish" -#: ../../library/codecs.rst:1264 +#: ../../library/codecs.rst:1267 msgid "macturkish" msgstr "" -#: ../../library/codecs.rst:1266 +#: ../../library/codecs.rst:1269 msgid "ptcp154" msgstr "ptcp154" -#: ../../library/codecs.rst:1266 +#: ../../library/codecs.rst:1269 msgid "csptcp154, pt154, cp154, cyrillic-asian" msgstr "csptcp154, pt154, cp154, cyrillic-asian" -#: ../../library/codecs.rst:1269 +#: ../../library/codecs.rst:1272 msgid "shift_jis" msgstr "shift_jis" -#: ../../library/codecs.rst:1269 +#: ../../library/codecs.rst:1272 msgid "csshiftjis, shiftjis, sjis, s_jis" msgstr "csshiftjis, shiftjis, sjis, s_jis" -#: ../../library/codecs.rst:1272 +#: ../../library/codecs.rst:1275 msgid "shift_jis_2004" msgstr "shift_jis_2004" -#: ../../library/codecs.rst:1272 +#: ../../library/codecs.rst:1275 msgid "shiftjis2004, sjis_2004, sjis2004" msgstr "shiftjis2004, sjis_2004, sjis2004" -#: ../../library/codecs.rst:1275 +#: ../../library/codecs.rst:1278 msgid "shift_jisx0213" msgstr "shift_jisx0213" -#: ../../library/codecs.rst:1275 +#: ../../library/codecs.rst:1278 msgid "shiftjisx0213, sjisx0213, s_jisx0213" msgstr "shiftjisx0213, sjisx0213, s_jisx0213" -#: ../../library/codecs.rst:1278 +#: ../../library/codecs.rst:1281 msgid "utf_32" msgstr "utf_32" -#: ../../library/codecs.rst:1278 +#: ../../library/codecs.rst:1281 msgid "U32, utf32" msgstr "U32, utf32" -#: ../../library/codecs.rst:1278 ../../library/codecs.rst:1280 -#: ../../library/codecs.rst:1282 ../../library/codecs.rst:1284 -#: ../../library/codecs.rst:1286 ../../library/codecs.rst:1288 -#: ../../library/codecs.rst:1290 ../../library/codecs.rst:1292 -#: ../../library/codecs.rst:1294 +#: ../../library/codecs.rst:1281 ../../library/codecs.rst:1283 +#: ../../library/codecs.rst:1285 ../../library/codecs.rst:1287 +#: ../../library/codecs.rst:1289 ../../library/codecs.rst:1291 +#: ../../library/codecs.rst:1293 ../../library/codecs.rst:1295 +#: ../../library/codecs.rst:1297 msgid "all languages" msgstr "" -#: ../../library/codecs.rst:1280 +#: ../../library/codecs.rst:1283 msgid "utf_32_be" msgstr "utf_32_be" -#: ../../library/codecs.rst:1280 +#: ../../library/codecs.rst:1283 msgid "UTF-32BE" msgstr "UTF-32BE" -#: ../../library/codecs.rst:1282 +#: ../../library/codecs.rst:1285 msgid "utf_32_le" msgstr "utf_32_le" -#: ../../library/codecs.rst:1282 +#: ../../library/codecs.rst:1285 msgid "UTF-32LE" msgstr "UTF-32LE" -#: ../../library/codecs.rst:1284 +#: ../../library/codecs.rst:1287 msgid "utf_16" msgstr "utf_16" -#: ../../library/codecs.rst:1284 +#: ../../library/codecs.rst:1287 msgid "U16, utf16" msgstr "U16, utf16" -#: ../../library/codecs.rst:1286 +#: ../../library/codecs.rst:1289 msgid "utf_16_be" msgstr "utf_16_be" -#: ../../library/codecs.rst:1286 +#: ../../library/codecs.rst:1289 msgid "UTF-16BE" msgstr "UTF-16BE" -#: ../../library/codecs.rst:1288 +#: ../../library/codecs.rst:1291 msgid "utf_16_le" msgstr "utf_16_le" -#: ../../library/codecs.rst:1288 +#: ../../library/codecs.rst:1291 msgid "UTF-16LE" msgstr "UTF-16LE" -#: ../../library/codecs.rst:1290 +#: ../../library/codecs.rst:1293 msgid "utf_7" msgstr "utf_7" -#: ../../library/codecs.rst:1290 +#: ../../library/codecs.rst:1293 msgid "U7, unicode-1-1-utf-7" msgstr "U7, unicode-1-1-utf-7" -#: ../../library/codecs.rst:1292 +#: ../../library/codecs.rst:1295 msgid "utf_8" msgstr "utf_8" -#: ../../library/codecs.rst:1292 +#: ../../library/codecs.rst:1295 msgid "U8, UTF, utf8, cp65001" msgstr "U8, UTF, utf8, cp65001" -#: ../../library/codecs.rst:1294 +#: ../../library/codecs.rst:1297 msgid "utf_8_sig" msgstr "utf_8_sig" -#: ../../library/codecs.rst:1297 +#: ../../library/codecs.rst:1300 msgid "" "The utf-16\\* and utf-32\\* encoders no longer allow surrogate code points " "(``U+D800``--``U+DFFF``) to be encoded. The utf-32\\* decoders no longer " "decode byte sequences that correspond to surrogate code points." msgstr "" -#: ../../library/codecs.rst:1303 +#: ../../library/codecs.rst:1306 msgid "``cp65001`` is now an alias to ``utf_8``." msgstr "" -#: ../../library/codecs.rst:1308 +#: ../../library/codecs.rst:1311 msgid "Python Specific Encodings" msgstr "" -#: ../../library/codecs.rst:1310 +#: ../../library/codecs.rst:1313 msgid "" "A number of predefined codecs are specific to Python, so their codec names " "have no meaning outside Python. These are listed in the tables below based " @@ -2305,272 +2305,274 @@ msgid "" "asymmetric codecs, the stated meaning describes the encoding direction." msgstr "" -#: ../../library/codecs.rst:1318 +#: ../../library/codecs.rst:1321 msgid "Text Encodings" msgstr "" -#: ../../library/codecs.rst:1320 +#: ../../library/codecs.rst:1323 msgid "" "The following codecs provide :class:`str` to :class:`bytes` encoding and :" "term:`bytes-like object` to :class:`str` decoding, similar to the Unicode " "text encodings." msgstr "" -#: ../../library/codecs.rst:1329 +#: ../../library/codecs.rst:1332 msgid "idna" msgstr "idna" -#: ../../library/codecs.rst:1329 +#: ../../library/codecs.rst:1332 msgid "" "Implement :rfc:`3490`, see also :mod:`encodings.idna`. Only " "``errors='strict'`` is supported." msgstr "" -#: ../../library/codecs.rst:1335 +#: ../../library/codecs.rst:1338 msgid "mbcs" msgstr "mbcs" -#: ../../library/codecs.rst:1335 +#: ../../library/codecs.rst:1338 msgid "ansi, dbcs" msgstr "ansi, dbcs" -#: ../../library/codecs.rst:1335 +#: ../../library/codecs.rst:1338 msgid "" "Windows only: Encode the operand according to the ANSI codepage (CP_ACP)." msgstr "" -#: ../../library/codecs.rst:1339 +#: ../../library/codecs.rst:1342 msgid "oem" msgstr "oem" -#: ../../library/codecs.rst:1339 +#: ../../library/codecs.rst:1342 msgid "" "Windows only: Encode the operand according to the OEM codepage (CP_OEMCP)." msgstr "" -#: ../../library/codecs.rst:1345 +#: ../../library/codecs.rst:1348 msgid "palmos" msgstr "" -#: ../../library/codecs.rst:1345 +#: ../../library/codecs.rst:1348 msgid "Encoding of PalmOS 3.5." msgstr "" -#: ../../library/codecs.rst:1347 +#: ../../library/codecs.rst:1350 msgid "punycode" msgstr "" -#: ../../library/codecs.rst:1347 +#: ../../library/codecs.rst:1350 msgid "Implement :rfc:`3492`. Stateful codecs are not supported." msgstr "" -#: ../../library/codecs.rst:1351 +#: ../../library/codecs.rst:1354 msgid "raw_unicode_escape" msgstr "raw_unicode_escape" -#: ../../library/codecs.rst:1351 +#: ../../library/codecs.rst:1354 msgid "" "Latin-1 encoding with :samp:`\\\\u{XXXX}` and :samp:`\\\\U{XXXXXXXX}` for " "other code points. Existing backslashes are not escaped in any way. It is " "used in the Python pickle protocol." msgstr "" -#: ../../library/codecs.rst:1361 +#: ../../library/codecs.rst:1364 msgid "undefined" msgstr "" -#: ../../library/codecs.rst:1361 +#: ../../library/codecs.rst:1364 msgid "" "Raise an exception for all conversions, even empty strings. The error " "handler is ignored." msgstr "" -#: ../../library/codecs.rst:1366 +#: ../../library/codecs.rst:1369 msgid "unicode_escape" msgstr "unicode_escape" -#: ../../library/codecs.rst:1366 +#: ../../library/codecs.rst:1369 msgid "" "Encoding suitable as the contents of a Unicode literal in ASCII-encoded " "Python source code, except that quotes are not escaped. Decode from Latin-1 " "source code. Beware that Python source code actually uses UTF-8 by default." msgstr "" -#: ../../library/codecs.rst:1378 +#: ../../library/codecs.rst:1381 msgid "\"unicode_internal\" codec is removed." msgstr "" -#: ../../library/codecs.rst:1385 +#: ../../library/codecs.rst:1388 msgid "Binary Transforms" msgstr "" -#: ../../library/codecs.rst:1387 +#: ../../library/codecs.rst:1390 msgid "" "The following codecs provide binary transforms: :term:`bytes-like object` " "to :class:`bytes` mappings. They are not supported by :meth:`bytes.decode` " "(which only produces :class:`str` output)." msgstr "" -#: ../../library/codecs.rst:1395 +#: ../../library/codecs.rst:1398 msgid "Encoder / decoder" msgstr "" -#: ../../library/codecs.rst:1397 +#: ../../library/codecs.rst:1400 msgid "base64_codec [#b64]_" msgstr "base64_codec [#b64]_" -#: ../../library/codecs.rst:1397 +#: ../../library/codecs.rst:1400 msgid "base64, base_64" msgstr "base64, base_64" -#: ../../library/codecs.rst:1397 +#: ../../library/codecs.rst:1400 msgid "" "Convert the operand to multiline MIME base64 (the result always includes a " "trailing ``'\\n'``)." msgstr "" -#: ../../library/codecs.rst:1402 +#: ../../library/codecs.rst:1405 msgid "" "accepts any :term:`bytes-like object` as input for encoding and decoding" msgstr "" -#: ../../library/codecs.rst:1397 +#: ../../library/codecs.rst:1400 msgid ":meth:`base64.encodebytes` / :meth:`base64.decodebytes`" msgstr ":meth:`base64.encodebytes` / :meth:`base64.decodebytes`" -#: ../../library/codecs.rst:1408 +#: ../../library/codecs.rst:1411 msgid "bz2_codec" msgstr "bz2_codec" -#: ../../library/codecs.rst:1408 +#: ../../library/codecs.rst:1411 msgid "bz2" msgstr "bz2" -#: ../../library/codecs.rst:1408 +#: ../../library/codecs.rst:1411 msgid "Compress the operand using bz2." msgstr "" -#: ../../library/codecs.rst:1408 +#: ../../library/codecs.rst:1411 msgid ":meth:`bz2.compress` / :meth:`bz2.decompress`" msgstr ":meth:`bz2.compress` / :meth:`bz2.decompress`" -#: ../../library/codecs.rst:1411 +#: ../../library/codecs.rst:1414 msgid "hex_codec" msgstr "hex_codec" -#: ../../library/codecs.rst:1411 +#: ../../library/codecs.rst:1414 msgid "hex" msgstr "hex" -#: ../../library/codecs.rst:1411 +#: ../../library/codecs.rst:1414 msgid "" "Convert the operand to hexadecimal representation, with two digits per byte." msgstr "" -#: ../../library/codecs.rst:1411 +#: ../../library/codecs.rst:1414 msgid ":meth:`binascii.b2a_hex` / :meth:`binascii.a2b_hex`" msgstr ":meth:`binascii.b2a_hex` / :meth:`binascii.a2b_hex`" -#: ../../library/codecs.rst:1416 +#: ../../library/codecs.rst:1419 msgid "quopri_codec" msgstr "quopri_codec" -#: ../../library/codecs.rst:1416 +#: ../../library/codecs.rst:1419 msgid "quopri, quotedprintable, quoted_printable" msgstr "quopri, quotedprintable, quoted_printable" -#: ../../library/codecs.rst:1416 +#: ../../library/codecs.rst:1419 msgid "Convert the operand to MIME quoted printable." msgstr "" -#: ../../library/codecs.rst:1416 +#: ../../library/codecs.rst:1419 msgid ":meth:`quopri.encode` with ``quotetabs=True`` / :meth:`quopri.decode`" msgstr ":meth:`quopri.encode` with ``quotetabs=True`` / :meth:`quopri.decode`" -#: ../../library/codecs.rst:1420 +#: ../../library/codecs.rst:1423 msgid "uu_codec" msgstr "uu_codec" -#: ../../library/codecs.rst:1420 +#: ../../library/codecs.rst:1423 msgid "uu" msgstr "uu" -#: ../../library/codecs.rst:1420 +#: ../../library/codecs.rst:1423 msgid "Convert the operand using uuencode." msgstr "" -#: ../../library/codecs.rst:1420 -msgid ":meth:`uu.encode` / :meth:`uu.decode`" +#: ../../library/codecs.rst:1423 +#, fuzzy +msgid "" +":meth:`!uu.encode` / :meth:`!uu.decode` (Note: :mod:`uu` is deprecated.)" msgstr ":meth:`uu.encode` / :meth:`uu.decode`" -#: ../../library/codecs.rst:1423 +#: ../../library/codecs.rst:1428 msgid "zlib_codec" msgstr "zlib_codec" -#: ../../library/codecs.rst:1423 +#: ../../library/codecs.rst:1428 msgid "zip, zlib" msgstr "zip, zlib" -#: ../../library/codecs.rst:1423 +#: ../../library/codecs.rst:1428 msgid "Compress the operand using gzip." msgstr "" -#: ../../library/codecs.rst:1423 +#: ../../library/codecs.rst:1428 msgid ":meth:`zlib.compress` / :meth:`zlib.decompress`" msgstr ":meth:`zlib.compress` / :meth:`zlib.decompress`" -#: ../../library/codecs.rst:1427 +#: ../../library/codecs.rst:1432 msgid "" "In addition to :term:`bytes-like objects `, " "``'base64_codec'`` also accepts ASCII-only instances of :class:`str` for " "decoding" msgstr "" -#: ../../library/codecs.rst:1431 +#: ../../library/codecs.rst:1436 msgid "Restoration of the binary transforms." msgstr "" -#: ../../library/codecs.rst:1434 +#: ../../library/codecs.rst:1439 msgid "Restoration of the aliases for the binary transforms." msgstr "" -#: ../../library/codecs.rst:1441 +#: ../../library/codecs.rst:1446 msgid "Text Transforms" msgstr "" -#: ../../library/codecs.rst:1443 +#: ../../library/codecs.rst:1448 msgid "" "The following codec provides a text transform: a :class:`str` to :class:" "`str` mapping. It is not supported by :meth:`str.encode` (which only " "produces :class:`bytes` output)." msgstr "" -#: ../../library/codecs.rst:1452 +#: ../../library/codecs.rst:1457 msgid "rot_13" msgstr "rot_13" -#: ../../library/codecs.rst:1452 +#: ../../library/codecs.rst:1457 msgid "rot13" msgstr "" -#: ../../library/codecs.rst:1452 +#: ../../library/codecs.rst:1457 msgid "Return the Caesar-cypher encryption of the operand." msgstr "" -#: ../../library/codecs.rst:1457 +#: ../../library/codecs.rst:1462 msgid "Restoration of the ``rot_13`` text transform." msgstr "" -#: ../../library/codecs.rst:1460 +#: ../../library/codecs.rst:1465 msgid "Restoration of the ``rot13`` alias." msgstr "" -#: ../../library/codecs.rst:1465 +#: ../../library/codecs.rst:1470 msgid "" ":mod:`encodings.idna` --- Internationalized Domain Names in Applications" msgstr "" -#: ../../library/codecs.rst:1471 +#: ../../library/codecs.rst:1476 msgid "" "This module implements :rfc:`3490` (Internationalized Domain Names in " "Applications) and :rfc:`3492` (Nameprep: A Stringprep Profile for " @@ -2578,13 +2580,13 @@ msgid "" "encoding and :mod:`stringprep`." msgstr "" -#: ../../library/codecs.rst:1476 +#: ../../library/codecs.rst:1481 msgid "" "If you need the IDNA 2008 standard from :rfc:`5891` and :rfc:`5895`, use the " "third-party `idna module `_." msgstr "" -#: ../../library/codecs.rst:1479 +#: ../../library/codecs.rst:1484 msgid "" "These RFCs together define a protocol to support non-ASCII characters in " "domain names. A domain name containing non-ASCII characters (such as ``www." @@ -2598,7 +2600,7 @@ msgid "" "presenting them to the user." msgstr "" -#: ../../library/codecs.rst:1490 +#: ../../library/codecs.rst:1495 msgid "" "Python supports this conversion in several ways: the ``idna`` codec " "performs conversion between Unicode and ACE, separating an input string into " @@ -2615,14 +2617,14 @@ msgid "" "sends that field at all)." msgstr "" -#: ../../library/codecs.rst:1503 +#: ../../library/codecs.rst:1508 msgid "" "When receiving host names from the wire (such as in reverse name lookup), no " "automatic conversion to Unicode is performed: applications wishing to " "present such host names to the user should decode them to Unicode." msgstr "" -#: ../../library/codecs.rst:1507 +#: ../../library/codecs.rst:1512 msgid "" "The module :mod:`encodings.idna` also implements the nameprep procedure, " "which performs certain normalizations on host names, to achieve case-" @@ -2630,49 +2632,49 @@ msgid "" "characters. The nameprep functions can be used directly if desired." msgstr "" -#: ../../library/codecs.rst:1515 +#: ../../library/codecs.rst:1520 msgid "" "Return the nameprepped version of *label*. The implementation currently " "assumes query strings, so ``AllowUnassigned`` is true." msgstr "" -#: ../../library/codecs.rst:1521 +#: ../../library/codecs.rst:1526 msgid "" "Convert a label to ASCII, as specified in :rfc:`3490`. ``UseSTD3ASCIIRules`` " "is assumed to be false." msgstr "" -#: ../../library/codecs.rst:1527 +#: ../../library/codecs.rst:1532 msgid "Convert a label to Unicode, as specified in :rfc:`3490`." msgstr "" -#: ../../library/codecs.rst:1531 +#: ../../library/codecs.rst:1536 msgid ":mod:`encodings.mbcs` --- Windows ANSI codepage" msgstr "" -#: ../../library/codecs.rst:1536 +#: ../../library/codecs.rst:1541 msgid "This module implements the ANSI codepage (CP_ACP)." msgstr "" -#: ../../library/codecs.rst:1538 +#: ../../library/codecs.rst:1543 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" -#: ../../library/codecs.rst:1540 +#: ../../library/codecs.rst:1545 msgid "Support any error handler." msgstr "" -#: ../../library/codecs.rst:1543 +#: ../../library/codecs.rst:1548 msgid "" "Before 3.2, the *errors* argument was ignored; ``'replace'`` was always used " "to encode, and ``'ignore'`` to decode." msgstr "" -#: ../../library/codecs.rst:1549 +#: ../../library/codecs.rst:1554 msgid ":mod:`encodings.utf_8_sig` --- UTF-8 codec with BOM signature" msgstr "" -#: ../../library/codecs.rst:1555 +#: ../../library/codecs.rst:1560 msgid "" "This module implements a variant of the UTF-8 codec. On encoding, a UTF-8 " "encoded BOM will be prepended to the UTF-8 encoded bytes. For the stateful " diff --git a/library/collections.abc.po b/library/collections.abc.po index 9c36761182..ac7a5b7e47 100644 --- a/library/collections.abc.po +++ b/library/collections.abc.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-10-20 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:41+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -430,9 +430,9 @@ msgstr "" msgid "" "Checking ``isinstance(obj, Iterable)`` detects classes that are registered " "as :class:`Iterable` or that have an :meth:`__iter__` method, but it does " -"not detect classes that iterate with the :meth:`__getitem__` method. The " -"only reliable way to determine whether an object is :term:`iterable` is to " -"call ``iter(obj)``." +"not detect classes that iterate with the :meth:`~object.__getitem__` " +"method. The only reliable way to determine whether an object is :term:" +"`iterable` is to call ``iter(obj)``." msgstr "" #: ../../library/collections.abc.rst:200 @@ -463,9 +463,9 @@ msgstr "" msgid "" "Checking ``isinstance(obj, Iterable)`` detects classes that are registered " "as :class:`Iterable` or that have an :meth:`__iter__` method, but it does " -"not detect classes that iterate with the :meth:`__getitem__` method. The " -"only reliable way to determine whether an object is :term:`iterable` is to " -"call ``iter(obj)``." +"not detect classes that iterate with the :meth:`~object.__getitem__` method. " +"The only reliable way to determine whether an object is :term:`iterable` is " +"to call ``iter(obj)``." msgstr "" #: ../../library/collections.abc.rst:231 @@ -499,11 +499,11 @@ msgstr "" msgid "" "Implementation note: Some of the mixin methods, such as :meth:`__iter__`, :" "meth:`__reversed__` and :meth:`index`, make repeated calls to the " -"underlying :meth:`__getitem__` method. Consequently, if :meth:`__getitem__` " -"is implemented with constant access speed, the mixin methods will have " -"linear performance; however, if the underlying method is linear (as it would " -"be with a linked list), the mixins will have quadratic performance and will " -"likely need to be overridden." +"underlying :meth:`~object.__getitem__` method. Consequently, if :meth:" +"`~object.__getitem__` is implemented with constant access speed, the mixin " +"methods will have linear performance; however, if the underlying method is " +"linear (as it would be with a linked list), the mixins will have quadratic " +"performance and will likely need to be overridden." msgstr "" #: ../../library/collections.abc.rst:272 diff --git a/library/collections.po b/library/collections.po index 78ac6d2647..8eef17b770 100644 --- a/library/collections.po +++ b/library/collections.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-10-20 00:03+0000\n" "PO-Revision-Date: 2023-02-18 14:48+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -934,24 +934,24 @@ msgstr "" #: ../../library/collections.rst:746 msgid "" -"This method is called by the :meth:`__getitem__` method of the :class:`dict` " -"class when the requested key is not found; whatever it returns or raises is " -"then returned or raised by :meth:`__getitem__`." +"This method is called by the :meth:`~object.__getitem__` method of the :" +"class:`dict` class when the requested key is not found; whatever it returns " +"or raises is then returned or raised by :meth:`~object.__getitem__`." msgstr "" -"在無法找到所要求的鍵時,此方法會被 :class:`dict` 類別的 :meth:`__getitem__` " -"方法呼叫。無論此方法回傳了值還是引發了例外,都會被 :meth:`__getitem__` 所傳" -"遞。" +"在無法找到所要求的鍵時,此方法會被 :class:`dict` 類別的 :meth:`~object." +"__getitem__` 方法呼叫。無論此方法回傳了值還是引發了例外,都會被 :meth:" +"`~object.__getitem__` 所傳遞。" #: ../../library/collections.rst:750 msgid "" "Note that :meth:`__missing__` is *not* called for any operations besides :" -"meth:`__getitem__`. This means that :meth:`get` will, like normal " +"meth:`~object.__getitem__`. This means that :meth:`get` will, like normal " "dictionaries, return ``None`` as a default rather than using :attr:" "`default_factory`." msgstr "" -"注意,\\ :meth:`__missing__` *不會*\\ 被 :meth:`__getitem__` 以外的其他方法呼" -"叫,這意味著 :meth:`get` 會像一般的 dict 那樣回傳 ``None`` 做為預設值,而非使" -"用 :attr:`default_factory`。" +"注意,\\ :meth:`__missing__` *不會*\\ 被 :meth:`~object.__getitem__` 以外的其" +"他方法呼叫,這意味著 :meth:`get` 會像一般的 dict 那樣回傳 ``None`` 做為預設" +"值,而非使用 :attr:`default_factory`。" #: ../../library/collections.rst:756 msgid ":class:`defaultdict` objects support the following instance variable:" diff --git a/library/contextlib.po b/library/contextlib.po index d304c5e28c..e31c9625e1 100644 --- a/library/contextlib.po +++ b/library/contextlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-10-20 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:41+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -64,7 +64,8 @@ msgstr "" msgid "" "This function is a :term:`decorator` that can be used to define a factory " "function for :keyword:`with` statement context managers, without needing to " -"create a class or separate :meth:`__enter__` and :meth:`__exit__` methods." +"create a class or separate :meth:`~object.__enter__` and :meth:`~object." +"__exit__` methods." msgstr "" #: ../../library/contextlib.rst:50 @@ -418,8 +419,8 @@ msgstr "" #: ../../library/contextlib.rst:518 msgid "" -"The :meth:`__enter__` method returns the :class:`ExitStack` instance, and " -"performs no additional operations." +"The :meth:`~object.__enter__` method returns the :class:`ExitStack` " +"instance, and performs no additional operations." msgstr "" #: ../../library/contextlib.rst:521 @@ -457,9 +458,9 @@ msgstr "" #: ../../library/contextlib.rst:546 msgid "" -"Enters a new context manager and adds its :meth:`__exit__` method to the " -"callback stack. The return value is the result of the context manager's own :" -"meth:`__enter__` method." +"Enters a new context manager and adds its :meth:`~object.__exit__` method to " +"the callback stack. The return value is the result of the context manager's " +"own :meth:`~object.__enter__` method." msgstr "" #: ../../library/contextlib.rst:550 @@ -475,27 +476,29 @@ msgid "" msgstr "" #: ../../library/contextlib.rst:559 -msgid "Adds a context manager's :meth:`__exit__` method to the callback stack." +msgid "" +"Adds a context manager's :meth:`~object.__exit__` method to the callback " +"stack." msgstr "" #: ../../library/contextlib.rst:561 msgid "" "As ``__enter__`` is *not* invoked, this method can be used to cover part of " -"an :meth:`__enter__` implementation with a context manager's own :meth:" -"`__exit__` method." +"an :meth:`~object.__enter__` implementation with a context manager's own :" +"meth:`~object.__exit__` method." msgstr "" #: ../../library/contextlib.rst:565 msgid "" "If passed an object that is not a context manager, this method assumes it is " -"a callback with the same signature as a context manager's :meth:`__exit__` " -"method and adds it directly to the callback stack." +"a callback with the same signature as a context manager's :meth:`~object." +"__exit__` method and adds it directly to the callback stack." msgstr "" #: ../../library/contextlib.rst:569 msgid "" "By returning true values, these callbacks can suppress exceptions the same " -"way context manager :meth:`__exit__` methods can." +"way context manager :meth:`~object.__exit__` methods can." msgstr "" #: ../../library/contextlib.rst:572 @@ -648,7 +651,7 @@ msgstr "" msgid "" "As noted in the documentation of :meth:`ExitStack.push`, this method can be " "useful in cleaning up an already allocated resource if later steps in the :" -"meth:`__enter__` implementation fail." +"meth:`~object.__enter__` implementation fail." msgstr "" #: ../../library/contextlib.rst:719 @@ -741,8 +744,8 @@ msgstr "" msgid "" "Note that there is one additional limitation when using context managers as " "function decorators: there's no way to access the return value of :meth:" -"`__enter__`. If that value is needed, then it is still necessary to use an " -"explicit ``with`` statement." +"`~object.__enter__`. If that value is needed, then it is still necessary to " +"use an explicit ``with`` statement." msgstr "" #: ../../library/contextlib.rst:880 diff --git a/library/difflib.po b/library/difflib.po index fd4440ff4a..3fd67c4ee7 100644 --- a/library/difflib.po +++ b/library/difflib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-11 17:13+0000\n" +"POT-Creation-Date: 2023-11-04 00:03+0000\n" "PO-Revision-Date: 2016-11-19 00:29+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -72,7 +72,7 @@ msgid "" "``False`` when creating the :class:`SequenceMatcher`." msgstr "" -#: ../../library/difflib.rst:55 ../../library/difflib.rst:384 +#: ../../library/difflib.rst:55 ../../library/difflib.rst:386 msgid "The *autojunk* parameter." msgstr "*autojunk* 參數。" @@ -92,7 +92,7 @@ msgstr "" msgid "Code" msgstr "" -#: ../../library/difflib.rst:69 ../../library/difflib.rst:494 +#: ../../library/difflib.rst:69 ../../library/difflib.rst:496 msgid "Meaning" msgstr "" @@ -249,13 +249,13 @@ msgid "" "trailing newlines." msgstr "" -#: ../../library/difflib.rst:165 ../../library/difflib.rst:294 +#: ../../library/difflib.rst:165 ../../library/difflib.rst:297 msgid "" "For inputs that do not have trailing newlines, set the *lineterm* argument " "to ``\"\"`` so that the output will be uniformly newline free." msgstr "" -#: ../../library/difflib.rst:168 ../../library/difflib.rst:297 +#: ../../library/difflib.rst:168 msgid "" "The context diff format normally has a header for filenames and modification " "times. Any or all of these may be specified using strings for *fromfile*, " @@ -264,11 +264,11 @@ msgid "" "default to blanks." msgstr "" -#: ../../library/difflib.rst:191 ../../library/difflib.rst:318 +#: ../../library/difflib.rst:194 ../../library/difflib.rst:320 msgid "See :ref:`difflib-interface` for a more detailed example." msgstr "一個更詳盡的範例請見 :ref:`difflib-interface`\\ 。" -#: ../../library/difflib.rst:196 +#: ../../library/difflib.rst:199 msgid "" "Return a list of the best \"good enough\" matches. *word* is a sequence for " "which close matches are desired (typically a string), and *possibilities* is " @@ -276,37 +276,37 @@ msgid "" "strings)." msgstr "" -#: ../../library/difflib.rst:200 +#: ../../library/difflib.rst:203 msgid "" "Optional argument *n* (default ``3``) is the maximum number of close matches " "to return; *n* must be greater than ``0``." msgstr "" -#: ../../library/difflib.rst:203 +#: ../../library/difflib.rst:206 msgid "" "Optional argument *cutoff* (default ``0.6``) is a float in the range [0, 1]. " "Possibilities that don't score at least that similar to *word* are ignored." msgstr "" -#: ../../library/difflib.rst:206 +#: ../../library/difflib.rst:209 msgid "" "The best (no more than *n*) matches among the possibilities are returned in " "a list, sorted by similarity score, most similar first." msgstr "" -#: ../../library/difflib.rst:222 +#: ../../library/difflib.rst:225 msgid "" "Compare *a* and *b* (lists of strings); return a :class:`Differ`\\ -style " "delta (a :term:`generator` generating the delta lines)." msgstr "" -#: ../../library/difflib.rst:225 +#: ../../library/difflib.rst:228 msgid "" "Optional keyword parameters *linejunk* and *charjunk* are filtering " "functions (or ``None``):" msgstr "" -#: ../../library/difflib.rst:228 +#: ../../library/difflib.rst:231 msgid "" "*linejunk*: A function that accepts a single string argument, and returns " "true if the string is junk, or false if not. The default is ``None``. There " @@ -317,7 +317,7 @@ msgid "" "this usually works better than using this function." msgstr "" -#: ../../library/difflib.rst:236 +#: ../../library/difflib.rst:239 msgid "" "*charjunk*: A function that accepts a character (a string of length 1), and " "returns if the character is junk, or false if not. The default is module-" @@ -325,28 +325,28 @@ msgid "" "characters (a blank or tab; it's a bad idea to include newline in this!)." msgstr "" -#: ../../library/difflib.rst:257 +#: ../../library/difflib.rst:260 msgid "Return one of the two sequences that generated a delta." msgstr "" -#: ../../library/difflib.rst:259 +#: ../../library/difflib.rst:262 msgid "" "Given a *sequence* produced by :meth:`Differ.compare` or :func:`ndiff`, " "extract lines originating from file 1 or 2 (parameter *which*), stripping " "off line prefixes." msgstr "" -#: ../../library/difflib.rst:263 +#: ../../library/difflib.rst:266 msgid "Example:" msgstr "範例:" -#: ../../library/difflib.rst:280 +#: ../../library/difflib.rst:283 msgid "" "Compare *a* and *b* (lists of strings); return a delta (a :term:`generator` " "generating the delta lines) in unified diff format." msgstr "" -#: ../../library/difflib.rst:283 +#: ../../library/difflib.rst:286 msgid "" "Unified diffs are a compact way of showing just the lines that have changed " "plus a few lines of context. The changes are shown in an inline style " @@ -354,7 +354,7 @@ msgid "" "set by *n* which defaults to three." msgstr "" -#: ../../library/difflib.rst:288 +#: ../../library/difflib.rst:291 msgid "" "By default, the diff control lines (those with ``---``, ``+++``, or ``@@``) " "are created with a trailing newline. This is helpful so that inputs created " @@ -363,14 +363,23 @@ msgid "" "trailing newlines." msgstr "" -#: ../../library/difflib.rst:322 +#: ../../library/difflib.rst:300 +msgid "" +"The unified diff format normally has a header for filenames and modification " +"times. Any or all of these may be specified using strings for *fromfile*, " +"*tofile*, *fromfiledate*, and *tofiledate*. The modification times are " +"normally expressed in the ISO 8601 format. If not specified, the strings " +"default to blanks." +msgstr "" + +#: ../../library/difflib.rst:324 msgid "" "Compare *a* and *b* (lists of bytes objects) using *dfunc*; yield a sequence " "of delta lines (also bytes) in the format returned by *dfunc*. *dfunc* must " "be a callable, typically either :func:`unified_diff` or :func:`context_diff`." msgstr "" -#: ../../library/difflib.rst:327 +#: ../../library/difflib.rst:329 msgid "" "Allows you to compare data with unknown or inconsistent encoding. All inputs " "except *n* must be bytes objects, not str. Works by losslessly converting " @@ -380,42 +389,42 @@ msgid "" "unknown/inconsistent encodings as *a* and *b*." msgstr "" -#: ../../library/difflib.rst:338 +#: ../../library/difflib.rst:340 msgid "" "Return ``True`` for ignorable lines. The line *line* is ignorable if *line* " "is blank or contains a single ``'#'``, otherwise it is not ignorable. Used " "as a default for parameter *linejunk* in :func:`ndiff` in older versions." msgstr "" -#: ../../library/difflib.rst:345 +#: ../../library/difflib.rst:347 msgid "" "Return ``True`` for ignorable characters. The character *ch* is ignorable " "if *ch* is a space or tab, otherwise it is not ignorable. Used as a default " "for parameter *charjunk* in :func:`ndiff`." msgstr "" -#: ../../library/difflib.rst:353 +#: ../../library/difflib.rst:355 msgid "" "`Pattern Matching: The Gestalt Approach `_" msgstr "" -#: ../../library/difflib.rst:353 +#: ../../library/difflib.rst:355 msgid "" "Discussion of a similar algorithm by John W. Ratcliff and D. E. Metzener. " "This was published in `Dr. Dobb's Journal `_ in " "July, 1988." msgstr "" -#: ../../library/difflib.rst:360 +#: ../../library/difflib.rst:362 msgid "SequenceMatcher Objects" msgstr "SequenceMatcher 物件" -#: ../../library/difflib.rst:362 +#: ../../library/difflib.rst:364 msgid "The :class:`SequenceMatcher` class has this constructor:" msgstr "" -#: ../../library/difflib.rst:367 +#: ../../library/difflib.rst:369 msgid "" "Optional argument *isjunk* must be ``None`` (the default) or a one-argument " "function that takes a sequence element and returns true if and only if the " @@ -424,26 +433,26 @@ msgid "" "ignored. For example, pass::" msgstr "" -#: ../../library/difflib.rst:375 +#: ../../library/difflib.rst:377 msgid "" "if you're comparing lines as sequences of characters, and don't want to " "synch up on blanks or hard tabs." msgstr "" -#: ../../library/difflib.rst:378 +#: ../../library/difflib.rst:380 msgid "" "The optional arguments *a* and *b* are sequences to be compared; both " "default to empty strings. The elements of both sequences must be :term:" "`hashable`." msgstr "" -#: ../../library/difflib.rst:381 +#: ../../library/difflib.rst:383 msgid "" "The optional argument *autojunk* can be used to disable the automatic junk " "heuristic." msgstr "" -#: ../../library/difflib.rst:387 +#: ../../library/difflib.rst:389 msgid "" "SequenceMatcher objects get three data attributes: *bjunk* is the set of " "elements of *b* for which *isjunk* is ``True``; *bpopular* is the set of non-" @@ -453,19 +462,19 @@ msgid "" "`set_seqs` or :meth:`set_seq2`." msgstr "" -#: ../../library/difflib.rst:394 +#: ../../library/difflib.rst:396 msgid "The *bjunk* and *bpopular* attributes." msgstr "" -#: ../../library/difflib.rst:397 +#: ../../library/difflib.rst:399 msgid ":class:`SequenceMatcher` objects have the following methods:" msgstr "" -#: ../../library/difflib.rst:401 +#: ../../library/difflib.rst:403 msgid "Set the two sequences to be compared." msgstr "" -#: ../../library/difflib.rst:403 +#: ../../library/difflib.rst:405 msgid "" ":class:`SequenceMatcher` computes and caches detailed information about the " "second sequence, so if you want to compare one sequence against many " @@ -473,23 +482,23 @@ msgid "" "call :meth:`set_seq1` repeatedly, once for each of the other sequences." msgstr "" -#: ../../library/difflib.rst:411 +#: ../../library/difflib.rst:413 msgid "" "Set the first sequence to be compared. The second sequence to be compared " "is not changed." msgstr "" -#: ../../library/difflib.rst:417 +#: ../../library/difflib.rst:419 msgid "" "Set the second sequence to be compared. The first sequence to be compared " "is not changed." msgstr "" -#: ../../library/difflib.rst:423 +#: ../../library/difflib.rst:425 msgid "Find longest matching block in ``a[alo:ahi]`` and ``b[blo:bhi]``." msgstr "" -#: ../../library/difflib.rst:425 +#: ../../library/difflib.rst:427 msgid "" "If *isjunk* was omitted or ``None``, :meth:`find_longest_match` returns " "``(i, j, k)`` such that ``a[i:i+k]`` is equal to ``b[j:j+k]``, where ``alo " @@ -501,7 +510,7 @@ msgid "" "that starts earliest in *b*." msgstr "" -#: ../../library/difflib.rst:438 +#: ../../library/difflib.rst:440 msgid "" "If *isjunk* was provided, first the longest matching block is determined as " "above, but with the additional restriction that no junk element appears in " @@ -510,7 +519,7 @@ msgid "" "junk except as identical junk happens to be adjacent to an interesting match." msgstr "" -#: ../../library/difflib.rst:445 +#: ../../library/difflib.rst:447 msgid "" "Here's the same example as before, but considering blanks to be junk. That " "prevents ``' abcd'`` from matching the ``' abcd'`` at the tail end of the " @@ -518,26 +527,26 @@ msgid "" "matches the leftmost ``'abcd'`` in the second sequence:" msgstr "" -#: ../../library/difflib.rst:454 +#: ../../library/difflib.rst:456 msgid "If no blocks match, this returns ``(alo, blo, 0)``." msgstr "" -#: ../../library/difflib.rst:456 +#: ../../library/difflib.rst:458 msgid "This method returns a :term:`named tuple` ``Match(a, b, size)``." msgstr "" -#: ../../library/difflib.rst:458 +#: ../../library/difflib.rst:460 msgid "Added default arguments." msgstr "新增預設引數。" -#: ../../library/difflib.rst:464 +#: ../../library/difflib.rst:466 msgid "" "Return list of triples describing non-overlapping matching subsequences. " "Each triple is of the form ``(i, j, n)``, and means that ``a[i:i+n] == b[j:" "j+n]``. The triples are monotonically increasing in *i* and *j*." msgstr "" -#: ../../library/difflib.rst:469 +#: ../../library/difflib.rst:471 msgid "" "The last triple is a dummy, and has the value ``(len(a), len(b), 0)``. It " "is the only triple with ``n == 0``. If ``(i, j, n)`` and ``(i', j', n')`` " @@ -546,7 +555,7 @@ msgid "" "triples always describe non-adjacent equal blocks." msgstr "" -#: ../../library/difflib.rst:486 +#: ../../library/difflib.rst:488 msgid "" "Return list of 5-tuples describing how to turn *a* into *b*. Each tuple is " "of the form ``(tag, i1, i2, j1, j2)``. The first tuple has ``i1 == j1 == " @@ -554,104 +563,104 @@ msgid "" "tuple, and, likewise, *j1* equal to the previous *j2*." msgstr "" -#: ../../library/difflib.rst:491 +#: ../../library/difflib.rst:493 msgid "The *tag* values are strings, with these meanings:" msgstr "" -#: ../../library/difflib.rst:494 +#: ../../library/difflib.rst:496 msgid "Value" msgstr "" -#: ../../library/difflib.rst:496 +#: ../../library/difflib.rst:498 msgid "``'replace'``" msgstr "``'replace'``" -#: ../../library/difflib.rst:496 +#: ../../library/difflib.rst:498 msgid "``a[i1:i2]`` should be replaced by ``b[j1:j2]``." msgstr "" -#: ../../library/difflib.rst:499 +#: ../../library/difflib.rst:501 msgid "``'delete'``" msgstr "``'delete'``" -#: ../../library/difflib.rst:499 +#: ../../library/difflib.rst:501 msgid "``a[i1:i2]`` should be deleted. Note that ``j1 == j2`` in this case." msgstr "" -#: ../../library/difflib.rst:502 +#: ../../library/difflib.rst:504 msgid "``'insert'``" msgstr "``'insert'``" -#: ../../library/difflib.rst:502 +#: ../../library/difflib.rst:504 msgid "" "``b[j1:j2]`` should be inserted at ``a[i1:i1]``. Note that ``i1 == i2`` in " "this case." msgstr "" -#: ../../library/difflib.rst:506 +#: ../../library/difflib.rst:508 msgid "``'equal'``" msgstr "``'equal'``" -#: ../../library/difflib.rst:506 +#: ../../library/difflib.rst:508 msgid "``a[i1:i2] == b[j1:j2]`` (the sub-sequences are equal)." msgstr "" -#: ../../library/difflib.rst:510 +#: ../../library/difflib.rst:512 msgid "For example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/difflib.rst:527 +#: ../../library/difflib.rst:529 msgid "Return a :term:`generator` of groups with up to *n* lines of context." msgstr "" -#: ../../library/difflib.rst:529 +#: ../../library/difflib.rst:531 msgid "" "Starting with the groups returned by :meth:`get_opcodes`, this method splits " "out smaller change clusters and eliminates intervening ranges which have no " "changes." msgstr "" -#: ../../library/difflib.rst:533 +#: ../../library/difflib.rst:535 msgid "The groups are returned in the same format as :meth:`get_opcodes`." msgstr "" -#: ../../library/difflib.rst:538 +#: ../../library/difflib.rst:540 msgid "" "Return a measure of the sequences' similarity as a float in the range [0, 1]." msgstr "" -#: ../../library/difflib.rst:541 +#: ../../library/difflib.rst:543 msgid "" "Where T is the total number of elements in both sequences, and M is the " "number of matches, this is 2.0\\*M / T. Note that this is ``1.0`` if the " "sequences are identical, and ``0.0`` if they have nothing in common." msgstr "" -#: ../../library/difflib.rst:545 +#: ../../library/difflib.rst:547 msgid "" "This is expensive to compute if :meth:`get_matching_blocks` or :meth:" "`get_opcodes` hasn't already been called, in which case you may want to try :" "meth:`quick_ratio` or :meth:`real_quick_ratio` first to get an upper bound." msgstr "" -#: ../../library/difflib.rst:552 +#: ../../library/difflib.rst:554 msgid "" "Caution: The result of a :meth:`ratio` call may depend on the order of the " "arguments. For instance::" msgstr "" -#: ../../library/difflib.rst:563 +#: ../../library/difflib.rst:565 msgid "Return an upper bound on :meth:`ratio` relatively quickly." msgstr "" -#: ../../library/difflib.rst:568 +#: ../../library/difflib.rst:570 msgid "Return an upper bound on :meth:`ratio` very quickly." msgstr "" -#: ../../library/difflib.rst:571 +#: ../../library/difflib.rst:573 msgid "" "The three methods that return the ratio of matching to total characters can " "give different results due to differing levels of approximation, although :" @@ -660,28 +669,28 @@ msgid "" "ratio`:" msgstr "" -#: ../../library/difflib.rst:588 +#: ../../library/difflib.rst:590 msgid "SequenceMatcher Examples" msgstr "SequenceMatcher 範例" -#: ../../library/difflib.rst:590 +#: ../../library/difflib.rst:592 msgid "This example compares two strings, considering blanks to be \"junk\":" msgstr "" -#: ../../library/difflib.rst:596 +#: ../../library/difflib.rst:598 msgid "" ":meth:`~SequenceMatcher.ratio` returns a float in [0, 1], measuring the " "similarity of the sequences. As a rule of thumb, a :meth:`~SequenceMatcher." "ratio` value over 0.6 means the sequences are close matches:" msgstr "" -#: ../../library/difflib.rst:603 +#: ../../library/difflib.rst:605 msgid "" "If you're only interested in where the sequences match, :meth:" "`~SequenceMatcher.get_matching_blocks` is handy:" msgstr "" -#: ../../library/difflib.rst:612 +#: ../../library/difflib.rst:614 msgid "" "Note that the last tuple returned by :meth:`~SequenceMatcher." "get_matching_blocks` is always a dummy, ``(len(a), len(b), 0)``, and this is " @@ -689,29 +698,29 @@ msgid "" "is ``0``." msgstr "" -#: ../../library/difflib.rst:616 +#: ../../library/difflib.rst:618 msgid "" "If you want to know how to change the first sequence into the second, use :" "meth:`~SequenceMatcher.get_opcodes`:" msgstr "" -#: ../../library/difflib.rst:627 +#: ../../library/difflib.rst:629 msgid "" "The :func:`get_close_matches` function in this module which shows how simple " "code building on :class:`SequenceMatcher` can be used to do useful work." msgstr "" -#: ../../library/difflib.rst:631 +#: ../../library/difflib.rst:633 msgid "" "`Simple version control recipe `_ for a small application built with :class:`SequenceMatcher`." msgstr "" -#: ../../library/difflib.rst:639 +#: ../../library/difflib.rst:641 msgid "Differ Objects" msgstr "" -#: ../../library/difflib.rst:641 +#: ../../library/difflib.rst:643 msgid "" "Note that :class:`Differ`\\ -generated deltas make no claim to be " "**minimal** diffs. To the contrary, minimal diffs are often counter-" @@ -721,31 +730,31 @@ msgid "" "longer diff." msgstr "" -#: ../../library/difflib.rst:647 +#: ../../library/difflib.rst:649 msgid "The :class:`Differ` class has this constructor:" msgstr "" -#: ../../library/difflib.rst:653 +#: ../../library/difflib.rst:655 msgid "" "Optional keyword parameters *linejunk* and *charjunk* are for filter " "functions (or ``None``):" msgstr "" -#: ../../library/difflib.rst:656 +#: ../../library/difflib.rst:658 msgid "" "*linejunk*: A function that accepts a single string argument, and returns " "true if the string is junk. The default is ``None``, meaning that no line " "is considered junk." msgstr "" -#: ../../library/difflib.rst:660 +#: ../../library/difflib.rst:662 msgid "" "*charjunk*: A function that accepts a single character argument (a string of " "length 1), and returns true if the character is junk. The default is " "``None``, meaning that no character is considered junk." msgstr "" -#: ../../library/difflib.rst:664 +#: ../../library/difflib.rst:666 msgid "" "These junk-filtering functions speed up matching to find differences and do " "not cause any differing lines or characters to be ignored. Read the " @@ -753,17 +762,17 @@ msgid "" "*isjunk* parameter for an explanation." msgstr "" -#: ../../library/difflib.rst:670 +#: ../../library/difflib.rst:672 msgid "" ":class:`Differ` objects are used (deltas generated) via a single method:" msgstr "" -#: ../../library/difflib.rst:675 +#: ../../library/difflib.rst:677 msgid "" "Compare two sequences of lines, and generate the delta (a sequence of lines)." msgstr "" -#: ../../library/difflib.rst:677 +#: ../../library/difflib.rst:679 msgid "" "Each sequence must contain individual single-line strings ending with " "newlines. Such sequences can be obtained from the :meth:`~io.IOBase." @@ -772,11 +781,11 @@ msgid "" "IOBase.writelines` method of a file-like object." msgstr "" -#: ../../library/difflib.rst:688 +#: ../../library/difflib.rst:690 msgid "Differ Example" msgstr "" -#: ../../library/difflib.rst:690 +#: ../../library/difflib.rst:692 msgid "" "This example compares two texts. First we set up the texts, sequences of " "individual single-line strings ending with newlines (such sequences can also " @@ -784,45 +793,45 @@ msgid "" "objects):" msgstr "" -#: ../../library/difflib.rst:709 +#: ../../library/difflib.rst:711 msgid "Next we instantiate a Differ object:" msgstr "" -#: ../../library/difflib.rst:713 +#: ../../library/difflib.rst:715 msgid "" "Note that when instantiating a :class:`Differ` object we may pass functions " "to filter out line and character \"junk.\" See the :meth:`Differ` " "constructor for details." msgstr "" -#: ../../library/difflib.rst:717 +#: ../../library/difflib.rst:719 msgid "Finally, we compare the two:" msgstr "" -#: ../../library/difflib.rst:721 +#: ../../library/difflib.rst:723 msgid "``result`` is a list of strings, so let's pretty-print it:" msgstr "" -#: ../../library/difflib.rst:736 +#: ../../library/difflib.rst:738 msgid "As a single multi-line string it looks like this:" msgstr "" -#: ../../library/difflib.rst:755 +#: ../../library/difflib.rst:757 msgid "A command-line interface to difflib" msgstr "" -#: ../../library/difflib.rst:757 +#: ../../library/difflib.rst:759 msgid "" "This example shows how to use difflib to create a ``diff``-like utility." msgstr "" -#: ../../library/difflib.rst:762 +#: ../../library/difflib.rst:764 msgid "ndiff example" msgstr "" "ndiff 範例:\n" "\n" "::" -#: ../../library/difflib.rst:764 +#: ../../library/difflib.rst:766 msgid "This example shows how to use :func:`difflib.ndiff`." msgstr "" diff --git a/library/dis.po b/library/dis.po index 149873e707..5b4accee2c 100644 --- a/library/dis.po +++ b/library/dis.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-12 00:03+0000\n" +"POT-Creation-Date: 2023-10-18 00:04+0000\n" "PO-Revision-Date: 2018-07-27 16:55+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -68,69 +68,83 @@ msgid "" "shown by passing ``adaptive=True``." msgstr "" -#: ../../library/dis.rst:46 +#: ../../library/dis.rst:45 +msgid "" +"The argument of a jump is the offset of the target instruction relative to " +"the instruction that appears immediately after the jump instruction's :" +"opcode:`CACHE` entries." +msgstr "" + +#: ../../library/dis.rst:50 +msgid "" +"As a consequence, the presence of the :opcode:`CACHE` instructions is " +"transparent for forward jumps but needs to be taken into account when " +"reasoning about backward jumps." +msgstr "" + +#: ../../library/dis.rst:54 msgid "Example: Given the function :func:`!myfunc`::" msgstr "" -#: ../../library/dis.rst:51 +#: ../../library/dis.rst:59 msgid "" "the following command can be used to display the disassembly of :func:`!" "myfunc`:" msgstr "" -#: ../../library/dis.rst:64 +#: ../../library/dis.rst:72 msgid "(The \"2\" is a line number)." msgstr "" -#: ../../library/dis.rst:69 +#: ../../library/dis.rst:77 msgid "Command-line interface" msgstr "" -#: ../../library/dis.rst:71 +#: ../../library/dis.rst:79 msgid "The :mod:`dis` module can be invoked as a script from the command line:" msgstr "" -#: ../../library/dis.rst:77 +#: ../../library/dis.rst:85 msgid "The following options are accepted:" msgstr "" -#: ../../library/dis.rst:83 +#: ../../library/dis.rst:91 msgid "Display usage and exit." msgstr "" -#: ../../library/dis.rst:85 +#: ../../library/dis.rst:93 msgid "" "If :file:`infile` is specified, its disassembled code will be written to " "stdout. Otherwise, disassembly is performed on compiled source code recieved " "from stdin." msgstr "" -#: ../../library/dis.rst:89 +#: ../../library/dis.rst:97 msgid "Bytecode analysis" msgstr "" -#: ../../library/dis.rst:93 +#: ../../library/dis.rst:101 msgid "" "The bytecode analysis API allows pieces of Python code to be wrapped in a :" "class:`Bytecode` object that provides easy access to details of the compiled " "code." msgstr "" -#: ../../library/dis.rst:100 +#: ../../library/dis.rst:108 msgid "" "Analyse the bytecode corresponding to a function, generator, asynchronous " "generator, coroutine, method, string of source code, or a code object (as " "returned by :func:`compile`)." msgstr "" -#: ../../library/dis.rst:104 +#: ../../library/dis.rst:112 msgid "" "This is a convenience wrapper around many of the functions listed below, " "most notably :func:`get_instructions`, as iterating over a :class:`Bytecode` " "instance yields the bytecode operations as :class:`Instruction` instances." msgstr "" -#: ../../library/dis.rst:108 ../../library/dis.rst:296 +#: ../../library/dis.rst:116 ../../library/dis.rst:304 msgid "" "If *first_line* is not ``None``, it indicates the line number that should be " "reported for the first source line in the disassembled code. Otherwise, the " @@ -138,71 +152,71 @@ msgid "" "code object." msgstr "" -#: ../../library/dis.rst:113 +#: ../../library/dis.rst:121 msgid "" "If *current_offset* is not ``None``, it refers to an instruction offset in " "the disassembled code. Setting this means :meth:`.dis` will display a " "\"current instruction\" marker against the specified opcode." msgstr "" -#: ../../library/dis.rst:117 +#: ../../library/dis.rst:125 msgid "" "If *show_caches* is ``True``, :meth:`.dis` will display inline cache entries " "used by the interpreter to specialize the bytecode." msgstr "" -#: ../../library/dis.rst:120 +#: ../../library/dis.rst:128 msgid "" "If *adaptive* is ``True``, :meth:`.dis` will display specialized bytecode " "that may be different from the original bytecode." msgstr "" -#: ../../library/dis.rst:125 +#: ../../library/dis.rst:133 msgid "" "Construct a :class:`Bytecode` instance from the given traceback, setting " "*current_offset* to the instruction responsible for the exception." msgstr "" -#: ../../library/dis.rst:130 +#: ../../library/dis.rst:138 msgid "The compiled code object." msgstr "" -#: ../../library/dis.rst:134 +#: ../../library/dis.rst:142 msgid "The first source line of the code object (if available)" msgstr "" -#: ../../library/dis.rst:138 +#: ../../library/dis.rst:146 msgid "" "Return a formatted view of the bytecode operations (the same as printed by :" "func:`dis.dis`, but returned as a multi-line string)." msgstr "" -#: ../../library/dis.rst:143 +#: ../../library/dis.rst:151 msgid "" "Return a formatted multi-line string with detailed information about the " "code object, like :func:`code_info`." msgstr "" -#: ../../library/dis.rst:146 ../../library/dis.rst:186 -#: ../../library/dis.rst:238 +#: ../../library/dis.rst:154 ../../library/dis.rst:194 +#: ../../library/dis.rst:246 msgid "This can now handle coroutine and asynchronous generator objects." msgstr "" -#: ../../library/dis.rst:149 ../../library/dis.rst:241 -#: ../../library/dis.rst:257 ../../library/dis.rst:284 -#: ../../library/dis.rst:305 +#: ../../library/dis.rst:157 ../../library/dis.rst:249 +#: ../../library/dis.rst:265 ../../library/dis.rst:292 +#: ../../library/dis.rst:313 msgid "Added the *show_caches* and *adaptive* parameters." msgstr "新增 *show_caches* 與 *adaptive* 參數。" -#: ../../library/dis.rst:152 +#: ../../library/dis.rst:160 msgid "Example:" msgstr "範例:" -#: ../../library/dis.rst:168 +#: ../../library/dis.rst:176 msgid "Analysis functions" msgstr "" -#: ../../library/dis.rst:170 +#: ../../library/dis.rst:178 msgid "" "The :mod:`dis` module also defines the following analysis functions that " "convert the input directly to the desired output. They can be useful if only " @@ -210,39 +224,39 @@ msgid "" "isn't useful:" msgstr "" -#: ../../library/dis.rst:176 +#: ../../library/dis.rst:184 msgid "" "Return a formatted multi-line string with detailed code object information " "for the supplied function, generator, asynchronous generator, coroutine, " "method, source code string or code object." msgstr "" -#: ../../library/dis.rst:180 +#: ../../library/dis.rst:188 msgid "" "Note that the exact contents of code info strings are highly implementation " "dependent and they may change arbitrarily across Python VMs or Python " "releases." msgstr "" -#: ../../library/dis.rst:192 +#: ../../library/dis.rst:200 msgid "" "Print detailed code object information for the supplied function, method, " "source code string or code object to *file* (or ``sys.stdout`` if *file* is " "not specified)." msgstr "" -#: ../../library/dis.rst:196 +#: ../../library/dis.rst:204 msgid "" "This is a convenient shorthand for ``print(code_info(x), file=file)``, " "intended for interactive exploration at the interpreter prompt." msgstr "" -#: ../../library/dis.rst:201 ../../library/dis.rst:232 -#: ../../library/dis.rst:254 ../../library/dis.rst:281 +#: ../../library/dis.rst:209 ../../library/dis.rst:240 +#: ../../library/dis.rst:262 ../../library/dis.rst:289 msgid "Added *file* parameter." msgstr "新增 *file* 參數。" -#: ../../library/dis.rst:207 +#: ../../library/dis.rst:215 msgid "" "Disassemble the *x* object. *x* can denote either a module, a class, a " "method, a function, a generator, an asynchronous generator, a coroutine, a " @@ -258,127 +272,127 @@ msgid "" "disassembles the last traceback." msgstr "" -#: ../../library/dis.rst:220 ../../library/dis.rst:251 -#: ../../library/dis.rst:278 +#: ../../library/dis.rst:228 ../../library/dis.rst:259 +#: ../../library/dis.rst:286 msgid "" "The disassembly is written as text to the supplied *file* argument if " "provided and to ``sys.stdout`` otherwise." msgstr "" -#: ../../library/dis.rst:223 +#: ../../library/dis.rst:231 msgid "" "The maximal depth of recursion is limited by *depth* unless it is ``None``. " "``depth=0`` means no recursion." msgstr "" -#: ../../library/dis.rst:226 +#: ../../library/dis.rst:234 msgid "" "If *show_caches* is ``True``, this function will display inline cache " "entries used by the interpreter to specialize the bytecode." msgstr "" -#: ../../library/dis.rst:229 +#: ../../library/dis.rst:237 msgid "" "If *adaptive* is ``True``, this function will display specialized bytecode " "that may be different from the original bytecode." msgstr "" -#: ../../library/dis.rst:235 +#: ../../library/dis.rst:243 msgid "Implemented recursive disassembling and added *depth* parameter." msgstr "" -#: ../../library/dis.rst:247 +#: ../../library/dis.rst:255 msgid "" "Disassemble the top-of-stack function of a traceback, using the last " "traceback if none was passed. The instruction causing the exception is " "indicated." msgstr "" -#: ../../library/dis.rst:264 +#: ../../library/dis.rst:272 msgid "" "Disassemble a code object, indicating the last instruction if *lasti* was " "provided. The output is divided in the following columns:" msgstr "" -#: ../../library/dis.rst:267 +#: ../../library/dis.rst:275 msgid "the line number, for the first instruction of each line" msgstr "" -#: ../../library/dis.rst:268 +#: ../../library/dis.rst:276 msgid "the current instruction, indicated as ``-->``," msgstr "" -#: ../../library/dis.rst:269 +#: ../../library/dis.rst:277 msgid "a labelled instruction, indicated with ``>>``," msgstr "" -#: ../../library/dis.rst:270 +#: ../../library/dis.rst:278 msgid "the address of the instruction," msgstr "" -#: ../../library/dis.rst:271 +#: ../../library/dis.rst:279 msgid "the operation code name," msgstr "" -#: ../../library/dis.rst:272 +#: ../../library/dis.rst:280 msgid "operation parameters, and" msgstr "" -#: ../../library/dis.rst:273 +#: ../../library/dis.rst:281 msgid "interpretation of the parameters in parentheses." msgstr "" -#: ../../library/dis.rst:275 +#: ../../library/dis.rst:283 msgid "" "The parameter interpretation recognizes local and global variable names, " "constant values, branch targets, and compare operators." msgstr "" -#: ../../library/dis.rst:290 +#: ../../library/dis.rst:298 msgid "" "Return an iterator over the instructions in the supplied function, method, " "source code string or code object." msgstr "" -#: ../../library/dis.rst:293 +#: ../../library/dis.rst:301 msgid "" "The iterator generates a series of :class:`Instruction` named tuples giving " "the details of each operation in the supplied code." msgstr "" -#: ../../library/dis.rst:301 +#: ../../library/dis.rst:309 msgid "" "The *show_caches* and *adaptive* parameters work as they do in :func:`dis`." msgstr "" -#: ../../library/dis.rst:311 +#: ../../library/dis.rst:319 msgid "" "This generator function uses the ``co_lines`` method of the code object " "*code* to find the offsets which are starts of lines in the source code. " "They are generated as ``(offset, lineno)`` pairs." msgstr "" -#: ../../library/dis.rst:315 +#: ../../library/dis.rst:323 msgid "Line numbers can be decreasing. Before, they were always increasing." msgstr "" -#: ../../library/dis.rst:318 +#: ../../library/dis.rst:326 msgid "" "The :pep:`626` ``co_lines`` method is used instead of the ``co_firstlineno`` " "and ``co_lnotab`` attributes of the code object." msgstr "" -#: ../../library/dis.rst:325 +#: ../../library/dis.rst:333 msgid "" "Detect all offsets in the raw compiled bytecode string *code* which are jump " "targets, and return a list of these offsets." msgstr "" -#: ../../library/dis.rst:331 +#: ../../library/dis.rst:339 msgid "Compute the stack effect of *opcode* with argument *oparg*." msgstr "" -#: ../../library/dis.rst:333 +#: ../../library/dis.rst:341 msgid "" "If the code has a jump target and *jump* is ``True``, :func:`~stack_effect` " "will return the stack effect of jumping. If *jump* is ``False``, it will " @@ -386,118 +400,122 @@ msgid "" "it will return the maximal stack effect of both cases." msgstr "" -#: ../../library/dis.rst:340 +#: ../../library/dis.rst:348 msgid "Added *jump* parameter." msgstr "新增 *jump* 參數。" -#: ../../library/dis.rst:347 +#: ../../library/dis.rst:355 msgid "Python Bytecode Instructions" msgstr "" -#: ../../library/dis.rst:349 +#: ../../library/dis.rst:357 msgid "" "The :func:`get_instructions` function and :class:`Bytecode` class provide " "details of bytecode instructions as :class:`Instruction` instances:" msgstr "" -#: ../../library/dis.rst:354 +#: ../../library/dis.rst:362 msgid "Details for a bytecode operation" msgstr "" -#: ../../library/dis.rst:358 +#: ../../library/dis.rst:366 msgid "" "numeric code for operation, corresponding to the opcode values listed below " "and the bytecode values in the :ref:`opcode_collections`." msgstr "" -#: ../../library/dis.rst:364 +#: ../../library/dis.rst:372 msgid "human readable name for operation" msgstr "" -#: ../../library/dis.rst:369 +#: ../../library/dis.rst:377 msgid "numeric argument to operation (if any), otherwise ``None``" msgstr "" -#: ../../library/dis.rst:374 +#: ../../library/dis.rst:382 msgid "resolved arg value (if any), otherwise ``None``" msgstr "" -#: ../../library/dis.rst:379 +#: ../../library/dis.rst:387 msgid "" "human readable description of operation argument (if any), otherwise an " "empty string." msgstr "" -#: ../../library/dis.rst:385 +#: ../../library/dis.rst:393 msgid "start index of operation within bytecode sequence" msgstr "" -#: ../../library/dis.rst:390 +#: ../../library/dis.rst:398 msgid "line started by this opcode (if any), otherwise ``None``" msgstr "" -#: ../../library/dis.rst:395 +#: ../../library/dis.rst:403 msgid "``True`` if other code jumps to here, otherwise ``False``" msgstr "" -#: ../../library/dis.rst:400 +#: ../../library/dis.rst:408 msgid "" ":class:`dis.Positions` object holding the start and end locations that are " "covered by this instruction." msgstr "" -#: ../../library/dis.rst:407 +#: ../../library/dis.rst:415 msgid "Field ``positions`` is added." msgstr "" -#: ../../library/dis.rst:412 +#: ../../library/dis.rst:420 msgid "" "In case the information is not available, some fields might be ``None``." msgstr "" -#: ../../library/dis.rst:422 +#: ../../library/dis.rst:430 msgid "" "The Python compiler currently generates the following bytecode instructions." msgstr "" -#: ../../library/dis.rst:425 +#: ../../library/dis.rst:433 msgid "**General instructions**" msgstr "" -#: ../../library/dis.rst:427 +#: ../../library/dis.rst:435 msgid "" "In the following, We will refer to the interpreter stack as ``STACK`` and " "describe operations on it as if it was a Python list. The top of the stack " "corresponds to ``STACK[-1]`` in this language." msgstr "" -#: ../../library/dis.rst:433 +#: ../../library/dis.rst:441 msgid "" "Do nothing code. Used as a placeholder by the bytecode optimizer, and to " "generate line tracing events." msgstr "" -#: ../../library/dis.rst:439 +#: ../../library/dis.rst:447 msgid "Removes the top-of-stack item::" msgstr "" -#: ../../library/dis.rst:446 +#: ../../library/dis.rst:454 msgid "" "Removes the top two values from the stack. Equivalent to ``POP_TOP``; " "``POP_TOP``. Used to clean up at the end of loops, hence the name." msgstr "" -#: ../../library/dis.rst:455 +#: ../../library/dis.rst:463 +msgid "Implements ``del STACK[-2]``. Used to clean up when a generator exits." +msgstr "" + +#: ../../library/dis.rst:471 msgid "" "Push the i-th item to the top of the stack without removing it from its " "original location::" msgstr "" -#: ../../library/dis.rst:466 +#: ../../library/dis.rst:482 msgid "Swap the top of the stack with the i-th element::" msgstr "" -#: ../../library/dis.rst:475 +#: ../../library/dis.rst:491 msgid "" "Rather than being an actual instruction, this opcode is used to mark extra " "space for the interpreter to cache useful data directly in the bytecode " @@ -505,91 +523,91 @@ msgid "" "viewed with ``show_caches=True``." msgstr "" -#: ../../library/dis.rst:480 +#: ../../library/dis.rst:496 msgid "" "Logically, this space is part of the preceding instruction. Many opcodes " "expect to be followed by an exact number of caches, and will instruct the " "interpreter to skip over them at runtime." msgstr "" -#: ../../library/dis.rst:484 +#: ../../library/dis.rst:500 msgid "" "Populated caches can look like arbitrary instructions, so great care should " "be taken when reading or modifying raw, adaptive bytecode containing " "quickened data." msgstr "" -#: ../../library/dis.rst:491 +#: ../../library/dis.rst:507 msgid "**Unary operations**" msgstr "" -#: ../../library/dis.rst:493 +#: ../../library/dis.rst:509 msgid "" "Unary operations take the top of the stack, apply the operation, and push " "the result back on the stack." msgstr "" -#: ../../library/dis.rst:499 +#: ../../library/dis.rst:515 msgid "Implements ``STACK[-1] = -STACK[-1]``." msgstr "" -#: ../../library/dis.rst:504 +#: ../../library/dis.rst:520 msgid "Implements ``STACK[-1] = not STACK[-1]``." msgstr "" -#: ../../library/dis.rst:509 +#: ../../library/dis.rst:525 msgid "Implements ``STACK[-1] = ~STACK[-1]``." msgstr "" -#: ../../library/dis.rst:514 +#: ../../library/dis.rst:530 msgid "Implements ``STACK[-1] = iter(STACK[-1])``." msgstr "" -#: ../../library/dis.rst:519 +#: ../../library/dis.rst:535 msgid "" "If ``STACK[-1]`` is a :term:`generator iterator` or :term:`coroutine` object " "it is left as is. Otherwise, implements ``STACK[-1] = iter(STACK[-1])``." msgstr "" -#: ../../library/dis.rst:525 +#: ../../library/dis.rst:541 msgid "**Binary and in-place operations**" msgstr "" -#: ../../library/dis.rst:527 +#: ../../library/dis.rst:543 msgid "" "Binary operations remove the top two items from the stack (``STACK[-1]`` and " "``STACK[-2]``). They perform the operation, then put the result back on the " "stack." msgstr "" -#: ../../library/dis.rst:530 +#: ../../library/dis.rst:546 msgid "" "In-place operations are like binary operations, but the operation is done in-" "place when ``STACK[-2]`` supports it, and the resulting ``STACK[-1]`` may be " "(but does not have to be) the original ``STACK[-2]``." msgstr "" -#: ../../library/dis.rst:537 +#: ../../library/dis.rst:553 msgid "" "Implements the binary and in-place operators (depending on the value of " "*op*)::" msgstr "" -#: ../../library/dis.rst:549 ../../library/dis.rst:558 -#: ../../library/dis.rst:568 ../../library/dis.rst:576 -#: ../../library/dis.rst:588 ../../library/dis.rst:676 -#: ../../library/dis.rst:686 ../../library/dis.rst:696 -#: ../../library/dis.rst:916 ../../library/dis.rst:927 -#: ../../library/dis.rst:1027 ../../library/dis.rst:1039 -#: ../../library/dis.rst:1051 +#: ../../library/dis.rst:565 ../../library/dis.rst:574 +#: ../../library/dis.rst:584 ../../library/dis.rst:592 +#: ../../library/dis.rst:604 ../../library/dis.rst:692 +#: ../../library/dis.rst:702 ../../library/dis.rst:712 +#: ../../library/dis.rst:932 ../../library/dis.rst:943 +#: ../../library/dis.rst:1043 ../../library/dis.rst:1055 +#: ../../library/dis.rst:1067 msgid "Implements::" msgstr "" -#: ../../library/dis.rst:599 +#: ../../library/dis.rst:615 msgid "**Coroutine opcodes**" msgstr "" -#: ../../library/dis.rst:603 +#: ../../library/dis.rst:619 msgid "" "Implements ``STACK[-1] = get_awaitable(STACK[-1])``, where " "``get_awaitable(o)`` returns ``o`` if ``o`` is a coroutine object or a " @@ -597,39 +615,39 @@ msgid "" "resolves ``o.__await__``." msgstr "" -#: ../../library/dis.rst:608 +#: ../../library/dis.rst:624 msgid "" "If the ``where`` operand is nonzero, it indicates where the instruction " "occurs:" msgstr "" -#: ../../library/dis.rst:611 +#: ../../library/dis.rst:627 msgid "``1``: After a call to ``__aenter__``" msgstr "" -#: ../../library/dis.rst:612 +#: ../../library/dis.rst:628 msgid "``2``: After a call to ``__aexit__``" msgstr "" -#: ../../library/dis.rst:616 +#: ../../library/dis.rst:632 msgid "Previously, this instruction did not have an oparg." msgstr "" -#: ../../library/dis.rst:622 +#: ../../library/dis.rst:638 msgid "Implements ``STACK[-1] = STACK[-1].__aiter__()``." msgstr "" -#: ../../library/dis.rst:625 +#: ../../library/dis.rst:641 msgid "Returning awaitable objects from ``__aiter__`` is no longer supported." msgstr "" -#: ../../library/dis.rst:632 +#: ../../library/dis.rst:648 msgid "" "Implement ``STACK.append(get_awaitable(STACK[-1].__anext__()))`` to the " "stack. See ``GET_AWAITABLE`` for details about ``get_awaitable``." msgstr "" -#: ../../library/dis.rst:640 +#: ../../library/dis.rst:656 msgid "" "Terminates an :keyword:`async for` loop. Handles an exception raised when " "awaiting a next item. The stack contains the async iterable in ``STACK[-2]`` " @@ -637,13 +655,13 @@ msgid "" "is not :exc:`StopAsyncIteration`, it is re-raised." msgstr "" -#: ../../library/dis.rst:647 ../../library/dis.rst:752 -#: ../../library/dis.rst:763 +#: ../../library/dis.rst:663 ../../library/dis.rst:768 +#: ../../library/dis.rst:779 msgid "" "Exception representation on the stack now consist of one, not three, items." msgstr "" -#: ../../library/dis.rst:653 +#: ../../library/dis.rst:669 msgid "" "Handles an exception raised during a :meth:`~generator.throw` or :meth:" "`~generator.close` call through the current frame. If ``STACK[-1]`` is an " @@ -651,35 +669,35 @@ msgid "" "its ``value`` member. Otherwise, re-raise ``STACK[-1]``." msgstr "" -#: ../../library/dis.rst:663 +#: ../../library/dis.rst:679 msgid "" "Resolves ``__aenter__`` and ``__aexit__`` from ``STACK[-1]``. Pushes " "``__aexit__`` and result of ``__aenter__()`` to the stack::" msgstr "" -#: ../../library/dis.rst:672 +#: ../../library/dis.rst:688 msgid "**Miscellaneous opcodes**" msgstr "" -#: ../../library/dis.rst:681 +#: ../../library/dis.rst:697 msgid "Used to implement set comprehensions." msgstr "" -#: ../../library/dis.rst:691 +#: ../../library/dis.rst:707 msgid "Used to implement list comprehensions." msgstr "" -#: ../../library/dis.rst:702 +#: ../../library/dis.rst:718 msgid "Used to implement dict comprehensions." msgstr "" -#: ../../library/dis.rst:705 +#: ../../library/dis.rst:721 msgid "" "Map value is ``STACK[-1]`` and map key is ``STACK[-2]``. Before, those were " "reversed." msgstr "" -#: ../../library/dis.rst:709 +#: ../../library/dis.rst:725 msgid "" "For all of the :opcode:`SET_ADD`, :opcode:`LIST_APPEND` and :opcode:" "`MAP_ADD` instructions, while the added value or key/value pair is popped " @@ -687,29 +705,29 @@ msgid "" "further iterations of the loop." msgstr "" -#: ../../library/dis.rst:717 +#: ../../library/dis.rst:733 msgid "Returns with ``STACK[-1]`` to the caller of the function." msgstr "" -#: ../../library/dis.rst:722 +#: ../../library/dis.rst:738 msgid "Returns with ``co_consts[consti]`` to the caller of the function." msgstr "" -#: ../../library/dis.rst:729 +#: ../../library/dis.rst:745 msgid "Yields ``STACK.pop()`` from a :term:`generator`." msgstr "" -#: ../../library/dis.rst:731 +#: ../../library/dis.rst:747 msgid "oparg set to be the stack depth." msgstr "" -#: ../../library/dis.rst:734 +#: ../../library/dis.rst:750 msgid "" "oparg set to be the exception block depth, for efficient closing of " "generators." msgstr "" -#: ../../library/dis.rst:740 +#: ../../library/dis.rst:756 msgid "" "Checks whether ``__annotations__`` is defined in ``locals()``, if not it is " "set up to an empty ``dict``. This opcode is only emitted if a class or " @@ -717,39 +735,39 @@ msgid "" "statically." msgstr "" -#: ../../library/dis.rst:750 +#: ../../library/dis.rst:766 msgid "" "Pops a value from the stack, which is used to restore the exception state." msgstr "" -#: ../../library/dis.rst:757 +#: ../../library/dis.rst:773 msgid "" "Re-raises the exception currently on top of the stack. If oparg is non-zero, " "pops an additional value from the stack which is used to set ``f_lasti`` of " "the current frame." msgstr "" -#: ../../library/dis.rst:768 +#: ../../library/dis.rst:784 msgid "" "Pops a value from the stack. Pushes the current exception to the top of the " "stack. Pushes the value originally popped back to the stack. Used in " "exception handlers." msgstr "" -#: ../../library/dis.rst:776 +#: ../../library/dis.rst:792 msgid "" "Performs exception matching for ``except``. Tests whether the ``STACK[-2]`` " "is an exception matching ``STACK[-1]``. Pops ``STACK[-1]`` and pushes the " "boolean result of the test." msgstr "" -#: ../../library/dis.rst:784 +#: ../../library/dis.rst:800 msgid "" "Performs exception matching for ``except*``. Applies ``split(STACK[-1])`` on " "the exception group representing ``STACK[-2]``." msgstr "" -#: ../../library/dis.rst:787 +#: ../../library/dis.rst:803 msgid "" "In case of a match, pops two items from the stack and pushes the non-" "matching subgroup (``None`` in case of full match) followed by the matching " @@ -757,7 +775,7 @@ msgid "" "``None``." msgstr "" -#: ../../library/dis.rst:796 +#: ../../library/dis.rst:812 msgid "" "Calls the function in position 4 on the stack with arguments (type, val, tb) " "representing the exception at the top of the stack. Used to implement the " @@ -765,25 +783,25 @@ msgid "" "occurred in a :keyword:`with` statement." msgstr "" -#: ../../library/dis.rst:803 +#: ../../library/dis.rst:819 msgid "" "The ``__exit__`` function is in position 4 of the stack rather than 7. " "Exception representation on the stack now consist of one, not three, items." msgstr "" -#: ../../library/dis.rst:810 +#: ../../library/dis.rst:826 msgid "" "Pushes :exc:`AssertionError` onto the stack. Used by the :keyword:`assert` " "statement." msgstr "" -#: ../../library/dis.rst:818 +#: ../../library/dis.rst:834 msgid "" "Pushes :func:`!builtins.__build_class__` onto the stack. It is later called " "to construct a class." msgstr "" -#: ../../library/dis.rst:824 +#: ../../library/dis.rst:840 msgid "" "This opcode performs several operations before a with block starts. First, " "it loads :meth:`~object.__exit__` from the context manager and pushes it " @@ -792,11 +810,11 @@ msgid "" "``__enter__()`` method is pushed onto the stack." msgstr "" -#: ../../library/dis.rst:835 +#: ../../library/dis.rst:851 msgid "Perform ``STACK.append(len(STACK[-1]))``." msgstr "" -#: ../../library/dis.rst:842 +#: ../../library/dis.rst:858 msgid "" "If ``STACK[-1]`` is an instance of :class:`collections.abc.Mapping` (or, " "more technically: if it has the :c:macro:`Py_TPFLAGS_MAPPING` flag set in " @@ -804,7 +822,7 @@ msgid "" "Otherwise, push ``False``." msgstr "" -#: ../../library/dis.rst:852 +#: ../../library/dis.rst:868 msgid "" "If ``STACK[-1]`` is an instance of :class:`collections.abc.Sequence` and is " "*not* an instance of :class:`str`/:class:`bytes`/:class:`bytearray` (or, " @@ -813,20 +831,20 @@ msgid "" "Otherwise, push ``False``." msgstr "" -#: ../../library/dis.rst:862 +#: ../../library/dis.rst:878 msgid "" "``STACK[-1]`` is a tuple of mapping keys, and ``STACK[-2]`` is the match " "subject. If ``STACK[-2]`` contains all of the keys in ``STACK[-1]``, push a :" "class:`tuple` containing the corresponding values. Otherwise, push ``None``." msgstr "" -#: ../../library/dis.rst:868 ../../library/dis.rst:1489 +#: ../../library/dis.rst:884 ../../library/dis.rst:1511 msgid "" "Previously, this instruction also pushed a boolean value indicating success " "(``True``) or failure (``False``)." msgstr "" -#: ../../library/dis.rst:875 +#: ../../library/dis.rst:891 msgid "" "Implements ``name = STACK.pop()``. *namei* is the index of *name* in the " "attribute :attr:`!co_names` of the :ref:`code object `. The " @@ -834,19 +852,19 @@ msgid "" "possible." msgstr "" -#: ../../library/dis.rst:882 +#: ../../library/dis.rst:898 msgid "" "Implements ``del name``, where *namei* is the index into :attr:`!co_names` " "attribute of the :ref:`code object `." msgstr "" -#: ../../library/dis.rst:888 +#: ../../library/dis.rst:904 msgid "" "Unpacks ``STACK[-1]`` into *count* individual values, which are put onto the " "stack right-to-left. Require there to be exactly *count* values.::" msgstr "" -#: ../../library/dis.rst:897 +#: ../../library/dis.rst:913 msgid "" "Implements assignment with a starred target: Unpacks an iterable in " "``STACK[-1]`` into individual values, where the total number of values can " @@ -854,11 +872,11 @@ msgid "" "will be a list of all leftover items." msgstr "" -#: ../../library/dis.rst:902 +#: ../../library/dis.rst:918 msgid "The number of values before and after the list value is limited to 255." msgstr "" -#: ../../library/dis.rst:904 +#: ../../library/dis.rst:920 msgid "" "The number of values before the list value is encoded in the argument of the " "opcode. The number of values after the list if any is encoded using an " @@ -867,50 +885,50 @@ msgid "" "list value, the high byte of *counts* the number of values after it." msgstr "" -#: ../../library/dis.rst:910 +#: ../../library/dis.rst:926 msgid "" "The extracted values are put onto the stack right-to-left, i.e. ``a, *b, c = " "d`` will be stored after execution as ``STACK.extend((a, b, c))``." msgstr "" -#: ../../library/dis.rst:922 +#: ../../library/dis.rst:938 msgid "" "where *namei* is the index of name in :attr:`!co_names` of the :ref:`code " "object `." msgstr "" -#: ../../library/dis.rst:932 +#: ../../library/dis.rst:948 msgid "" "where *namei* is the index of name into :attr:`!co_names` of the :ref:`code " "object `." msgstr "" -#: ../../library/dis.rst:938 +#: ../../library/dis.rst:954 msgid "Works as :opcode:`STORE_NAME`, but stores the name as a global." msgstr "" -#: ../../library/dis.rst:943 +#: ../../library/dis.rst:959 msgid "Works as :opcode:`DELETE_NAME`, but deletes a global name." msgstr "" -#: ../../library/dis.rst:948 +#: ../../library/dis.rst:964 msgid "Pushes ``co_consts[consti]`` onto the stack." msgstr "" -#: ../../library/dis.rst:953 +#: ../../library/dis.rst:969 msgid "" "Pushes the value associated with ``co_names[namei]`` onto the stack. The " "name is looked up within the locals, then the globals, then the builtins." msgstr "" -#: ../../library/dis.rst:959 +#: ../../library/dis.rst:975 msgid "" "Pushes a reference to the locals dictionary onto the stack. This is used to " "prepare namespace dictionaries for :opcode:`LOAD_FROM_DICT_OR_DEREF` and :" "opcode:`LOAD_FROM_DICT_OR_GLOBALS`." msgstr "" -#: ../../library/dis.rst:968 +#: ../../library/dis.rst:984 msgid "" "Pops a mapping off the stack and looks up the value for ``co_names[namei]``. " "If the name is not found there, looks it up in the globals and then the " @@ -919,69 +937,69 @@ msgid "" "bodies." msgstr "" -#: ../../library/dis.rst:979 +#: ../../library/dis.rst:995 msgid "" "Creates a tuple consuming *count* items from the stack, and pushes the " "resulting tuple onto the stack.::" msgstr "" -#: ../../library/dis.rst:989 +#: ../../library/dis.rst:1005 msgid "Works as :opcode:`BUILD_TUPLE`, but creates a list." msgstr "" -#: ../../library/dis.rst:994 +#: ../../library/dis.rst:1010 msgid "Works as :opcode:`BUILD_TUPLE`, but creates a set." msgstr "" -#: ../../library/dis.rst:999 +#: ../../library/dis.rst:1015 msgid "" "Pushes a new dictionary object onto the stack. Pops ``2 * count`` items so " "that the dictionary holds *count* entries: ``{..., STACK[-4]: STACK[-3], " "STACK[-2]: STACK[-1]}``." msgstr "" -#: ../../library/dis.rst:1003 +#: ../../library/dis.rst:1019 msgid "" "The dictionary is created from stack items instead of creating an empty " "dictionary pre-sized to hold *count* items." msgstr "" -#: ../../library/dis.rst:1010 +#: ../../library/dis.rst:1026 msgid "" "The version of :opcode:`BUILD_MAP` specialized for constant keys. Pops the " "top element on the stack which contains a tuple of keys, then starting from " "``STACK[-2]``, pops *count* values to form values in the built dictionary." msgstr "" -#: ../../library/dis.rst:1019 +#: ../../library/dis.rst:1035 msgid "" "Concatenates *count* strings from the stack and pushes the resulting string " "onto the stack." msgstr "" -#: ../../library/dis.rst:1032 +#: ../../library/dis.rst:1048 msgid "Used to build lists." msgstr "" -#: ../../library/dis.rst:1044 +#: ../../library/dis.rst:1060 msgid "Used to build sets." msgstr "" -#: ../../library/dis.rst:1056 +#: ../../library/dis.rst:1072 msgid "Used to build dicts." msgstr "" -#: ../../library/dis.rst:1063 +#: ../../library/dis.rst:1079 msgid "Like :opcode:`DICT_UPDATE` but raises an exception for duplicate keys." msgstr "" -#: ../../library/dis.rst:1070 +#: ../../library/dis.rst:1086 msgid "" "If the low bit of ``namei`` is not set, this replaces ``STACK[-1]`` with " "``getattr(STACK[-1], co_names[namei>>1])``." msgstr "" -#: ../../library/dis.rst:1073 +#: ../../library/dis.rst:1089 msgid "" "If the low bit of ``namei`` is set, this will attempt to load a method named " "``co_names[namei>>1]`` from the ``STACK[-1]`` object. ``STACK[-1]`` is " @@ -992,49 +1010,60 @@ msgid "" "the object returned by the attribute lookup are pushed." msgstr "" -#: ../../library/dis.rst:1081 +#: ../../library/dis.rst:1097 msgid "" "If the low bit of ``namei`` is set, then a ``NULL`` or ``self`` is pushed to " "the stack before the attribute or unbound method respectively." msgstr "" -#: ../../library/dis.rst:1088 +#: ../../library/dis.rst:1104 +msgid "" +"This opcode implements :func:`super`, both in its zero-argument and two-" +"argument forms (e.g. ``super().method()``, ``super().attr`` and ``super(cls, " +"self).method()``, ``super(cls, self).attr``)." +msgstr "" + +#: ../../library/dis.rst:1108 +msgid "" +"It pops three values from the stack (from top of stack down): - ``self``: " +"the first argument to the current method - ``cls``: the class within which " +"the current method was defined - the global ``super``" +msgstr "" + +#: ../../library/dis.rst:1113 msgid "" -"This opcode implements :func:`super` (e.g. ``super().method()`` and " -"``super().attr``). It works the same as :opcode:`LOAD_ATTR`, except that " -"``namei`` is shifted left by 2 bits instead of 1, and instead of expecting a " -"single receiver on the stack, it expects three objects (from top of stack " -"down): ``self`` (the first argument to the current method), ``cls`` (the " -"class within which the current method was defined), and the global ``super``." +"With respect to its argument, it works similarly to :opcode:`LOAD_ATTR`, " +"except that ``namei`` is shifted left by 2 bits instead of 1." msgstr "" -#: ../../library/dis.rst:1095 +#: ../../library/dis.rst:1116 msgid "" "The low bit of ``namei`` signals to attempt a method load, as with :opcode:" -"`LOAD_ATTR`." +"`LOAD_ATTR`, which results in pushing ``None`` and the loaded method. When " +"it is unset a single value is pushed to the stack." msgstr "" -#: ../../library/dis.rst:1098 +#: ../../library/dis.rst:1120 msgid "" "The second-low bit of ``namei``, if set, means that this was a two-argument " "call to :func:`super` (unset means zero-argument)." msgstr "" -#: ../../library/dis.rst:1106 +#: ../../library/dis.rst:1128 msgid "" "Performs a Boolean operation. The operation name can be found in " "``cmp_op[opname]``." msgstr "" -#: ../../library/dis.rst:1112 +#: ../../library/dis.rst:1134 msgid "Performs ``is`` comparison, or ``is not`` if ``invert`` is 1." msgstr "" -#: ../../library/dis.rst:1119 +#: ../../library/dis.rst:1141 msgid "Performs ``in`` comparison, or ``not in`` if ``invert`` is 1." msgstr "" -#: ../../library/dis.rst:1126 +#: ../../library/dis.rst:1148 msgid "" "Imports the module ``co_names[namei]``. ``STACK[-1]`` and ``STACK[-2]`` are " "popped and provide the *fromlist* and *level* arguments of :func:" @@ -1043,68 +1072,68 @@ msgid "" "opcode:`STORE_FAST` instruction modifies the namespace." msgstr "" -#: ../../library/dis.rst:1134 +#: ../../library/dis.rst:1156 msgid "" "Loads the attribute ``co_names[namei]`` from the module found in " "``STACK[-1]``. The resulting object is pushed onto the stack, to be " "subsequently stored by a :opcode:`STORE_FAST` instruction." msgstr "" -#: ../../library/dis.rst:1141 +#: ../../library/dis.rst:1163 msgid "Increments bytecode counter by *delta*." msgstr "" -#: ../../library/dis.rst:1146 +#: ../../library/dis.rst:1168 msgid "Decrements bytecode counter by *delta*. Checks for interrupts." msgstr "" -#: ../../library/dis.rst:1153 +#: ../../library/dis.rst:1175 msgid "Decrements bytecode counter by *delta*. Does not check for interrupts." msgstr "" -#: ../../library/dis.rst:1160 +#: ../../library/dis.rst:1182 msgid "" "If ``STACK[-1]`` is true, increments the bytecode counter by *delta*. " "``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1163 ../../library/dis.rst:1176 +#: ../../library/dis.rst:1185 ../../library/dis.rst:1198 msgid "" "The oparg is now a relative delta rather than an absolute target. This " "opcode is a pseudo-instruction, replaced in final bytecode by the directed " "versions (forward/backward)." msgstr "" -#: ../../library/dis.rst:1168 ../../library/dis.rst:1181 -#: ../../library/dis.rst:1194 ../../library/dis.rst:1208 +#: ../../library/dis.rst:1190 ../../library/dis.rst:1203 +#: ../../library/dis.rst:1216 ../../library/dis.rst:1230 msgid "This is no longer a pseudo-instruction." msgstr "" -#: ../../library/dis.rst:1173 +#: ../../library/dis.rst:1195 msgid "" "If ``STACK[-1]`` is false, increments the bytecode counter by *delta*. " "``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1186 +#: ../../library/dis.rst:1208 msgid "" "If ``STACK[-1]`` is not ``None``, increments the bytecode counter by " "*delta*. ``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1189 ../../library/dis.rst:1203 +#: ../../library/dis.rst:1211 ../../library/dis.rst:1225 msgid "" "This opcode is a pseudo-instruction, replaced in final bytecode by the " "directed versions (forward/backward)." msgstr "" -#: ../../library/dis.rst:1200 +#: ../../library/dis.rst:1222 msgid "" "If ``STACK[-1]`` is ``None``, increments the bytecode counter by *delta*. " "``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1213 +#: ../../library/dis.rst:1235 msgid "" "``STACK[-1]`` is an :term:`iterator`. Call its :meth:`~iterator.__next__` " "method. If this yields a new value, push it on the stack (leaving the " @@ -1112,83 +1141,83 @@ msgid "" "code counter is incremented by *delta*." msgstr "" -#: ../../library/dis.rst:1218 +#: ../../library/dis.rst:1240 msgid "Up until 3.11 the iterator was popped when it was exhausted." msgstr "" -#: ../../library/dis.rst:1223 +#: ../../library/dis.rst:1245 msgid "Loads the global named ``co_names[namei>>1]`` onto the stack." msgstr "" -#: ../../library/dis.rst:1225 +#: ../../library/dis.rst:1247 msgid "" "If the low bit of ``namei`` is set, then a ``NULL`` is pushed to the stack " "before the global variable." msgstr "" -#: ../../library/dis.rst:1231 +#: ../../library/dis.rst:1253 msgid "" "Pushes a reference to the local ``co_varnames[var_num]`` onto the stack." msgstr "" -#: ../../library/dis.rst:1233 +#: ../../library/dis.rst:1255 msgid "" "This opcode is now only used in situations where the local variable is " "guaranteed to be initialized. It cannot raise :exc:`UnboundLocalError`." msgstr "" -#: ../../library/dis.rst:1239 +#: ../../library/dis.rst:1261 msgid "" "Pushes a reference to the local ``co_varnames[var_num]`` onto the stack, " "raising an :exc:`UnboundLocalError` if the local variable has not been " "initialized." msgstr "" -#: ../../library/dis.rst:1247 +#: ../../library/dis.rst:1269 msgid "" "Pushes a reference to the local ``co_varnames[var_num]`` onto the stack (or " "pushes ``NULL`` onto the stack if the local variable has not been " "initialized) and sets ``co_varnames[var_num]`` to ``NULL``." msgstr "" -#: ../../library/dis.rst:1255 +#: ../../library/dis.rst:1277 msgid "Stores ``STACK.pop()`` into the local ``co_varnames[var_num]``." msgstr "" -#: ../../library/dis.rst:1260 +#: ../../library/dis.rst:1282 msgid "Deletes local ``co_varnames[var_num]``." msgstr "" -#: ../../library/dis.rst:1265 +#: ../../library/dis.rst:1287 msgid "" "Creates a new cell in slot ``i``. If that slot is nonempty then that value " "is stored into the new cell." msgstr "" -#: ../../library/dis.rst:1273 +#: ../../library/dis.rst:1295 msgid "" "Pushes a reference to the cell contained in slot ``i`` of the \"fast " "locals\" storage. The name of the variable is ``co_fastlocalnames[i]``." msgstr "" -#: ../../library/dis.rst:1276 +#: ../../library/dis.rst:1298 msgid "" "Note that ``LOAD_CLOSURE`` is effectively an alias for ``LOAD_FAST``. It " "exists to keep bytecode a little more readable." msgstr "" -#: ../../library/dis.rst:1279 ../../library/dis.rst:1288 -#: ../../library/dis.rst:1310 ../../library/dis.rst:1321 +#: ../../library/dis.rst:1301 ../../library/dis.rst:1310 +#: ../../library/dis.rst:1332 ../../library/dis.rst:1343 msgid "``i`` is no longer offset by the length of ``co_varnames``." msgstr "" -#: ../../library/dis.rst:1285 +#: ../../library/dis.rst:1307 msgid "" "Loads the cell contained in slot ``i`` of the \"fast locals\" storage. " "Pushes a reference to the object the cell contains on the stack." msgstr "" -#: ../../library/dis.rst:1294 +#: ../../library/dis.rst:1316 msgid "" "Pops a mapping off the stack and looks up the name associated with slot " "``i`` of the \"fast locals\" storage in this mapping. If the name is not " @@ -1198,94 +1227,94 @@ msgid "" "scopes ` within class bodies." msgstr "" -#: ../../library/dis.rst:1307 +#: ../../library/dis.rst:1329 msgid "" "Stores ``STACK.pop()`` into the cell contained in slot ``i`` of the \"fast " "locals\" storage." msgstr "" -#: ../../library/dis.rst:1316 +#: ../../library/dis.rst:1338 msgid "" "Empties the cell contained in slot ``i`` of the \"fast locals\" storage. " "Used by the :keyword:`del` statement." msgstr "" -#: ../../library/dis.rst:1327 +#: ../../library/dis.rst:1349 msgid "" "Copies the ``n`` free variables from the closure into the frame. Removes the " "need for special code on the caller's side when calling closures." msgstr "" -#: ../../library/dis.rst:1336 +#: ../../library/dis.rst:1358 msgid "" "Raises an exception using one of the 3 forms of the ``raise`` statement, " "depending on the value of *argc*:" msgstr "" -#: ../../library/dis.rst:1339 +#: ../../library/dis.rst:1361 msgid "0: ``raise`` (re-raise previous exception)" msgstr "" -#: ../../library/dis.rst:1340 +#: ../../library/dis.rst:1362 msgid "" "1: ``raise STACK[-1]`` (raise exception instance or type at ``STACK[-1]``)" msgstr "" -#: ../../library/dis.rst:1341 +#: ../../library/dis.rst:1363 msgid "" "2: ``raise STACK[-2] from STACK[-1]`` (raise exception instance or type at " "``STACK[-2]`` with ``__cause__`` set to ``STACK[-1]``)" msgstr "" -#: ../../library/dis.rst:1347 +#: ../../library/dis.rst:1369 msgid "" "Calls a callable object with the number of arguments specified by ``argc``, " "including the named arguments specified by the preceding :opcode:`KW_NAMES`, " "if any. On the stack are (in ascending order), either:" msgstr "" -#: ../../library/dis.rst:1352 +#: ../../library/dis.rst:1374 msgid "NULL" msgstr "" -#: ../../library/dis.rst:1353 ../../library/dis.rst:1359 +#: ../../library/dis.rst:1375 ../../library/dis.rst:1381 msgid "The callable" msgstr "" -#: ../../library/dis.rst:1354 +#: ../../library/dis.rst:1376 msgid "The positional arguments" msgstr "" -#: ../../library/dis.rst:1355 ../../library/dis.rst:1362 +#: ../../library/dis.rst:1377 ../../library/dis.rst:1384 msgid "The named arguments" msgstr "" -#: ../../library/dis.rst:1357 +#: ../../library/dis.rst:1379 msgid "or:" msgstr "或:" -#: ../../library/dis.rst:1360 +#: ../../library/dis.rst:1382 msgid "``self``" msgstr "``self``" -#: ../../library/dis.rst:1361 +#: ../../library/dis.rst:1383 msgid "The remaining positional arguments" msgstr "" -#: ../../library/dis.rst:1364 +#: ../../library/dis.rst:1386 msgid "" "``argc`` is the total of the positional and named arguments, excluding " "``self`` when a ``NULL`` is not present." msgstr "" -#: ../../library/dis.rst:1367 +#: ../../library/dis.rst:1389 msgid "" "``CALL`` pops all arguments and the callable object off the stack, calls the " "callable object with those arguments, and pushes the return value returned " "by the callable object." msgstr "" -#: ../../library/dis.rst:1376 +#: ../../library/dis.rst:1398 msgid "" "Calls a callable object with variable set of positional and keyword " "arguments. If the lowest bit of *flags* is set, the top of the stack " @@ -1297,70 +1326,70 @@ msgid "" "arguments, and pushes the return value returned by the callable object." msgstr "" -#: ../../library/dis.rst:1391 +#: ../../library/dis.rst:1413 msgid "" "Pushes a ``NULL`` to the stack. Used in the call sequence to match the " "``NULL`` pushed by :opcode:`LOAD_METHOD` for non-method calls." msgstr "" -#: ../../library/dis.rst:1400 +#: ../../library/dis.rst:1422 msgid "" "Prefixes :opcode:`CALL`. Stores a reference to ``co_consts[consti]`` into an " "internal variable for use by :opcode:`CALL`. ``co_consts[consti]`` must be a " "tuple of strings." msgstr "" -#: ../../library/dis.rst:1409 +#: ../../library/dis.rst:1431 msgid "" "Pushes a new function object on the stack. From bottom to top, the consumed " "stack must consist of values if the argument carries a specified flag value" msgstr "" -#: ../../library/dis.rst:1412 +#: ../../library/dis.rst:1434 msgid "" "``0x01`` a tuple of default values for positional-only and positional-or-" "keyword parameters in positional order" msgstr "" -#: ../../library/dis.rst:1414 +#: ../../library/dis.rst:1436 msgid "``0x02`` a dictionary of keyword-only parameters' default values" msgstr "" -#: ../../library/dis.rst:1415 +#: ../../library/dis.rst:1437 msgid "``0x04`` a tuple of strings containing parameters' annotations" msgstr "" -#: ../../library/dis.rst:1416 +#: ../../library/dis.rst:1438 msgid "``0x08`` a tuple containing cells for free variables, making a closure" msgstr "" -#: ../../library/dis.rst:1417 +#: ../../library/dis.rst:1439 msgid "the code associated with the function (at ``STACK[-1]``)" msgstr "" -#: ../../library/dis.rst:1419 +#: ../../library/dis.rst:1441 msgid "Flag value ``0x04`` is a tuple of strings instead of dictionary" msgstr "" -#: ../../library/dis.rst:1422 +#: ../../library/dis.rst:1444 msgid "Qualified name at ``STACK[-1]`` was removed." msgstr "" -#: ../../library/dis.rst:1430 +#: ../../library/dis.rst:1452 msgid "" "Pushes a slice object on the stack. *argc* must be 2 or 3. If it is 2, " "implements::" msgstr "" -#: ../../library/dis.rst:1436 +#: ../../library/dis.rst:1458 msgid "if it is 3, implements::" msgstr "" -#: ../../library/dis.rst:1443 +#: ../../library/dis.rst:1465 msgid "See the :func:`slice` built-in function for more information." msgstr "" -#: ../../library/dis.rst:1448 +#: ../../library/dis.rst:1470 msgid "" "Prefixes any opcode which has an argument too big to fit into the default " "one byte. *ext* holds an additional byte which act as higher bits in the " @@ -1368,54 +1397,54 @@ msgid "" "allowed, forming an argument from two-byte to four-byte." msgstr "" -#: ../../library/dis.rst:1456 +#: ../../library/dis.rst:1478 msgid "" "Used for implementing formatted literal strings (f-strings). Pops an " "optional *fmt_spec* from the stack, then a required *value*. *flags* is " "interpreted as follows:" msgstr "" -#: ../../library/dis.rst:1460 +#: ../../library/dis.rst:1482 msgid "``(flags & 0x03) == 0x00``: *value* is formatted as-is." msgstr "" -#: ../../library/dis.rst:1461 +#: ../../library/dis.rst:1483 msgid "" "``(flags & 0x03) == 0x01``: call :func:`str` on *value* before formatting it." msgstr "" -#: ../../library/dis.rst:1463 +#: ../../library/dis.rst:1485 msgid "" "``(flags & 0x03) == 0x02``: call :func:`repr` on *value* before formatting " "it." msgstr "" -#: ../../library/dis.rst:1465 +#: ../../library/dis.rst:1487 msgid "" "``(flags & 0x03) == 0x03``: call :func:`ascii` on *value* before formatting " "it." msgstr "" -#: ../../library/dis.rst:1467 +#: ../../library/dis.rst:1489 msgid "" "``(flags & 0x04) == 0x04``: pop *fmt_spec* from the stack and use it, else " "use an empty *fmt_spec*." msgstr "" -#: ../../library/dis.rst:1470 +#: ../../library/dis.rst:1492 msgid "" "Formatting is performed using :c:func:`PyObject_Format`. The result is " "pushed on the stack." msgstr "" -#: ../../library/dis.rst:1478 +#: ../../library/dis.rst:1500 msgid "" "``STACK[-1]`` is a tuple of keyword attribute names, ``STACK[-2]`` is the " "class being matched against, and ``STACK[-3]`` is the match subject. " "*count* is the number of positional sub-patterns." msgstr "" -#: ../../library/dis.rst:1482 +#: ../../library/dis.rst:1504 msgid "" "Pop ``STACK[-1]``, ``STACK[-2]``, and ``STACK[-3]``. If ``STACK[-3]`` is an " "instance of ``STACK[-2]`` and has the positional and keyword attributes " @@ -1423,258 +1452,257 @@ msgid "" "Otherwise, push ``None``." msgstr "" -#: ../../library/dis.rst:1496 +#: ../../library/dis.rst:1518 msgid "A no-op. Performs internal tracing, debugging and optimization checks." msgstr "" -#: ../../library/dis.rst:1498 +#: ../../library/dis.rst:1520 msgid "The ``where`` operand marks where the ``RESUME`` occurs:" msgstr "" -#: ../../library/dis.rst:1500 +#: ../../library/dis.rst:1522 msgid "" "``0`` The start of a function, which is neither a generator, coroutine nor " "an async generator" msgstr "" -#: ../../library/dis.rst:1502 +#: ../../library/dis.rst:1524 msgid "``1`` After a ``yield`` expression" msgstr "" -#: ../../library/dis.rst:1503 +#: ../../library/dis.rst:1525 msgid "``2`` After a ``yield from`` expression" msgstr "" -#: ../../library/dis.rst:1504 +#: ../../library/dis.rst:1526 msgid "``3`` After an ``await`` expression" msgstr "" -#: ../../library/dis.rst:1511 +#: ../../library/dis.rst:1533 msgid "" "Create a generator, coroutine, or async generator from the current frame. " "Used as first opcode of in code object for the above mentioned callables. " "Clear the current frame and return the newly created generator." msgstr "" -#: ../../library/dis.rst:1520 +#: ../../library/dis.rst:1542 msgid "" "Equivalent to ``STACK[-1] = STACK[-2].send(STACK[-1])``. Used in ``yield " "from`` and ``await`` statements." msgstr "" -#: ../../library/dis.rst:1523 +#: ../../library/dis.rst:1545 msgid "" -"If the call raises :exc:`StopIteration`, pop both items, push the " -"exception's ``value`` attribute, and increment the bytecode counter by " -"*delta*." +"If the call raises :exc:`StopIteration`, pop the top value from the stack, " +"push the exception's ``value`` attribute, and increment the bytecode counter " +"by *delta*." msgstr "" -#: ../../library/dis.rst:1532 +#: ../../library/dis.rst:1554 msgid "" "This is not really an opcode. It identifies the dividing line between " "opcodes in the range [0,255] which don't use their argument and those that " "do (``< HAVE_ARGUMENT`` and ``>= HAVE_ARGUMENT``, respectively)." msgstr "" -#: ../../library/dis.rst:1536 +#: ../../library/dis.rst:1558 msgid "" "If your application uses pseudo instructions, use the :data:`hasarg` " "collection instead." msgstr "" -#: ../../library/dis.rst:1539 +#: ../../library/dis.rst:1561 msgid "" "Now every instruction has an argument, but opcodes ``< HAVE_ARGUMENT`` " "ignore it. Before, only opcodes ``>= HAVE_ARGUMENT`` had an argument." msgstr "" -#: ../../library/dis.rst:1543 +#: ../../library/dis.rst:1565 msgid "" "Pseudo instructions were added to the :mod:`dis` module, and for them it is " "not true that comparison with ``HAVE_ARGUMENT`` indicates whether they use " "their arg." msgstr "" -#: ../../library/dis.rst:1551 +#: ../../library/dis.rst:1573 msgid "" "Calls an intrinsic function with one argument. Passes ``STACK[-1]`` as the " "argument and sets ``STACK[-1]`` to the result. Used to implement " -"functionality that is necessary but not performance critical." +"functionality that is not performance critical." msgstr "" -#: ../../library/dis.rst:1555 ../../library/dis.rst:1605 +#: ../../library/dis.rst:1577 ../../library/dis.rst:1631 msgid "The operand determines which intrinsic function is called:" msgstr "" -#: ../../library/dis.rst:1558 ../../library/dis.rst:1608 +#: ../../library/dis.rst:1580 ../../library/dis.rst:1634 msgid "Operand" msgstr "" -#: ../../library/dis.rst:1558 ../../library/dis.rst:1608 +#: ../../library/dis.rst:1580 ../../library/dis.rst:1634 msgid "Description" msgstr "" -#: ../../library/dis.rst:1560 +#: ../../library/dis.rst:1582 msgid "``INTRINSIC_1_INVALID``" msgstr "``INTRINSIC_1_INVALID``" -#: ../../library/dis.rst:1560 ../../library/dis.rst:1610 +#: ../../library/dis.rst:1582 ../../library/dis.rst:1636 msgid "Not valid" msgstr "" -#: ../../library/dis.rst:1562 +#: ../../library/dis.rst:1584 msgid "``INTRINSIC_PRINT``" msgstr "``INTRINSIC_PRINT``" -#: ../../library/dis.rst:1562 +#: ../../library/dis.rst:1584 msgid "Prints the argument to standard out. Used in the REPL." msgstr "" -#: ../../library/dis.rst:1565 +#: ../../library/dis.rst:1587 msgid "``INTRINSIC_IMPORT_STAR``" msgstr "``INTRINSIC_IMPORT_STAR``" -#: ../../library/dis.rst:1565 +#: ../../library/dis.rst:1587 msgid "Performs ``import *`` for the named module." msgstr "" -#: ../../library/dis.rst:1568 +#: ../../library/dis.rst:1590 msgid "``INTRINSIC_STOPITERATION_ERROR``" msgstr "``INTRINSIC_STOPITERATION_ERROR``" -#: ../../library/dis.rst:1568 +#: ../../library/dis.rst:1590 msgid "Extracts the return value from a ``StopIteration`` exception." msgstr "" -#: ../../library/dis.rst:1571 +#: ../../library/dis.rst:1593 msgid "``INTRINSIC_ASYNC_GEN_WRAP``" msgstr "``INTRINSIC_ASYNC_GEN_WRAP``" -#: ../../library/dis.rst:1571 +#: ../../library/dis.rst:1593 msgid "Wraps an aync generator value" msgstr "" -#: ../../library/dis.rst:1573 +#: ../../library/dis.rst:1595 msgid "``INTRINSIC_UNARY_POSITIVE``" msgstr "``INTRINSIC_UNARY_POSITIVE``" -#: ../../library/dis.rst:1573 +#: ../../library/dis.rst:1595 msgid "Performs the unary ``+`` operation" msgstr "" -#: ../../library/dis.rst:1576 +#: ../../library/dis.rst:1598 msgid "``INTRINSIC_LIST_TO_TUPLE``" msgstr "``INTRINSIC_LIST_TO_TUPLE``" -#: ../../library/dis.rst:1576 +#: ../../library/dis.rst:1598 msgid "Converts a list to a tuple" msgstr "" -#: ../../library/dis.rst:1578 +#: ../../library/dis.rst:1600 msgid "``INTRINSIC_TYPEVAR``" msgstr "``INTRINSIC_TYPEVAR``" -#: ../../library/dis.rst:1578 +#: ../../library/dis.rst:1600 msgid "Creates a :class:`typing.TypeVar`" msgstr "" -#: ../../library/dis.rst:1580 +#: ../../library/dis.rst:1602 msgid "``INTRINSIC_PARAMSPEC``" msgstr "``INTRINSIC_PARAMSPEC``" -#: ../../library/dis.rst:1580 +#: ../../library/dis.rst:1602 msgid "Creates a :class:`typing.ParamSpec`" msgstr "" -#: ../../library/dis.rst:1583 +#: ../../library/dis.rst:1605 msgid "``INTRINSIC_TYPEVARTUPLE``" msgstr "``INTRINSIC_TYPEVARTUPLE``" -#: ../../library/dis.rst:1583 +#: ../../library/dis.rst:1605 msgid "Creates a :class:`typing.TypeVarTuple`" msgstr "" -#: ../../library/dis.rst:1586 +#: ../../library/dis.rst:1608 msgid "``INTRINSIC_SUBSCRIPT_GENERIC``" msgstr "``INTRINSIC_SUBSCRIPT_GENERIC``" -#: ../../library/dis.rst:1586 +#: ../../library/dis.rst:1608 msgid "Returns :class:`typing.Generic` subscripted with the argument" msgstr "" -#: ../../library/dis.rst:1589 +#: ../../library/dis.rst:1611 msgid "``INTRINSIC_TYPEALIAS``" msgstr "``INTRINSIC_TYPEALIAS``" -#: ../../library/dis.rst:1589 +#: ../../library/dis.rst:1611 msgid "" "Creates a :class:`typing.TypeAliasType`; used in the :keyword:`type` " "statement. The argument is a tuple of the type alias's name, type " "parameters, and value." msgstr "" -#: ../../library/dis.rst:1601 +#: ../../library/dis.rst:1623 msgid "" -"Calls an intrinsic function with two arguments. Passes ``STACK[-2]``, " -"``STACK[-1]`` as the arguments and sets ``STACK[-1]`` to the result. Used to " -"implement functionality that is necessary but not performance critical." +"Calls an intrinsic function with two arguments. Used to implement " +"functionality that is not performance critical::" msgstr "" -#: ../../library/dis.rst:1610 +#: ../../library/dis.rst:1636 msgid "``INTRINSIC_2_INVALID``" msgstr "``INTRINSIC_2_INVALID``" -#: ../../library/dis.rst:1612 +#: ../../library/dis.rst:1638 msgid "``INTRINSIC_PREP_RERAISE_STAR``" msgstr "``INTRINSIC_PREP_RERAISE_STAR``" -#: ../../library/dis.rst:1612 +#: ../../library/dis.rst:1638 msgid "Calculates the :exc:`ExceptionGroup` to raise from a ``try-except*``." msgstr "" -#: ../../library/dis.rst:1616 +#: ../../library/dis.rst:1642 msgid "``INTRINSIC_TYPEVAR_WITH_BOUND``" msgstr "``INTRINSIC_TYPEVAR_WITH_BOUND``" -#: ../../library/dis.rst:1616 +#: ../../library/dis.rst:1642 msgid "Creates a :class:`typing.TypeVar` with a bound." msgstr "" -#: ../../library/dis.rst:1619 +#: ../../library/dis.rst:1645 msgid "``INTRINSIC_TYPEVAR_WITH_CONSTRAINTS``" msgstr "``INTRINSIC_TYPEVAR_WITH_CONSTRAINTS``" -#: ../../library/dis.rst:1619 +#: ../../library/dis.rst:1645 msgid "Creates a :class:`typing.TypeVar` with constraints." msgstr "" -#: ../../library/dis.rst:1623 +#: ../../library/dis.rst:1649 msgid "``INTRINSIC_SET_FUNCTION_TYPE_PARAMS``" msgstr "``INTRINSIC_SET_FUNCTION_TYPE_PARAMS``" -#: ../../library/dis.rst:1623 +#: ../../library/dis.rst:1649 msgid "Sets the ``__type_params__`` attribute of a function." msgstr "" -#: ../../library/dis.rst:1630 +#: ../../library/dis.rst:1656 msgid "**Pseudo-instructions**" msgstr "" -#: ../../library/dis.rst:1632 +#: ../../library/dis.rst:1658 msgid "" "These opcodes do not appear in Python bytecode. They are used by the " "compiler but are replaced by real opcodes or removed before bytecode is " "generated." msgstr "" -#: ../../library/dis.rst:1637 +#: ../../library/dis.rst:1663 msgid "" "Set up an exception handler for the following code block. If an exception " "occurs, the value stack level is restored to its current state and control " "is transferred to the exception handler at ``target``." msgstr "" -#: ../../library/dis.rst:1644 +#: ../../library/dis.rst:1670 msgid "" "Like ``SETUP_FINALLY``, but in case of an exception also pushes the last " "instruction (``lasti``) to the stack so that ``RERAISE`` can restore it. If " @@ -1683,75 +1711,76 @@ msgid "" "exception handler at ``target``." msgstr "" -#: ../../library/dis.rst:1653 +#: ../../library/dis.rst:1679 msgid "" "Like ``SETUP_CLEANUP``, but in case of an exception one more item is popped " "from the stack before control is transferred to the exception handler at " "``target``." msgstr "" -#: ../../library/dis.rst:1657 +#: ../../library/dis.rst:1683 msgid "" "This variant is used in :keyword:`with` and :keyword:`async with` " "constructs, which push the return value of the context manager's :meth:" "`~object.__enter__` or :meth:`~object.__aenter__` to the stack." msgstr "" -#: ../../library/dis.rst:1664 +#: ../../library/dis.rst:1690 msgid "" "Marks the end of the code block associated with the last ``SETUP_FINALLY``, " "``SETUP_CLEANUP`` or ``SETUP_WITH``." msgstr "" -#: ../../library/dis.rst:1670 +#: ../../library/dis.rst:1696 msgid "" "Undirected relative jump instructions which are replaced by their directed " "(forward/backward) counterparts by the assembler." msgstr "" -#: ../../library/dis.rst:1675 +#: ../../library/dis.rst:1701 msgid "" "Optimized unbound method lookup. Emitted as a ``LOAD_ATTR`` opcode with a " "flag set in the arg." msgstr "" -#: ../../library/dis.rst:1682 +#: ../../library/dis.rst:1708 msgid "Opcode collections" msgstr "" -#: ../../library/dis.rst:1684 +#: ../../library/dis.rst:1710 msgid "" "These collections are provided for automatic introspection of bytecode " "instructions:" msgstr "" -#: ../../library/dis.rst:1687 +#: ../../library/dis.rst:1713 msgid "" -"The collections now contain pseudo instructions as well. These are opcodes " -"with values ``>= MIN_PSEUDO_OPCODE``." +"The collections now contain pseudo instructions and instrumented " +"instructions as well. These are opcodes with values ``>= MIN_PSEUDO_OPCODE`` " +"and ``>= MIN_INSTRUMENTED_OPCODE``." msgstr "" -#: ../../library/dis.rst:1693 +#: ../../library/dis.rst:1720 msgid "Sequence of operation names, indexable using the bytecode." msgstr "" -#: ../../library/dis.rst:1698 +#: ../../library/dis.rst:1725 msgid "Dictionary mapping operation names to bytecodes." msgstr "" -#: ../../library/dis.rst:1703 +#: ../../library/dis.rst:1730 msgid "Sequence of all compare operation names." msgstr "" -#: ../../library/dis.rst:1708 +#: ../../library/dis.rst:1735 msgid "Sequence of bytecodes that use their argument." msgstr "" -#: ../../library/dis.rst:1715 +#: ../../library/dis.rst:1742 msgid "Sequence of bytecodes that access a constant." msgstr "" -#: ../../library/dis.rst:1720 +#: ../../library/dis.rst:1747 msgid "" "Sequence of bytecodes that access a free variable. 'free' in this context " "refers to names in the current scope that are referenced by inner scopes or " @@ -1759,34 +1788,34 @@ msgid "" "include references to global or builtin scopes." msgstr "" -#: ../../library/dis.rst:1728 +#: ../../library/dis.rst:1755 msgid "Sequence of bytecodes that access an attribute by name." msgstr "" -#: ../../library/dis.rst:1733 +#: ../../library/dis.rst:1760 msgid "Sequence of bytecodes that have a relative jump target." msgstr "" -#: ../../library/dis.rst:1738 +#: ../../library/dis.rst:1765 msgid "Sequence of bytecodes that have an absolute jump target." msgstr "" -#: ../../library/dis.rst:1743 +#: ../../library/dis.rst:1770 msgid "Sequence of bytecodes that access a local variable." msgstr "" -#: ../../library/dis.rst:1748 +#: ../../library/dis.rst:1775 msgid "Sequence of bytecodes of Boolean operations." msgstr "" -#: ../../library/dis.rst:1752 +#: ../../library/dis.rst:1779 msgid "Sequence of bytecodes that set an exception handler." msgstr "" -#: ../../library/dis.rst:1428 +#: ../../library/dis.rst:1450 msgid "built-in function" msgstr "built-in function(內建函式)" -#: ../../library/dis.rst:1428 +#: ../../library/dis.rst:1450 msgid "slice" msgstr "slice(切片)" diff --git a/library/doctest.po b/library/doctest.po index 60db19b76a..64c365b17f 100644 --- a/library/doctest.po +++ b/library/doctest.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-10-20 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:43+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -240,42 +240,59 @@ msgstr "" #: ../../library/doctest.rst:280 msgid "" -"In addition, if ``M.__test__`` exists and \"is true\", it must be a dict, " -"and each entry maps a (string) name to a function object, class object, or " -"string. Function and class object docstrings found from ``M.__test__`` are " -"searched, and strings are treated as if they were docstrings. In output, a " -"key ``K`` in ``M.__test__`` appears with name ::" +"In addition, there are cases when you want tests to be part of a module but " +"not part of the help text, which requires that the tests not be included in " +"the docstring. Doctest looks for a module-level variable called ``__test__`` " +"and uses it to locate other tests. If ``M.__test__`` exists and is truthy, " +"it must be a dict, and each entry maps a (string) name to a function object, " +"class object, or string. Function and class object docstrings found from ``M." +"__test__`` are searched, and strings are treated as if they were " +"docstrings. In output, a key ``K`` in ``M.__test__`` appears with name ``M." +"__test__.K``." msgstr "" -#: ../../library/doctest.rst:288 +#: ../../library/doctest.rst:289 +msgid "For example, place this block of code at the top of :file:`example.py`:" +msgstr "" + +#: ../../library/doctest.rst:303 +msgid "" +"The value of ``example.__test__[\"numbers\"]`` will be treated as a " +"docstring and all the tests inside it will be run. It is important to note " +"that the value can be mapped to a function, class object, or module; if so, :" +"mod:`!doctest` searches them recursively for docstrings, which are then " +"scanned for tests." +msgstr "" + +#: ../../library/doctest.rst:309 msgid "" "Any classes found are recursively searched similarly, to test docstrings in " "their contained methods and nested classes." msgstr "" -#: ../../library/doctest.rst:295 +#: ../../library/doctest.rst:316 msgid "How are Docstring Examples Recognized?" msgstr "" -#: ../../library/doctest.rst:297 +#: ../../library/doctest.rst:318 msgid "" "In most cases a copy-and-paste of an interactive console session works fine, " "but doctest isn't trying to do an exact emulation of any specific Python " "shell." msgstr "" -#: ../../library/doctest.rst:322 +#: ../../library/doctest.rst:343 msgid "" "Any expected output must immediately follow the final ``'>>> '`` or ``'... " "'`` line containing the code, and the expected output (if any) extends to " "the next ``'>>> '`` or all-whitespace line." msgstr "" -#: ../../library/doctest.rst:326 +#: ../../library/doctest.rst:347 msgid "The fine print:" msgstr "" -#: ../../library/doctest.rst:328 +#: ../../library/doctest.rst:349 msgid "" "Expected output cannot contain an all-whitespace line, since such a line is " "taken to signal the end of expected output. If expected output does contain " @@ -283,7 +300,7 @@ msgid "" "line is expected." msgstr "" -#: ../../library/doctest.rst:333 +#: ../../library/doctest.rst:354 msgid "" "All hard tab characters are expanded to spaces, using 8-column tab stops. " "Tabs in output generated by the tested code are not modified. Because any " @@ -298,20 +315,20 @@ msgid "" "`DocTestParser` class." msgstr "" -#: ../../library/doctest.rst:345 +#: ../../library/doctest.rst:366 msgid "" "Output to stdout is captured, but not output to stderr (exception tracebacks " "are captured via a different means)." msgstr "" -#: ../../library/doctest.rst:348 +#: ../../library/doctest.rst:369 msgid "" "If you continue a line via backslashing in an interactive session, or for " "any other reason use a backslash, you should use a raw docstring, which will " "preserve your backslashes exactly as you type them::" msgstr "" -#: ../../library/doctest.rst:358 +#: ../../library/doctest.rst:379 msgid "" "Otherwise, the backslash will be interpreted as part of the string. For " "example, the ``\\n`` above would be interpreted as a newline character. " @@ -319,21 +336,21 @@ msgid "" "use a raw string)::" msgstr "" -#: ../../library/doctest.rst:368 +#: ../../library/doctest.rst:389 msgid "The starting column doesn't matter::" msgstr "" -#: ../../library/doctest.rst:375 +#: ../../library/doctest.rst:396 msgid "" "and as many leading whitespace characters are stripped from the expected " "output as appeared in the initial ``'>>> '`` line that started the example." msgstr "" -#: ../../library/doctest.rst:382 +#: ../../library/doctest.rst:403 msgid "What's the Execution Context?" msgstr "" -#: ../../library/doctest.rst:384 +#: ../../library/doctest.rst:405 msgid "" "By default, each time :mod:`doctest` finds a docstring to test, it uses a " "*shallow copy* of :mod:`M`'s globals, so that running tests doesn't change " @@ -344,17 +361,17 @@ msgid "" "defined in other docstrings." msgstr "" -#: ../../library/doctest.rst:392 +#: ../../library/doctest.rst:413 msgid "" "You can force use of your own dict as the execution context by passing " "``globs=your_dict`` to :func:`testmod` or :func:`testfile` instead." msgstr "" -#: ../../library/doctest.rst:399 +#: ../../library/doctest.rst:420 msgid "What About Exceptions?" msgstr "" -#: ../../library/doctest.rst:401 +#: ../../library/doctest.rst:422 msgid "" "No problem, provided that the traceback is the only output produced by the " "example: just paste in the traceback. [#]_ Since tracebacks contain details " @@ -363,34 +380,34 @@ msgid "" "it accepts." msgstr "" -#: ../../library/doctest.rst:407 +#: ../../library/doctest.rst:428 msgid "Simple example::" msgstr "" "簡單範例:\n" "\n" "::" -#: ../../library/doctest.rst:414 +#: ../../library/doctest.rst:435 msgid "" "That doctest succeeds if :exc:`ValueError` is raised, with the ``list." "remove(x): x not in list`` detail as shown." msgstr "" -#: ../../library/doctest.rst:417 +#: ../../library/doctest.rst:438 msgid "" "The expected output for an exception must start with a traceback header, " "which may be either of the following two lines, indented the same as the " "first line of the example::" msgstr "" -#: ../../library/doctest.rst:424 +#: ../../library/doctest.rst:445 msgid "" "The traceback header is followed by an optional traceback stack, whose " "contents are ignored by doctest. The traceback stack is typically omitted, " "or copied verbatim from an interactive session." msgstr "" -#: ../../library/doctest.rst:428 +#: ../../library/doctest.rst:449 msgid "" "The traceback stack is followed by the most interesting part: the line(s) " "containing the exception type and detail. This is usually the last line of " @@ -398,20 +415,20 @@ msgid "" "multi-line detail::" msgstr "" -#: ../../library/doctest.rst:440 +#: ../../library/doctest.rst:461 msgid "" "The last three lines (starting with :exc:`ValueError`) are compared against " "the exception's type and detail, and the rest are ignored." msgstr "" -#: ../../library/doctest.rst:443 +#: ../../library/doctest.rst:464 msgid "" "Best practice is to omit the traceback stack, unless it adds significant " "documentation value to the example. So the last example is probably better " "as::" msgstr "" -#: ../../library/doctest.rst:453 +#: ../../library/doctest.rst:474 msgid "" "Note that tracebacks are treated very specially. In particular, in the " "rewritten example, the use of ``...`` is independent of doctest's :const:" @@ -420,11 +437,11 @@ msgid "" "transcript of a Monty Python skit." msgstr "" -#: ../../library/doctest.rst:459 +#: ../../library/doctest.rst:480 msgid "Some details you should read once, but won't need to remember:" msgstr "" -#: ../../library/doctest.rst:461 +#: ../../library/doctest.rst:482 msgid "" "Doctest can't guess whether your expected output came from an exception " "traceback or from ordinary printing. So, e.g., an example that expects " @@ -434,7 +451,7 @@ msgid "" "create real problems." msgstr "" -#: ../../library/doctest.rst:468 +#: ../../library/doctest.rst:489 msgid "" "Each line of the traceback stack (if present) must be indented further than " "the first line of the example, *or* start with a non-alphanumeric character. " @@ -443,14 +460,14 @@ msgid "" "course this does the right thing for genuine tracebacks." msgstr "" -#: ../../library/doctest.rst:474 +#: ../../library/doctest.rst:495 msgid "" "When the :const:`IGNORE_EXCEPTION_DETAIL` doctest option is specified, " "everything following the leftmost colon and any module information in the " "exception name is ignored." msgstr "" -#: ../../library/doctest.rst:478 +#: ../../library/doctest.rst:499 msgid "" "The interactive shell omits the traceback header line for some :exc:" "`SyntaxError`\\ s. But doctest uses the traceback header line to " @@ -459,13 +476,13 @@ msgid "" "need to manually add the traceback header line to your test example." msgstr "" -#: ../../library/doctest.rst:486 +#: ../../library/doctest.rst:507 msgid "" "For some exceptions, Python displays the position of the error using ``^`` " "markers and tildes::" msgstr "" -#: ../../library/doctest.rst:495 +#: ../../library/doctest.rst:516 msgid "" "Since the lines showing the position of the error come before the exception " "type and detail, they are not checked by doctest. For example, the " @@ -473,11 +490,11 @@ msgid "" "location::" msgstr "" -#: ../../library/doctest.rst:510 +#: ../../library/doctest.rst:531 msgid "Option Flags" msgstr "" -#: ../../library/doctest.rst:512 +#: ../../library/doctest.rst:533 msgid "" "A number of option flags control various aspects of doctest's behavior. " "Symbolic names for the flags are supplied as module constants, which can be :" @@ -487,17 +504,17 @@ msgid "" "option." msgstr "" -#: ../../library/doctest.rst:518 +#: ../../library/doctest.rst:539 msgid "The ``-o`` command line option." msgstr "" -#: ../../library/doctest.rst:521 +#: ../../library/doctest.rst:542 msgid "" "The first group of options define test semantics, controlling aspects of how " "doctest decides whether actual output matches an example's expected output:" msgstr "" -#: ../../library/doctest.rst:527 +#: ../../library/doctest.rst:548 msgid "" "By default, if an expected output block contains just ``1``, an actual " "output block containing just ``1`` or just ``True`` is considered to be a " @@ -509,7 +526,7 @@ msgid "" "not for several years." msgstr "" -#: ../../library/doctest.rst:539 +#: ../../library/doctest.rst:560 msgid "" "By default, if an expected output block contains a line containing only the " "string ````, then that line will match a blank line in the actual " @@ -518,7 +535,7 @@ msgid "" "`DONT_ACCEPT_BLANKLINE` is specified, this substitution is not allowed." msgstr "" -#: ../../library/doctest.rst:548 +#: ../../library/doctest.rst:569 msgid "" "When specified, all sequences of whitespace (blanks and newlines) are " "treated as equal. Any sequence of whitespace within the expected output " @@ -528,7 +545,7 @@ msgid "" "across multiple lines in your source." msgstr "" -#: ../../library/doctest.rst:559 +#: ../../library/doctest.rst:580 msgid "" "When specified, an ellipsis marker (``...``) in the expected output can " "match any substring in the actual output. This includes substrings that " @@ -537,14 +554,14 @@ msgid "" "matched too much!\" surprises that ``.*`` is prone to in regular expressions." msgstr "" -#: ../../library/doctest.rst:568 +#: ../../library/doctest.rst:589 msgid "" "When specified, doctests expecting exceptions pass so long as an exception " "of the expected type is raised, even if the details (message and fully " "qualified exception name) don't match." msgstr "" -#: ../../library/doctest.rst:572 +#: ../../library/doctest.rst:593 msgid "" "For example, an example expecting ``ValueError: 42`` will pass if the actual " "exception raised is ``ValueError: 3*14``, but will fail if, say, a :exc:" @@ -554,20 +571,20 @@ msgid "" "these variations will work with the flag specified:" msgstr "" -#: ../../library/doctest.rst:594 +#: ../../library/doctest.rst:615 msgid "" "Note that :const:`ELLIPSIS` can also be used to ignore the details of the " "exception message, but such a test may still fail based on whether the " "module name is present or matches exactly." msgstr "" -#: ../../library/doctest.rst:598 +#: ../../library/doctest.rst:619 msgid "" ":const:`IGNORE_EXCEPTION_DETAIL` now also ignores any information relating " "to the module containing the exception under test." msgstr "" -#: ../../library/doctest.rst:605 +#: ../../library/doctest.rst:626 msgid "" "When specified, do not run the example at all. This can be useful in " "contexts where doctest examples serve as both documentation and test cases, " @@ -576,32 +593,32 @@ msgid "" "might depend on resources which would be unavailable to the test driver." msgstr "" -#: ../../library/doctest.rst:611 +#: ../../library/doctest.rst:632 msgid "" "The SKIP flag can also be used for temporarily \"commenting out\" examples." msgstr "" -#: ../../library/doctest.rst:616 +#: ../../library/doctest.rst:637 msgid "A bitmask or'ing together all the comparison flags above." msgstr "" -#: ../../library/doctest.rst:618 +#: ../../library/doctest.rst:639 msgid "The second group of options controls how test failures are reported:" msgstr "" -#: ../../library/doctest.rst:623 +#: ../../library/doctest.rst:644 msgid "" "When specified, failures that involve multi-line expected and actual outputs " "are displayed using a unified diff." msgstr "" -#: ../../library/doctest.rst:629 +#: ../../library/doctest.rst:650 msgid "" "When specified, failures that involve multi-line expected and actual outputs " "will be displayed using a context diff." msgstr "" -#: ../../library/doctest.rst:635 +#: ../../library/doctest.rst:656 msgid "" "When specified, differences are computed by ``difflib.Differ``, using the " "same algorithm as the popular :file:`ndiff.py` utility. This is the only " @@ -611,7 +628,7 @@ msgid "" "mismatching column positions." msgstr "" -#: ../../library/doctest.rst:644 +#: ../../library/doctest.rst:665 msgid "" "When specified, display the first failing example in each doctest, but " "suppress output for all remaining examples. This will prevent doctest from " @@ -622,7 +639,7 @@ msgid "" "of failures reported; only the output is suppressed." msgstr "" -#: ../../library/doctest.rst:655 +#: ../../library/doctest.rst:676 msgid "" "When specified, exit after the first failing example and don't attempt to " "run the remaining examples. Thus, the number of failures reported will be at " @@ -630,23 +647,23 @@ msgid "" "first failure won't even produce debugging output." msgstr "" -#: ../../library/doctest.rst:660 +#: ../../library/doctest.rst:681 msgid "" "The doctest command line accepts the option ``-f`` as a shorthand for ``-o " "FAIL_FAST``." msgstr "" -#: ../../library/doctest.rst:668 +#: ../../library/doctest.rst:689 msgid "A bitmask or'ing together all the reporting flags above." msgstr "" -#: ../../library/doctest.rst:671 +#: ../../library/doctest.rst:692 msgid "" "There is also a way to register new option flag names, though this isn't " "useful unless you intend to extend :mod:`doctest` internals via subclassing:" msgstr "" -#: ../../library/doctest.rst:677 +#: ../../library/doctest.rst:698 msgid "" "Create a new option flag with a given name, and return the new flag's " "integer value. :func:`register_optionflag` can be used when subclassing :" @@ -655,35 +672,35 @@ msgid "" "be called using the following idiom::" msgstr "" -#: ../../library/doctest.rst:693 +#: ../../library/doctest.rst:714 msgid "Directives" msgstr "" -#: ../../library/doctest.rst:695 +#: ../../library/doctest.rst:716 msgid "" "Doctest directives may be used to modify the :ref:`option flags ` for an individual example. Doctest directives are special Python " "comments following an example's source code:" msgstr "" -#: ../../library/doctest.rst:706 +#: ../../library/doctest.rst:727 msgid "" "Whitespace is not allowed between the ``+`` or ``-`` and the directive " "option name. The directive option name can be any of the option flag names " "explained above." msgstr "" -#: ../../library/doctest.rst:710 +#: ../../library/doctest.rst:731 msgid "" "An example's doctest directives modify doctest's behavior for that single " "example. Use ``+`` to enable the named behavior, or ``-`` to disable it." msgstr "" -#: ../../library/doctest.rst:713 +#: ../../library/doctest.rst:734 msgid "For example, this test passes:" msgstr "" -#: ../../library/doctest.rst:722 +#: ../../library/doctest.rst:743 msgid "" "Without the directive it would fail, both because the actual output doesn't " "have two blanks before the single-digit list elements, and because the " @@ -691,26 +708,26 @@ msgid "" "a directive to do so:" msgstr "" -#: ../../library/doctest.rst:733 +#: ../../library/doctest.rst:754 msgid "" "Multiple directives can be used on a single physical line, separated by " "commas:" msgstr "" -#: ../../library/doctest.rst:742 +#: ../../library/doctest.rst:763 msgid "" "If multiple directive comments are used for a single example, then they are " "combined:" msgstr "" -#: ../../library/doctest.rst:752 +#: ../../library/doctest.rst:773 msgid "" "As the previous example shows, you can add ``...`` lines to your example " "containing only directives. This can be useful when an example is too long " "for a directive to comfortably fit on the same line:" msgstr "" -#: ../../library/doctest.rst:763 +#: ../../library/doctest.rst:784 msgid "" "Note that since all options are disabled by default, and directives apply " "only to the example they appear in, enabling options (via ``+`` in a " @@ -720,11 +737,11 @@ msgid "" "be useful." msgstr "" -#: ../../library/doctest.rst:773 +#: ../../library/doctest.rst:794 msgid "Warnings" msgstr "" -#: ../../library/doctest.rst:775 +#: ../../library/doctest.rst:796 msgid "" ":mod:`doctest` is serious about requiring exact matches in expected output. " "If even a single character doesn't match, the test fails. This will " @@ -734,51 +751,51 @@ msgid "" "test like ::" msgstr "" -#: ../../library/doctest.rst:784 +#: ../../library/doctest.rst:805 msgid "is vulnerable! One workaround is to do ::" msgstr "" -#: ../../library/doctest.rst:789 +#: ../../library/doctest.rst:810 msgid "instead. Another is to do ::" msgstr "" -#: ../../library/doctest.rst:795 +#: ../../library/doctest.rst:816 msgid "There are others, but you get the idea." msgstr "" -#: ../../library/doctest.rst:797 +#: ../../library/doctest.rst:818 msgid "Another bad idea is to print things that embed an object address, like" msgstr "" -#: ../../library/doctest.rst:807 +#: ../../library/doctest.rst:828 msgid "" "The :const:`ELLIPSIS` directive gives a nice approach for the last example:" msgstr "" -#: ../../library/doctest.rst:815 +#: ../../library/doctest.rst:836 msgid "" "Floating-point numbers are also subject to small output variations across " "platforms, because Python defers to the platform C library for float " "formatting, and C libraries vary widely in quality here. ::" msgstr "" -#: ../../library/doctest.rst:826 +#: ../../library/doctest.rst:847 msgid "" "Numbers of the form ``I/2.**J`` are safe across all platforms, and I often " "contrive doctest examples to produce numbers of that form::" msgstr "" -#: ../../library/doctest.rst:832 +#: ../../library/doctest.rst:853 msgid "" "Simple fractions are also easier for people to understand, and that makes " "for better documentation." msgstr "" -#: ../../library/doctest.rst:839 +#: ../../library/doctest.rst:860 msgid "Basic API" msgstr "" -#: ../../library/doctest.rst:841 +#: ../../library/doctest.rst:862 msgid "" "The functions :func:`testmod` and :func:`testfile` provide a simple " "interface to doctest that should be sufficient for most basic uses. For a " @@ -786,25 +803,25 @@ msgid "" "simple-testmod` and :ref:`doctest-simple-testfile`." msgstr "" -#: ../../library/doctest.rst:849 +#: ../../library/doctest.rst:870 msgid "" "All arguments except *filename* are optional, and should be specified in " "keyword form." msgstr "" -#: ../../library/doctest.rst:852 +#: ../../library/doctest.rst:873 msgid "" "Test examples in the file named *filename*. Return ``(failure_count, " "test_count)``." msgstr "" -#: ../../library/doctest.rst:855 +#: ../../library/doctest.rst:876 msgid "" "Optional argument *module_relative* specifies how the filename should be " "interpreted:" msgstr "" -#: ../../library/doctest.rst:858 +#: ../../library/doctest.rst:879 msgid "" "If *module_relative* is ``True`` (the default), then *filename* specifies an " "OS-independent module-relative path. By default, this path is relative to " @@ -814,20 +831,20 @@ msgid "" "absolute path (i.e., it may not begin with ``/``)." msgstr "" -#: ../../library/doctest.rst:865 +#: ../../library/doctest.rst:886 msgid "" "If *module_relative* is ``False``, then *filename* specifies an OS-specific " "path. The path may be absolute or relative; relative paths are resolved " "with respect to the current working directory." msgstr "" -#: ../../library/doctest.rst:869 +#: ../../library/doctest.rst:890 msgid "" "Optional argument *name* gives the name of the test; by default, or if " "``None``, ``os.path.basename(filename)`` is used." msgstr "" -#: ../../library/doctest.rst:872 +#: ../../library/doctest.rst:893 msgid "" "Optional argument *package* is a Python package or the name of a Python " "package whose directory should be used as the base directory for a module-" @@ -836,7 +853,7 @@ msgid "" "is an error to specify *package* if *module_relative* is ``False``." msgstr "" -#: ../../library/doctest.rst:878 +#: ../../library/doctest.rst:899 msgid "" "Optional argument *globs* gives a dict to be used as the globals when " "executing examples. A new shallow copy of this dict is created for the " @@ -844,7 +861,7 @@ msgid "" "``None``, a new empty dict is used." msgstr "" -#: ../../library/doctest.rst:883 +#: ../../library/doctest.rst:904 msgid "" "Optional argument *extraglobs* gives a dict merged into the globals used to " "execute examples. This works like :meth:`dict.update`: if *globs* and " @@ -857,27 +874,27 @@ msgid "" "tested." msgstr "" -#: ../../library/doctest.rst:892 +#: ../../library/doctest.rst:913 msgid "" "Optional argument *verbose* prints lots of stuff if true, and prints only " "failures if false; by default, or if ``None``, it's true if and only if ``'-" "v'`` is in ``sys.argv``." msgstr "" -#: ../../library/doctest.rst:896 +#: ../../library/doctest.rst:917 msgid "" "Optional argument *report* prints a summary at the end when true, else " "prints nothing at the end. In verbose mode, the summary is detailed, else " "the summary is very brief (in fact, empty if all tests passed)." msgstr "" -#: ../../library/doctest.rst:900 +#: ../../library/doctest.rst:921 msgid "" "Optional argument *optionflags* (default value 0) takes the :ref:`bitwise OR " "` of option flags. See section :ref:`doctest-options`." msgstr "" -#: ../../library/doctest.rst:904 +#: ../../library/doctest.rst:925 msgid "" "Optional argument *raise_on_error* defaults to false. If true, an exception " "is raised upon the first failure or unexpected exception in an example. " @@ -885,33 +902,33 @@ msgid "" "continue running examples." msgstr "" -#: ../../library/doctest.rst:909 ../../library/doctest.rst:1049 +#: ../../library/doctest.rst:930 ../../library/doctest.rst:1070 msgid "" "Optional argument *parser* specifies a :class:`DocTestParser` (or subclass) " "that should be used to extract tests from the files. It defaults to a " "normal parser (i.e., ``DocTestParser()``)." msgstr "" -#: ../../library/doctest.rst:913 ../../library/doctest.rst:1053 +#: ../../library/doctest.rst:934 ../../library/doctest.rst:1074 msgid "" "Optional argument *encoding* specifies an encoding that should be used to " "convert the file to unicode." msgstr "" -#: ../../library/doctest.rst:919 +#: ../../library/doctest.rst:940 msgid "" "All arguments are optional, and all except for *m* should be specified in " "keyword form." msgstr "" -#: ../../library/doctest.rst:922 +#: ../../library/doctest.rst:943 msgid "" "Test examples in docstrings in functions and classes reachable from module " "*m* (or module :mod:`__main__` if *m* is not supplied or is ``None``), " "starting with ``m.__doc__``." msgstr "" -#: ../../library/doctest.rst:926 +#: ../../library/doctest.rst:947 msgid "" "Also test examples reachable from dict ``m.__test__``, if it exists and is " "not ``None``. ``m.__test__`` maps names (strings) to functions, classes and " @@ -919,22 +936,22 @@ msgid "" "are searched directly, as if they were docstrings." msgstr "" -#: ../../library/doctest.rst:931 +#: ../../library/doctest.rst:952 msgid "" "Only docstrings attached to objects belonging to module *m* are searched." msgstr "" -#: ../../library/doctest.rst:933 +#: ../../library/doctest.rst:954 msgid "Return ``(failure_count, test_count)``." msgstr "" -#: ../../library/doctest.rst:935 +#: ../../library/doctest.rst:956 msgid "" "Optional argument *name* gives the name of the module; by default, or if " "``None``, ``m.__name__`` is used." msgstr "" -#: ../../library/doctest.rst:938 +#: ../../library/doctest.rst:959 msgid "" "Optional argument *exclude_empty* defaults to false. If true, objects for " "which no doctests are found are excluded from consideration. The default is " @@ -944,39 +961,39 @@ msgid "" "class:`DocTestFinder` constructor defaults to true." msgstr "" -#: ../../library/doctest.rst:945 +#: ../../library/doctest.rst:966 msgid "" "Optional arguments *extraglobs*, *verbose*, *report*, *optionflags*, " "*raise_on_error*, and *globs* are the same as for function :func:`testfile` " "above, except that *globs* defaults to ``m.__dict__``." msgstr "" -#: ../../library/doctest.rst:952 +#: ../../library/doctest.rst:973 msgid "" "Test examples associated with object *f*; for example, *f* may be a string, " "a module, a function, or a class object." msgstr "" -#: ../../library/doctest.rst:955 +#: ../../library/doctest.rst:976 msgid "" "A shallow copy of dictionary argument *globs* is used for the execution " "context." msgstr "" -#: ../../library/doctest.rst:957 +#: ../../library/doctest.rst:978 msgid "" "Optional argument *name* is used in failure messages, and defaults to " "``\"NoName\"``." msgstr "" -#: ../../library/doctest.rst:960 +#: ../../library/doctest.rst:981 msgid "" "If optional argument *verbose* is true, output is generated even if there " "are no failures. By default, output is generated only in case of an example " "failure." msgstr "" -#: ../../library/doctest.rst:963 +#: ../../library/doctest.rst:984 msgid "" "Optional argument *compileflags* gives the set of flags that should be used " "by the Python compiler when running the examples. By default, or if " @@ -984,16 +1001,16 @@ msgid "" "found in *globs*." msgstr "" -#: ../../library/doctest.rst:967 +#: ../../library/doctest.rst:988 msgid "" "Optional argument *optionflags* works as for function :func:`testfile` above." msgstr "" -#: ../../library/doctest.rst:973 +#: ../../library/doctest.rst:994 msgid "Unittest API" msgstr "" -#: ../../library/doctest.rst:975 +#: ../../library/doctest.rst:996 msgid "" "As your collection of doctest'ed modules grows, you'll want a way to run all " "their doctests systematically. :mod:`doctest` provides two functions that " @@ -1002,19 +1019,19 @@ msgid "" "discovery, include a :func:`load_tests` function in your test module::" msgstr "" -#: ../../library/doctest.rst:989 +#: ../../library/doctest.rst:1010 msgid "" "There are two main functions for creating :class:`unittest.TestSuite` " "instances from text files and modules with doctests:" msgstr "" -#: ../../library/doctest.rst:995 +#: ../../library/doctest.rst:1016 msgid "" "Convert doctest tests from one or more text files to a :class:`unittest." "TestSuite`." msgstr "" -#: ../../library/doctest.rst:998 +#: ../../library/doctest.rst:1019 msgid "" "The returned :class:`unittest.TestSuite` is to be run by the unittest " "framework and runs the interactive examples in each file. If an example in " @@ -1023,21 +1040,21 @@ msgid "" "containing the test and a (sometimes approximate) line number." msgstr "" -#: ../../library/doctest.rst:1004 +#: ../../library/doctest.rst:1025 msgid "Pass one or more paths (as strings) to text files to be examined." msgstr "" -#: ../../library/doctest.rst:1006 +#: ../../library/doctest.rst:1027 msgid "Options may be provided as keyword arguments:" msgstr "" -#: ../../library/doctest.rst:1008 +#: ../../library/doctest.rst:1029 msgid "" "Optional argument *module_relative* specifies how the filenames in *paths* " "should be interpreted:" msgstr "" -#: ../../library/doctest.rst:1011 +#: ../../library/doctest.rst:1032 msgid "" "If *module_relative* is ``True`` (the default), then each filename in " "*paths* specifies an OS-independent module-relative path. By default, this " @@ -1048,14 +1065,14 @@ msgid "" "``)." msgstr "" -#: ../../library/doctest.rst:1019 +#: ../../library/doctest.rst:1040 msgid "" "If *module_relative* is ``False``, then each filename in *paths* specifies " "an OS-specific path. The path may be absolute or relative; relative paths " "are resolved with respect to the current working directory." msgstr "" -#: ../../library/doctest.rst:1023 +#: ../../library/doctest.rst:1044 msgid "" "Optional argument *package* is a Python package or the name of a Python " "package whose directory should be used as the base directory for module-" @@ -1065,7 +1082,7 @@ msgid "" "``False``." msgstr "" -#: ../../library/doctest.rst:1030 +#: ../../library/doctest.rst:1051 msgid "" "Optional argument *setUp* specifies a set-up function for the test suite. " "This is called before running the tests in each file. The *setUp* function " @@ -1073,7 +1090,7 @@ msgid "" "test globals as the *globs* attribute of the test passed." msgstr "" -#: ../../library/doctest.rst:1035 +#: ../../library/doctest.rst:1056 msgid "" "Optional argument *tearDown* specifies a tear-down function for the test " "suite. This is called after running the tests in each file. The *tearDown* " @@ -1081,14 +1098,14 @@ msgid "" "access the test globals as the *globs* attribute of the test passed." msgstr "" -#: ../../library/doctest.rst:1040 ../../library/doctest.rst:1074 +#: ../../library/doctest.rst:1061 ../../library/doctest.rst:1095 msgid "" "Optional argument *globs* is a dictionary containing the initial global " "variables for the tests. A new copy of this dictionary is created for each " "test. By default, *globs* is a new empty dictionary." msgstr "" -#: ../../library/doctest.rst:1044 +#: ../../library/doctest.rst:1065 msgid "" "Optional argument *optionflags* specifies the default doctest options for " "the tests, created by or-ing together individual option flags. See section :" @@ -1096,17 +1113,17 @@ msgid "" "for a better way to set reporting options." msgstr "" -#: ../../library/doctest.rst:1056 +#: ../../library/doctest.rst:1077 msgid "" "The global ``__file__`` is added to the globals provided to doctests loaded " "from a text file using :func:`DocFileSuite`." msgstr "" -#: ../../library/doctest.rst:1062 +#: ../../library/doctest.rst:1083 msgid "Convert doctest tests for a module to a :class:`unittest.TestSuite`." msgstr "" -#: ../../library/doctest.rst:1064 +#: ../../library/doctest.rst:1085 msgid "" "The returned :class:`unittest.TestSuite` is to be run by the unittest " "framework and runs each doctest in the module. If any of the doctests fail, " @@ -1115,42 +1132,42 @@ msgid "" "(sometimes approximate) line number." msgstr "" -#: ../../library/doctest.rst:1070 +#: ../../library/doctest.rst:1091 msgid "" "Optional argument *module* provides the module to be tested. It can be a " "module object or a (possibly dotted) module name. If not specified, the " "module calling this function is used." msgstr "" -#: ../../library/doctest.rst:1078 +#: ../../library/doctest.rst:1099 msgid "" "Optional argument *extraglobs* specifies an extra set of global variables, " "which is merged into *globs*. By default, no extra globals are used." msgstr "" -#: ../../library/doctest.rst:1081 +#: ../../library/doctest.rst:1102 msgid "" "Optional argument *test_finder* is the :class:`DocTestFinder` object (or a " "drop-in replacement) that is used to extract doctests from the module." msgstr "" -#: ../../library/doctest.rst:1084 +#: ../../library/doctest.rst:1105 msgid "" "Optional arguments *setUp*, *tearDown*, and *optionflags* are the same as " "for function :func:`DocFileSuite` above." msgstr "" -#: ../../library/doctest.rst:1087 +#: ../../library/doctest.rst:1108 msgid "This function uses the same search technique as :func:`testmod`." msgstr "" -#: ../../library/doctest.rst:1089 +#: ../../library/doctest.rst:1110 msgid "" ":func:`DocTestSuite` returns an empty :class:`unittest.TestSuite` if " "*module* contains no docstrings instead of raising :exc:`ValueError`." msgstr "" -#: ../../library/doctest.rst:1094 +#: ../../library/doctest.rst:1115 msgid "" "Under the covers, :func:`DocTestSuite` creates a :class:`unittest.TestSuite` " "out of :class:`doctest.DocTestCase` instances, and :class:`DocTestCase` is a " @@ -1159,14 +1176,14 @@ msgid "" "questions about the exact details of :mod:`unittest` integration." msgstr "" -#: ../../library/doctest.rst:1100 +#: ../../library/doctest.rst:1121 msgid "" "Similarly, :func:`DocFileSuite` creates a :class:`unittest.TestSuite` out " "of :class:`doctest.DocFileCase` instances, and :class:`DocFileCase` is a " "subclass of :class:`DocTestCase`." msgstr "" -#: ../../library/doctest.rst:1104 +#: ../../library/doctest.rst:1125 msgid "" "So both ways of creating a :class:`unittest.TestSuite` run instances of :" "class:`DocTestCase`. This is important for a subtle reason: when you run :" @@ -1179,23 +1196,23 @@ msgid "" "through :mod:`unittest` to :mod:`doctest` test runners." msgstr "" -#: ../../library/doctest.rst:1114 +#: ../../library/doctest.rst:1135 msgid "" "For this reason, :mod:`doctest` also supports a notion of :mod:`doctest` " "reporting flags specific to :mod:`unittest` support, via this function:" msgstr "" -#: ../../library/doctest.rst:1120 +#: ../../library/doctest.rst:1141 msgid "Set the :mod:`doctest` reporting flags to use." msgstr "" -#: ../../library/doctest.rst:1122 +#: ../../library/doctest.rst:1143 msgid "" "Argument *flags* takes the :ref:`bitwise OR ` of option flags. See " "section :ref:`doctest-options`. Only \"reporting flags\" can be used." msgstr "" -#: ../../library/doctest.rst:1125 +#: ../../library/doctest.rst:1146 msgid "" "This is a module-global setting, and affects all future doctests run by " "module :mod:`unittest`: the :meth:`runTest` method of :class:`DocTestCase` " @@ -1209,17 +1226,17 @@ msgid "" "`doctest`'s :mod:`unittest` reporting flags are ignored." msgstr "" -#: ../../library/doctest.rst:1136 +#: ../../library/doctest.rst:1157 msgid "" "The value of the :mod:`unittest` reporting flags in effect before the " "function was called is returned by the function." msgstr "" -#: ../../library/doctest.rst:1143 +#: ../../library/doctest.rst:1164 msgid "Advanced API" msgstr "" -#: ../../library/doctest.rst:1145 +#: ../../library/doctest.rst:1166 msgid "" "The basic API is a simple wrapper that's intended to make doctest easy to " "use. It is fairly flexible, and should meet most users' needs; however, if " @@ -1227,85 +1244,85 @@ msgid "" "doctest's capabilities, then you should use the advanced API." msgstr "" -#: ../../library/doctest.rst:1150 +#: ../../library/doctest.rst:1171 msgid "" "The advanced API revolves around two container classes, which are used to " "store the interactive examples extracted from doctest cases:" msgstr "" -#: ../../library/doctest.rst:1153 +#: ../../library/doctest.rst:1174 msgid "" ":class:`Example`: A single Python :term:`statement`, paired with its " "expected output." msgstr "" -#: ../../library/doctest.rst:1156 +#: ../../library/doctest.rst:1177 msgid "" ":class:`DocTest`: A collection of :class:`Example`\\ s, typically extracted " "from a single docstring or text file." msgstr "" -#: ../../library/doctest.rst:1159 +#: ../../library/doctest.rst:1180 msgid "" "Additional processing classes are defined to find, parse, and run, and check " "doctest examples:" msgstr "" -#: ../../library/doctest.rst:1162 +#: ../../library/doctest.rst:1183 msgid "" ":class:`DocTestFinder`: Finds all docstrings in a given module, and uses a :" "class:`DocTestParser` to create a :class:`DocTest` from every docstring that " "contains interactive examples." msgstr "" -#: ../../library/doctest.rst:1166 +#: ../../library/doctest.rst:1187 msgid "" ":class:`DocTestParser`: Creates a :class:`DocTest` object from a string " "(such as an object's docstring)." msgstr "" -#: ../../library/doctest.rst:1169 +#: ../../library/doctest.rst:1190 msgid "" ":class:`DocTestRunner`: Executes the examples in a :class:`DocTest`, and " "uses an :class:`OutputChecker` to verify their output." msgstr "" -#: ../../library/doctest.rst:1172 +#: ../../library/doctest.rst:1193 msgid "" ":class:`OutputChecker`: Compares the actual output from a doctest example " "with the expected output, and decides whether they match." msgstr "" -#: ../../library/doctest.rst:1175 +#: ../../library/doctest.rst:1196 msgid "" "The relationships among these processing classes are summarized in the " "following diagram::" msgstr "" -#: ../../library/doctest.rst:1191 +#: ../../library/doctest.rst:1212 msgid "DocTest Objects" msgstr "DocTest 物件" -#: ../../library/doctest.rst:1196 +#: ../../library/doctest.rst:1217 msgid "" "A collection of doctest examples that should be run in a single namespace. " "The constructor arguments are used to initialize the attributes of the same " "names." msgstr "" -#: ../../library/doctest.rst:1200 +#: ../../library/doctest.rst:1221 msgid "" ":class:`DocTest` defines the following attributes. They are initialized by " "the constructor, and should not be modified directly." msgstr "" -#: ../../library/doctest.rst:1206 +#: ../../library/doctest.rst:1227 msgid "" "A list of :class:`Example` objects encoding the individual interactive " "Python examples that should be run by this test." msgstr "" -#: ../../library/doctest.rst:1212 +#: ../../library/doctest.rst:1233 msgid "" "The namespace (aka globals) that the examples should be run in. This is a " "dictionary mapping names to values. Any changes to the namespace made by " @@ -1313,57 +1330,57 @@ msgid "" "`globs` after the test is run." msgstr "" -#: ../../library/doctest.rst:1220 +#: ../../library/doctest.rst:1241 msgid "" "A string name identifying the :class:`DocTest`. Typically, this is the name " "of the object or file that the test was extracted from." msgstr "" -#: ../../library/doctest.rst:1226 +#: ../../library/doctest.rst:1247 msgid "" "The name of the file that this :class:`DocTest` was extracted from; or " "``None`` if the filename is unknown, or if the :class:`DocTest` was not " "extracted from a file." msgstr "" -#: ../../library/doctest.rst:1233 +#: ../../library/doctest.rst:1254 msgid "" "The line number within :attr:`filename` where this :class:`DocTest` begins, " "or ``None`` if the line number is unavailable. This line number is zero-" "based with respect to the beginning of the file." msgstr "" -#: ../../library/doctest.rst:1240 +#: ../../library/doctest.rst:1261 msgid "" "The string that the test was extracted from, or ``None`` if the string is " "unavailable, or if the test was not extracted from a string." msgstr "" -#: ../../library/doctest.rst:1247 +#: ../../library/doctest.rst:1268 msgid "Example Objects" msgstr "Example 物件" -#: ../../library/doctest.rst:1252 +#: ../../library/doctest.rst:1273 msgid "" "A single interactive example, consisting of a Python statement and its " "expected output. The constructor arguments are used to initialize the " "attributes of the same names." msgstr "" -#: ../../library/doctest.rst:1257 +#: ../../library/doctest.rst:1278 msgid "" ":class:`Example` defines the following attributes. They are initialized by " "the constructor, and should not be modified directly." msgstr "" -#: ../../library/doctest.rst:1263 +#: ../../library/doctest.rst:1284 msgid "" "A string containing the example's source code. This source code consists of " "a single Python statement, and always ends with a newline; the constructor " "adds a newline when necessary." msgstr "" -#: ../../library/doctest.rst:1270 +#: ../../library/doctest.rst:1291 msgid "" "The expected output from running the example's source code (either from " "stdout, or a traceback in case of exception). :attr:`want` ends with a " @@ -1371,7 +1388,7 @@ msgid "" "The constructor adds a newline when necessary." msgstr "" -#: ../../library/doctest.rst:1278 +#: ../../library/doctest.rst:1299 msgid "" "The exception message generated by the example, if the example is expected " "to generate an exception; or ``None`` if it is not expected to generate an " @@ -1380,20 +1397,20 @@ msgid "" "unless it's ``None``. The constructor adds a newline if needed." msgstr "" -#: ../../library/doctest.rst:1287 +#: ../../library/doctest.rst:1308 msgid "" "The line number within the string containing this example where the example " "begins. This line number is zero-based with respect to the beginning of the " "containing string." msgstr "" -#: ../../library/doctest.rst:1294 +#: ../../library/doctest.rst:1315 msgid "" "The example's indentation in the containing string, i.e., the number of " "space characters that precede the example's first prompt." msgstr "" -#: ../../library/doctest.rst:1300 +#: ../../library/doctest.rst:1321 msgid "" "A dictionary mapping from option flags to ``True`` or ``False``, which is " "used to override default options for this example. Any option flags not " @@ -1402,11 +1419,11 @@ msgid "" "are set." msgstr "" -#: ../../library/doctest.rst:1309 +#: ../../library/doctest.rst:1330 msgid "DocTestFinder objects" msgstr "DocTestFinder 物件" -#: ../../library/doctest.rst:1314 +#: ../../library/doctest.rst:1335 msgid "" "A processing class used to extract the :class:`DocTest`\\ s that are " "relevant to a given object, from its docstring and the docstrings of its " @@ -1414,48 +1431,48 @@ msgid "" "classes, functions, methods, staticmethods, classmethods, and properties." msgstr "" -#: ../../library/doctest.rst:1319 +#: ../../library/doctest.rst:1340 msgid "" "The optional argument *verbose* can be used to display the objects searched " "by the finder. It defaults to ``False`` (no output)." msgstr "" -#: ../../library/doctest.rst:1322 +#: ../../library/doctest.rst:1343 msgid "" "The optional argument *parser* specifies the :class:`DocTestParser` object " "(or a drop-in replacement) that is used to extract doctests from docstrings." msgstr "" -#: ../../library/doctest.rst:1325 +#: ../../library/doctest.rst:1346 msgid "" "If the optional argument *recurse* is false, then :meth:`DocTestFinder.find` " "will only examine the given object, and not any contained objects." msgstr "" -#: ../../library/doctest.rst:1328 +#: ../../library/doctest.rst:1349 msgid "" "If the optional argument *exclude_empty* is false, then :meth:`DocTestFinder." "find` will include tests for objects with empty docstrings." msgstr "" -#: ../../library/doctest.rst:1332 +#: ../../library/doctest.rst:1353 msgid ":class:`DocTestFinder` defines the following method:" msgstr "" -#: ../../library/doctest.rst:1337 +#: ../../library/doctest.rst:1358 msgid "" "Return a list of the :class:`DocTest`\\ s that are defined by *obj*'s " "docstring, or by any of its contained objects' docstrings." msgstr "" -#: ../../library/doctest.rst:1340 +#: ../../library/doctest.rst:1361 msgid "" "The optional argument *name* specifies the object's name; this name will be " "used to construct names for the returned :class:`DocTest`\\ s. If *name* is " "not specified, then ``obj.__name__`` is used." msgstr "" -#: ../../library/doctest.rst:1344 +#: ../../library/doctest.rst:1365 msgid "" "The optional parameter *module* is the module that contains the given " "object. If the module is not specified or is ``None``, then the test finder " @@ -1463,26 +1480,26 @@ msgid "" "module is used:" msgstr "" -#: ../../library/doctest.rst:1348 +#: ../../library/doctest.rst:1369 msgid "As a default namespace, if *globs* is not specified." msgstr "" -#: ../../library/doctest.rst:1350 +#: ../../library/doctest.rst:1371 msgid "" "To prevent the DocTestFinder from extracting DocTests from objects that are " "imported from other modules. (Contained objects with modules other than " "*module* are ignored.)" msgstr "" -#: ../../library/doctest.rst:1354 +#: ../../library/doctest.rst:1375 msgid "To find the name of the file containing the object." msgstr "" -#: ../../library/doctest.rst:1356 +#: ../../library/doctest.rst:1377 msgid "To help find the line number of the object within its file." msgstr "" -#: ../../library/doctest.rst:1358 +#: ../../library/doctest.rst:1379 msgid "" "If *module* is ``False``, no attempt to find the module will be made. This " "is obscure, of use mostly in testing doctest itself: if *module* is " @@ -1491,7 +1508,7 @@ msgid "" "contained objects will (recursively) be searched for doctests." msgstr "" -#: ../../library/doctest.rst:1364 +#: ../../library/doctest.rst:1385 msgid "" "The globals for each :class:`DocTest` is formed by combining *globs* and " "*extraglobs* (bindings in *extraglobs* override bindings in *globs*). A new " @@ -1501,34 +1518,34 @@ msgid "" "defaults to ``{}``." msgstr "" -#: ../../library/doctest.rst:1375 +#: ../../library/doctest.rst:1396 msgid "DocTestParser objects" msgstr "DocTestParser 物件" -#: ../../library/doctest.rst:1380 +#: ../../library/doctest.rst:1401 msgid "" "A processing class used to extract interactive examples from a string, and " "use them to create a :class:`DocTest` object." msgstr "" -#: ../../library/doctest.rst:1384 ../../library/doctest.rst:1452 +#: ../../library/doctest.rst:1405 ../../library/doctest.rst:1473 msgid ":class:`DocTestParser` defines the following methods:" msgstr "" -#: ../../library/doctest.rst:1389 +#: ../../library/doctest.rst:1410 msgid "" "Extract all doctest examples from the given string, and collect them into a :" "class:`DocTest` object." msgstr "" -#: ../../library/doctest.rst:1392 +#: ../../library/doctest.rst:1413 msgid "" "*globs*, *name*, *filename*, and *lineno* are attributes for the new :class:" "`DocTest` object. See the documentation for :class:`DocTest` for more " "information." msgstr "" -#: ../../library/doctest.rst:1399 +#: ../../library/doctest.rst:1420 msgid "" "Extract all doctest examples from the given string, and return them as a " "list of :class:`Example` objects. Line numbers are 0-based. The optional " @@ -1536,7 +1553,7 @@ msgid "" "error messages." msgstr "" -#: ../../library/doctest.rst:1406 +#: ../../library/doctest.rst:1427 msgid "" "Divide the given string into examples and intervening text, and return them " "as a list of alternating :class:`Example`\\ s and strings. Line numbers for " @@ -1544,17 +1561,17 @@ msgid "" "name identifying this string, and is only used for error messages." msgstr "" -#: ../../library/doctest.rst:1415 +#: ../../library/doctest.rst:1436 msgid "DocTestRunner objects" msgstr "DocTestRunner 物件" -#: ../../library/doctest.rst:1420 +#: ../../library/doctest.rst:1441 msgid "" "A processing class used to execute and verify the interactive examples in a :" "class:`DocTest`." msgstr "" -#: ../../library/doctest.rst:1423 +#: ../../library/doctest.rst:1444 msgid "" "The comparison between expected outputs and actual outputs is done by an :" "class:`OutputChecker`. This comparison may be customized with a number of " @@ -1564,7 +1581,7 @@ msgid "" "constructor." msgstr "" -#: ../../library/doctest.rst:1429 +#: ../../library/doctest.rst:1450 msgid "" "The test runner's display output can be controlled in two ways. First, an " "output function can be passed to :meth:`TestRunner.run`; this function will " @@ -1575,14 +1592,14 @@ msgid "" "`report_unexpected_exception`, and :meth:`report_failure`." msgstr "" -#: ../../library/doctest.rst:1437 +#: ../../library/doctest.rst:1458 msgid "" "The optional keyword argument *checker* specifies the :class:`OutputChecker` " "object (or drop-in replacement) that should be used to compare the expected " "outputs to the actual outputs of doctest examples." msgstr "" -#: ../../library/doctest.rst:1441 +#: ../../library/doctest.rst:1462 msgid "" "The optional keyword argument *verbose* controls the :class:" "`DocTestRunner`'s verbosity. If *verbose* is ``True``, then information is " @@ -1591,56 +1608,56 @@ msgid "" "verbose output is used iff the command-line switch ``-v`` is used." msgstr "" -#: ../../library/doctest.rst:1447 +#: ../../library/doctest.rst:1468 msgid "" "The optional keyword argument *optionflags* can be used to control how the " "test runner compares expected output to actual output, and how it displays " "failures. For more information, see section :ref:`doctest-options`." msgstr "" -#: ../../library/doctest.rst:1457 +#: ../../library/doctest.rst:1478 msgid "" "Report that the test runner is about to process the given example. This " "method is provided to allow subclasses of :class:`DocTestRunner` to " "customize their output; it should not be called directly." msgstr "" -#: ../../library/doctest.rst:1461 +#: ../../library/doctest.rst:1482 msgid "" "*example* is the example about to be processed. *test* is the test " "*containing example*. *out* is the output function that was passed to :meth:" "`DocTestRunner.run`." msgstr "" -#: ../../library/doctest.rst:1468 +#: ../../library/doctest.rst:1489 msgid "" "Report that the given example ran successfully. This method is provided to " "allow subclasses of :class:`DocTestRunner` to customize their output; it " "should not be called directly." msgstr "" -#: ../../library/doctest.rst:1472 ../../library/doctest.rst:1483 +#: ../../library/doctest.rst:1493 ../../library/doctest.rst:1504 msgid "" "*example* is the example about to be processed. *got* is the actual output " "from the example. *test* is the test containing *example*. *out* is the " "output function that was passed to :meth:`DocTestRunner.run`." msgstr "" -#: ../../library/doctest.rst:1479 +#: ../../library/doctest.rst:1500 msgid "" "Report that the given example failed. This method is provided to allow " "subclasses of :class:`DocTestRunner` to customize their output; it should " "not be called directly." msgstr "" -#: ../../library/doctest.rst:1490 +#: ../../library/doctest.rst:1511 msgid "" "Report that the given example raised an unexpected exception. This method is " "provided to allow subclasses of :class:`DocTestRunner` to customize their " "output; it should not be called directly." msgstr "" -#: ../../library/doctest.rst:1494 +#: ../../library/doctest.rst:1515 msgid "" "*example* is the example about to be processed. *exc_info* is a tuple " "containing information about the unexpected exception (as returned by :func:" @@ -1648,13 +1665,13 @@ msgid "" "output function that was passed to :meth:`DocTestRunner.run`." msgstr "" -#: ../../library/doctest.rst:1502 +#: ../../library/doctest.rst:1523 msgid "" "Run the examples in *test* (a :class:`DocTest` object), and display the " "results using the writer function *out*." msgstr "" -#: ../../library/doctest.rst:1505 +#: ../../library/doctest.rst:1526 msgid "" "The examples are run in the namespace ``test.globs``. If *clear_globs* is " "true (the default), then this namespace will be cleared after the test runs, " @@ -1662,39 +1679,39 @@ msgid "" "after the test completes, then use *clear_globs=False*." msgstr "" -#: ../../library/doctest.rst:1510 +#: ../../library/doctest.rst:1531 msgid "" "*compileflags* gives the set of flags that should be used by the Python " "compiler when running the examples. If not specified, then it will default " "to the set of future-import flags that apply to *globs*." msgstr "" -#: ../../library/doctest.rst:1514 +#: ../../library/doctest.rst:1535 msgid "" "The output of each example is checked using the :class:`DocTestRunner`'s " "output checker, and the results are formatted by the :meth:`DocTestRunner." "report_\\*` methods." msgstr "" -#: ../../library/doctest.rst:1521 +#: ../../library/doctest.rst:1542 msgid "" "Print a summary of all the test cases that have been run by this " "DocTestRunner, and return a :term:`named tuple` ``TestResults(failed, " "attempted)``." msgstr "" -#: ../../library/doctest.rst:1524 +#: ../../library/doctest.rst:1545 msgid "" "The optional *verbose* argument controls how detailed the summary is. If " "the verbosity is not specified, then the :class:`DocTestRunner`'s verbosity " "is used." msgstr "" -#: ../../library/doctest.rst:1531 +#: ../../library/doctest.rst:1552 msgid "OutputChecker objects" msgstr "OutputChecker 物件" -#: ../../library/doctest.rst:1536 +#: ../../library/doctest.rst:1557 msgid "" "A class used to check the whether the actual output from a doctest example " "matches the expected output. :class:`OutputChecker` defines two methods: :" @@ -1703,11 +1720,11 @@ msgid "" "string describing the differences between two outputs." msgstr "" -#: ../../library/doctest.rst:1543 +#: ../../library/doctest.rst:1564 msgid ":class:`OutputChecker` defines the following methods:" msgstr "" -#: ../../library/doctest.rst:1547 +#: ../../library/doctest.rst:1568 msgid "" "Return ``True`` iff the actual output from an example (*got*) matches the " "expected output (*want*). These strings are always considered to match if " @@ -1716,28 +1733,28 @@ msgid "" "`doctest-options` for more information about option flags." msgstr "" -#: ../../library/doctest.rst:1556 +#: ../../library/doctest.rst:1577 msgid "" "Return a string describing the differences between the expected output for a " "given example (*example*) and the actual output (*got*). *optionflags* is " "the set of option flags used to compare *want* and *got*." msgstr "" -#: ../../library/doctest.rst:1564 +#: ../../library/doctest.rst:1585 msgid "Debugging" msgstr "" -#: ../../library/doctest.rst:1566 +#: ../../library/doctest.rst:1587 msgid "Doctest provides several mechanisms for debugging doctest examples:" msgstr "" -#: ../../library/doctest.rst:1568 +#: ../../library/doctest.rst:1589 msgid "" "Several functions convert doctests to executable Python programs, which can " "be run under the Python debugger, :mod:`pdb`." msgstr "" -#: ../../library/doctest.rst:1571 +#: ../../library/doctest.rst:1592 msgid "" "The :class:`DebugRunner` class is a subclass of :class:`DocTestRunner` that " "raises an exception for the first failing example, containing information " @@ -1745,13 +1762,13 @@ msgid "" "debugging on the example." msgstr "" -#: ../../library/doctest.rst:1576 +#: ../../library/doctest.rst:1597 msgid "" "The :mod:`unittest` cases generated by :func:`DocTestSuite` support the :" "meth:`debug` method defined by :class:`unittest.TestCase`." msgstr "" -#: ../../library/doctest.rst:1579 +#: ../../library/doctest.rst:1600 msgid "" "You can add a call to :func:`pdb.set_trace` in a doctest example, and you'll " "drop into the Python debugger when that line is executed. Then you can " @@ -1759,21 +1776,21 @@ msgid "" "`a.py` contains just this module docstring::" msgstr "" -#: ../../library/doctest.rst:1594 +#: ../../library/doctest.rst:1615 msgid "Then an interactive Python session may look like this::" msgstr "" -#: ../../library/doctest.rst:1627 +#: ../../library/doctest.rst:1648 msgid "" "Functions that convert doctests to Python code, and possibly run the " "synthesized code under the debugger:" msgstr "" -#: ../../library/doctest.rst:1633 +#: ../../library/doctest.rst:1654 msgid "Convert text with examples to a script." msgstr "" -#: ../../library/doctest.rst:1635 +#: ../../library/doctest.rst:1656 msgid "" "Argument *s* is a string containing doctest examples. The string is " "converted to a Python script, where doctest examples in *s* are converted to " @@ -1781,22 +1798,22 @@ msgid "" "generated script is returned as a string. For example, ::" msgstr "" -#: ../../library/doctest.rst:1650 +#: ../../library/doctest.rst:1671 msgid "displays::" msgstr "" -#: ../../library/doctest.rst:1660 +#: ../../library/doctest.rst:1681 msgid "" "This function is used internally by other functions (see below), but can " "also be useful when you want to transform an interactive Python session into " "a Python script." msgstr "" -#: ../../library/doctest.rst:1667 +#: ../../library/doctest.rst:1688 msgid "Convert the doctest for an object to a script." msgstr "" -#: ../../library/doctest.rst:1669 +#: ../../library/doctest.rst:1690 msgid "" "Argument *module* is a module object, or dotted name of a module, containing " "the object whose doctests are of interest. Argument *name* is the name " @@ -1806,17 +1823,17 @@ msgid "" "module :file:`a.py` contains a top-level function :func:`f`, then ::" msgstr "" -#: ../../library/doctest.rst:1679 +#: ../../library/doctest.rst:1700 msgid "" "prints a script version of function :func:`f`'s docstring, with doctests " "converted to code, and the rest placed in comments." msgstr "" -#: ../../library/doctest.rst:1685 +#: ../../library/doctest.rst:1706 msgid "Debug the doctests for an object." msgstr "" -#: ../../library/doctest.rst:1687 +#: ../../library/doctest.rst:1708 msgid "" "The *module* and *name* arguments are the same as for function :func:" "`testsource` above. The synthesized Python script for the named object's " @@ -1824,13 +1841,13 @@ msgid "" "the control of the Python debugger, :mod:`pdb`." msgstr "" -#: ../../library/doctest.rst:1692 +#: ../../library/doctest.rst:1713 msgid "" "A shallow copy of ``module.__dict__`` is used for both local and global " "execution context." msgstr "" -#: ../../library/doctest.rst:1695 +#: ../../library/doctest.rst:1716 msgid "" "Optional argument *pm* controls whether post-mortem debugging is used. If " "*pm* has a true value, the script file is run directly, and the debugger " @@ -1842,30 +1859,30 @@ msgid "" "to :func:`pdb.run`." msgstr "" -#: ../../library/doctest.rst:1706 +#: ../../library/doctest.rst:1727 msgid "Debug the doctests in a string." msgstr "" -#: ../../library/doctest.rst:1708 +#: ../../library/doctest.rst:1729 msgid "" "This is like function :func:`debug` above, except that a string containing " "doctest examples is specified directly, via the *src* argument." msgstr "" -#: ../../library/doctest.rst:1711 +#: ../../library/doctest.rst:1732 msgid "" "Optional argument *pm* has the same meaning as in function :func:`debug` " "above." msgstr "" -#: ../../library/doctest.rst:1713 +#: ../../library/doctest.rst:1734 msgid "" "Optional argument *globs* gives a dictionary to use as both local and global " "execution context. If not specified, or ``None``, an empty dictionary is " "used. If specified, a shallow copy of the dictionary is used." msgstr "" -#: ../../library/doctest.rst:1718 +#: ../../library/doctest.rst:1739 msgid "" "The :class:`DebugRunner` class, and the special exceptions it may raise, are " "of most interest to testing framework authors, and will only be sketched " @@ -1873,7 +1890,7 @@ msgid "" "(which is a doctest!) for more details:" msgstr "" -#: ../../library/doctest.rst:1726 +#: ../../library/doctest.rst:1747 msgid "" "A subclass of :class:`DocTestRunner` that raises an exception as soon as a " "failure is encountered. If an unexpected exception occurs, an :exc:" @@ -1883,89 +1900,89 @@ msgid "" "the actual output." msgstr "" -#: ../../library/doctest.rst:1733 +#: ../../library/doctest.rst:1754 msgid "" "For information about the constructor parameters and methods, see the " "documentation for :class:`DocTestRunner` in section :ref:`doctest-advanced-" "api`." msgstr "" -#: ../../library/doctest.rst:1736 +#: ../../library/doctest.rst:1757 msgid "" "There are two exceptions that may be raised by :class:`DebugRunner` " "instances:" msgstr "" -#: ../../library/doctest.rst:1741 +#: ../../library/doctest.rst:1762 msgid "" "An exception raised by :class:`DocTestRunner` to signal that a doctest " "example's actual output did not match its expected output. The constructor " "arguments are used to initialize the attributes of the same names." msgstr "" -#: ../../library/doctest.rst:1745 +#: ../../library/doctest.rst:1766 msgid ":exc:`DocTestFailure` defines the following attributes:" msgstr "" -#: ../../library/doctest.rst:1750 ../../library/doctest.rst:1774 +#: ../../library/doctest.rst:1771 ../../library/doctest.rst:1795 msgid "The :class:`DocTest` object that was being run when the example failed." msgstr "" -#: ../../library/doctest.rst:1755 ../../library/doctest.rst:1779 +#: ../../library/doctest.rst:1776 ../../library/doctest.rst:1800 msgid "The :class:`Example` that failed." msgstr "" -#: ../../library/doctest.rst:1760 +#: ../../library/doctest.rst:1781 msgid "The example's actual output." msgstr "" -#: ../../library/doctest.rst:1765 +#: ../../library/doctest.rst:1786 msgid "" "An exception raised by :class:`DocTestRunner` to signal that a doctest " "example raised an unexpected exception. The constructor arguments are used " "to initialize the attributes of the same names." msgstr "" -#: ../../library/doctest.rst:1769 +#: ../../library/doctest.rst:1790 msgid ":exc:`UnexpectedException` defines the following attributes:" msgstr "" -#: ../../library/doctest.rst:1784 +#: ../../library/doctest.rst:1805 msgid "" "A tuple containing information about the unexpected exception, as returned " "by :func:`sys.exc_info`." msgstr "" -#: ../../library/doctest.rst:1791 +#: ../../library/doctest.rst:1812 msgid "Soapbox" msgstr "" -#: ../../library/doctest.rst:1793 +#: ../../library/doctest.rst:1814 msgid "" "As mentioned in the introduction, :mod:`doctest` has grown to have three " "primary uses:" msgstr "" -#: ../../library/doctest.rst:1796 +#: ../../library/doctest.rst:1817 msgid "Checking examples in docstrings." msgstr "" -#: ../../library/doctest.rst:1798 +#: ../../library/doctest.rst:1819 msgid "Regression testing." msgstr "" -#: ../../library/doctest.rst:1800 +#: ../../library/doctest.rst:1821 msgid "Executable documentation / literate testing." msgstr "" -#: ../../library/doctest.rst:1802 +#: ../../library/doctest.rst:1823 msgid "" "These uses have different requirements, and it is important to distinguish " "them. In particular, filling your docstrings with obscure test cases makes " "for bad documentation." msgstr "" -#: ../../library/doctest.rst:1806 +#: ../../library/doctest.rst:1827 msgid "" "When writing a docstring, choose docstring examples with care. There's an " "art to this that needs to be learned---it may not be natural at first. " @@ -1977,7 +1994,7 @@ msgid "" "\"harmless\" change." msgstr "" -#: ../../library/doctest.rst:1814 +#: ../../library/doctest.rst:1835 msgid "" "Doctest also makes an excellent tool for regression testing, especially if " "you don't skimp on explanatory text. By interleaving prose and examples, it " @@ -1998,13 +2015,13 @@ msgid "" "different results, blurring the distinction between testing and explaining." msgstr "" -#: ../../library/doctest.rst:1832 +#: ../../library/doctest.rst:1853 msgid "" "Regression testing is best confined to dedicated objects or files. There " "are several options for organizing tests:" msgstr "" -#: ../../library/doctest.rst:1835 +#: ../../library/doctest.rst:1856 msgid "" "Write text files containing test cases as interactive examples, and test the " "files using :func:`testfile` or :func:`DocFileSuite`. This is recommended, " @@ -2012,7 +2029,7 @@ msgid "" "doctest." msgstr "" -#: ../../library/doctest.rst:1840 +#: ../../library/doctest.rst:1861 msgid "" "Define functions named ``_regrtest_topic`` that consist of single " "docstrings, containing test cases for the named topics. These functions can " @@ -2020,13 +2037,13 @@ msgid "" "test file." msgstr "" -#: ../../library/doctest.rst:1844 +#: ../../library/doctest.rst:1865 msgid "" "Define a ``__test__`` dictionary mapping from regression test topics to " "docstrings containing test cases." msgstr "" -#: ../../library/doctest.rst:1847 +#: ../../library/doctest.rst:1868 msgid "" "When you have placed your tests in a module, the module can itself be the " "test runner. When a test fails, you can arrange for your test runner to re-" @@ -2034,53 +2051,53 @@ msgid "" "example of such a test runner::" msgstr "" -#: ../../library/doctest.rst:1869 +#: ../../library/doctest.rst:1890 msgid "Footnotes" msgstr "註解" -#: ../../library/doctest.rst:1870 +#: ../../library/doctest.rst:1891 msgid "" "Examples containing both expected output and an exception are not supported. " "Trying to guess where one ends and the other begins is too error-prone, and " "that also makes for a confusing test." msgstr "" -#: ../../library/doctest.rst:318 +#: ../../library/doctest.rst:339 msgid ">>>" msgstr ">>>" -#: ../../library/doctest.rst:318 +#: ../../library/doctest.rst:339 msgid "interpreter prompt" msgstr "interpreter prompt(直譯器提示)" -#: ../../library/doctest.rst:318 ../../library/doctest.rst:556 +#: ../../library/doctest.rst:339 ../../library/doctest.rst:577 msgid "..." msgstr "..." -#: ../../library/doctest.rst:484 +#: ../../library/doctest.rst:505 msgid "^ (caret)" msgstr "^ (插入符號)" -#: ../../library/doctest.rst:484 +#: ../../library/doctest.rst:505 msgid "marker" msgstr "marker(標記)" -#: ../../library/doctest.rst:536 +#: ../../library/doctest.rst:557 msgid "" msgstr "" -#: ../../library/doctest.rst:556 ../../library/doctest.rst:686 +#: ../../library/doctest.rst:577 ../../library/doctest.rst:707 msgid "in doctests" msgstr "於 doctests 中" -#: ../../library/doctest.rst:686 +#: ../../library/doctest.rst:707 msgid "# (hash)" msgstr "# (井字號)" -#: ../../library/doctest.rst:686 +#: ../../library/doctest.rst:707 msgid "+ (plus)" msgstr "+ (加號)" -#: ../../library/doctest.rst:686 +#: ../../library/doctest.rst:707 msgid "- (minus)" msgstr "- (減號)" diff --git a/library/email.compat32-message.po b/library/email.compat32-message.po index 9af25c9797..7a2f9ecf06 100644 --- a/library/email.compat32-message.po +++ b/library/email.compat32-message.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2023-10-20 00:03+0000\n" "PO-Revision-Date: 2018-07-15 18:56+0800\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -419,8 +419,8 @@ msgstr "" #: ../../library/email.compat32-message.rst:369 msgid "" "Return the value of the named header field. This is identical to :meth:" -"`__getitem__` except that optional *failobj* is returned if the named header " -"is missing (defaults to ``None``)." +"`~object.__getitem__` except that optional *failobj* is returned if the " +"named header is missing (defaults to ``None``)." msgstr "" #: ../../library/email.compat32-message.rst:373 diff --git a/library/email.message.po b/library/email.message.po index 9003644575..5809709c83 100644 --- a/library/email.message.po +++ b/library/email.message.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 10:36+0000\n" +"POT-Creation-Date: 2023-10-20 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:44+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -299,8 +299,8 @@ msgstr "" #: ../../library/email.message.rst:249 msgid "" "Return the value of the named header field. This is identical to :meth:" -"`__getitem__` except that optional *failobj* is returned if the named header " -"is missing (*failobj* defaults to ``None``)." +"`~object.__getitem__` except that optional *failobj* is returned if the " +"named header is missing (*failobj* defaults to ``None``)." msgstr "" #: ../../library/email.message.rst:254 diff --git a/library/enum.po b/library/enum.po index b6f514ad6a..2054456150 100644 --- a/library/enum.po +++ b/library/enum.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-23 00:03+0000\n" +"POT-Creation-Date: 2023-10-25 00:03+0000\n" "PO-Revision-Date: 2023-09-11 14:08+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -418,16 +418,15 @@ msgstr "在位元操作時怎麼處理範圍外的值(只有 :class:`Flag` 會 msgid "Returns ``True`` if member belongs to the ``cls``::" msgstr "如果 member 屬於 ``cls`` 則回傳 ``True``: ::" -#: ../../library/enum.rst:204 +#: ../../library/enum.rst:206 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." +"Before Python 3.12, a ``TypeError`` is raised if a non-Enum-member is used " +"in a containment check." msgstr "" -"在 Python 3.12 中這可以檢查成員的值,而不只是檢查成員;在此之前,如果用非列舉" -"成員做屬於檢查會引發 ``TypeError``。" +"在 Python 3.12 之前,如果用非列舉成員做屬於檢查 (containment check) 會引發 " +"``TypeError``。" -#: ../../library/enum.rst:210 +#: ../../library/enum.rst:211 msgid "" "Returns ``['__class__', '__doc__', '__members__', '__module__']`` and the " "names of the members in *cls*::" @@ -435,46 +434,46 @@ msgstr "" "回傳 ``['__class__', '__doc__', '__members__', '__module__']`` 及 *cls* 的成" "員名稱: ::" -#: ../../library/enum.rst:218 +#: ../../library/enum.rst:219 msgid "" "Returns the Enum member in *cls* matching *name*, or raises a :exc:" "`KeyError`::" msgstr "回傳 *cls* 中符合 *name* 的列舉成員,或引發 :exc:`KeyError`: ::" -#: ../../library/enum.rst:225 +#: ../../library/enum.rst:226 msgid "Returns each member in *cls* in definition order::" msgstr "以定義的順序回傳在 *cls* 中的每個成員: ::" -#: ../../library/enum.rst:232 +#: ../../library/enum.rst:233 msgid "Returns the number of member in *cls*::" msgstr "回傳 *cls* 的成員數量: ::" -#: ../../library/enum.rst:239 +#: ../../library/enum.rst:240 msgid "Returns each member in *cls* in reverse definition order::" msgstr "以跟定義相反的順序回傳 *cls* 的每個成員: ::" -#: ../../library/enum.rst:246 +#: ../../library/enum.rst:247 msgid "Before 3.11 ``enum`` used ``EnumMeta`` type, which is kept as an alias." msgstr "" "在 3.11 之前,``enum`` 使用 ``EnumMeta`` 類型,目前保留此類型當作別名。" -#: ../../library/enum.rst:251 +#: ../../library/enum.rst:252 msgid "*Enum* is the base class for all *enum* enumerations." msgstr "*Enum* 是所有 *enum* 列舉的基礎類別。" -#: ../../library/enum.rst:255 +#: ../../library/enum.rst:256 msgid "The name used to define the ``Enum`` member::" msgstr "用來定義 ``Enum`` 成員的名稱: ::" -#: ../../library/enum.rst:262 +#: ../../library/enum.rst:263 msgid "The value given to the ``Enum`` member::" msgstr "``Enum`` 成員給定的值: ::" -#: ../../library/enum.rst:267 +#: ../../library/enum.rst:268 msgid "Enum member values" msgstr "列舉成員的值" -#: ../../library/enum.rst:269 +#: ../../library/enum.rst:270 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 " @@ -484,13 +483,13 @@ msgstr "" "重要,你可以使用 :class:`auto` 實例,它會為你選擇合適的值。更多細節請參考 :" "class:`auto`。" -#: ../../library/enum.rst:276 +#: ../../library/enum.rst:277 msgid "" "``_ignore_`` is only used during creation and is removed from the " "enumeration once creation is complete." msgstr "``_ignore_`` 只有在建立的時候用到,在列舉建立完成後會被移除。" -#: ../../library/enum.rst:279 +#: ../../library/enum.rst:280 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:" @@ -499,7 +498,7 @@ msgstr "" "``_ignore_`` 是一個不會變成成員的名稱串列,在列舉建立完成後其名稱會被移除。範" "例請參考 :ref:`TimePeriod `。" -#: ../../library/enum.rst:285 +#: ../../library/enum.rst:286 msgid "" "Returns ``['__class__', '__doc__', '__module__', 'name', 'value']`` and any " "public methods defined on *self.__class__*::" @@ -511,11 +510,11 @@ msgstr "" msgid "name" msgstr "name" -#: ../../library/enum.rst:306 +#: ../../library/enum.rst:307 msgid "The name of the member being defined (e.g. 'RED')." msgstr "定義的成員名稱(例如 'RED')。" -#: ../../library/enum.rst:307 +#: ../../library/enum.rst:308 msgid "The start value for the Enum; the default is 1." msgstr "列舉的開始值,預設為 1。" @@ -523,7 +522,7 @@ msgstr "列舉的開始值,預設為 1。" msgid "count" msgstr "count" -#: ../../library/enum.rst:308 +#: ../../library/enum.rst:309 msgid "The number of members currently defined, not including this one." msgstr "已定義的成員數量,不包含目前這一個。" @@ -531,23 +530,23 @@ msgstr "已定義的成員數量,不包含目前這一個。" msgid "last_values" msgstr "last_values" -#: ../../library/enum.rst:309 +#: ../../library/enum.rst:310 msgid "A list of the previous values." msgstr "一個之前值的串列。" -#: ../../library/enum.rst:311 +#: ../../library/enum.rst:312 msgid "" "A *staticmethod* that is used to determine the next value returned by :class:" "`auto`::" msgstr "一個 *staticmethod*,用來決定 :class:`auto` 下一個要回傳的值的: ::" -#: ../../library/enum.rst:327 +#: ../../library/enum.rst:328 msgid "" "A *classmethod* that is used to further configure subsequent subclasses. By " "default, does nothing." msgstr "一個 *classmethod*,用來進一步設定後續的子類別,預設不做任何事。" -#: ../../library/enum.rst:332 +#: ../../library/enum.rst:333 msgid "" "A *classmethod* for looking up values not found in *cls*. By default it " "does nothing, but can be overridden to implement custom search behavior::" @@ -555,7 +554,7 @@ msgstr "" "一個 *classmethod*,用來查詢在 *cls* 裡找不到的值。預設不做任何事,但可以被覆" "寫以實作客製化的搜尋行為: ::" -#: ../../library/enum.rst:354 +#: ../../library/enum.rst:355 msgid "" "Returns the string used for *repr()* calls. By default, returns the *Enum* " "name, member name, and value, but can be overridden::" @@ -563,7 +562,7 @@ msgstr "" "回傳呼叫 *repr()* 時使用的字串。預設回傳 *Enum* 名稱、成員名稱及值,但可以被" "覆寫: ::" -#: ../../library/enum.rst:370 +#: ../../library/enum.rst:371 msgid "" "Returns the string used for *str()* calls. By default, returns the *Enum* " "name and member name, but can be overridden::" @@ -571,7 +570,7 @@ msgstr "" "回傳呼叫 *str()* 時使用的字串。預設回傳 *Enum* 名稱及成員名稱,但可以被覆" "寫: ::" -#: ../../library/enum.rst:385 +#: ../../library/enum.rst:386 msgid "" "Returns the string used for *format()* and *f-string* calls. By default, " "returns :meth:`__str__` return value, but can be overridden::" @@ -579,17 +578,17 @@ msgstr "" "回傳呼叫 *format()* 及 *f-string* 時使用的字串。預設回傳 :meth:`__str__` 的回" "傳值,但可以被覆寫: ::" -#: ../../library/enum.rst:400 +#: ../../library/enum.rst:401 msgid "" "Using :class:`auto` with :class:`Enum` results in integers of increasing " "value, starting with ``1``." msgstr ":class:`Enum` 使用 :class:`auto` 會產生從 ``1`` 開始遞增的整數。" -#: ../../library/enum.rst:403 +#: ../../library/enum.rst:404 msgid "Added :ref:`enum-dataclass-support`" msgstr "新增 :ref:`enum-dataclass-support`" -#: ../../library/enum.rst:408 +#: ../../library/enum.rst:409 msgid "" "*IntEnum* is the same as *Enum*, but its members are also integers and can " "be used anywhere that an integer can be used. If any integer operation is " @@ -599,13 +598,13 @@ msgstr "" "*IntEnum* 和 *Enum* 一樣,但其成員同時也是整數而可以被用在任何使用整數的地" "方。如果 *IntEnum* 成員經過任何整數運算,其結果會失去列舉狀態。" -#: ../../library/enum.rst:429 +#: ../../library/enum.rst:430 msgid "" "Using :class:`auto` with :class:`IntEnum` results in integers of increasing " "value, starting with ``1``." msgstr ":class:`IntEnum` 使用 :class:`auto` 會產生從 ``1`` 開始遞增的整數。" -#: ../../library/enum.rst:432 +#: ../../library/enum.rst:433 msgid "" ":meth:`~object.__str__` is now :meth:`!int.__str__` to better support the " "*replacement of existing constants* use-case. :meth:`~object.__format__` was " @@ -615,7 +614,7 @@ msgstr "" "境,:meth:`~object.__str__` 現在會是 :meth:`!int.__str__`。為了同樣的理由,:" "meth:`~object.__format__` 已經是 :meth:`!int.__format__`。" -#: ../../library/enum.rst:439 +#: ../../library/enum.rst:440 msgid "" "*StrEnum* is the same as *Enum*, but its members are also strings and can be " "used in most of the same places that a string can be used. The result of " @@ -625,7 +624,7 @@ msgstr "" "*StrEnum* 和 *Enum* 一樣,但其成員同時也是字串而可以被用在幾乎所有使用字串的" "地方。*StrEnum* 成員經過任何字串操作的結果會不再是列舉的一部份。" -#: ../../library/enum.rst:445 +#: ../../library/enum.rst:446 msgid "" "There are places in the stdlib that check for an exact :class:`str` instead " "of a :class:`str` subclass (i.e. ``type(unknown) == str`` instead of " @@ -636,13 +635,13 @@ msgstr "" "是 ``type(unknown) == str`` 而不是 ``isinstance(unknown, str)``),在這些地方" "你需要使用 ``str(StrEnum.member)``。" -#: ../../library/enum.rst:452 +#: ../../library/enum.rst:453 msgid "" "Using :class:`auto` with :class:`StrEnum` results in the lower-cased member " "name as the value." msgstr ":class:`StrEnum` 使用 :class:`auto` 會產生小寫的成員名稱當作值。" -#: ../../library/enum.rst:457 +#: ../../library/enum.rst:458 msgid "" ":meth:`~object.__str__` is :meth:`!str.__str__` to better support the " "*replacement of existing constants* use-case. :meth:`~object.__format__` is " @@ -652,7 +651,7 @@ msgstr "" "境,:meth:`~object.__str__` 現在會是 :meth:`!str.__str__`。為了同樣的理由,:" "meth:`~object.__format__` 也會是 :meth:`!str.__format__`。" -#: ../../library/enum.rst:465 +#: ../../library/enum.rst:466 msgid "" "*Flag* members support the bitwise operators ``&`` (*AND*), ``|`` (*OR*), " "``^`` (*XOR*), and ``~`` (*INVERT*); the results of those operators are " @@ -661,43 +660,43 @@ msgstr "" "*Flag* 成員支援位元操作 ``&`` (*AND*)、``|`` (*OR*)、``^`` (*XOR*) 及 ``~`` " "(*INVERT*);這些操作的結果會是列舉成員。" -#: ../../library/enum.rst:471 +#: ../../library/enum.rst:472 msgid "Returns *True* if value is in self::" msgstr "如果 value 在 self 裡則回傳 *True*: ::" -#: ../../library/enum.rst:492 +#: ../../library/enum.rst:493 msgid "Returns all contained non-alias members::" msgstr "回傳所有包含的非別名成員: ::" -#: ../../library/enum.rst:501 +#: ../../library/enum.rst:502 msgid "Aliases are no longer returned during iteration." msgstr "疊代時不會再回傳別名。" -#: ../../library/enum.rst:505 +#: ../../library/enum.rst:506 msgid "Returns number of members in flag::" msgstr "回傳旗標裡的成員數量: ::" -#: ../../library/enum.rst:514 +#: ../../library/enum.rst:515 msgid "Returns *True* if any members in flag, *False* otherwise::" msgstr "如果成員在旗標裡則回傳 *True*,否則回傳 *False*: ::" -#: ../../library/enum.rst:526 +#: ../../library/enum.rst:527 msgid "Returns current flag binary or'ed with other::" msgstr "回傳和 other 做 OR 過後的二進位旗標: ::" -#: ../../library/enum.rst:533 +#: ../../library/enum.rst:534 msgid "Returns current flag binary and'ed with other::" msgstr "回傳和 other 做 AND 過後的二進位旗標: ::" -#: ../../library/enum.rst:542 +#: ../../library/enum.rst:543 msgid "Returns current flag binary xor'ed with other::" msgstr "回傳和 other 做 XOR 過後的二進位旗標: ::" -#: ../../library/enum.rst:551 +#: ../../library/enum.rst:552 msgid "Returns all the flags in *type(self)* that are not in self::" msgstr "回傳所有在 *type(self)* 但不在 self 裡的旗標: ::" -#: ../../library/enum.rst:562 +#: ../../library/enum.rst:563 msgid "" "Function used to format any remaining unnamed numeric values. Default is " "the value's repr; common choices are :func:`hex` and :func:`oct`." @@ -705,17 +704,17 @@ msgstr "" "用來格式化任何剩下未命名數值的函式。預設是值的 repr,常見選擇是 :func:`hex` " "和 :func:`oct`。" -#: ../../library/enum.rst:567 +#: ../../library/enum.rst:568 msgid "" "Using :class:`auto` with :class:`Flag` results in integers that are powers " "of two, starting with ``1``." msgstr ":class:`Flag` 使用 :class:`auto` 會產生從 ``1`` 開始 2 的次方的整數。" -#: ../../library/enum.rst:570 +#: ../../library/enum.rst:571 msgid "The *repr()* of zero-valued flags has changed. It is now::" msgstr "值為 0 的旗標的 *repr()* 已改變。現在是: ::" -#: ../../library/enum.rst:578 +#: ../../library/enum.rst:579 msgid "" "*IntFlag* is the same as *Flag*, but its members are also integers and can " "be used anywhere that an integer can be used." @@ -723,38 +722,38 @@ msgstr "" "*IntFlag* 和 *Flag* 一樣,但其成員同時也是整數而可以被用在任何使用整數的地" "方。" -#: ../../library/enum.rst:592 +#: ../../library/enum.rst:593 msgid "" "If any integer operation is performed with an *IntFlag* member, the result " "is not an *IntFlag*::" msgstr "如果 *IntFlag* 成員經過任何整數運算,其結果不是 *IntFlag*: ::" -#: ../../library/enum.rst:598 +#: ../../library/enum.rst:599 msgid "If a *Flag* operation is performed with an *IntFlag* member and:" msgstr "如果 *IntFlag* 成員經過 *Flag* 操作且:" -#: ../../library/enum.rst:600 +#: ../../library/enum.rst:601 msgid "the result is a valid *IntFlag*: an *IntFlag* is returned" msgstr "結果是合法的 *IntFlag*:回傳 *IntFlag*" -#: ../../library/enum.rst:601 +#: ../../library/enum.rst:602 msgid "" "the result is not a valid *IntFlag*: the result depends on the " "*FlagBoundary* setting" msgstr "結果不是合法的 *IntFlag*:結果會根據 *FlagBoundary* 的設定" -#: ../../library/enum.rst:603 +#: ../../library/enum.rst:604 msgid "The *repr()* of unnamed zero-valued flags has changed. It is now:" msgstr "未命名且值為 0 的旗標的 *repr()* 已改變。現在是: ::" -#: ../../library/enum.rst:610 +#: ../../library/enum.rst:611 msgid "" "Using :class:`auto` with :class:`IntFlag` results in integers that are " "powers of two, starting with ``1``." msgstr "" ":class:`IntFlag` 使用 :class:`auto` 會產生從 ``1`` 開始 2 的次方的整數。" -#: ../../library/enum.rst:615 +#: ../../library/enum.rst:616 msgid "" ":meth:`~object.__str__` is now :meth:`!int.__str__` to better support the " "*replacement of existing constants* use-case. :meth:`~object.__format__` " @@ -764,7 +763,7 @@ msgstr "" "境,:meth:`~object.__str__` 現在會是 :meth:`!int.__str__`。為了同樣的理由,:" "meth:`~object.__format__` 已經是 :meth:`!int.__format__`。" -#: ../../library/enum.rst:619 +#: ../../library/enum.rst:620 msgid "" "Inversion of an :class:`!IntFlag` now returns a positive value that is the " "union of all flags not in the given flag, rather than a negative value. This " @@ -773,7 +772,7 @@ msgstr "" ":class:`!IntFlag` 的反轉 (inversion) 現在會回傳正值,該值是不在給定旗標的所有" "旗標聯集,而不是一個負值。這符合現有 :class:`Flag` 的行為。" -#: ../../library/enum.rst:625 +#: ../../library/enum.rst:626 msgid "" ":class:`!ReprEnum` uses the :meth:`repr() ` of :class:`Enum`, " "but the :class:`str() ` of the mixed-in data type:" @@ -781,15 +780,15 @@ msgstr "" ":class:`!ReprEnum` 使用 :class:`Enum` 的 :meth:`repr() `,但使" "用混合資料類型的 :class:`str() `:" -#: ../../library/enum.rst:628 +#: ../../library/enum.rst:629 msgid ":meth:`!int.__str__` for :class:`IntEnum` and :class:`IntFlag`" msgstr "對 :class:`IntEnum` 和 :class:`IntFlag` 是 :meth:`!int.__str__`" -#: ../../library/enum.rst:629 +#: ../../library/enum.rst:630 msgid ":meth:`!str.__str__` for :class:`StrEnum`" msgstr "對 :class:`StrEnum` 是 :meth:`!str.__str__`" -#: ../../library/enum.rst:631 +#: ../../library/enum.rst:632 msgid "" "Inherit from :class:`!ReprEnum` to keep the :class:`str() ` / :func:" "`format` of the mixed-in data type instead of using the :class:`Enum`-" @@ -798,7 +797,7 @@ msgstr "" "繼承 :class:`!ReprEnum` 來保留混合資料類型的 :class:`str() ` / :func:" "`format`,而不是使用 :class:`Enum` 預設的 :meth:`str() `。" -#: ../../library/enum.rst:640 +#: ../../library/enum.rst:641 msgid "" "*EnumCheck* contains the options used by the :func:`verify` decorator to " "ensure various constraints; failed constraints result in a :exc:`ValueError`." @@ -806,17 +805,17 @@ msgstr "" "*EnumCheck* 包含 :func:`verify` 裝飾器使用的選項,以確保多樣的限制,不符合限" "制會產生 :exc:`ValueError`。" -#: ../../library/enum.rst:645 +#: ../../library/enum.rst:646 msgid "Ensure that each value has only one name::" msgstr "確保每個值只有一個名稱: ::" -#: ../../library/enum.rst:661 +#: ../../library/enum.rst:662 msgid "" "Ensure that there are no missing values between the lowest-valued member and " "the highest-valued member::" msgstr "確保在最小值成員跟最大值成員間沒有缺少值: ::" -#: ../../library/enum.rst:676 +#: ../../library/enum.rst:677 msgid "" "Ensure that any flag groups/masks contain only named flags -- useful when " "values are specified instead of being generated by :func:`auto`::" @@ -824,35 +823,35 @@ msgstr "" "確保任何旗標群組 / 遮罩只包含命名旗標 -- 當值是用指定而不是透過 :func:`auto` " "產生時是很實用的: ::" -#: ../../library/enum.rst:693 +#: ../../library/enum.rst:694 msgid "" "CONTINUOUS and NAMED_FLAGS are designed to work with integer-valued members." msgstr "CONTINUOUS 和 NAMED_FLAGS 是設計用來運作在整數值的成員上。" -#: ../../library/enum.rst:699 +#: ../../library/enum.rst:700 msgid "" "*FlagBoundary* controls how out-of-range values are handled in *Flag* and " "its subclasses." msgstr "*FlagBoundary* 控制在 *Flag* 及其子類別中如何處理範圍外的值。" -#: ../../library/enum.rst:704 +#: ../../library/enum.rst:705 msgid "" "Out-of-range values cause a :exc:`ValueError` to be raised. This is the " "default for :class:`Flag`::" msgstr "範圍外的值會引發 :exc:`ValueError`。這是 :class:`Flag` 的預設行為: ::" -#: ../../library/enum.rst:722 +#: ../../library/enum.rst:723 msgid "" "Out-of-range values have invalid values removed, leaving a valid *Flag* " "value::" msgstr "範圍外的值會移除非法值,留下合法的 *Flag* 值: ::" -#: ../../library/enum.rst:736 +#: ../../library/enum.rst:737 msgid "" "Out-of-range values lose their *Flag* membership and revert to :class:`int`." msgstr "範圍外的值會失去它們的 *Flag* 成員資格且恢復成 :class:`int`。" -#: ../../library/enum.rst:749 +#: ../../library/enum.rst:750 msgid "" "Out-of-range values are kept, and the *Flag* membership is kept. This is the " "default for :class:`IntFlag`::" @@ -860,11 +859,11 @@ msgstr "" "範圍外的值會被保留,*Flag* 成員資格也會被保留。這是 :class:`IntFlag` 的預設行" "為: ::" -#: ../../library/enum.rst:766 +#: ../../library/enum.rst:767 msgid "Supported ``__dunder__`` names" msgstr "支援 ``__dunder__`` 名稱" -#: ../../library/enum.rst:768 +#: ../../library/enum.rst:769 msgid "" ":attr:`~EnumType.__members__` is a read-only ordered mapping of " "``member_name``:``member`` items. It is only available on the class." @@ -872,7 +871,7 @@ msgstr "" ":attr:`~EnumType.__members__` 是一個唯讀有序的\\ ``成員名稱``:``成員``\\ 項目的" "對映。只有在類別上可用。" -#: ../../library/enum.rst:771 +#: ../../library/enum.rst:772 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_` " @@ -882,26 +881,26 @@ msgstr "" "的 :attr:`!_value_` 也是一個很好的主意。一旦所有成員都建立之後就不會再被用" "到。" -#: ../../library/enum.rst:777 +#: ../../library/enum.rst:778 msgid "Supported ``_sunder_`` names" msgstr "支援 ``_sunder_`` 名稱" -#: ../../library/enum.rst:779 +#: ../../library/enum.rst:780 msgid "``_name_`` -- name of the member" msgstr "``_name_`` -- 成員名稱" -#: ../../library/enum.rst:780 +#: ../../library/enum.rst:781 msgid "" "``_value_`` -- value of the member; can be set / modified in ``__new__``" msgstr "``_value_`` -- 成員的值;可以在 ``__new__`` 設定或修改" -#: ../../library/enum.rst:782 +#: ../../library/enum.rst:783 msgid "" "``_missing_`` -- a lookup function used when a value is not found; may be " "overridden" msgstr "``_missing_`` -- 當值沒有被找到時會使用的查詢函式;可以被覆寫" -#: ../../library/enum.rst:784 +#: ../../library/enum.rst:785 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 " @@ -910,7 +909,7 @@ msgstr "" "``_ignore_`` -- 可以是 :class:`list` 或 :class:`str` 的名稱串列,它不會被轉換" "成成員,且在最後的類別上會被移除" -#: ../../library/enum.rst:787 +#: ../../library/enum.rst:788 msgid "" "``_order_`` -- used in Python 2/3 code to ensure member order is consistent " "(class attribute, removed during class creation)" @@ -918,20 +917,20 @@ msgstr "" "``_order_`` -- 在 Python 2/3 的程式裡用來確保成員順序是一致的(類別屬性,在類" "別建立時移除)" -#: ../../library/enum.rst:789 +#: ../../library/enum.rst:790 msgid "" "``_generate_next_value_`` -- used to get an appropriate value for an enum " "member; may be overridden" msgstr "``_generate_next_value_`` -- 用來為列舉成員取得合適的值;可以被覆寫" -#: ../../library/enum.rst:794 +#: ../../library/enum.rst:795 msgid "" "For standard :class:`Enum` classes the next value chosen is the last value " "seen incremented by one." msgstr "" "對標準的 :class:`Enum` 類別來說,下一個被選擇的值是最後一個看見的值加一。" -#: ../../library/enum.rst:797 +#: ../../library/enum.rst:798 msgid "" "For :class:`Flag` classes the next value chosen will be the next highest " "power-of-two, regardless of the last value seen." @@ -939,19 +938,19 @@ msgstr "" "對 :class:`Flag` 類別來說,下一個被選擇的值是下一個最大的 2 的次方,不管最後" "一個看見的值是什麼。" -#: ../../library/enum.rst:800 +#: ../../library/enum.rst:801 msgid "``_missing_``, ``_order_``, ``_generate_next_value_``" msgstr "``_missing_``\\ 、\\ ``_order_``\\ 、\\ ``_generate_next_value_``" -#: ../../library/enum.rst:801 +#: ../../library/enum.rst:802 msgid "``_ignore_``" msgstr "``_ignore_``" -#: ../../library/enum.rst:806 +#: ../../library/enum.rst:807 msgid "Utilities and Decorators" msgstr "通用項目與裝飾器" -#: ../../library/enum.rst:810 +#: ../../library/enum.rst:811 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 " @@ -967,27 +966,27 @@ msgstr "" "2 的次方的數字;對 *StrEnum* 來說,是成員名稱的小寫版本。如果混用 *auto()* 和" "手動指定值的話要特別注意。" -#: ../../library/enum.rst:818 +#: ../../library/enum.rst:819 msgid "" "*auto* instances are only resolved when at the top level of an assignment:" msgstr "*auto* 實例只有在最上層的賦值時才會被解析:" -#: ../../library/enum.rst:820 +#: ../../library/enum.rst:821 msgid "``FIRST = auto()`` will work (auto() is replaced with ``1``);" msgstr "``FIRST = auto()`` 可以運作(auto() 會被取代成 ``1``)" -#: ../../library/enum.rst:821 +#: ../../library/enum.rst:822 msgid "" "``SECOND = auto(), -2`` will work (auto is replaced with ``2``, so ``2, -2`` " "is" msgstr "" "``SECOND = auto(), -2`` 可以運作(auto 會被取代成 ``2``, 因此 ``2, -2`` 會" -#: ../../library/enum.rst:822 +#: ../../library/enum.rst:823 msgid "used to create the ``SECOND`` enum member;" msgstr "被用來建立列舉成員 ``SECOND``;" -#: ../../library/enum.rst:823 +#: ../../library/enum.rst:824 msgid "" "``THREE = [auto(), -3]`` will *not* work (``, -3`` is used to " "create the ``THREE`` enum member)" @@ -995,19 +994,19 @@ msgstr "" "``THREE = [auto(), -3]`` *無法*\\ 運作(\\ ``, -3`` 會被用來建立列" "舉成員 ``THREE``)" -#: ../../library/enum.rst:828 +#: ../../library/enum.rst:829 msgid "" "In prior versions, ``auto()`` had to be the only thing on the assignment " "line to work properly." msgstr "在之前的版本中,``auto()`` 必須是賦值行裡的唯一內容才能運作正確。" -#: ../../library/enum.rst:831 +#: ../../library/enum.rst:832 msgid "" "``_generate_next_value_`` can be overridden to customize the values used by " "*auto*." msgstr "可以覆寫 ``_generate_next_value_`` 來客製 *auto* 使用的值。" -#: ../../library/enum.rst:834 +#: ../../library/enum.rst:835 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 " @@ -1016,7 +1015,7 @@ msgstr "" "在 3.13 預設 ``_generate_next_value_`` 總是回傳最大的成員值加一,如果任何成員" "是不相容的類型就會失敗。" -#: ../../library/enum.rst:840 +#: ../../library/enum.rst:841 msgid "" "A decorator similar to the built-in *property*, but specifically for " "enumerations. It allows member attributes to have the same names as members " @@ -1025,7 +1024,7 @@ msgstr "" "和內建的 *property* 相似的裝飾器,但只專門針對列舉。它允許成員屬性和成員本身" "有相同名稱。" -#: ../../library/enum.rst:844 +#: ../../library/enum.rst:845 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, " @@ -1035,7 +1034,7 @@ msgstr "" "*屬性*\\ 和成員必須定義在分開的類別裡;例如 *value* 和 *name* 屬性定義在 " "*Enum* 類別而 *Enum* 子類別可以定義成員名稱為 ``value`` 和 ``name``。" -#: ../../library/enum.rst:853 +#: ../../library/enum.rst:854 msgid "" "A :keyword:`class` decorator specifically for enumerations. It searches an " "enumeration's :attr:`~EnumType.__members__`, gathering any aliases it finds; " @@ -1045,7 +1044,7 @@ msgstr "" "__members__`,蒐集任何它找到的別名;如果有找到任何別名則引發 :exc:" "`ValueError` 並附上細節: ::" -#: ../../library/enum.rst:871 +#: ../../library/enum.rst:872 msgid "" "A :keyword:`class` decorator specifically for enumerations. Members from :" "class:`EnumCheck` are used to specify which constraints should be checked on " @@ -1054,15 +1053,15 @@ msgstr "" "專門針對列舉的 :keyword:`class` 裝飾器。使用 :class:`EnumCheck` 裡的成員來指" "定在裝飾的列舉上應該檢查什麼限制。" -#: ../../library/enum.rst:879 +#: ../../library/enum.rst:880 msgid "A decorator for use in enums: its target will become a member." msgstr "列舉所使用的裝飾器:其目標會變成成員。" -#: ../../library/enum.rst:885 +#: ../../library/enum.rst:886 msgid "A decorator for use in enums: its target will not become a member." msgstr "列舉所使用的裝飾器:其目標不會變成成員。" -#: ../../library/enum.rst:891 +#: ../../library/enum.rst:892 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 " @@ -1073,19 +1072,19 @@ msgstr "" "組而不是其類別。應該只有當列舉成員被匯出到模組的全域命名空間才使用(範例請參" "考 :class:`re.RegexFlag`)。" -#: ../../library/enum.rst:901 +#: ../../library/enum.rst:902 msgid "Return a list of all power-of-two integers contained in a flag *value*." msgstr "回傳在旗標\\ *值*\\ 中包含的所有 2 的次方的整數串列。" -#: ../../library/enum.rst:908 +#: ../../library/enum.rst:909 msgid "Notes" msgstr "備註" -#: ../../library/enum.rst:910 +#: ../../library/enum.rst:911 msgid ":class:`IntEnum`, :class:`StrEnum`, and :class:`IntFlag`" msgstr ":class:`IntEnum`、:class:`StrEnum` 及 :class:`IntFlag`" -#: ../../library/enum.rst:912 +#: ../../library/enum.rst:913 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:" @@ -1093,17 +1092,17 @@ msgstr "" "這三種列舉類型是設計來直接取代現有以整數及字串為基底的值;因此它們有額外的限" "制:" -#: ../../library/enum.rst:915 +#: ../../library/enum.rst:916 msgid "``__str__`` uses the value and not the name of the enum member" msgstr "``__str__`` 使用值而不是列舉成員的名稱" -#: ../../library/enum.rst:917 +#: ../../library/enum.rst:918 msgid "" "``__format__``, because it uses ``__str__``, will also use the value of the " "enum member instead of its name" msgstr "``__format__`` 因為使用 ``__str__``,也會使用值而不是列舉成員的名稱" -#: ../../library/enum.rst:920 +#: ../../library/enum.rst:921 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::" @@ -1111,7 +1110,7 @@ msgstr "" "如果你不需要或不想要這些限制,你可以透過混合 ``int`` 或 ``str`` 類型來建立自" "己的基礎類別: ::" -#: ../../library/enum.rst:927 +#: ../../library/enum.rst:928 msgid "or you can reassign the appropriate :meth:`str`, etc., in your enum::" msgstr "或者你也可以在你的列舉重新給定合適的 :meth:`str`: ::" diff --git a/library/fcntl.po b/library/fcntl.po index 2a60f76aa3..8487abb927 100644 --- a/library/fcntl.po +++ b/library/fcntl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 00:03+0000\n" +"POT-Creation-Date: 2023-11-01 00:03+0000\n" "PO-Revision-Date: 2017-09-22 18:26+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -30,18 +30,9 @@ msgid "" "`ioctl(2)` Unix manual pages." msgstr "" -#: ../../includes/wasm-notavail.rst:3 -msgid ":ref:`Availability `: not Emscripten, not WASI." -msgstr "" - -#: ../../includes/wasm-notavail.rst:5 -msgid "" -"This module does not work or is not available on WebAssembly platforms " -"``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " -"more information." -msgstr "" -"此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法作用" -"或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" +#: ../../library/fcntl.rst:21 +msgid ":ref:`Availability `: Unix, not Emscripten, not WASI." +msgstr ":ref:`適用 `:Unix、非 Emscripten、非 WASI。" #: ../../library/fcntl.rst:23 msgid "" @@ -122,7 +113,7 @@ msgstr "" msgid "If the :c:func:`fcntl` fails, an :exc:`OSError` is raised." msgstr "" -#: ../../library/fcntl.rst:96 +#: ../../library/fcntl.rst:85 msgid "" "Raises an :ref:`auditing event ` ``fcntl.fcntl`` with arguments " "``fd``, ``cmd``, ``arg``." @@ -193,7 +184,7 @@ msgstr "" "\n" "::" -#: ../../library/fcntl.rst:147 +#: ../../library/fcntl.rst:136 msgid "" "Raises an :ref:`auditing event ` ``fcntl.ioctl`` with arguments " "``fd``, ``request``, ``arg``." @@ -213,7 +204,7 @@ msgstr "" msgid "If the :c:func:`flock` fails, an :exc:`OSError` exception is raised." msgstr "" -#: ../../library/fcntl.rst:159 +#: ../../library/fcntl.rst:148 msgid "" "Raises an :ref:`auditing event ` ``fcntl.flock`` with arguments " "``fd``, ``operation``." @@ -279,7 +270,7 @@ msgid "" "file. The default for *whence* is also 0." msgstr "" -#: ../../library/fcntl.rst:194 +#: ../../library/fcntl.rst:183 msgid "" "Raises an :ref:`auditing event ` ``fcntl.lockf`` with arguments " "``fd``, ``cmd``, ``len``, ``start``, ``whence``." @@ -321,3 +312,11 @@ msgstr "file control(檔案控制)" #: ../../library/fcntl.rst:10 msgid "I/O control" msgstr "I/O control(I/O 控制)" + +#~ msgid "" +#~ "This module does not work or is not available on WebAssembly platforms " +#~ "``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` " +#~ "for more information." +#~ msgstr "" +#~ "此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法" +#~ "作用或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" diff --git a/library/functions.po b/library/functions.po index 85c5c1ace1..2b6a0f7429 100644 --- a/library/functions.po +++ b/library/functions.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-11 17:13+0000\n" +"POT-Creation-Date: 2023-10-20 00:03+0000\n" "PO-Revision-Date: 2023-07-02 22:53+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1745,18 +1745,18 @@ msgid "" "differently depending on the presence of the second argument. Without a " "second argument, *object* must be a collection object which supports the :" "term:`iterable` protocol (the :meth:`__iter__` method), or it must support " -"the sequence protocol (the :meth:`__getitem__` method with integer arguments " -"starting at ``0``). If it does not support either of those protocols, :exc:" -"`TypeError` is raised. If the second argument, *sentinel*, is given, then " -"*object* must be a callable object. The iterator created in this case will " -"call *object* with no arguments for each call to its :meth:`~iterator." -"__next__` method; if the value returned is equal to *sentinel*, :exc:" -"`StopIteration` will be raised, otherwise the value will be returned." +"the sequence protocol (the :meth:`~object.__getitem__` method with integer " +"arguments starting at ``0``). If it does not support either of those " +"protocols, :exc:`TypeError` is raised. If the second argument, *sentinel*, " +"is given, then *object* must be a callable object. The iterator created in " +"this case will call *object* with no arguments for each call to its :meth:" +"`~iterator.__next__` method; if the value returned is equal to *sentinel*, :" +"exc:`StopIteration` will be raised, otherwise the value will be returned." msgstr "" "回傳一個 :term:`iterator` 物件。根據是否存在第二個引數,第一個引數的意義是非" "常不同的。如果沒有第二個引數,*object* 必須是支援 :term:`iterable` 協定(有 :" -"meth:`__iter__` method)的集合物件,或必須支援序列協定(有 :meth:" -"`__getitem__` 方法,且數字引數從 ``0`` 開始)。如果它不支援這些協定,會觸發 :" +"meth:`__iter__` method)的集合物件,或必須支援序列協定(有 :meth:`~object." +"__getitem__` 方法,且數字引數從 ``0`` 開始)。如果它不支援這些協定,會觸發 :" "exc:`TypeError`。如果有第二個引數 *sentinel*,那麼 *object* 必須是可呼叫的物" "件,這種情況下生成的 iterator,每次疊代呼叫 :meth:`~iterator.__next__` 時會不" "帶引數地呼叫 *object*\\ ;如果回傳的結果是 *sentinel* 則觸發 :exc:" @@ -2509,8 +2509,8 @@ msgstr "" msgid "" "Return a reverse :term:`iterator`. *seq* must be an object which has a :" "meth:`__reversed__` method or supports the sequence protocol (the :meth:" -"`__len__` method and the :meth:`__getitem__` method with integer arguments " -"starting at ``0``)." +"`__len__` method and the :meth:`~object.__getitem__` method with integer " +"arguments starting at ``0``)." msgstr "" #: ../../library/functions.rst:1572 diff --git a/library/getpass.po b/library/getpass.po index 828e2edc0d..2b69eeadeb 100644 --- a/library/getpass.po +++ b/library/getpass.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:17+0000\n" +"POT-Creation-Date: 2023-10-20 00:03+0000\n" "PO-Revision-Date: 2022-02-11 12:04+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -88,15 +88,15 @@ msgstr "回傳使用者的\"登入名稱\"。" #: ../../library/getpass.rst:45 msgid "" "This function checks the environment variables :envvar:`LOGNAME`, :envvar:" -"`USER`, :envvar:`LNAME` and :envvar:`USERNAME`, in order, and returns the " +"`USER`, :envvar:`!LNAME` and :envvar:`USERNAME`, in order, and returns the " "value of the first one which is set to a non-empty string. If none are set, " "the login name from the password database is returned on systems which " "support the :mod:`pwd` module, otherwise, an exception is raised." msgstr "" -"此函式會按順序檢查環境變數 :envvar:`LOGNAME`\\ 、\\ :envvar:`USER`\\ 、\\ :" -"envvar:`LNAME` 和 :envvar:`USERNAME`,並回傳其中第一個被設定成非空字串的值。" -"如果均未設定,則在支援 :mod:`pwd` 模組的系統上將會回傳來自密碼資料庫的登入名" -"稱,否則將引發一個例外。" +"此函式會按順序檢查環境變數 :envvar:`LOGNAME`、:envvar:`USER`、:envvar:`!" +"LNAME` 和 :envvar:`USERNAME`,並回傳其中第一個被設定成非空字串的值。如果均未" +"設定,則在支援 :mod:`pwd` 模組的系統上將會回傳來自密碼資料庫的登入名稱,否則" +"將引發一個例外。" #: ../../library/getpass.rst:52 msgid "" diff --git a/library/grp.po b/library/grp.po index a216d5d66f..7561672a82 100644 --- a/library/grp.po +++ b/library/grp.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:17+0000\n" +"POT-Creation-Date: 2023-11-01 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:02+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -28,18 +28,9 @@ msgid "" "all Unix versions." msgstr "" -#: ../../includes/wasm-notavail.rst:3 -msgid ":ref:`Availability `: not Emscripten, not WASI." -msgstr "" - -#: ../../includes/wasm-notavail.rst:5 -msgid "" -"This module does not work or is not available on WebAssembly platforms " -"``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " -"more information." -msgstr "" -"此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法作用" -"或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" +#: ../../library/grp.rst:13 +msgid ":ref:`Availability `: Unix, not Emscripten, not WASI." +msgstr ":ref:`適用 `:Unix、非 Emscripten、非 WASI。" #: ../../library/grp.rst:15 msgid "" @@ -159,3 +150,11 @@ msgstr ":mod:`spwd` 模組" #: ../../library/grp.rst:68 msgid "An interface to the shadow password database, similar to this." msgstr "" + +#~ msgid "" +#~ "This module does not work or is not available on WebAssembly platforms " +#~ "``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` " +#~ "for more information." +#~ msgstr "" +#~ "此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法" +#~ "作用或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" diff --git a/library/inspect.po b/library/inspect.po index 8f55ff930d..b8d5bf3058 100644 --- a/library/inspect.po +++ b/library/inspect.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-12 00:03+0000\n" +"POT-Creation-Date: 2023-10-24 00:03+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-" @@ -911,6 +911,12 @@ msgstr "" #: ../../library/inspect.rst:643 msgid "" +"If the passed object has a ``__signature__`` attribute, this function " +"returns it without further computations." +msgstr "" + +#: ../../library/inspect.rst:646 +msgid "" "For objects defined in modules using stringized annotations (``from " "__future__ import annotations``), :func:`signature` will attempt to " "automatically un-stringize the annotations using :func:`inspect." @@ -920,7 +926,7 @@ msgid "" "instructions on how to use these parameters." msgstr "" -#: ../../library/inspect.rst:652 +#: ../../library/inspect.rst:655 msgid "" "Raises :exc:`ValueError` if no signature can be provided, and :exc:" "`TypeError` if that type of object is not supported. Also, if the " @@ -929,39 +935,39 @@ msgid "" "exception." msgstr "" -#: ../../library/inspect.rst:658 +#: ../../library/inspect.rst:661 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:662 +#: ../../library/inspect.rst:665 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:667 +#: ../../library/inspect.rst:670 msgid "``globals``, ``locals``, and ``eval_str`` parameters." msgstr "" -#: ../../library/inspect.rst:672 +#: ../../library/inspect.rst:675 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:679 +#: ../../library/inspect.rst:682 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:683 +#: ../../library/inspect.rst:686 msgid "" "The optional *parameters* argument is a sequence of :class:`Parameter` " "objects, which is validated to check that there are no parameters with " @@ -970,54 +976,54 @@ msgid "" "defaults follow parameters without defaults." msgstr "" -#: ../../library/inspect.rst:689 +#: ../../library/inspect.rst:692 msgid "" "The optional *return_annotation* argument, can be an arbitrary Python " "object, is the \"return\" annotation of the callable." msgstr "" -#: ../../library/inspect.rst:692 +#: ../../library/inspect.rst:695 msgid "" "Signature objects are *immutable*. Use :meth:`Signature.replace` to make a " "modified copy." msgstr "" -#: ../../library/inspect.rst:695 +#: ../../library/inspect.rst:698 msgid "Signature objects are picklable and :term:`hashable`." msgstr "" -#: ../../library/inspect.rst:700 +#: ../../library/inspect.rst:703 msgid "A special class-level marker to specify absence of a return annotation." msgstr "" -#: ../../library/inspect.rst:704 +#: ../../library/inspect.rst:707 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:708 ../../library/inspect.rst:1034 +#: ../../library/inspect.rst:711 ../../library/inspect.rst:1039 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:715 +#: ../../library/inspect.rst:718 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:720 +#: ../../library/inspect.rst:723 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:726 +#: ../../library/inspect.rst:729 msgid "" "Works the same way as :meth:`Signature.bind`, but allows the omission of " "some required arguments (mimics :func:`functools.partial` behavior.) " @@ -1025,7 +1031,7 @@ msgid "" "arguments do not match the signature." msgstr "" -#: ../../library/inspect.rst:733 +#: ../../library/inspect.rst:736 msgid "" "Create a new Signature instance based on the instance :meth:`replace` was " "invoked on. It is possible to pass different ``parameters`` and/or " @@ -1034,7 +1040,7 @@ msgid "" "attr:`Signature.empty`." msgstr "" -#: ../../library/inspect.rst:751 +#: ../../library/inspect.rst:754 msgid "" "Return a :class:`Signature` (or its subclass) object for a given callable " "``obj``. Pass ``follow_wrapped=False`` to get a signature of ``obj`` " @@ -1042,139 +1048,143 @@ msgid "" "will be used as the namespaces when resolving annotations." msgstr "" -#: ../../library/inspect.rst:756 +#: ../../library/inspect.rst:759 msgid "This method simplifies subclassing of :class:`Signature`::" msgstr "" -#: ../../library/inspect.rst:765 +#: ../../library/inspect.rst:766 +msgid "Its behavior is otherwise identical to that of :func:`signature`." +msgstr "" + +#: ../../library/inspect.rst:770 msgid "``globalns`` and ``localns`` parameters." msgstr "" -#: ../../library/inspect.rst:771 +#: ../../library/inspect.rst:776 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:774 +#: ../../library/inspect.rst:779 msgid "Parameter objects are picklable and :term:`hashable`." msgstr "" -#: ../../library/inspect.rst:779 +#: ../../library/inspect.rst:784 msgid "" "A special class-level marker to specify absence of default values and " "annotations." msgstr "" -#: ../../library/inspect.rst:784 +#: ../../library/inspect.rst:789 msgid "" "The name of the parameter as a string. The name must be a valid Python " "identifier." msgstr "" -#: ../../library/inspect.rst:789 +#: ../../library/inspect.rst:794 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:793 +#: ../../library/inspect.rst:798 msgid "" "These parameter names are exposed by this module as names like ``implicit0``." msgstr "" -#: ../../library/inspect.rst:799 +#: ../../library/inspect.rst:804 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:804 +#: ../../library/inspect.rst:809 msgid "" "The annotation for the parameter. If the parameter has no annotation, this " "attribute is set to :attr:`Parameter.empty`." msgstr "" -#: ../../library/inspect.rst:809 +#: ../../library/inspect.rst:814 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:816 +#: ../../library/inspect.rst:821 msgid "Name" msgstr "名稱" -#: ../../library/inspect.rst:816 +#: ../../library/inspect.rst:821 msgid "Meaning" msgstr "意義" -#: ../../library/inspect.rst:818 +#: ../../library/inspect.rst:823 msgid "*POSITIONAL_ONLY*" msgstr "*POSITIONAL_ONLY*" -#: ../../library/inspect.rst:818 +#: ../../library/inspect.rst:823 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:823 +#: ../../library/inspect.rst:828 msgid "*POSITIONAL_OR_KEYWORD*" msgstr "*POSITIONAL_OR_KEYWORD*" -#: ../../library/inspect.rst:823 +#: ../../library/inspect.rst:828 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:828 +#: ../../library/inspect.rst:833 msgid "*VAR_POSITIONAL*" msgstr "*VAR_POSITIONAL*" -#: ../../library/inspect.rst:828 +#: ../../library/inspect.rst:833 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:833 +#: ../../library/inspect.rst:838 msgid "*KEYWORD_ONLY*" msgstr "*KEYWORD_ONLY*" -#: ../../library/inspect.rst:833 +#: ../../library/inspect.rst:838 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:838 +#: ../../library/inspect.rst:843 msgid "*VAR_KEYWORD*" msgstr "*VAR_KEYWORD*" -#: ../../library/inspect.rst:838 +#: ../../library/inspect.rst:843 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:844 +#: ../../library/inspect.rst:849 msgid "Example: print all keyword-only arguments without default values::" msgstr "" -#: ../../library/inspect.rst:858 +#: ../../library/inspect.rst:863 msgid "Describes a enum value of Parameter.kind." msgstr "" -#: ../../library/inspect.rst:862 +#: ../../library/inspect.rst:867 msgid "Example: print all descriptions of arguments::" msgstr "" -#: ../../library/inspect.rst:877 +#: ../../library/inspect.rst:882 msgid "" "Create a new Parameter instance based on the instance replaced was invoked " "on. To override a :class:`Parameter` attribute, pass the corresponding " @@ -1182,94 +1192,94 @@ msgid "" "pass :attr:`Parameter.empty`." msgstr "" -#: ../../library/inspect.rst:895 +#: ../../library/inspect.rst:900 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:902 +#: ../../library/inspect.rst:907 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:907 +#: ../../library/inspect.rst:912 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:911 +#: ../../library/inspect.rst:916 msgid "" "Should be used in conjunction with :attr:`Signature.parameters` for any " "argument processing purposes." msgstr "" -#: ../../library/inspect.rst:916 +#: ../../library/inspect.rst:921 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:921 +#: ../../library/inspect.rst:926 msgid "" ":attr:`arguments` is now of type :class:`dict`. Formerly, it was of type :" "class:`collections.OrderedDict`." msgstr "" -#: ../../library/inspect.rst:927 +#: ../../library/inspect.rst:932 msgid "" "A tuple of positional arguments values. Dynamically computed from the :attr:" "`arguments` attribute." msgstr "" -#: ../../library/inspect.rst:932 +#: ../../library/inspect.rst:937 msgid "" "A dict of keyword arguments values. Dynamically computed from the :attr:" "`arguments` attribute." msgstr "" -#: ../../library/inspect.rst:937 +#: ../../library/inspect.rst:942 msgid "A reference to the parent :class:`Signature` object." msgstr "" -#: ../../library/inspect.rst:941 +#: ../../library/inspect.rst:946 msgid "Set default values for missing arguments." msgstr "" -#: ../../library/inspect.rst:943 +#: ../../library/inspect.rst:948 msgid "" "For variable-positional arguments (``*args``) the default is an empty tuple." msgstr "" -#: ../../library/inspect.rst:946 +#: ../../library/inspect.rst:951 msgid "" "For variable-keyword arguments (``**kwargs``) the default is an empty dict." msgstr "" -#: ../../library/inspect.rst:959 +#: ../../library/inspect.rst:964 msgid "" "The :attr:`args` and :attr:`kwargs` properties can be used to invoke " "functions::" msgstr "" -#: ../../library/inspect.rst:972 +#: ../../library/inspect.rst:977 msgid ":pep:`362` - Function Signature Object." msgstr "" -#: ../../library/inspect.rst:973 +#: ../../library/inspect.rst:978 msgid "The detailed specification, implementation details and examples." msgstr "" -#: ../../library/inspect.rst:979 +#: ../../library/inspect.rst:984 msgid "Classes and functions" msgstr "" -#: ../../library/inspect.rst:983 +#: ../../library/inspect.rst:988 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 " @@ -1280,19 +1290,19 @@ msgid "" "will appear multiple times." msgstr "" -#: ../../library/inspect.rst:994 +#: ../../library/inspect.rst:999 msgid "" "Get the names and default values of a Python function's parameters. A :term:" "`named tuple` is returned:" msgstr "" -#: ../../library/inspect.rst:997 +#: ../../library/inspect.rst:1002 msgid "" "``FullArgSpec(args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, " "annotations)``" msgstr "" -#: ../../library/inspect.rst:1000 +#: ../../library/inspect.rst:1005 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 " @@ -1307,7 +1317,7 @@ msgid "" "report the function return value annotation (if any)." msgstr "" -#: ../../library/inspect.rst:1015 +#: ../../library/inspect.rst:1020 msgid "" "Note that :func:`signature` and :ref:`Signature Object ` provide the recommended API for callable introspection, and support " @@ -1317,14 +1327,14 @@ msgid "" "``inspect`` module API." msgstr "" -#: ../../library/inspect.rst:1022 +#: ../../library/inspect.rst:1027 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:1027 +#: ../../library/inspect.rst:1032 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 " @@ -1332,7 +1342,7 @@ msgid "" "code migrating away from the legacy :func:`getargspec` API." msgstr "" -#: ../../library/inspect.rst:1042 +#: ../../library/inspect.rst:1047 msgid "" "Get information about arguments passed into a particular frame. A :term:" "`named tuple` ``ArgInfo(args, varargs, keywords, locals)`` is returned. " @@ -1341,18 +1351,18 @@ msgid "" "dictionary of the given frame." msgstr "" -#: ../../library/inspect.rst:1049 ../../library/inspect.rst:1059 +#: ../../library/inspect.rst:1054 ../../library/inspect.rst:1064 msgid "This function was inadvertently marked as deprecated in Python 3.5." msgstr "" -#: ../../library/inspect.rst:1054 +#: ../../library/inspect.rst:1059 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:1064 +#: ../../library/inspect.rst:1069 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 " @@ -1360,7 +1370,7 @@ msgid "" "user-defined metatype is in use, cls will be the first element of the tuple." msgstr "" -#: ../../library/inspect.rst:1072 +#: ../../library/inspect.rst:1077 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 " @@ -1373,11 +1383,11 @@ msgid "" "example::" msgstr "" -#: ../../library/inspect.rst:1096 +#: ../../library/inspect.rst:1101 msgid "Use :meth:`Signature.bind` and :meth:`Signature.bind_partial` instead." msgstr "" -#: ../../library/inspect.rst:1102 +#: ../../library/inspect.rst:1107 msgid "" "Get the mapping of external name references in a Python function or method " "*func* to their current values. A :term:`named tuple` " @@ -1389,18 +1399,18 @@ msgid "" "builtins." msgstr "" -#: ../../library/inspect.rst:1111 +#: ../../library/inspect.rst:1116 msgid "" ":exc:`TypeError` is raised if *func* is not a Python function or method." msgstr "" -#: ../../library/inspect.rst:1118 +#: ../../library/inspect.rst:1123 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:1121 +#: ../../library/inspect.rst:1126 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 " @@ -1410,68 +1420,68 @@ msgid "" "``__signature__`` attribute defined." msgstr "" -#: ../../library/inspect.rst:1128 +#: ../../library/inspect.rst:1133 msgid ":exc:`ValueError` is raised if a cycle is encountered." msgstr "" -#: ../../library/inspect.rst:1135 +#: ../../library/inspect.rst:1140 msgid "Compute the annotations dict for an object." msgstr "" -#: ../../library/inspect.rst:1137 +#: ../../library/inspect.rst:1142 msgid "" "``obj`` may be a callable, class, or module. Passing in an object of any " "other type raises :exc:`TypeError`." msgstr "" -#: ../../library/inspect.rst:1140 +#: ../../library/inspect.rst:1145 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:1144 +#: ../../library/inspect.rst:1149 msgid "This function handles several details for you:" msgstr "" -#: ../../library/inspect.rst:1146 +#: ../../library/inspect.rst:1151 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:1150 +#: ../../library/inspect.rst:1155 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:1154 +#: ../../library/inspect.rst:1159 msgid "" "Ignores inherited annotations on classes. If a class doesn't have its own " "annotations dict, returns an empty dict." msgstr "" -#: ../../library/inspect.rst:1156 +#: ../../library/inspect.rst:1161 msgid "" "All accesses to object members and dict values are done using ``getattr()`` " "and ``dict.get()`` for safety." msgstr "" -#: ../../library/inspect.rst:1158 +#: ../../library/inspect.rst:1163 msgid "Always, always, always returns a freshly created dict." msgstr "" -#: ../../library/inspect.rst:1160 +#: ../../library/inspect.rst:1165 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:1163 +#: ../../library/inspect.rst:1168 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()` " @@ -1479,12 +1489,12 @@ msgid "" "call.)" msgstr "" -#: ../../library/inspect.rst:1167 +#: ../../library/inspect.rst:1172 msgid "" "If eval_str is false (the default), values of type ``str`` are unchanged." msgstr "" -#: ../../library/inspect.rst:1169 +#: ../../library/inspect.rst:1174 msgid "" "``globals`` and ``locals`` are passed in to :func:`eval()`; see the " "documentation for :func:`eval()` for more information. If ``globals`` or " @@ -1492,35 +1502,35 @@ msgid "" "specific default, contingent on ``type(obj)``:" msgstr "" -#: ../../library/inspect.rst:1174 +#: ../../library/inspect.rst:1179 msgid "If ``obj`` is a module, ``globals`` defaults to ``obj.__dict__``." msgstr "" -#: ../../library/inspect.rst:1175 +#: ../../library/inspect.rst:1180 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:1178 +#: ../../library/inspect.rst:1183 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:1182 +#: ../../library/inspect.rst:1187 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:1192 +#: ../../library/inspect.rst:1197 msgid "The interpreter stack" msgstr "" -#: ../../library/inspect.rst:1194 +#: ../../library/inspect.rst:1199 msgid "" "Some of the following functions return :class:`FrameInfo` objects. For " "backwards compatibility these objects allow tuple-like operations on all " @@ -1528,95 +1538,95 @@ msgid "" "may be removed in the future." msgstr "" -#: ../../library/inspect.rst:1203 +#: ../../library/inspect.rst:1208 msgid "The :ref:`frame object ` that the record corresponds to." msgstr "" -#: ../../library/inspect.rst:1207 +#: ../../library/inspect.rst:1212 msgid "" "The file name associated with the code being executed by the frame this " "record corresponds to." msgstr "" -#: ../../library/inspect.rst:1212 +#: ../../library/inspect.rst:1217 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:1217 +#: ../../library/inspect.rst:1222 msgid "" "The function name that is being executed by the frame this record " "corresponds to." msgstr "" -#: ../../library/inspect.rst:1221 +#: ../../library/inspect.rst:1226 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:1226 ../../library/inspect.rst:1265 +#: ../../library/inspect.rst:1231 ../../library/inspect.rst:1270 msgid "" "The index of the current line being executed in the :attr:`code_context` " "list." msgstr "" -#: ../../library/inspect.rst:1230 +#: ../../library/inspect.rst:1235 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:1234 +#: ../../library/inspect.rst:1239 msgid "Return a :term:`named tuple` instead of a :class:`tuple`." msgstr "" -#: ../../library/inspect.rst:1237 +#: ../../library/inspect.rst:1242 msgid "" ":class:`!FrameInfo` is now a class instance (that is backwards compatible " "with the previous :term:`named tuple`)." msgstr "" -#: ../../library/inspect.rst:1246 +#: ../../library/inspect.rst:1251 msgid "" "The file name associated with the code being executed by the frame this " "traceback corresponds to." msgstr "" -#: ../../library/inspect.rst:1251 +#: ../../library/inspect.rst:1256 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:1256 +#: ../../library/inspect.rst:1261 msgid "" "The function name that is being executed by the frame this traceback " "corresponds to." msgstr "" -#: ../../library/inspect.rst:1260 +#: ../../library/inspect.rst:1265 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:1269 +#: ../../library/inspect.rst:1274 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:1274 +#: ../../library/inspect.rst:1279 msgid "" ":class:`!Traceback` is now a class instance (that is backwards compatible " "with the previous :term:`named tuple`)." msgstr "" -#: ../../library/inspect.rst:1281 +#: ../../library/inspect.rst:1286 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 " @@ -1628,7 +1638,7 @@ msgid "" "consumption which occurs." msgstr "" -#: ../../library/inspect.rst:1289 +#: ../../library/inspect.rst:1294 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 :" @@ -1636,31 +1646,31 @@ msgid "" "disabled when Python was compiled or using :func:`gc.disable`. For example::" msgstr "" -#: ../../library/inspect.rst:1301 +#: ../../library/inspect.rst:1306 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:1305 +#: ../../library/inspect.rst:1310 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:1312 +#: ../../library/inspect.rst:1317 msgid "" "Get information about a frame or traceback object. A :class:`Traceback` " "object is returned." msgstr "" -#: ../../library/inspect.rst:1315 +#: ../../library/inspect.rst:1320 msgid "A :class:`Traceback` object is returned instead of a named tuple." msgstr "" -#: ../../library/inspect.rst:1320 +#: ../../library/inspect.rst:1325 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 " @@ -1668,19 +1678,19 @@ msgid "" "represents the outermost call on *frame*'s stack." msgstr "" -#: ../../library/inspect.rst:1325 ../../library/inspect.rst:1340 -#: ../../library/inspect.rst:1366 ../../library/inspect.rst:1381 +#: ../../library/inspect.rst:1330 ../../library/inspect.rst:1345 +#: ../../library/inspect.rst:1371 ../../library/inspect.rst:1386 msgid "" "A list of :term:`named tuples ` ``FrameInfo(frame, filename, " "lineno, function, code_context, index)`` is returned." msgstr "" -#: ../../library/inspect.rst:1330 ../../library/inspect.rst:1345 -#: ../../library/inspect.rst:1371 ../../library/inspect.rst:1386 +#: ../../library/inspect.rst:1335 ../../library/inspect.rst:1350 +#: ../../library/inspect.rst:1376 ../../library/inspect.rst:1391 msgid "A list of :class:`FrameInfo` objects is returned." msgstr "" -#: ../../library/inspect.rst:1335 +#: ../../library/inspect.rst:1340 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 " @@ -1688,11 +1698,11 @@ msgid "" "represents where the exception was raised." msgstr "" -#: ../../library/inspect.rst:1350 +#: ../../library/inspect.rst:1355 msgid "Return the frame object for the caller's stack frame." msgstr "" -#: ../../library/inspect.rst:1354 +#: ../../library/inspect.rst:1359 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 " @@ -1700,14 +1710,14 @@ msgid "" "``None``." msgstr "" -#: ../../library/inspect.rst:1362 +#: ../../library/inspect.rst:1367 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:1376 +#: ../../library/inspect.rst:1381 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 " @@ -1715,11 +1725,11 @@ msgid "" "entry represents where the exception was raised." msgstr "" -#: ../../library/inspect.rst:1390 +#: ../../library/inspect.rst:1395 msgid "Fetching attributes statically" msgstr "" -#: ../../library/inspect.rst:1392 +#: ../../library/inspect.rst:1397 msgid "" "Both :func:`getattr` and :func:`hasattr` can trigger code execution when " "fetching or checking for the existence of attributes. Descriptors, like " @@ -1727,20 +1737,20 @@ msgid "" "`__getattribute__` may be called." msgstr "" -#: ../../library/inspect.rst:1397 +#: ../../library/inspect.rst:1402 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:1403 +#: ../../library/inspect.rst:1408 msgid "" "Retrieve attributes without triggering dynamic lookup via the descriptor " "protocol, :meth:`__getattr__` or :meth:`__getattribute__`." msgstr "" -#: ../../library/inspect.rst:1406 +#: ../../library/inspect.rst:1411 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 " @@ -1748,31 +1758,31 @@ msgid "" "return descriptors objects instead of instance members." msgstr "" -#: ../../library/inspect.rst:1412 +#: ../../library/inspect.rst:1417 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:1418 +#: ../../library/inspect.rst:1423 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:1422 +#: ../../library/inspect.rst:1427 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:1448 +#: ../../library/inspect.rst:1453 msgid "Current State of Generators, Coroutines, and Asynchronous Generators" msgstr "" -#: ../../library/inspect.rst:1450 +#: ../../library/inspect.rst:1455 msgid "" "When implementing coroutine schedulers and for other advanced uses of " "generators, it is useful to determine whether a generator is currently " @@ -1781,32 +1791,32 @@ msgid "" "generator to be determined easily." msgstr "" -#: ../../library/inspect.rst:1458 +#: ../../library/inspect.rst:1463 msgid "Get current state of a generator-iterator." msgstr "" -#: ../../library/inspect.rst:1460 ../../library/inspect.rst:1476 -#: ../../library/inspect.rst:1493 +#: ../../library/inspect.rst:1465 ../../library/inspect.rst:1481 +#: ../../library/inspect.rst:1498 msgid "Possible states are:" msgstr "" -#: ../../library/inspect.rst:1462 +#: ../../library/inspect.rst:1467 msgid "GEN_CREATED: Waiting to start execution." msgstr "" -#: ../../library/inspect.rst:1463 +#: ../../library/inspect.rst:1468 msgid "GEN_RUNNING: Currently being executed by the interpreter." msgstr "" -#: ../../library/inspect.rst:1464 +#: ../../library/inspect.rst:1469 msgid "GEN_SUSPENDED: Currently suspended at a yield expression." msgstr "" -#: ../../library/inspect.rst:1465 +#: ../../library/inspect.rst:1470 msgid "GEN_CLOSED: Execution has completed." msgstr "" -#: ../../library/inspect.rst:1471 +#: ../../library/inspect.rst:1476 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 " @@ -1814,23 +1824,23 @@ msgid "" "``cr_frame`` attributes." msgstr "" -#: ../../library/inspect.rst:1478 +#: ../../library/inspect.rst:1483 msgid "CORO_CREATED: Waiting to start execution." msgstr "" -#: ../../library/inspect.rst:1479 +#: ../../library/inspect.rst:1484 msgid "CORO_RUNNING: Currently being executed by the interpreter." msgstr "" -#: ../../library/inspect.rst:1480 +#: ../../library/inspect.rst:1485 msgid "CORO_SUSPENDED: Currently suspended at an await expression." msgstr "" -#: ../../library/inspect.rst:1481 +#: ../../library/inspect.rst:1486 msgid "CORO_CLOSED: Execution has completed." msgstr "" -#: ../../library/inspect.rst:1487 +#: ../../library/inspect.rst:1492 msgid "" "Get current state of an asynchronous generator object. The function is " "intended to be used with asynchronous iterator objects created by :keyword:" @@ -1839,30 +1849,30 @@ msgid "" "``ag_frame`` attributes." msgstr "" -#: ../../library/inspect.rst:1495 +#: ../../library/inspect.rst:1500 msgid "AGEN_CREATED: Waiting to start execution." msgstr "" -#: ../../library/inspect.rst:1496 +#: ../../library/inspect.rst:1501 msgid "AGEN_RUNNING: Currently being executed by the interpreter." msgstr "" -#: ../../library/inspect.rst:1497 +#: ../../library/inspect.rst:1502 msgid "AGEN_SUSPENDED: Currently suspended at a yield expression." msgstr "" -#: ../../library/inspect.rst:1498 +#: ../../library/inspect.rst:1503 msgid "AGEN_CLOSED: Execution has completed." msgstr "" -#: ../../library/inspect.rst:1502 +#: ../../library/inspect.rst:1507 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:1508 +#: ../../library/inspect.rst:1513 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. " @@ -1870,14 +1880,14 @@ msgid "" "generator, and all the same caveats apply." msgstr "" -#: ../../library/inspect.rst:1513 +#: ../../library/inspect.rst:1518 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:1519 +#: ../../library/inspect.rst:1524 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 " @@ -1885,79 +1895,79 @@ msgid "" "dictionary." msgstr "" -#: ../../library/inspect.rst:1528 +#: ../../library/inspect.rst:1533 msgid "" "This function is analogous to :func:`~inspect.getgeneratorlocals`, but works " "for coroutine objects created by :keyword:`async def` functions." msgstr "" -#: ../../library/inspect.rst:1535 +#: ../../library/inspect.rst:1540 msgid "" "This function is analogous to :func:`~inspect.getgeneratorlocals`, but works " "for asynchronous generator objects created by :keyword:`async def` functions " "which use the :keyword:`yield` statement." msgstr "" -#: ../../library/inspect.rst:1545 +#: ../../library/inspect.rst:1550 msgid "Code Objects Bit Flags" msgstr "" -#: ../../library/inspect.rst:1547 +#: ../../library/inspect.rst:1552 msgid "" "Python code objects have a ``co_flags`` attribute, which is a bitmap of the " "following flags:" msgstr "" -#: ../../library/inspect.rst:1552 +#: ../../library/inspect.rst:1557 msgid "The code object is optimized, using fast locals." msgstr "" -#: ../../library/inspect.rst:1556 +#: ../../library/inspect.rst:1561 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:1561 +#: ../../library/inspect.rst:1566 msgid "The code object has a variable positional parameter (``*args``-like)." msgstr "" -#: ../../library/inspect.rst:1565 +#: ../../library/inspect.rst:1570 msgid "The code object has a variable keyword parameter (``**kwargs``-like)." msgstr "" -#: ../../library/inspect.rst:1569 +#: ../../library/inspect.rst:1574 msgid "The flag is set when the code object is a nested function." msgstr "" -#: ../../library/inspect.rst:1573 +#: ../../library/inspect.rst:1578 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:1578 +#: ../../library/inspect.rst:1583 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:1586 +#: ../../library/inspect.rst:1591 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:1595 +#: ../../library/inspect.rst:1600 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:1602 +#: ../../library/inspect.rst:1607 msgid "" "The flags are specific to CPython, and may not be defined in other Python " "implementations. Furthermore, the flags are an implementation detail, and " @@ -1965,39 +1975,39 @@ msgid "" "use public APIs from the :mod:`inspect` module for any introspection needs." msgstr "" -#: ../../library/inspect.rst:1610 +#: ../../library/inspect.rst:1615 msgid "Buffer flags" msgstr "" -#: ../../library/inspect.rst:1614 +#: ../../library/inspect.rst:1619 msgid "" "This is an :class:`enum.IntFlag` that represents the flags that can be " "passed to the :meth:`~object.__buffer__` method of objects implementing the :" "ref:`buffer protocol `." msgstr "" -#: ../../library/inspect.rst:1618 +#: ../../library/inspect.rst:1623 msgid "The meaning of the flags is explained at :ref:`buffer-request-types`." msgstr "" -#: ../../library/inspect.rst:1645 +#: ../../library/inspect.rst:1650 msgid "Command Line Interface" msgstr "命令列介面" -#: ../../library/inspect.rst:1647 +#: ../../library/inspect.rst:1652 msgid "" "The :mod:`inspect` module also provides a basic introspection capability " "from the command line." msgstr "" -#: ../../library/inspect.rst:1652 +#: ../../library/inspect.rst:1657 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:1658 +#: ../../library/inspect.rst:1663 msgid "" "Print information about the specified object rather than the source code" msgstr "" diff --git a/library/itertools.po b/library/itertools.po index 1bae04ba61..c34a10c07c 100644 --- a/library/itertools.po +++ b/library/itertools.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-09-13 00:03+0000\n" +"POT-Creation-Date: 2023-10-28 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:04+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -81,8 +81,8 @@ msgid ":func:`count`" msgstr ":func:`count`" #: ../../library/itertools.rst:44 -msgid "start, [step]" -msgstr "" +msgid "[start[, step]]" +msgstr "[start[, step]]" #: ../../library/itertools.rst:44 msgid "start, start+step, start+2*step, ..." diff --git a/library/locale.po b/library/locale.po index 0afee18ed9..f3252fcd86 100644 --- a/library/locale.po +++ b/library/locale.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-10-28 00:03+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-" @@ -679,32 +679,42 @@ msgid "" "conventions." msgstr "" -#: ../../library/locale.rst:469 +#: ../../library/locale.rst:467 +msgid "" +"Locale category for the character type functions. Most importantly, this " +"category defines the text encoding, i.e. how bytes are interpreted as " +"Unicode codepoints. See :pep:`538` and :pep:`540` for how this variable " +"might be automatically coerced to ``C.UTF-8`` to avoid issues created by " +"invalid settings in containers or incompatible settings passed over remote " +"SSH connections." +msgstr "" + +#: ../../library/locale.rst:474 msgid "" -"Locale category for the character type functions. Depending on the settings " -"of this category, the functions of module :mod:`string` dealing with case " -"change their behaviour." +"Python doesn't internally use locale-dependent character transformation " +"functions from ``ctype.h``. Instead, an internal ``pyctype.h`` provides " +"locale-independent equivalents like :c:macro:`!Py_TOLOWER`." msgstr "" -#: ../../library/locale.rst:476 +#: ../../library/locale.rst:481 msgid "" "Locale category for sorting strings. The functions :func:`strcoll` and :" "func:`strxfrm` of the :mod:`locale` module are affected." msgstr "" -#: ../../library/locale.rst:482 +#: ../../library/locale.rst:487 msgid "" "Locale category for the formatting of time. The function :func:`time." "strftime` follows these conventions." msgstr "" -#: ../../library/locale.rst:488 +#: ../../library/locale.rst:493 msgid "" "Locale category for formatting of monetary values. The available options " "are available from the :func:`localeconv` function." msgstr "" -#: ../../library/locale.rst:494 +#: ../../library/locale.rst:499 msgid "" "Locale category for message display. Python currently does not support " "application specific locale-aware messages. Messages displayed by the " @@ -712,13 +722,13 @@ msgid "" "affected by this category." msgstr "" -#: ../../library/locale.rst:499 +#: ../../library/locale.rst:504 msgid "" "This value may not be available on operating systems not conforming to the " "POSIX standard, most notably Windows." msgstr "" -#: ../../library/locale.rst:505 +#: ../../library/locale.rst:510 msgid "" "Locale category for formatting numbers. The functions :func:" "`format_string`, :func:`atoi`, :func:`atof` and :func:`.str` of the :mod:" @@ -726,7 +736,7 @@ msgid "" "operations are not affected." msgstr "" -#: ../../library/locale.rst:513 +#: ../../library/locale.rst:518 msgid "" "Combination of all locale settings. If this flag is used when the locale is " "changed, setting the locale for all categories is attempted. If that fails " @@ -736,24 +746,24 @@ msgid "" "settings." msgstr "" -#: ../../library/locale.rst:522 +#: ../../library/locale.rst:527 msgid "" "This is a symbolic constant used for different values returned by :func:" "`localeconv`." msgstr "" -#: ../../library/locale.rst:526 +#: ../../library/locale.rst:531 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/locale.rst:539 +#: ../../library/locale.rst:544 msgid "Background, details, hints, tips and caveats" msgstr "" -#: ../../library/locale.rst:541 +#: ../../library/locale.rst:546 msgid "" "The C standard defines the locale as a program-wide property that may be " "relatively expensive to change. On top of that, some implementations are " @@ -761,7 +771,7 @@ msgid "" "This makes the locale somewhat painful to use correctly." msgstr "" -#: ../../library/locale.rst:546 +#: ../../library/locale.rst:551 msgid "" "Initially, when a program is started, the locale is the ``C`` locale, no " "matter what the user's preferred locale is. There is one exception: the :" @@ -771,7 +781,7 @@ msgid "" "categories by calling ``setlocale(LC_ALL, '')``." msgstr "" -#: ../../library/locale.rst:553 +#: ../../library/locale.rst:558 msgid "" "It is generally a bad idea to call :func:`setlocale` in some library " "routine, since as a side effect it affects the entire program. Saving and " @@ -779,7 +789,7 @@ msgid "" "that happen to run before the settings have been restored." msgstr "" -#: ../../library/locale.rst:558 +#: ../../library/locale.rst:563 msgid "" "If, when coding a module for general use, you need a locale independent " "version of an operation that is affected by the locale (such as certain " @@ -790,14 +800,14 @@ msgid "" "settings." msgstr "" -#: ../../library/locale.rst:565 +#: ../../library/locale.rst:570 msgid "" "The only way to perform numeric operations according to the locale is to use " "the special functions defined by this module: :func:`atof`, :func:`atoi`, :" "func:`format_string`, :func:`.str`." msgstr "" -#: ../../library/locale.rst:569 +#: ../../library/locale.rst:574 msgid "" "There is no way to perform case conversions and character classifications " "according to the locale. For (Unicode) text strings these are done " @@ -808,11 +818,11 @@ msgid "" "whitespace." msgstr "" -#: ../../library/locale.rst:580 +#: ../../library/locale.rst:585 msgid "For extension writers and programs that embed Python" msgstr "" -#: ../../library/locale.rst:582 +#: ../../library/locale.rst:587 msgid "" "Extension modules should never call :func:`setlocale`, except to find out " "what the current locale is. But since the return value can only be used " @@ -820,7 +830,7 @@ msgid "" "whether or not the locale is ``C``)." msgstr "" -#: ../../library/locale.rst:587 +#: ../../library/locale.rst:592 msgid "" "When Python code uses the :mod:`locale` module to change the locale, this " "also affects the embedding application. If the embedding application " @@ -830,11 +840,11 @@ msgid "" "accessible as a shared library." msgstr "" -#: ../../library/locale.rst:598 +#: ../../library/locale.rst:603 msgid "Access to message catalogs" msgstr "" -#: ../../library/locale.rst:606 +#: ../../library/locale.rst:611 msgid "" "The locale module exposes the C library's gettext interface on systems that " "provide this interface. It consists of the functions :func:`!gettext`, :" @@ -845,7 +855,7 @@ msgid "" "for locating message catalogs." msgstr "" -#: ../../library/locale.rst:613 +#: ../../library/locale.rst:618 msgid "" "Python applications should normally find no need to invoke these functions, " "and should use :mod:`gettext` instead. A known exception to this rule are " @@ -855,7 +865,7 @@ msgid "" "their message catalogs." msgstr "" -#: ../../library/locale.rst:19 ../../library/locale.rst:467 +#: ../../library/locale.rst:19 msgid "module" msgstr "module(模組)" @@ -863,6 +873,5 @@ msgstr "module(模組)" msgid "_locale" msgstr "_locale" -#: ../../library/locale.rst:467 -msgid "string" -msgstr "string(字串)" +#~ msgid "string" +#~ msgstr "string(字串)" diff --git a/library/logging.handlers.po b/library/logging.handlers.po index 417245ed9d..3df1e532ef 100644 --- a/library/logging.handlers.po +++ b/library/logging.handlers.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 00:03+0000\n" +"POT-Creation-Date: 2023-11-03 00:03+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-" @@ -845,19 +845,17 @@ msgid "" "Tries to create a socket and, if it's not a datagram socket, connect it to " "the other end. This method is called during handler initialization, but it's " "not regarded as an error if the other end isn't listening at this point - " -"the method will be called again when emitting an event, if but it's not " -"regarded as an error if the other end isn't listening yet --- the method " -"will be called again when emitting an event, if there is no socket at that " -"point." +"the method will be called again when emitting an event, if there is no " +"socket at that point." msgstr "" -#: ../../library/logging.handlers.rst:667 +#: ../../library/logging.handlers.rst:665 msgid "" "The record is formatted, and then sent to the syslog server. If exception " "information is present, it is *not* sent to the server." msgstr "" -#: ../../library/logging.handlers.rst:670 +#: ../../library/logging.handlers.rst:668 msgid "" "(See: :issue:`12168`.) In earlier versions, the message sent to the syslog " "daemons was always terminated with a NUL byte, because early versions of " @@ -868,7 +866,7 @@ msgid "" "byte on as part of the message." msgstr "" -#: ../../library/logging.handlers.rst:679 +#: ../../library/logging.handlers.rst:677 msgid "" "To enable easier handling of syslog messages in the face of all these " "differing daemon behaviours, the appending of the NUL byte has been made " @@ -878,7 +876,7 @@ msgid "" "*not* append the NUL terminator." msgstr "" -#: ../../library/logging.handlers.rst:686 +#: ../../library/logging.handlers.rst:684 msgid "" "(See: :issue:`12419`.) In earlier versions, there was no facility for an " "\"ident\" or \"tag\" prefix to identify the source of the message. This can " @@ -889,262 +887,262 @@ msgid "" "bytes, and is prepended to the message exactly as is." msgstr "" -#: ../../library/logging.handlers.rst:697 +#: ../../library/logging.handlers.rst:695 msgid "" "Encodes the facility and priority into an integer. You can pass in strings " "or integers - if strings are passed, internal mapping dictionaries are used " "to convert them to integers." msgstr "" -#: ../../library/logging.handlers.rst:701 +#: ../../library/logging.handlers.rst:699 msgid "" "The symbolic ``LOG_`` values are defined in :class:`SysLogHandler` and " "mirror the values defined in the ``sys/syslog.h`` header file." msgstr "" -#: ../../library/logging.handlers.rst:704 +#: ../../library/logging.handlers.rst:702 msgid "**Priorities**" msgstr "" -#: ../../library/logging.handlers.rst:707 -#: ../../library/logging.handlers.rst:729 +#: ../../library/logging.handlers.rst:705 +#: ../../library/logging.handlers.rst:727 msgid "Name (string)" msgstr "" -#: ../../library/logging.handlers.rst:707 -#: ../../library/logging.handlers.rst:729 +#: ../../library/logging.handlers.rst:705 +#: ../../library/logging.handlers.rst:727 msgid "Symbolic value" msgstr "" -#: ../../library/logging.handlers.rst:709 +#: ../../library/logging.handlers.rst:707 msgid "``alert``" msgstr "``alert``" -#: ../../library/logging.handlers.rst:709 +#: ../../library/logging.handlers.rst:707 msgid "LOG_ALERT" msgstr "LOG_ALERT" -#: ../../library/logging.handlers.rst:711 +#: ../../library/logging.handlers.rst:709 msgid "``crit`` or ``critical``" msgstr "``crit`` 或 ``critical``" -#: ../../library/logging.handlers.rst:711 +#: ../../library/logging.handlers.rst:709 msgid "LOG_CRIT" msgstr "LOG_CRIT" -#: ../../library/logging.handlers.rst:713 +#: ../../library/logging.handlers.rst:711 msgid "``debug``" msgstr "``debug``" -#: ../../library/logging.handlers.rst:713 +#: ../../library/logging.handlers.rst:711 msgid "LOG_DEBUG" msgstr "LOG_DEBUG" -#: ../../library/logging.handlers.rst:715 +#: ../../library/logging.handlers.rst:713 msgid "``emerg`` or ``panic``" msgstr "``emerg`` 或 ``panic``" -#: ../../library/logging.handlers.rst:715 +#: ../../library/logging.handlers.rst:713 msgid "LOG_EMERG" msgstr "LOG_EMERG" -#: ../../library/logging.handlers.rst:717 +#: ../../library/logging.handlers.rst:715 msgid "``err`` or ``error``" msgstr "``err`` 或 ``error``" -#: ../../library/logging.handlers.rst:717 +#: ../../library/logging.handlers.rst:715 msgid "LOG_ERR" msgstr "LOG_ERR" -#: ../../library/logging.handlers.rst:719 +#: ../../library/logging.handlers.rst:717 msgid "``info``" msgstr "``info``" -#: ../../library/logging.handlers.rst:719 +#: ../../library/logging.handlers.rst:717 msgid "LOG_INFO" msgstr "LOG_INFO" -#: ../../library/logging.handlers.rst:721 +#: ../../library/logging.handlers.rst:719 msgid "``notice``" msgstr "``notice``" -#: ../../library/logging.handlers.rst:721 +#: ../../library/logging.handlers.rst:719 msgid "LOG_NOTICE" msgstr "LOG_NOTICE" -#: ../../library/logging.handlers.rst:723 +#: ../../library/logging.handlers.rst:721 msgid "``warn`` or ``warning``" msgstr "``warn`` 或 ``warning``" -#: ../../library/logging.handlers.rst:723 +#: ../../library/logging.handlers.rst:721 msgid "LOG_WARNING" msgstr "LOG_WARNING" -#: ../../library/logging.handlers.rst:726 +#: ../../library/logging.handlers.rst:724 msgid "**Facilities**" msgstr "" -#: ../../library/logging.handlers.rst:731 +#: ../../library/logging.handlers.rst:729 msgid "``auth``" msgstr "``auth``" -#: ../../library/logging.handlers.rst:731 +#: ../../library/logging.handlers.rst:729 msgid "LOG_AUTH" msgstr "LOG_AUTH" -#: ../../library/logging.handlers.rst:733 +#: ../../library/logging.handlers.rst:731 msgid "``authpriv``" msgstr "``authpriv``" -#: ../../library/logging.handlers.rst:733 +#: ../../library/logging.handlers.rst:731 msgid "LOG_AUTHPRIV" msgstr "LOG_AUTHPRIV" -#: ../../library/logging.handlers.rst:735 +#: ../../library/logging.handlers.rst:733 msgid "``cron``" msgstr "``cron``" -#: ../../library/logging.handlers.rst:735 +#: ../../library/logging.handlers.rst:733 msgid "LOG_CRON" msgstr "LOG_CRON" -#: ../../library/logging.handlers.rst:737 +#: ../../library/logging.handlers.rst:735 msgid "``daemon``" msgstr "``daemon``" -#: ../../library/logging.handlers.rst:737 +#: ../../library/logging.handlers.rst:735 msgid "LOG_DAEMON" msgstr "LOG_DAEMON" -#: ../../library/logging.handlers.rst:739 +#: ../../library/logging.handlers.rst:737 msgid "``ftp``" msgstr "``ftp``" -#: ../../library/logging.handlers.rst:739 +#: ../../library/logging.handlers.rst:737 msgid "LOG_FTP" msgstr "LOG_FTP" -#: ../../library/logging.handlers.rst:741 +#: ../../library/logging.handlers.rst:739 msgid "``kern``" msgstr "``kern``" -#: ../../library/logging.handlers.rst:741 +#: ../../library/logging.handlers.rst:739 msgid "LOG_KERN" msgstr "LOG_KERN" -#: ../../library/logging.handlers.rst:743 +#: ../../library/logging.handlers.rst:741 msgid "``lpr``" msgstr "``lpr``" -#: ../../library/logging.handlers.rst:743 +#: ../../library/logging.handlers.rst:741 msgid "LOG_LPR" msgstr "LOG_LPR" -#: ../../library/logging.handlers.rst:745 +#: ../../library/logging.handlers.rst:743 msgid "``mail``" msgstr "``mail``" -#: ../../library/logging.handlers.rst:745 +#: ../../library/logging.handlers.rst:743 msgid "LOG_MAIL" msgstr "LOG_MAIL" -#: ../../library/logging.handlers.rst:747 +#: ../../library/logging.handlers.rst:745 msgid "``news``" msgstr "``news``" -#: ../../library/logging.handlers.rst:747 +#: ../../library/logging.handlers.rst:745 msgid "LOG_NEWS" msgstr "LOG_NEWS" -#: ../../library/logging.handlers.rst:749 +#: ../../library/logging.handlers.rst:747 msgid "``syslog``" msgstr "``syslog``" -#: ../../library/logging.handlers.rst:749 +#: ../../library/logging.handlers.rst:747 msgid "LOG_SYSLOG" msgstr "LOG_SYSLOG" -#: ../../library/logging.handlers.rst:751 +#: ../../library/logging.handlers.rst:749 msgid "``user``" msgstr "``user``" -#: ../../library/logging.handlers.rst:751 +#: ../../library/logging.handlers.rst:749 msgid "LOG_USER" msgstr "LOG_USER" -#: ../../library/logging.handlers.rst:753 +#: ../../library/logging.handlers.rst:751 msgid "``uucp``" msgstr "``uucp``" -#: ../../library/logging.handlers.rst:753 +#: ../../library/logging.handlers.rst:751 msgid "LOG_UUCP" msgstr "LOG_UUCP" -#: ../../library/logging.handlers.rst:755 +#: ../../library/logging.handlers.rst:753 msgid "``local0``" msgstr "``local0``" -#: ../../library/logging.handlers.rst:755 +#: ../../library/logging.handlers.rst:753 msgid "LOG_LOCAL0" msgstr "LOG_LOCAL0" -#: ../../library/logging.handlers.rst:757 +#: ../../library/logging.handlers.rst:755 msgid "``local1``" msgstr "``local1``" -#: ../../library/logging.handlers.rst:757 +#: ../../library/logging.handlers.rst:755 msgid "LOG_LOCAL1" msgstr "LOG_LOCAL1" -#: ../../library/logging.handlers.rst:759 +#: ../../library/logging.handlers.rst:757 msgid "``local2``" msgstr "``local2``" -#: ../../library/logging.handlers.rst:759 +#: ../../library/logging.handlers.rst:757 msgid "LOG_LOCAL2" msgstr "LOG_LOCAL2" -#: ../../library/logging.handlers.rst:761 +#: ../../library/logging.handlers.rst:759 msgid "``local3``" msgstr "``local3``" -#: ../../library/logging.handlers.rst:761 +#: ../../library/logging.handlers.rst:759 msgid "LOG_LOCAL3" msgstr "LOG_LOCAL3" -#: ../../library/logging.handlers.rst:763 +#: ../../library/logging.handlers.rst:761 msgid "``local4``" msgstr "``local4``" -#: ../../library/logging.handlers.rst:763 +#: ../../library/logging.handlers.rst:761 msgid "LOG_LOCAL4" msgstr "LOG_LOCAL4" -#: ../../library/logging.handlers.rst:765 +#: ../../library/logging.handlers.rst:763 msgid "``local5``" msgstr "``local5``" -#: ../../library/logging.handlers.rst:765 +#: ../../library/logging.handlers.rst:763 msgid "LOG_LOCAL5" msgstr "LOG_LOCAL5" -#: ../../library/logging.handlers.rst:767 +#: ../../library/logging.handlers.rst:765 msgid "``local6``" msgstr "``local6``" -#: ../../library/logging.handlers.rst:767 +#: ../../library/logging.handlers.rst:765 msgid "LOG_LOCAL6" msgstr "LOG_LOCAL6" -#: ../../library/logging.handlers.rst:769 +#: ../../library/logging.handlers.rst:767 msgid "``local7``" msgstr "``local7``" -#: ../../library/logging.handlers.rst:769 +#: ../../library/logging.handlers.rst:767 msgid "LOG_LOCAL7" msgstr "LOG_LOCAL7" -#: ../../library/logging.handlers.rst:774 +#: ../../library/logging.handlers.rst:772 msgid "" "Maps a logging level name to a syslog priority name. You may need to " "override this if you are using custom levels, or if the default algorithm is " @@ -1153,11 +1151,11 @@ msgid "" "all other level names to 'warning'." msgstr "" -#: ../../library/logging.handlers.rst:784 +#: ../../library/logging.handlers.rst:782 msgid "NTEventLogHandler" msgstr "NTEventLogHandler" -#: ../../library/logging.handlers.rst:786 +#: ../../library/logging.handlers.rst:784 msgid "" "The :class:`NTEventLogHandler` class, located in the :mod:`logging.handlers` " "module, supports sending logging messages to a local Windows NT, Windows " @@ -1165,7 +1163,7 @@ msgid "" "Win32 extensions for Python installed." msgstr "" -#: ../../library/logging.handlers.rst:794 +#: ../../library/logging.handlers.rst:792 msgid "" "Returns a new instance of the :class:`NTEventLogHandler` class. The " "*appname* is used to define the application name as it appears in the event " @@ -1181,7 +1179,7 @@ msgid "" "or ``'Security'``, and defaults to ``'Application'``." msgstr "" -#: ../../library/logging.handlers.rst:810 +#: ../../library/logging.handlers.rst:808 msgid "" "At this point, you can remove the application name from the registry as a " "source of event log entries. However, if you do this, you will not be able " @@ -1190,19 +1188,19 @@ msgid "" "not do this." msgstr "" -#: ../../library/logging.handlers.rst:819 +#: ../../library/logging.handlers.rst:817 msgid "" "Determines the message ID, event category and event type, and then logs the " "message in the NT event log." msgstr "" -#: ../../library/logging.handlers.rst:825 +#: ../../library/logging.handlers.rst:823 msgid "" "Returns the event category for the record. Override this if you want to " "specify your own categories. This version returns 0." msgstr "" -#: ../../library/logging.handlers.rst:831 +#: ../../library/logging.handlers.rst:829 msgid "" "Returns the event type for the record. Override this if you want to specify " "your own types. This version does a mapping using the handler's typemap " @@ -1213,7 +1211,7 @@ msgid "" "the handler's *typemap* attribute." msgstr "" -#: ../../library/logging.handlers.rst:842 +#: ../../library/logging.handlers.rst:840 msgid "" "Returns the message ID for the record. If you are using your own messages, " "you could do this by having the *msg* passed to the logger being an ID " @@ -1222,17 +1220,17 @@ msgid "" "message ID in :file:`win32service.pyd`." msgstr "" -#: ../../library/logging.handlers.rst:851 +#: ../../library/logging.handlers.rst:849 msgid "SMTPHandler" msgstr "SMTPHandler" -#: ../../library/logging.handlers.rst:853 +#: ../../library/logging.handlers.rst:851 msgid "" "The :class:`SMTPHandler` class, located in the :mod:`logging.handlers` " "module, supports sending logging messages to an email address via SMTP." msgstr "" -#: ../../library/logging.handlers.rst:859 +#: ../../library/logging.handlers.rst:857 msgid "" "Returns a new instance of the :class:`SMTPHandler` class. The instance is " "initialized with the from and to addresses and subject line of the email. " @@ -1243,7 +1241,7 @@ msgid "" "*credentials* argument." msgstr "" -#: ../../library/logging.handlers.rst:866 +#: ../../library/logging.handlers.rst:864 msgid "" "To specify the use of a secure protocol (TLS), pass in a tuple to the " "*secure* argument. This will only be used when authentication credentials " @@ -1253,31 +1251,31 @@ msgid "" "SMTP.starttls` method.)" msgstr "" -#: ../../library/logging.handlers.rst:873 +#: ../../library/logging.handlers.rst:871 msgid "" "A timeout can be specified for communication with the SMTP server using the " "*timeout* argument." msgstr "" -#: ../../library/logging.handlers.rst:876 +#: ../../library/logging.handlers.rst:874 msgid "The *timeout* argument was added." msgstr "新增 *timeout* 引數。" -#: ../../library/logging.handlers.rst:881 +#: ../../library/logging.handlers.rst:879 msgid "Formats the record and sends it to the specified addressees." msgstr "" -#: ../../library/logging.handlers.rst:886 +#: ../../library/logging.handlers.rst:884 msgid "" "If you want to specify a subject line which is record-dependent, override " "this method." msgstr "" -#: ../../library/logging.handlers.rst:892 +#: ../../library/logging.handlers.rst:890 msgid "MemoryHandler" msgstr "MemoryHandler" -#: ../../library/logging.handlers.rst:894 +#: ../../library/logging.handlers.rst:892 msgid "" "The :class:`MemoryHandler` class, located in the :mod:`logging.handlers` " "module, supports buffering of logging records in memory, periodically " @@ -1285,7 +1283,7 @@ msgid "" "buffer is full, or when an event of a certain severity or greater is seen." msgstr "" -#: ../../library/logging.handlers.rst:899 +#: ../../library/logging.handlers.rst:897 msgid "" ":class:`MemoryHandler` is a subclass of the more general :class:" "`BufferingHandler`, which is an abstract class. This buffers logging records " @@ -1294,32 +1292,32 @@ msgid "" "should, then :meth:`flush` is expected to do the flushing." msgstr "" -#: ../../library/logging.handlers.rst:908 +#: ../../library/logging.handlers.rst:906 msgid "" "Initializes the handler with a buffer of the specified capacity. Here, " "*capacity* means the number of logging records buffered." msgstr "" -#: ../../library/logging.handlers.rst:914 +#: ../../library/logging.handlers.rst:912 msgid "" "Append the record to the buffer. If :meth:`shouldFlush` returns true, call :" "meth:`flush` to process the buffer." msgstr "" -#: ../../library/logging.handlers.rst:920 +#: ../../library/logging.handlers.rst:918 msgid "" "For a :class:`BufferingHandler` instance, flushing means that it sets the " "buffer to an empty list. This method can be overwritten to implement more " "useful flushing behavior." msgstr "" -#: ../../library/logging.handlers.rst:927 +#: ../../library/logging.handlers.rst:925 msgid "" "Return ``True`` if the buffer is up to capacity. This method can be " "overridden to implement custom flushing strategies." msgstr "" -#: ../../library/logging.handlers.rst:933 +#: ../../library/logging.handlers.rst:931 msgid "" "Returns a new instance of the :class:`MemoryHandler` class. The instance is " "initialized with a buffer size of *capacity* (number of records buffered). " @@ -1331,15 +1329,15 @@ msgid "" "the buffer will occur when the handler is closed." msgstr "" -#: ../../library/logging.handlers.rst:942 +#: ../../library/logging.handlers.rst:940 msgid "The *flushOnClose* parameter was added." msgstr "新增 *flushOnClose* 參數。" -#: ../../library/logging.handlers.rst:948 +#: ../../library/logging.handlers.rst:946 msgid "Calls :meth:`flush`, sets the target to ``None`` and clears the buffer." msgstr "" -#: ../../library/logging.handlers.rst:954 +#: ../../library/logging.handlers.rst:952 msgid "" "For a :class:`MemoryHandler` instance, flushing means just sending the " "buffered records to the target, if there is one. The buffer is also cleared " @@ -1347,26 +1345,26 @@ msgid "" "behavior." msgstr "" -#: ../../library/logging.handlers.rst:961 +#: ../../library/logging.handlers.rst:959 msgid "Sets the target handler for this handler." msgstr "" -#: ../../library/logging.handlers.rst:966 +#: ../../library/logging.handlers.rst:964 msgid "Checks for buffer full or a record at the *flushLevel* or higher." msgstr "" -#: ../../library/logging.handlers.rst:972 +#: ../../library/logging.handlers.rst:970 msgid "HTTPHandler" msgstr "HTTPHandler" -#: ../../library/logging.handlers.rst:974 +#: ../../library/logging.handlers.rst:972 msgid "" "The :class:`HTTPHandler` class, located in the :mod:`logging.handlers` " "module, supports sending logging messages to a web server, using either " "``GET`` or ``POST`` semantics." msgstr "" -#: ../../library/logging.handlers.rst:981 +#: ../../library/logging.handlers.rst:979 msgid "" "Returns a new instance of the :class:`HTTPHandler` class. The *host* can be " "of the form ``host:port``, should you need to use a specific port number. " @@ -1380,11 +1378,11 @@ msgid "" "cleartext across the wire." msgstr "" -#: ../../library/logging.handlers.rst:992 +#: ../../library/logging.handlers.rst:990 msgid "The *context* parameter was added." msgstr "新增 *context* 參數。" -#: ../../library/logging.handlers.rst:997 +#: ../../library/logging.handlers.rst:995 msgid "" "Provides a dictionary, based on ``record``, which is to be URL-encoded and " "sent to the web server. The default implementation just returns ``record." @@ -1393,14 +1391,14 @@ msgid "" "customization of what's sent to the server is required." msgstr "" -#: ../../library/logging.handlers.rst:1005 +#: ../../library/logging.handlers.rst:1003 msgid "" "Sends the record to the web server as a URL-encoded dictionary. The :meth:" "`mapLogRecord` method is used to convert the record to the dictionary to be " "sent." msgstr "" -#: ../../library/logging.handlers.rst:1009 +#: ../../library/logging.handlers.rst:1007 msgid "" "Since preparing a record for sending it to a web server is not the same as a " "generic formatting operation, using :meth:`~logging.Handler.setFormatter` to " @@ -1410,18 +1408,18 @@ msgid "" "the dictionary in a form suitable for sending to a web server." msgstr "" -#: ../../library/logging.handlers.rst:1022 +#: ../../library/logging.handlers.rst:1020 msgid "QueueHandler" msgstr "QueueHandler" -#: ../../library/logging.handlers.rst:1026 +#: ../../library/logging.handlers.rst:1024 msgid "" "The :class:`QueueHandler` class, located in the :mod:`logging.handlers` " "module, supports sending logging messages to a queue, such as those " "implemented in the :mod:`queue` or :mod:`multiprocessing` modules." msgstr "" -#: ../../library/logging.handlers.rst:1030 +#: ../../library/logging.handlers.rst:1028 msgid "" "Along with the :class:`QueueListener` class, :class:`QueueHandler` can be " "used to let handlers do their work on a separate thread from the one which " @@ -1431,7 +1429,7 @@ msgid "" "an email via :class:`SMTPHandler`) are done on a separate thread." msgstr "" -#: ../../library/logging.handlers.rst:1039 +#: ../../library/logging.handlers.rst:1037 msgid "" "Returns a new instance of the :class:`QueueHandler` class. The instance is " "initialized with the queue to send messages to. The *queue* can be any queue-" @@ -1441,14 +1439,14 @@ msgid "" "instances for *queue*." msgstr "" -#: ../../library/logging.handlers.rst:1046 -#: ../../library/logging.handlers.rst:1135 +#: ../../library/logging.handlers.rst:1044 +#: ../../library/logging.handlers.rst:1133 msgid "" "If you are using :mod:`multiprocessing`, you should avoid using :class:" "`~queue.SimpleQueue` and instead use :class:`multiprocessing.Queue`." msgstr "" -#: ../../library/logging.handlers.rst:1051 +#: ../../library/logging.handlers.rst:1049 msgid "" "Enqueues the result of preparing the LogRecord. Should an exception occur (e." "g. because a bounded queue has filled up), the :meth:`~logging.Handler." @@ -1458,13 +1456,13 @@ msgid "" "raiseExceptions` is ``True``)." msgstr "" -#: ../../library/logging.handlers.rst:1060 +#: ../../library/logging.handlers.rst:1058 msgid "" "Prepares a record for queuing. The object returned by this method is " "enqueued." msgstr "" -#: ../../library/logging.handlers.rst:1063 +#: ../../library/logging.handlers.rst:1061 msgid "" "The base implementation formats the record to merge the message, arguments, " "exception and stack information, if present. It also removes unpickleable " @@ -1474,14 +1472,14 @@ msgid "" "attr:`exc_info` and :attr:`exc_text` attributes to ``None``." msgstr "" -#: ../../library/logging.handlers.rst:1071 +#: ../../library/logging.handlers.rst:1069 msgid "" "You might want to override this method if you want to convert the record to " "a dict or JSON string, or send a modified copy of the record while leaving " "the original intact." msgstr "" -#: ../../library/logging.handlers.rst:1075 +#: ../../library/logging.handlers.rst:1073 msgid "" "The base implementation formats the message with arguments, sets the " "``message`` and ``msg`` attributes to the formatted message and sets the " @@ -1497,25 +1495,25 @@ msgid "" "libraries that you use.)" msgstr "" -#: ../../library/logging.handlers.rst:1091 +#: ../../library/logging.handlers.rst:1089 msgid "" "Enqueues the record on the queue using ``put_nowait()``; you may want to " "override this if you want to use blocking behaviour, or a timeout, or a " "customized queue implementation." msgstr "" -#: ../../library/logging.handlers.rst:1097 +#: ../../library/logging.handlers.rst:1095 msgid "" "When created via configuration using :func:`~logging.config.dictConfig`, " "this attribute will contain a :class:`QueueListener` instance for use with " "this handler. Otherwise, it will be ``None``." msgstr "" -#: ../../library/logging.handlers.rst:1106 +#: ../../library/logging.handlers.rst:1104 msgid "QueueListener" msgstr "QueueListener" -#: ../../library/logging.handlers.rst:1110 +#: ../../library/logging.handlers.rst:1108 msgid "" "The :class:`QueueListener` class, located in the :mod:`logging.handlers` " "module, supports receiving logging messages from a queue, such as those " @@ -1526,7 +1524,7 @@ msgid "" "works hand-in-hand with :class:`QueueHandler`." msgstr "" -#: ../../library/logging.handlers.rst:1118 +#: ../../library/logging.handlers.rst:1116 msgid "" "Along with the :class:`QueueHandler` class, :class:`QueueListener` can be " "used to let handlers do their work on a separate thread from the one which " @@ -1536,7 +1534,7 @@ msgid "" "an email via :class:`SMTPHandler`) are done on a separate thread." msgstr "" -#: ../../library/logging.handlers.rst:1127 +#: ../../library/logging.handlers.rst:1125 msgid "" "Returns a new instance of the :class:`QueueListener` class. The instance is " "initialized with the queue to send messages to and a list of handlers which " @@ -1547,7 +1545,7 @@ msgid "" "class:`~queue.SimpleQueue` instances for *queue*." msgstr "" -#: ../../library/logging.handlers.rst:1138 +#: ../../library/logging.handlers.rst:1136 msgid "" "If ``respect_handler_level`` is ``True``, a handler's level is respected " "(compared with the level for the message) when deciding whether to pass " @@ -1555,82 +1553,82 @@ msgid "" "versions - to always pass each message to each handler." msgstr "" -#: ../../library/logging.handlers.rst:1143 +#: ../../library/logging.handlers.rst:1141 msgid "The ``respect_handler_level`` argument was added." msgstr "新增 ``respect_handler_level`` 引數。" -#: ../../library/logging.handlers.rst:1148 +#: ../../library/logging.handlers.rst:1146 msgid "Dequeues a record and return it, optionally blocking." msgstr "" -#: ../../library/logging.handlers.rst:1150 +#: ../../library/logging.handlers.rst:1148 msgid "" "The base implementation uses ``get()``. You may want to override this method " "if you want to use timeouts or work with custom queue implementations." msgstr "" -#: ../../library/logging.handlers.rst:1156 +#: ../../library/logging.handlers.rst:1154 msgid "Prepare a record for handling." msgstr "" -#: ../../library/logging.handlers.rst:1158 +#: ../../library/logging.handlers.rst:1156 msgid "" "This implementation just returns the passed-in record. You may want to " "override this method if you need to do any custom marshalling or " "manipulation of the record before passing it to the handlers." msgstr "" -#: ../../library/logging.handlers.rst:1164 +#: ../../library/logging.handlers.rst:1162 msgid "Handle a record." msgstr "" -#: ../../library/logging.handlers.rst:1166 +#: ../../library/logging.handlers.rst:1164 msgid "" "This just loops through the handlers offering them the record to handle. The " "actual object passed to the handlers is that which is returned from :meth:" "`prepare`." msgstr "" -#: ../../library/logging.handlers.rst:1172 +#: ../../library/logging.handlers.rst:1170 msgid "Starts the listener." msgstr "" -#: ../../library/logging.handlers.rst:1174 +#: ../../library/logging.handlers.rst:1172 msgid "" "This starts up a background thread to monitor the queue for LogRecords to " "process." msgstr "" -#: ../../library/logging.handlers.rst:1179 +#: ../../library/logging.handlers.rst:1177 msgid "Stops the listener." msgstr "" -#: ../../library/logging.handlers.rst:1181 +#: ../../library/logging.handlers.rst:1179 msgid "" "This asks the thread to terminate, and then waits for it to do so. Note that " "if you don't call this before your application exits, there may be some " "records still left on the queue, which won't be processed." msgstr "" -#: ../../library/logging.handlers.rst:1187 +#: ../../library/logging.handlers.rst:1185 msgid "" "Writes a sentinel to the queue to tell the listener to quit. This " "implementation uses ``put_nowait()``. You may want to override this method " "if you want to use timeouts or work with custom queue implementations." msgstr "" -#: ../../library/logging.handlers.rst:1198 +#: ../../library/logging.handlers.rst:1196 msgid "Module :mod:`logging`" msgstr ":mod:`logging` 模組" -#: ../../library/logging.handlers.rst:1198 +#: ../../library/logging.handlers.rst:1196 msgid "API reference for the logging module." msgstr "" -#: ../../library/logging.handlers.rst:1200 +#: ../../library/logging.handlers.rst:1198 msgid "Module :mod:`logging.config`" msgstr ":mod:`logging.config` 模組" -#: ../../library/logging.handlers.rst:1201 +#: ../../library/logging.handlers.rst:1199 msgid "Configuration API for the logging module." msgstr "" diff --git a/library/mailbox.po b/library/mailbox.po index a8a1eb86e8..d277e16352 100644 --- a/library/mailbox.po +++ b/library/mailbox.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-24 00:03+0000\n" +"POT-Creation-Date: 2023-10-20 00:03+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-" @@ -202,7 +202,7 @@ msgid "" "Return a representation of the message corresponding to *key*. If no such " "message exists, *default* is returned if the method was called as :meth:" "`get` and a :exc:`KeyError` exception is raised if the method was called as :" -"meth:`__getitem__`. The message is represented as an instance of the " +"meth:`~object.__getitem__`. The message is represented as an instance of the " "appropriate format-specific :class:`Message` subclass unless a custom " "message factory was specified when the :class:`Mailbox` instance was " "initialized." diff --git a/library/mmap.po b/library/mmap.po index a4d3c14a62..418b0e75fc 100644 --- a/library/mmap.po +++ b/library/mmap.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-10-24 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -52,10 +52,10 @@ msgid "" "A memory-mapped file is created by the :class:`~mmap.mmap` constructor, " "which is different on Unix and on Windows. In either case you must provide " "a file descriptor for a file opened for update. If you wish to map an " -"existing Python file object, use its :meth:`fileno` method to obtain the " -"correct value for the *fileno* parameter. Otherwise, you can open the file " -"using the :func:`os.open` function, which returns a file descriptor directly " -"(the file still needs to be closed when done)." +"existing Python file object, use its :meth:`~io.IOBase.fileno` method to " +"obtain the correct value for the *fileno* parameter. Otherwise, you can " +"open the file using the :func:`os.open` function, which returns a file " +"descriptor directly (the file still needs to be closed when done)." msgstr "" #: ../../library/mmap.rst:28 diff --git a/library/multiprocessing.po b/library/multiprocessing.po index 38134ab93d..ae00e0cc2c 100644 --- a/library/multiprocessing.po +++ b/library/multiprocessing.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-11 17:13+0000\n" +"POT-Creation-Date: 2023-10-24 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2845,8 +2845,9 @@ msgid "" "**Windows**: An item in *object_list* must either be an integer handle which " "is waitable (according to the definition used by the documentation of the " "Win32 function ``WaitForMultipleObjects()``) or it can be an object with a :" -"meth:`fileno` method which returns a socket handle or pipe handle. (Note " -"that pipe handles and socket handles are **not** waitable handles.)" +"meth:`~io.IOBase.fileno` method which returns a socket handle or pipe " +"handle. (Note that pipe handles and socket handles are **not** waitable " +"handles.)" msgstr "" #: ../../library/multiprocessing.rst:2581 diff --git a/library/operator.po b/library/operator.po index ed45990e29..20f1745011 100644 --- a/library/operator.po +++ b/library/operator.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 10:36+0000\n" +"POT-Creation-Date: 2023-10-20 00:03+0000\n" "PO-Revision-Date: 2023-02-18 14:49+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -89,8 +89,8 @@ msgid "" "`~object.__len__` methods.)" msgstr "" "回傳 :keyword:`not` *obj* 的結果。(請注意物件實例並沒有 :meth:`!__not__` " -"method(方法);只有直譯器核心定義此操作。結果會受 :meth:`~object.__bool__` 和 " -":meth:`~object.__len__` method 影響。)" +"method(方法);只有直譯器核心定義此操作。結果會受 :meth:`~object.__bool__` " +"和 :meth:`~object.__len__` method 影響。)" #: ../../library/operator.rst:69 msgid "" @@ -298,11 +298,11 @@ msgstr "" #: ../../library/operator.rst:308 msgid "" "Return a callable object that fetches *item* from its operand using the " -"operand's :meth:`__getitem__` method. If multiple items are specified, " -"returns a tuple of lookup values. For example:" +"operand's :meth:`~object.__getitem__` method. If multiple items are " +"specified, returns a tuple of lookup values. For example:" msgstr "" -"回傳一個使用運算元的 :meth:`__getitem__` 方法從運算元中獲取 *item* 的可呼叫物" -"件。如果指定了多個條目,則回傳一個查詢值的 tupple。例如:" +"回傳一個使用運算元的 :meth:`~object.__getitem__` 方法從運算元中獲取 *item* 的" +"可呼叫物件。如果指定了多個條目,則回傳一個查詢值的 tupple。例如:" #: ../../library/operator.rst:312 msgid "After ``f = itemgetter(2)``, the call ``f(r)`` returns ``r[2]``." @@ -318,13 +318,13 @@ msgstr "" #: ../../library/operator.rst:329 msgid "" -"The items can be any type accepted by the operand's :meth:`__getitem__` " -"method. Dictionaries accept any :term:`hashable` value. Lists, tuples, and " -"strings accept an index or a slice:" +"The items can be any type accepted by the operand's :meth:`~object." +"__getitem__` method. Dictionaries accept any :term:`hashable` value. " +"Lists, tuples, and strings accept an index or a slice:" msgstr "" -"傳入的條目可以為運算元的 :meth:`__getitem__` 所接受的任何型別。dictionary(字" -"典)接受任意\\ :term:`可雜湊 `\\ 的值。list、tupple 和字串接受索引" -"或切片:" +"傳入的條目可以為運算元的 :meth:`~object.__getitem__` 所接受的任何型別。" +"dictionary(字典)接受任意\\ :term:`可雜湊 `\\ 的值。list、tupple " +"和字串接受索引或切片:" #: ../../library/operator.rst:343 msgid "" diff --git a/library/posix.po b/library/posix.po index 7f86596528..c28cdb16cf 100644 --- a/library/posix.po +++ b/library/posix.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-11-01 00:03+0000\n" "PO-Revision-Date: 2023-01-24 00:05+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -32,7 +32,11 @@ msgstr "" "該模組提供對由 C 標準和 POSIX 標準(一種偽裝的 Unix 介面)所標準化的作業系統" "功能的存取。" -#: ../../library/posix.rst:16 +#: ../../library/posix.rst:14 +msgid ":ref:`Availability `: Unix." +msgstr ":ref:`適用 `:Unix。" + +#: ../../library/posix.rst:18 msgid "" "**Do not import this module directly.** Instead, import the module :mod:" "`os`, which provides a *portable* version of this interface. On Unix, the :" @@ -51,7 +55,7 @@ msgstr "" "`posix` *不會有*\\ 性能損失。此外,:mod:`os` 提供了一些額外的功能,例如當 " "``os.environ`` 中的條目更改時自動呼叫 :func:`~os.putenv`。" -#: ../../library/posix.rst:25 +#: ../../library/posix.rst:27 msgid "" "Errors are reported as exceptions; the usual exceptions are given for type " "errors, while errors reported by the system calls raise :exc:`OSError`." @@ -59,11 +63,11 @@ msgstr "" "錯誤會以例外的形式被回報;常見的例外是因為型別錯誤而給出的,而系統呼叫回報的" "錯誤會引發 :exc:`OSError`。" -#: ../../library/posix.rst:32 +#: ../../library/posix.rst:34 msgid "Large File Support" msgstr "對大檔案 (Large File) 的支援" -#: ../../library/posix.rst:40 +#: ../../library/posix.rst:42 msgid "" "Several operating systems (including AIX and Solaris) provide support for " "files that are larger than 2 GiB from a C programming model where :c:expr:" @@ -76,7 +80,7 @@ msgstr "" "大小和偏移量 (offset) 種類定義為 64-bit 值來實作。此類檔案有時被稱為「大檔案 " "(:dfn:`large files`)」。" -#: ../../library/posix.rst:46 +#: ../../library/posix.rst:48 msgid "" "Large file support is enabled in Python when the size of an :c:type:`off_t` " "is larger than a :c:expr:`long` and the :c:expr:`long long` is at least as " @@ -91,18 +95,18 @@ msgstr "" "\n" "::" -#: ../../library/posix.rst:56 +#: ../../library/posix.rst:58 msgid "On large-file-capable Linux systems, this might work::" msgstr "" "在支援大檔案的 Linux 系統上,這可能有效:\n" "\n" "::" -#: ../../library/posix.rst:65 +#: ../../library/posix.rst:67 msgid "Notable Module Contents" msgstr "值得注意的模組內容" -#: ../../library/posix.rst:67 +#: ../../library/posix.rst:69 msgid "" "In addition to many functions described in the :mod:`os` module " "documentation, :mod:`posix` defines the following data item:" @@ -110,7 +114,7 @@ msgstr "" "除了 :mod:`os` 模組說明文件中描述的許多函式外,:mod:`posix` 還定義了以下資料" "項目:" -#: ../../library/posix.rst:72 +#: ../../library/posix.rst:74 msgid "" "A dictionary representing the string environment at the time the interpreter " "was started. Keys and values are bytes on Unix and str on Windows. For " @@ -121,7 +125,7 @@ msgstr "" "str。例如,``environ[b'HOME']``\\ (Windows 上為 ``environ['HOME']``\\ )是你" "的主目錄的路徑名,等同於 C 語言中的 ``getenv(\"HOME\")``。" -#: ../../library/posix.rst:77 +#: ../../library/posix.rst:79 msgid "" "Modifying this dictionary does not affect the string environment passed on " "by :func:`~os.execv`, :func:`~os.popen` or :func:`~os.system`; if you need " @@ -134,11 +138,11 @@ msgstr "" "`~os.execve` 或將變數賦值和匯出陳述句新增到 :func:`~os.system` 或 :func:`~os." "popen` 的指令字串中。" -#: ../../library/posix.rst:83 +#: ../../library/posix.rst:85 msgid "On Unix, keys and values are bytes." msgstr "在 Unix 上,鍵和值是位元組。" -#: ../../library/posix.rst:88 +#: ../../library/posix.rst:90 msgid "" "The :mod:`os` module provides an alternate implementation of ``environ`` " "which updates the environment on modification. Note also that updating :data:" @@ -150,18 +154,18 @@ msgstr "" "新 :data:`os.environ` 將使該字典變成過時的。建議使用 :mod:`os` 模組版本,而不" "是直接存取 :mod:`posix` 模組。" -#: ../../library/posix.rst:14 +#: ../../library/posix.rst:16 msgid "module" msgstr "module(模組)" -#: ../../library/posix.rst:14 +#: ../../library/posix.rst:16 msgid "os" msgstr "os" -#: ../../library/posix.rst:34 +#: ../../library/posix.rst:36 msgid "large files" msgstr "large files(大型檔案)" -#: ../../library/posix.rst:34 +#: ../../library/posix.rst:36 msgid "file" msgstr "file(檔案)" diff --git a/library/pty.po b/library/pty.po index cbce70b540..14588f7c4b 100644 --- a/library/pty.po +++ b/library/pty.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 10:36+0000\n" +"POT-Creation-Date: 2023-11-01 00:03+0000\n" "PO-Revision-Date: 2016-11-19 00:33+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -34,17 +34,21 @@ msgid "" msgstr "" #: ../../library/pty.rst:19 +msgid ":ref:`Availability `: Unix." +msgstr ":ref:`適用 `:Unix。" + +#: ../../library/pty.rst:21 msgid "" "Pseudo-terminal handling is highly platform dependent. This code is mainly " "tested on Linux, FreeBSD, and macOS (it is supposed to work on other POSIX " "platforms but it's not been thoroughly tested)." msgstr "" -#: ../../library/pty.rst:23 +#: ../../library/pty.rst:25 msgid "The :mod:`pty` module defines the following functions:" msgstr "" -#: ../../library/pty.rst:28 +#: ../../library/pty.rst:30 msgid "" "Fork. Connect the child's controlling terminal to a pseudo-terminal. Return " "value is ``(pid, fd)``. Note that the child gets *pid* 0, and the *fd* is " @@ -53,14 +57,14 @@ msgid "" "the child's standard input and output)." msgstr "" -#: ../../library/pty.rst:37 +#: ../../library/pty.rst:39 msgid "" "Open a new pseudo-terminal pair, using :func:`os.openpty` if possible, or " "emulation code for generic Unix systems. Return a pair of file descriptors " "``(master, slave)``, for the master and the slave end, respectively." msgstr "" -#: ../../library/pty.rst:44 +#: ../../library/pty.rst:46 msgid "" "Spawn a process, and connect its controlling terminal with the current " "process's standard io. This is often used to baffle programs which insist on " @@ -69,14 +73,14 @@ msgid "" "will return." msgstr "" -#: ../../library/pty.rst:50 +#: ../../library/pty.rst:52 msgid "" "A loop copies STDIN of the current process to the child and data received " "from the child to STDOUT of the current process. It is not signaled to the " "child if STDIN of the current process closes down." msgstr "" -#: ../../library/pty.rst:54 +#: ../../library/pty.rst:56 msgid "" "The functions *master_read* and *stdin_read* are passed a file descriptor " "which they should read from, and they should always return a byte string. In " @@ -84,7 +88,7 @@ msgid "" "array should be returned to signal end of file." msgstr "" -#: ../../library/pty.rst:59 +#: ../../library/pty.rst:61 msgid "" "The default implementation for both functions will read and return up to " "1024 bytes each time the function is called. The *master_read* callback is " @@ -93,7 +97,7 @@ msgid "" "the parent process's standard input." msgstr "" -#: ../../library/pty.rst:65 +#: ../../library/pty.rst:67 msgid "" "Returning an empty byte string from either callback is interpreted as an end-" "of-file (EOF) condition, and that callback will not be called after that. If " @@ -103,35 +107,35 @@ msgid "" "signals EOF the same behavior results (on linux at least)." msgstr "" -#: ../../library/pty.rst:72 +#: ../../library/pty.rst:74 msgid "" "Return the exit status value from :func:`os.waitpid` on the child process." msgstr "" -#: ../../library/pty.rst:74 +#: ../../library/pty.rst:76 msgid "" ":func:`os.waitstatus_to_exitcode` can be used to convert the exit status " "into an exit code." msgstr "" -#: ../../library/pty.rst:77 +#: ../../library/pty.rst:79 msgid "" "Raises an :ref:`auditing event ` ``pty.spawn`` with argument " "``argv``." msgstr "" "引發一個附帶引數 ``argv`` 的\\ :ref:`稽核事件 ` ``pty.spawn``。" -#: ../../library/pty.rst:79 +#: ../../library/pty.rst:81 msgid "" ":func:`spawn` now returns the status value from :func:`os.waitpid` on the " "child process." msgstr "" -#: ../../library/pty.rst:84 +#: ../../library/pty.rst:86 msgid "Example" msgstr "範例" -#: ../../library/pty.rst:88 +#: ../../library/pty.rst:90 msgid "" "The following program acts like the Unix command :manpage:`script(1)`, using " "a pseudo-terminal to record all input and output of a terminal session in a " diff --git a/library/pwd.po b/library/pwd.po index 1ac2d5f4cc..10903ae7c6 100644 --- a/library/pwd.po +++ b/library/pwd.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-13 00:17+0000\n" +"POT-Creation-Date: 2023-11-01 00:03+0000\n" "PO-Revision-Date: 2023-05-20 16:08+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -30,18 +30,9 @@ msgid "" msgstr "" "此模組提供對 Unix 使用者帳戶和密碼資料庫的存取介面。它適用於所有 Unix 版本。" -#: ../../includes/wasm-notavail.rst:3 -msgid ":ref:`Availability `: not Emscripten, not WASI." -msgstr ":ref:`Availability `:非 Emscripten、非 WASI。" - -#: ../../includes/wasm-notavail.rst:5 -msgid "" -"This module does not work or is not available on WebAssembly platforms " -"``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " -"more information." -msgstr "" -"此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上不起作用" -"或無法使用。更多資訊請參閱 :ref:`wasm-availability`。" +#: ../../library/pwd.rst:13 +msgid ":ref:`Availability `: Unix, not Emscripten, not WASI." +msgstr ":ref:`適用 `:Unix、非 Emscripten、非 WASI。" #: ../../library/pwd.rst:15 msgid "" @@ -214,3 +205,11 @@ msgstr "module(模組)" #: ../../library/pwd.rst:42 msgid "crypt" msgstr "crypt" + +#~ msgid "" +#~ "This module does not work or is not available on WebAssembly platforms " +#~ "``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` " +#~ "for more information." +#~ msgstr "" +#~ "此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上不起" +#~ "作用或無法使用。更多資訊請參閱 :ref:`wasm-availability`。" diff --git a/library/resource.po b/library/resource.po index 9b0e297da0..c310598aa7 100644 --- a/library/resource.po +++ b/library/resource.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-03 00:17+0000\n" +"POT-Creation-Date: 2023-11-01 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:09+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -28,18 +28,9 @@ msgid "" "resources utilized by a program." msgstr "" -#: ../../includes/wasm-notavail.rst:3 -msgid ":ref:`Availability `: not Emscripten, not WASI." -msgstr "" - -#: ../../includes/wasm-notavail.rst:5 -msgid "" -"This module does not work or is not available on WebAssembly platforms " -"``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " -"more information." -msgstr "" -"此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法作用" -"或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" +#: ../../library/resource.rst:16 +msgid ":ref:`Availability `: Unix, not Emscripten, not WASI." +msgstr ":ref:`適用 `:Unix、非 Emscripten、非 WASI。" #: ../../library/resource.rst:18 msgid "" @@ -123,7 +114,7 @@ msgstr "" msgid "VxWorks only supports setting :data:`RLIMIT_NOFILE`." msgstr "" -#: ../../library/resource.rst:94 +#: ../../library/resource.rst:83 msgid "" "Raises an :ref:`auditing event ` ``resource.setrlimit`` with " "arguments ``resource``, ``limits``." @@ -154,7 +145,7 @@ msgid "" "process." msgstr "" -#: ../../library/resource.rst:113 +#: ../../library/resource.rst:102 msgid "" "Raises an :ref:`auditing event ` ``resource.prlimit`` with " "arguments ``pid``, ``resource``, ``limits``." @@ -604,3 +595,11 @@ msgid "" "Pass to :func:`getrusage` to request resources consumed by the current " "thread. May not be available on all systems." msgstr "" + +#~ msgid "" +#~ "This module does not work or is not available on WebAssembly platforms " +#~ "``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` " +#~ "for more information." +#~ msgstr "" +#~ "此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法" +#~ "作用或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" diff --git a/library/selectors.po b/library/selectors.po index 71fd2b0f0f..a1f060159a 100644 --- a/library/selectors.po +++ b/library/selectors.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 10:36+0000\n" +"POT-Creation-Date: 2023-10-24 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:09+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -43,8 +43,8 @@ msgid "" "concrete implementations (:class:`KqueueSelector`, :class:" "`EpollSelector`...), that can be used to wait for I/O readiness notification " "on multiple file objects. In the following, \"file object\" refers to any " -"object with a :meth:`fileno()` method, or a raw file descriptor. See :term:" -"`file object`." +"object with a :meth:`~io.IOBase.fileno` method, or a raw file descriptor. " +"See :term:`file object`." msgstr "" #: ../../library/selectors.rst:26 diff --git a/library/socket.po b/library/socket.po index 1c2482488b..585c4b7523 100644 --- a/library/socket.po +++ b/library/socket.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-11 17:13+0000\n" +"POT-Creation-Date: 2023-10-30 00:03+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-" @@ -113,8 +113,8 @@ msgid "" "Previously, :const:`AF_UNIX` socket paths were assumed to use UTF-8 encoding." msgstr "" -#: ../../library/socket.rst:66 ../../library/socket.rst:1142 -#: ../../library/socket.rst:1184 ../../library/socket.rst:1943 +#: ../../library/socket.rst:66 ../../library/socket.rst:1149 +#: ../../library/socket.rst:1191 ../../library/socket.rst:1950 msgid "Writable :term:`bytes-like object` is now accepted." msgstr "" @@ -288,8 +288,8 @@ msgstr "" msgid "*feat* and *mask* are unsigned 32bit integers." msgstr "" -#: ../../library/socket.rst:171 ../../library/socket.rst:583 -#: ../../library/socket.rst:1865 +#: ../../library/socket.rst:171 ../../library/socket.rst:590 +#: ../../library/socket.rst:1872 msgid ":ref:`Availability `: Linux >= 2.6.38." msgstr ":ref:`適用 `:Linux >= 2.6.38。" @@ -304,7 +304,7 @@ msgid "" "context ID or CID and port are integers." msgstr "" -#: ../../library/socket.rst:181 ../../library/socket.rst:656 +#: ../../library/socket.rst:181 ../../library/socket.rst:663 msgid ":ref:`Availability `: Linux >= 3.9" msgstr ":ref:`適用 `:Linux 3.9 以上。" @@ -370,7 +370,7 @@ msgid "" "address, whose interpretation depends on the device." msgstr "" -#: ../../library/socket.rst:210 ../../library/socket.rst:531 +#: ../../library/socket.rst:210 ../../library/socket.rst:538 msgid ":ref:`Availability `: Linux >= 2.2." msgstr ":ref:`適用 `:Linux >= 2.2。" @@ -382,7 +382,7 @@ msgid "" "*port* are non-negative integers." msgstr "" -#: ../../library/socket.rst:217 ../../library/socket.rst:632 +#: ../../library/socket.rst:217 ../../library/socket.rst:639 msgid ":ref:`Availability `: Linux >= 4.7." msgstr ":ref:`適用 `:Linux >= 4.7。" @@ -562,7 +562,14 @@ msgid "" "depending on the system." msgstr "" -#: ../../library/socket.rst:362 +#: ../../library/socket.rst:357 +msgid "" +":const:`AF_UNSPEC` means that :func:`getaddrinfo` should return socket " +"addresses for any address family (either IPv4, IPv6, or any other) that can " +"be used." +msgstr "" + +#: ../../library/socket.rst:367 msgid "" "These constants represent the socket types, used for the second argument to :" "func:`.socket`. More constants may be available depending on the system. " @@ -570,24 +577,24 @@ msgid "" "useful.)" msgstr "" -#: ../../library/socket.rst:370 +#: ../../library/socket.rst:375 msgid "" "These two constants, if defined, can be combined with the socket types and " "allow you to set some flags atomically (thus avoiding possible race " "conditions and the need for separate calls)." msgstr "" -#: ../../library/socket.rst:376 +#: ../../library/socket.rst:381 msgid "" "`Secure File Descriptor Handling `_ for a more thorough explanation." msgstr "" -#: ../../library/socket.rst:379 +#: ../../library/socket.rst:384 msgid ":ref:`Availability `: Linux >= 2.6.27." msgstr ":ref:`適用 `:Linux >= 2.6.27。" -#: ../../library/socket.rst:398 +#: ../../library/socket.rst:405 msgid "" "Many constants of these forms, documented in the Unix documentation on " "sockets and/or the IP protocol, are also defined in the socket module. They " @@ -597,41 +604,41 @@ msgid "" "default values are provided." msgstr "" -#: ../../library/socket.rst:405 +#: ../../library/socket.rst:412 msgid "" "``SO_DOMAIN``, ``SO_PROTOCOL``, ``SO_PEERSEC``, ``SO_PASSSEC``, " "``TCP_USER_TIMEOUT``, ``TCP_CONGESTION`` were added." msgstr "" -#: ../../library/socket.rst:409 +#: ../../library/socket.rst:416 msgid "" "On Windows, ``TCP_FASTOPEN``, ``TCP_KEEPCNT`` appear if run-time Windows " "supports." msgstr "" -#: ../../library/socket.rst:413 +#: ../../library/socket.rst:420 msgid "``TCP_NOTSENT_LOWAT`` was added." msgstr "新增 ``TCP_NOTSENT_LOWAT``。" -#: ../../library/socket.rst:416 +#: ../../library/socket.rst:423 msgid "" "On Windows, ``TCP_KEEPIDLE``, ``TCP_KEEPINTVL`` appear if run-time Windows " "supports." msgstr "" -#: ../../library/socket.rst:419 +#: ../../library/socket.rst:426 msgid "" "``IP_RECVTOS`` was added. Added ``TCP_KEEPALIVE``. On MacOS this constant " "can be used in the same way that ``TCP_KEEPIDLE`` is used on Linux." msgstr "" -#: ../../library/socket.rst:424 +#: ../../library/socket.rst:431 msgid "" "Added ``TCP_CONNECTION_INFO``. On MacOS this constant can be used in the " "same way that ``TCP_INFO`` is used on Linux and BSD." msgstr "" -#: ../../library/socket.rst:428 +#: ../../library/socket.rst:435 msgid "" "Added ``SO_RTABLE`` and ``SO_USER_COOKIE``. On OpenBSD and FreeBSD " "respectively those constants can be used in the same way that ``SO_MARK`` is " @@ -647,166 +654,166 @@ msgid "" "``IP_DROP_SOURCE_MEMBERSHIP``." msgstr "" -#: ../../library/socket.rst:447 ../../library/socket.rst:528 -#: ../../library/socket.rst:552 +#: ../../library/socket.rst:454 ../../library/socket.rst:535 +#: ../../library/socket.rst:559 msgid "" "Many constants of these forms, documented in the Linux documentation, are " "also defined in the socket module." msgstr "" -#: ../../library/socket.rst:450 +#: ../../library/socket.rst:457 msgid ":ref:`Availability `: Linux >= 2.6.25, NetBSD >= 8." msgstr ":ref:`適用 `:Linux 2.6.25 以上、NetBSD 8 以上。" -#: ../../library/socket.rst:454 +#: ../../library/socket.rst:461 msgid "NetBSD support was added." msgstr "" -#: ../../library/socket.rst:460 +#: ../../library/socket.rst:467 msgid "" "CAN_BCM, in the CAN protocol family, is the broadcast manager (BCM) " "protocol. Broadcast manager constants, documented in the Linux " "documentation, are also defined in the socket module." msgstr "" -#: ../../library/socket.rst:464 ../../library/socket.rst:499 +#: ../../library/socket.rst:471 ../../library/socket.rst:506 msgid ":ref:`Availability `: Linux >= 2.6.25." msgstr ":ref:`適用 `:Linux >= 2.6.25。" -#: ../../library/socket.rst:467 +#: ../../library/socket.rst:474 msgid "" "The :data:`CAN_BCM_CAN_FD_FRAME` flag is only available on Linux >= 4.8." msgstr "" -#: ../../library/socket.rst:473 +#: ../../library/socket.rst:480 msgid "" "Enables CAN FD support in a CAN_RAW socket. This is disabled by default. " "This allows your application to send both CAN and CAN FD frames; however, " "you must accept both CAN and CAN FD frames when reading from the socket." msgstr "" -#: ../../library/socket.rst:477 ../../library/socket.rst:488 +#: ../../library/socket.rst:484 ../../library/socket.rst:495 msgid "This constant is documented in the Linux documentation." msgstr "" -#: ../../library/socket.rst:479 +#: ../../library/socket.rst:486 msgid ":ref:`Availability `: Linux >= 3.6." msgstr ":ref:`適用 `:Linux >= 3.6。" -#: ../../library/socket.rst:485 +#: ../../library/socket.rst:492 msgid "" "Joins the applied CAN filters such that only CAN frames that match all given " "CAN filters are passed to user space." msgstr "" -#: ../../library/socket.rst:490 +#: ../../library/socket.rst:497 msgid ":ref:`Availability `: Linux >= 4.1." msgstr ":ref:`適用 `:Linux >= 4.1。" -#: ../../library/socket.rst:496 +#: ../../library/socket.rst:503 msgid "" "CAN_ISOTP, in the CAN protocol family, is the ISO-TP (ISO 15765-2) protocol. " "ISO-TP constants, documented in the Linux documentation." msgstr "" -#: ../../library/socket.rst:505 +#: ../../library/socket.rst:512 msgid "" "CAN_J1939, in the CAN protocol family, is the SAE J1939 protocol. J1939 " "constants, documented in the Linux documentation." msgstr "" -#: ../../library/socket.rst:508 +#: ../../library/socket.rst:515 msgid ":ref:`Availability `: Linux >= 5.4." msgstr ":ref:`適用 `:Linux >= 5.4。" -#: ../../library/socket.rst:516 +#: ../../library/socket.rst:523 msgid "" "These two constants, documented in the FreeBSD divert(4) manual page, are " "also defined in the socket module." msgstr "" -#: ../../library/socket.rst:519 +#: ../../library/socket.rst:526 msgid ":ref:`Availability `: FreeBSD >= 14.0." msgstr ":ref:`適用 `:FreeBSD >= 14.0。" -#: ../../library/socket.rst:536 +#: ../../library/socket.rst:543 msgid "" ":data:`!ETH_P_ALL` can be used in the :class:`~socket.socket` constructor as " "*proto* for the :const:`AF_PACKET` family in order to capture every packet, " "regardless of protocol." msgstr "" -#: ../../library/socket.rst:540 +#: ../../library/socket.rst:547 msgid "For more information, see the :manpage:`packet(7)` manpage." msgstr "" -#: ../../library/socket.rst:542 +#: ../../library/socket.rst:549 msgid ":ref:`Availability `: Linux." msgstr ":ref:`適用 `:Linux。" -#: ../../library/socket.rst:555 +#: ../../library/socket.rst:562 msgid ":ref:`Availability `: Linux >= 2.6.30." msgstr ":ref:`適用 `:Linux >= 2.6.30。" -#: ../../library/socket.rst:565 +#: ../../library/socket.rst:572 msgid "" "Constants for Windows' WSAIoctl(). The constants are used as arguments to " "the :meth:`~socket.socket.ioctl` method of socket objects." msgstr "" -#: ../../library/socket.rst:568 ../../library/socket.rst:1557 +#: ../../library/socket.rst:575 ../../library/socket.rst:1564 msgid "``SIO_LOOPBACK_FAST_PATH`` was added." msgstr "加入 ``SIO_LOOPBACK_FAST_PATH``。" -#: ../../library/socket.rst:574 +#: ../../library/socket.rst:581 msgid "" "TIPC related constants, matching the ones exported by the C socket API. See " "the TIPC documentation for more information." msgstr "" -#: ../../library/socket.rst:581 +#: ../../library/socket.rst:588 msgid "Constants for Linux Kernel cryptography." msgstr "" -#: ../../library/socket.rst:593 +#: ../../library/socket.rst:600 msgid "Constants for Linux host/guest communication." msgstr "" -#: ../../library/socket.rst:595 +#: ../../library/socket.rst:602 msgid ":ref:`Availability `: Linux >= 4.8." msgstr ":ref:`適用 `:Linux >= 4.8。" -#: ../../library/socket.rst:601 +#: ../../library/socket.rst:608 msgid ":ref:`Availability `: BSD, macOS." msgstr ":ref:`適用 `:BSD、macOS。" -#: ../../library/socket.rst:607 +#: ../../library/socket.rst:614 msgid "" "This constant contains a boolean value which indicates if IPv6 is supported " "on this platform." msgstr "" -#: ../../library/socket.rst:613 +#: ../../library/socket.rst:620 msgid "" "These are string constants containing Bluetooth addresses with special " "meanings. For example, :const:`BDADDR_ANY` can be used to indicate any " "address when specifying the binding socket with :const:`BTPROTO_RFCOMM`." msgstr "" -#: ../../library/socket.rst:622 +#: ../../library/socket.rst:629 msgid "" "For use with :const:`BTPROTO_HCI`. :const:`HCI_FILTER` is not available for " "NetBSD or DragonFlyBSD. :const:`HCI_TIME_STAMP` and :const:`HCI_DATA_DIR` " "are not available for FreeBSD, NetBSD, or DragonFlyBSD." msgstr "" -#: ../../library/socket.rst:629 +#: ../../library/socket.rst:636 msgid "" "Constant for Qualcomm's IPC router protocol, used to communicate with " "service providing remote processors." msgstr "" -#: ../../library/socket.rst:638 +#: ../../library/socket.rst:645 msgid "" "LOCAL_CREDS and LOCAL_CREDS_PERSISTENT can be used with SOCK_DGRAM, " "SOCK_STREAM sockets, equivalent to Linux/DragonFlyBSD SO_PASSCRED, while " @@ -815,49 +822,49 @@ msgid "" "message type." msgstr "" -#: ../../library/socket.rst:647 +#: ../../library/socket.rst:654 msgid ":ref:`Availability `: FreeBSD." msgstr ":ref:`適用 `:FreeBSD。" -#: ../../library/socket.rst:651 +#: ../../library/socket.rst:658 msgid "" "Constant to optimize CPU locality, to be used in conjunction with :data:" "`SO_REUSEPORT`." msgstr "" -#: ../../library/socket.rst:671 +#: ../../library/socket.rst:678 msgid "Constants for Windows Hyper-V sockets for host/guest communications." msgstr "" -#: ../../library/socket.rst:673 ../../library/socket.rst:880 -#: ../../library/socket.rst:1971 +#: ../../library/socket.rst:680 ../../library/socket.rst:887 +#: ../../library/socket.rst:1978 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" -#: ../../library/socket.rst:684 +#: ../../library/socket.rst:691 msgid "" "`IEEE 802.3 protocol number `_. constants." msgstr "" -#: ../../library/socket.rst:688 +#: ../../library/socket.rst:695 msgid ":ref:`Availability `: Linux, FreeBSD, macOS." msgstr ":ref:`適用 `:Linux、FreeBSD、macOS。" -#: ../../library/socket.rst:694 +#: ../../library/socket.rst:701 msgid "Functions" msgstr "函式" -#: ../../library/socket.rst:697 +#: ../../library/socket.rst:704 msgid "Creating sockets" msgstr "建立 sockets" -#: ../../library/socket.rst:699 +#: ../../library/socket.rst:706 msgid "" "The following functions all create :ref:`socket objects `." msgstr "" -#: ../../library/socket.rst:704 +#: ../../library/socket.rst:711 msgid "" "Create a new socket using the given address family, socket type and protocol " "number. The address family should be :const:`AF_INET` (the default), :const:" @@ -870,7 +877,7 @@ msgid "" "`CAN_J1939`." msgstr "" -#: ../../library/socket.rst:714 +#: ../../library/socket.rst:721 msgid "" "If *fileno* is specified, the values for *family*, *type*, and *proto* are " "auto-detected from the specified file descriptor. Auto-detection can be " @@ -881,12 +888,12 @@ msgid "" "This may help close a detached socket using :meth:`socket.close()`." msgstr "" -#: ../../library/socket.rst:723 ../../library/socket.rst:869 -#: ../../library/socket.rst:1376 ../../library/socket.rst:1470 +#: ../../library/socket.rst:730 ../../library/socket.rst:876 +#: ../../library/socket.rst:1383 ../../library/socket.rst:1477 msgid "The newly created socket is :ref:`non-inheritable `." msgstr "" -#: ../../library/socket.rst:736 +#: ../../library/socket.rst:743 msgid "" "Raises an :ref:`auditing event ` ``socket.__new__`` with arguments " "``self``, ``family``, ``type``, ``protocol``." @@ -894,44 +901,44 @@ msgstr "" "引發一個附帶引數 ``self``、``family``、``type``、``protocol`` 的\\ :ref:`稽核" "事件 ` ``socket.__new__``。" -#: ../../library/socket.rst:727 +#: ../../library/socket.rst:734 msgid "The AF_CAN family was added. The AF_RDS family was added." msgstr "" -#: ../../library/socket.rst:731 +#: ../../library/socket.rst:738 msgid "The CAN_BCM protocol was added." msgstr "新增 CAN_BCM 協定。" -#: ../../library/socket.rst:734 ../../library/socket.rst:871 +#: ../../library/socket.rst:741 ../../library/socket.rst:878 msgid "The returned socket is now non-inheritable." msgstr "" -#: ../../library/socket.rst:737 +#: ../../library/socket.rst:744 msgid "The CAN_ISOTP protocol was added." msgstr "新增 CAN_ISOTP 協定。" -#: ../../library/socket.rst:740 +#: ../../library/socket.rst:747 msgid "" "When :const:`SOCK_NONBLOCK` or :const:`SOCK_CLOEXEC` bit flags are applied " "to *type* they are cleared, and :attr:`socket.type` will not reflect them. " "They are still passed to the underlying system ``socket()`` call. Therefore," msgstr "" -#: ../../library/socket.rst:752 +#: ../../library/socket.rst:759 msgid "" "will still create a non-blocking socket on OSes that support " "``SOCK_NONBLOCK``, but ``sock.type`` will be set to ``socket.SOCK_STREAM``." msgstr "" -#: ../../library/socket.rst:756 +#: ../../library/socket.rst:763 msgid "The CAN_J1939 protocol was added." msgstr "新增 CAN_J1939 協定。" -#: ../../library/socket.rst:759 +#: ../../library/socket.rst:766 msgid "The IPPROTO_MPTCP protocol was added." msgstr "新增 IPPROTO_MPTCP 協定。" -#: ../../library/socket.rst:764 +#: ../../library/socket.rst:771 msgid "" "Build a pair of connected socket objects using the given address family, " "socket type, and protocol number. Address family, socket type, and protocol " @@ -940,25 +947,25 @@ msgid "" "`AF_INET`." msgstr "" -#: ../../library/socket.rst:769 +#: ../../library/socket.rst:776 msgid "The newly created sockets are :ref:`non-inheritable `." msgstr "" -#: ../../library/socket.rst:771 +#: ../../library/socket.rst:778 msgid "" "The returned socket objects now support the whole socket API, rather than a " "subset." msgstr "" -#: ../../library/socket.rst:775 +#: ../../library/socket.rst:782 msgid "The returned sockets are now non-inheritable." msgstr "" -#: ../../library/socket.rst:778 +#: ../../library/socket.rst:785 msgid "Windows support added." msgstr "新增對 Windows 的支援。" -#: ../../library/socket.rst:784 +#: ../../library/socket.rst:791 msgid "" "Connect to a TCP service listening on the internet *address* (a 2-tuple " "``(host, port)``), and return the socket object. This is a higher-level " @@ -969,21 +976,21 @@ msgid "" "IPv4 and IPv6." msgstr "" -#: ../../library/socket.rst:792 +#: ../../library/socket.rst:799 msgid "" "Passing the optional *timeout* parameter will set the timeout on the socket " "instance before attempting to connect. If no *timeout* is supplied, the " "global default timeout setting returned by :func:`getdefaulttimeout` is used." msgstr "" -#: ../../library/socket.rst:797 +#: ../../library/socket.rst:804 msgid "" "If supplied, *source_address* must be a 2-tuple ``(host, port)`` for the " "socket to bind to as its source address before connecting. If host or port " "are '' or 0 respectively the OS default behavior will be used." msgstr "" -#: ../../library/socket.rst:801 +#: ../../library/socket.rst:808 msgid "" "When a connection cannot be created, an exception is raised. By default, it " "is the exception from the last address in the list. If *all_errors* is " @@ -991,21 +998,21 @@ msgid "" "attempts." msgstr "" -#: ../../library/socket.rst:806 +#: ../../library/socket.rst:813 msgid "*source_address* was added." msgstr "新增 *source_address*\\ 。" -#: ../../library/socket.rst:809 +#: ../../library/socket.rst:816 msgid "*all_errors* was added." msgstr "新增 *all_errors*\\ 。" -#: ../../library/socket.rst:815 +#: ../../library/socket.rst:822 msgid "" "Convenience function which creates a TCP socket bound to *address* (a 2-" "tuple ``(host, port)``) and returns the socket object." msgstr "" -#: ../../library/socket.rst:818 +#: ../../library/socket.rst:825 msgid "" "*family* should be either :data:`AF_INET` or :data:`AF_INET6`. *backlog* is " "the queue size passed to :meth:`socket.listen`; if not specified , a default " @@ -1013,7 +1020,7 @@ msgid "" "`SO_REUSEPORT` socket option." msgstr "" -#: ../../library/socket.rst:823 +#: ../../library/socket.rst:830 msgid "" "If *dualstack_ipv6* is true and the platform supports it the socket will be " "able to accept both IPv4 and IPv6 connections, else it will raise :exc:" @@ -1026,60 +1033,60 @@ msgid "" "func:`has_dualstack_ipv6`:" msgstr "" -#: ../../library/socket.rst:845 +#: ../../library/socket.rst:852 msgid "" "On POSIX platforms the :data:`SO_REUSEADDR` socket option is set in order to " "immediately reuse previous sockets which were bound on the same *address* " "and remained in TIME_WAIT state." msgstr "" -#: ../../library/socket.rst:853 +#: ../../library/socket.rst:860 msgid "" "Return ``True`` if the platform supports creating a TCP socket which can " "handle both IPv4 and IPv6 connections." msgstr "" -#: ../../library/socket.rst:860 +#: ../../library/socket.rst:867 msgid "" "Duplicate the file descriptor *fd* (an integer as returned by a file " -"object's :meth:`fileno` method) and build a socket object from the result. " -"Address family, socket type and protocol number are as for the :func:`." -"socket` function above. The file descriptor should refer to a socket, but " -"this is not checked --- subsequent operations on the object may fail if the " -"file descriptor is invalid. This function is rarely needed, but can be used " -"to get or set socket options on a socket passed to a program as standard " -"input or output (such as a server started by the Unix inet daemon). The " -"socket is assumed to be in blocking mode." +"object's :meth:`~io.IOBase.fileno` method) and build a socket object from " +"the result. Address family, socket type and protocol number are as for the :" +"func:`.socket` function above. The file descriptor should refer to a socket, " +"but this is not checked --- subsequent operations on the object may fail if " +"the file descriptor is invalid. This function is rarely needed, but can be " +"used to get or set socket options on a socket passed to a program as " +"standard input or output (such as a server started by the Unix inet " +"daemon). The socket is assumed to be in blocking mode." msgstr "" -#: ../../library/socket.rst:877 +#: ../../library/socket.rst:884 msgid "" "Instantiate a socket from data obtained from the :meth:`socket.share` " "method. The socket is assumed to be in blocking mode." msgstr "" -#: ../../library/socket.rst:887 +#: ../../library/socket.rst:894 msgid "" "This is a Python type object that represents the socket object type. It is " "the same as ``type(socket(...))``." msgstr "" -#: ../../library/socket.rst:892 +#: ../../library/socket.rst:899 msgid "Other functions" msgstr "其他函式" -#: ../../library/socket.rst:894 +#: ../../library/socket.rst:901 msgid "The :mod:`socket` module also offers various network-related services:" msgstr "" -#: ../../library/socket.rst:899 +#: ../../library/socket.rst:906 msgid "" "Close a socket file descriptor. This is like :func:`os.close`, but for " "sockets. On some platforms (most noticeable Windows) :func:`os.close` does " "not work for socket file descriptors." msgstr "" -#: ../../library/socket.rst:907 +#: ../../library/socket.rst:914 msgid "" "Translate the *host*/*port* argument into a sequence of 5-tuples that " "contain all the necessary arguments for creating a socket connected to that " @@ -1089,7 +1096,7 @@ msgid "" "and *port*, you can pass ``NULL`` to the underlying C API." msgstr "" -#: ../../library/socket.rst:914 +#: ../../library/socket.rst:921 msgid "" "The *family*, *type* and *proto* arguments can be optionally specified in " "order to narrow the list of addresses returned. Passing zero as a value for " @@ -1100,15 +1107,15 @@ msgid "" "domain name." msgstr "" -#: ../../library/socket.rst:922 +#: ../../library/socket.rst:929 msgid "The function returns a list of 5-tuples with the following structure:" msgstr "" -#: ../../library/socket.rst:924 +#: ../../library/socket.rst:931 msgid "``(family, type, proto, canonname, sockaddr)``" msgstr "``(family, type, proto, canonname, sockaddr)``" -#: ../../library/socket.rst:926 +#: ../../library/socket.rst:933 msgid "" "In these tuples, *family*, *type*, *proto* are all integers and are meant to " "be passed to the :func:`.socket` function. *canonname* will be a string " @@ -1120,7 +1127,7 @@ msgid "" "be passed to the :meth:`socket.connect` method." msgstr "" -#: ../../library/socket.rst:947 +#: ../../library/socket.rst:954 msgid "" "Raises an :ref:`auditing event ` ``socket.getaddrinfo`` with " "arguments ``host``, ``port``, ``family``, ``type``, ``protocol``." @@ -1128,24 +1135,24 @@ msgstr "" "引發一個附帶引數 ``host``、``port``、``family``、``type``、``protocol`` 的" "\\ :ref:`稽核事件 ` ``socket.getaddrinfo``。" -#: ../../library/socket.rst:938 +#: ../../library/socket.rst:945 msgid "" "The following example fetches address information for a hypothetical TCP " "connection to ``example.org`` on port 80 (results may differ on your system " "if IPv6 isn't enabled)::" msgstr "" -#: ../../library/socket.rst:948 +#: ../../library/socket.rst:955 msgid "parameters can now be passed using keyword arguments." msgstr "" -#: ../../library/socket.rst:951 +#: ../../library/socket.rst:958 msgid "" "for IPv6 multicast addresses, string representing an address will not " "contain ``%scope_id`` part." msgstr "" -#: ../../library/socket.rst:957 +#: ../../library/socket.rst:964 msgid "" "Return a fully qualified domain name for *name*. If *name* is omitted or " "empty, it is interpreted as the local host. To find the fully qualified " @@ -1156,7 +1163,7 @@ msgid "" "``'0.0.0.0'``, the hostname from :func:`gethostname` is returned." msgstr "" -#: ../../library/socket.rst:968 +#: ../../library/socket.rst:975 msgid "" "Translate a host name to IPv4 address format. The IPv4 address is returned " "as a string, such as ``'100.50.200.5'``. If the host name is an IPv4 " @@ -1166,7 +1173,7 @@ msgid "" "stack support." msgstr "" -#: ../../library/socket.rst:985 ../../library/socket.rst:1001 +#: ../../library/socket.rst:992 ../../library/socket.rst:1008 msgid "" "Raises an :ref:`auditing event ` ``socket.gethostbyname`` with " "argument ``hostname``." @@ -1174,18 +1181,18 @@ msgstr "" "引發一個附帶引數 ``hostname`` 的\\ :ref:`稽核事件 ` ``socket." "gethostbyname``。" -#: ../../library/socket.rst:976 ../../library/socket.rst:992 -#: ../../library/socket.rst:1005 ../../library/socket.rst:1020 -#: ../../library/socket.rst:1037 ../../library/socket.rst:1048 -#: ../../library/socket.rst:1059 ../../library/socket.rst:1070 -#: ../../library/socket.rst:1394 ../../library/socket.rst:1441 -#: ../../library/socket.rst:1455 ../../library/socket.rst:1475 -#: ../../library/socket.rst:1522 ../../library/socket.rst:1567 -#: ../../library/socket.rst:1949 ../../library/socket.rst:1959 +#: ../../library/socket.rst:983 ../../library/socket.rst:999 +#: ../../library/socket.rst:1012 ../../library/socket.rst:1027 +#: ../../library/socket.rst:1044 ../../library/socket.rst:1055 +#: ../../library/socket.rst:1066 ../../library/socket.rst:1077 +#: ../../library/socket.rst:1401 ../../library/socket.rst:1448 +#: ../../library/socket.rst:1462 ../../library/socket.rst:1482 +#: ../../library/socket.rst:1529 ../../library/socket.rst:1574 +#: ../../library/socket.rst:1956 ../../library/socket.rst:1966 msgid ":ref:`Availability `: not WASI." msgstr ":ref:`適用 `:非 WASI。" -#: ../../library/socket.rst:981 +#: ../../library/socket.rst:988 msgid "" "Translate a host name to IPv4 address format, extended interface. Return a 3-" "tuple ``(hostname, aliaslist, ipaddrlist)`` where *hostname* is the host's " @@ -1197,26 +1204,26 @@ msgid "" "stack support." msgstr "" -#: ../../library/socket.rst:997 +#: ../../library/socket.rst:1004 msgid "" "Return a string containing the hostname of the machine where the Python " "interpreter is currently executing." msgstr "" -#: ../../library/socket.rst:1011 +#: ../../library/socket.rst:1018 msgid "" "Raises an :ref:`auditing event ` ``socket.gethostname`` with no " "arguments." msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``socket.gethostname``。" -#: ../../library/socket.rst:1002 +#: ../../library/socket.rst:1009 msgid "" "Note: :func:`gethostname` doesn't always return the fully qualified domain " "name; use :func:`getfqdn` for that." msgstr "" -#: ../../library/socket.rst:1010 +#: ../../library/socket.rst:1017 msgid "" "Return a 3-tuple ``(hostname, aliaslist, ipaddrlist)`` where *hostname* is " "the primary host name responding to the given *ip_address*, *aliaslist* is a " @@ -1227,7 +1234,7 @@ msgid "" "`gethostbyaddr` supports both IPv4 and IPv6." msgstr "" -#: ../../library/socket.rst:1029 +#: ../../library/socket.rst:1036 msgid "" "Raises an :ref:`auditing event ` ``socket.gethostbyaddr`` with " "argument ``ip_address``." @@ -1235,7 +1242,7 @@ msgstr "" "引發一個附帶引數 ``ip_address`` 的\\ :ref:`稽核事件 ` ``socket." "gethostbyaddr``。" -#: ../../library/socket.rst:1025 +#: ../../library/socket.rst:1032 msgid "" "Translate a socket address *sockaddr* into a 2-tuple ``(host, port)``. " "Depending on the settings of *flags*, the result can contain a fully " @@ -1243,18 +1250,18 @@ msgid "" "Similarly, *port* can contain a string port name or a numeric port number." msgstr "" -#: ../../library/socket.rst:1030 +#: ../../library/socket.rst:1037 msgid "" "For IPv6 addresses, ``%scope_id`` is appended to the host part if *sockaddr* " "contains meaningful *scope_id*. Usually this happens for multicast addresses." msgstr "" -#: ../../library/socket.rst:1033 +#: ../../library/socket.rst:1040 msgid "" "For more information about *flags* you can consult :manpage:`getnameinfo(3)`." msgstr "" -#: ../../library/socket.rst:1046 +#: ../../library/socket.rst:1053 msgid "" "Raises an :ref:`auditing event ` ``socket.getnameinfo`` with " "argument ``sockaddr``." @@ -1262,7 +1269,7 @@ msgstr "" "引發一個附帶引數 ``sockaddr`` 的\\ :ref:`稽核事件 ` ``socket." "getnameinfo``。" -#: ../../library/socket.rst:1042 +#: ../../library/socket.rst:1049 msgid "" "Translate an internet protocol name (for example, ``'icmp'``) to a constant " "suitable for passing as the (optional) third argument to the :func:`.socket` " @@ -1271,14 +1278,14 @@ msgid "" "chosen automatically if the protocol is omitted or zero." msgstr "" -#: ../../library/socket.rst:1053 +#: ../../library/socket.rst:1060 msgid "" "Translate an internet service name and protocol name to a port number for " "that service. The optional protocol name, if given, should be ``'tcp'`` or " "``'udp'``, otherwise any protocol will match." msgstr "" -#: ../../library/socket.rst:1068 +#: ../../library/socket.rst:1075 msgid "" "Raises an :ref:`auditing event ` ``socket.getservbyname`` with " "arguments ``servicename``, ``protocolname``." @@ -1286,14 +1293,14 @@ msgstr "" "引發一個附帶引數 ``sockaddr``、``protocolname`` 的\\ :ref:`稽核事件 " "` ``socket.getservbyname``。" -#: ../../library/socket.rst:1064 +#: ../../library/socket.rst:1071 msgid "" "Translate an internet port number and protocol name to a service name for " "that service. The optional protocol name, if given, should be ``'tcp'`` or " "``'udp'``, otherwise any protocol will match." msgstr "" -#: ../../library/socket.rst:1079 +#: ../../library/socket.rst:1086 msgid "" "Raises an :ref:`auditing event ` ``socket.getservbyport`` with " "arguments ``port``, ``protocolname``." @@ -1301,40 +1308,40 @@ msgstr "" "引發一個附帶引數 ``port``、``protocolname`` 的\\ :ref:`稽核事件 ` " "``socket.getservbyport``。" -#: ../../library/socket.rst:1075 +#: ../../library/socket.rst:1082 msgid "" "Convert 32-bit positive integers from network to host byte order. On " "machines where the host byte order is the same as network byte order, this " "is a no-op; otherwise, it performs a 4-byte swap operation." msgstr "" -#: ../../library/socket.rst:1082 +#: ../../library/socket.rst:1089 msgid "" "Convert 16-bit positive integers from network to host byte order. On " "machines where the host byte order is the same as network byte order, this " "is a no-op; otherwise, it performs a 2-byte swap operation." msgstr "" -#: ../../library/socket.rst:1086 ../../library/socket.rst:1104 +#: ../../library/socket.rst:1093 ../../library/socket.rst:1111 msgid "" "Raises :exc:`OverflowError` if *x* does not fit in a 16-bit unsigned integer." msgstr "" -#: ../../library/socket.rst:1093 +#: ../../library/socket.rst:1100 msgid "" "Convert 32-bit positive integers from host to network byte order. On " "machines where the host byte order is the same as network byte order, this " "is a no-op; otherwise, it performs a 4-byte swap operation." msgstr "" -#: ../../library/socket.rst:1100 +#: ../../library/socket.rst:1107 msgid "" "Convert 16-bit positive integers from host to network byte order. On " "machines where the host byte order is the same as network byte order, this " "is a no-op; otherwise, it performs a 2-byte swap operation." msgstr "" -#: ../../library/socket.rst:1111 +#: ../../library/socket.rst:1118 msgid "" "Convert an IPv4 address from dotted-quad string format (for example, " "'123.45.67.89') to 32-bit packed binary format, as a bytes object four " @@ -1343,26 +1350,26 @@ msgid "" "which is the C type for the 32-bit packed binary this function returns." msgstr "" -#: ../../library/socket.rst:1117 +#: ../../library/socket.rst:1124 msgid "" ":func:`inet_aton` also accepts strings with less than three dots; see the " "Unix manual page :manpage:`inet(3)` for details." msgstr "" -#: ../../library/socket.rst:1120 +#: ../../library/socket.rst:1127 msgid "" "If the IPv4 address string passed to this function is invalid, :exc:" "`OSError` will be raised. Note that exactly what is valid depends on the " "underlying C implementation of :c:func:`inet_aton`." msgstr "" -#: ../../library/socket.rst:1124 +#: ../../library/socket.rst:1131 msgid "" ":func:`inet_aton` does not support IPv6, and :func:`inet_pton` should be " "used instead for IPv4/v6 dual stack support." msgstr "" -#: ../../library/socket.rst:1130 +#: ../../library/socket.rst:1137 msgid "" "Convert a 32-bit packed IPv4 address (a :term:`bytes-like object` four bytes " "in length) to its standard dotted-quad string representation (for example, " @@ -1372,7 +1379,7 @@ msgid "" "argument." msgstr "" -#: ../../library/socket.rst:1137 +#: ../../library/socket.rst:1144 msgid "" "If the byte sequence passed to this function is not exactly 4 bytes in " "length, :exc:`OSError` will be raised. :func:`inet_ntoa` does not support " @@ -1380,7 +1387,7 @@ msgid "" "support." msgstr "" -#: ../../library/socket.rst:1148 +#: ../../library/socket.rst:1155 msgid "" "Convert an IP address from its family-specific string format to a packed, " "binary format. :func:`inet_pton` is useful when a library or network " @@ -1388,7 +1395,7 @@ msgid "" "`inet_aton`) or :c:struct:`in6_addr`." msgstr "" -#: ../../library/socket.rst:1153 +#: ../../library/socket.rst:1160 msgid "" "Supported values for *address_family* are currently :const:`AF_INET` and :" "const:`AF_INET6`. If the IP address string *ip_string* is invalid, :exc:" @@ -1397,15 +1404,15 @@ msgid "" "`inet_pton`." msgstr "" -#: ../../library/socket.rst:1159 ../../library/socket.rst:1179 +#: ../../library/socket.rst:1166 ../../library/socket.rst:1186 msgid ":ref:`Availability `: Unix, Windows." msgstr ":ref:`適用 `:Unix、Windows。" -#: ../../library/socket.rst:1161 ../../library/socket.rst:1181 +#: ../../library/socket.rst:1168 ../../library/socket.rst:1188 msgid "Windows support added" msgstr "" -#: ../../library/socket.rst:1167 +#: ../../library/socket.rst:1174 msgid "" "Convert a packed IP address (a :term:`bytes-like object` of some number of " "bytes) to its standard, family-specific string representation (for example, " @@ -1414,7 +1421,7 @@ msgid "" "(similar to :func:`inet_ntoa`) or :c:struct:`in6_addr`." msgstr "" -#: ../../library/socket.rst:1174 +#: ../../library/socket.rst:1181 msgid "" "Supported values for *address_family* are currently :const:`AF_INET` and :" "const:`AF_INET6`. If the bytes object *packed_ip* is not the correct length " @@ -1422,7 +1429,7 @@ msgid "" "`OSError` is raised for errors from the call to :func:`inet_ntop`." msgstr "" -#: ../../library/socket.rst:1196 +#: ../../library/socket.rst:1203 msgid "" "Return the total length, without trailing padding, of an ancillary data item " "with associated data of the given *length*. This value can often be used as " @@ -1433,16 +1440,16 @@ msgid "" "the permissible range of values." msgstr "" -#: ../../library/socket.rst:1205 ../../library/socket.rst:1228 +#: ../../library/socket.rst:1212 ../../library/socket.rst:1235 msgid ":ref:`Availability `: Unix, not Emscripten, not WASI." msgstr ":ref:`適用 `:Unix、非 Emscripten、非 WASI。" -#: ../../library/socket.rst:1207 ../../library/socket.rst:1697 -#: ../../library/socket.rst:1741 ../../library/socket.rst:1849 +#: ../../library/socket.rst:1214 ../../library/socket.rst:1704 +#: ../../library/socket.rst:1748 ../../library/socket.rst:1856 msgid "Most Unix platforms." msgstr "" -#: ../../library/socket.rst:1214 +#: ../../library/socket.rst:1221 msgid "" "Return the buffer size needed for :meth:`~socket.recvmsg` to receive an " "ancillary data item with associated data of the given *length*, along with " @@ -1452,7 +1459,7 @@ msgid "" "values." msgstr "" -#: ../../library/socket.rst:1222 +#: ../../library/socket.rst:1229 msgid "" "Note that some systems might support ancillary data without providing this " "function. Also note that setting the buffer size using the results of this " @@ -1460,31 +1467,31 @@ msgid "" "received, since additional data may be able to fit into the padding area." msgstr "" -#: ../../library/socket.rst:1230 +#: ../../library/socket.rst:1237 msgid "most Unix platforms." msgstr "" -#: ../../library/socket.rst:1237 +#: ../../library/socket.rst:1244 msgid "" "Return the default timeout in seconds (float) for new socket objects. A " "value of ``None`` indicates that new socket objects have no timeout. When " "the socket module is first imported, the default is ``None``." msgstr "" -#: ../../library/socket.rst:1244 +#: ../../library/socket.rst:1251 msgid "" "Set the default timeout in seconds (float) for new socket objects. When the " "socket module is first imported, the default is ``None``. See :meth:" "`~socket.settimeout` for possible values and their respective meanings." msgstr "" -#: ../../library/socket.rst:1252 +#: ../../library/socket.rst:1259 msgid "" "Set the machine's hostname to *name*. This will raise an :exc:`OSError` if " "you don't have enough rights." msgstr "" -#: ../../library/socket.rst:1266 +#: ../../library/socket.rst:1273 msgid "" "Raises an :ref:`auditing event ` ``socket.sethostname`` with " "argument ``name``." @@ -1492,114 +1499,114 @@ msgstr "" "引發一個附帶引數 ``name`` 的\\ :ref:`稽核事件 ` ``socket." "sethostname``。" -#: ../../library/socket.rst:1257 ../../library/socket.rst:1695 -#: ../../library/socket.rst:1739 +#: ../../library/socket.rst:1264 ../../library/socket.rst:1702 +#: ../../library/socket.rst:1746 msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" -#: ../../library/socket.rst:1264 +#: ../../library/socket.rst:1271 msgid "" "Return a list of network interface information (index int, name string) " "tuples. :exc:`OSError` if the system call fails." msgstr "" -#: ../../library/socket.rst:1268 ../../library/socket.rst:1295 -#: ../../library/socket.rst:1312 ../../library/socket.rst:1329 -#: ../../library/socket.rst:1343 +#: ../../library/socket.rst:1275 ../../library/socket.rst:1302 +#: ../../library/socket.rst:1319 ../../library/socket.rst:1336 +#: ../../library/socket.rst:1350 msgid "" ":ref:`Availability `: Unix, Windows, not Emscripten, not WASI." msgstr ":ref:`適用 `:Unix、Windows、非 Emscripten、非 WASI。" -#: ../../library/socket.rst:1272 ../../library/socket.rst:1299 -#: ../../library/socket.rst:1316 +#: ../../library/socket.rst:1279 ../../library/socket.rst:1306 +#: ../../library/socket.rst:1323 msgid "Windows support was added." msgstr "增加對 Windows 的支援。" -#: ../../library/socket.rst:1277 +#: ../../library/socket.rst:1284 msgid "" "On Windows network interfaces have different names in different contexts " "(all names are examples):" msgstr "" -#: ../../library/socket.rst:1280 +#: ../../library/socket.rst:1287 msgid "UUID: ``{FB605B73-AAC2-49A6-9A2F-25416AEA0573}``" msgstr "UUID: ``{FB605B73-AAC2-49A6-9A2F-25416AEA0573}``" -#: ../../library/socket.rst:1281 +#: ../../library/socket.rst:1288 msgid "name: ``ethernet_32770``" msgstr "" -#: ../../library/socket.rst:1282 +#: ../../library/socket.rst:1289 msgid "friendly name: ``vEthernet (nat)``" msgstr "" -#: ../../library/socket.rst:1283 +#: ../../library/socket.rst:1290 msgid "description: ``Hyper-V Virtual Ethernet Adapter``" msgstr "" -#: ../../library/socket.rst:1285 +#: ../../library/socket.rst:1292 msgid "" "This function returns names of the second form from the list, " "``ethernet_32770`` in this example case." msgstr "" -#: ../../library/socket.rst:1291 +#: ../../library/socket.rst:1298 msgid "" "Return a network interface index number corresponding to an interface name. :" "exc:`OSError` if no interface with the given name exists." msgstr "" -#: ../../library/socket.rst:1303 ../../library/socket.rst:1320 +#: ../../library/socket.rst:1310 ../../library/socket.rst:1327 msgid "\"Interface name\" is a name as documented in :func:`if_nameindex`." msgstr "" -#: ../../library/socket.rst:1308 +#: ../../library/socket.rst:1315 msgid "" "Return a network interface name corresponding to an interface index number. :" "exc:`OSError` if no interface with the given index exists." msgstr "" -#: ../../library/socket.rst:1325 +#: ../../library/socket.rst:1332 msgid "" "Send the list of file descriptors *fds* over an :const:`AF_UNIX` socket " "*sock*. The *fds* parameter is a sequence of file descriptors. Consult :meth:" "`sendmsg` for the documentation of these parameters." msgstr "" -#: ../../library/socket.rst:1331 ../../library/socket.rst:1345 +#: ../../library/socket.rst:1338 ../../library/socket.rst:1352 msgid "" "Unix platforms supporting :meth:`~socket.sendmsg` and :const:`SCM_RIGHTS` " "mechanism." msgstr "" -#: ../../library/socket.rst:1339 +#: ../../library/socket.rst:1346 msgid "" "Receive up to *maxfds* file descriptors from an :const:`AF_UNIX` socket " "*sock*. Return ``(msg, list(fds), flags, addr)``. Consult :meth:`recvmsg` " "for the documentation of these parameters." msgstr "" -#: ../../library/socket.rst:1352 +#: ../../library/socket.rst:1359 msgid "Any truncated integers at the end of the list of file descriptors." msgstr "" -#: ../../library/socket.rst:1358 +#: ../../library/socket.rst:1365 msgid "Socket Objects" msgstr "Socket 物件" -#: ../../library/socket.rst:1360 +#: ../../library/socket.rst:1367 msgid "" "Socket objects have the following methods. Except for :meth:`~socket." "makefile`, these correspond to Unix system calls applicable to sockets." msgstr "" -#: ../../library/socket.rst:1364 +#: ../../library/socket.rst:1371 msgid "" "Support for the :term:`context manager` protocol was added. Exiting the " "context manager is equivalent to calling :meth:`~socket.close`." msgstr "" -#: ../../library/socket.rst:1371 +#: ../../library/socket.rst:1378 msgid "" "Accept a connection. The socket must be bound to an address and listening " "for connections. The return value is a pair ``(conn, address)`` where *conn* " @@ -1608,27 +1615,27 @@ msgid "" "connection." msgstr "" -#: ../../library/socket.rst:1378 ../../library/socket.rst:1472 +#: ../../library/socket.rst:1385 ../../library/socket.rst:1479 msgid "The socket is now non-inheritable." msgstr "" -#: ../../library/socket.rst:1381 ../../library/socket.rst:1610 -#: ../../library/socket.rst:1624 ../../library/socket.rst:1701 -#: ../../library/socket.rst:1774 ../../library/socket.rst:1793 -#: ../../library/socket.rst:1810 ../../library/socket.rst:1855 +#: ../../library/socket.rst:1388 ../../library/socket.rst:1617 +#: ../../library/socket.rst:1631 ../../library/socket.rst:1708 +#: ../../library/socket.rst:1781 ../../library/socket.rst:1800 +#: ../../library/socket.rst:1817 ../../library/socket.rst:1862 msgid "" "If the system call is interrupted and the signal handler does not raise an " "exception, the method now retries the system call instead of raising an :exc:" "`InterruptedError` exception (see :pep:`475` for the rationale)." msgstr "" -#: ../../library/socket.rst:1389 +#: ../../library/socket.rst:1396 msgid "" "Bind the socket to *address*. The socket must not already be bound. (The " "format of *address* depends on the address family --- see above.)" msgstr "" -#: ../../library/socket.rst:1403 +#: ../../library/socket.rst:1410 msgid "" "Raises an :ref:`auditing event ` ``socket.bind`` with arguments " "``self``, ``address``." @@ -1636,7 +1643,7 @@ msgstr "" "引發一個附帶引數 ``self``、``address`` 的\\ :ref:`稽核事件 ` " "``socket.bind``。" -#: ../../library/socket.rst:1399 +#: ../../library/socket.rst:1406 msgid "" "Mark the socket closed. The underlying system resource (e.g. a file " "descriptor) is also closed when all file objects from :meth:`makefile()` are " @@ -1645,20 +1652,20 @@ msgid "" "flushed)." msgstr "" -#: ../../library/socket.rst:1405 +#: ../../library/socket.rst:1412 msgid "" "Sockets are automatically closed when they are garbage-collected, but it is " "recommended to :meth:`close` them explicitly, or to use a :keyword:`with` " "statement around them." msgstr "" -#: ../../library/socket.rst:1409 +#: ../../library/socket.rst:1416 msgid "" ":exc:`OSError` is now raised if an error occurs when the underlying :c:func:" "`close` call is made." msgstr "" -#: ../../library/socket.rst:1415 +#: ../../library/socket.rst:1422 msgid "" ":meth:`close()` releases the resource associated with a connection but does " "not necessarily close the connection immediately. If you want to close the " @@ -1666,13 +1673,13 @@ msgid "" "`close()`." msgstr "" -#: ../../library/socket.rst:1423 +#: ../../library/socket.rst:1430 msgid "" "Connect to a remote socket at *address*. (The format of *address* depends on " "the address family --- see above.)" msgstr "" -#: ../../library/socket.rst:1426 +#: ../../library/socket.rst:1433 msgid "" "If the connection is interrupted by a signal, the method waits until the " "connection completes, or raise a :exc:`TimeoutError` on timeout, if the " @@ -1682,7 +1689,7 @@ msgid "" "(or the exception raised by the signal handler)." msgstr "" -#: ../../library/socket.rst:1444 ../../library/socket.rst:1464 +#: ../../library/socket.rst:1451 ../../library/socket.rst:1471 msgid "" "Raises an :ref:`auditing event ` ``socket.connect`` with arguments " "``self``, ``address``." @@ -1690,7 +1697,7 @@ msgstr "" "引發一個附帶引數 ``self``、``address`` 的\\ :ref:`稽核事件 ` " "``socket.connect``。" -#: ../../library/socket.rst:1435 +#: ../../library/socket.rst:1442 msgid "" "The method now waits until the connection completes instead of raising an :" "exc:`InterruptedError` exception if the connection is interrupted by a " @@ -1698,7 +1705,7 @@ msgid "" "blocking or has a timeout (see the :pep:`475` for the rationale)." msgstr "" -#: ../../library/socket.rst:1446 +#: ../../library/socket.rst:1453 msgid "" "Like ``connect(address)``, but return an error indicator instead of raising " "an exception for errors returned by the C-level :c:func:`connect` call " @@ -1708,38 +1715,38 @@ msgid "" "asynchronous connects." msgstr "" -#: ../../library/socket.rst:1459 +#: ../../library/socket.rst:1466 msgid "" "Put the socket object into closed state without actually closing the " "underlying file descriptor. The file descriptor is returned, and can be " "reused for other purposes." msgstr "" -#: ../../library/socket.rst:1468 +#: ../../library/socket.rst:1475 msgid "Duplicate the socket." msgstr "" -#: ../../library/socket.rst:1480 +#: ../../library/socket.rst:1487 msgid "" "Return the socket's file descriptor (a small integer), or -1 on failure. " "This is useful with :func:`select.select`." msgstr "" -#: ../../library/socket.rst:1483 +#: ../../library/socket.rst:1490 msgid "" "Under Windows the small integer returned by this method cannot be used where " "a file descriptor can be used (such as :func:`os.fdopen`). Unix does not " "have this limitation." msgstr "" -#: ../../library/socket.rst:1489 +#: ../../library/socket.rst:1496 msgid "" "Get the :ref:`inheritable flag ` of the socket's file " "descriptor or socket's handle: ``True`` if the socket can be inherited in " "child processes, ``False`` if it cannot." msgstr "" -#: ../../library/socket.rst:1498 +#: ../../library/socket.rst:1505 msgid "" "Return the remote address to which the socket is connected. This is useful " "to find out the port number of a remote IPv4/v6 socket, for instance. (The " @@ -1747,14 +1754,14 @@ msgid "" "above.) On some systems this function is not supported." msgstr "" -#: ../../library/socket.rst:1506 +#: ../../library/socket.rst:1513 msgid "" "Return the socket's own address. This is useful to find out the port number " "of an IPv4/v6 socket, for instance. (The format of the address returned " "depends on the address family --- see above.)" msgstr "" -#: ../../library/socket.rst:1513 +#: ../../library/socket.rst:1520 msgid "" "Return the value of the given socket option (see the Unix man page :manpage:" "`getsockopt(2)`). The needed symbolic constants (:const:`SO_\\*` etc.) are " @@ -1766,16 +1773,16 @@ msgid "" "`struct` for a way to decode C structures encoded as byte strings)." msgstr "" -#: ../../library/socket.rst:1527 +#: ../../library/socket.rst:1534 msgid "" "Return ``True`` if socket is in blocking mode, ``False`` if in non-blocking." msgstr "" -#: ../../library/socket.rst:1530 +#: ../../library/socket.rst:1537 msgid "This is equivalent to checking ``socket.gettimeout() != 0``." msgstr "這等同於檢查 ``socket.gettimeout() != 0``。" -#: ../../library/socket.rst:1537 +#: ../../library/socket.rst:1544 msgid "" "Return the timeout in seconds (float) associated with socket operations, or " "``None`` if no timeout is set. This reflects the last call to :meth:" @@ -1786,30 +1793,30 @@ msgstr "" msgid "platform" msgstr "平台" -#: ../../library/socket.rst:1544 +#: ../../library/socket.rst:1551 msgid "Windows" msgstr "Windows" -#: ../../library/socket.rst:1546 +#: ../../library/socket.rst:1553 msgid "" "The :meth:`ioctl` method is a limited interface to the WSAIoctl system " "interface. Please refer to the `Win32 documentation `_ for more information." msgstr "" -#: ../../library/socket.rst:1551 +#: ../../library/socket.rst:1558 msgid "" "On other platforms, the generic :func:`fcntl.fcntl` and :func:`fcntl.ioctl` " "functions may be used; they accept a socket object as their first argument." msgstr "" -#: ../../library/socket.rst:1554 +#: ../../library/socket.rst:1561 msgid "" "Currently only the following control codes are supported: ``SIO_RCVALL``, " "``SIO_KEEPALIVE_VALS``, and ``SIO_LOOPBACK_FAST_PATH``." msgstr "" -#: ../../library/socket.rst:1562 +#: ../../library/socket.rst:1569 msgid "" "Enable a server to accept connections. If *backlog* is specified, it must " "be at least 0 (if it is lower, it is set to 0); it specifies the number of " @@ -1817,11 +1824,11 @@ msgid "" "connections. If not specified, a default reasonable value is chosen." msgstr "" -#: ../../library/socket.rst:1569 +#: ../../library/socket.rst:1576 msgid "The *backlog* parameter is now optional." msgstr "" -#: ../../library/socket.rst:1578 +#: ../../library/socket.rst:1585 msgid "" "Return a :term:`file object` associated with the socket. The exact returned " "type depends on the arguments given to :meth:`makefile`. These arguments " @@ -1830,28 +1837,28 @@ msgid "" "``'b'``." msgstr "" -#: ../../library/socket.rst:1583 +#: ../../library/socket.rst:1590 msgid "" "The socket must be in blocking mode; it can have a timeout, but the file " "object's internal buffer may end up in an inconsistent state if a timeout " "occurs." msgstr "" -#: ../../library/socket.rst:1587 +#: ../../library/socket.rst:1594 msgid "" "Closing the file object returned by :meth:`makefile` won't close the " "original socket unless all other file objects have been closed and :meth:" "`socket.close` has been called on the socket object." msgstr "" -#: ../../library/socket.rst:1593 +#: ../../library/socket.rst:1600 msgid "" "On Windows, the file-like object created by :meth:`makefile` cannot be used " "where a file object with a file descriptor is expected, such as the stream " "arguments of :meth:`subprocess.Popen`." msgstr "" -#: ../../library/socket.rst:1600 +#: ../../library/socket.rst:1607 msgid "" "Receive data from the socket. The return value is a bytes object " "representing the data received. The maximum amount of data to be received " @@ -1860,13 +1867,13 @@ msgid "" "zero." msgstr "" -#: ../../library/socket.rst:1607 +#: ../../library/socket.rst:1614 msgid "" "For best match with hardware and network realities, the value of *bufsize* " "should be a relatively small power of 2, for example, 4096." msgstr "" -#: ../../library/socket.rst:1618 +#: ../../library/socket.rst:1625 msgid "" "Receive data from the socket. The return value is a pair ``(bytes, " "address)`` where *bytes* is a bytes object representing the data received " @@ -1876,14 +1883,14 @@ msgid "" "address family --- see above.)" msgstr "" -#: ../../library/socket.rst:1629 +#: ../../library/socket.rst:1636 msgid "" "For multicast IPv6 address, first item of *address* does not contain " "``%scope_id`` part anymore. In order to get full IPv6 address use :func:" "`getnameinfo`." msgstr "" -#: ../../library/socket.rst:1636 +#: ../../library/socket.rst:1643 msgid "" "Receive normal data (up to *bufsize* bytes) and ancillary data from the " "socket. The *ancbufsize* argument sets the size in bytes of the internal " @@ -1894,7 +1901,7 @@ msgid "" "*flags* argument defaults to 0 and has the same meaning as for :meth:`recv`." msgstr "" -#: ../../library/socket.rst:1646 +#: ../../library/socket.rst:1653 msgid "" "The return value is a 4-tuple: ``(data, ancdata, msg_flags, address)``. The " "*data* item is a :class:`bytes` object holding the non-ancillary data " @@ -1909,7 +1916,7 @@ msgid "" "socket, if available; otherwise, its value is unspecified." msgstr "" -#: ../../library/socket.rst:1660 +#: ../../library/socket.rst:1667 msgid "" "On some systems, :meth:`sendmsg` and :meth:`recvmsg` can be used to pass " "file descriptors between processes over an :const:`AF_UNIX` socket. When " @@ -1922,7 +1929,7 @@ msgid "" "descriptors received via this mechanism." msgstr "" -#: ../../library/socket.rst:1671 +#: ../../library/socket.rst:1678 msgid "" "Some systems do not indicate the truncated length of ancillary data items " "which have been only partially received. If an item appears to extend " @@ -1931,7 +1938,7 @@ msgid "" "provided it has not been truncated before the start of its associated data." msgstr "" -#: ../../library/socket.rst:1678 +#: ../../library/socket.rst:1685 msgid "" "On systems which support the :const:`SCM_RIGHTS` mechanism, the following " "function will receive up to *maxfds* file descriptors, returning the message " @@ -1940,7 +1947,7 @@ msgid "" "meth:`sendmsg`. ::" msgstr "" -#: ../../library/socket.rst:1709 +#: ../../library/socket.rst:1716 msgid "" "Receive normal data and ancillary data from the socket, behaving as :meth:" "`recvmsg` would, but scatter the non-ancillary data into a series of buffers " @@ -1953,7 +1960,7 @@ msgid "" "arguments have the same meaning as for :meth:`recvmsg`." msgstr "" -#: ../../library/socket.rst:1720 +#: ../../library/socket.rst:1727 msgid "" "The return value is a 4-tuple: ``(nbytes, ancdata, msg_flags, address)``, " "where *nbytes* is the total number of bytes of non-ancillary data written " @@ -1961,14 +1968,14 @@ msgid "" "for :meth:`recvmsg`." msgstr "" -#: ../../library/socket.rst:1725 +#: ../../library/socket.rst:1732 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/socket.rst:1748 +#: ../../library/socket.rst:1755 msgid "" "Receive data from the socket, writing it into *buffer* instead of creating a " "new bytestring. The return value is a pair ``(nbytes, address)`` where " @@ -1978,7 +1985,7 @@ msgid "" "format of *address* depends on the address family --- see above.)" msgstr "" -#: ../../library/socket.rst:1758 +#: ../../library/socket.rst:1765 msgid "" "Receive up to *nbytes* bytes from the socket, storing the data into a buffer " "rather than creating a new bytestring. If *nbytes* is not specified (or 0), " @@ -1987,7 +1994,7 @@ msgid "" "of the optional argument *flags*; it defaults to zero." msgstr "" -#: ../../library/socket.rst:1767 +#: ../../library/socket.rst:1774 msgid "" "Send data to the socket. The socket must be connected to a remote socket. " "The optional *flags* argument has the same meaning as for :meth:`recv` " @@ -1997,7 +2004,7 @@ msgid "" "data. For further information on this topic, consult the :ref:`socket-howto`." msgstr "" -#: ../../library/socket.rst:1782 +#: ../../library/socket.rst:1789 msgid "" "Send data to the socket. The socket must be connected to a remote socket. " "The optional *flags* argument has the same meaning as for :meth:`recv` " @@ -2007,13 +2014,13 @@ msgid "" "to determine how much data, if any, was successfully sent." msgstr "" -#: ../../library/socket.rst:1789 +#: ../../library/socket.rst:1796 msgid "" "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:1802 +#: ../../library/socket.rst:1809 msgid "" "Send data to the socket. The socket should not be connected to a remote " "socket, since the destination socket is specified by *address*. The " @@ -2022,7 +2029,7 @@ msgid "" "address family --- see above.)" msgstr "" -#: ../../library/socket.rst:1819 +#: ../../library/socket.rst:1826 msgid "" "Raises an :ref:`auditing event ` ``socket.sendto`` with arguments " "``self``, ``address``." @@ -2030,7 +2037,7 @@ msgstr "" "引發一個附帶引數 ``self``、``address`` 的\\ :ref:`稽核事件 ` " "``socket.sendto``。" -#: ../../library/socket.rst:1818 +#: ../../library/socket.rst:1825 msgid "" "Send normal and ancillary data to the socket, gathering the non-ancillary " "data from a series of buffers and concatenating it into a single message. " @@ -2050,18 +2057,18 @@ msgid "" "bytes of non-ancillary data sent." msgstr "" -#: ../../library/socket.rst:1838 +#: ../../library/socket.rst:1845 msgid "" "The following function sends the list of file descriptors *fds* over an :" "const:`AF_UNIX` socket, on systems which support the :const:`SCM_RIGHTS` " "mechanism. See also :meth:`recvmsg`. ::" msgstr "" -#: ../../library/socket.rst:1847 +#: ../../library/socket.rst:1854 msgid ":ref:`Availability `: Unix, not WASI." msgstr ":ref:`適用 `:Unix、非 WASI。" -#: ../../library/socket.rst:1862 +#: ../../library/socket.rst:1869 msgid "" "Raises an :ref:`auditing event ` ``socket.sendmsg`` with arguments " "``self``, ``address``." @@ -2069,14 +2076,14 @@ msgstr "" "引發一個附帶引數 ``self``、``address`` 的\\ :ref:`稽核事件 ` " "``socket.sendmsg``。" -#: ../../library/socket.rst:1862 +#: ../../library/socket.rst:1869 msgid "" "Specialized version of :meth:`~socket.sendmsg` for :const:`AF_ALG` socket. " "Set mode, IV, AEAD associated data length and flags for :const:`AF_ALG` " "socket." msgstr "" -#: ../../library/socket.rst:1871 +#: ../../library/socket.rst:1878 msgid "" "Send a file until EOF is reached by using high-performance :mod:`os." "sendfile` and return the total number of bytes which were sent. *file* must " @@ -2090,38 +2097,38 @@ msgid "" "be of :const:`SOCK_STREAM` type. Non-blocking sockets are not supported." msgstr "" -#: ../../library/socket.rst:1887 +#: ../../library/socket.rst:1894 msgid "" "Set the :ref:`inheritable flag ` of the socket's file " "descriptor or socket's handle." msgstr "" -#: ../../library/socket.rst:1895 +#: ../../library/socket.rst:1902 msgid "" "Set blocking or non-blocking mode of the socket: if *flag* is false, the " "socket is set to non-blocking, else to blocking mode." msgstr "" -#: ../../library/socket.rst:1898 +#: ../../library/socket.rst:1905 msgid "" "This method is a shorthand for certain :meth:`~socket.settimeout` calls:" msgstr "" -#: ../../library/socket.rst:1900 +#: ../../library/socket.rst:1907 msgid "``sock.setblocking(True)`` is equivalent to ``sock.settimeout(None)``" msgstr "``sock.setblocking(True)`` 等價於 ``sock.settimeout(None)``" -#: ../../library/socket.rst:1902 +#: ../../library/socket.rst:1909 msgid "``sock.setblocking(False)`` is equivalent to ``sock.settimeout(0.0)``" msgstr "``sock.setblocking(False)`` 等價於 ``sock.settimeout(0.0)``" -#: ../../library/socket.rst:1904 +#: ../../library/socket.rst:1911 msgid "" "The method no longer applies :const:`SOCK_NONBLOCK` flag on :attr:`socket." "type`." msgstr "" -#: ../../library/socket.rst:1911 +#: ../../library/socket.rst:1918 msgid "" "Set a timeout on blocking socket operations. The *value* argument can be a " "nonnegative floating point number expressing seconds, or ``None``. If a non-" @@ -2131,19 +2138,19 @@ msgid "" "blocking mode. If ``None`` is given, the socket is put in blocking mode." msgstr "" -#: ../../library/socket.rst:1918 +#: ../../library/socket.rst:1925 msgid "" "For further information, please consult the :ref:`notes on socket timeouts " "`." msgstr "" -#: ../../library/socket.rst:1920 +#: ../../library/socket.rst:1927 msgid "" "The method no longer toggles :const:`SOCK_NONBLOCK` flag on :attr:`socket." "type`." msgstr "" -#: ../../library/socket.rst:1933 +#: ../../library/socket.rst:1940 msgid "" "Set the value of the given socket option (see the Unix manual page :manpage:" "`setsockopt(2)`). The needed symbolic constants are defined in the :mod:" @@ -2156,11 +2163,11 @@ msgid "" "C function with ``optval=NULL`` and ``optlen=optlen``." msgstr "" -#: ../../library/socket.rst:1946 +#: ../../library/socket.rst:1953 msgid "setsockopt(level, optname, None, optlen: int) form added." msgstr "" -#: ../../library/socket.rst:1954 +#: ../../library/socket.rst:1961 msgid "" "Shut down one or both halves of the connection. If *how* is :const:" "`SHUT_RD`, further receives are disallowed. If *how* is :const:`SHUT_WR`, " @@ -2168,7 +2175,7 @@ msgid "" "and receives are disallowed." msgstr "" -#: ../../library/socket.rst:1964 +#: ../../library/socket.rst:1971 msgid "" "Duplicate a socket and prepare it for sharing with a target process. The " "target process must be provided with *process_id*. The resulting bytes " @@ -2179,48 +2186,48 @@ msgid "" "process." msgstr "" -#: ../../library/socket.rst:1976 +#: ../../library/socket.rst:1983 msgid "" "Note that there are no methods :meth:`read` or :meth:`write`; use :meth:" "`~socket.recv` and :meth:`~socket.send` without *flags* argument instead." msgstr "" -#: ../../library/socket.rst:1979 +#: ../../library/socket.rst:1986 msgid "" "Socket objects also have these (read-only) attributes that correspond to the " "values given to the :class:`~socket.socket` constructor." msgstr "" -#: ../../library/socket.rst:1985 +#: ../../library/socket.rst:1992 msgid "The socket family." msgstr "" -#: ../../library/socket.rst:1990 +#: ../../library/socket.rst:1997 msgid "The socket type." msgstr "" -#: ../../library/socket.rst:1995 +#: ../../library/socket.rst:2002 msgid "The socket protocol." msgstr "" -#: ../../library/socket.rst:2002 +#: ../../library/socket.rst:2009 msgid "Notes on socket timeouts" msgstr "" -#: ../../library/socket.rst:2004 +#: ../../library/socket.rst:2011 msgid "" "A socket object can be in one of three modes: blocking, non-blocking, or " "timeout. Sockets are by default always created in blocking mode, but this " "can be changed by calling :func:`setdefaulttimeout`." msgstr "" -#: ../../library/socket.rst:2008 +#: ../../library/socket.rst:2015 msgid "" "In *blocking mode*, operations block until complete or the system returns an " "error (such as connection timed out)." msgstr "" -#: ../../library/socket.rst:2011 +#: ../../library/socket.rst:2018 msgid "" "In *non-blocking mode*, operations fail (with an error that is unfortunately " "system-dependent) if they cannot be completed immediately: functions from " @@ -2228,14 +2235,14 @@ msgid "" "available for reading or writing." msgstr "" -#: ../../library/socket.rst:2016 +#: ../../library/socket.rst:2023 msgid "" "In *timeout mode*, operations fail if they cannot be completed within the " "timeout specified for the socket (they raise a :exc:`timeout` exception) or " "if the system returns an error." msgstr "" -#: ../../library/socket.rst:2021 +#: ../../library/socket.rst:2028 msgid "" "At the operating system level, sockets in *timeout mode* are internally set " "in non-blocking mode. Also, the blocking and timeout modes are shared " @@ -2244,11 +2251,11 @@ msgid "" "you decide to use the :meth:`~socket.fileno()` of a socket." msgstr "" -#: ../../library/socket.rst:2028 +#: ../../library/socket.rst:2035 msgid "Timeouts and the ``connect`` method" msgstr "" -#: ../../library/socket.rst:2030 +#: ../../library/socket.rst:2037 msgid "" "The :meth:`~socket.connect` operation is also subject to the timeout " "setting, and in general it is recommended to call :meth:`~socket.settimeout` " @@ -2258,24 +2265,24 @@ msgid "" "setting." msgstr "" -#: ../../library/socket.rst:2038 +#: ../../library/socket.rst:2045 msgid "Timeouts and the ``accept`` method" msgstr "" -#: ../../library/socket.rst:2040 +#: ../../library/socket.rst:2047 msgid "" "If :func:`getdefaulttimeout` is not :const:`None`, sockets returned by the :" "meth:`~socket.accept` method inherit that timeout. Otherwise, the behaviour " "depends on settings of the listening socket:" msgstr "" -#: ../../library/socket.rst:2044 +#: ../../library/socket.rst:2051 msgid "" "if the listening socket is in *blocking mode* or in *timeout mode*, the " "socket returned by :meth:`~socket.accept` is in *blocking mode*;" msgstr "" -#: ../../library/socket.rst:2047 +#: ../../library/socket.rst:2054 msgid "" "if the listening socket is in *non-blocking mode*, whether the socket " "returned by :meth:`~socket.accept` is in blocking or non-blocking mode is " @@ -2283,11 +2290,11 @@ msgid "" "it is recommended you manually override this setting." msgstr "" -#: ../../library/socket.rst:2056 +#: ../../library/socket.rst:2063 msgid "Example" msgstr "範例" -#: ../../library/socket.rst:2058 +#: ../../library/socket.rst:2065 msgid "" "Here are four minimal example programs using the TCP/IP protocol: a server " "that echoes all data that it receives back (servicing only one client), and " @@ -2300,14 +2307,14 @@ msgid "" "new socket returned by :meth:`~socket.accept`." msgstr "" -#: ../../library/socket.rst:2068 +#: ../../library/socket.rst:2075 msgid "The first two examples support IPv4 only. ::" msgstr "" "前兩個範例只支援 IPv4:\n" "\n" "::" -#: ../../library/socket.rst:2099 +#: ../../library/socket.rst:2106 msgid "" "The next two examples are identical to the above two, but support both IPv4 " "and IPv6. The server side will listen to the first address family available " @@ -2317,73 +2324,73 @@ msgid "" "resolution, and sends traffic to the first one connected successfully. ::" msgstr "" -#: ../../library/socket.rst:2171 +#: ../../library/socket.rst:2178 msgid "" "The next example shows how to write a very simple network sniffer with raw " "sockets on Windows. The example requires administrator privileges to modify " "the interface::" msgstr "" -#: ../../library/socket.rst:2196 +#: ../../library/socket.rst:2203 msgid "" "The next example shows how to use the socket interface to communicate to a " "CAN network using the raw socket protocol. To use CAN with the broadcast " "manager protocol instead, open a socket with::" msgstr "" -#: ../../library/socket.rst:2202 +#: ../../library/socket.rst:2209 msgid "" "After binding (:const:`CAN_RAW`) or connecting (:const:`CAN_BCM`) the " "socket, you can use the :meth:`socket.send` and :meth:`socket.recv` " "operations (and their counterparts) on the socket object as usual." msgstr "" -#: ../../library/socket.rst:2206 +#: ../../library/socket.rst:2213 msgid "This last example might require special privileges::" msgstr "" -#: ../../library/socket.rst:2246 +#: ../../library/socket.rst:2253 msgid "" "Running an example several times with too small delay between executions, " "could lead to this error::" msgstr "" -#: ../../library/socket.rst:2251 +#: ../../library/socket.rst:2258 msgid "" "This is because the previous execution has left the socket in a " "``TIME_WAIT`` state, and can't be immediately reused." msgstr "" -#: ../../library/socket.rst:2254 +#: ../../library/socket.rst:2261 msgid "" "There is a :mod:`socket` flag to set, in order to prevent this, :const:" "`socket.SO_REUSEADDR`::" msgstr "" -#: ../../library/socket.rst:2261 +#: ../../library/socket.rst:2268 msgid "" "the :data:`SO_REUSEADDR` flag tells the kernel to reuse a local socket in " "``TIME_WAIT`` state, without waiting for its natural timeout to expire." msgstr "" -#: ../../library/socket.rst:2267 +#: ../../library/socket.rst:2274 msgid "" "For an introduction to socket programming (in C), see the following papers:" msgstr "" -#: ../../library/socket.rst:2269 +#: ../../library/socket.rst:2276 msgid "" "*An Introductory 4.3BSD Interprocess Communication Tutorial*, by Stuart " "Sechrest" msgstr "" -#: ../../library/socket.rst:2271 +#: ../../library/socket.rst:2278 msgid "" "*An Advanced 4.3BSD Interprocess Communication Tutorial*, by Samuel J. " "Leffler et al," msgstr "" -#: ../../library/socket.rst:2274 +#: ../../library/socket.rst:2281 msgid "" "both in the UNIX Programmer's Manual, Supplementary Documents 1 (sections " "PS1:7 and PS1:8). The platform-specific reference material for the various " @@ -2402,18 +2409,18 @@ msgstr "object(物件)" msgid "socket" msgstr "socket" -#: ../../library/socket.rst:1576 +#: ../../library/socket.rst:1583 msgid "I/O control" msgstr "I/O control(I/O 控制)" -#: ../../library/socket.rst:1576 +#: ../../library/socket.rst:1583 msgid "buffering" msgstr "buffering(緩衝)" -#: ../../library/socket.rst:1931 +#: ../../library/socket.rst:1938 msgid "module" msgstr "module(模組)" -#: ../../library/socket.rst:1931 +#: ../../library/socket.rst:1938 msgid "struct" msgstr "struct" diff --git a/library/sqlite3.po b/library/sqlite3.po index af64d9d6f7..43b1ec9efa 100644 --- a/library/sqlite3.po +++ b/library/sqlite3.po @@ -1,5 +1,4 @@ -# 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: @@ -7,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-11 17:13+0000\n" +"POT-Creation-Date: 2023-10-26 00:03+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-" @@ -45,27 +44,27 @@ msgstr "" #: ../../library/sqlite3.rst:34 msgid "This document includes four main sections:" -msgstr "" +msgstr "此文件包含四個主要章節:" #: ../../library/sqlite3.rst:36 msgid ":ref:`sqlite3-tutorial` teaches how to use the :mod:`!sqlite3` module." -msgstr "" +msgstr ":ref:`sqlite3-tutorial` 教導如何使用 :mod:`!sqlite3` 模組。" #: ../../library/sqlite3.rst:37 msgid "" ":ref:`sqlite3-reference` describes the classes and functions this module " "defines." -msgstr "" +msgstr ":ref:`sqlite3-reference` 描述此模組定義的類別與函式。" #: ../../library/sqlite3.rst:39 msgid ":ref:`sqlite3-howtos` details how to handle specific tasks." -msgstr "" +msgstr ":ref:`sqlite3-howtos` 詳細說明如何處理特定工作。" #: ../../library/sqlite3.rst:40 msgid "" ":ref:`sqlite3-explanation` provides in-depth background on transaction " "control." -msgstr "" +msgstr ":ref:`sqlite3-explanation` 深入提供交易 (transaction) 控制的背景。" #: ../../library/sqlite3.rst:47 msgid "https://www.sqlite.org" @@ -87,7 +86,7 @@ msgstr "" #: ../../library/sqlite3.rst:52 msgid ":pep:`249` - Database API Specification 2.0" -msgstr "" +msgstr ":pep:`249` - 資料庫 API 規格 2.0" #: ../../library/sqlite3.rst:53 msgid "PEP written by Marc-André Lemburg." @@ -222,7 +221,7 @@ msgstr "" #: ../../library/sqlite3.rst:236 msgid ":ref:`sqlite3-howtos` for further reading:" -msgstr "" +msgstr "進一步參考 :ref:`sqlite3-howtos`:" #: ../../library/sqlite3.rst:238 msgid ":ref:`sqlite3-placeholders`" @@ -665,7 +664,7 @@ msgstr "" #: ../../library/sqlite3.rst:613 msgid "Connection objects" -msgstr "" +msgstr "Connection 物件" #: ../../library/sqlite3.rst:617 msgid "" @@ -813,8 +812,7 @@ msgstr "新增 *deterministic* 參數。" #: ../../library/sqlite3.rst:744 ../../library/sqlite3.rst:782 #: ../../library/sqlite3.rst:845 ../../library/sqlite3.rst:1115 -#: ../../library/sqlite3.rst:1415 ../../library/sqlite3.rst:1552 -#: ../../library/sqlite3.rst:1591 +#: ../../library/sqlite3.rst:1529 ../../library/sqlite3.rst:1568 msgid "Example:" msgstr "範例:" @@ -1116,27 +1114,31 @@ msgid "" "dump`` command in the :program:`sqlite3` shell." msgstr "" -#: ../../library/sqlite3.rst:1129 +#: ../../library/sqlite3.rst:1128 ../../library/sqlite3.rst:1198 +msgid ":ref:`sqlite3-howto-encoding`" +msgstr ":ref:`sqlite3-howto-encoding`" + +#: ../../library/sqlite3.rst:1133 msgid "Create a backup of an SQLite database." msgstr "" -#: ../../library/sqlite3.rst:1131 +#: ../../library/sqlite3.rst:1135 msgid "" "Works even if the database is being accessed by other clients or " "concurrently by the same connection." msgstr "" -#: ../../library/sqlite3.rst:1134 +#: ../../library/sqlite3.rst:1138 msgid "The database connection to save the backup to." msgstr "" -#: ../../library/sqlite3.rst:1137 +#: ../../library/sqlite3.rst:1141 msgid "" "The number of pages to copy at a time. If equal to or less than ``0``, the " "entire database is copied in a single step. Defaults to ``-1``." msgstr "" -#: ../../library/sqlite3.rst:1143 +#: ../../library/sqlite3.rst:1147 msgid "" "If set to a :term:`callable`, it is invoked with three integer arguments for " "every backup iteration: the *status* of the last iteration, the *remaining* " @@ -1144,46 +1146,46 @@ msgid "" "Defaults to ``None``." msgstr "" -#: ../../library/sqlite3.rst:1152 +#: ../../library/sqlite3.rst:1156 msgid "" "The name of the database to back up. Either ``\"main\"`` (the default) for " "the main database, ``\"temp\"`` for the temporary database, or the name of a " "custom database as attached using the ``ATTACH DATABASE`` SQL statement." msgstr "" -#: ../../library/sqlite3.rst:1159 +#: ../../library/sqlite3.rst:1163 msgid "" "The number of seconds to sleep between successive attempts to back up " "remaining pages." msgstr "" -#: ../../library/sqlite3.rst:1163 +#: ../../library/sqlite3.rst:1167 msgid "Example 1, copy an existing database into another:" msgstr "" -#: ../../library/sqlite3.rst:1182 +#: ../../library/sqlite3.rst:1186 msgid "Example 2, copy an existing database into a transient copy:" msgstr "" -#: ../../library/sqlite3.rst:1194 +#: ../../library/sqlite3.rst:1202 msgid "Get a connection runtime limit." msgstr "" -#: ../../library/sqlite3.rst:1196 +#: ../../library/sqlite3.rst:1204 msgid "The `SQLite limit category`_ to be queried." msgstr "" -#: ../../library/sqlite3.rst:1201 ../../library/sqlite3.rst:1238 +#: ../../library/sqlite3.rst:1209 ../../library/sqlite3.rst:1246 msgid "If *category* is not recognised by the underlying SQLite library." msgstr "" -#: ../../library/sqlite3.rst:1204 +#: ../../library/sqlite3.rst:1212 msgid "" "Example, query the maximum length of an SQL statement for :class:" "`Connection` ``con`` (the default is 1000000000):" msgstr "" -#: ../../library/sqlite3.rst:1224 +#: ../../library/sqlite3.rst:1232 msgid "" "Set a connection runtime limit. Attempts to increase a limit above its hard " "upper bound are silently truncated to the hard upper bound. Regardless of " @@ -1191,40 +1193,40 @@ msgid "" "returned." msgstr "" -#: ../../library/sqlite3.rst:1229 +#: ../../library/sqlite3.rst:1237 msgid "The `SQLite limit category`_ to be set." msgstr "" -#: ../../library/sqlite3.rst:1232 +#: ../../library/sqlite3.rst:1240 msgid "" "The value of the new limit. If negative, the current limit is unchanged." msgstr "" -#: ../../library/sqlite3.rst:1241 +#: ../../library/sqlite3.rst:1249 msgid "" "Example, limit the number of attached databases to 1 for :class:`Connection` " "``con`` (the default limit is 10):" msgstr "" -#: ../../library/sqlite3.rst:1258 +#: ../../library/sqlite3.rst:1266 msgid "Query a boolean connection configuration option." msgstr "" -#: ../../library/sqlite3.rst:1260 ../../library/sqlite3.rst:1271 +#: ../../library/sqlite3.rst:1268 ../../library/sqlite3.rst:1279 msgid "A :ref:`SQLITE_DBCONFIG code `." msgstr "" -#: ../../library/sqlite3.rst:1269 +#: ../../library/sqlite3.rst:1277 msgid "Set a boolean connection configuration option." msgstr "" -#: ../../library/sqlite3.rst:1274 +#: ../../library/sqlite3.rst:1282 msgid "" "``True`` if the configuration option should be enabled (default); ``False`` " "if it should be disabled." msgstr "" -#: ../../library/sqlite3.rst:1282 +#: ../../library/sqlite3.rst:1290 msgid "" "Serialize a database into a :class:`bytes` object. For an ordinary on-disk " "database file, the serialization is just a copy of the disk file. For an in-" @@ -1233,17 +1235,17 @@ msgid "" "backed up to disk." msgstr "" -#: ../../library/sqlite3.rst:1288 +#: ../../library/sqlite3.rst:1296 msgid "The database name to be serialized. Defaults to ``\"main\"``." msgstr "" -#: ../../library/sqlite3.rst:1296 +#: ../../library/sqlite3.rst:1304 msgid "" "This method is only available if the underlying SQLite library has the " "serialize API." msgstr "" -#: ../../library/sqlite3.rst:1304 +#: ../../library/sqlite3.rst:1312 msgid "" "Deserialize a :meth:`serialized ` database into a :class:" "`Connection`. This method causes the database connection to disconnect from " @@ -1251,96 +1253,96 @@ msgid "" "serialization contained in *data*." msgstr "" -#: ../../library/sqlite3.rst:1310 +#: ../../library/sqlite3.rst:1318 msgid "A serialized database." msgstr "" -#: ../../library/sqlite3.rst:1313 +#: ../../library/sqlite3.rst:1321 msgid "The database name to deserialize into. Defaults to ``\"main\"``." msgstr "" -#: ../../library/sqlite3.rst:1317 +#: ../../library/sqlite3.rst:1325 msgid "" "If the database connection is currently involved in a read transaction or a " "backup operation." msgstr "" -#: ../../library/sqlite3.rst:1321 +#: ../../library/sqlite3.rst:1329 msgid "If *data* does not contain a valid SQLite database." msgstr "" -#: ../../library/sqlite3.rst:1324 +#: ../../library/sqlite3.rst:1332 msgid "If :func:`len(data) ` is larger than ``2**63 - 1``." msgstr "" -#: ../../library/sqlite3.rst:1329 +#: ../../library/sqlite3.rst:1337 msgid "" "This method is only available if the underlying SQLite library has the " "deserialize API." msgstr "" -#: ../../library/sqlite3.rst:1336 +#: ../../library/sqlite3.rst:1344 msgid "" "This attribute controls :pep:`249`-compliant transaction behaviour. :attr:`!" "autocommit` has three allowed values:" msgstr "" -#: ../../library/sqlite3.rst:1339 +#: ../../library/sqlite3.rst:1347 msgid "" "``False``: Select :pep:`249`-compliant transaction behaviour, implying that :" "mod:`!sqlite3` ensures a transaction is always open. Use :meth:`commit` and :" "meth:`rollback` to close transactions." msgstr "" -#: ../../library/sqlite3.rst:1343 +#: ../../library/sqlite3.rst:1351 msgid "This is the recommended value of :attr:`!autocommit`." msgstr "" -#: ../../library/sqlite3.rst:1345 +#: ../../library/sqlite3.rst:1353 msgid "" "``True``: Use SQLite's `autocommit mode`_. :meth:`commit` and :meth:" "`rollback` have no effect in this mode." msgstr "" -#: ../../library/sqlite3.rst:1348 +#: ../../library/sqlite3.rst:1356 msgid "" ":data:`LEGACY_TRANSACTION_CONTROL`: Pre-Python 3.12 (non-:pep:`249`-" "compliant) transaction control. See :attr:`isolation_level` for more details." msgstr "" -#: ../../library/sqlite3.rst:1352 +#: ../../library/sqlite3.rst:1360 msgid "This is currently the default value of :attr:`!autocommit`." msgstr "" -#: ../../library/sqlite3.rst:1354 +#: ../../library/sqlite3.rst:1362 msgid "" "Changing :attr:`!autocommit` to ``False`` will open a new transaction, and " "changing it to ``True`` will commit any pending transaction." msgstr "" -#: ../../library/sqlite3.rst:1357 +#: ../../library/sqlite3.rst:1365 msgid "See :ref:`sqlite3-transaction-control-autocommit` for more details." -msgstr "" +msgstr "更多詳情請見 :ref:`sqlite3-transaction-control-autocommit`。" -#: ../../library/sqlite3.rst:1361 +#: ../../library/sqlite3.rst:1369 msgid "" "The :attr:`isolation_level` attribute has no effect unless :attr:" "`autocommit` is :data:`LEGACY_TRANSACTION_CONTROL`." msgstr "" -#: ../../library/sqlite3.rst:1368 +#: ../../library/sqlite3.rst:1376 msgid "" "This read-only attribute corresponds to the low-level SQLite `autocommit " "mode`_." msgstr "" -#: ../../library/sqlite3.rst:1371 +#: ../../library/sqlite3.rst:1379 msgid "" "``True`` if a transaction is active (there are uncommitted changes), " "``False`` otherwise." msgstr "" -#: ../../library/sqlite3.rst:1378 +#: ../../library/sqlite3.rst:1386 msgid "" "Controls the :ref:`legacy transaction handling mode ` of :mod:`!sqlite3`. If set to ``None``, " @@ -1350,13 +1352,13 @@ msgid "" "` is performed." msgstr "" -#: ../../library/sqlite3.rst:1386 +#: ../../library/sqlite3.rst:1394 msgid "" "If not overridden by the *isolation_level* parameter of :func:`connect`, the " "default is ``\"\"``, which is an alias for ``\"DEFERRED\"``." msgstr "" -#: ../../library/sqlite3.rst:1391 +#: ../../library/sqlite3.rst:1399 msgid "" "Using :attr:`autocommit` to control transaction handling is recommended over " "using :attr:`!isolation_level`. :attr:`!isolation_level` has no effect " @@ -1364,7 +1366,7 @@ msgid "" "default)." msgstr "" -#: ../../library/sqlite3.rst:1398 +#: ../../library/sqlite3.rst:1406 msgid "" "The initial :attr:`~Cursor.row_factory` for :class:`Cursor` objects created " "from this connection. Assigning to this attribute does not affect the :attr:" @@ -1373,30 +1375,33 @@ msgid "" "`tuple`." msgstr "" -#: ../../library/sqlite3.rst:1405 ../../library/sqlite3.rst:1718 -#: ../../library/sqlite3.rst:1741 +#: ../../library/sqlite3.rst:1413 ../../library/sqlite3.rst:1694 +#: ../../library/sqlite3.rst:1717 msgid "See :ref:`sqlite3-howto-row-factory` for more details." -msgstr "" +msgstr "更多詳情請見 :ref:`sqlite3-howto-row-factory`。" -#: ../../library/sqlite3.rst:1409 +#: ../../library/sqlite3.rst:1417 msgid "" "A :term:`callable` that accepts a :class:`bytes` parameter and returns a " "text representation of it. The callable is invoked for SQLite values with " -"the ``TEXT`` data type. By default, this attribute is set to :class:`str`. " -"If you want to return ``bytes`` instead, set *text_factory* to ``bytes``." +"the ``TEXT`` data type. By default, this attribute is set to :class:`str`." msgstr "" -#: ../../library/sqlite3.rst:1449 +#: ../../library/sqlite3.rst:1422 +msgid "See :ref:`sqlite3-howto-encoding` for more details." +msgstr "更多詳情請見 :ref:`sqlite3-howto-encoding`。" + +#: ../../library/sqlite3.rst:1426 msgid "" "Return the total number of database rows that have been modified, inserted, " "or deleted since the database connection was opened." msgstr "" -#: ../../library/sqlite3.rst:1456 +#: ../../library/sqlite3.rst:1433 msgid "Cursor objects" -msgstr "" +msgstr "Cursor 物件" -#: ../../library/sqlite3.rst:1458 +#: ../../library/sqlite3.rst:1435 msgid "" "A ``Cursor`` object represents a `database cursor`_ which is used to execute " "SQL statements, and manage the context of a fetch operation. Cursors are " @@ -1404,39 +1409,39 @@ msgid "" "`connection shortcut methods `." msgstr "" -#: ../../library/sqlite3.rst:1465 +#: ../../library/sqlite3.rst:1442 msgid "" "Cursor objects are :term:`iterators `, meaning that if you :meth:" "`~Cursor.execute` a ``SELECT`` query, you can simply iterate over the cursor " "to fetch the resulting rows:" msgstr "" -#: ../../library/sqlite3.rst:1490 +#: ../../library/sqlite3.rst:1467 msgid "A :class:`Cursor` instance has the following attributes and methods." msgstr "" -#: ../../library/sqlite3.rst:1497 +#: ../../library/sqlite3.rst:1474 msgid "" "Execute SQL a single SQL statement, optionally binding Python values using :" "ref:`placeholders `." msgstr "" -#: ../../library/sqlite3.rst:1501 +#: ../../library/sqlite3.rst:1478 msgid "A single SQL statement." -msgstr "" +msgstr "單一個 SQL 陳述式。" -#: ../../library/sqlite3.rst:1504 +#: ../../library/sqlite3.rst:1481 msgid "" "Python values to bind to placeholders in *sql*. A :class:`!dict` if named " "placeholders are used. A :term:`!sequence` if unnamed placeholders are used. " "See :ref:`sqlite3-placeholders`." msgstr "" -#: ../../library/sqlite3.rst:1511 +#: ../../library/sqlite3.rst:1488 msgid "If *sql* contains more than one SQL statement." msgstr "" -#: ../../library/sqlite3.rst:1514 +#: ../../library/sqlite3.rst:1491 msgid "" "If :attr:`~Connection.autocommit` is :data:`LEGACY_TRANSACTION_CONTROL`, :" "attr:`~Connection.isolation_level` is not ``None``, *sql* is an ``INSERT``, " @@ -1444,7 +1449,7 @@ msgid "" "transaction, a transaction is implicitly opened before executing *sql*." msgstr "" -#: ../../library/sqlite3.rst:1523 +#: ../../library/sqlite3.rst:1500 msgid "" ":exc:`DeprecationWarning` is emitted if :ref:`named placeholders ` are used and *parameters* is a sequence instead of a :class:" @@ -1452,43 +1457,43 @@ msgid "" "instead." msgstr "" -#: ../../library/sqlite3.rst:1529 +#: ../../library/sqlite3.rst:1506 msgid "Use :meth:`executescript` to execute multiple SQL statements." msgstr "" -#: ../../library/sqlite3.rst:1533 +#: ../../library/sqlite3.rst:1510 msgid "" "For every item in *parameters*, repeatedly execute the :ref:`parameterized " "` :abbr:`DML (Data Manipulation Language)` SQL " "statement *sql*." msgstr "" -#: ../../library/sqlite3.rst:1537 +#: ../../library/sqlite3.rst:1514 msgid "Uses the same implicit transaction handling as :meth:`~Cursor.execute`." msgstr "" -#: ../../library/sqlite3.rst:1539 +#: ../../library/sqlite3.rst:1516 msgid "A single SQL DML statement." msgstr "" -#: ../../library/sqlite3.rst:1542 +#: ../../library/sqlite3.rst:1519 msgid "" "An :term:`!iterable` of parameters to bind with the placeholders in *sql*. " "See :ref:`sqlite3-placeholders`." msgstr "" -#: ../../library/sqlite3.rst:1548 +#: ../../library/sqlite3.rst:1525 msgid "" "If *sql* contains more than one SQL statement, or is not a DML statement." msgstr "" -#: ../../library/sqlite3.rst:1565 +#: ../../library/sqlite3.rst:1542 msgid "" "Any resulting rows are discarded, including DML statements with `RETURNING " "clauses`_." msgstr "" -#: ../../library/sqlite3.rst:1572 +#: ../../library/sqlite3.rst:1549 msgid "" ":exc:`DeprecationWarning` is emitted if :ref:`named placeholders ` are used and the items in *parameters* are sequences instead " @@ -1496,7 +1501,7 @@ msgid "" "be raised instead." msgstr "" -#: ../../library/sqlite3.rst:1581 +#: ../../library/sqlite3.rst:1558 msgid "" "Execute the SQL statements in *sql_script*. If the :attr:`~Connection." "autocommit` is :data:`LEGACY_TRANSACTION_CONTROL` and there is a pending " @@ -1505,24 +1510,24 @@ msgid "" "added to *sql_script*." msgstr "" -#: ../../library/sqlite3.rst:1589 +#: ../../library/sqlite3.rst:1566 msgid "*sql_script* must be a :class:`string `." msgstr "" -#: ../../library/sqlite3.rst:1607 +#: ../../library/sqlite3.rst:1583 msgid "" "If :attr:`~Cursor.row_factory` is ``None``, return the next row query result " "set as a :class:`tuple`. Else, pass it to the row factory and return its " "result. Return ``None`` if no more data is available." msgstr "" -#: ../../library/sqlite3.rst:1615 +#: ../../library/sqlite3.rst:1591 msgid "" "Return the next set of rows of a query result as a :class:`list`. Return an " "empty list if no more rows are available." msgstr "" -#: ../../library/sqlite3.rst:1618 +#: ../../library/sqlite3.rst:1594 msgid "" "The number of rows to fetch per call is specified by the *size* parameter. " "If *size* is not given, :attr:`arraysize` determines the number of rows to " @@ -1530,7 +1535,7 @@ msgid "" "available are returned." msgstr "" -#: ../../library/sqlite3.rst:1624 +#: ../../library/sqlite3.rst:1600 msgid "" "Note there are performance considerations involved with the *size* " "parameter. For optimal performance, it is usually best to use the arraysize " @@ -1538,36 +1543,36 @@ msgid "" "the same value from one :meth:`fetchmany` call to the next." msgstr "" -#: ../../library/sqlite3.rst:1631 +#: ../../library/sqlite3.rst:1607 msgid "" "Return all (remaining) rows of a query result as a :class:`list`. Return an " "empty list if no rows are available. Note that the :attr:`arraysize` " "attribute can affect the performance of this operation." msgstr "" -#: ../../library/sqlite3.rst:1638 +#: ../../library/sqlite3.rst:1614 msgid "Close the cursor now (rather than whenever ``__del__`` is called)." msgstr "" -#: ../../library/sqlite3.rst:1640 +#: ../../library/sqlite3.rst:1616 msgid "" "The cursor will be unusable from this point forward; a :exc:" "`ProgrammingError` exception will be raised if any operation is attempted " "with the cursor." msgstr "" -#: ../../library/sqlite3.rst:1645 ../../library/sqlite3.rst:1649 +#: ../../library/sqlite3.rst:1621 ../../library/sqlite3.rst:1625 msgid "Required by the DB-API. Does nothing in :mod:`!sqlite3`." msgstr "" -#: ../../library/sqlite3.rst:1653 +#: ../../library/sqlite3.rst:1629 msgid "" "Read/write attribute that controls the number of rows returned by :meth:" "`fetchmany`. The default value is 1 which means a single row would be " "fetched per call." msgstr "" -#: ../../library/sqlite3.rst:1658 +#: ../../library/sqlite3.rst:1634 msgid "" "Read-only attribute that provides the SQLite database :class:`Connection` " "belonging to the cursor. A :class:`Cursor` object created by calling :meth:" @@ -1575,18 +1580,18 @@ msgid "" "that refers to *con*:" msgstr "" -#: ../../library/sqlite3.rst:1672 +#: ../../library/sqlite3.rst:1648 msgid "" "Read-only attribute that provides the column names of the last query. To " "remain compatible with the Python DB API, it returns a 7-tuple for each " "column where the last six items of each tuple are ``None``." msgstr "" -#: ../../library/sqlite3.rst:1676 +#: ../../library/sqlite3.rst:1652 msgid "It is set for ``SELECT`` statements without any matching rows as well." msgstr "" -#: ../../library/sqlite3.rst:1680 +#: ../../library/sqlite3.rst:1656 msgid "" "Read-only attribute that provides the row id of the last inserted row. It is " "only updated after successful ``INSERT`` or ``REPLACE`` statements using " @@ -1596,15 +1601,15 @@ msgid "" "``None``." msgstr "" -#: ../../library/sqlite3.rst:1688 +#: ../../library/sqlite3.rst:1664 msgid "Inserts into ``WITHOUT ROWID`` tables are not recorded." msgstr "" -#: ../../library/sqlite3.rst:1690 +#: ../../library/sqlite3.rst:1666 msgid "Added support for the ``REPLACE`` statement." msgstr "新增 ``REPLACE`` 陳述式的支援。" -#: ../../library/sqlite3.rst:1695 +#: ../../library/sqlite3.rst:1671 msgid "" "Read-only attribute that provides the number of modified rows for " "``INSERT``, ``UPDATE``, ``DELETE``, and ``REPLACE`` statements; is ``-1`` " @@ -1614,7 +1619,7 @@ msgid "" "resulting rows must be fetched in order for :attr:`!rowcount` to be updated." msgstr "" -#: ../../library/sqlite3.rst:1706 +#: ../../library/sqlite3.rst:1682 msgid "" "Control how a row fetched from this :class:`!Cursor` is represented. If " "``None``, a row is represented as a :class:`tuple`. Can be set to the " @@ -1623,18 +1628,18 @@ msgid "" "and returns a custom object representing an SQLite row." msgstr "" -#: ../../library/sqlite3.rst:1713 +#: ../../library/sqlite3.rst:1689 msgid "" "Defaults to what :attr:`Connection.row_factory` was set to when the :class:`!" "Cursor` was created. Assigning to this attribute does not affect :attr:" "`Connection.row_factory` of the parent connection." msgstr "" -#: ../../library/sqlite3.rst:1729 +#: ../../library/sqlite3.rst:1705 msgid "Row objects" -msgstr "" +msgstr "Row 物件" -#: ../../library/sqlite3.rst:1733 +#: ../../library/sqlite3.rst:1709 msgid "" "A :class:`!Row` instance serves as a highly optimized :attr:`~Connection." "row_factory` for :class:`Connection` objects. It supports iteration, " @@ -1642,28 +1647,28 @@ msgid "" "index." msgstr "" -#: ../../library/sqlite3.rst:1738 +#: ../../library/sqlite3.rst:1714 msgid "" "Two :class:`!Row` objects compare equal if they have identical column names " "and values." msgstr "" -#: ../../library/sqlite3.rst:1745 +#: ../../library/sqlite3.rst:1721 msgid "" "Return a :class:`list` of column names as :class:`strings `. " "Immediately after a query, it is the first member of each tuple in :attr:" "`Cursor.description`." msgstr "" -#: ../../library/sqlite3.rst:1749 +#: ../../library/sqlite3.rst:1725 msgid "Added support of slicing." msgstr "新增對切片的支援。" -#: ../../library/sqlite3.rst:1756 +#: ../../library/sqlite3.rst:1732 msgid "Blob objects" -msgstr "" +msgstr "Blob 物件" -#: ../../library/sqlite3.rst:1762 +#: ../../library/sqlite3.rst:1738 msgid "" "A :class:`Blob` instance is a :term:`file-like object` that can read and " "write data in an SQLite :abbr:`BLOB (Binary Large OBject)`. Call :func:" @@ -1671,24 +1676,24 @@ msgid "" "and :term:`slices ` for direct access to the blob data." msgstr "" -#: ../../library/sqlite3.rst:1767 +#: ../../library/sqlite3.rst:1743 msgid "" "Use the :class:`Blob` as a :term:`context manager` to ensure that the blob " "handle is closed after use." msgstr "" -#: ../../library/sqlite3.rst:1797 +#: ../../library/sqlite3.rst:1773 msgid "Close the blob." msgstr "" -#: ../../library/sqlite3.rst:1799 +#: ../../library/sqlite3.rst:1775 msgid "" "The blob will be unusable from this point onward. An :class:`~sqlite3." "Error` (or subclass) exception will be raised if any further operation is " "attempted with the blob." msgstr "" -#: ../../library/sqlite3.rst:1805 +#: ../../library/sqlite3.rst:1781 msgid "" "Read *length* bytes of data from the blob at the current offset position. If " "the end of the blob is reached, the data up to :abbr:`EOF (End of File)` " @@ -1696,18 +1701,18 @@ msgid "" "`~Blob.read` will read until the end of the blob." msgstr "" -#: ../../library/sqlite3.rst:1813 +#: ../../library/sqlite3.rst:1789 msgid "" "Write *data* to the blob at the current offset. This function cannot change " "the blob length. Writing beyond the end of the blob will raise :exc:" "`ValueError`." msgstr "" -#: ../../library/sqlite3.rst:1819 +#: ../../library/sqlite3.rst:1795 msgid "Return the current access position of the blob." msgstr "" -#: ../../library/sqlite3.rst:1823 +#: ../../library/sqlite3.rst:1799 msgid "" "Set the current access position of the blob to *offset*. The *origin* " "argument defaults to :const:`os.SEEK_SET` (absolute blob positioning). Other " @@ -1715,26 +1720,26 @@ msgid "" "position) and :const:`os.SEEK_END` (seek relative to the blob’s end)." msgstr "" -#: ../../library/sqlite3.rst:1831 +#: ../../library/sqlite3.rst:1807 msgid "PrepareProtocol objects" -msgstr "" +msgstr "PrepareProtocol 物件" -#: ../../library/sqlite3.rst:1835 +#: ../../library/sqlite3.rst:1811 msgid "" "The PrepareProtocol type's single purpose is to act as a :pep:`246` style " "adaption protocol for objects that can :ref:`adapt themselves ` to :ref:`native SQLite types `." msgstr "" -#: ../../library/sqlite3.rst:1843 +#: ../../library/sqlite3.rst:1819 msgid "Exceptions" msgstr "例外" -#: ../../library/sqlite3.rst:1845 +#: ../../library/sqlite3.rst:1821 msgid "The exception hierarchy is defined by the DB-API 2.0 (:pep:`249`)." msgstr "" -#: ../../library/sqlite3.rst:1849 +#: ../../library/sqlite3.rst:1825 msgid "" "This exception is not currently raised by the :mod:`!sqlite3` module, but " "may be raised by applications using :mod:`!sqlite3`, for example if a user-" @@ -1742,39 +1747,39 @@ msgid "" "of :exc:`Exception`." msgstr "" -#: ../../library/sqlite3.rst:1856 +#: ../../library/sqlite3.rst:1832 msgid "" "The base class of the other exceptions in this module. Use this to catch all " "errors with one single :keyword:`except` statement. ``Error`` is a subclass " "of :exc:`Exception`." msgstr "" -#: ../../library/sqlite3.rst:1860 +#: ../../library/sqlite3.rst:1836 msgid "" "If the exception originated from within the SQLite library, the following " "two attributes are added to the exception:" msgstr "" -#: ../../library/sqlite3.rst:1865 +#: ../../library/sqlite3.rst:1841 msgid "" "The numeric error code from the `SQLite API `_" msgstr "" -#: ../../library/sqlite3.rst:1872 +#: ../../library/sqlite3.rst:1848 msgid "" "The symbolic name of the numeric error code from the `SQLite API `_" msgstr "" -#: ../../library/sqlite3.rst:1879 +#: ../../library/sqlite3.rst:1855 msgid "" "Exception raised for misuse of the low-level SQLite C API. In other words, " "if this exception is raised, it probably indicates a bug in the :mod:`!" "sqlite3` module. ``InterfaceError`` is a subclass of :exc:`Error`." msgstr "" -#: ../../library/sqlite3.rst:1886 +#: ../../library/sqlite3.rst:1862 msgid "" "Exception raised for errors that are related to the database. This serves as " "the base exception for several types of database errors. It is only raised " @@ -1782,14 +1787,14 @@ msgid "" "subclass of :exc:`Error`." msgstr "" -#: ../../library/sqlite3.rst:1893 +#: ../../library/sqlite3.rst:1869 msgid "" "Exception raised for errors caused by problems with the processed data, like " "numeric values out of range, and strings which are too long. ``DataError`` " "is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1899 +#: ../../library/sqlite3.rst:1875 msgid "" "Exception raised for errors that are related to the database's operation, " "and not necessarily under the control of the programmer. For example, the " @@ -1797,20 +1802,20 @@ msgid "" "``OperationalError`` is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1907 +#: ../../library/sqlite3.rst:1883 msgid "" "Exception raised when the relational integrity of the database is affected, " "e.g. a foreign key check fails. It is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1912 +#: ../../library/sqlite3.rst:1888 msgid "" "Exception raised when SQLite encounters an internal error. If this is " "raised, it may indicate that there is a problem with the runtime SQLite " "library. ``InternalError`` is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1919 +#: ../../library/sqlite3.rst:1895 msgid "" "Exception raised for :mod:`!sqlite3` API programming errors, for example " "supplying the wrong number of bindings to a query, or trying to operate on a " @@ -1818,7 +1823,7 @@ msgid "" "`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1926 +#: ../../library/sqlite3.rst:1902 msgid "" "Exception raised in case a method or database API is not supported by the " "underlying SQLite library. For example, setting *deterministic* to ``True`` " @@ -1827,78 +1832,78 @@ msgid "" "subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1936 +#: ../../library/sqlite3.rst:1912 msgid "SQLite and Python types" msgstr "" -#: ../../library/sqlite3.rst:1938 +#: ../../library/sqlite3.rst:1914 msgid "" "SQLite natively supports the following types: ``NULL``, ``INTEGER``, " "``REAL``, ``TEXT``, ``BLOB``." msgstr "" -#: ../../library/sqlite3.rst:1941 +#: ../../library/sqlite3.rst:1917 msgid "" "The following Python types can thus be sent to SQLite without any problem:" msgstr "" -#: ../../library/sqlite3.rst:1944 ../../library/sqlite3.rst:1961 +#: ../../library/sqlite3.rst:1920 ../../library/sqlite3.rst:1937 msgid "Python type" msgstr "" -#: ../../library/sqlite3.rst:1944 ../../library/sqlite3.rst:1961 +#: ../../library/sqlite3.rst:1920 ../../library/sqlite3.rst:1937 msgid "SQLite type" msgstr "" -#: ../../library/sqlite3.rst:1946 ../../library/sqlite3.rst:1963 +#: ../../library/sqlite3.rst:1922 ../../library/sqlite3.rst:1939 msgid "``None``" msgstr "``None``" -#: ../../library/sqlite3.rst:1946 ../../library/sqlite3.rst:1963 +#: ../../library/sqlite3.rst:1922 ../../library/sqlite3.rst:1939 msgid "``NULL``" msgstr "``NULL``" -#: ../../library/sqlite3.rst:1948 ../../library/sqlite3.rst:1965 +#: ../../library/sqlite3.rst:1924 ../../library/sqlite3.rst:1941 msgid ":class:`int`" msgstr ":class:`int`" -#: ../../library/sqlite3.rst:1948 ../../library/sqlite3.rst:1965 +#: ../../library/sqlite3.rst:1924 ../../library/sqlite3.rst:1941 msgid "``INTEGER``" msgstr "``INTEGER``" -#: ../../library/sqlite3.rst:1950 ../../library/sqlite3.rst:1967 +#: ../../library/sqlite3.rst:1926 ../../library/sqlite3.rst:1943 msgid ":class:`float`" msgstr ":class:`float`" -#: ../../library/sqlite3.rst:1950 ../../library/sqlite3.rst:1967 +#: ../../library/sqlite3.rst:1926 ../../library/sqlite3.rst:1943 msgid "``REAL``" msgstr "``REAL``" -#: ../../library/sqlite3.rst:1952 +#: ../../library/sqlite3.rst:1928 msgid ":class:`str`" msgstr ":class:`str`" -#: ../../library/sqlite3.rst:1952 ../../library/sqlite3.rst:1969 +#: ../../library/sqlite3.rst:1928 ../../library/sqlite3.rst:1945 msgid "``TEXT``" msgstr "``TEXT``" -#: ../../library/sqlite3.rst:1954 ../../library/sqlite3.rst:1972 +#: ../../library/sqlite3.rst:1930 ../../library/sqlite3.rst:1948 msgid ":class:`bytes`" msgstr ":class:`bytes`" -#: ../../library/sqlite3.rst:1954 ../../library/sqlite3.rst:1972 +#: ../../library/sqlite3.rst:1930 ../../library/sqlite3.rst:1948 msgid "``BLOB``" msgstr "``BLOB``" -#: ../../library/sqlite3.rst:1958 +#: ../../library/sqlite3.rst:1934 msgid "This is how SQLite types are converted to Python types by default:" msgstr "" -#: ../../library/sqlite3.rst:1969 +#: ../../library/sqlite3.rst:1945 msgid "depends on :attr:`~Connection.text_factory`, :class:`str` by default" msgstr "" -#: ../../library/sqlite3.rst:1975 +#: ../../library/sqlite3.rst:1951 msgid "" "The type system of the :mod:`!sqlite3` module is extensible in two ways: you " "can store additional Python types in an SQLite database via :ref:`object " @@ -1907,47 +1912,47 @@ msgid "" "converters>`." msgstr "" -#: ../../library/sqlite3.rst:1985 +#: ../../library/sqlite3.rst:1961 msgid "Default adapters and converters (deprecated)" msgstr "" -#: ../../library/sqlite3.rst:1989 +#: ../../library/sqlite3.rst:1965 msgid "" "The default adapters and converters are deprecated as of Python 3.12. " "Instead, use the :ref:`sqlite3-adapter-converter-recipes` and tailor them to " "your needs." msgstr "" -#: ../../library/sqlite3.rst:1993 +#: ../../library/sqlite3.rst:1969 msgid "The deprecated default adapters and converters consist of:" msgstr "" -#: ../../library/sqlite3.rst:1995 +#: ../../library/sqlite3.rst:1971 msgid "" "An adapter for :class:`datetime.date` objects to :class:`strings ` in " "`ISO 8601`_ format." msgstr "" -#: ../../library/sqlite3.rst:1997 +#: ../../library/sqlite3.rst:1973 msgid "" "An adapter for :class:`datetime.datetime` objects to strings in ISO 8601 " "format." msgstr "" -#: ../../library/sqlite3.rst:1999 +#: ../../library/sqlite3.rst:1975 msgid "" "A converter for :ref:`declared ` \"date\" types to :" "class:`datetime.date` objects." msgstr "" -#: ../../library/sqlite3.rst:2001 +#: ../../library/sqlite3.rst:1977 msgid "" "A converter for declared \"timestamp\" types to :class:`datetime.datetime` " "objects. Fractional parts will be truncated to 6 digits (microsecond " "precision)." msgstr "" -#: ../../library/sqlite3.rst:2007 +#: ../../library/sqlite3.rst:1983 msgid "" "The default \"timestamp\" converter ignores UTC offsets in the database and " "always returns a naive :class:`datetime.datetime` object. To preserve UTC " @@ -1955,38 +1960,38 @@ msgid "" "offset-aware converter with :func:`register_converter`." msgstr "" -#: ../../library/sqlite3.rst:2020 +#: ../../library/sqlite3.rst:1996 msgid "Command-line interface" -msgstr "" +msgstr "命令列介面" -#: ../../library/sqlite3.rst:2022 +#: ../../library/sqlite3.rst:1998 msgid "" "The :mod:`!sqlite3` module can be invoked as a script, using the " "interpreter's :option:`-m` switch, in order to provide a simple SQLite " "shell. The argument signature is as follows::" msgstr "" -#: ../../library/sqlite3.rst:2029 +#: ../../library/sqlite3.rst:2005 msgid "Type ``.quit`` or CTRL-D to exit the shell." msgstr "" -#: ../../library/sqlite3.rst:2035 +#: ../../library/sqlite3.rst:2011 msgid "Print CLI help." msgstr "" -#: ../../library/sqlite3.rst:2039 +#: ../../library/sqlite3.rst:2015 msgid "Print underlying SQLite library version." msgstr "" -#: ../../library/sqlite3.rst:2047 +#: ../../library/sqlite3.rst:2023 msgid "How-to guides" msgstr "" -#: ../../library/sqlite3.rst:2052 +#: ../../library/sqlite3.rst:2028 msgid "How to use placeholders to bind values in SQL queries" msgstr "" -#: ../../library/sqlite3.rst:2054 +#: ../../library/sqlite3.rst:2030 msgid "" "SQL operations usually need to use values from Python variables. However, " "beware of using Python's string operations to assemble queries, as they are " @@ -1994,7 +1999,7 @@ msgid "" "close the single quote and inject ``OR TRUE`` to select all rows::" msgstr "" -#: ../../library/sqlite3.rst:2067 +#: ../../library/sqlite3.rst:2043 msgid "" "Instead, use the DB-API's parameter substitution. To insert a variable into " "a query string, use a placeholder in the string, and substitute the actual " @@ -2002,7 +2007,7 @@ msgid "" "second argument of the cursor's :meth:`~Cursor.execute` method." msgstr "" -#: ../../library/sqlite3.rst:2072 +#: ../../library/sqlite3.rst:2048 msgid "" "An SQL statement may use one of two kinds of placeholders: question marks " "(qmark style) or named placeholders (named style). For the qmark style, " @@ -2013,24 +2018,24 @@ msgid "" "ignored. Here's an example of both styles:" msgstr "" -#: ../../library/sqlite3.rst:2109 +#: ../../library/sqlite3.rst:2085 msgid "" ":pep:`249` numeric placeholders are *not* supported. If used, they will be " "interpreted as named placeholders." msgstr "" -#: ../../library/sqlite3.rst:2116 +#: ../../library/sqlite3.rst:2092 msgid "How to adapt custom Python types to SQLite values" msgstr "" -#: ../../library/sqlite3.rst:2118 +#: ../../library/sqlite3.rst:2094 msgid "" "SQLite supports only a limited set of data types natively. To store custom " "Python types in SQLite databases, *adapt* them to one of the :ref:`Python " "types SQLite natively understands `." msgstr "" -#: ../../library/sqlite3.rst:2122 +#: ../../library/sqlite3.rst:2098 msgid "" "There are two ways to adapt Python objects to SQLite types: letting your " "object adapt itself, or using an *adapter callable*. The latter will take " @@ -2040,11 +2045,11 @@ msgid "" "custom adapter functions." msgstr "" -#: ../../library/sqlite3.rst:2134 +#: ../../library/sqlite3.rst:2110 msgid "How to write adaptable objects" msgstr "" -#: ../../library/sqlite3.rst:2136 +#: ../../library/sqlite3.rst:2112 msgid "" "Suppose we have a :class:`!Point` class that represents a pair of " "coordinates, ``x`` and ``y``, in a Cartesian coordinate system. The " @@ -2054,84 +2059,84 @@ msgid "" "object passed to *protocol* will be of type :class:`PrepareProtocol`." msgstr "" -#: ../../library/sqlite3.rst:2167 +#: ../../library/sqlite3.rst:2143 msgid "How to register adapter callables" msgstr "" -#: ../../library/sqlite3.rst:2169 +#: ../../library/sqlite3.rst:2145 msgid "" "The other possibility is to create a function that converts the Python " "object to an SQLite-compatible type. This function can then be registered " "using :func:`register_adapter`." msgstr "" -#: ../../library/sqlite3.rst:2199 +#: ../../library/sqlite3.rst:2175 msgid "How to convert SQLite values to custom Python types" msgstr "" -#: ../../library/sqlite3.rst:2201 +#: ../../library/sqlite3.rst:2177 msgid "" "Writing an adapter lets you convert *from* custom Python types *to* SQLite " "values. To be able to convert *from* SQLite values *to* custom Python types, " "we use *converters*." msgstr "" -#: ../../library/sqlite3.rst:2206 +#: ../../library/sqlite3.rst:2182 msgid "" "Let's go back to the :class:`!Point` class. We stored the x and y " "coordinates separated via semicolons as strings in SQLite." msgstr "" -#: ../../library/sqlite3.rst:2209 +#: ../../library/sqlite3.rst:2185 msgid "" "First, we'll define a converter function that accepts the string as a " "parameter and constructs a :class:`!Point` object from it." msgstr "" -#: ../../library/sqlite3.rst:2214 +#: ../../library/sqlite3.rst:2190 msgid "" "Converter functions are **always** passed a :class:`bytes` object, no matter " "the underlying SQLite data type." msgstr "" -#: ../../library/sqlite3.rst:2223 +#: ../../library/sqlite3.rst:2199 msgid "" "We now need to tell :mod:`!sqlite3` when it should convert a given SQLite " "value. This is done when connecting to a database, using the *detect_types* " "parameter of :func:`connect`. There are three options:" msgstr "" -#: ../../library/sqlite3.rst:2227 +#: ../../library/sqlite3.rst:2203 msgid "Implicit: set *detect_types* to :const:`PARSE_DECLTYPES`" msgstr "" -#: ../../library/sqlite3.rst:2228 +#: ../../library/sqlite3.rst:2204 msgid "Explicit: set *detect_types* to :const:`PARSE_COLNAMES`" msgstr "" -#: ../../library/sqlite3.rst:2229 +#: ../../library/sqlite3.rst:2205 msgid "" "Both: set *detect_types* to ``sqlite3.PARSE_DECLTYPES | sqlite3." "PARSE_COLNAMES``. Column names take precedence over declared types." msgstr "" -#: ../../library/sqlite3.rst:2233 +#: ../../library/sqlite3.rst:2209 msgid "The following example illustrates the implicit and explicit approaches:" msgstr "" -#: ../../library/sqlite3.rst:2284 +#: ../../library/sqlite3.rst:2260 msgid "Adapter and converter recipes" msgstr "" -#: ../../library/sqlite3.rst:2286 +#: ../../library/sqlite3.rst:2262 msgid "This section shows recipes for common adapters and converters." msgstr "" -#: ../../library/sqlite3.rst:2348 +#: ../../library/sqlite3.rst:2324 msgid "How to use connection shortcut methods" msgstr "" -#: ../../library/sqlite3.rst:2350 +#: ../../library/sqlite3.rst:2326 msgid "" "Using the :meth:`~Connection.execute`, :meth:`~Connection.executemany`, and :" "meth:`~Connection.executescript` methods of the :class:`Connection` class, " @@ -2143,11 +2148,11 @@ msgid "" "object." msgstr "" -#: ../../library/sqlite3.rst:2391 +#: ../../library/sqlite3.rst:2367 msgid "How to use the connection context manager" msgstr "" -#: ../../library/sqlite3.rst:2393 +#: ../../library/sqlite3.rst:2369 msgid "" "A :class:`Connection` object can be used as a context manager that " "automatically commits or rolls back open transactions when leaving the body " @@ -2159,60 +2164,60 @@ msgid "" "rolling back." msgstr "" -#: ../../library/sqlite3.rst:2404 +#: ../../library/sqlite3.rst:2380 msgid "" "If there is no open transaction upon leaving the body of the ``with`` " "statement, or if :attr:`~Connection.autocommit` is ``True``, the context " "manager does nothing." msgstr "" -#: ../../library/sqlite3.rst:2409 +#: ../../library/sqlite3.rst:2385 msgid "" "The context manager neither implicitly opens a new transaction nor closes " "the connection. If you need a closing context manager, consider using :meth:" "`contextlib.closing`." msgstr "" -#: ../../library/sqlite3.rst:2443 +#: ../../library/sqlite3.rst:2419 msgid "How to work with SQLite URIs" msgstr "" -#: ../../library/sqlite3.rst:2445 +#: ../../library/sqlite3.rst:2421 msgid "Some useful URI tricks include:" msgstr "" -#: ../../library/sqlite3.rst:2447 +#: ../../library/sqlite3.rst:2423 msgid "Open a database in read-only mode:" msgstr "" -#: ../../library/sqlite3.rst:2456 +#: ../../library/sqlite3.rst:2432 msgid "" "Do not implicitly create a new database file if it does not already exist; " "will raise :exc:`~sqlite3.OperationalError` if unable to create a new file:" msgstr "" -#: ../../library/sqlite3.rst:2466 +#: ../../library/sqlite3.rst:2442 msgid "Create a shared named in-memory database:" msgstr "" -#: ../../library/sqlite3.rst:2480 +#: ../../library/sqlite3.rst:2456 msgid "" "More information about this feature, including a list of parameters, can be " "found in the `SQLite URI documentation`_." msgstr "" -#: ../../library/sqlite3.rst:2489 +#: ../../library/sqlite3.rst:2465 msgid "How to create and use row factories" msgstr "" -#: ../../library/sqlite3.rst:2491 +#: ../../library/sqlite3.rst:2467 msgid "" "By default, :mod:`!sqlite3` represents each row as a :class:`tuple`. If a :" "class:`!tuple` does not suit your needs, you can use the :class:`sqlite3." "Row` class or a custom :attr:`~Cursor.row_factory`." msgstr "" -#: ../../library/sqlite3.rst:2496 +#: ../../library/sqlite3.rst:2472 msgid "" "While :attr:`!row_factory` exists as an attribute both on the :class:" "`Cursor` and the :class:`Connection`, it is recommended to set :class:" @@ -2220,7 +2225,7 @@ msgid "" "use the same row factory." msgstr "" -#: ../../library/sqlite3.rst:2501 +#: ../../library/sqlite3.rst:2477 msgid "" ":class:`!Row` provides indexed and case-insensitive named access to columns, " "with minimal memory overhead and performance impact over a :class:`!tuple`. " @@ -2228,11 +2233,11 @@ msgid "" "attribute:" msgstr "" -#: ../../library/sqlite3.rst:2511 +#: ../../library/sqlite3.rst:2487 msgid "Queries now return :class:`!Row` objects:" msgstr "" -#: ../../library/sqlite3.rst:2528 +#: ../../library/sqlite3.rst:2504 msgid "" "The ``FROM`` clause can be omitted in the ``SELECT`` statement, as in the " "above example. In such cases, SQLite returns a single row with columns " @@ -2240,41 +2245,80 @@ msgid "" "alias``." msgstr "" -#: ../../library/sqlite3.rst:2533 +#: ../../library/sqlite3.rst:2509 msgid "" "You can create a custom :attr:`~Cursor.row_factory` that returns each row as " "a :class:`dict`, with column names mapped to values:" msgstr "" -#: ../../library/sqlite3.rst:2542 +#: ../../library/sqlite3.rst:2518 msgid "" "Using it, queries now return a :class:`!dict` instead of a :class:`!tuple`:" msgstr "" -#: ../../library/sqlite3.rst:2552 +#: ../../library/sqlite3.rst:2528 msgid "The following row factory returns a :term:`named tuple`:" msgstr "" -#: ../../library/sqlite3.rst:2563 +#: ../../library/sqlite3.rst:2539 msgid ":func:`!namedtuple_factory` can be used as follows:" msgstr "" -#: ../../library/sqlite3.rst:2578 +#: ../../library/sqlite3.rst:2554 msgid "" "With some adjustments, the above recipe can be adapted to use a :class:" "`~dataclasses.dataclass`, or any other custom class, instead of a :class:" "`~collections.namedtuple`." msgstr "" -#: ../../library/sqlite3.rst:2586 +#: ../../library/sqlite3.rst:2562 +msgid "How to handle non-UTF-8 text encodings" +msgstr "" + +#: ../../library/sqlite3.rst:2564 +msgid "" +"By default, :mod:`!sqlite3` uses :class:`str` to adapt SQLite values with " +"the ``TEXT`` data type. This works well for UTF-8 encoded text, but it might " +"fail for other encodings and invalid UTF-8. You can use a custom :attr:" +"`~Connection.text_factory` to handle such cases." +msgstr "" + +#: ../../library/sqlite3.rst:2570 +msgid "" +"Because of SQLite's `flexible typing`_, it is not uncommon to encounter " +"table columns with the ``TEXT`` data type containing non-UTF-8 encodings, or " +"even arbitrary data. To demonstrate, let's assume we have a database with " +"ISO-8859-2 (Latin-2) encoded text, for example a table of Czech-English " +"dictionary entries. Assuming we now have a :class:`Connection` instance :py:" +"data:`!con` connected to this database, we can decode the Latin-2 encoded " +"text using this :attr:`~Connection.text_factory`:" +msgstr "" + +#: ../../library/sqlite3.rst:2583 +msgid "" +"For invalid UTF-8 or arbitrary data in stored in ``TEXT`` table columns, you " +"can use the following technique, borrowed from the :ref:`unicode-howto`:" +msgstr "" + +#: ../../library/sqlite3.rst:2592 +msgid "" +"The :mod:`!sqlite3` module API does not support strings containing " +"surrogates." +msgstr "" + +#: ../../library/sqlite3.rst:2597 +msgid ":ref:`unicode-howto`" +msgstr "" + +#: ../../library/sqlite3.rst:2603 msgid "Explanation" msgstr "解釋" -#: ../../library/sqlite3.rst:2592 +#: ../../library/sqlite3.rst:2609 msgid "Transaction control" msgstr "" -#: ../../library/sqlite3.rst:2594 +#: ../../library/sqlite3.rst:2611 msgid "" ":mod:`!sqlite3` offers multiple methods of controlling whether, when and how " "database transactions are opened and closed. :ref:`sqlite3-transaction-" @@ -2282,24 +2326,24 @@ msgid "" "isolation-level` retains the pre-Python 3.12 behaviour." msgstr "" -#: ../../library/sqlite3.rst:2603 +#: ../../library/sqlite3.rst:2620 msgid "Transaction control via the ``autocommit`` attribute" msgstr "" -#: ../../library/sqlite3.rst:2605 +#: ../../library/sqlite3.rst:2622 msgid "" "The recommended way of controlling transaction behaviour is through the :" "attr:`Connection.autocommit` attribute, which should preferably be set using " "the *autocommit* parameter of :func:`connect`." msgstr "" -#: ../../library/sqlite3.rst:2610 +#: ../../library/sqlite3.rst:2627 msgid "" "It is suggested to set *autocommit* to ``False``, which implies :pep:`249`-" "compliant transaction control. This means:" msgstr "" -#: ../../library/sqlite3.rst:2614 +#: ../../library/sqlite3.rst:2631 msgid "" ":mod:`!sqlite3` ensures that a transaction is always open, so :func:" "`connect`, :meth:`Connection.commit`, and :meth:`Connection.rollback` will " @@ -2308,21 +2352,21 @@ msgid "" "when opening transactions." msgstr "" -#: ../../library/sqlite3.rst:2619 +#: ../../library/sqlite3.rst:2636 msgid "Transactions should be committed explicitly using :meth:`!commit`." msgstr "" -#: ../../library/sqlite3.rst:2620 +#: ../../library/sqlite3.rst:2637 msgid "Transactions should be rolled back explicitly using :meth:`!rollback`." msgstr "" -#: ../../library/sqlite3.rst:2621 +#: ../../library/sqlite3.rst:2638 msgid "" "An implicit rollback is performed if the database is :meth:`~Connection." "close`-ed with pending changes." msgstr "" -#: ../../library/sqlite3.rst:2624 +#: ../../library/sqlite3.rst:2641 msgid "" "Set *autocommit* to ``True`` to enable SQLite's `autocommit mode`_. In this " "mode, :meth:`Connection.commit` and :meth:`Connection.rollback` have no " @@ -2331,25 +2375,25 @@ msgid "" "in_transaction` to query the low-level SQLite autocommit mode." msgstr "" -#: ../../library/sqlite3.rst:2632 +#: ../../library/sqlite3.rst:2649 msgid "" "Set *autocommit* to :data:`LEGACY_TRANSACTION_CONTROL` to leave transaction " "control behaviour to the :attr:`Connection.isolation_level` attribute. See :" "ref:`sqlite3-transaction-control-isolation-level` for more information." msgstr "" -#: ../../library/sqlite3.rst:2641 +#: ../../library/sqlite3.rst:2658 msgid "Transaction control via the ``isolation_level`` attribute" msgstr "" -#: ../../library/sqlite3.rst:2645 +#: ../../library/sqlite3.rst:2662 msgid "" "The recommended way of controlling transactions is via the :attr:" "`~Connection.autocommit` attribute. See :ref:`sqlite3-transaction-control-" "autocommit`." msgstr "" -#: ../../library/sqlite3.rst:2649 +#: ../../library/sqlite3.rst:2666 msgid "" "If :attr:`Connection.autocommit` is set to :data:" "`LEGACY_TRANSACTION_CONTROL` (the default), transaction behaviour is " @@ -2357,7 +2401,7 @@ msgid "" "Otherwise, :attr:`!isolation_level` has no effect." msgstr "" -#: ../../library/sqlite3.rst:2655 +#: ../../library/sqlite3.rst:2672 msgid "" "If the connection attribute :attr:`~Connection.isolation_level` is not " "``None``, new transactions are implicitly opened before :meth:`~Cursor." @@ -2371,7 +2415,7 @@ msgid "" "attribute." msgstr "" -#: ../../library/sqlite3.rst:2668 +#: ../../library/sqlite3.rst:2685 msgid "" "If :attr:`~Connection.isolation_level` is set to ``None``, no transactions " "are implicitly opened at all. This leaves the underlying SQLite library in " @@ -2381,33 +2425,33 @@ msgid "" "in_transaction` attribute." msgstr "" -#: ../../library/sqlite3.rst:2676 +#: ../../library/sqlite3.rst:2693 msgid "" "The :meth:`~Cursor.executescript` method implicitly commits any pending " "transaction before execution of the given SQL script, regardless of the " "value of :attr:`~Connection.isolation_level`." msgstr "" -#: ../../library/sqlite3.rst:2680 +#: ../../library/sqlite3.rst:2697 msgid "" ":mod:`!sqlite3` used to implicitly commit an open transaction before DDL " "statements. This is no longer the case." msgstr "" -#: ../../library/sqlite3.rst:2684 +#: ../../library/sqlite3.rst:2701 msgid "" "The recommended way of controlling transactions is now via the :attr:" "`~Connection.autocommit` attribute." msgstr "" -#: ../../library/sqlite3.rst:1492 +#: ../../library/sqlite3.rst:1469 msgid "? (question mark)" msgstr "? (問號)" -#: ../../library/sqlite3.rst:1492 ../../library/sqlite3.rst:1493 +#: ../../library/sqlite3.rst:1469 ../../library/sqlite3.rst:1470 msgid "in SQL statements" msgstr "於 SQL 陳述式中" -#: ../../library/sqlite3.rst:1493 +#: ../../library/sqlite3.rst:1470 msgid ": (colon)" msgstr ": (冒號)" diff --git a/library/sys.monitoring.po b/library/sys.monitoring.po index 00d44ff013..1e665b2e7e 100644 --- a/library/sys.monitoring.po +++ b/library/sys.monitoring.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-11 17:13+0000\n" +"POT-Creation-Date: 2023-10-26 00:03+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -21,84 +21,88 @@ msgstr "" msgid ":mod:`sys.monitoring` --- Execution event monitoring" msgstr "" -#: ../../library/sys.monitoring.rst:11 +#: ../../library/sys.monitoring.rst:13 msgid "" -"``sys.monitoring`` is a namespace within the ``sys`` module, not an " +":mod:`sys.monitoring` is a namespace within the :mod:`sys` module, not an " "independent module, so there is no need to ``import sys.monitoring``, simply " "``import sys`` and then use ``sys.monitoring``." msgstr "" -#: ../../library/sys.monitoring.rst:17 +#: ../../library/sys.monitoring.rst:19 msgid "" "This namespace provides access to the functions and constants necessary to " "activate and control event monitoring." msgstr "" -#: ../../library/sys.monitoring.rst:20 +#: ../../library/sys.monitoring.rst:22 msgid "" "As programs execute, events occur that might be of interest to tools that " -"monitor execution. The :mod:`!sys.monitoring` namespace provides means to " +"monitor execution. The :mod:`sys.monitoring` namespace provides means to " "receive callbacks when events of interest occur." msgstr "" -#: ../../library/sys.monitoring.rst:24 +#: ../../library/sys.monitoring.rst:26 msgid "The monitoring API consists of three components:" msgstr "" -#: ../../library/sys.monitoring.rst:26 ../../library/sys.monitoring.rst:31 -msgid "Tool identifiers" +#: ../../library/sys.monitoring.rst:28 +msgid "`Tool identifiers`_" msgstr "" -#: ../../library/sys.monitoring.rst:27 ../../library/sys.monitoring.rst:74 -msgid "Events" +#: ../../library/sys.monitoring.rst:29 +msgid "`Events`_" msgstr "" -#: ../../library/sys.monitoring.rst:28 -msgid "Callbacks" +#: ../../library/sys.monitoring.rst:30 +msgid ":ref:`Callbacks `" msgstr "" #: ../../library/sys.monitoring.rst:33 +msgid "Tool identifiers" +msgstr "" + +#: ../../library/sys.monitoring.rst:35 msgid "" -"A tool identifier is an integer and associated name. Tool identifiers are " -"used to discourage tools from interfering with each other and to allow " +"A tool identifier is an integer and the associated name. Tool identifiers " +"are used to discourage tools from interfering with each other and to allow " "multiple tools to operate at the same time. Currently tools are completely " "independent and cannot be used to monitor each other. This restriction may " "be lifted in the future." msgstr "" -#: ../../library/sys.monitoring.rst:39 +#: ../../library/sys.monitoring.rst:41 msgid "" "Before registering or activating events, a tool should choose an identifier. " -"Identifiers are integers in the range 0 to 5." +"Identifiers are integers in the range 0 to 5 inclusive." msgstr "" -#: ../../library/sys.monitoring.rst:43 +#: ../../library/sys.monitoring.rst:45 msgid "Registering and using tools" msgstr "" -#: ../../library/sys.monitoring.rst:47 +#: ../../library/sys.monitoring.rst:49 msgid "" -"Must be called before ``id`` can be used. ``id`` must be in the range 0 to 5 " -"inclusive. Raises a ``ValueError`` if ``id`` is in use." +"Must be called before *tool_id* can be used. *tool_id* must be in the range " +"0 to 5 inclusive. Raises a :exc:`ValueError` if *tool_id* is in use." msgstr "" -#: ../../library/sys.monitoring.rst:53 -msgid "Should be called once a tool no longer requires ``id``." +#: ../../library/sys.monitoring.rst:55 +msgid "Should be called once a tool no longer requires *tool_id*." msgstr "" -#: ../../library/sys.monitoring.rst:57 +#: ../../library/sys.monitoring.rst:59 msgid "" -"Returns the name of the tool if ``id`` is in use, otherwise it returns " -"``None``. ``id`` must be in the range 0 to 5 inclusive." +"Returns the name of the tool if *tool_id* is in use, otherwise it returns " +"``None``. *tool_id* must be in the range 0 to 5 inclusive." msgstr "" -#: ../../library/sys.monitoring.rst:61 +#: ../../library/sys.monitoring.rst:63 msgid "" "All IDs are treated the same by the VM with regard to events, but the " "following IDs are pre-defined to make co-operation of tools easier::" msgstr "" -#: ../../library/sys.monitoring.rst:69 +#: ../../library/sys.monitoring.rst:71 msgid "" "There is no obligation to set an ID, nor is there anything preventing a tool " "from using an ID even it is already in use. However, tools are encouraged to " @@ -106,312 +110,327 @@ msgid "" msgstr "" #: ../../library/sys.monitoring.rst:76 -msgid "The following events are supported:" +msgid "Events" msgstr "" -#: ../../library/sys.monitoring.rst:78 ../../library/sys.monitoring.rst:138 -msgid "BRANCH" +#: ../../library/sys.monitoring.rst:78 +msgid "The following events are supported:" msgstr "" -#: ../../library/sys.monitoring.rst:79 +#: ../../library/sys.monitoring.rst:82 msgid "A conditional branch is taken (or not)." msgstr "" -#: ../../library/sys.monitoring.rst:80 ../../library/sys.monitoring.rst:134 -msgid "CALL" -msgstr "" - -#: ../../library/sys.monitoring.rst:81 +#: ../../library/sys.monitoring.rst:86 msgid "A call in Python code (event occurs before the call)." msgstr "" -#: ../../library/sys.monitoring.rst:82 ../../library/sys.monitoring.rst:147 -msgid "C_RAISE" -msgstr "" - -#: ../../library/sys.monitoring.rst:83 +#: ../../library/sys.monitoring.rst:90 msgid "" -"Exception raised from any callable, except Python functions (event occurs " -"after the exit)." -msgstr "" - -#: ../../library/sys.monitoring.rst:84 ../../library/sys.monitoring.rst:148 -msgid "C_RETURN" +"An exception raised from any callable, except for Python functions (event " +"occurs after the exit)." msgstr "" -#: ../../library/sys.monitoring.rst:85 +#: ../../library/sys.monitoring.rst:94 msgid "" -"Return from any callable, except Python functions (event occurs after the " -"return)." -msgstr "" - -#: ../../library/sys.monitoring.rst:86 ../../library/sys.monitoring.rst:165 -msgid "EXCEPTION_HANDLED" +"Return from any callable, except for Python functions (event occurs after " +"the return)." msgstr "" -#: ../../library/sys.monitoring.rst:87 +#: ../../library/sys.monitoring.rst:98 msgid "An exception is handled." msgstr "" -#: ../../library/sys.monitoring.rst:88 ../../library/sys.monitoring.rst:136 -msgid "INSTRUCTION" -msgstr "" - -#: ../../library/sys.monitoring.rst:89 +#: ../../library/sys.monitoring.rst:102 msgid "A VM instruction is about to be executed." msgstr "" -#: ../../library/sys.monitoring.rst:90 ../../library/sys.monitoring.rst:137 -msgid "JUMP" -msgstr "" - -#: ../../library/sys.monitoring.rst:91 +#: ../../library/sys.monitoring.rst:106 msgid "An unconditional jump in the control flow graph is made." msgstr "" -#: ../../library/sys.monitoring.rst:92 ../../library/sys.monitoring.rst:135 -msgid "LINE" -msgstr "" - -#: ../../library/sys.monitoring.rst:93 +#: ../../library/sys.monitoring.rst:110 msgid "" "An instruction is about to be executed that has a different line number from " "the preceding instruction." msgstr "" -#: ../../library/sys.monitoring.rst:94 ../../library/sys.monitoring.rst:131 -msgid "PY_RESUME" -msgstr "" - -#: ../../library/sys.monitoring.rst:95 +#: ../../library/sys.monitoring.rst:114 msgid "" "Resumption of a Python function (for generator and coroutine functions), " -"except for throw() calls." +"except for ``throw()`` calls." msgstr "" -#: ../../library/sys.monitoring.rst:96 ../../library/sys.monitoring.rst:132 -msgid "PY_RETURN" -msgstr "" - -#: ../../library/sys.monitoring.rst:97 +#: ../../library/sys.monitoring.rst:118 msgid "" "Return from a Python function (occurs immediately before the return, the " "callee's frame will be on the stack)." msgstr "" -#: ../../library/sys.monitoring.rst:98 ../../library/sys.monitoring.rst:130 -msgid "PY_START" -msgstr "" - -#: ../../library/sys.monitoring.rst:99 +#: ../../library/sys.monitoring.rst:122 msgid "" "Start of a Python function (occurs immediately after the call, the callee's " "frame will be on the stack)" msgstr "" -#: ../../library/sys.monitoring.rst:100 ../../library/sys.monitoring.rst:162 -msgid "PY_THROW" -msgstr "" - -#: ../../library/sys.monitoring.rst:101 -msgid "A Python function is resumed by a throw() call." -msgstr "" - -#: ../../library/sys.monitoring.rst:102 ../../library/sys.monitoring.rst:163 -msgid "PY_UNWIND" +#: ../../library/sys.monitoring.rst:126 +msgid "A Python function is resumed by a ``throw()`` call." msgstr "" -#: ../../library/sys.monitoring.rst:103 +#: ../../library/sys.monitoring.rst:130 msgid "Exit from a Python function during exception unwinding." msgstr "" -#: ../../library/sys.monitoring.rst:104 ../../library/sys.monitoring.rst:133 -msgid "PY_YIELD" -msgstr "" - -#: ../../library/sys.monitoring.rst:105 +#: ../../library/sys.monitoring.rst:134 msgid "" "Yield from a Python function (occurs immediately before the yield, the " "callee's frame will be on the stack)." msgstr "" -#: ../../library/sys.monitoring.rst:106 ../../library/sys.monitoring.rst:164 -msgid "RAISE" -msgstr "" - -#: ../../library/sys.monitoring.rst:107 +#: ../../library/sys.monitoring.rst:138 msgid "" -"An exception is raised, except those that cause a ``STOP_ITERATION`` event." +"An exception is raised, except those that cause a :monitoring-event:" +"`STOP_ITERATION` event." msgstr "" -#: ../../library/sys.monitoring.rst:108 -msgid "RERAISE" -msgstr "" - -#: ../../library/sys.monitoring.rst:109 +#: ../../library/sys.monitoring.rst:142 msgid "" -"An exception is re-raised, for example at the end of a ``finally`` block." +"An exception is re-raised, for example at the end of a :keyword:`finally` " +"block." msgstr "" -#: ../../library/sys.monitoring.rst:111 ../../library/sys.monitoring.rst:139 -msgid "STOP_ITERATION" -msgstr "" - -#: ../../library/sys.monitoring.rst:111 +#: ../../library/sys.monitoring.rst:146 msgid "" -"An artificial ``StopIteration`` is raised; see `the STOP_ITERATION event`_." +"An artificial :exc:`StopIteration` is raised; see `the STOP_ITERATION " +"event`_." msgstr "" -#: ../../library/sys.monitoring.rst:113 +#: ../../library/sys.monitoring.rst:149 msgid "More events may be added in the future." msgstr "" -#: ../../library/sys.monitoring.rst:115 +#: ../../library/sys.monitoring.rst:151 msgid "" "These events are attributes of the :mod:`!sys.monitoring.events` namespace. " "Each event is represented as a power-of-2 integer constant. To define a set " "of events, simply bitwise or the individual events together. For example, to " -"specify both ``PY_RETURN`` and ``PY_START`` events, use the expression " -"``PY_RETURN | PY_START``." +"specify both :monitoring-event:`PY_RETURN` and :monitoring-event:`PY_START` " +"events, use the expression ``PY_RETURN | PY_START``." +msgstr "" + +#: ../../library/sys.monitoring.rst:159 +msgid "An alias for ``0`` so users can do explict comparisions like::" msgstr "" -#: ../../library/sys.monitoring.rst:121 +#: ../../library/sys.monitoring.rst:164 msgid "Events are divided into three groups:" msgstr "" -#: ../../library/sys.monitoring.rst:124 +#: ../../library/sys.monitoring.rst:167 msgid "Local events" msgstr "" -#: ../../library/sys.monitoring.rst:126 +#: ../../library/sys.monitoring.rst:169 msgid "" "Local events are associated with normal execution of the program and happen " "at clearly defined locations. All local events can be disabled. The local " "events are:" msgstr "" -#: ../../library/sys.monitoring.rst:142 +#: ../../library/sys.monitoring.rst:173 +msgid ":monitoring-event:`PY_START`" +msgstr "" + +#: ../../library/sys.monitoring.rst:174 +msgid ":monitoring-event:`PY_RESUME`" +msgstr "" + +#: ../../library/sys.monitoring.rst:175 +msgid ":monitoring-event:`PY_RETURN`" +msgstr "" + +#: ../../library/sys.monitoring.rst:176 +msgid ":monitoring-event:`PY_YIELD`" +msgstr "" + +#: ../../library/sys.monitoring.rst:177 +msgid ":monitoring-event:`CALL`" +msgstr "" + +#: ../../library/sys.monitoring.rst:178 +msgid ":monitoring-event:`LINE`" +msgstr "" + +#: ../../library/sys.monitoring.rst:179 +msgid ":monitoring-event:`INSTRUCTION`" +msgstr "" + +#: ../../library/sys.monitoring.rst:180 +msgid ":monitoring-event:`JUMP`" +msgstr "" + +#: ../../library/sys.monitoring.rst:181 +msgid ":monitoring-event:`BRANCH`" +msgstr "" + +#: ../../library/sys.monitoring.rst:182 +msgid ":monitoring-event:`STOP_ITERATION`" +msgstr "" + +#: ../../library/sys.monitoring.rst:185 msgid "Ancillary events" msgstr "" -#: ../../library/sys.monitoring.rst:144 +#: ../../library/sys.monitoring.rst:187 msgid "" "Ancillary events can be monitored like other events, but are controlled by " "another event:" msgstr "" -#: ../../library/sys.monitoring.rst:150 +#: ../../library/sys.monitoring.rst:190 +msgid ":monitoring-event:`C_RAISE`" +msgstr "" + +#: ../../library/sys.monitoring.rst:191 +msgid ":monitoring-event:`C_RETURN`" +msgstr "" + +#: ../../library/sys.monitoring.rst:193 msgid "" -"The ``C_RETURN`` and ``C_RAISE`` events are controlled by the ``CALL`` " -"event. ``C_RETURN`` and ``C_RAISE`` events will only be seen if the " -"corresponding ``CALL`` event is being monitored." +"The :monitoring-event:`C_RETURN` and :monitoring-event:`C_RAISE` events are " +"controlled by the :monitoring-event:`CALL` event. :monitoring-event:" +"`C_RETURN` and :monitoring-event:`C_RAISE` events will only be seen if the " +"corresponding :monitoring-event:`CALL` event is being monitored." msgstr "" -#: ../../library/sys.monitoring.rst:155 +#: ../../library/sys.monitoring.rst:199 msgid "Other events" msgstr "" -#: ../../library/sys.monitoring.rst:157 +#: ../../library/sys.monitoring.rst:201 msgid "" "Other events are not necessarily tied to a specific location in the program " "and cannot be individually disabled." msgstr "" -#: ../../library/sys.monitoring.rst:160 +#: ../../library/sys.monitoring.rst:204 msgid "The other events that can be monitored are:" msgstr "" -#: ../../library/sys.monitoring.rst:169 +#: ../../library/sys.monitoring.rst:206 +msgid ":monitoring-event:`PY_THROW`" +msgstr "" + +#: ../../library/sys.monitoring.rst:207 +msgid ":monitoring-event:`PY_UNWIND`" +msgstr "" + +#: ../../library/sys.monitoring.rst:208 +msgid ":monitoring-event:`RAISE`" +msgstr "" + +#: ../../library/sys.monitoring.rst:209 +msgid ":monitoring-event:`EXCEPTION_HANDLED`" +msgstr "" + +#: ../../library/sys.monitoring.rst:213 msgid "The STOP_ITERATION event" msgstr "" -#: ../../library/sys.monitoring.rst:171 +#: ../../library/sys.monitoring.rst:215 msgid "" -":pep:`PEP 380 <380#use-of-stopiteration-to-return-values>` specifies that a " -"``StopIteration`` exception is raised when returning a value from a " +":pep:`PEP 380 <380#use-of-stopiteration-to-return-values>` specifies that a :" +"exc:`StopIteration` exception is raised when returning a value from a " "generator or coroutine. However, this is a very inefficient way to return a " "value, so some Python implementations, notably CPython 3.12+, do not raise " "an exception unless it would be visible to other code." msgstr "" -#: ../../library/sys.monitoring.rst:177 +#: ../../library/sys.monitoring.rst:221 msgid "" "To allow tools to monitor for real exceptions without slowing down " -"generators and coroutines, the ``STOP_ITERATION`` event is provided. " -"``STOP_ITERATION`` can be locally disabled, unlike ``RAISE``." +"generators and coroutines, the :monitoring-event:`STOP_ITERATION` event is " +"provided. :monitoring-event:`STOP_ITERATION` can be locally disabled, " +"unlike :monitoring-event:`RAISE`." msgstr "" -#: ../../library/sys.monitoring.rst:183 +#: ../../library/sys.monitoring.rst:227 msgid "Turning events on and off" msgstr "" -#: ../../library/sys.monitoring.rst:185 +#: ../../library/sys.monitoring.rst:229 msgid "" -"In order to monitor an event, it must be turned on and a callback " -"registered. Events can be turned on or off by setting the events either " -"globally or for a particular code object." +"In order to monitor an event, it must be turned on and a corresponding " +"callback must be registered. Events can be turned on or off by setting the " +"events either globally or for a particular code object." msgstr "" -#: ../../library/sys.monitoring.rst:191 +#: ../../library/sys.monitoring.rst:236 msgid "Setting events globally" msgstr "" -#: ../../library/sys.monitoring.rst:193 +#: ../../library/sys.monitoring.rst:238 msgid "" "Events can be controlled globally by modifying the set of events being " "monitored." msgstr "" -#: ../../library/sys.monitoring.rst:197 +#: ../../library/sys.monitoring.rst:242 msgid "Returns the ``int`` representing all the active events." msgstr "" -#: ../../library/sys.monitoring.rst:201 +#: ../../library/sys.monitoring.rst:246 msgid "" -"Activates all events which are set in ``event_set``. Raises a ``ValueError`` " -"if ``tool_id`` is not in use." +"Activates all events which are set in *event_set*. Raises a :exc:" +"`ValueError` if *tool_id* is not in use." msgstr "" -#: ../../library/sys.monitoring.rst:204 +#: ../../library/sys.monitoring.rst:249 msgid "No events are active by default." msgstr "" -#: ../../library/sys.monitoring.rst:207 +#: ../../library/sys.monitoring.rst:252 msgid "Per code object events" msgstr "" -#: ../../library/sys.monitoring.rst:209 +#: ../../library/sys.monitoring.rst:254 msgid "Events can also be controlled on a per code object basis." msgstr "" -#: ../../library/sys.monitoring.rst:213 -msgid "Returns all the local events for ``code``" +#: ../../library/sys.monitoring.rst:258 +msgid "Returns all the local events for *code*" msgstr "" -#: ../../library/sys.monitoring.rst:217 +#: ../../library/sys.monitoring.rst:262 msgid "" -"Activates all the local events for ``code`` which are set in ``event_set``. " -"Raises a ``ValueError`` if ``tool_id`` is not in use." +"Activates all the local events for *code* which are set in *event_set*. " +"Raises a :exc:`ValueError` if *tool_id* is not in use." msgstr "" -#: ../../library/sys.monitoring.rst:220 +#: ../../library/sys.monitoring.rst:265 msgid "" "Local events add to global events, but do not mask them. In other words, all " "global events will trigger for a code object, regardless of the local events." msgstr "" -#: ../../library/sys.monitoring.rst:226 +#: ../../library/sys.monitoring.rst:271 msgid "Disabling events" msgstr "" -#: ../../library/sys.monitoring.rst:228 +#: ../../library/sys.monitoring.rst:275 msgid "" -"Local events can be disabled for a specific code location by returning ``sys." -"monitoring.DISABLE`` from a callback function. This does not change which " -"events are set, or any other code locations for the same event." +"A special value that can be returned from a callback function to disable " +"events for the current code location." msgstr "" -#: ../../library/sys.monitoring.rst:232 +#: ../../library/sys.monitoring.rst:278 +msgid "" +"Local events can be disabled for a specific code location by returning :data:" +"`sys.monitoring.DISABLE` from a callback function. This does not change " +"which events are set, or any other code locations for the same event." +msgstr "" + +#: ../../library/sys.monitoring.rst:282 msgid "" "Disabling events for specific locations is very important for high " "performance monitoring. For example, a program can be run under a debugger " @@ -419,122 +438,105 @@ msgid "" "breakpoints." msgstr "" -#: ../../library/sys.monitoring.rst:239 +#: ../../library/sys.monitoring.rst:289 +msgid "" +"Enable all the events that were disabled by :data:`sys.monitoring.DISABLE` " +"for all tools." +msgstr "" + +#: ../../library/sys.monitoring.rst:296 msgid "Registering callback functions" msgstr "" -#: ../../library/sys.monitoring.rst:241 +#: ../../library/sys.monitoring.rst:298 msgid "To register a callable for events call" msgstr "" -#: ../../library/sys.monitoring.rst:245 -msgid "" -"Registers the callable ``func`` for the ``event`` with the given ``tool_id``" +#: ../../library/sys.monitoring.rst:302 +msgid "Registers the callable *func* for the *event* with the given *tool_id*" msgstr "" -#: ../../library/sys.monitoring.rst:247 +#: ../../library/sys.monitoring.rst:304 msgid "" -"If another callback was registered for the given ``tool_id`` and ``event``, " -"it is unregistered and returned. Otherwise ``register_callback`` returns " +"If another callback was registered for the given *tool_id* and *event*, it " +"is unregistered and returned. Otherwise :func:`register_callback` returns " "``None``." msgstr "" -#: ../../library/sys.monitoring.rst:252 +#: ../../library/sys.monitoring.rst:309 msgid "" "Functions can be unregistered by calling ``sys.monitoring." "register_callback(tool_id, event, None)``." msgstr "" -#: ../../library/sys.monitoring.rst:255 +#: ../../library/sys.monitoring.rst:312 msgid "Callback functions can be registered and unregistered at any time." msgstr "" -#: ../../library/sys.monitoring.rst:257 +#: ../../library/sys.monitoring.rst:314 msgid "" -"Registering or unregistering a callback function will generate a ``sys." -"audit`` event." +"Registering or unregistering a callback function will generate a :func:`sys." +"audit` event." msgstr "" -#: ../../library/sys.monitoring.rst:261 +#: ../../library/sys.monitoring.rst:318 msgid "Callback function arguments" msgstr "" -#: ../../library/sys.monitoring.rst:263 +#: ../../library/sys.monitoring.rst:322 +msgid "" +"A special value that is passed to a callback function to indicate that there " +"are no arguments to the call." +msgstr "" + +#: ../../library/sys.monitoring.rst:325 msgid "" "When an active event occurs, the registered callback function is called. " "Different events will provide the callback function with different " "arguments, as follows:" msgstr "" -#: ../../library/sys.monitoring.rst:266 -msgid "``PY_START`` and ``PY_RESUME``::" +#: ../../library/sys.monitoring.rst:328 +msgid ":monitoring-event:`PY_START` and :monitoring-event:`PY_RESUME`::" msgstr "" -#: ../../library/sys.monitoring.rst:270 -msgid "``PY_RETURN`` and ``PY_YIELD``:" +#: ../../library/sys.monitoring.rst:332 +msgid ":monitoring-event:`PY_RETURN` and :monitoring-event:`PY_YIELD`::" msgstr "" -#: ../../library/sys.monitoring.rst:272 +#: ../../library/sys.monitoring.rst:336 msgid "" -"``func(code: CodeType, instruction_offset: int, retval: object) -> DISABLE | " -"Any``" -msgstr "" - -#: ../../library/sys.monitoring.rst:274 -msgid "``CALL``, ``C_RAISE`` and ``C_RETURN``:" +":monitoring-event:`CALL`, :monitoring-event:`C_RAISE` and :monitoring-event:" +"`C_RETURN`::" msgstr "" -#: ../../library/sys.monitoring.rst:276 +#: ../../library/sys.monitoring.rst:340 msgid "" -"``func(code: CodeType, instruction_offset: int, callable: object, arg0: " -"object | MISSING) -> DISABLE | Any``" +"If there are no arguments, *arg0* is set to :data:`sys.monitoring.MISSING`." msgstr "" -#: ../../library/sys.monitoring.rst:278 -msgid "If there are no arguments, ``arg0`` is set to ``MISSING``." -msgstr "" - -#: ../../library/sys.monitoring.rst:280 -msgid "" -"``RAISE``, ``RERAISE``, ``EXCEPTION_HANDLED``, ``PY_UNWIND``, ``PY_THROW`` " -"and ``STOP_ITERATION``:" -msgstr "" - -#: ../../library/sys.monitoring.rst:282 +#: ../../library/sys.monitoring.rst:342 msgid "" -"``func(code: CodeType, instruction_offset: int, exception: BaseException) -> " -"DISABLE | Any``" -msgstr "" - -#: ../../library/sys.monitoring.rst:284 -msgid "``LINE``:" -msgstr "" - -#: ../../library/sys.monitoring.rst:286 -msgid "``func(code: CodeType, line_number: int) -> DISABLE | Any``" +":monitoring-event:`RAISE`, :monitoring-event:`RERAISE`, :monitoring-event:" +"`EXCEPTION_HANDLED`, :monitoring-event:`PY_UNWIND`, :monitoring-event:" +"`PY_THROW` and :monitoring-event:`STOP_ITERATION`::" msgstr "" -#: ../../library/sys.monitoring.rst:288 -msgid "``BRANCH`` and ``JUMP``:" +#: ../../library/sys.monitoring.rst:347 +msgid ":monitoring-event:`LINE`::" msgstr "" -#: ../../library/sys.monitoring.rst:290 -msgid "" -"``func(code: CodeType, instruction_offset: int, destination_offset: int) -> " -"DISABLE | Any``" +#: ../../library/sys.monitoring.rst:351 +msgid ":monitoring-event:`BRANCH` and :monitoring-event:`JUMP`::" msgstr "" -#: ../../library/sys.monitoring.rst:292 +#: ../../library/sys.monitoring.rst:355 msgid "" -"Note that the ``destination_offset`` is where the code will next execute. " -"For an untaken branch this will be the offset of the instruction following " -"the branch." +"Note that the *destination_offset* is where the code will next execute. For " +"an untaken branch this will be the offset of the instruction following the " +"branch." msgstr "" -#: ../../library/sys.monitoring.rst:296 -msgid "``INSTRUCTION``:" -msgstr "" - -#: ../../library/sys.monitoring.rst:298 -msgid "``func(code: CodeType, instruction_offset: int) -> DISABLE | Any``" +#: ../../library/sys.monitoring.rst:359 +msgid ":monitoring-event:`INSTRUCTION`::" msgstr "" diff --git a/library/sys.po b/library/sys.po index 93f7eb9d6e..e95afb800e 100644 --- a/library/sys.po +++ b/library/sys.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-11 17:13+0000\n" +"POT-Creation-Date: 2023-11-01 00:03+0000\n" "PO-Revision-Date: 2023-04-26 02:54+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -79,7 +79,6 @@ msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys.addaudithook``。" #: ../../library/sys.rst:49 -#, fuzzy msgid "" "Calling :func:`sys.addaudithook` will itself raise an auditing event named " "``sys.addaudithook`` with no arguments. If any existing hooks raise an " @@ -88,9 +87,9 @@ msgid "" "hook has been added unless they control all existing hooks." msgstr "" "呼叫 :func:`sys.addaudithook` 本身會引發一個不帶任何引數、名為 ``sys." -"addaudithook`` 的稽核事件。如果任何現有的掛鉤函式引發從 :class:" -"`RuntimeError` 衍生的例外,則不會添加新的掛鉤函式並抑制異常。因此,除非呼叫者" -"控制所有已存在的掛鉤函式,他們不能假設他們的掛鉤函式已被添加。" +"addaudithook`` 的稽核事件。如果任何現有的 hook 引發從 :class:`RuntimeError` " +"衍生的例外,則不會添加新的 hook 並抑制異常。因此,除非呼叫者控制所有已存在的 " +"hook,他們不能假設他們的 hook 已被添加。" #: ../../library/sys.rst:56 msgid "" @@ -231,27 +230,34 @@ msgstr "另請參閱 :data:`sys.stdlib_module_names` 清單。" msgid "" "Call ``func(*args)``, while tracing is enabled. The tracing state is saved, " "and restored afterwards. This is intended to be called from a debugger from " -"a checkpoint, to recursively debug some other code." +"a checkpoint, to recursively debug or profile some other code." +msgstr "" + +#: ../../library/sys.rst:178 +msgid "" +"Tracing is suspended while calling a tracing function set by :func:" +"`settrace` or :func:`setprofile` to avoid infinite recursion. :func:`!" +"call_tracing` enables explicit recursion of the tracing function." msgstr "" -#: ../../library/sys.rst:181 +#: ../../library/sys.rst:185 msgid "A string containing the copyright pertaining to the Python interpreter." msgstr "" -#: ../../library/sys.rst:186 +#: ../../library/sys.rst:190 msgid "" "Clear the internal type cache. The type cache is used to speed up attribute " "and method lookups. Use the function *only* to drop unnecessary references " "during reference leak debugging." msgstr "" -#: ../../library/sys.rst:190 ../../library/sys.rst:206 -#: ../../library/sys.rst:219 +#: ../../library/sys.rst:194 ../../library/sys.rst:210 +#: ../../library/sys.rst:223 msgid "" "This function should be used for internal and specialized purposes only." msgstr "" -#: ../../library/sys.rst:195 +#: ../../library/sys.rst:199 msgid "" "Return a dictionary mapping each thread's identifier to the topmost stack " "frame currently active in that thread at the time the function is called. " @@ -259,7 +265,7 @@ msgid "" "given such a frame." msgstr "" -#: ../../library/sys.rst:200 +#: ../../library/sys.rst:204 msgid "" "This is most useful for debugging deadlock: this function does not require " "the deadlocked threads' cooperation, and such threads' call stacks are " @@ -268,14 +274,14 @@ msgid "" "by the time calling code examines the frame." msgstr "" -#: ../../library/sys.rst:208 +#: ../../library/sys.rst:212 msgid "" "Raises an :ref:`auditing event ` ``sys._current_frames`` with no " "arguments." msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys._current_frames``。" -#: ../../library/sys.rst:212 +#: ../../library/sys.rst:216 msgid "" "Return a dictionary mapping each thread's identifier to the topmost " "exception currently active in that thread at the time the function is " @@ -283,11 +289,11 @@ msgid "" "included in the result dictionary." msgstr "" -#: ../../library/sys.rst:217 +#: ../../library/sys.rst:221 msgid "This is most useful for statistical profiling." msgstr "" -#: ../../library/sys.rst:221 +#: ../../library/sys.rst:225 msgid "" "Raises an :ref:`auditing event ` ``sys._current_exceptions`` with " "no arguments." @@ -295,20 +301,20 @@ msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys." "_current_exceptions``。" -#: ../../library/sys.rst:223 +#: ../../library/sys.rst:227 msgid "" "Each value in the dictionary is now a single exception instance, rather than " "a 3-tuple as returned from ``sys.exc_info()``." msgstr "" -#: ../../library/sys.rst:229 +#: ../../library/sys.rst:233 msgid "" "This hook function is called by built-in :func:`breakpoint`. By default, it " "drops you into the :mod:`pdb` debugger, but it can be set to any other " "function so that you can choose which debugger gets used." msgstr "" -#: ../../library/sys.rst:233 +#: ../../library/sys.rst:237 msgid "" "The signature of this function is dependent on what it calls. For example, " "the default binding (e.g. ``pdb.set_trace()``) expects no arguments, but you " @@ -318,7 +324,7 @@ msgid "" "returns is returned from ``breakpoint()``." msgstr "" -#: ../../library/sys.rst:240 +#: ../../library/sys.rst:244 msgid "" "The default implementation first consults the environment variable :envvar:" "`PYTHONBREAKPOINT`. If that is set to ``\"0\"`` then this function returns " @@ -332,48 +338,48 @@ msgid "" "breakpointhook()`` returns to the built-in :func:`breakpoint` function." msgstr "" -#: ../../library/sys.rst:252 +#: ../../library/sys.rst:256 msgid "" "Note that if anything goes wrong while importing the callable named by :" "envvar:`PYTHONBREAKPOINT`, a :exc:`RuntimeWarning` is reported and the " "breakpoint is ignored." msgstr "" -#: ../../library/sys.rst:256 +#: ../../library/sys.rst:260 msgid "" "Also note that if ``sys.breakpointhook()`` is overridden programmatically, :" "envvar:`PYTHONBREAKPOINT` is *not* consulted." msgstr "" -#: ../../library/sys.rst:263 +#: ../../library/sys.rst:267 msgid "" "Print low-level information to stderr about the state of CPython's memory " "allocator." msgstr "" -#: ../../library/sys.rst:266 +#: ../../library/sys.rst:270 msgid "" "If Python is :ref:`built in debug mode ` (:option:`configure --" "with-pydebug option <--with-pydebug>`), it also performs some expensive " "internal consistency checks." msgstr "" -#: ../../library/sys.rst:274 +#: ../../library/sys.rst:278 msgid "" "This function is specific to CPython. The exact output format is not " "defined here, and may change." msgstr "" -#: ../../library/sys.rst:280 +#: ../../library/sys.rst:284 msgid "Integer specifying the handle of the Python DLL." msgstr "" -#: ../../library/sys.rst:282 ../../library/sys.rst:972 -#: ../../library/sys.rst:1717 ../../library/sys.rst:1953 +#: ../../library/sys.rst:286 ../../library/sys.rst:976 +#: ../../library/sys.rst:1730 ../../library/sys.rst:1966 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" -#: ../../library/sys.rst:287 +#: ../../library/sys.rst:291 msgid "" "If *value* is not ``None``, this function prints ``repr(value)`` to ``sys." "stdout``, and saves *value* in ``builtins._``. If ``repr(value)`` is not " @@ -382,7 +388,7 @@ msgid "" "encoding`` with ``'backslashreplace'`` error handler." msgstr "" -#: ../../library/sys.rst:293 +#: ../../library/sys.rst:297 msgid "" "``sys.displayhook`` is called on the result of evaluating an :term:" "`expression` entered in an interactive Python session. The display of these " @@ -390,15 +396,15 @@ msgid "" "displayhook``." msgstr "" -#: ../../library/sys.rst:297 +#: ../../library/sys.rst:301 msgid "Pseudo-code::" msgstr "" -#: ../../library/sys.rst:317 +#: ../../library/sys.rst:321 msgid "Use ``'backslashreplace'`` error handler on :exc:`UnicodeEncodeError`." msgstr "" -#: ../../library/sys.rst:323 +#: ../../library/sys.rst:327 msgid "" "If this is true, Python won't try to write ``.pyc`` files on the import of " "source modules. This value is initially set to ``True`` or ``False`` " @@ -407,20 +413,20 @@ msgid "" "to control bytecode file generation." msgstr "" -#: ../../library/sys.rst:332 +#: ../../library/sys.rst:336 msgid "" "A :term:`named tuple` holding information about the environment on the " "*wasm32-emscripten* platform. The named tuple is provisional and may change " "in the future." msgstr "" -#: ../../library/sys.rst:338 +#: ../../library/sys.rst:342 msgid "" "Emscripten version as tuple of ints (major, minor, micro), e.g. ``(3, 1, " "8)``." msgstr "" -#: ../../library/sys.rst:342 +#: ../../library/sys.rst:346 msgid "" "Runtime string, e.g. browser user agent, ``'Node.js v14.18.2'``, or " "``'UNKNOWN'``." @@ -428,19 +434,19 @@ msgstr "" "運行環境字串,例如瀏覽器使用者代理 (browser user agent) ``'Node.js " "v14.18.2'`` 或 ``'UNKNOWN'``。" -#: ../../library/sys.rst:346 +#: ../../library/sys.rst:350 msgid "``True`` if Python is compiled with Emscripten pthreads support." msgstr "" -#: ../../library/sys.rst:350 +#: ../../library/sys.rst:354 msgid "``True`` if Python is compiled with shared memory support." msgstr "" -#: ../../library/sys.rst:352 +#: ../../library/sys.rst:356 msgid ":ref:`Availability `: Emscripten." msgstr ":ref:`適用 `:Emscripten。" -#: ../../library/sys.rst:359 +#: ../../library/sys.rst:363 msgid "" "If this is set (not ``None``), Python will write bytecode-cache ``.pyc`` " "files to (and read them from) a parallel directory tree rooted at this " @@ -451,12 +457,12 @@ msgid "" "with the same pycache prefix (if any) that you will use at runtime." msgstr "" -#: ../../library/sys.rst:367 +#: ../../library/sys.rst:371 msgid "" "A relative path is interpreted relative to the current working directory." msgstr "" -#: ../../library/sys.rst:369 +#: ../../library/sys.rst:373 msgid "" "This value is initially set based on the value of the :option:`-X` " "``pycache_prefix=PATH`` command-line option or the :envvar:" @@ -464,12 +470,12 @@ msgid "" "If neither are set, it is ``None``." msgstr "" -#: ../../library/sys.rst:379 +#: ../../library/sys.rst:383 msgid "" "This function prints out a given traceback and exception to ``sys.stderr``." msgstr "" -#: ../../library/sys.rst:381 +#: ../../library/sys.rst:385 msgid "" "When an exception other than :exc:`SystemExit` is raised and uncaught, the " "interpreter calls ``sys.excepthook`` with three arguments, the exception " @@ -480,7 +486,7 @@ msgid "" "argument function to ``sys.excepthook``." msgstr "" -#: ../../library/sys.rst:388 +#: ../../library/sys.rst:392 msgid "" "Raises an :ref:`auditing event ` ``sys.excepthook`` with arguments " "``hook``, ``type``, ``value``, ``traceback``." @@ -488,7 +494,7 @@ msgstr "" "引發一個附帶引數 ``hook``、``type``、``value``、``traceback`` 的\\ :ref:`稽核" "事件 ` ``sys.excepthook``。" -#: ../../library/sys.rst:390 +#: ../../library/sys.rst:394 msgid "" "Raise an auditing event ``sys.excepthook`` with arguments ``hook``, " "``type``, ``value``, ``traceback`` when an uncaught exception occurs. If no " @@ -498,14 +504,14 @@ msgid "" "excepthook`` will be called." msgstr "" -#: ../../library/sys.rst:399 +#: ../../library/sys.rst:403 msgid "" "The :func:`sys.unraisablehook` function handles unraisable exceptions and " "the :func:`threading.excepthook` function handles exception raised by :func:" "`threading.Thread.run`." msgstr "" -#: ../../library/sys.rst:409 +#: ../../library/sys.rst:413 msgid "" "These objects contain the original values of ``breakpointhook``, " "``displayhook``, ``excepthook``, and ``unraisablehook`` at the start of the " @@ -514,15 +520,15 @@ msgid "" "get replaced with broken or alternative objects." msgstr "" -#: ../../library/sys.rst:415 +#: ../../library/sys.rst:419 msgid "__breakpointhook__" msgstr "__breakpointhook__" -#: ../../library/sys.rst:418 +#: ../../library/sys.rst:422 msgid "__unraisablehook__" msgstr "__unraisablehook__" -#: ../../library/sys.rst:424 +#: ../../library/sys.rst:428 msgid "" "This function, when called while an exception handler is executing (such as " "an ``except`` or ``except*`` clause), returns the exception instance that " @@ -530,11 +536,11 @@ msgid "" "another, only the exception handled by the innermost handler is accessible." msgstr "" -#: ../../library/sys.rst:429 +#: ../../library/sys.rst:433 msgid "If no exception handler is executing, this function returns ``None``." msgstr "" -#: ../../library/sys.rst:436 +#: ../../library/sys.rst:440 msgid "" "This function returns the old-style representation of the handled exception. " "If an exception ``e`` is currently handled (so :func:`exception` would " @@ -545,13 +551,13 @@ msgid "" "stack at the point where the exception last occurred." msgstr "" -#: ../../library/sys.rst:447 +#: ../../library/sys.rst:451 msgid "" "If no exception is being handled anywhere on the stack, this function return " "a tuple containing three ``None`` values." msgstr "" -#: ../../library/sys.rst:450 +#: ../../library/sys.rst:454 msgid "" "The ``type`` and ``traceback`` fields are now derived from the ``value`` " "(the exception instance), so when an exception is modified while it is being " @@ -559,7 +565,7 @@ msgid "" "func:`exc_info`." msgstr "" -#: ../../library/sys.rst:458 +#: ../../library/sys.rst:462 msgid "" "A string giving the site-specific directory prefix where the platform-" "dependent Python files are installed; by default, this is also ``'/usr/" @@ -571,7 +577,7 @@ msgid "" "is the version number of Python, for example ``3.2``." msgstr "" -#: ../../library/sys.rst:469 +#: ../../library/sys.rst:473 msgid "" "If a :ref:`virtual environment ` is in effect, this value will be " "changed in ``site.py`` to point to the virtual environment. The value for " @@ -579,7 +585,7 @@ msgid "" "`base_exec_prefix`." msgstr "" -#: ../../library/sys.rst:477 +#: ../../library/sys.rst:481 msgid "" "A string giving the absolute path of the executable binary for the Python " "interpreter, on systems where this makes sense. If Python is unable to " @@ -587,13 +593,13 @@ msgid "" "empty string or ``None``." msgstr "" -#: ../../library/sys.rst:485 +#: ../../library/sys.rst:489 msgid "" "Raise a :exc:`SystemExit` exception, signaling an intention to exit the " "interpreter." msgstr "" -#: ../../library/sys.rst:487 +#: ../../library/sys.rst:491 msgid "" "The optional argument *arg* can be an integer giving the exit status " "(defaulting to zero), or another type of object. If it is an integer, zero " @@ -609,7 +615,7 @@ msgid "" "way to exit a program when an error occurs." msgstr "" -#: ../../library/sys.rst:500 +#: ../../library/sys.rst:504 msgid "" "Since :func:`exit` ultimately \"only\" raises an exception, it will only " "exit the process when called from the main thread, and the exception is not " @@ -618,113 +624,113 @@ msgid "" "an outer level." msgstr "" -#: ../../library/sys.rst:505 +#: ../../library/sys.rst:509 msgid "" "If an error occurs in the cleanup after the Python interpreter has caught :" "exc:`SystemExit` (such as an error flushing buffered data in the standard " "streams), the exit status is changed to 120." msgstr "" -#: ../../library/sys.rst:513 +#: ../../library/sys.rst:517 msgid "" "The :term:`named tuple` *flags* exposes the status of command line flags. " "The attributes are read only." msgstr "" -#: ../../library/sys.rst:519 +#: ../../library/sys.rst:523 msgid ":option:`-d`" msgstr ":option:`-d`" -#: ../../library/sys.rst:522 ../../library/sys.rst:525 +#: ../../library/sys.rst:526 ../../library/sys.rst:529 msgid ":option:`-i`" msgstr ":option:`-i`" -#: ../../library/sys.rst:528 +#: ../../library/sys.rst:532 msgid ":option:`-I`" msgstr ":option:`-I`" -#: ../../library/sys.rst:531 +#: ../../library/sys.rst:535 msgid ":option:`-O` or :option:`-OO`" msgstr ":option:`-O` 或 :option:`-OO`" -#: ../../library/sys.rst:534 +#: ../../library/sys.rst:538 msgid ":option:`-B`" msgstr ":option:`-B`" -#: ../../library/sys.rst:537 +#: ../../library/sys.rst:541 msgid ":option:`-s`" msgstr ":option:`-s`" -#: ../../library/sys.rst:540 +#: ../../library/sys.rst:544 msgid ":option:`-S`" msgstr ":option:`-S`" -#: ../../library/sys.rst:543 +#: ../../library/sys.rst:547 msgid ":option:`-E`" msgstr ":option:`-E`" -#: ../../library/sys.rst:546 +#: ../../library/sys.rst:550 msgid ":option:`-v`" msgstr ":option:`-v`" -#: ../../library/sys.rst:549 +#: ../../library/sys.rst:553 msgid ":option:`-b`" msgstr ":option:`-b`" -#: ../../library/sys.rst:552 +#: ../../library/sys.rst:556 msgid ":option:`-q`" msgstr ":option:`-q`" -#: ../../library/sys.rst:555 +#: ../../library/sys.rst:559 msgid ":option:`-R`" msgstr ":option:`-R`" -#: ../../library/sys.rst:558 +#: ../../library/sys.rst:562 msgid ":option:`-X dev <-X>` (:ref:`Python Development Mode `)" msgstr ":option:`-X dev <-X>` (:ref:`Python 開發模式 `)" -#: ../../library/sys.rst:561 +#: ../../library/sys.rst:565 msgid ":option:`-X utf8 <-X>`" msgstr ":option:`-X utf8 <-X>`" -#: ../../library/sys.rst:564 +#: ../../library/sys.rst:568 msgid ":option:`-P`" msgstr ":option:`-P`" -#: ../../library/sys.rst:567 +#: ../../library/sys.rst:571 msgid "" ":option:`-X int_max_str_digits <-X>` (:ref:`integer string conversion length " "limitation `)" msgstr "" -#: ../../library/sys.rst:571 +#: ../../library/sys.rst:575 msgid ":option:`-X warn_default_encoding <-X>`" msgstr ":option:`-X warn_default_encoding <-X>`" -#: ../../library/sys.rst:573 +#: ../../library/sys.rst:577 msgid "Added ``quiet`` attribute for the new :option:`-q` flag." msgstr "新增 ``quiet`` 屬性,用於新的 :option:`-q` 旗標。" -#: ../../library/sys.rst:576 +#: ../../library/sys.rst:580 msgid "The ``hash_randomization`` attribute." msgstr "``hash_randomization`` 屬性。" -#: ../../library/sys.rst:579 +#: ../../library/sys.rst:583 msgid "Removed obsolete ``division_warning`` attribute." msgstr "移除過時的 ``division_warning`` 屬性。" -#: ../../library/sys.rst:582 +#: ../../library/sys.rst:586 msgid "Added ``isolated`` attribute for :option:`-I` ``isolated`` flag." msgstr "新增 ``isolated`` 屬性,用於 :option:`-I` ``isolated`` 旗標。" -#: ../../library/sys.rst:585 +#: ../../library/sys.rst:589 msgid "" "Added the ``dev_mode`` attribute for the new :ref:`Python Development Mode " "` and the ``utf8_mode`` attribute for the new :option:`-X` " "``utf8`` flag." msgstr "" -#: ../../library/sys.rst:590 +#: ../../library/sys.rst:594 msgid "" "Added ``warn_default_encoding`` attribute for :option:`-X` " "``warn_default_encoding`` flag." @@ -732,15 +738,15 @@ msgstr "" "新增 ``warn_default_encoding`` 屬性,用於 :option:`-X` " "``warn_default_encoding`` 旗標。" -#: ../../library/sys.rst:593 +#: ../../library/sys.rst:597 msgid "Added the ``safe_path`` attribute for :option:`-P` option." msgstr "新增 ``safe_path`` 屬性,用於 :option:`-P` 選項。" -#: ../../library/sys.rst:596 +#: ../../library/sys.rst:600 msgid "Added the ``int_max_str_digits`` attribute." msgstr "新增 ``int_max_str_digits`` 屬性。" -#: ../../library/sys.rst:602 +#: ../../library/sys.rst:606 msgid "" "A :term:`named tuple` holding information about the float type. It contains " "low level information about the precision and internal representation. The " @@ -750,161 +756,161 @@ msgid "" "floating types', for details." msgstr "" -#: ../../library/sys.rst:609 +#: ../../library/sys.rst:613 msgid "Attributes of the :data:`!float_info` :term:`named tuple`" msgstr "" -#: ../../library/sys.rst:612 +#: ../../library/sys.rst:616 msgid "attribute" msgstr "屬性" -#: ../../library/sys.rst:613 +#: ../../library/sys.rst:617 msgid "float.h macro" msgstr "float.h macro" -#: ../../library/sys.rst:614 +#: ../../library/sys.rst:618 msgid "explanation" msgstr "解釋" -#: ../../library/sys.rst:617 +#: ../../library/sys.rst:621 msgid ":c:macro:`!DBL_EPSILON`" msgstr ":c:macro:`!DBL_EPSILON`" -#: ../../library/sys.rst:618 +#: ../../library/sys.rst:622 msgid "" "difference between 1.0 and the least value greater than 1.0 that is " "representable as a float." msgstr "" -#: ../../library/sys.rst:621 +#: ../../library/sys.rst:625 msgid "See also :func:`math.ulp`." msgstr "另請參閱 :func:`math.ulp`。" -#: ../../library/sys.rst:624 +#: ../../library/sys.rst:628 msgid ":c:macro:`!DBL_DIG`" msgstr ":c:macro:`!DBL_DIG`" -#: ../../library/sys.rst:625 +#: ../../library/sys.rst:629 msgid "" "The maximum number of decimal digits that can be faithfully represented in a " "float; see below." msgstr "" -#: ../../library/sys.rst:629 +#: ../../library/sys.rst:633 msgid ":c:macro:`!DBL_MANT_DIG`" msgstr ":c:macro:`!DBL_MANT_DIG`" -#: ../../library/sys.rst:630 +#: ../../library/sys.rst:634 msgid "" "Float precision: the number of base-``radix`` digits in the significand of a " "float." msgstr "" -#: ../../library/sys.rst:634 +#: ../../library/sys.rst:638 msgid ":c:macro:`!DBL_MAX`" msgstr ":c:macro:`!DBL_MAX`" -#: ../../library/sys.rst:635 +#: ../../library/sys.rst:639 msgid "The maximum representable positive finite float." msgstr "" -#: ../../library/sys.rst:638 +#: ../../library/sys.rst:642 msgid ":c:macro:`!DBL_MAX_EXP`" msgstr ":c:macro:`!DBL_MAX_EXP`" -#: ../../library/sys.rst:639 +#: ../../library/sys.rst:643 msgid "" "The maximum integer *e* such that ``radix**(e-1)`` is a representable finite " "float." msgstr "" -#: ../../library/sys.rst:643 +#: ../../library/sys.rst:647 msgid ":c:macro:`!DBL_MAX_10_EXP`" msgstr ":c:macro:`!DBL_MAX_10_EXP`" -#: ../../library/sys.rst:644 +#: ../../library/sys.rst:648 msgid "" "The maximum integer *e* such that ``10**e`` is in the range of representable " "finite floats." msgstr "" -#: ../../library/sys.rst:648 +#: ../../library/sys.rst:652 msgid ":c:macro:`!DBL_MIN`" msgstr ":c:macro:`!DBL_MIN`" -#: ../../library/sys.rst:649 +#: ../../library/sys.rst:653 msgid "The minimum representable positive *normalized* float." msgstr "" -#: ../../library/sys.rst:651 +#: ../../library/sys.rst:655 msgid "" "Use :func:`math.ulp(0.0) ` to get the smallest positive " "*denormalized* representable float." msgstr "" -#: ../../library/sys.rst:655 +#: ../../library/sys.rst:659 msgid ":c:macro:`!DBL_MIN_EXP`" msgstr ":c:macro:`!DBL_MIN_EXP`" -#: ../../library/sys.rst:656 +#: ../../library/sys.rst:660 msgid "" "The minimum integer *e* such that ``radix**(e-1)`` is a normalized float." msgstr "" -#: ../../library/sys.rst:660 +#: ../../library/sys.rst:664 msgid ":c:macro:`!DBL_MIN_10_EXP`" msgstr ":c:macro:`!DBL_MIN_10_EXP`" -#: ../../library/sys.rst:661 +#: ../../library/sys.rst:665 msgid "The minimum integer *e* such that ``10**e`` is a normalized float." msgstr "" -#: ../../library/sys.rst:664 +#: ../../library/sys.rst:668 msgid ":c:macro:`!FLT_RADIX`" msgstr ":c:macro:`!FLT_RADIX`" -#: ../../library/sys.rst:665 +#: ../../library/sys.rst:669 msgid "The radix of exponent representation." msgstr "" -#: ../../library/sys.rst:668 +#: ../../library/sys.rst:672 msgid ":c:macro:`!FLT_ROUNDS`" msgstr ":c:macro:`!FLT_ROUNDS`" -#: ../../library/sys.rst:669 +#: ../../library/sys.rst:673 msgid "" "An integer representing the rounding mode for floating-point arithmetic. " "This reflects the value of the system :c:macro:`!FLT_ROUNDS` macro at " "interpreter startup time:" msgstr "" -#: ../../library/sys.rst:673 +#: ../../library/sys.rst:677 msgid "``-1``: indeterminable" msgstr "" -#: ../../library/sys.rst:674 +#: ../../library/sys.rst:678 msgid "``0``: toward zero" msgstr "" -#: ../../library/sys.rst:675 +#: ../../library/sys.rst:679 msgid "``1``: to nearest" msgstr "" -#: ../../library/sys.rst:676 +#: ../../library/sys.rst:680 msgid "``2``: toward positive infinity" msgstr "" -#: ../../library/sys.rst:677 +#: ../../library/sys.rst:681 msgid "``3``: toward negative infinity" msgstr "" -#: ../../library/sys.rst:679 +#: ../../library/sys.rst:683 msgid "" "All other values for :c:macro:`!FLT_ROUNDS` characterize implementation-" "defined rounding behavior." msgstr "" -#: ../../library/sys.rst:682 +#: ../../library/sys.rst:686 msgid "" "The attribute :attr:`sys.float_info.dig` needs further explanation. If " "``s`` is any string representing a decimal number with at most :attr:`!sys." @@ -912,13 +918,13 @@ msgid "" "back again will recover a string representing the same decimal value::" msgstr "" -#: ../../library/sys.rst:695 +#: ../../library/sys.rst:699 msgid "" "But for strings with more than :attr:`sys.float_info.dig` significant " "digits, this isn't always true::" msgstr "" -#: ../../library/sys.rst:704 +#: ../../library/sys.rst:708 msgid "" "A string indicating how the :func:`repr` function behaves for floats. If " "the string has value ``'short'`` then for a finite float ``x``, ``repr(x)`` " @@ -928,7 +934,7 @@ msgid "" "same way as it did in versions of Python prior to 3.1." msgstr "" -#: ../../library/sys.rst:717 +#: ../../library/sys.rst:721 msgid "" "Return the number of memory blocks currently allocated by the interpreter, " "regardless of their size. This function is mainly useful for tracking and " @@ -938,42 +944,42 @@ msgid "" "results." msgstr "" -#: ../../library/sys.rst:724 +#: ../../library/sys.rst:728 msgid "" "If a Python build or implementation cannot reasonably compute this " "information, :func:`getallocatedblocks()` is allowed to return 0 instead." msgstr "" -#: ../../library/sys.rst:732 +#: ../../library/sys.rst:736 msgid "Return the number of unicode objects that have been interned." msgstr "" -#: ../../library/sys.rst:739 +#: ../../library/sys.rst:743 msgid "Return the build time API version of Android as an integer." msgstr "" -#: ../../library/sys.rst:741 +#: ../../library/sys.rst:745 msgid ":ref:`Availability `: Android." msgstr ":ref:`適用 `:Android。" -#: ../../library/sys.rst:748 +#: ../../library/sys.rst:752 msgid "" "Return the name of the current default string encoding used by the Unicode " "implementation." msgstr "" -#: ../../library/sys.rst:754 +#: ../../library/sys.rst:758 msgid "" "Return the current value of the flags that are used for :c:func:`dlopen` " "calls. Symbolic names for the flag values can be found in the :mod:`os` " "module (:samp:`RTLD_{xxx}` constants, e.g. :const:`os.RTLD_LAZY`)." msgstr "" -#: ../../library/sys.rst:759 ../../library/sys.rst:1447 +#: ../../library/sys.rst:763 ../../library/sys.rst:1451 msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" -#: ../../library/sys.rst:764 +#: ../../library/sys.rst:768 msgid "" "Get the :term:`filesystem encoding `: " "the encoding used with the :term:`filesystem error handler ` is enabled." msgstr "" -#: ../../library/sys.rst:797 +#: ../../library/sys.rst:801 msgid "" "Get the :term:`filesystem error handler `: the error handler used with the :term:`filesystem encoding " @@ -1028,20 +1034,20 @@ msgid "" "func:`getfilesystemencoding`." msgstr "" -#: ../../library/sys.rst:815 +#: ../../library/sys.rst:819 msgid "" "Returns the current value for the :ref:`integer string conversion length " "limitation `. See also :func:`set_int_max_str_digits`." msgstr "" -#: ../../library/sys.rst:822 +#: ../../library/sys.rst:826 msgid "" "Return the reference count of the *object*. The count returned is generally " "one higher than you might expect, because it includes the (temporary) " "reference as an argument to :func:`getrefcount`." msgstr "" -#: ../../library/sys.rst:826 +#: ../../library/sys.rst:830 msgid "" "Note that the returned value may not actually reflect how many references to " "the object are actually held. For example, some objects are \"immortal\" " @@ -1050,13 +1056,13 @@ msgid "" "other than a value of 0 or 1." msgstr "" -#: ../../library/sys.rst:832 +#: ../../library/sys.rst:836 msgid "" "Immortal objects have very large refcounts that do not match the actual " "number of references to the object." msgstr "" -#: ../../library/sys.rst:838 +#: ../../library/sys.rst:842 msgid "" "Return the current value of the recursion limit, the maximum depth of the " "Python interpreter stack. This limit prevents infinite recursion from " @@ -1064,46 +1070,46 @@ msgid "" "func:`setrecursionlimit`." msgstr "" -#: ../../library/sys.rst:846 +#: ../../library/sys.rst:850 msgid "" "Return the size of an object in bytes. The object can be any type of object. " "All built-in objects will return correct results, but this does not have to " "hold true for third-party extensions as it is implementation specific." msgstr "" -#: ../../library/sys.rst:851 +#: ../../library/sys.rst:855 msgid "" "Only the memory consumption directly attributed to the object is accounted " "for, not the memory consumption of objects it refers to." msgstr "" -#: ../../library/sys.rst:854 +#: ../../library/sys.rst:858 msgid "" "If given, *default* will be returned if the object does not provide means to " "retrieve the size. Otherwise a :exc:`TypeError` will be raised." msgstr "" -#: ../../library/sys.rst:857 +#: ../../library/sys.rst:861 msgid "" ":func:`getsizeof` calls the object's ``__sizeof__`` method and adds an " "additional garbage collector overhead if the object is managed by the " "garbage collector." msgstr "" -#: ../../library/sys.rst:861 +#: ../../library/sys.rst:865 msgid "" "See `recursive sizeof recipe `_ for an example of using :func:`getsizeof` recursively to find the size " "of containers and all their contents." msgstr "" -#: ../../library/sys.rst:867 +#: ../../library/sys.rst:871 msgid "" "Return the interpreter's \"thread switch interval\"; see :func:" "`setswitchinterval`." msgstr "" -#: ../../library/sys.rst:875 +#: ../../library/sys.rst:879 msgid "" "Return a frame object from the call stack. If optional integer *depth* is " "given, return the frame object that many calls below the top of the stack. " @@ -1112,7 +1118,7 @@ msgid "" "stack." msgstr "" -#: ../../library/sys.rst:880 +#: ../../library/sys.rst:884 msgid "" "Raises an :ref:`auditing event ` ``sys._getframe`` with argument " "``frame``." @@ -1120,13 +1126,13 @@ msgstr "" "引發一個附帶引數 ``frame`` 的\\ :ref:`稽核事件 ` ``sys." "_getframe``。" -#: ../../library/sys.rst:884 ../../library/sys.rst:900 +#: ../../library/sys.rst:888 ../../library/sys.rst:904 msgid "" "This function should be used for internal and specialized purposes only. It " "is not guaranteed to exist in all implementations of Python." msgstr "" -#: ../../library/sys.rst:890 +#: ../../library/sys.rst:894 msgid "" "Return the name of a module from the call stack. If optional integer " "*depth* is given, return the module that many calls below the top of the " @@ -1135,7 +1141,7 @@ msgid "" "returning the module at the top of the call stack." msgstr "" -#: ../../library/sys.rst:896 +#: ../../library/sys.rst:900 msgid "" "Raises an :ref:`auditing event ` ``sys._getframemodulename`` with " "argument ``depth``." @@ -1143,15 +1149,15 @@ msgstr "" "引發一個附帶引數 ``depth`` 的\\ :ref:`稽核事件 ` ``sys." "_getframemodulename``。" -#: ../../library/sys.rst:910 +#: ../../library/sys.rst:914 msgid "Get the profiler function as set by :func:`setprofile`." msgstr "" -#: ../../library/sys.rst:919 +#: ../../library/sys.rst:923 msgid "Get the trace function as set by :func:`settrace`." msgstr "" -#: ../../library/sys.rst:923 +#: ../../library/sys.rst:927 msgid "" "The :func:`gettrace` function is intended only for implementing debuggers, " "profilers, coverage tools and the like. Its behavior is part of the " @@ -1159,7 +1165,7 @@ msgid "" "thus may not be available in all Python implementations." msgstr "" -#: ../../library/sys.rst:931 +#: ../../library/sys.rst:935 msgid "" "Return a named tuple describing the Windows version currently running. The " "named elements are *major*, *minor*, *build*, *platform*, *service_pack*, " @@ -1171,54 +1177,54 @@ msgid "" "first 5 elements are retrievable by indexing." msgstr "" -#: ../../library/sys.rst:942 +#: ../../library/sys.rst:946 msgid "*platform* will be ``2`` (VER_PLATFORM_WIN32_NT)." msgstr "" -#: ../../library/sys.rst:944 +#: ../../library/sys.rst:948 msgid "*product_type* may be one of the following values:" msgstr "" -#: ../../library/sys.rst:947 +#: ../../library/sys.rst:951 msgid "Constant" msgstr "" -#: ../../library/sys.rst:947 +#: ../../library/sys.rst:951 msgid "Meaning" msgstr "" -#: ../../library/sys.rst:949 +#: ../../library/sys.rst:953 msgid "``1`` (VER_NT_WORKSTATION)" msgstr "``1`` (VER_NT_WORKSTATION)" -#: ../../library/sys.rst:949 +#: ../../library/sys.rst:953 msgid "The system is a workstation." msgstr "" -#: ../../library/sys.rst:951 +#: ../../library/sys.rst:955 msgid "``2`` (VER_NT_DOMAIN_CONTROLLER)" msgstr "``2`` (VER_NT_DOMAIN_CONTROLLER)" -#: ../../library/sys.rst:951 +#: ../../library/sys.rst:955 msgid "The system is a domain controller." msgstr "" -#: ../../library/sys.rst:954 +#: ../../library/sys.rst:958 msgid "``3`` (VER_NT_SERVER)" msgstr "``3`` (VER_NT_SERVER)" -#: ../../library/sys.rst:954 +#: ../../library/sys.rst:958 msgid "The system is a server, but not a domain controller." msgstr "" -#: ../../library/sys.rst:958 +#: ../../library/sys.rst:962 msgid "" "This function wraps the Win32 :c:func:`!GetVersionEx` function; see the " "Microsoft documentation on :c:func:`!OSVERSIONINFOEX` for more information " "about these fields." msgstr "" -#: ../../library/sys.rst:962 +#: ../../library/sys.rst:966 msgid "" "*platform_version* returns the major version, minor version and build number " "of the current operating system, rather than the version that is being " @@ -1226,24 +1232,24 @@ msgid "" "feature detection." msgstr "" -#: ../../library/sys.rst:968 +#: ../../library/sys.rst:972 msgid "" "*platform_version* derives the version from kernel32.dll which can be of a " "different version than the OS version. Please use :mod:`platform` module for " "achieving accurate OS version." msgstr "" -#: ../../library/sys.rst:974 +#: ../../library/sys.rst:978 msgid "" "Changed to a named tuple and added *service_pack_minor*, " "*service_pack_major*, *suite_mask*, and *product_type*." msgstr "" -#: ../../library/sys.rst:978 +#: ../../library/sys.rst:982 msgid "Added *platform_version*" msgstr "新增 *platform_version*" -#: ../../library/sys.rst:984 +#: ../../library/sys.rst:988 msgid "" "Returns an *asyncgen_hooks* object, which is similar to a :class:" "`~collections.namedtuple` of the form ``(firstiter, finalizer)``, where " @@ -1253,71 +1259,71 @@ msgid "" "loop." msgstr "" -#: ../../library/sys.rst:991 +#: ../../library/sys.rst:995 msgid "See :pep:`525` for more details." msgstr "更多細節請見 :pep:`525`\\ 。" -#: ../../library/sys.rst:995 ../../library/sys.rst:1649 +#: ../../library/sys.rst:999 ../../library/sys.rst:1662 msgid "" "This function has been added on a provisional basis (see :pep:`411` for " "details.)" msgstr "" -#: ../../library/sys.rst:1001 +#: ../../library/sys.rst:1005 msgid "" "Get the current coroutine origin tracking depth, as set by :func:" "`set_coroutine_origin_tracking_depth`." msgstr "" -#: ../../library/sys.rst:1007 ../../library/sys.rst:1670 +#: ../../library/sys.rst:1011 ../../library/sys.rst:1683 msgid "" "This function has been added on a provisional basis (see :pep:`411` for " "details.) Use it only for debugging purposes." msgstr "" -#: ../../library/sys.rst:1013 +#: ../../library/sys.rst:1017 msgid "" "A :term:`named tuple` giving parameters of the numeric hash implementation. " "For more details about hashing of numeric types, see :ref:`numeric-hash`." msgstr "" -#: ../../library/sys.rst:1019 +#: ../../library/sys.rst:1023 msgid "The width in bits used for hash values" msgstr "" -#: ../../library/sys.rst:1023 +#: ../../library/sys.rst:1027 msgid "The prime modulus P used for numeric hash scheme" msgstr "" -#: ../../library/sys.rst:1027 +#: ../../library/sys.rst:1031 msgid "The hash value returned for a positive infinity" msgstr "" -#: ../../library/sys.rst:1031 +#: ../../library/sys.rst:1035 msgid "(This attribute is no longer used)" msgstr "" -#: ../../library/sys.rst:1035 +#: ../../library/sys.rst:1039 msgid "The multiplier used for the imaginary part of a complex number" msgstr "" -#: ../../library/sys.rst:1039 +#: ../../library/sys.rst:1043 msgid "The name of the algorithm for hashing of str, bytes, and memoryview" msgstr "" -#: ../../library/sys.rst:1043 +#: ../../library/sys.rst:1047 msgid "The internal output size of the hash algorithm" msgstr "" -#: ../../library/sys.rst:1047 +#: ../../library/sys.rst:1051 msgid "The size of the seed key of the hash algorithm" msgstr "" -#: ../../library/sys.rst:1051 +#: ../../library/sys.rst:1055 msgid "Added *algorithm*, *hash_bits* and *seed_bits*" msgstr "新增 *algorithm*\\ 、\\ *hash_bits* 與 *seed_bits*" -#: ../../library/sys.rst:1057 +#: ../../library/sys.rst:1061 msgid "" "The version number encoded as a single integer. This is guaranteed to " "increase with each version, including proper support for non-production " @@ -1325,7 +1331,7 @@ msgid "" "version 1.5.2, use::" msgstr "" -#: ../../library/sys.rst:1068 +#: ../../library/sys.rst:1072 msgid "" "This is called ``hexversion`` since it only really looks meaningful when " "viewed as the result of passing it to the built-in :func:`hex` function. " @@ -1333,25 +1339,25 @@ msgid "" "human-friendly encoding of the same information." msgstr "" -#: ../../library/sys.rst:1073 +#: ../../library/sys.rst:1077 msgid "More details of ``hexversion`` can be found at :ref:`apiabiversion`." msgstr "" -#: ../../library/sys.rst:1078 +#: ../../library/sys.rst:1082 msgid "" "An object containing information about the implementation of the currently " "running Python interpreter. The following attributes are required to exist " "in all Python implementations." msgstr "" -#: ../../library/sys.rst:1082 +#: ../../library/sys.rst:1086 msgid "" "*name* is the implementation's identifier, e.g. ``'cpython'``. The actual " "string is defined by the Python implementation, but it is guaranteed to be " "lower case." msgstr "" -#: ../../library/sys.rst:1086 +#: ../../library/sys.rst:1090 msgid "" "*version* is a named tuple, in the same format as :data:`sys.version_info`. " "It represents the version of the Python *implementation*. This has a " @@ -1363,13 +1369,13 @@ msgid "" "the same value, since it is the reference implementation." msgstr "" -#: ../../library/sys.rst:1096 +#: ../../library/sys.rst:1100 msgid "" "*hexversion* is the implementation version in hexadecimal format, like :data:" "`sys.hexversion`." msgstr "" -#: ../../library/sys.rst:1099 +#: ../../library/sys.rst:1103 msgid "" "*cache_tag* is the tag used by the import machinery in the filenames of " "cached modules. By convention, it would be a composite of the " @@ -1378,7 +1384,7 @@ msgid "" "set to ``None``, it indicates that module caching should be disabled." msgstr "" -#: ../../library/sys.rst:1106 +#: ../../library/sys.rst:1110 msgid "" ":data:`sys.implementation` may contain additional attributes specific to the " "Python implementation. These non-standard attributes must start with an " @@ -1388,41 +1394,41 @@ msgid "" "versions, however.) See :pep:`421` for more information." msgstr "" -#: ../../library/sys.rst:1117 +#: ../../library/sys.rst:1121 msgid "" "The addition of new required attributes must go through the normal PEP " "process. See :pep:`421` for more information." msgstr "" -#: ../../library/sys.rst:1122 +#: ../../library/sys.rst:1126 msgid "" "A :term:`named tuple` that holds information about Python's internal " "representation of integers. The attributes are read only." msgstr "" -#: ../../library/sys.rst:1127 +#: ../../library/sys.rst:1131 msgid "" "The number of bits held in each digit. Python integers are stored internally " "in base ``2**int_info.bits_per_digit``." msgstr "" -#: ../../library/sys.rst:1132 +#: ../../library/sys.rst:1136 msgid "The size in bytes of the C type used to represent a digit." msgstr "" -#: ../../library/sys.rst:1136 +#: ../../library/sys.rst:1140 msgid "" "The default value for :func:`sys.get_int_max_str_digits` when it is not " "otherwise explicitly configured." msgstr "" -#: ../../library/sys.rst:1141 +#: ../../library/sys.rst:1145 msgid "" "The minimum non-zero value for :func:`sys.set_int_max_str_digits`, :envvar:" "`PYTHONINTMAXSTRDIGITS`, or :option:`-X int_max_str_digits <-X>`." msgstr "" -#: ../../library/sys.rst:1148 +#: ../../library/sys.rst:1152 msgid "" "Added :attr:`~int_info.default_max_str_digits` and :attr:`~int_info." "str_digits_check_threshold`." @@ -1430,7 +1436,7 @@ msgstr "" "新增 :attr:`~int_info.default_max_str_digits` 和 :attr:`~int_info." "str_digits_check_threshold`。" -#: ../../library/sys.rst:1154 +#: ../../library/sys.rst:1158 msgid "" "When this attribute exists, its value is automatically called (with no " "arguments) when the interpreter is launched in :ref:`interactive mode `." msgstr "" -#: ../../library/sys.rst:1160 +#: ../../library/sys.rst:1164 msgid "" "Raises an :ref:`auditing event ` ``cpython.run_interactivehook`` " "with argument ``hook``." @@ -1447,13 +1453,13 @@ msgstr "" "引發一個附帶引數 ``hook`` 的\\ :ref:`稽核事件 ` ``cpython." "run_interactivehook``。" -#: ../../library/sys.rst:1162 +#: ../../library/sys.rst:1166 msgid "" "Raises an :ref:`auditing event ` ``cpython.run_interactivehook`` " "with the hook object as the argument when the hook is called on startup." msgstr "" -#: ../../library/sys.rst:1171 +#: ../../library/sys.rst:1175 msgid "" "Enter *string* in the table of \"interned\" strings and return the interned " "string -- which is *string* itself or a copy. Interning strings is useful to " @@ -1465,19 +1471,19 @@ msgid "" "attributes have interned keys." msgstr "" -#: ../../library/sys.rst:1179 +#: ../../library/sys.rst:1183 msgid "" "Interned strings are not immortal; you must keep a reference to the return " "value of :func:`intern` around to benefit from it." msgstr "" -#: ../../library/sys.rst:1185 +#: ../../library/sys.rst:1189 msgid "" "Return :const:`True` if the Python interpreter is :term:`shutting down " "`, :const:`False` otherwise." msgstr "" -#: ../../library/sys.rst:1192 +#: ../../library/sys.rst:1196 msgid "" "This variable is not always defined; it is set to the exception instance " "when an exception is not handled and the interpreter prints an error message " @@ -1488,34 +1494,34 @@ msgid "" "more information.)" msgstr "" -#: ../../library/sys.rst:1206 +#: ../../library/sys.rst:1210 msgid "" "These three variables are deprecated; use :data:`sys.last_exc` instead. They " "hold the legacy representation of ``sys.last_exc``, as returned from :func:" "`exc_info` above." msgstr "" -#: ../../library/sys.rst:1212 +#: ../../library/sys.rst:1216 msgid "" "An integer giving the maximum value a variable of type :c:type:`Py_ssize_t` " "can take. It's usually ``2**31 - 1`` on a 32-bit platform and ``2**63 - 1`` " "on a 64-bit platform." msgstr "" -#: ../../library/sys.rst:1219 +#: ../../library/sys.rst:1223 msgid "" "An integer giving the value of the largest Unicode code point, i.e. " "``1114111`` (``0x10FFFF`` in hexadecimal)." msgstr "" -#: ../../library/sys.rst:1222 +#: ../../library/sys.rst:1226 msgid "" "Before :pep:`393`, ``sys.maxunicode`` used to be either ``0xFFFF`` or " "``0x10FFFF``, depending on the configuration option that specified whether " "Unicode characters were stored as UCS-2 or UCS-4." msgstr "" -#: ../../library/sys.rst:1230 +#: ../../library/sys.rst:1234 msgid "" "A list of :term:`meta path finder` objects that have their :meth:`~importlib." "abc.MetaPathFinder.find_spec` methods called to see if one of the objects " @@ -1528,27 +1534,27 @@ msgid "" "if the module cannot be found." msgstr "" -#: ../../library/sys.rst:1243 +#: ../../library/sys.rst:1247 msgid ":class:`importlib.abc.MetaPathFinder`" msgstr ":class:`importlib.abc.MetaPathFinder`" -#: ../../library/sys.rst:1243 +#: ../../library/sys.rst:1247 msgid "" "The abstract base class defining the interface of finder objects on :data:" "`meta_path`." msgstr "" -#: ../../library/sys.rst:1247 +#: ../../library/sys.rst:1251 msgid ":class:`importlib.machinery.ModuleSpec`" msgstr ":class:`importlib.machinery.ModuleSpec`" -#: ../../library/sys.rst:1246 +#: ../../library/sys.rst:1250 msgid "" "The concrete class which :meth:`~importlib.abc.MetaPathFinder.find_spec` " "should return instances of." msgstr "" -#: ../../library/sys.rst:1252 +#: ../../library/sys.rst:1256 msgid "" ":term:`Module specs ` were introduced in Python 3.4, by :pep:" "`451`. Earlier versions of Python looked for a method called :meth:`!" @@ -1556,7 +1562,7 @@ msgid "" "entry doesn't have a :meth:`~importlib.abc.MetaPathFinder.find_spec` method." msgstr "" -#: ../../library/sys.rst:1260 +#: ../../library/sys.rst:1264 msgid "" "This is a dictionary that maps module names to modules which have already " "been loaded. This can be manipulated to force reloading of modules and " @@ -1568,78 +1574,78 @@ msgid "" "other threads." msgstr "" -#: ../../library/sys.rst:1272 +#: ../../library/sys.rst:1276 msgid "" "The list of the original command line arguments passed to the Python " "executable." msgstr "" -#: ../../library/sys.rst:1275 +#: ../../library/sys.rst:1279 msgid "See also :data:`sys.argv`." msgstr "另請參閱 :data:`sys.argv`\\ 。" -#: ../../library/sys.rst:1284 +#: ../../library/sys.rst:1288 msgid "" "A list of strings that specifies the search path for modules. Initialized " "from the environment variable :envvar:`PYTHONPATH`, plus an installation-" "dependent default." msgstr "" -#: ../../library/sys.rst:1288 +#: ../../library/sys.rst:1292 msgid "" "By default, as initialized upon program startup, a potentially unsafe path " "is prepended to :data:`sys.path` (*before* the entries inserted as a result " "of :envvar:`PYTHONPATH`):" msgstr "" -#: ../../library/sys.rst:1292 +#: ../../library/sys.rst:1296 msgid "" "``python -m module`` command line: prepend the current working directory." msgstr "" -#: ../../library/sys.rst:1294 +#: ../../library/sys.rst:1298 msgid "" "``python script.py`` command line: prepend the script's directory. If it's a " "symbolic link, resolve symbolic links." msgstr "" -#: ../../library/sys.rst:1296 +#: ../../library/sys.rst:1300 msgid "" "``python -c code`` and ``python`` (REPL) command lines: prepend an empty " "string, which means the current working directory." msgstr "" -#: ../../library/sys.rst:1299 +#: ../../library/sys.rst:1303 msgid "" "To not prepend this potentially unsafe path, use the :option:`-P` command " "line option or the :envvar:`PYTHONSAFEPATH` environment variable." msgstr "" -#: ../../library/sys.rst:1302 +#: ../../library/sys.rst:1306 msgid "" "A program is free to modify this list for its own purposes. Only strings " "should be added to :data:`sys.path`; all other data types are ignored during " "import." msgstr "" -#: ../../library/sys.rst:1308 +#: ../../library/sys.rst:1312 msgid "" "Module :mod:`site` This describes how to use .pth files to extend :data:`sys." "path`." msgstr "" -#: ../../library/sys.rst:1313 +#: ../../library/sys.rst:1317 msgid "" "A list of callables that take a path argument to try to create a :term:" "`finder` for the path. If a finder can be created, it is to be returned by " "the callable, else raise :exc:`ImportError`." msgstr "" -#: ../../library/sys.rst:1317 ../../library/sys.rst:1328 +#: ../../library/sys.rst:1321 ../../library/sys.rst:1332 msgid "Originally specified in :pep:`302`." msgstr "" -#: ../../library/sys.rst:1322 +#: ../../library/sys.rst:1326 msgid "" "A dictionary acting as a cache for :term:`finder` objects. The keys are " "paths that have been passed to :data:`sys.path_hooks` and the values are the " @@ -1647,13 +1653,13 @@ msgid "" "is found on :data:`sys.path_hooks` then ``None`` is stored." msgstr "" -#: ../../library/sys.rst:1333 +#: ../../library/sys.rst:1337 msgid "" "This string contains a platform identifier that can be used to append " "platform-specific components to :data:`sys.path`, for instance." msgstr "" -#: ../../library/sys.rst:1336 +#: ../../library/sys.rst:1340 msgid "" "For Unix systems, except on Linux and AIX, this is the lowercased OS name as " "returned by ``uname -s`` with the first part of the version as returned by " @@ -1662,75 +1668,75 @@ msgid "" "version, it is therefore recommended to use the following idiom::" msgstr "" -#: ../../library/sys.rst:1349 +#: ../../library/sys.rst:1353 msgid "For other systems, the values are:" msgstr "" -#: ../../library/sys.rst:1352 +#: ../../library/sys.rst:1356 msgid "System" msgstr "" -#: ../../library/sys.rst:1352 +#: ../../library/sys.rst:1356 msgid "``platform`` value" msgstr "" -#: ../../library/sys.rst:1354 +#: ../../library/sys.rst:1358 msgid "AIX" msgstr "AIX" -#: ../../library/sys.rst:1354 +#: ../../library/sys.rst:1358 msgid "``'aix'``" msgstr "``'aix'``" -#: ../../library/sys.rst:1355 +#: ../../library/sys.rst:1359 msgid "Emscripten" msgstr "Emscripten" -#: ../../library/sys.rst:1355 +#: ../../library/sys.rst:1359 msgid "``'emscripten'``" msgstr "``'emscripten'``" -#: ../../library/sys.rst:1356 +#: ../../library/sys.rst:1360 msgid "Linux" msgstr "Linux" -#: ../../library/sys.rst:1356 +#: ../../library/sys.rst:1360 msgid "``'linux'``" msgstr "``'linux'``" -#: ../../library/sys.rst:1357 +#: ../../library/sys.rst:1361 msgid "WASI" msgstr "WASI" -#: ../../library/sys.rst:1357 +#: ../../library/sys.rst:1361 msgid "``'wasi'``" msgstr "``'wasi'``" -#: ../../library/sys.rst:1358 +#: ../../library/sys.rst:1362 msgid "Windows" msgstr "Windows" -#: ../../library/sys.rst:1358 +#: ../../library/sys.rst:1362 msgid "``'win32'``" msgstr "``'win32'``" -#: ../../library/sys.rst:1359 +#: ../../library/sys.rst:1363 msgid "Windows/Cygwin" msgstr "Windows/Cygwin" -#: ../../library/sys.rst:1359 +#: ../../library/sys.rst:1363 msgid "``'cygwin'``" msgstr "``'cygwin'``" -#: ../../library/sys.rst:1360 +#: ../../library/sys.rst:1364 msgid "macOS" msgstr "macOS" -#: ../../library/sys.rst:1360 +#: ../../library/sys.rst:1364 msgid "``'darwin'``" msgstr "``'darwin'``" -#: ../../library/sys.rst:1363 +#: ../../library/sys.rst:1367 msgid "" "On Linux, :data:`sys.platform` doesn't contain the major version anymore. It " "is always ``'linux'``, instead of ``'linux2'`` or ``'linux3'``. Since older " @@ -1738,7 +1744,7 @@ msgid "" "the ``startswith`` idiom presented above." msgstr "" -#: ../../library/sys.rst:1369 +#: ../../library/sys.rst:1373 msgid "" "On AIX, :data:`sys.platform` doesn't contain the major version anymore. It " "is always ``'aix'``, instead of ``'aix5'`` or ``'aix7'``. Since older " @@ -1746,57 +1752,57 @@ msgid "" "the ``startswith`` idiom presented above." msgstr "" -#: ../../library/sys.rst:1377 +#: ../../library/sys.rst:1381 msgid "" ":data:`os.name` has a coarser granularity. :func:`os.uname` gives system-" "dependent version information." msgstr "" -#: ../../library/sys.rst:1380 +#: ../../library/sys.rst:1384 msgid "" "The :mod:`platform` module provides detailed checks for the system's " "identity." msgstr "" -#: ../../library/sys.rst:1386 +#: ../../library/sys.rst:1390 msgid "" "Name of the platform-specific library directory. It is used to build the " "path of standard library and the paths of installed extension modules." msgstr "" -#: ../../library/sys.rst:1389 +#: ../../library/sys.rst:1393 msgid "" "It is equal to ``\"lib\"`` on most platforms. On Fedora and SuSE, it is " "equal to ``\"lib64\"`` on 64-bit platforms which gives the following ``sys." "path`` paths (where ``X.Y`` is the Python ``major.minor`` version):" msgstr "" -#: ../../library/sys.rst:1393 +#: ../../library/sys.rst:1397 msgid "" "``/usr/lib64/pythonX.Y/``: Standard library (like ``os.py`` of the :mod:`os` " "module)" msgstr "" -#: ../../library/sys.rst:1395 +#: ../../library/sys.rst:1399 msgid "" "``/usr/lib64/pythonX.Y/lib-dynload/``: C extension modules of the standard " "library (like the :mod:`errno` module, the exact filename is platform " "specific)" msgstr "" -#: ../../library/sys.rst:1398 +#: ../../library/sys.rst:1402 msgid "" "``/usr/lib/pythonX.Y/site-packages/`` (always use ``lib``, not :data:`sys." "platlibdir`): Third-party modules" msgstr "" -#: ../../library/sys.rst:1400 +#: ../../library/sys.rst:1404 msgid "" "``/usr/lib64/pythonX.Y/site-packages/``: C extension modules of third-party " "packages" msgstr "" -#: ../../library/sys.rst:1408 +#: ../../library/sys.rst:1412 msgid "" "A string giving the site-specific directory prefix where the platform " "independent Python files are installed; on Unix, the default is :file:`/usr/" @@ -1805,14 +1811,14 @@ msgid "" "derived paths." msgstr "" -#: ../../library/sys.rst:1414 +#: ../../library/sys.rst:1418 msgid "" "If a :ref:`virtual environment ` is in effect, this value will be " "changed in ``site.py`` to point to the virtual environment. The value for " "the Python installation will still be available, via :data:`base_prefix`." msgstr "" -#: ../../library/sys.rst:1429 +#: ../../library/sys.rst:1433 msgid "" "Strings specifying the primary and secondary prompt of the interpreter. " "These are only defined if the interpreter is in interactive mode. Their " @@ -1822,7 +1828,7 @@ msgid "" "used to implement a dynamic prompt." msgstr "" -#: ../../library/sys.rst:1439 +#: ../../library/sys.rst:1443 msgid "" "Set the flags used by the interpreter for :c:func:`dlopen` calls, such as " "when the interpreter loads extension modules. Among other things, this will " @@ -1833,14 +1839,14 @@ msgid "" "g. :const:`os.RTLD_LAZY`)." msgstr "" -#: ../../library/sys.rst:1451 +#: ../../library/sys.rst:1455 msgid "" "Set the :ref:`integer string conversion length limitation " "` used by this interpreter. See also :func:" "`get_int_max_str_digits`." msgstr "" -#: ../../library/sys.rst:1463 +#: ../../library/sys.rst:1467 msgid "" "Set the system's profile function, which allows you to implement a Python " "source code profiler in Python. See chapter :ref:`profile` for more " @@ -1855,7 +1861,14 @@ msgid "" "in the profile function will cause itself unset." msgstr "" -#: ../../library/sys.rst:1474 +#: ../../library/sys.rst:1479 +msgid "" +"The same tracing mechanism is used for :func:`!setprofile` as :func:" +"`settrace`. To trace calls with :func:`!setprofile` inside a tracing " +"function (e.g. in a debugger breakpoint), see :func:`call_tracing`." +msgstr "" + +#: ../../library/sys.rst:1483 msgid "" "Profile functions should have three arguments: *frame*, *event*, and *arg*. " "*frame* is the current stack frame. *event* is a string: ``'call'``, " @@ -1863,71 +1876,71 @@ msgid "" "depends on the event type." msgstr "" -#: ../../library/sys.rst:1479 -msgid "" -"Raises an :ref:`auditing event ` ``sys.setprofile`` with no " -"arguments." -msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys.setprofile``。" - -#: ../../library/sys.rst:1481 ../../library/sys.rst:1562 +#: ../../library/sys.rst:1488 ../../library/sys.rst:1575 msgid "The events have the following meaning:" msgstr "" -#: ../../library/sys.rst:1485 ../../library/sys.rst:1567 +#: ../../library/sys.rst:1492 ../../library/sys.rst:1580 msgid "``'call'``" msgstr "``'call'``" -#: ../../library/sys.rst:1484 +#: ../../library/sys.rst:1491 msgid "" "A function is called (or some other code block entered). The profile " "function is called; *arg* is ``None``." msgstr "" -#: ../../library/sys.rst:1490 ../../library/sys.rst:1582 +#: ../../library/sys.rst:1497 ../../library/sys.rst:1595 msgid "``'return'``" msgstr "``'return'``" -#: ../../library/sys.rst:1488 +#: ../../library/sys.rst:1495 msgid "" "A function (or other code block) is about to return. The profile function " "is called; *arg* is the value that will be returned, or ``None`` if the " "event is caused by an exception being raised." msgstr "" -#: ../../library/sys.rst:1494 +#: ../../library/sys.rst:1501 msgid "``'c_call'``" msgstr "``'c_call'``" -#: ../../library/sys.rst:1493 +#: ../../library/sys.rst:1500 msgid "" "A C function is about to be called. This may be an extension function or a " "built-in. *arg* is the C function object." msgstr "" -#: ../../library/sys.rst:1497 +#: ../../library/sys.rst:1504 msgid "``'c_return'``" msgstr "``'c_return'``" -#: ../../library/sys.rst:1497 +#: ../../library/sys.rst:1504 msgid "A C function has returned. *arg* is the C function object." msgstr "" -#: ../../library/sys.rst:1499 +#: ../../library/sys.rst:1507 msgid "``'c_exception'``" msgstr "``'c_exception'``" -#: ../../library/sys.rst:1500 +#: ../../library/sys.rst:1507 msgid "A C function has raised an exception. *arg* is the C function object." msgstr "" -#: ../../library/sys.rst:1504 +#: ../../library/sys.rst:1509 +msgid "" +"Raises an :ref:`auditing event ` ``sys.setprofile`` with no " +"arguments." +msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys.setprofile``。" + +#: ../../library/sys.rst:1514 msgid "" "Set the maximum depth of the Python interpreter stack to *limit*. This " "limit prevents infinite recursion from causing an overflow of the C stack " "and crashing Python." msgstr "" -#: ../../library/sys.rst:1508 +#: ../../library/sys.rst:1518 msgid "" "The highest possible limit is platform-dependent. A user may need to set " "the limit higher when they have a program that requires deep recursion and a " @@ -1935,19 +1948,19 @@ msgid "" "because a too-high limit can lead to a crash." msgstr "" -#: ../../library/sys.rst:1513 +#: ../../library/sys.rst:1523 msgid "" "If the new limit is too low at the current recursion depth, a :exc:" "`RecursionError` exception is raised." msgstr "" -#: ../../library/sys.rst:1516 +#: ../../library/sys.rst:1526 msgid "" "A :exc:`RecursionError` exception is now raised if the new limit is too low " "at the current recursion depth." msgstr "" -#: ../../library/sys.rst:1523 +#: ../../library/sys.rst:1533 msgid "" "Set the interpreter's thread switch interval (in seconds). This floating-" "point value determines the ideal duration of the \"timeslices\" allocated to " @@ -1958,7 +1971,7 @@ msgid "" "scheduler." msgstr "" -#: ../../library/sys.rst:1540 +#: ../../library/sys.rst:1550 msgid "" "Set the system's trace function, which allows you to implement a Python " "source code debugger in Python. The function is thread-specific; for a " @@ -1967,7 +1980,7 @@ msgid "" "`threading.settrace`." msgstr "" -#: ../../library/sys.rst:1545 +#: ../../library/sys.rst:1555 msgid "" "Trace functions should have three arguments: *frame*, *event*, and *arg*. " "*frame* is the current stack frame. *event* is a string: ``'call'``, " @@ -1975,7 +1988,7 @@ msgid "" "the event type." msgstr "" -#: ../../library/sys.rst:1550 +#: ../../library/sys.rst:1560 msgid "" "The trace function is invoked (with *event* set to ``'call'``) whenever a " "new local scope is entered; it should return a reference to a local trace " @@ -1983,31 +1996,36 @@ msgid "" "traced." msgstr "" -#: ../../library/sys.rst:1555 +#: ../../library/sys.rst:1565 msgid "" -"The local trace function should return a reference to itself (or to another " -"function for further tracing in that scope), or ``None`` to turn off tracing " -"in that scope." +"The local trace function should return a reference to itself, or to another " +"function which would then be used as the local trace function for the scope." msgstr "" -#: ../../library/sys.rst:1559 +#: ../../library/sys.rst:1568 msgid "" "If there is any error occurred in the trace function, it will be unset, just " "like ``settrace(None)`` is called." msgstr "" -#: ../../library/sys.rst:1565 +#: ../../library/sys.rst:1572 +msgid "" +"Tracing is disabled while calling the trace function (e.g. a function set " +"by :func:`!settrace`). For recursive tracing see :func:`call_tracing`." +msgstr "" + +#: ../../library/sys.rst:1578 msgid "" "A function is called (or some other code block entered). The global trace " "function is called; *arg* is ``None``; the return value specifies the local " "trace function." msgstr "" -#: ../../library/sys.rst:1576 +#: ../../library/sys.rst:1589 msgid "``'line'``" msgstr "``'line'``" -#: ../../library/sys.rst:1570 +#: ../../library/sys.rst:1583 msgid "" "The interpreter is about to execute a new line of code or re-execute the " "condition of a loop. The local trace function is called; *arg* is ``None``; " @@ -2017,7 +2035,7 @@ msgid "" "const:`False` on that :ref:`frame `." msgstr "" -#: ../../library/sys.rst:1579 +#: ../../library/sys.rst:1592 msgid "" "A function (or other code block) is about to return. The local trace " "function is called; *arg* is the value that will be returned, or ``None`` if " @@ -2025,22 +2043,22 @@ msgid "" "return value is ignored." msgstr "" -#: ../../library/sys.rst:1587 +#: ../../library/sys.rst:1600 msgid "``'exception'``" msgstr "``'exception'``" -#: ../../library/sys.rst:1585 +#: ../../library/sys.rst:1598 msgid "" "An exception has occurred. The local trace function is called; *arg* is a " "tuple ``(exception, value, traceback)``; the return value specifies the new " "local trace function." msgstr "" -#: ../../library/sys.rst:1595 +#: ../../library/sys.rst:1608 msgid "``'opcode'``" msgstr "``'opcode'``" -#: ../../library/sys.rst:1590 +#: ../../library/sys.rst:1603 msgid "" "The interpreter is about to execute a new opcode (see :mod:`dis` for opcode " "details). The local trace function is called; *arg* is ``None``; the return " @@ -2049,13 +2067,13 @@ msgid "" "f_trace_opcodes` to :const:`True` on the :ref:`frame `." msgstr "" -#: ../../library/sys.rst:1597 +#: ../../library/sys.rst:1610 msgid "" "Note that as an exception is propagated down the chain of callers, an " "``'exception'`` event is generated at each level." msgstr "" -#: ../../library/sys.rst:1600 +#: ../../library/sys.rst:1613 msgid "" "For more fine-grained usage, it's possible to set a trace function by " "assigning ``frame.f_trace = tracefunc`` explicitly, rather than relying on " @@ -2069,17 +2087,17 @@ msgid "" "on each frame)." msgstr "" -#: ../../library/sys.rst:1611 +#: ../../library/sys.rst:1624 msgid "For more information on code and frame objects, refer to :ref:`types`." msgstr "" -#: ../../library/sys.rst:1613 +#: ../../library/sys.rst:1626 msgid "" "Raises an :ref:`auditing event ` ``sys.settrace`` with no " "arguments." msgstr "" -#: ../../library/sys.rst:1617 +#: ../../library/sys.rst:1630 msgid "" "The :func:`settrace` function is intended only for implementing debuggers, " "profilers, coverage tools and the like. Its behavior is part of the " @@ -2087,13 +2105,13 @@ msgid "" "thus may not be available in all Python implementations." msgstr "" -#: ../../library/sys.rst:1624 +#: ../../library/sys.rst:1637 msgid "" "``'opcode'`` event type added; :attr:`!f_trace_lines` and :attr:`!" "f_trace_opcodes` attributes added to frames" msgstr "" -#: ../../library/sys.rst:1629 +#: ../../library/sys.rst:1642 msgid "" "Accepts two optional keyword arguments which are callables that accept an :" "term:`asynchronous generator iterator` as an argument. The *firstiter* " @@ -2102,7 +2120,7 @@ msgid "" "about to be garbage collected." msgstr "" -#: ../../library/sys.rst:1635 +#: ../../library/sys.rst:1648 msgid "" "Raises an :ref:`auditing event ` ``sys." "set_asyncgen_hooks_firstiter`` with no arguments." @@ -2110,7 +2128,7 @@ msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys." "set_asyncgen_hooks_firstiter``。" -#: ../../library/sys.rst:1637 +#: ../../library/sys.rst:1650 msgid "" "Raises an :ref:`auditing event ` ``sys." "set_asyncgen_hooks_finalizer`` with no arguments." @@ -2118,20 +2136,20 @@ msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys." "set_asyncgen_hooks_finalizer``。" -#: ../../library/sys.rst:1639 +#: ../../library/sys.rst:1652 msgid "" "Two auditing events are raised because the underlying API consists of two " "calls, each of which must raise its own event." msgstr "" -#: ../../library/sys.rst:1642 +#: ../../library/sys.rst:1655 msgid "" "See :pep:`525` for more details, and for a reference example of a " "*finalizer* method see the implementation of ``asyncio.Loop." "shutdown_asyncgens`` in :source:`Lib/asyncio/base_events.py`" msgstr "" -#: ../../library/sys.rst:1654 +#: ../../library/sys.rst:1667 msgid "" "Allows enabling or disabling coroutine origin tracking. When enabled, the " "``cr_origin`` attribute on coroutine objects will contain a tuple of " @@ -2140,105 +2158,105 @@ msgid "" "disabled, ``cr_origin`` will be None." msgstr "" -#: ../../library/sys.rst:1661 +#: ../../library/sys.rst:1674 msgid "" "To enable, pass a *depth* value greater than zero; this sets the number of " "frames whose information will be captured. To disable, pass set *depth* to " "zero." msgstr "" -#: ../../library/sys.rst:1665 +#: ../../library/sys.rst:1678 msgid "This setting is thread-specific." msgstr "" -#: ../../library/sys.rst:1675 +#: ../../library/sys.rst:1688 msgid "" "Activate the stack profiler trampoline *backend*. The only supported backend " "is ``\"perf\"``." msgstr "" -#: ../../library/sys.rst:1678 ../../library/sys.rst:1693 -#: ../../library/sys.rst:1701 +#: ../../library/sys.rst:1691 ../../library/sys.rst:1706 +#: ../../library/sys.rst:1714 msgid ":ref:`Availability `: Linux." msgstr ":ref:`適用 `:Linux。" -#: ../../library/sys.rst:1684 +#: ../../library/sys.rst:1697 msgid ":ref:`perf_profiling`" msgstr "" -#: ../../library/sys.rst:1685 +#: ../../library/sys.rst:1698 msgid "https://perf.wiki.kernel.org" msgstr "" -#: ../../library/sys.rst:1689 +#: ../../library/sys.rst:1702 msgid "Deactivate the current stack profiler trampoline backend." msgstr "" -#: ../../library/sys.rst:1691 +#: ../../library/sys.rst:1704 msgid "If no stack profiler is activated, this function has no effect." msgstr "" -#: ../../library/sys.rst:1699 +#: ../../library/sys.rst:1712 msgid "Return ``True`` if a stack profiler trampoline is active." msgstr "" -#: ../../library/sys.rst:1707 +#: ../../library/sys.rst:1720 msgid "" "Changes the :term:`filesystem encoding and error handler` to 'mbcs' and " "'replace' respectively, for consistency with versions of Python prior to 3.6." msgstr "" -#: ../../library/sys.rst:1711 +#: ../../library/sys.rst:1724 msgid "" "This is equivalent to defining the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` " "environment variable before launching Python." msgstr "" -#: ../../library/sys.rst:1714 +#: ../../library/sys.rst:1727 msgid "" "See also :func:`sys.getfilesystemencoding` and :func:`sys." "getfilesystemencodeerrors`." msgstr "" -#: ../../library/sys.rst:1719 +#: ../../library/sys.rst:1732 msgid "See :pep:`529` for more details." msgstr "更多細節請見 :pep:`529`\\ 。" -#: ../../library/sys.rst:1726 +#: ../../library/sys.rst:1739 msgid "" ":term:`File objects ` used by the interpreter for standard " "input, output and errors:" msgstr "" -#: ../../library/sys.rst:1729 +#: ../../library/sys.rst:1742 msgid "" "``stdin`` is used for all interactive input (including calls to :func:" "`input`);" msgstr "" -#: ../../library/sys.rst:1731 +#: ../../library/sys.rst:1744 msgid "" "``stdout`` is used for the output of :func:`print` and :term:`expression` " "statements and for the prompts of :func:`input`;" msgstr "" -#: ../../library/sys.rst:1733 +#: ../../library/sys.rst:1746 msgid "The interpreter's own prompts and its error messages go to ``stderr``." msgstr "" -#: ../../library/sys.rst:1735 +#: ../../library/sys.rst:1748 msgid "" "These streams are regular :term:`text files ` like those returned " "by the :func:`open` function. Their parameters are chosen as follows:" msgstr "" -#: ../../library/sys.rst:1739 +#: ../../library/sys.rst:1752 msgid "" "The encoding and error handling are is initialized from :c:member:`PyConfig." "stdio_encoding` and :c:member:`PyConfig.stdio_errors`." msgstr "" -#: ../../library/sys.rst:1742 +#: ../../library/sys.rst:1755 msgid "" "On Windows, UTF-8 is used for the console device. Non-character devices " "such as disk files and pipes use the system locale encoding (i.e. the ANSI " @@ -2249,14 +2267,14 @@ msgid "" "initially attached to a console." msgstr "" -#: ../../library/sys.rst:1751 +#: ../../library/sys.rst:1764 msgid "" "The special behaviour of the console can be overridden by setting the " "environment variable PYTHONLEGACYWINDOWSSTDIO before starting Python. In " "that case, the console codepages are used as for any other character device." msgstr "" -#: ../../library/sys.rst:1756 +#: ../../library/sys.rst:1769 msgid "" "Under all platforms, you can override the character encoding by setting the :" "envvar:`PYTHONIOENCODING` environment variable before starting Python or by " @@ -2265,7 +2283,7 @@ msgid "" "only applies when :envvar:`PYTHONLEGACYWINDOWSSTDIO` is also set." msgstr "" -#: ../../library/sys.rst:1763 +#: ../../library/sys.rst:1776 msgid "" "When interactive, the ``stdout`` stream is line-buffered. Otherwise, it is " "block-buffered like regular text files. The ``stderr`` stream is line-" @@ -2274,27 +2292,27 @@ msgid "" "`PYTHONUNBUFFERED` environment variable." msgstr "" -#: ../../library/sys.rst:1769 +#: ../../library/sys.rst:1782 msgid "" "Non-interactive ``stderr`` is now line-buffered instead of fully buffered." msgstr "" -#: ../../library/sys.rst:1775 +#: ../../library/sys.rst:1788 msgid "" "To write or read binary data from/to the standard streams, use the " "underlying binary :data:`~io.TextIOBase.buffer` object. For example, to " "write bytes to :data:`stdout`, use ``sys.stdout.buffer.write(b'abc')``." msgstr "" -#: ../../library/sys.rst:1779 +#: ../../library/sys.rst:1792 msgid "" "However, if you are writing a library (and do not control in which context " "its code will be executed), be aware that the standard streams may be " "replaced with file-like objects like :class:`io.StringIO` which do not " -"support the :attr:!buffer` attribute." +"support the :attr:`!buffer` attribute." msgstr "" -#: ../../library/sys.rst:1789 +#: ../../library/sys.rst:1802 msgid "" "These objects contain the original values of ``stdin``, ``stderr`` and " "``stdout`` at the start of the program. They are used during finalization, " @@ -2302,7 +2320,7 @@ msgid "" "``sys.std*`` object has been redirected." msgstr "" -#: ../../library/sys.rst:1794 +#: ../../library/sys.rst:1807 msgid "" "It can also be used to restore the actual files to known working file " "objects in case they have been overwritten with a broken object. However, " @@ -2310,7 +2328,7 @@ msgid "" "before replacing it, and restore the saved object." msgstr "" -#: ../../library/sys.rst:1800 +#: ../../library/sys.rst:1813 msgid "" "Under some conditions ``stdin``, ``stdout`` and ``stderr`` as well as the " "original values ``__stdin__``, ``__stdout__`` and ``__stderr__`` can be " @@ -2318,12 +2336,12 @@ msgid "" "to a console and Python apps started with :program:`pythonw`." msgstr "" -#: ../../library/sys.rst:1808 +#: ../../library/sys.rst:1821 msgid "" "A frozenset of strings containing the names of standard library modules." msgstr "" -#: ../../library/sys.rst:1810 +#: ../../library/sys.rst:1823 msgid "" "It is the same on all platforms. Modules which are not available on some " "platforms and modules disabled at Python build are also listed. All module " @@ -2331,7 +2349,7 @@ msgid "" "modules are excluded." msgstr "" -#: ../../library/sys.rst:1815 +#: ../../library/sys.rst:1828 msgid "" "For packages, only the main package is listed: sub-packages and sub-modules " "are not listed. For example, the ``email`` package is listed, but the " @@ -2339,62 +2357,60 @@ msgid "" "listed." msgstr "" -#: ../../library/sys.rst:1820 +#: ../../library/sys.rst:1833 msgid "See also the :data:`sys.builtin_module_names` list." msgstr "另請參閱 :attr:`sys.builtin_module_names` 清單。" -#: ../../library/sys.rst:1827 +#: ../../library/sys.rst:1840 msgid "" "A :term:`named tuple` holding information about the thread implementation." msgstr "" -#: ../../library/sys.rst:1832 +#: ../../library/sys.rst:1845 msgid "The name of the thread implementation:" msgstr "" -#: ../../library/sys.rst:1834 -#, fuzzy +#: ../../library/sys.rst:1847 msgid "``\"nt\"``: Windows threads" -msgstr "``'nt'``: Windows 執行緒" +msgstr "``\"nt\"``: Windows 執行緒" -#: ../../library/sys.rst:1835 -#, fuzzy +#: ../../library/sys.rst:1848 msgid "``\"pthread\"``: POSIX threads" -msgstr "``'pthread'``: POSIX 執行緒" +msgstr "``\"pthread\"``: POSIX 執行緒" -#: ../../library/sys.rst:1836 +#: ../../library/sys.rst:1849 msgid "" "``\"pthread-stubs\"``: stub POSIX threads (on WebAssembly platforms without " "threading support)" msgstr "" -#: ../../library/sys.rst:1838 +#: ../../library/sys.rst:1851 msgid "``\"solaris\"``: Solaris threads" msgstr "" -#: ../../library/sys.rst:1842 +#: ../../library/sys.rst:1855 msgid "The name of the lock implementation:" msgstr "" -#: ../../library/sys.rst:1844 +#: ../../library/sys.rst:1857 msgid "``\"semaphore\"``: a lock uses a semaphore" msgstr "" -#: ../../library/sys.rst:1845 +#: ../../library/sys.rst:1858 msgid "``\"mutex+cond\"``: a lock uses a mutex and a condition variable" msgstr "" -#: ../../library/sys.rst:1846 +#: ../../library/sys.rst:1859 msgid "``None`` if this information is unknown" msgstr "為 ``None`` 表示此資訊未知" -#: ../../library/sys.rst:1850 +#: ../../library/sys.rst:1863 msgid "" "The name and version of the thread library. It is a string, or ``None`` if " "this information is unknown." msgstr "" -#: ../../library/sys.rst:1858 +#: ../../library/sys.rst:1871 msgid "" "When this variable is set to an integer value, it determines the maximum " "number of levels of traceback information printed when an unhandled " @@ -2403,73 +2419,73 @@ msgid "" "are printed." msgstr "" -#: ../../library/sys.rst:1866 +#: ../../library/sys.rst:1879 msgid "Handle an unraisable exception." msgstr "處理一個不可被引發的例外。" -#: ../../library/sys.rst:1868 +#: ../../library/sys.rst:1881 msgid "" "Called when an exception has occurred but there is no way for Python to " "handle it. For example, when a destructor raises an exception or during " "garbage collection (:func:`gc.collect`)." msgstr "" -#: ../../library/sys.rst:1872 +#: ../../library/sys.rst:1885 msgid "The *unraisable* argument has the following attributes:" msgstr "" -#: ../../library/sys.rst:1874 +#: ../../library/sys.rst:1887 msgid ":attr:`!exc_type`: Exception type." msgstr ":attr:`!exc_type`: 例外型別。" -#: ../../library/sys.rst:1875 +#: ../../library/sys.rst:1888 msgid ":attr:`!exc_value`: Exception value, can be ``None``." msgstr ":attr:`!exc_value`: 例外值,可以為 ``None``。" -#: ../../library/sys.rst:1876 +#: ../../library/sys.rst:1889 msgid ":attr:`!exc_traceback`: Exception traceback, can be ``None``." msgstr ":attr:`!exc_traceback`: 例外追蹤,可以為 ``None``。" -#: ../../library/sys.rst:1877 +#: ../../library/sys.rst:1890 msgid ":attr:`!err_msg`: Error message, can be ``None``." msgstr ":attr:`!err_msg`: 錯誤訊息,可以為 ``None``。" -#: ../../library/sys.rst:1878 +#: ../../library/sys.rst:1891 msgid ":attr:`!object`: Object causing the exception, can be ``None``." msgstr ":attr:`!object`: 導致例外的物件,可以為 ``None``。" -#: ../../library/sys.rst:1880 +#: ../../library/sys.rst:1893 msgid "" "The default hook formats :attr:`!err_msg` and :attr:`!object` as: " "``f'{err_msg}: {object!r}'``; use \"Exception ignored in\" error message if :" "attr:`!err_msg` is ``None``." msgstr "" -#: ../../library/sys.rst:1884 +#: ../../library/sys.rst:1897 msgid "" ":func:`sys.unraisablehook` can be overridden to control how unraisable " "exceptions are handled." msgstr "" -#: ../../library/sys.rst:1889 +#: ../../library/sys.rst:1902 msgid ":func:`excepthook` which handles uncaught exceptions." msgstr "處理未被捕捉到例外的 :func:`excepthook`。" -#: ../../library/sys.rst:1893 +#: ../../library/sys.rst:1906 msgid "" "Storing :attr:`!exc_value` using a custom hook can create a reference cycle. " "It should be cleared explicitly to break the reference cycle when the " "exception is no longer needed." msgstr "" -#: ../../library/sys.rst:1897 +#: ../../library/sys.rst:1910 msgid "" "Storing :attr:`!object` using a custom hook can resurrect it if it is set to " "an object which is being finalized. Avoid storing :attr:`!object` after the " "custom hook completes to avoid resurrecting objects." msgstr "" -#: ../../library/sys.rst:1901 +#: ../../library/sys.rst:1914 #, fuzzy msgid "" "Raises an :ref:`auditing event ` ``sys.unraisablehook`` with " @@ -2478,7 +2494,7 @@ msgstr "" "引發一個附帶引數 ``hook``、``unraisable`` 的\\ :ref:`稽核事件 ` " "``sys.unraisablehook``。" -#: ../../library/sys.rst:1903 +#: ../../library/sys.rst:1916 msgid "" "Raise an auditing event ``sys.unraisablehook`` with arguments *hook*, " "*unraisable* when an exception that cannot be handled occurs. The " @@ -2486,7 +2502,7 @@ msgid "" "hook has been set, *hook* may be ``None``." msgstr "" -#: ../../library/sys.rst:1912 +#: ../../library/sys.rst:1925 msgid "" "A string containing the version number of the Python interpreter plus " "additional information on the build number and compiler used. This string " @@ -2495,13 +2511,13 @@ msgid "" "functions provided by the :mod:`platform` module." msgstr "" -#: ../../library/sys.rst:1921 +#: ../../library/sys.rst:1934 msgid "" "The C API version for this interpreter. Programmers may find this useful " "when debugging version conflicts between Python and extension modules." msgstr "" -#: ../../library/sys.rst:1927 +#: ../../library/sys.rst:1940 msgid "" "A tuple containing the five components of the version number: *major*, " "*minor*, *micro*, *releaselevel*, and *serial*. All values except " @@ -2512,18 +2528,18 @@ msgid "" "version_info.major`` and so on." msgstr "" -#: ../../library/sys.rst:1935 +#: ../../library/sys.rst:1948 msgid "Added named component attributes." msgstr "新增了附名的元件屬性。" -#: ../../library/sys.rst:1940 +#: ../../library/sys.rst:1953 msgid "" "This is an implementation detail of the warnings framework; do not modify " "this value. Refer to the :mod:`warnings` module for more information on the " "warnings framework." msgstr "" -#: ../../library/sys.rst:1947 +#: ../../library/sys.rst:1960 msgid "" "The version number used to form registry keys on Windows platforms. This is " "stored as string resource 1000 in the Python DLL. The value is normally the " @@ -2532,31 +2548,31 @@ msgid "" "has no effect on the registry keys used by Python." msgstr "" -#: ../../library/sys.rst:1959 +#: ../../library/sys.rst:1972 msgid "" "Namespace containing functions and constants for register callbacks and " "controlling monitoring events. See :mod:`sys.monitoring` for details." msgstr "" -#: ../../library/sys.rst:1965 +#: ../../library/sys.rst:1978 msgid "" "A dictionary of the various implementation-specific flags passed through " "the :option:`-X` command-line option. Option names are either mapped to " "their values, if given explicitly, or to :const:`True`. Example:" msgstr "" -#: ../../library/sys.rst:1981 +#: ../../library/sys.rst:1994 msgid "" "This is a CPython-specific way of accessing options passed through :option:`-" "X`. Other implementations may export them through other means, or not at " "all." msgstr "" -#: ../../library/sys.rst:1989 +#: ../../library/sys.rst:2002 msgid "Citations" msgstr "引用" -#: ../../library/sys.rst:1990 +#: ../../library/sys.rst:2003 msgid "" "ISO/IEC 9899:1999. \"Programming languages -- C.\" A public draft of this " "standard is available at https://www.open-std.org/jtc1/sc22/wg14/www/docs/" @@ -2569,59 +2585,59 @@ msgstr "" msgid "auditing" msgstr "" -#: ../../library/sys.rst:445 +#: ../../library/sys.rst:449 msgid "object" msgstr "object(物件)" -#: ../../library/sys.rst:445 +#: ../../library/sys.rst:449 msgid "traceback" msgstr "traceback" -#: ../../library/sys.rst:906 ../../library/sys.rst:1459 +#: ../../library/sys.rst:910 ../../library/sys.rst:1463 msgid "profile function" msgstr "" -#: ../../library/sys.rst:906 ../../library/sys.rst:1459 +#: ../../library/sys.rst:910 ../../library/sys.rst:1463 msgid "profiler" msgstr "" -#: ../../library/sys.rst:915 ../../library/sys.rst:1536 +#: ../../library/sys.rst:919 ../../library/sys.rst:1546 msgid "trace function" msgstr "" -#: ../../library/sys.rst:915 ../../library/sys.rst:1536 +#: ../../library/sys.rst:919 ../../library/sys.rst:1546 msgid "debugger" msgstr "debugger(除錯器)" -#: ../../library/sys.rst:1282 +#: ../../library/sys.rst:1286 msgid "module" msgstr "module(模組)" -#: ../../library/sys.rst:1282 +#: ../../library/sys.rst:1286 msgid "search" msgstr "search(搜尋)" -#: ../../library/sys.rst:1282 +#: ../../library/sys.rst:1286 msgid "path" msgstr "path(路徑)" -#: ../../library/sys.rst:1423 +#: ../../library/sys.rst:1427 msgid "interpreter prompts" msgstr "interpreter prompts(直譯器提示)" -#: ../../library/sys.rst:1423 +#: ../../library/sys.rst:1427 msgid "prompts, interpreter" msgstr "prompts, interpreter(提示、直譯器)" -#: ../../library/sys.rst:1423 +#: ../../library/sys.rst:1427 msgid ">>>" msgstr ">>>" -#: ../../library/sys.rst:1423 +#: ../../library/sys.rst:1427 msgid "interpreter prompt" msgstr "interpreter prompt(直譯器提示)" -#: ../../library/sys.rst:1423 +#: ../../library/sys.rst:1427 msgid "..." msgstr "..." diff --git a/library/syslog.po b/library/syslog.po index 40ab46dd77..fc9d6e877d 100644 --- a/library/syslog.po +++ b/library/syslog.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-11-01 00:03+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -30,25 +30,16 @@ msgid "" msgstr "" #: ../../library/syslog.rst:14 +msgid ":ref:`Availability `: Unix, not Emscripten, not WASI." +msgstr ":ref:`適用 `:Unix、非 Emscripten、非 WASI。" + +#: ../../library/syslog.rst:16 msgid "" "This module wraps the system ``syslog`` family of routines. A pure Python " "library that can speak to a syslog server is available in the :mod:`logging." "handlers` module as :class:`SysLogHandler`." msgstr "" -#: ../../includes/wasm-notavail.rst:3 -msgid ":ref:`Availability `: not Emscripten, not WASI." -msgstr "" - -#: ../../includes/wasm-notavail.rst:5 -msgid "" -"This module does not work or is not available on WebAssembly platforms " -"``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " -"more information." -msgstr "" -"此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法作用" -"或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" - #: ../../library/syslog.rst:20 msgid "The module defines the following functions:" msgstr "該模組定義了以下函式:" @@ -69,7 +60,7 @@ msgid "" "func:`openlog` will be called with no arguments." msgstr "" -#: ../../library/syslog.rst:47 +#: ../../library/syslog.rst:36 msgid "" "Raises an :ref:`auditing event ` ``syslog.syslog`` with arguments " "``priority``, ``message``." @@ -110,7 +101,7 @@ msgid "" "for messages which do not have a facility explicitly encoded." msgstr "" -#: ../../library/syslog.rst:75 +#: ../../library/syslog.rst:64 msgid "" "Raises an :ref:`auditing event ` ``syslog.openlog`` with arguments " "``ident``, ``logoption``, ``facility``." @@ -145,7 +136,7 @@ msgid "" "`openlog` parameters are reset to defaults." msgstr "" -#: ../../library/syslog.rst:98 +#: ../../library/syslog.rst:87 msgid "" "Raises an :ref:`auditing event ` ``syslog.closelog`` with no " "arguments." @@ -162,7 +153,7 @@ msgid "" "and including *pri*." msgstr "" -#: ../../library/syslog.rst:117 +#: ../../library/syslog.rst:106 msgid "" "Raises an :ref:`auditing event ` ``syslog.setlogmask`` with " "argument ``maskpri``." @@ -229,3 +220,11 @@ msgid "" "in logged messages, and write the messages to the destination facility used " "for mail logging::" msgstr "" + +#~ msgid "" +#~ "This module does not work or is not available on WebAssembly platforms " +#~ "``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` " +#~ "for more information." +#~ msgstr "" +#~ "此模組在 WebAssembly 平台 ``wasm32-emscripten`` 和 ``wasm32-wasi`` 上無法" +#~ "作用或無法使用。有關更多資訊,請參閱 :ref:`wasm-availability`。" diff --git a/library/tempfile.po b/library/tempfile.po index a6b5b3d670..369a47297f 100644 --- a/library/tempfile.po +++ b/library/tempfile.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-10-24 00:03+0000\n" "PO-Revision-Date: 2022-06-12 15:17+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -290,12 +290,14 @@ msgstr "新增 *delete_on_close* 參數。" msgid "" "This class operates exactly as :func:`TemporaryFile` does, except that data " "is spooled in memory until the file size exceeds *max_size*, or until the " -"file's :func:`fileno` method is called, at which point the contents are " -"written to disk and operation proceeds as with :func:`TemporaryFile`." +"file's :func:`~io.IOBase.fileno` method is called, at which point the " +"contents are written to disk and operation proceeds as with :func:" +"`TemporaryFile`." msgstr "" "此類別執行的操作與 :func:`TemporaryFile` 完全相同,但會將資料排存 (spool) 於" -"在記憶體中,直到檔案大小超過 *max_size*,或檔案的 :func:`fileno` 方法被呼叫為" -"止,此時資料會被寫入磁碟,並且之後的操作與 :func:`TemporaryFile` 相同。" +"在記憶體中,直到檔案大小超過 *max_size*,或檔案的 :func:`~io.IOBase.fileno` " +"方法被呼叫為止,此時資料會被寫入磁碟,並且之後的操作與 :func:`TemporaryFile` " +"相同。" #: ../../library/tempfile.rst:154 msgid "" diff --git a/library/termios.po b/library/termios.po index 481411f60f..9ddcd3bbdb 100644 --- a/library/termios.po +++ b/library/termios.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-11-01 00:03+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-" @@ -31,13 +31,17 @@ msgid "" msgstr "" #: ../../library/termios.rst:19 +msgid ":ref:`Availability `: Unix." +msgstr ":ref:`適用 `:Unix。" + +#: ../../library/termios.rst:21 msgid "" "All functions in this module take a file descriptor *fd* as their first " "argument. This can be an integer file descriptor, such as returned by ``sys." "stdin.fileno()``, or a :term:`file object`, such as ``sys.stdin`` itself." msgstr "" -#: ../../library/termios.rst:23 +#: ../../library/termios.rst:25 msgid "" "This module also defines all the constants needed to work with the functions " "provided here; these have the same name as their counterparts in C. Please " @@ -45,11 +49,11 @@ msgid "" "terminal control interfaces." msgstr "" -#: ../../library/termios.rst:28 +#: ../../library/termios.rst:30 msgid "The module defines the following functions:" msgstr "" -#: ../../library/termios.rst:33 +#: ../../library/termios.rst:35 msgid "" "Return a list containing the tty attributes for file descriptor *fd*, as " "follows: ``[iflag, oflag, cflag, lflag, ispeed, ospeed, cc]`` where *cc* is " @@ -60,49 +64,60 @@ msgid "" "constants defined in the :mod:`termios` module." msgstr "" -#: ../../library/termios.rst:44 +#: ../../library/termios.rst:46 msgid "" "Set the tty attributes for file descriptor *fd* from the *attributes*, which " "is a list like the one returned by :func:`tcgetattr`. The *when* argument " -"determines when the attributes are changed: :const:`TCSANOW` to change " -"immediately, :const:`TCSADRAIN` to change after transmitting all queued " -"output, or :const:`TCSAFLUSH` to change after transmitting all queued output " -"and discarding all queued input." +"determines when the attributes are changed:" +msgstr "" + +#: ../../library/termios.rst:52 +msgid "Change attributes immediately." +msgstr "" + +#: ../../library/termios.rst:56 +msgid "Change attributes after transmitting all queued output." +msgstr "" + +#: ../../library/termios.rst:60 +msgid "" +"Change attributes after transmitting all queued output and discarding all " +"queued input." msgstr "" -#: ../../library/termios.rst:54 +#: ../../library/termios.rst:66 msgid "" "Send a break on file descriptor *fd*. A zero *duration* sends a break for " "0.25--0.5 seconds; a nonzero *duration* has a system dependent meaning." msgstr "" -#: ../../library/termios.rst:60 +#: ../../library/termios.rst:72 msgid "" "Wait until all output written to file descriptor *fd* has been transmitted." msgstr "" -#: ../../library/termios.rst:65 +#: ../../library/termios.rst:77 msgid "" "Discard queued data on file descriptor *fd*. The *queue* selector specifies " "which queue: :const:`TCIFLUSH` for the input queue, :const:`TCOFLUSH` for " "the output queue, or :const:`TCIOFLUSH` for both queues." msgstr "" -#: ../../library/termios.rst:72 +#: ../../library/termios.rst:84 msgid "" "Suspend or resume input or output on file descriptor *fd*. The *action* " "argument can be :const:`TCOOFF` to suspend output, :const:`TCOON` to restart " "output, :const:`TCIOFF` to suspend input, or :const:`TCION` to restart input." msgstr "" -#: ../../library/termios.rst:79 +#: ../../library/termios.rst:91 msgid "" "Return a tuple ``(ws_row, ws_col)`` containing the tty window size for file " "descriptor *fd*. Requires :const:`termios.TIOCGWINSZ` or :const:`termios." "TIOCGSIZE`." msgstr "" -#: ../../library/termios.rst:88 +#: ../../library/termios.rst:100 msgid "" "Set the tty window size for file descriptor *fd* from *winsize*, which is a " "two-item tuple ``(ws_row, ws_col)`` like the one returned by :func:" @@ -111,19 +126,19 @@ msgid "" "const:`termios.TIOCSSIZE`) to be defined." msgstr "" -#: ../../library/termios.rst:99 +#: ../../library/termios.rst:111 msgid "Module :mod:`tty`" msgstr ":mod:`tty` 模組" -#: ../../library/termios.rst:100 +#: ../../library/termios.rst:112 msgid "Convenience functions for common terminal control operations." msgstr "" -#: ../../library/termios.rst:106 +#: ../../library/termios.rst:118 msgid "Example" msgstr "範例" -#: ../../library/termios.rst:108 +#: ../../library/termios.rst:120 msgid "" "Here's a function that prompts for a password with echoing turned off. Note " "the technique using a separate :func:`tcgetattr` call and a :keyword:" diff --git a/library/test.po b/library/test.po index 42104f34c1..30b923688b 100644 --- a/library/test.po +++ b/library/test.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-10-30 00:03+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-" @@ -558,115 +558,71 @@ msgid "" msgstr "" #: ../../library/test.rst:503 -msgid "" -"Determine whether *test* matches the patterns set in :func:`set_match_tests`." -msgstr "" - -#: ../../library/test.rst:508 -msgid "" -"Define match patterns on test filenames and test method names for filtering " -"tests." -msgstr "" - -#: ../../library/test.rst:513 -msgid "" -"Execute :class:`unittest.TestCase` subclasses passed to the function. The " -"function scans the classes for methods starting with the prefix ``test_`` " -"and executes the tests individually." -msgstr "" - -#: ../../library/test.rst:517 -msgid "" -"It is also legal to pass strings as parameters; these should be keys in " -"``sys.modules``. Each associated module will be scanned by ``unittest." -"TestLoader.loadTestsFromModule()``. This is usually seen in the following :" -"func:`test_main` function::" -msgstr "" - -#: ../../library/test.rst:525 -msgid "This will run all tests defined in the named module." -msgstr "" - -#: ../../library/test.rst:530 -msgid "" -"Run :func:`doctest.testmod` on the given *module*. Return ``(failure_count, " -"test_count)``." -msgstr "" - -#: ../../library/test.rst:533 -msgid "" -"If *verbosity* is ``None``, :func:`doctest.testmod` is run with verbosity " -"set to :data:`verbose`. Otherwise, it is run with verbosity set to " -"``None``. *optionflags* is passed as ``optionflags`` to :func:`doctest." -"testmod`." -msgstr "" - -#: ../../library/test.rst:541 msgid "Get size of a page in bytes." msgstr "" -#: ../../library/test.rst:548 +#: ../../library/test.rst:510 msgid "" "Set the :func:`sys.setswitchinterval` to the given *interval*. Defines a " "minimum interval for Android systems to prevent the system from hanging." msgstr "" -#: ../../library/test.rst:554 +#: ../../library/test.rst:516 msgid "" "Use this check to guard CPython's implementation-specific tests or to run " "them only on the implementations guarded by the arguments. This function " "returns ``True`` or ``False`` depending on the host platform. Example usage::" msgstr "" -#: ../../library/test.rst:566 +#: ../../library/test.rst:528 msgid "" "Set the values for :data:`max_memuse` and :data:`real_max_memuse` for big " "memory tests." msgstr "" -#: ../../library/test.rst:572 +#: ../../library/test.rst:534 msgid "" "Store the value from *stdout*. It is meant to hold the stdout at the time " "the regrtest began." msgstr "" -#: ../../library/test.rst:578 +#: ../../library/test.rst:540 msgid "" "Return the original stdout set by :func:`record_original_stdout` or ``sys." "stdout`` if it's not set." msgstr "" -#: ../../library/test.rst:584 +#: ../../library/test.rst:546 msgid "" "Return a list of command line arguments reproducing the current settings in " "``sys.flags`` and ``sys.warnoptions``." msgstr "" -#: ../../library/test.rst:590 +#: ../../library/test.rst:552 msgid "" "Return a list of command line arguments reproducing the current optimization " "settings in ``sys.flags``." msgstr "" -#: ../../library/test.rst:598 +#: ../../library/test.rst:560 msgid "" "A context managers that temporarily replaces the named stream with :class:" "`io.StringIO` object." msgstr "" -#: ../../library/test.rst:601 +#: ../../library/test.rst:563 msgid "Example use with output streams::" msgstr "" -#: ../../library/test.rst:609 +#: ../../library/test.rst:571 msgid "Example use with input stream::" msgstr "" -#: ../../library/test.rst:621 +#: ../../library/test.rst:583 msgid "A context manager that temporary disables :mod:`faulthandler`." msgstr "" -#: ../../library/test.rst:626 +#: ../../library/test.rst:588 msgid "" "Force as many objects as possible to be collected. This is needed because " "timely deallocation is not guaranteed by the garbage collector. This means " @@ -674,115 +630,115 @@ msgid "" "remain alive for longer than expected." msgstr "" -#: ../../library/test.rst:634 +#: ../../library/test.rst:596 msgid "" "A context manager that disables the garbage collector on entry. On exit, the " "garbage collector is restored to its prior state." msgstr "" -#: ../../library/test.rst:640 +#: ../../library/test.rst:602 msgid "Context manager to swap out an attribute with a new object." msgstr "" -#: ../../library/test.rst:642 ../../library/test.rst:660 -#: ../../library/test.rst:895 ../../library/test.rst:1361 +#: ../../library/test.rst:604 ../../library/test.rst:622 +#: ../../library/test.rst:857 ../../library/test.rst:1323 msgid "Usage::" msgstr "" "用法:\n" "\n" "::" -#: ../../library/test.rst:647 +#: ../../library/test.rst:609 msgid "" "This will set ``obj.attr`` to 5 for the duration of the ``with`` block, " "restoring the old value at the end of the block. If ``attr`` doesn't exist " "on ``obj``, it will be created and then deleted at the end of the block." msgstr "" -#: ../../library/test.rst:652 ../../library/test.rst:670 +#: ../../library/test.rst:614 ../../library/test.rst:632 msgid "" "The old value (or ``None`` if it doesn't exist) will be assigned to the " "target of the \"as\" clause, if there is one." msgstr "" -#: ../../library/test.rst:658 +#: ../../library/test.rst:620 msgid "Context manager to swap out an item with a new object." msgstr "" -#: ../../library/test.rst:665 +#: ../../library/test.rst:627 msgid "" "This will set ``obj[\"item\"]`` to 5 for the duration of the ``with`` block, " "restoring the old value at the end of the block. If ``item`` doesn't exist " "on ``obj``, it will be created and then deleted at the end of the block." msgstr "" -#: ../../library/test.rst:676 +#: ../../library/test.rst:638 msgid "" "Call the ``flush()`` method on :data:`sys.stdout` and then on :data:`sys." "stderr`. It can be used to make sure that the logs order is consistent " "before writing into stderr." msgstr "" -#: ../../library/test.rst:685 +#: ../../library/test.rst:647 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." msgstr "" -#: ../../library/test.rst:694 +#: ../../library/test.rst:656 msgid "" "Wait until process *pid* completes and check that the process exit code is " "*exitcode*." msgstr "" -#: ../../library/test.rst:697 +#: ../../library/test.rst:659 msgid "" "Raise an :exc:`AssertionError` if the process exit code is not equal to " "*exitcode*." msgstr "" -#: ../../library/test.rst:700 +#: ../../library/test.rst:662 msgid "" "If the process runs longer than *timeout* seconds (:data:`SHORT_TIMEOUT` by " "default), kill the process and raise an :exc:`AssertionError`. The timeout " "feature is not available on Windows." msgstr "" -#: ../../library/test.rst:709 +#: ../../library/test.rst:671 msgid "" "Return the size of the :c:type:`PyObject` whose structure members are " "defined by *fmt*. The returned value includes the size of the Python object " "header and alignment." msgstr "" -#: ../../library/test.rst:715 +#: ../../library/test.rst:677 msgid "" "Return the size of the :c:type:`PyVarObject` whose structure members are " "defined by *fmt*. The returned value includes the size of the Python object " "header and alignment." msgstr "" -#: ../../library/test.rst:721 +#: ../../library/test.rst:683 msgid "" "For testcase *test*, assert that the ``sys.getsizeof`` for *o* plus the GC " "header size equals *size*." msgstr "" -#: ../../library/test.rst:727 +#: ../../library/test.rst:689 msgid "" "A decorator to conditionally mark tests with :func:`unittest." "expectedFailure`. Any use of this decorator should have an associated " "comment identifying the relevant tracker issue." msgstr "" -#: ../../library/test.rst:734 +#: ../../library/test.rst:696 msgid "" "A decorator that skips the decorated test on TLS certification validation " "failures." msgstr "" -#: ../../library/test.rst:739 +#: ../../library/test.rst:701 msgid "" "A decorator for running a function in a different locale, correctly " "resetting it after it has finished. *catstr* is the locale category as a " @@ -790,79 +746,79 @@ msgid "" "sequentially, and the first valid locale will be used." msgstr "" -#: ../../library/test.rst:747 +#: ../../library/test.rst:709 msgid "" "A decorator for running a function in a specific timezone, correctly " "resetting it after it has finished." msgstr "" -#: ../../library/test.rst:753 +#: ../../library/test.rst:715 msgid "" "Decorator for the minimum version when running test on FreeBSD. If the " "FreeBSD version is less than the minimum, the test is skipped." msgstr "" -#: ../../library/test.rst:759 +#: ../../library/test.rst:721 msgid "" "Decorator for the minimum version when running test on Linux. If the Linux " "version is less than the minimum, the test is skipped." msgstr "" -#: ../../library/test.rst:765 +#: ../../library/test.rst:727 msgid "" "Decorator for the minimum version when running test on macOS. If the macOS " "version is less than the minimum, the test is skipped." msgstr "" -#: ../../library/test.rst:771 +#: ../../library/test.rst:733 msgid "Decorator for skipping tests on non-IEEE 754 platforms." msgstr "" -#: ../../library/test.rst:776 +#: ../../library/test.rst:738 msgid "Decorator for skipping tests if :mod:`zlib` doesn't exist." msgstr "" -#: ../../library/test.rst:781 +#: ../../library/test.rst:743 msgid "Decorator for skipping tests if :mod:`gzip` doesn't exist." msgstr "" -#: ../../library/test.rst:786 +#: ../../library/test.rst:748 msgid "Decorator for skipping tests if :mod:`bz2` doesn't exist." msgstr "" -#: ../../library/test.rst:791 +#: ../../library/test.rst:753 msgid "Decorator for skipping tests if :mod:`lzma` doesn't exist." msgstr "" -#: ../../library/test.rst:796 +#: ../../library/test.rst:758 msgid "Decorator for skipping tests if *resource* is not available." msgstr "" -#: ../../library/test.rst:801 +#: ../../library/test.rst:763 msgid "Decorator for only running the test if :data:`HAVE_DOCSTRINGS`." msgstr "" -#: ../../library/test.rst:806 +#: ../../library/test.rst:768 msgid "" "Decorator for only running the test if :ref:`Limited C API ` " "is available." msgstr "" -#: ../../library/test.rst:812 +#: ../../library/test.rst:774 msgid "Decorator for tests only applicable to CPython." msgstr "" -#: ../../library/test.rst:817 +#: ../../library/test.rst:779 msgid "" "Decorator for invoking :func:`check_impl_detail` on *guards*. If that " "returns ``False``, then uses *msg* as the reason for skipping the test." msgstr "" -#: ../../library/test.rst:823 +#: ../../library/test.rst:785 msgid "Decorator to temporarily turn off tracing for the duration of the test." msgstr "" -#: ../../library/test.rst:828 +#: ../../library/test.rst:790 msgid "" "Decorator for tests which involve reference counting. The decorator does " "not run the test if it is not run by CPython. Any trace function is unset " @@ -870,11 +826,11 @@ msgid "" "trace function." msgstr "" -#: ../../library/test.rst:836 +#: ../../library/test.rst:798 msgid "Decorator for bigmem tests." msgstr "" -#: ../../library/test.rst:838 +#: ../../library/test.rst:800 msgid "" "*size* is a requested size for the test (in arbitrary, test-interpreted " "units.) *memuse* is the number of bytes per unit for the test, or a good " @@ -882,7 +838,7 @@ msgid "" "each, could be decorated with ``@bigmemtest(size=_4G, memuse=2)``." msgstr "" -#: ../../library/test.rst:843 +#: ../../library/test.rst:805 msgid "" "The *size* argument is normally passed to the decorated test method as an " "extra argument. If *dry_run* is ``True``, the value passed to the test " @@ -890,11 +846,11 @@ msgid "" "means the test doesn't support dummy runs when ``-M`` is not specified." msgstr "" -#: ../../library/test.rst:851 +#: ../../library/test.rst:813 msgid "Decorator for tests that fill the address space." msgstr "" -#: ../../library/test.rst:856 +#: ../../library/test.rst:818 msgid "" "Test for syntax errors in *statement* by attempting to compile *statement*. " "*testcase* is the :mod:`unittest` instance for the test. *errtext* is the " @@ -904,44 +860,44 @@ msgid "" "of the exception." msgstr "" -#: ../../library/test.rst:866 +#: ../../library/test.rst:828 msgid "Open *url*. If open fails, raises :exc:`TestFailed`." msgstr "" -#: ../../library/test.rst:871 +#: ../../library/test.rst:833 msgid "" "Use this at the end of ``test_main`` whenever sub-processes are started. " "This will help ensure that no extra children (zombies) stick around to hog " "resources and create problems when looking for refleaks." msgstr "" -#: ../../library/test.rst:878 +#: ../../library/test.rst:840 msgid "" "Get an attribute, raising :exc:`unittest.SkipTest` if :exc:`AttributeError` " "is raised." msgstr "" -#: ../../library/test.rst:884 +#: ../../library/test.rst:846 msgid "" "Context manager catching unraisable exception using :func:`sys." "unraisablehook`." msgstr "" -#: ../../library/test.rst:887 +#: ../../library/test.rst:849 msgid "" "Storing the exception value (``cm.unraisable.exc_value``) creates a " "reference cycle. The reference cycle is broken explicitly when the context " "manager exits." msgstr "" -#: ../../library/test.rst:891 +#: ../../library/test.rst:853 msgid "" "Storing the object (``cm.unraisable.object``) can resurrect it if it is set " "to an object which is being finalized. Exiting the context manager clears " "the stored object." msgstr "" -#: ../../library/test.rst:912 +#: ../../library/test.rst:874 msgid "" "Generic implementation of the :mod:`unittest` ``load_tests`` protocol for " "use in test packages. *pkg_dir* is the root directory of the package; " @@ -950,55 +906,55 @@ msgid "" "the following::" msgstr "" -#: ../../library/test.rst:927 +#: ../../library/test.rst:889 msgid "" "Returns the set of attributes, functions or methods of *ref_api* not found " "on *other_api*, except for a defined list of items to be ignored in this " "check specified in *ignore*." msgstr "" -#: ../../library/test.rst:931 +#: ../../library/test.rst:893 msgid "" "By default this skips private attributes beginning with '_' but includes all " "magic methods, i.e. those starting and ending in '__'." msgstr "" -#: ../../library/test.rst:939 +#: ../../library/test.rst:901 msgid "" "Override *object_to_patch.attr_name* with *new_value*. Also add cleanup " "procedure to *test_instance* to restore *object_to_patch* for *attr_name*. " "The *attr_name* should be a valid attribute for *object_to_patch*." msgstr "" -#: ../../library/test.rst:947 +#: ../../library/test.rst:909 msgid "" "Run *code* in subinterpreter. Raise :exc:`unittest.SkipTest` if :mod:" "`tracemalloc` is enabled." msgstr "" -#: ../../library/test.rst:953 +#: ../../library/test.rst:915 msgid "Assert instances of *cls* are deallocated after iterating." msgstr "" -#: ../../library/test.rst:958 +#: ../../library/test.rst:920 msgid "" "Check for the existence of the compiler executables whose names are listed " "in *cmd_names* or all the compiler executables when *cmd_names* is empty and " "return the first missing executable or ``None`` when none is found missing." msgstr "" -#: ../../library/test.rst:966 +#: ../../library/test.rst:928 msgid "" "Assert that the ``__all__`` variable of *module* contains all public names." msgstr "" -#: ../../library/test.rst:968 +#: ../../library/test.rst:930 msgid "" "The module's public names (its API) are detected automatically based on " "whether they match the public name convention and were defined in *module*." msgstr "" -#: ../../library/test.rst:972 +#: ../../library/test.rst:934 msgid "" "The *name_of_module* argument can specify (as a string or tuple thereof) " "what module(s) an API could be defined in order to be detected as a public " @@ -1006,7 +962,7 @@ msgid "" "other modules, possibly a C backend (like ``csv`` and its ``_csv``)." msgstr "" -#: ../../library/test.rst:977 +#: ../../library/test.rst:939 msgid "" "The *extra* argument can be a set of names that wouldn't otherwise be " "automatically detected as \"public\", like objects without a proper " @@ -1014,31 +970,31 @@ msgid "" "detected ones." msgstr "" -#: ../../library/test.rst:981 +#: ../../library/test.rst:943 msgid "" "The *not_exported* argument can be a set of names that must not be treated " "as part of the public API even though their names indicate otherwise." msgstr "" -#: ../../library/test.rst:984 ../../library/test.rst:1610 +#: ../../library/test.rst:946 ../../library/test.rst:1572 msgid "Example use::" msgstr "" "用法範例:\n" "\n" "::" -#: ../../library/test.rst:1007 +#: ../../library/test.rst:969 msgid "" "Skip tests if the :mod:`multiprocessing.synchronize` module is missing, if " "there is no available semaphore implementation, or if creating a lock raises " "an :exc:`OSError`." msgstr "" -#: ../../library/test.rst:1016 +#: ../../library/test.rst:978 msgid "Assert that type *tp* cannot be instantiated using *args* and *kwds*." msgstr "" -#: ../../library/test.rst:1023 +#: ../../library/test.rst:985 msgid "" "This function returns a context manager that will change the global :func:" "`sys.set_int_max_str_digits` setting for the duration of the context to " @@ -1046,72 +1002,73 @@ msgid "" "digits when converting between an integer and string." msgstr "" -#: ../../library/test.rst:1031 +#: ../../library/test.rst:993 msgid "The :mod:`test.support` module defines the following classes:" msgstr "" -#: ../../library/test.rst:1036 +#: ../../library/test.rst:998 msgid "" "A context manager used to try to prevent crash dialog popups on tests that " "are expected to crash a subprocess." msgstr "" -#: ../../library/test.rst:1039 +#: ../../library/test.rst:1001 msgid "" "On Windows, it disables Windows Error Reporting dialogs using `SetErrorMode " "`_." msgstr "" -#: ../../library/test.rst:1042 +#: ../../library/test.rst:1004 msgid "" "On UNIX, :func:`resource.setrlimit` is used to set :const:`resource." "RLIMIT_CORE`'s soft limit to 0 to prevent coredump file creation." msgstr "" -#: ../../library/test.rst:1046 -msgid "On both platforms, the old value is restored by :meth:`__exit__`." +#: ../../library/test.rst:1008 +msgid "" +"On both platforms, the old value is restored by :meth:`~object.__exit__`." msgstr "" -#: ../../library/test.rst:1051 +#: ../../library/test.rst:1013 msgid "" "Class to save and restore signal handlers registered by the Python signal " "handler." msgstr "" -#: ../../library/test.rst:1056 +#: ../../library/test.rst:1018 msgid "" "Save the signal handlers to a dictionary mapping signal numbers to the " "current signal handler." msgstr "" -#: ../../library/test.rst:1061 +#: ../../library/test.rst:1023 msgid "" "Set the signal numbers from the :meth:`save` dictionary to the saved handler." msgstr "" -#: ../../library/test.rst:1069 +#: ../../library/test.rst:1031 msgid "Try to match a single dict with the supplied arguments." msgstr "" -#: ../../library/test.rst:1074 +#: ../../library/test.rst:1036 msgid "Try to match a single stored value (*dv*) with a supplied value (*v*)." msgstr "" -#: ../../library/test.rst:1078 +#: ../../library/test.rst:1040 msgid ":mod:`test.support.socket_helper` --- Utilities for socket tests" msgstr "" -#: ../../library/test.rst:1084 +#: ../../library/test.rst:1046 msgid "" "The :mod:`test.support.socket_helper` module provides support for socket " "tests." msgstr "" -#: ../../library/test.rst:1091 +#: ../../library/test.rst:1053 msgid "Set to ``True`` if IPv6 is enabled on this host, ``False`` otherwise." msgstr "" -#: ../../library/test.rst:1096 +#: ../../library/test.rst:1058 msgid "" "Returns an unused port that should be suitable for binding. This is " "achieved by creating a temporary socket with the same family and type as the " @@ -1122,7 +1079,7 @@ msgid "" "port is returned." msgstr "" -#: ../../library/test.rst:1105 +#: ../../library/test.rst:1067 msgid "" "Either this method or :func:`bind_port` should be used for any tests where a " "server socket needs to be bound to a particular port for the duration of the " @@ -1135,7 +1092,7 @@ msgid "" "simultaneously, which is a problem for buildbots." msgstr "" -#: ../../library/test.rst:1119 +#: ../../library/test.rst:1081 msgid "" "Bind the socket to a free port and return the port number. Relies on " "ephemeral ports in order to ensure we are using an unbound port. This is " @@ -1148,7 +1105,7 @@ msgid "" "testing multicasting via multiple UDP sockets." msgstr "" -#: ../../library/test.rst:1130 +#: ../../library/test.rst:1092 msgid "" "Additionally, if the :const:`~socket.SO_EXCLUSIVEADDRUSE` socket option is " "available (i.e. on Windows), it will be set on the socket. This will " @@ -1156,58 +1113,58 @@ msgid "" "test." msgstr "" -#: ../../library/test.rst:1138 +#: ../../library/test.rst:1100 msgid "" "Bind a Unix socket, raising :exc:`unittest.SkipTest` if :exc:" "`PermissionError` is raised." msgstr "" -#: ../../library/test.rst:1144 +#: ../../library/test.rst:1106 msgid "" "A decorator for running tests that require a functional ``bind()`` for Unix " "sockets." msgstr "" -#: ../../library/test.rst:1150 +#: ../../library/test.rst:1112 msgid "" "A context manager that raises :exc:`~test.support.ResourceDenied` when " "various issues with the internet connection manifest themselves as " "exceptions." msgstr "" -#: ../../library/test.rst:1156 +#: ../../library/test.rst:1118 msgid "" ":mod:`test.support.script_helper` --- Utilities for the Python execution " "tests" msgstr "" -#: ../../library/test.rst:1162 +#: ../../library/test.rst:1124 msgid "" "The :mod:`test.support.script_helper` module provides support for Python's " "script execution tests." msgstr "" -#: ../../library/test.rst:1167 +#: ../../library/test.rst:1129 msgid "" "Return ``True`` if ``sys.executable interpreter`` requires environment " "variables in order to be able to run at all." msgstr "" -#: ../../library/test.rst:1170 +#: ../../library/test.rst:1132 msgid "" "This is designed to be used with ``@unittest.skipIf()`` to annotate tests " "that need to use an ``assert_python*()`` function to launch an isolated mode " "(``-I``) or no environment mode (``-E``) sub-interpreter process." msgstr "" -#: ../../library/test.rst:1174 +#: ../../library/test.rst:1136 msgid "" "A normal build & test does not run into this situation but it can happen " "when trying to run the standard library test suite from an interpreter that " "doesn't have an obvious home with Python's current home finding logic." msgstr "" -#: ../../library/test.rst:1178 +#: ../../library/test.rst:1140 msgid "" "Setting :envvar:`PYTHONHOME` is one way to get most of the testsuite to run " "in that situation. :envvar:`PYTHONPATH` or :envvar:`PYTHONUSERSITE` are " @@ -1215,85 +1172,85 @@ msgid "" "interpreter can start." msgstr "" -#: ../../library/test.rst:1186 +#: ../../library/test.rst:1148 msgid "" "Set up the environment based on *env_vars* for running the interpreter in a " "subprocess. The values can include ``__isolated``, ``__cleanenv``, " "``__cwd``, and ``TERM``." msgstr "" -#: ../../library/test.rst:1190 ../../library/test.rst:1206 -#: ../../library/test.rst:1218 +#: ../../library/test.rst:1152 ../../library/test.rst:1168 +#: ../../library/test.rst:1180 msgid "The function no longer strips whitespaces from *stderr*." msgstr "" -#: ../../library/test.rst:1196 +#: ../../library/test.rst:1158 msgid "" "Assert that running the interpreter with *args* and optional environment " "variables *env_vars* succeeds (``rc == 0``) and return a ``(return code, " "stdout, stderr)`` tuple." msgstr "" -#: ../../library/test.rst:1200 +#: ../../library/test.rst:1162 msgid "" "If the *__cleanenv* keyword-only parameter is set, *env_vars* is used as a " "fresh environment." msgstr "" -#: ../../library/test.rst:1203 +#: ../../library/test.rst:1165 msgid "" "Python is started in isolated mode (command line option ``-I``), except if " "the *__isolated* keyword-only parameter is set to ``False``." msgstr "" -#: ../../library/test.rst:1212 +#: ../../library/test.rst:1174 msgid "" "Assert that running the interpreter with *args* and optional environment " "variables *env_vars* fails (``rc != 0``) and return a ``(return code, " "stdout, stderr)`` tuple." msgstr "" -#: ../../library/test.rst:1216 +#: ../../library/test.rst:1178 msgid "See :func:`assert_python_ok` for more options." msgstr "更多選項請見 :func:`assert_python_ok`\\ 。" -#: ../../library/test.rst:1224 +#: ../../library/test.rst:1186 msgid "Run a Python subprocess with the given arguments." msgstr "" -#: ../../library/test.rst:1226 +#: ../../library/test.rst:1188 msgid "" "*kw* is extra keyword args to pass to :func:`subprocess.Popen`. Returns a :" "class:`subprocess.Popen` object." msgstr "" -#: ../../library/test.rst:1232 +#: ../../library/test.rst:1194 msgid "" "Run the given :class:`subprocess.Popen` process until completion and return " "stdout." msgstr "" -#: ../../library/test.rst:1238 +#: ../../library/test.rst:1200 msgid "" "Create script containing *source* in path *script_dir* and " "*script_basename*. If *omit_suffix* is ``False``, append ``.py`` to the " "name. Return the full script path." msgstr "" -#: ../../library/test.rst:1245 +#: ../../library/test.rst:1207 msgid "" "Create zip file at *zip_dir* and *zip_basename* with extension ``zip`` which " "contains the files in *script_name*. *name_in_zip* is the archive name. " "Return a tuple containing ``(full path, full path of archive name)``." msgstr "" -#: ../../library/test.rst:1252 +#: ../../library/test.rst:1214 msgid "" "Create a directory named *pkg_dir* containing an ``__init__`` file with " "*init_source* as its contents." msgstr "" -#: ../../library/test.rst:1259 +#: ../../library/test.rst:1221 msgid "" "Create a zip package directory with a path of *zip_dir* and *zip_basename* " "containing an empty ``__init__`` file and a file *script_basename* " @@ -1302,60 +1259,60 @@ msgid "" "path and the archive name for the zip file." msgstr "" -#: ../../library/test.rst:1267 +#: ../../library/test.rst:1229 msgid "" ":mod:`test.support.bytecode_helper` --- Support tools for testing correct " "bytecode generation" msgstr "" -#: ../../library/test.rst:1272 +#: ../../library/test.rst:1234 msgid "" "The :mod:`test.support.bytecode_helper` module provides support for testing " "and inspecting bytecode generation." msgstr "" -#: ../../library/test.rst:1277 +#: ../../library/test.rst:1239 msgid "The module defines the following class:" msgstr "" -#: ../../library/test.rst:1281 +#: ../../library/test.rst:1243 msgid "This class has custom assertion methods for inspecting bytecode." msgstr "" -#: ../../library/test.rst:1285 +#: ../../library/test.rst:1247 msgid "Return the disassembly of *co* as string." msgstr "" -#: ../../library/test.rst:1290 +#: ../../library/test.rst:1252 msgid "" "Return instr if *opname* is found, otherwise throws :exc:`AssertionError`." msgstr "" -#: ../../library/test.rst:1295 +#: ../../library/test.rst:1257 msgid "Throws :exc:`AssertionError` if *opname* is found." msgstr "" -#: ../../library/test.rst:1299 +#: ../../library/test.rst:1261 msgid ":mod:`test.support.threading_helper` --- Utilities for threading tests" msgstr "" -#: ../../library/test.rst:1304 +#: ../../library/test.rst:1266 msgid "" "The :mod:`test.support.threading_helper` module provides support for " "threading tests." msgstr "" -#: ../../library/test.rst:1311 +#: ../../library/test.rst:1273 msgid "" "Join a *thread* within *timeout*. Raise an :exc:`AssertionError` if thread " "is still alive after *timeout* seconds." msgstr "" -#: ../../library/test.rst:1317 +#: ../../library/test.rst:1279 msgid "Decorator to ensure the threads are cleaned up even if the test fails." msgstr "" -#: ../../library/test.rst:1322 +#: ../../library/test.rst:1284 msgid "" "Context manager to start *threads*, which is a sequence of threads. *unlock* " "is a function called after the threads are started, even if an exception was " @@ -1363,79 +1320,79 @@ msgid "" "will attempt to join the started threads upon exit." msgstr "" -#: ../../library/test.rst:1330 +#: ../../library/test.rst:1292 msgid "" "Cleanup up threads not specified in *original_values*. Designed to emit a " "warning if a test leaves running threads in the background." msgstr "" -#: ../../library/test.rst:1336 +#: ../../library/test.rst:1298 msgid "Return current thread count and copy of dangling threads." msgstr "" -#: ../../library/test.rst:1341 +#: ../../library/test.rst:1303 msgid "" "Context manager to wait until all threads created in the ``with`` statement " "exit." msgstr "" -#: ../../library/test.rst:1347 +#: ../../library/test.rst:1309 msgid "" "Context manager catching :class:`threading.Thread` exception using :func:" "`threading.excepthook`." msgstr "" -#: ../../library/test.rst:1350 +#: ../../library/test.rst:1312 msgid "Attributes set when an exception is caught:" msgstr "" -#: ../../library/test.rst:1352 +#: ../../library/test.rst:1314 msgid "``exc_type``" msgstr "``exc_type``" -#: ../../library/test.rst:1353 +#: ../../library/test.rst:1315 msgid "``exc_value``" msgstr "``exc_value``" -#: ../../library/test.rst:1354 +#: ../../library/test.rst:1316 msgid "``exc_traceback``" msgstr "``exc_traceback``" -#: ../../library/test.rst:1355 +#: ../../library/test.rst:1317 msgid "``thread``" msgstr "``thread``" -#: ../../library/test.rst:1357 +#: ../../library/test.rst:1319 msgid "See :func:`threading.excepthook` documentation." msgstr "參閱 :func:`threading.excepthook` 文件。" -#: ../../library/test.rst:1359 +#: ../../library/test.rst:1321 msgid "These attributes are deleted at the context manager exit." msgstr "" -#: ../../library/test.rst:1379 +#: ../../library/test.rst:1341 msgid ":mod:`test.support.os_helper` --- Utilities for os tests" msgstr "" -#: ../../library/test.rst:1384 +#: ../../library/test.rst:1346 msgid "The :mod:`test.support.os_helper` module provides support for os tests." msgstr "" -#: ../../library/test.rst:1391 +#: ../../library/test.rst:1353 msgid "A non-ASCII character encodable by :func:`os.fsencode`." msgstr "" -#: ../../library/test.rst:1396 +#: ../../library/test.rst:1358 msgid "Set to :func:`os.getcwd`." msgstr "" -#: ../../library/test.rst:1401 +#: ../../library/test.rst:1363 msgid "" "Set to a name that is safe to use as the name of a temporary file. Any " "temporary file that is created should be closed and unlinked (removed)." msgstr "" -#: ../../library/test.rst:1407 +#: ../../library/test.rst:1369 msgid "" "Set to a filename containing the :data:`FS_NONASCII` character, if it " "exists. This guarantees that if the filename exists, it can be encoded and " @@ -1443,25 +1400,25 @@ msgid "" "a non-ASCII filename to be easily skipped on platforms where they can't work." msgstr "" -#: ../../library/test.rst:1415 +#: ../../library/test.rst:1377 msgid "" "Set to a filename (str type) that should not be able to be encoded by file " "system encoding in strict mode. It may be ``None`` if it's not possible to " "generate such a filename." msgstr "" -#: ../../library/test.rst:1422 +#: ../../library/test.rst:1384 msgid "" "Set to a filename (bytes type) that should not be able to be decoded by file " "system encoding in strict mode. It may be ``None`` if it's not possible to " "generate such a filename." msgstr "" -#: ../../library/test.rst:1429 +#: ../../library/test.rst:1391 msgid "Set to a non-ASCII name for a temporary file." msgstr "" -#: ../../library/test.rst:1434 +#: ../../library/test.rst:1396 msgid "" "Class used to temporarily set or unset environment variables. Instances can " "be used as a context manager and have a complete dictionary interface for " @@ -1470,75 +1427,75 @@ msgid "" "instance will be rolled back." msgstr "" -#: ../../library/test.rst:1440 +#: ../../library/test.rst:1402 msgid "Added dictionary interface." msgstr "新增字典介面。" -#: ../../library/test.rst:1446 +#: ../../library/test.rst:1408 msgid "" "Simple :term:`path-like object`. It implements the :meth:`__fspath__` " "method which just returns the *path* argument. If *path* is an exception, " "it will be raised in :meth:`!__fspath__`." msgstr "" -#: ../../library/test.rst:1453 +#: ../../library/test.rst:1415 msgid "" "Temporarily set the environment variable ``envvar`` to the value of " "``value``." msgstr "" -#: ../../library/test.rst:1459 +#: ../../library/test.rst:1421 msgid "Temporarily unset the environment variable ``envvar``." msgstr "" -#: ../../library/test.rst:1464 +#: ../../library/test.rst:1426 msgid "Return ``True`` if the OS supports symbolic links, ``False`` otherwise." msgstr "" -#: ../../library/test.rst:1470 +#: ../../library/test.rst:1432 msgid "Return ``True`` if the OS supports xattr, ``False`` otherwise." msgstr "" -#: ../../library/test.rst:1476 +#: ../../library/test.rst:1438 msgid "" "A context manager that temporarily changes the current working directory to " "*path* and yields the directory." msgstr "" -#: ../../library/test.rst:1479 +#: ../../library/test.rst:1441 msgid "" "If *quiet* is ``False``, the context manager raises an exception on error. " "Otherwise, it issues only a warning and keeps the current working directory " "the same." msgstr "" -#: ../../library/test.rst:1486 +#: ../../library/test.rst:1448 msgid "" "Create an empty file with *filename*. If it already exists, truncate it." msgstr "" -#: ../../library/test.rst:1491 +#: ../../library/test.rst:1453 msgid "Count the number of open file descriptors." msgstr "" -#: ../../library/test.rst:1496 +#: ../../library/test.rst:1458 msgid "Return ``True`` if the file system for *directory* is case-insensitive." msgstr "" -#: ../../library/test.rst:1501 +#: ../../library/test.rst:1463 msgid "" "Create an invalid file descriptor by opening and closing a temporary file, " "and returning its descriptor." msgstr "" -#: ../../library/test.rst:1507 +#: ../../library/test.rst:1469 msgid "" "Call :func:`os.rmdir` on *filename*. On Windows platforms, this is wrapped " "with a wait loop that checks for the existence of the file, which is needed " "due to antivirus programs that can hold files open and prevent deletion." msgstr "" -#: ../../library/test.rst:1515 +#: ../../library/test.rst:1477 msgid "" "Call :func:`shutil.rmtree` on *path* or call :func:`os.lstat` and :func:`os." "rmdir` to remove a path and its contents. As with :func:`rmdir`, on Windows " @@ -1546,21 +1503,21 @@ msgid "" "the files." msgstr "" -#: ../../library/test.rst:1523 +#: ../../library/test.rst:1485 msgid "A decorator for running tests that require support for symbolic links." msgstr "" -#: ../../library/test.rst:1528 +#: ../../library/test.rst:1490 msgid "A decorator for running tests that require support for xattr." msgstr "" -#: ../../library/test.rst:1533 +#: ../../library/test.rst:1495 msgid "" "A context manager that temporarily creates a new directory and changes the " "current working directory (CWD)." msgstr "" -#: ../../library/test.rst:1536 +#: ../../library/test.rst:1498 msgid "" "The context manager creates a temporary directory in the current directory " "with name *name* before temporarily changing the current working directory. " @@ -1568,20 +1525,20 @@ msgid "" "`tempfile.mkdtemp`." msgstr "" -#: ../../library/test.rst:1541 +#: ../../library/test.rst:1503 msgid "" "If *quiet* is ``False`` and it is not possible to create or change the CWD, " "an error is raised. Otherwise, only a warning is raised and the original " "CWD is used." msgstr "" -#: ../../library/test.rst:1548 +#: ../../library/test.rst:1510 msgid "" "A context manager that creates a temporary directory at *path* and yields " "the directory." msgstr "" -#: ../../library/test.rst:1551 +#: ../../library/test.rst:1513 msgid "" "If *path* is ``None``, the temporary directory is created using :func:" "`tempfile.mkdtemp`. If *quiet* is ``False``, the context manager raises an " @@ -1589,34 +1546,34 @@ msgid "" "created, only a warning is issued." msgstr "" -#: ../../library/test.rst:1559 +#: ../../library/test.rst:1521 msgid "A context manager that temporarily sets the process umask." msgstr "" -#: ../../library/test.rst:1564 +#: ../../library/test.rst:1526 msgid "" "Call :func:`os.unlink` on *filename*. As with :func:`rmdir`, on Windows " "platforms, this is wrapped with a wait loop that checks for the existence of " "the file." msgstr "" -#: ../../library/test.rst:1570 +#: ../../library/test.rst:1532 msgid ":mod:`test.support.import_helper` --- Utilities for import tests" msgstr "" -#: ../../library/test.rst:1575 +#: ../../library/test.rst:1537 msgid "" "The :mod:`test.support.import_helper` module provides support for import " "tests." msgstr "" -#: ../../library/test.rst:1582 +#: ../../library/test.rst:1544 msgid "" "Remove the module named *module_name* from ``sys.modules`` and delete any " "byte-compiled files of the module." msgstr "" -#: ../../library/test.rst:1588 +#: ../../library/test.rst:1550 msgid "" "This function imports and returns a fresh copy of the named Python module by " "removing the named module from ``sys.modules`` before doing the import. Note " @@ -1624,46 +1581,46 @@ msgid "" "operation." msgstr "" -#: ../../library/test.rst:1593 +#: ../../library/test.rst:1555 msgid "" "*fresh* is an iterable of additional module names that are also removed from " "the ``sys.modules`` cache before doing the import." msgstr "" -#: ../../library/test.rst:1596 +#: ../../library/test.rst:1558 msgid "" "*blocked* is an iterable of module names that are replaced with ``None`` in " "the module cache during the import to ensure that attempts to import them " "raise :exc:`ImportError`." msgstr "" -#: ../../library/test.rst:1600 +#: ../../library/test.rst:1562 msgid "" "The named module and any modules named in the *fresh* and *blocked* " "parameters are saved before starting the import and then reinserted into " "``sys.modules`` when the fresh import is complete." msgstr "" -#: ../../library/test.rst:1604 +#: ../../library/test.rst:1566 msgid "" "Module and package deprecation messages are suppressed during this import if " "*deprecated* is ``True``." msgstr "" -#: ../../library/test.rst:1607 +#: ../../library/test.rst:1569 msgid "" "This function will raise :exc:`ImportError` if the named module cannot be " "imported." msgstr "" -#: ../../library/test.rst:1624 +#: ../../library/test.rst:1586 msgid "" "This function imports and returns the named module. Unlike a normal import, " "this function raises :exc:`unittest.SkipTest` if the module cannot be " "imported." msgstr "" -#: ../../library/test.rst:1628 +#: ../../library/test.rst:1590 msgid "" "Module and package deprecation messages are suppressed during this import if " "*deprecated* is ``True``. If a module is required on a platform but " @@ -1671,21 +1628,21 @@ msgid "" "which will be compared against :data:`sys.platform`." msgstr "" -#: ../../library/test.rst:1638 +#: ../../library/test.rst:1600 msgid "Return a copy of :data:`sys.modules`." msgstr "" -#: ../../library/test.rst:1643 +#: ../../library/test.rst:1605 msgid "" "Remove modules except for *oldmodules* and ``encodings`` in order to " "preserve internal cache." msgstr "" -#: ../../library/test.rst:1649 +#: ../../library/test.rst:1611 msgid "Delete *name* from ``sys.modules``." msgstr "" -#: ../../library/test.rst:1654 +#: ../../library/test.rst:1616 msgid "" "Move a :pep:`3147`/:pep:`488` pyc file to its legacy pyc location and return " "the file system path to the legacy pyc file. The *source* value is the file " @@ -1693,42 +1650,42 @@ msgid "" "3147/488 pyc file must exist." msgstr "" -#: ../../library/test.rst:1662 +#: ../../library/test.rst:1624 msgid "" "A context manager to force import to return a new module reference. This is " "useful for testing module-level behaviors, such as the emission of a :exc:" "`DeprecationWarning` on import. Example usage::" msgstr "" -#: ../../library/test.rst:1672 +#: ../../library/test.rst:1634 msgid "A context manager to temporarily add directories to :data:`sys.path`." msgstr "" -#: ../../library/test.rst:1674 +#: ../../library/test.rst:1636 msgid "" "This makes a copy of :data:`sys.path`, appends any directories given as " "positional arguments, then reverts :data:`sys.path` to the copied settings " "when the context ends." msgstr "" -#: ../../library/test.rst:1678 +#: ../../library/test.rst:1640 msgid "" "Note that *all* :data:`sys.path` modifications in the body of the context " "manager, including replacement of the object, will be reverted at the end of " "the block." msgstr "" -#: ../../library/test.rst:1684 +#: ../../library/test.rst:1646 msgid ":mod:`test.support.warnings_helper` --- Utilities for warnings tests" msgstr "" -#: ../../library/test.rst:1689 +#: ../../library/test.rst:1651 msgid "" "The :mod:`test.support.warnings_helper` module provides support for warnings " "tests." msgstr "" -#: ../../library/test.rst:1696 +#: ../../library/test.rst:1658 msgid "" "Suppress warnings that are instances of *category*, which must be :exc:" "`Warning` or a subclass. Roughly equivalent to :func:`warnings." @@ -1736,14 +1693,14 @@ msgid "" "category=category) `. For example::" msgstr "" -#: ../../library/test.rst:1711 +#: ../../library/test.rst:1673 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:1718 +#: ../../library/test.rst:1680 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 " @@ -1755,7 +1712,7 @@ msgid "" "``None``, compares to the offset of the exception." msgstr "" -#: ../../library/test.rst:1732 +#: ../../library/test.rst:1694 msgid "" "A convenience wrapper for :func:`warnings.catch_warnings()` that makes it " "easier to test that a warning was correctly raised. It is approximately " @@ -1764,7 +1721,7 @@ msgid "" "automatically validate the results that are recorded." msgstr "" -#: ../../library/test.rst:1738 +#: ../../library/test.rst:1700 msgid "" "``check_warnings`` accepts 2-tuples of the form ``(\"message regexp\", " "WarningCategory)`` as positional arguments. If one or more *filters* are " @@ -1776,15 +1733,15 @@ msgid "" "*quiet* to ``True``." msgstr "" -#: ../../library/test.rst:1747 +#: ../../library/test.rst:1709 msgid "If no arguments are specified, it defaults to::" msgstr "" -#: ../../library/test.rst:1751 +#: ../../library/test.rst:1713 msgid "In this case all warnings are caught and no errors are raised." msgstr "" -#: ../../library/test.rst:1753 +#: ../../library/test.rst:1715 msgid "" "On entry to the context manager, a :class:`WarningRecorder` instance is " "returned. The underlying warnings list from :func:`~warnings.catch_warnings` " @@ -1796,39 +1753,39 @@ msgid "" "return ``None``." msgstr "" -#: ../../library/test.rst:1762 +#: ../../library/test.rst:1724 msgid "" "The recorder object also has a :meth:`reset` method, which clears the " "warnings list." msgstr "" -#: ../../library/test.rst:1765 +#: ../../library/test.rst:1727 msgid "The context manager is designed to be used like this::" msgstr "" -#: ../../library/test.rst:1772 +#: ../../library/test.rst:1734 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:1775 +#: ../../library/test.rst:1737 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:1789 +#: ../../library/test.rst:1751 msgid "" "Here all warnings will be caught, and the test code tests the captured " "warnings directly." msgstr "" -#: ../../library/test.rst:1792 +#: ../../library/test.rst:1754 msgid "New optional arguments *filters* and *quiet*." msgstr "" -#: ../../library/test.rst:1798 +#: ../../library/test.rst:1760 msgid "" "Class used to record warnings for unit tests. See documentation of :func:" "`check_warnings` above for more details." diff --git a/library/time.po b/library/time.po index 994feb6c80..a1e21ae69a 100644 --- a/library/time.po +++ b/library/time.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-10-14 15:34+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-" @@ -97,9 +97,9 @@ msgid "" "On the other hand, the precision of :func:`.time` and :func:`sleep` is " "better than their Unix equivalents: times are expressed as floating point " "numbers, :func:`.time` returns the most accurate time available (using Unix :" -"c:func:`gettimeofday` where available), and :func:`sleep` will accept a time " -"with a nonzero fraction (Unix :c:func:`select` is used to implement this, " -"where available)." +"c:func:`!gettimeofday` where available), and :func:`sleep` will accept a " +"time with a nonzero fraction (Unix :c:func:`!select` is used to implement " +"this, where available)." msgstr "" #: ../../library/time.rst:78 @@ -117,68 +117,68 @@ msgstr "關於這些物件的敘述請見 :class:`struct_time`\\ 。" #: ../../library/time.rst:86 msgid "" -"The :class:`struct_time` type was extended to provide the :attr:`tm_gmtoff` " -"and :attr:`tm_zone` attributes when platform supports corresponding ``struct " -"tm`` members." +"The :class:`struct_time` type was extended to provide the :attr:" +"`~struct_time.tm_gmtoff` and :attr:`~struct_time.tm_zone` attributes when " +"platform supports corresponding ``struct tm`` members." msgstr "" -#: ../../library/time.rst:91 +#: ../../library/time.rst:92 msgid "" -"The :class:`struct_time` attributes :attr:`tm_gmtoff` and :attr:`tm_zone` " -"are now available on all platforms." +"The :class:`struct_time` attributes :attr:`~struct_time.tm_gmtoff` and :attr:" +"`~struct_time.tm_zone` are now available on all platforms." msgstr "" -#: ../../library/time.rst:95 +#: ../../library/time.rst:97 msgid "Use the following functions to convert between time representations:" msgstr "" -#: ../../library/time.rst:98 +#: ../../library/time.rst:100 msgid "From" msgstr "" -#: ../../library/time.rst:98 +#: ../../library/time.rst:100 msgid "To" msgstr "" -#: ../../library/time.rst:98 +#: ../../library/time.rst:100 msgid "Use" msgstr "" -#: ../../library/time.rst:29 ../../library/time.rst:100 -#: ../../library/time.rst:103 ../../library/time.rst:106 -#: ../../library/time.rst:109 +#: ../../library/time.rst:29 ../../library/time.rst:102 +#: ../../library/time.rst:105 ../../library/time.rst:108 +#: ../../library/time.rst:111 msgid "seconds since the epoch" msgstr "" -#: ../../library/time.rst:100 ../../library/time.rst:106 +#: ../../library/time.rst:102 ../../library/time.rst:108 msgid ":class:`struct_time` in UTC" msgstr "" -#: ../../library/time.rst:100 +#: ../../library/time.rst:102 msgid ":func:`gmtime`" msgstr ":func:`gmtime`" -#: ../../library/time.rst:103 ../../library/time.rst:109 +#: ../../library/time.rst:105 ../../library/time.rst:111 msgid ":class:`struct_time` in local time" msgstr "" -#: ../../library/time.rst:103 +#: ../../library/time.rst:105 msgid ":func:`localtime`" msgstr ":func:`localtime`" -#: ../../library/time.rst:106 +#: ../../library/time.rst:108 msgid ":func:`calendar.timegm`" msgstr ":func:`calendar.timegm`" -#: ../../library/time.rst:109 +#: ../../library/time.rst:111 msgid ":func:`mktime`" msgstr ":func:`mktime`" -#: ../../library/time.rst:117 +#: ../../library/time.rst:119 msgid "Functions" msgstr "函式" -#: ../../library/time.rst:121 +#: ../../library/time.rst:123 msgid "" "Convert a tuple or :class:`struct_time` representing a time as returned by :" "func:`gmtime` or :func:`localtime` to a string of the following form: ``'Sun " @@ -186,94 +186,94 @@ msgid "" "padded if the day is a single digit, e.g.: ``'Wed Jun 9 04:26:40 1993'``." msgstr "" -#: ../../library/time.rst:127 +#: ../../library/time.rst:129 msgid "" "If *t* is not provided, the current time as returned by :func:`localtime` is " "used. Locale information is not used by :func:`asctime`." msgstr "" -#: ../../library/time.rst:132 +#: ../../library/time.rst:134 msgid "" "Unlike the C function of the same name, :func:`asctime` does not add a " "trailing newline." msgstr "" -#: ../../library/time.rst:137 +#: ../../library/time.rst:139 msgid "" "Return the *clk_id* of the thread-specific CPU-time clock for the specified " "*thread_id*." msgstr "" -#: ../../library/time.rst:139 +#: ../../library/time.rst:141 msgid "" "Use :func:`threading.get_ident` or the :attr:`~threading.Thread.ident` " "attribute of :class:`threading.Thread` objects to get a suitable value for " "*thread_id*." msgstr "" -#: ../../library/time.rst:144 +#: ../../library/time.rst:146 msgid "" "Passing an invalid or expired *thread_id* may result in undefined behavior, " "such as segmentation fault." msgstr "" -#: ../../library/time.rst:147 +#: ../../library/time.rst:149 msgid ":ref:`Availability `: Unix" msgstr ":ref:`適用 `:Unix" -#: ../../library/time.rst:149 +#: ../../library/time.rst:151 msgid "" "See the man page for :manpage:`pthread_getcpuclockid(3)` for further " "information." msgstr "" -#: ../../library/time.rst:156 +#: ../../library/time.rst:158 msgid "" "Return the resolution (precision) of the specified clock *clk_id*. Refer " "to :ref:`time-clock-id-constants` for a list of accepted values for *clk_id*." msgstr "" -#: ../../library/time.rst:159 ../../library/time.rst:172 -#: ../../library/time.rst:181 ../../library/time.rst:194 -#: ../../library/time.rst:203 ../../library/time.rst:680 -#: ../../library/time.rst:797 ../../library/time.rst:816 -#: ../../library/time.rst:844 ../../library/time.rst:879 +#: ../../library/time.rst:161 ../../library/time.rst:174 +#: ../../library/time.rst:183 ../../library/time.rst:196 +#: ../../library/time.rst:205 ../../library/time.rst:707 +#: ../../library/time.rst:824 ../../library/time.rst:843 +#: ../../library/time.rst:871 ../../library/time.rst:906 msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" -#: ../../library/time.rst:166 +#: ../../library/time.rst:168 msgid "" "Return the time of the specified clock *clk_id*. Refer to :ref:`time-clock-" "id-constants` for a list of accepted values for *clk_id*." msgstr "" -#: ../../library/time.rst:169 +#: ../../library/time.rst:171 msgid "" "Use :func:`clock_gettime_ns` to avoid the precision loss caused by the :" "class:`float` type." msgstr "" -#: ../../library/time.rst:179 +#: ../../library/time.rst:181 msgid "Similar to :func:`clock_gettime` but return time as nanoseconds." msgstr "" -#: ../../library/time.rst:188 +#: ../../library/time.rst:190 msgid "" "Set the time of the specified clock *clk_id*. Currently, :data:" "`CLOCK_REALTIME` is the only accepted value for *clk_id*." msgstr "" -#: ../../library/time.rst:191 +#: ../../library/time.rst:193 msgid "" "Use :func:`clock_settime_ns` to avoid the precision loss caused by the :" "class:`float` type." msgstr "" -#: ../../library/time.rst:201 +#: ../../library/time.rst:203 msgid "Similar to :func:`clock_settime` but set time with nanoseconds." msgstr "" -#: ../../library/time.rst:210 +#: ../../library/time.rst:212 msgid "" "Convert a time expressed in seconds since the epoch_ to a string of a form: " "``'Sun Jun 20 23:21:05 1993'`` representing local time. The day field is two " @@ -281,7 +281,7 @@ msgid "" "``'Wed Jun 9 04:26:40 1993'``." msgstr "" -#: ../../library/time.rst:215 +#: ../../library/time.rst:217 msgid "" "If *secs* is not provided or :const:`None`, the current time as returned by :" "func:`.time` is used. ``ctime(secs)`` is equivalent to " @@ -289,58 +289,58 @@ msgid "" "`ctime`." msgstr "" -#: ../../library/time.rst:223 +#: ../../library/time.rst:225 msgid "" "Get information on the specified clock as a namespace object. Supported " "clock names and the corresponding functions to read their value are:" msgstr "" -#: ../../library/time.rst:227 +#: ../../library/time.rst:229 msgid "``'monotonic'``: :func:`time.monotonic`" msgstr "``'monotonic'``\\ :\\ :func:`time.monotonic`" -#: ../../library/time.rst:228 +#: ../../library/time.rst:230 msgid "``'perf_counter'``: :func:`time.perf_counter`" msgstr "``'perf_counter'``\\ :\\ :func:`time.perf_counter`" -#: ../../library/time.rst:229 +#: ../../library/time.rst:231 msgid "``'process_time'``: :func:`time.process_time`" msgstr "``'process_time'``\\ :\\ :func:`time.process_time`" -#: ../../library/time.rst:230 +#: ../../library/time.rst:232 msgid "``'thread_time'``: :func:`time.thread_time`" msgstr "``'thread_time'``\\ :\\ :func:`time.thread_time`" -#: ../../library/time.rst:231 +#: ../../library/time.rst:233 msgid "``'time'``: :func:`time.time`" msgstr "``'time'``\\ :\\ :func:`time.time`" -#: ../../library/time.rst:233 +#: ../../library/time.rst:235 msgid "The result has the following attributes:" msgstr "" -#: ../../library/time.rst:235 +#: ../../library/time.rst:237 msgid "" "*adjustable*: ``True`` if the clock can be changed automatically (e.g. by a " "NTP daemon) or manually by the system administrator, ``False`` otherwise" msgstr "" -#: ../../library/time.rst:237 +#: ../../library/time.rst:239 msgid "" "*implementation*: The name of the underlying C function used to get the " "clock value. Refer to :ref:`time-clock-id-constants` for possible values." msgstr "" -#: ../../library/time.rst:239 +#: ../../library/time.rst:241 msgid "" "*monotonic*: ``True`` if the clock cannot go backward, ``False`` otherwise" msgstr "" -#: ../../library/time.rst:241 +#: ../../library/time.rst:243 msgid "*resolution*: The resolution of the clock in seconds (:class:`float`)" msgstr "" -#: ../../library/time.rst:248 +#: ../../library/time.rst:250 msgid "" "Convert a time expressed in seconds since the epoch_ to a :class:" "`struct_time` in UTC in which the dst flag is always zero. If *secs* is not " @@ -350,14 +350,14 @@ msgid "" "of this function." msgstr "" -#: ../../library/time.rst:258 +#: ../../library/time.rst:260 msgid "" "Like :func:`gmtime` but converts to local time. If *secs* is not provided " "or :const:`None`, the current time as returned by :func:`.time` is used. " "The dst flag is set to ``1`` when DST applies to the given time." msgstr "" -#: ../../library/time.rst:262 +#: ../../library/time.rst:264 msgid "" ":func:`localtime` may raise :exc:`OverflowError`, if the timestamp is " "outside the range of values supported by the platform C :c:func:`localtime` " @@ -366,7 +366,7 @@ msgid "" "between 1970 and 2038." msgstr "" -#: ../../library/time.rst:271 +#: ../../library/time.rst:273 msgid "" "This is the inverse function of :func:`localtime`. Its argument is the :" "class:`struct_time` or full 9-tuple (since the dst flag is needed; use " @@ -379,7 +379,7 @@ msgid "" "dependent." msgstr "" -#: ../../library/time.rst:283 +#: ../../library/time.rst:285 msgid "" "Return the value (in fractional seconds) of a monotonic clock, i.e. a clock " "that cannot go backwards. The clock is not affected by system clock " @@ -387,25 +387,25 @@ msgid "" "only the difference between the results of two calls is valid." msgstr "" -#: ../../library/time.rst:288 +#: ../../library/time.rst:290 msgid "" "Use :func:`monotonic_ns` to avoid the precision loss caused by the :class:" "`float` type." msgstr "" -#: ../../library/time.rst:293 +#: ../../library/time.rst:295 msgid "The function is now always available and always system-wide." msgstr "" -#: ../../library/time.rst:296 +#: ../../library/time.rst:298 msgid "On macOS, the function is now system-wide." msgstr "" -#: ../../library/time.rst:302 +#: ../../library/time.rst:304 msgid "Similar to :func:`monotonic`, but return time as nanoseconds." msgstr "" -#: ../../library/time.rst:311 +#: ../../library/time.rst:313 msgid "" "Return the value (in fractional seconds) of a performance counter, i.e. a " "clock with the highest available resolution to measure a short duration. It " @@ -414,21 +414,21 @@ msgid "" "between the results of two calls is valid." msgstr "" -#: ../../library/time.rst:317 +#: ../../library/time.rst:319 msgid "" "Use :func:`perf_counter_ns` to avoid the precision loss caused by the :class:" "`float` type." msgstr "" -#: ../../library/time.rst:322 +#: ../../library/time.rst:324 msgid "On Windows, the function is now system-wide." msgstr "" -#: ../../library/time.rst:327 +#: ../../library/time.rst:329 msgid "Similar to :func:`perf_counter`, but return time as nanoseconds." msgstr "" -#: ../../library/time.rst:339 +#: ../../library/time.rst:341 msgid "" "Return the value (in fractional seconds) of the sum of the system and user " "CPU time of the current process. It does not include time elapsed during " @@ -437,36 +437,36 @@ msgid "" "of two calls is valid." msgstr "" -#: ../../library/time.rst:345 +#: ../../library/time.rst:347 msgid "" "Use :func:`process_time_ns` to avoid the precision loss caused by the :class:" "`float` type." msgstr "" -#: ../../library/time.rst:352 +#: ../../library/time.rst:354 msgid "Similar to :func:`process_time` but return time as nanoseconds." msgstr "" -#: ../../library/time.rst:358 +#: ../../library/time.rst:360 msgid "" "Suspend execution of the calling thread for the given number of seconds. The " "argument may be a floating point number to indicate a more precise sleep " "time." msgstr "" -#: ../../library/time.rst:362 +#: ../../library/time.rst:364 msgid "" "If the sleep is interrupted by a signal and no exception is raised by the " "signal handler, the sleep is restarted with a recomputed timeout." msgstr "" -#: ../../library/time.rst:365 +#: ../../library/time.rst:367 msgid "" "The suspension time may be longer than requested by an arbitrary amount, " "because of the scheduling of other activity in the system." msgstr "" -#: ../../library/time.rst:368 +#: ../../library/time.rst:370 msgid "" "On Windows, if *secs* is zero, the thread relinquishes the remainder of its " "time slice to any other thread that is ready to run. If there are no other " @@ -477,36 +477,36 @@ msgid "" "nanoseconds. If *secs* is zero, ``Sleep(0)`` is used." msgstr "" -#: ../../library/time.rst:376 +#: ../../library/time.rst:378 msgid "Unix implementation:" msgstr "" -#: ../../library/time.rst:378 +#: ../../library/time.rst:380 msgid "Use ``clock_nanosleep()`` if available (resolution: 1 nanosecond);" msgstr "" -#: ../../library/time.rst:379 +#: ../../library/time.rst:381 msgid "Or use ``nanosleep()`` if available (resolution: 1 nanosecond);" msgstr "" -#: ../../library/time.rst:380 +#: ../../library/time.rst:382 msgid "Or use ``select()`` (resolution: 1 microsecond)." msgstr "" -#: ../../library/time.rst:382 +#: ../../library/time.rst:384 msgid "" "On Unix, the ``clock_nanosleep()`` and ``nanosleep()`` functions are now " "used if available. On Windows, a waitable timer is now used." msgstr "" -#: ../../library/time.rst:386 +#: ../../library/time.rst:388 msgid "" "The function now sleeps at least *secs* even if the sleep is interrupted by " "a signal, except if the signal handler raises an exception (see :pep:`475` " "for the rationale)." msgstr "" -#: ../../library/time.rst:397 +#: ../../library/time.rst:399 msgid "" "Convert a tuple or :class:`struct_time` representing a time as returned by :" "func:`gmtime` or :func:`localtime` to a string as specified by the *format* " @@ -515,267 +515,267 @@ msgid "" "raised if any field in *t* is outside of the allowed range." msgstr "" -#: ../../library/time.rst:403 +#: ../../library/time.rst:405 msgid "" "0 is a legal argument for any position in the time tuple; if it is normally " "illegal the value is forced to a correct one." msgstr "" -#: ../../library/time.rst:406 +#: ../../library/time.rst:408 msgid "" "The following directives can be embedded in the *format* string. They are " "shown without the optional field width and precision specification, and are " "replaced by the indicated characters in the :func:`strftime` result:" msgstr "" -#: ../../library/time.rst:411 +#: ../../library/time.rst:413 msgid "Directive" msgstr "" -#: ../../library/time.rst:411 +#: ../../library/time.rst:413 msgid "Meaning" msgstr "" -#: ../../library/time.rst:411 +#: ../../library/time.rst:413 msgid "Notes" msgstr "註解" -#: ../../library/time.rst:413 +#: ../../library/time.rst:415 msgid "``%a``" msgstr "``%a``" -#: ../../library/time.rst:413 +#: ../../library/time.rst:415 msgid "Locale's abbreviated weekday name." msgstr "" -#: ../../library/time.rst:416 +#: ../../library/time.rst:418 msgid "``%A``" msgstr "``%A``" -#: ../../library/time.rst:416 +#: ../../library/time.rst:418 msgid "Locale's full weekday name." msgstr "" -#: ../../library/time.rst:418 +#: ../../library/time.rst:420 msgid "``%b``" msgstr "``%b``" -#: ../../library/time.rst:418 +#: ../../library/time.rst:420 msgid "Locale's abbreviated month name." msgstr "" -#: ../../library/time.rst:421 +#: ../../library/time.rst:423 msgid "``%B``" msgstr "``%B``" -#: ../../library/time.rst:421 +#: ../../library/time.rst:423 msgid "Locale's full month name." msgstr "" -#: ../../library/time.rst:423 +#: ../../library/time.rst:425 msgid "``%c``" msgstr "``%c``" -#: ../../library/time.rst:423 +#: ../../library/time.rst:425 msgid "Locale's appropriate date and time representation." msgstr "" -#: ../../library/time.rst:426 +#: ../../library/time.rst:428 msgid "``%d``" msgstr "``%d``" -#: ../../library/time.rst:426 +#: ../../library/time.rst:428 msgid "Day of the month as a decimal number [01,31]." msgstr "" -#: ../../library/time.rst:429 +#: ../../library/time.rst:431 msgid "``%H``" msgstr "``%H``" -#: ../../library/time.rst:429 +#: ../../library/time.rst:431 msgid "Hour (24-hour clock) as a decimal number [00,23]." msgstr "" -#: ../../library/time.rst:432 +#: ../../library/time.rst:434 msgid "``%I``" msgstr "``%I``" -#: ../../library/time.rst:432 +#: ../../library/time.rst:434 msgid "Hour (12-hour clock) as a decimal number [01,12]." msgstr "" -#: ../../library/time.rst:435 +#: ../../library/time.rst:437 msgid "``%j``" msgstr "``%j``" -#: ../../library/time.rst:435 +#: ../../library/time.rst:437 msgid "Day of the year as a decimal number [001,366]." msgstr "" -#: ../../library/time.rst:438 +#: ../../library/time.rst:440 msgid "``%m``" msgstr "``%m``" -#: ../../library/time.rst:438 +#: ../../library/time.rst:440 msgid "Month as a decimal number [01,12]." msgstr "" -#: ../../library/time.rst:441 +#: ../../library/time.rst:443 msgid "``%M``" msgstr "``%M``" -#: ../../library/time.rst:441 +#: ../../library/time.rst:443 msgid "Minute as a decimal number [00,59]." msgstr "" -#: ../../library/time.rst:444 +#: ../../library/time.rst:446 msgid "``%p``" msgstr "``%p``" -#: ../../library/time.rst:444 +#: ../../library/time.rst:446 msgid "Locale's equivalent of either AM or PM." msgstr "" -#: ../../library/time.rst:444 +#: ../../library/time.rst:446 msgid "\\(1)" msgstr "\\(1)" -#: ../../library/time.rst:447 +#: ../../library/time.rst:449 msgid "``%S``" msgstr "``%S``" -#: ../../library/time.rst:447 +#: ../../library/time.rst:449 msgid "Second as a decimal number [00,61]." msgstr "" -#: ../../library/time.rst:447 +#: ../../library/time.rst:449 msgid "\\(2)" msgstr "\\(2)" -#: ../../library/time.rst:450 +#: ../../library/time.rst:452 msgid "``%U``" msgstr "``%U``" -#: ../../library/time.rst:450 +#: ../../library/time.rst:452 msgid "" "Week number of the year (Sunday as the first day of the week) as a decimal " "number [00,53]. All days in a new year preceding the first Sunday are " "considered to be in week 0." msgstr "" -#: ../../library/time.rst:450 ../../library/time.rst:461 +#: ../../library/time.rst:452 ../../library/time.rst:463 msgid "\\(3)" msgstr "\\(3)" -#: ../../library/time.rst:458 +#: ../../library/time.rst:460 msgid "``%w``" msgstr "``%w``" -#: ../../library/time.rst:458 +#: ../../library/time.rst:460 msgid "Weekday as a decimal number [0(Sunday),6]." msgstr "" -#: ../../library/time.rst:461 +#: ../../library/time.rst:463 msgid "``%W``" msgstr "``%W``" -#: ../../library/time.rst:461 +#: ../../library/time.rst:463 msgid "" "Week number of the year (Monday as the first day of the week) as a decimal " "number [00,53]. All days in a new year preceding the first Monday are " "considered to be in week 0." msgstr "" -#: ../../library/time.rst:469 +#: ../../library/time.rst:471 msgid "``%x``" msgstr "``%x``" -#: ../../library/time.rst:469 +#: ../../library/time.rst:471 msgid "Locale's appropriate date representation." msgstr "" -#: ../../library/time.rst:472 +#: ../../library/time.rst:474 msgid "``%X``" msgstr "``%X``" -#: ../../library/time.rst:472 +#: ../../library/time.rst:474 msgid "Locale's appropriate time representation." msgstr "" -#: ../../library/time.rst:475 +#: ../../library/time.rst:477 msgid "``%y``" msgstr "``%y``" -#: ../../library/time.rst:475 +#: ../../library/time.rst:477 msgid "Year without century as a decimal number [00,99]." msgstr "" -#: ../../library/time.rst:478 +#: ../../library/time.rst:480 msgid "``%Y``" msgstr "``%Y``" -#: ../../library/time.rst:478 +#: ../../library/time.rst:480 msgid "Year with century as a decimal number." msgstr "" -#: ../../library/time.rst:481 +#: ../../library/time.rst:483 msgid "``%z``" msgstr "``%z``" -#: ../../library/time.rst:481 +#: ../../library/time.rst:483 msgid "" "Time zone offset indicating a positive or negative time difference from UTC/" "GMT of the form +HHMM or -HHMM, where H represents decimal hour digits and M " "represents decimal minute digits [-23:59, +23:59]. [1]_" msgstr "" -#: ../../library/time.rst:487 +#: ../../library/time.rst:489 msgid "``%Z``" msgstr "``%Z``" -#: ../../library/time.rst:487 +#: ../../library/time.rst:489 msgid "Time zone name (no characters if no time zone exists). Deprecated. [1]_" msgstr "" -#: ../../library/time.rst:490 +#: ../../library/time.rst:492 msgid "``%%``" msgstr "``%%``" -#: ../../library/time.rst:490 +#: ../../library/time.rst:492 msgid "A literal ``'%'`` character." msgstr "" -#: ../../library/time.rst:493 +#: ../../library/time.rst:495 msgid "Notes:" msgstr "註解:" -#: ../../library/time.rst:496 +#: ../../library/time.rst:498 msgid "" "When used with the :func:`strptime` function, the ``%p`` directive only " "affects the output hour field if the ``%I`` directive is used to parse the " "hour." msgstr "" -#: ../../library/time.rst:500 +#: ../../library/time.rst:504 msgid "" "The range really is ``0`` to ``61``; value ``60`` is valid in timestamps " "representing `leap seconds`_ and value ``61`` is supported for historical " "reasons." msgstr "" -#: ../../library/time.rst:505 +#: ../../library/time.rst:509 msgid "" "When used with the :func:`strptime` function, ``%U`` and ``%W`` are only " "used in calculations when the day of the week and the year are specified." msgstr "" -#: ../../library/time.rst:508 +#: ../../library/time.rst:512 msgid "" "Here is an example, a format for dates compatible with that specified in " "the :rfc:`2822` Internet email standard. [1]_ ::" msgstr "" -#: ../../library/time.rst:515 +#: ../../library/time.rst:519 msgid "" "Additional directives may be supported on certain platforms, but only the " "ones listed here have a meaning standardized by ANSI C. To see the full set " @@ -783,7 +783,7 @@ msgid "" "`strftime(3)` documentation." msgstr "" -#: ../../library/time.rst:520 +#: ../../library/time.rst:524 msgid "" "On some platforms, an optional field width and precision specification can " "immediately follow the initial ``'%'`` of a directive in the following " @@ -791,13 +791,13 @@ msgid "" "``%j`` where it is 3." msgstr "" -#: ../../library/time.rst:531 +#: ../../library/time.rst:535 msgid "" "Parse a string representing a time according to a format. The return value " "is a :class:`struct_time` as returned by :func:`gmtime` or :func:`localtime`." msgstr "" -#: ../../library/time.rst:535 +#: ../../library/time.rst:539 msgid "" "The *format* parameter uses the same directives as those used by :func:" "`strftime`; it defaults to ``\"%a %b %d %H:%M:%S %Y\"`` which matches the " @@ -808,11 +808,11 @@ msgid "" "Both *string* and *format* must be strings." msgstr "" -#: ../../library/time.rst:543 +#: ../../library/time.rst:547 msgid "For example:" msgstr "" -#: ../../library/time.rst:550 +#: ../../library/time.rst:554 msgid "" "Support for the ``%Z`` directive is based on the values contained in " "``tzname`` and whether ``daylight`` is true. Because of this, it is " @@ -820,7 +820,7 @@ msgid "" "(and are considered to be non-daylight savings timezones)." msgstr "" -#: ../../library/time.rst:555 +#: ../../library/time.rst:559 msgid "" "Only the directives specified in the documentation are supported. Because " "``strftime()`` is implemented per platform it can sometimes offer more " @@ -829,7 +829,7 @@ msgid "" "are not documented as supported." msgstr "" -#: ../../library/time.rst:564 +#: ../../library/time.rst:568 msgid "" "The type of the time value sequence returned by :func:`gmtime`, :func:" "`localtime`, and :func:`strptime`. It is an object with a :term:`named " @@ -837,153 +837,109 @@ msgid "" "The following values are present:" msgstr "" -#: ../../library/time.rst:570 +#: ../../library/time.rst:575 msgid "Index" msgstr "" -#: ../../library/time.rst:570 +#: ../../library/time.rst:576 msgid "Attribute" msgstr "屬性" -#: ../../library/time.rst:570 +#: ../../library/time.rst:577 msgid "Values" msgstr "" -#: ../../library/time.rst:572 +#: ../../library/time.rst:579 msgid "0" msgstr "0" -#: ../../library/time.rst:572 -msgid ":attr:`tm_year`" -msgstr ":attr:`tm_year`" - -#: ../../library/time.rst:572 +#: ../../library/time.rst:581 msgid "(for example, 1993)" msgstr "(例如 1993)" -#: ../../library/time.rst:574 +#: ../../library/time.rst:583 msgid "1" msgstr "1" -#: ../../library/time.rst:574 -msgid ":attr:`tm_mon`" -msgstr ":attr:`tm_mon`" - -#: ../../library/time.rst:574 +#: ../../library/time.rst:585 msgid "range [1, 12]" msgstr "" -#: ../../library/time.rst:576 +#: ../../library/time.rst:587 msgid "2" msgstr "2" -#: ../../library/time.rst:576 -msgid ":attr:`tm_mday`" -msgstr ":attr:`tm_mday`" - -#: ../../library/time.rst:576 +#: ../../library/time.rst:589 msgid "range [1, 31]" msgstr "" -#: ../../library/time.rst:578 +#: ../../library/time.rst:591 msgid "3" msgstr "3" -#: ../../library/time.rst:578 -msgid ":attr:`tm_hour`" -msgstr ":attr:`tm_hour`" - -#: ../../library/time.rst:578 +#: ../../library/time.rst:593 msgid "range [0, 23]" msgstr "" -#: ../../library/time.rst:580 +#: ../../library/time.rst:595 msgid "4" msgstr "4" -#: ../../library/time.rst:580 -msgid ":attr:`tm_min`" -msgstr ":attr:`tm_min`" - -#: ../../library/time.rst:580 +#: ../../library/time.rst:597 msgid "range [0, 59]" msgstr "" -#: ../../library/time.rst:582 +#: ../../library/time.rst:599 msgid "5" msgstr "5" -#: ../../library/time.rst:582 -msgid ":attr:`tm_sec`" -msgstr ":attr:`tm_sec`" - -#: ../../library/time.rst:582 -msgid "range [0, 61]; see **(2)** in :func:`strftime` description" +#: ../../library/time.rst:601 +msgid "range [0, 61]; see :ref:`Note (2) ` in :func:`strftime`" msgstr "" -#: ../../library/time.rst:585 +#: ../../library/time.rst:603 msgid "6" msgstr "6" -#: ../../library/time.rst:585 -msgid ":attr:`tm_wday`" -msgstr ":attr:`tm_wday`" - -#: ../../library/time.rst:585 -msgid "range [0, 6], Monday is 0" +#: ../../library/time.rst:605 +msgid "range [0, 6]; Monday is 0" msgstr "" -#: ../../library/time.rst:587 +#: ../../library/time.rst:607 msgid "7" msgstr "7" -#: ../../library/time.rst:587 -msgid ":attr:`tm_yday`" -msgstr ":attr:`tm_yday`" - -#: ../../library/time.rst:587 +#: ../../library/time.rst:609 msgid "range [1, 366]" msgstr "" -#: ../../library/time.rst:589 +#: ../../library/time.rst:611 msgid "8" msgstr "8" -#: ../../library/time.rst:589 -msgid ":attr:`tm_isdst`" -msgstr ":attr:`tm_isdst`" - -#: ../../library/time.rst:589 +#: ../../library/time.rst:613 msgid "0, 1 or -1; see below" msgstr "" -#: ../../library/time.rst:591 ../../library/time.rst:593 +#: ../../library/time.rst:615 ../../library/time.rst:619 msgid "N/A" msgstr "N/A" -#: ../../library/time.rst:591 -msgid ":attr:`tm_zone`" -msgstr ":attr:`tm_zone`" - -#: ../../library/time.rst:591 +#: ../../library/time.rst:617 msgid "abbreviation of timezone name" msgstr "" -#: ../../library/time.rst:593 -msgid ":attr:`tm_gmtoff`" -msgstr ":attr:`tm_gmtoff`" - -#: ../../library/time.rst:593 +#: ../../library/time.rst:621 msgid "offset east of UTC in seconds" msgstr "" -#: ../../library/time.rst:596 +#: ../../library/time.rst:623 msgid "" "Note that unlike the C structure, the month value is a range of [1, 12], not " "[0, 11]." msgstr "" -#: ../../library/time.rst:599 +#: ../../library/time.rst:626 msgid "" "In calls to :func:`mktime`, :attr:`tm_isdst` may be set to 1 when daylight " "savings time is in effect, and 0 when it is not. A value of -1 indicates " @@ -991,14 +947,14 @@ msgid "" "filled in." msgstr "" -#: ../../library/time.rst:603 +#: ../../library/time.rst:630 msgid "" "When a tuple with an incorrect length is passed to a function expecting a :" "class:`struct_time`, or having elements of the wrong type, a :exc:" "`TypeError` is raised." msgstr "" -#: ../../library/time.rst:609 +#: ../../library/time.rst:636 msgid "" "Return the time in seconds since the epoch_ as a floating point number. The " "handling of `leap seconds`_ is platform dependent. On Windows and most Unix " @@ -1007,7 +963,7 @@ msgid "" "org/wiki/Unix_time>`_." msgstr "" -#: ../../library/time.rst:615 +#: ../../library/time.rst:642 msgid "" "Note that even though the time is always returned as a floating point " "number, not all systems provide time with a better precision than 1 second. " @@ -1016,7 +972,7 @@ msgid "" "between the two calls." msgstr "" -#: ../../library/time.rst:621 +#: ../../library/time.rst:648 msgid "" "The number returned by :func:`.time` may be converted into a more common " "time format (i.e. year, month, day, hour, etc...) in UTC by passing it to :" @@ -1026,19 +982,19 @@ msgid "" "attributes." msgstr "" -#: ../../library/time.rst:628 +#: ../../library/time.rst:655 msgid "" "Use :func:`time_ns` to avoid the precision loss caused by the :class:`float` " "type." msgstr "" -#: ../../library/time.rst:634 +#: ../../library/time.rst:661 msgid "" "Similar to :func:`~time.time` but returns time as an integer number of " "nanoseconds since the epoch_." msgstr "" -#: ../../library/time.rst:647 +#: ../../library/time.rst:674 msgid "" "Return the value (in fractional seconds) of the sum of the system and user " "CPU time of the current thread. It does not include time elapsed during " @@ -1047,25 +1003,25 @@ msgid "" "of two calls in the same thread is valid." msgstr "" -#: ../../library/time.rst:653 +#: ../../library/time.rst:680 msgid "" "Use :func:`thread_time_ns` to avoid the precision loss caused by the :class:" "`float` type." msgstr "" -#: ../../library/time.rst:656 +#: ../../library/time.rst:683 msgid ":ref:`Availability `: Linux, Unix, Windows." msgstr ":ref:`適用 `:Linux、Unix、Windows。" -#: ../../library/time.rst:658 +#: ../../library/time.rst:685 msgid "Unix systems supporting ``CLOCK_THREAD_CPUTIME_ID``." msgstr "" -#: ../../library/time.rst:665 +#: ../../library/time.rst:692 msgid "Similar to :func:`thread_time` but return time as nanoseconds." msgstr "" -#: ../../library/time.rst:672 +#: ../../library/time.rst:699 msgid "" "Reset the time conversion rules used by the library routines. The " "environment variable :envvar:`TZ` specifies how this is done. It will also " @@ -1076,42 +1032,42 @@ msgid "" "when daylight saving time applies)." msgstr "" -#: ../../library/time.rst:684 +#: ../../library/time.rst:711 msgid "" "Although in many cases, changing the :envvar:`TZ` environment variable may " "affect the output of functions like :func:`localtime` without calling :func:" "`tzset`, this behavior should not be relied on." msgstr "" -#: ../../library/time.rst:688 +#: ../../library/time.rst:715 msgid "The :envvar:`TZ` environment variable should contain no whitespace." msgstr "" -#: ../../library/time.rst:690 +#: ../../library/time.rst:717 msgid "" "The standard format of the :envvar:`TZ` environment variable is (whitespace " "added for clarity)::" msgstr "" -#: ../../library/time.rst:695 +#: ../../library/time.rst:722 msgid "Where the components are:" msgstr "" -#: ../../library/time.rst:699 +#: ../../library/time.rst:726 msgid "``std`` and ``dst``" msgstr "``std`` 和 ``dst``" -#: ../../library/time.rst:698 +#: ../../library/time.rst:725 msgid "" "Three or more alphanumerics giving the timezone abbreviations. These will be " "propagated into time.tzname" msgstr "" -#: ../../library/time.rst:705 +#: ../../library/time.rst:732 msgid "``offset``" msgstr "``offset``" -#: ../../library/time.rst:702 +#: ../../library/time.rst:729 msgid "" "The offset has the form: ``± hh[:mm[:ss]]``. This indicates the value added " "the local time to arrive at UTC. If preceded by a '-', the timezone is east " @@ -1119,41 +1075,41 @@ msgid "" "summer time is assumed to be one hour ahead of standard time." msgstr "" -#: ../../library/time.rst:727 +#: ../../library/time.rst:754 msgid "``start[/time], end[/time]``" msgstr "``start[/time], end[/time]``" -#: ../../library/time.rst:708 +#: ../../library/time.rst:735 msgid "" "Indicates when to change to and back from DST. The format of the start and " "end dates are one of the following:" msgstr "" -#: ../../library/time.rst:713 +#: ../../library/time.rst:740 msgid ":samp:`J{n}`" msgstr ":samp:`J{n}`" -#: ../../library/time.rst:712 +#: ../../library/time.rst:739 msgid "" "The Julian day *n* (1 <= *n* <= 365). Leap days are not counted, so in all " "years February 28 is day 59 and March 1 is day 60." msgstr "" -#: ../../library/time.rst:717 +#: ../../library/time.rst:744 msgid ":samp:`{n}`" msgstr ":samp:`{n}`" -#: ../../library/time.rst:716 +#: ../../library/time.rst:743 msgid "" "The zero-based Julian day (0 <= *n* <= 365). Leap days are counted, and it " "is possible to refer to February 29." msgstr "" -#: ../../library/time.rst:724 +#: ../../library/time.rst:751 msgid ":samp:`M{m}.{n}.{d}`" msgstr ":samp:`M{m}.{n}.{d}`" -#: ../../library/time.rst:720 +#: ../../library/time.rst:747 msgid "" "The *d*'th day (0 <= *d* <= 6) of week *n* of month *m* of the year (1 <= " "*n* <= 5, 1 <= *m* <= 12, where week 5 means \"the last *d* day in month " @@ -1161,13 +1117,13 @@ msgid "" "first week in which the *d*'th day occurs. Day zero is a Sunday." msgstr "" -#: ../../library/time.rst:726 +#: ../../library/time.rst:753 msgid "" "``time`` has the same format as ``offset`` except that no leading sign ('-' " "or '+') is allowed. The default, if time is not given, is 02:00:00." msgstr "" -#: ../../library/time.rst:740 +#: ../../library/time.rst:767 msgid "" "On many Unix systems (including \\*BSD, Linux, Solaris, and Darwin), it is " "more convenient to use the system's zoneinfo (:manpage:`tzfile(5)`) " @@ -1178,23 +1134,23 @@ msgid "" "``'Australia/Melbourne'``, ``'Egypt'`` or ``'Europe/Amsterdam'``. ::" msgstr "" -#: ../../library/time.rst:761 +#: ../../library/time.rst:788 msgid "Clock ID Constants" msgstr "" -#: ../../library/time.rst:763 +#: ../../library/time.rst:790 msgid "" "These constants are used as parameters for :func:`clock_getres` and :func:" "`clock_gettime`." msgstr "" -#: ../../library/time.rst:768 +#: ../../library/time.rst:795 msgid "" "Identical to :data:`CLOCK_MONOTONIC`, except it also includes any time that " "the system is suspended." msgstr "" -#: ../../library/time.rst:771 +#: ../../library/time.rst:798 msgid "" "This allows applications to get a suspend-aware monotonic clock without " "having to deal with the complications of :data:`CLOCK_REALTIME`, which may " @@ -1202,103 +1158,103 @@ msgid "" "similar." msgstr "" -#: ../../library/time.rst:776 +#: ../../library/time.rst:803 msgid ":ref:`Availability `: Linux >= 2.6.39." msgstr ":ref:`適用 `:Linux 2.6.39 以上。" -#: ../../library/time.rst:783 +#: ../../library/time.rst:810 msgid "" "The Solaris OS has a ``CLOCK_HIGHRES`` timer that attempts to use an optimal " "hardware source, and may give close to nanosecond resolution. " "``CLOCK_HIGHRES`` is the nonadjustable, high-resolution clock." msgstr "" -#: ../../library/time.rst:787 +#: ../../library/time.rst:814 msgid ":ref:`Availability `: Solaris." msgstr ":ref:`適用 `:Solaris。" -#: ../../library/time.rst:794 +#: ../../library/time.rst:821 msgid "" "Clock that cannot be set and represents monotonic time since some " "unspecified starting point." msgstr "" -#: ../../library/time.rst:804 +#: ../../library/time.rst:831 msgid "" "Similar to :data:`CLOCK_MONOTONIC`, but provides access to a raw hardware-" "based time that is not subject to NTP adjustments." msgstr "" -#: ../../library/time.rst:807 +#: ../../library/time.rst:834 msgid ":ref:`Availability `: Linux >= 2.6.28, macOS >= 10.12." msgstr ":ref:`適用 `:Linux 2.6.28 以上、macOS 10.12 以上。" -#: ../../library/time.rst:814 ../../library/time.rst:823 +#: ../../library/time.rst:841 ../../library/time.rst:850 msgid "High-resolution per-process timer from the CPU." msgstr "" -#: ../../library/time.rst:825 +#: ../../library/time.rst:852 msgid ":ref:`Availability `: FreeBSD, NetBSD >= 7, OpenBSD." msgstr ":ref:`適用 `:FreeBSD、NetBSD 7 以上、OpenBSD。" -#: ../../library/time.rst:831 +#: ../../library/time.rst:858 msgid "" "`International Atomic Time `_" msgstr "" -#: ../../library/time.rst:833 +#: ../../library/time.rst:860 msgid "" "The system must have a current leap second table in order for this to give " "the correct answer. PTP or NTP software can maintain a leap second table." msgstr "" -#: ../../library/time.rst:836 +#: ../../library/time.rst:863 msgid ":ref:`Availability `: Linux." msgstr ":ref:`適用 `:Linux。" -#: ../../library/time.rst:842 +#: ../../library/time.rst:869 msgid "Thread-specific CPU-time clock." msgstr "" -#: ../../library/time.rst:851 +#: ../../library/time.rst:878 msgid "" "Time whose absolute value is the time the system has been running and not " "suspended, providing accurate uptime measurement, both absolute and interval." msgstr "" -#: ../../library/time.rst:855 +#: ../../library/time.rst:882 msgid ":ref:`Availability `: FreeBSD, OpenBSD >= 5.5." msgstr ":ref:`適用 `:FreeBSD、OpenBSD 5.5 以上。" -#: ../../library/time.rst:862 +#: ../../library/time.rst:889 msgid "" "Clock that increments monotonically, tracking the time since an arbitrary " "point, unaffected by frequency or time adjustments and not incremented while " "the system is asleep." msgstr "" -#: ../../library/time.rst:866 +#: ../../library/time.rst:893 msgid ":ref:`Availability `: macOS >= 10.12." msgstr ":ref:`適用 `:macOS 10.12 以上。" -#: ../../library/time.rst:870 +#: ../../library/time.rst:897 msgid "" "The following constant is the only parameter that can be sent to :func:" "`clock_settime`." msgstr "" -#: ../../library/time.rst:876 +#: ../../library/time.rst:903 msgid "" "System-wide real-time clock. Setting this clock requires appropriate " "privileges." msgstr "" -#: ../../library/time.rst:887 +#: ../../library/time.rst:914 msgid "Timezone Constants" msgstr "" -#: ../../library/time.rst:891 +#: ../../library/time.rst:918 msgid "" "The offset of the local DST timezone, in seconds west of UTC, if one is " "defined. This is negative if the local DST timezone is east of UTC (as in " @@ -1306,68 +1262,68 @@ msgid "" "nonzero. See note below." msgstr "" -#: ../../library/time.rst:897 +#: ../../library/time.rst:924 msgid "Nonzero if a DST timezone is defined. See note below." msgstr "" -#: ../../library/time.rst:901 +#: ../../library/time.rst:928 msgid "" "The offset of the local (non-DST) timezone, in seconds west of UTC (negative " "in most of Western Europe, positive in the US, zero in the UK). See note " "below." msgstr "" -#: ../../library/time.rst:906 +#: ../../library/time.rst:933 msgid "" "A tuple of two strings: the first is the name of the local non-DST timezone, " "the second is the name of the local DST timezone. If no DST timezone is " "defined, the second string should not be used. See note below." msgstr "" -#: ../../library/time.rst:912 +#: ../../library/time.rst:939 msgid "" "For the above Timezone constants (:data:`altzone`, :data:`daylight`, :data:" "`timezone`, and :data:`tzname`), the value is determined by the timezone " "rules in effect at module load time or the last time :func:`tzset` is called " "and may be incorrect for times in the past. It is recommended to use the :" -"attr:`tm_gmtoff` and :attr:`tm_zone` results from :func:`localtime` to " -"obtain timezone information." +"attr:`~struct_time.tm_gmtoff` and :attr:`~struct_time.tm_zone` results from :" +"func:`localtime` to obtain timezone information." msgstr "" -#: ../../library/time.rst:922 +#: ../../library/time.rst:949 msgid "Module :mod:`datetime`" msgstr ":mod:`datetime` 模組" -#: ../../library/time.rst:922 +#: ../../library/time.rst:949 msgid "More object-oriented interface to dates and times." msgstr "" -#: ../../library/time.rst:926 +#: ../../library/time.rst:953 msgid "Module :mod:`locale`" msgstr ":mod:`locale` 模組" -#: ../../library/time.rst:925 +#: ../../library/time.rst:952 msgid "" "Internationalization services. The locale setting affects the " "interpretation of many format specifiers in :func:`strftime` and :func:" "`strptime`." msgstr "" -#: ../../library/time.rst:929 +#: ../../library/time.rst:956 msgid "Module :mod:`calendar`" msgstr ":mod:`calendar` 模組" -#: ../../library/time.rst:929 +#: ../../library/time.rst:956 msgid "" "General calendar-related functions. :func:`~calendar.timegm` is the " "inverse of :func:`gmtime` from this module." msgstr "" -#: ../../library/time.rst:933 +#: ../../library/time.rst:960 msgid "Footnotes" msgstr "註解" -#: ../../library/time.rst:934 +#: ../../library/time.rst:961 msgid "" "The use of ``%Z`` is now deprecated, but the ``%z`` escape that expands to " "the preferred hour/minute offset is not supported by all ANSI C libraries. " @@ -1406,23 +1362,56 @@ msgstr "Greenwich Mean Time(格林威治標準時間)" msgid "Daylight Saving Time" msgstr "Daylight Saving Time(日光節約時間)" -#: ../../library/time.rst:308 ../../library/time.rst:334 -#: ../../library/time.rst:642 +#: ../../library/time.rst:310 ../../library/time.rst:336 +#: ../../library/time.rst:669 msgid "benchmarking" msgstr "benchmarking(基準測試)" -#: ../../library/time.rst:334 ../../library/time.rst:642 +#: ../../library/time.rst:336 ../../library/time.rst:669 msgid "CPU time" msgstr "CPU time(CPU 時間)" -#: ../../library/time.rst:334 ../../library/time.rst:642 +#: ../../library/time.rst:336 ../../library/time.rst:669 msgid "processor time" msgstr "processor time(處理器時間)" -#: ../../library/time.rst:392 ../../library/time.rst:526 +#: ../../library/time.rst:394 ../../library/time.rst:530 msgid "% (percent)" msgstr "% (百分號)" -#: ../../library/time.rst:392 ../../library/time.rst:526 +#: ../../library/time.rst:394 ../../library/time.rst:530 msgid "datetime format" msgstr "datetime format(日期時間格式)" + +#~ msgid ":attr:`tm_year`" +#~ msgstr ":attr:`tm_year`" + +#~ msgid ":attr:`tm_mon`" +#~ msgstr ":attr:`tm_mon`" + +#~ msgid ":attr:`tm_mday`" +#~ msgstr ":attr:`tm_mday`" + +#~ msgid ":attr:`tm_hour`" +#~ msgstr ":attr:`tm_hour`" + +#~ msgid ":attr:`tm_min`" +#~ msgstr ":attr:`tm_min`" + +#~ msgid ":attr:`tm_sec`" +#~ msgstr ":attr:`tm_sec`" + +#~ msgid ":attr:`tm_wday`" +#~ msgstr ":attr:`tm_wday`" + +#~ msgid ":attr:`tm_yday`" +#~ msgstr ":attr:`tm_yday`" + +#~ msgid ":attr:`tm_isdst`" +#~ msgstr ":attr:`tm_isdst`" + +#~ msgid ":attr:`tm_zone`" +#~ msgstr ":attr:`tm_zone`" + +#~ msgid ":attr:`tm_gmtoff`" +#~ msgstr ":attr:`tm_gmtoff`" diff --git a/library/tkinter.messagebox.po b/library/tkinter.messagebox.po index e773cefb23..8cc691f0de 100644 --- a/library/tkinter.messagebox.po +++ b/library/tkinter.messagebox.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-13 00:11+0000\n" +"POT-Creation-Date: 2023-11-02 00:03+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-" @@ -30,23 +30,216 @@ msgstr "**原始碼:**\\ :source:`Lib/tkinter/messagebox.py`" msgid "" "The :mod:`tkinter.messagebox` module provides a template base class as well " "as a variety of convenience methods for commonly used configurations. The " -"message boxes are modal and will return a subset of (True, False, OK, None, " -"Yes, No) based on the user's selection. Common message box styles and " -"layouts include but are not limited to:" +"message boxes are modal and will return a subset of (``True``, ``False``, " +"``None``, :data:`OK`, :data:`CANCEL`, :data:`YES`, :data:`NO`) based on the " +"user's selection. Common message box styles and layouts include but are not " +"limited to:" msgstr "" -#: ../../library/tkinter.messagebox.rst:22 -msgid "Create a default information message box." +#: ../../library/tkinter.messagebox.rst:23 +msgid "" +"Create a message window with an application-specified message, an icon and a " +"set of buttons. Each of the buttons in the message window is identified by a " +"unique symbolic name (see the *type* options)." +msgstr "" + +#: ../../library/tkinter.messagebox.rst:27 +msgid "The following options are supported:" +msgstr "" + +#: ../../library/tkinter.messagebox.rst:33 +msgid "*command*" +msgstr "*command*" + +#: ../../library/tkinter.messagebox.rst:30 +msgid "" +"Specifies the function to invoke when the user closes the dialog. The name " +"of the button clicked by the user to close the dialog is passed as argument. " +"This is only available on macOS." +msgstr "" + +#: ../../library/tkinter.messagebox.rst:39 +msgid "*default*" +msgstr "*default*" + +#: ../../library/tkinter.messagebox.rst:36 +msgid "" +"Gives the :ref:`symbolic name ` of the default button " +"for this message window (:data:`OK`, :data:`CANCEL`, and so on). If this " +"option is not specified, the first button in the dialog will be made the " +"default." +msgstr "" + +#: ../../library/tkinter.messagebox.rst:46 +msgid "*detail*" +msgstr "*detail*" + +#: ../../library/tkinter.messagebox.rst:42 +msgid "" +"Specifies an auxiliary message to the main message given by the *message* " +"option. The message detail will be presented beneath the main message and, " +"where supported by the OS, in a less emphasized font than the main message." +msgstr "" + +#: ../../library/tkinter.messagebox.rst:51 +msgid "*icon*" +msgstr "*icon*" + +#: ../../library/tkinter.messagebox.rst:49 +msgid "" +"Specifies an :ref:`icon ` to display. If this option is " +"not specified, then the :data:`INFO` icon will be displayed." +msgstr "" + +#: ../../library/tkinter.messagebox.rst:55 +msgid "*message*" +msgstr "*message*" + +#: ../../library/tkinter.messagebox.rst:54 +msgid "" +"Specifies the message to display in this message box. The default value is " +"an empty string." +msgstr "" + +#: ../../library/tkinter.messagebox.rst:59 +msgid "*parent*" +msgstr "*parent*" + +#: ../../library/tkinter.messagebox.rst:58 +msgid "" +"Makes the specified window the logical parent of the message box. The " +"message box is displayed on top of its parent window." +msgstr "" + +#: ../../library/tkinter.messagebox.rst:64 +msgid "*title*" +msgstr "*title*" + +#: ../../library/tkinter.messagebox.rst:62 +msgid "" +"Specifies a string to display as the title of the message box. This option " +"is ignored on macOS, where platform guidelines forbid the use of a title on " +"this kind of dialog." +msgstr "" + +#: ../../library/tkinter.messagebox.rst:68 +msgid "*type*" +msgstr "*type*" + +#: ../../library/tkinter.messagebox.rst:67 +msgid "" +"Arranges for a :ref:`predefined set of buttons ` to be " +"displayed." +msgstr "" + +#: ../../library/tkinter.messagebox.rst:72 +msgid "" +"Display a message window and wait for the user to select one of the buttons. " +"Then return the symbolic name of the selected button. Keyword arguments can " +"override options specified in the constructor." msgstr "" -#: ../../library/tkinter.messagebox.rst:24 +#: ../../library/tkinter.messagebox.rst:76 msgid "**Information message box**" msgstr "" -#: ../../library/tkinter.messagebox.rst:28 +#: ../../library/tkinter.messagebox.rst:80 +msgid "" +"Creates and displays an information message box with the specified title and " +"message." +msgstr "" + +#: ../../library/tkinter.messagebox.rst:83 msgid "**Warning message boxes**" msgstr "" -#: ../../library/tkinter.messagebox.rst:33 +#: ../../library/tkinter.messagebox.rst:87 +msgid "" +"Creates and displays a warning message box with the specified title and " +"message." +msgstr "" + +#: ../../library/tkinter.messagebox.rst:92 +msgid "" +"Creates and displays an error message box with the specified title and " +"message." +msgstr "" + +#: ../../library/tkinter.messagebox.rst:95 msgid "**Question message boxes**" msgstr "" + +#: ../../library/tkinter.messagebox.rst:99 +msgid "" +"Ask a question. By default shows buttons :data:`YES` and :data:`NO`. Returns " +"the symbolic name of the selected button." +msgstr "" + +#: ../../library/tkinter.messagebox.rst:104 +msgid "" +"Ask if operation should proceed. Shows buttons :data:`OK` and :data:" +"`CANCEL`. Returns ``True`` if the answer is ok and ``False`` otherwise." +msgstr "" + +#: ../../library/tkinter.messagebox.rst:109 +msgid "" +"Ask if operation should be retried. Shows buttons :data:`RETRY` and :data:" +"`CANCEL`. Return ``True`` if the answer is yes and ``False`` otherwise." +msgstr "" + +#: ../../library/tkinter.messagebox.rst:114 +msgid "" +"Ask a question. Shows buttons :data:`YES` and :data:`NO`. Returns ``True`` " +"if the answer is yes and ``False`` otherwise." +msgstr "" + +#: ../../library/tkinter.messagebox.rst:119 +msgid "" +"Ask a question. Shows buttons :data:`YES`, :data:`NO` and :data:`CANCEL`. " +"Return ``True`` if the answer is yes, ``None`` if cancelled, and ``False`` " +"otherwise." +msgstr "" + +#: ../../library/tkinter.messagebox.rst:126 +msgid "Symbolic names of buttons:" +msgstr "" + +#: ../../library/tkinter.messagebox.rst:145 +msgid "Predefined sets of buttons:" +msgstr "" + +#: ../../library/tkinter.messagebox.rst:150 +msgid "" +"Displays three buttons whose symbolic names are :data:`ABORT`, :data:`RETRY` " +"and :data:`IGNORE`." +msgstr "" + +#: ../../library/tkinter.messagebox.rst:157 +msgid "Displays one button whose symbolic name is :data:`OK`." +msgstr "" + +#: ../../library/tkinter.messagebox.rst:162 +msgid "" +"Displays two buttons whose symbolic names are :data:`OK` and :data:`CANCEL`." +msgstr "" + +#: ../../library/tkinter.messagebox.rst:168 +msgid "" +"Displays two buttons whose symbolic names are :data:`RETRY` and :data:" +"`CANCEL`." +msgstr "" + +#: ../../library/tkinter.messagebox.rst:174 +msgid "" +"Displays two buttons whose symbolic names are :data:`YES` and :data:`NO`." +msgstr "" + +#: ../../library/tkinter.messagebox.rst:180 +msgid "" +"Displays three buttons whose symbolic names are :data:`YES`, :data:`NO` and :" +"data:`CANCEL`." +msgstr "" + +#: ../../library/tkinter.messagebox.rst:185 +msgid "Icon images:" +msgstr "" diff --git a/library/tty.po b/library/tty.po index 112a009880..4f00be48f5 100644 --- a/library/tty.po +++ b/library/tty.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-11 17:13+0000\n" +"POT-Creation-Date: 2023-11-01 00:03+0000\n" "PO-Revision-Date: 2021-12-17 17:00+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -36,27 +36,31 @@ msgid "" msgstr ":mod:`tty` 模組定義了將 tty 放入 cbreak 和 raw 模式的函式。" #: ../../library/tty.rst:18 +msgid ":ref:`Availability `: Unix." +msgstr ":ref:`適用 `:Unix。" + +#: ../../library/tty.rst:20 msgid "" "Because it requires the :mod:`termios` module, it will work only on Unix." msgstr "因為它需要 :mod:`termios` 模組,所以只能在 Unix 上執行。" -#: ../../library/tty.rst:20 +#: ../../library/tty.rst:22 msgid "The :mod:`tty` module defines the following functions:" msgstr ":mod:`tty` 模組定義了以下函式:" -#: ../../library/tty.rst:25 +#: ../../library/tty.rst:27 msgid "" "Convert the tty attribute list *mode*, which is a list like the one returned " "by :func:`termios.tcgetattr`, to that of a tty in raw mode." msgstr "" -#: ../../library/tty.rst:33 +#: ../../library/tty.rst:35 msgid "" "Convert the tty attribute list *mode*, which is a list like the one returned " "by :func:`termios.tcgetattr`, to that of a tty in cbreak mode." msgstr "" -#: ../../library/tty.rst:41 +#: ../../library/tty.rst:43 #, fuzzy msgid "" "Change the mode of the file descriptor *fd* to raw. If *when* is omitted, it " @@ -67,11 +71,11 @@ msgstr "" "將檔案描述器 *fd* 的模式更改為 raw。如果 *when* 被省略,則預設為 :const:" "`termios.TCSAFLUSH`,並傳遞給 :func:`termios.tcsetattr`。" -#: ../../library/tty.rst:46 ../../library/tty.rst:57 +#: ../../library/tty.rst:48 ../../library/tty.rst:59 msgid "The return value is now the original tty attributes, instead of None." msgstr "" -#: ../../library/tty.rst:52 +#: ../../library/tty.rst:54 #, fuzzy msgid "" "Change the mode of file descriptor *fd* to cbreak. If *when* is omitted, it " @@ -82,10 +86,10 @@ msgstr "" "將檔案描述器 *fd* 的模式更改為 cbreak。如果 *when* 被省略,則預設為 :const:" "`termios.TCSAFLUSH`,並傳遞給 :func:`termios.tcsetattr`。" -#: ../../library/tty.rst:63 +#: ../../library/tty.rst:65 msgid "Module :mod:`termios`" msgstr ":mod:`termios` 模組" -#: ../../library/tty.rst:64 +#: ../../library/tty.rst:66 msgid "Low-level terminal control interface." msgstr "低階終端機控制介面。" diff --git a/library/typing.po b/library/typing.po index 59abe80c15..8267d8a0bf 100644 --- a/library/typing.po +++ b/library/typing.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-11 17:13+0000\n" +"POT-Creation-Date: 2023-10-25 00:03+0000\n" "PO-Revision-Date: 2023-09-05 14:49+0800\n" "Last-Translator: RockLeon \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -449,8 +449,8 @@ msgid "" "of type :class:`int` and returns a :class:`str`." msgstr "" -#: ../../library/typing.rst:271 ../../library/typing.rst:2888 -#: ../../library/typing.rst:3030 +#: ../../library/typing.rst:271 ../../library/typing.rst:2894 +#: ../../library/typing.rst:3036 msgid "For example:" msgstr "舉例來說:" @@ -471,7 +471,7 @@ msgstr "" #: ../../library/typing.rst:306 msgid "" "``Callable`` cannot express complex signatures such as functions that take a " -"variadic number of arguments, :func:`overloaded functions `, or " +"variadic number of arguments, :ref:`overloaded functions `, or " "functions that have keyword-only parameters. However, these signatures can " "be expressed by defining a :class:`Protocol` class with a :meth:`~object." "__call__` method:" @@ -488,7 +488,7 @@ msgid "" "ReturnType]`` respectively." msgstr "" -#: ../../library/typing.rst:341 ../../library/typing.rst:3559 +#: ../../library/typing.rst:341 ../../library/typing.rst:3565 msgid "" "``Callable`` now supports :class:`ParamSpec` and :data:`Concatenate`. See :" "pep:`612` for more details." @@ -598,8 +598,8 @@ msgstr "" #: ../../library/typing.rst:528 msgid "" "This syntax indicates that the class ``LoggedVar`` is parameterised around a " -"single :class:`type variable ` ``T`` . This also makes ``T`` valid " -"as a type within the class body." +"single :ref:`type variable ` ``T`` . This also makes ``T`` valid as " +"a type within the class body." msgstr "" #: ../../library/typing.rst:532 @@ -870,7 +870,7 @@ msgstr "" #: ../../library/typing.rst:843 ../../library/typing.rst:934 #: ../../library/typing.rst:954 ../../library/typing.rst:1011 #: ../../library/typing.rst:1180 ../../library/typing.rst:1237 -#: ../../library/typing.rst:1446 ../../library/typing.rst:2828 +#: ../../library/typing.rst:1446 ../../library/typing.rst:2834 msgid "For example::" msgstr "" "舉例來說:\n" @@ -896,7 +896,7 @@ msgid "" "``LiteralString``." msgstr "" -#: ../../library/typing.rst:877 ../../library/typing.rst:1957 +#: ../../library/typing.rst:877 ../../library/typing.rst:1961 msgid "Example:" msgstr "" "舉例來說:\n" @@ -1127,7 +1127,7 @@ msgid "" "passed in::" msgstr "" -#: ../../library/typing.rst:1167 ../../library/typing.rst:1925 +#: ../../library/typing.rst:1167 ../../library/typing.rst:1929 msgid "" ":pep:`612` -- Parameter Specification Variables (the PEP which introduced " "``ParamSpec`` and ``Concatenate``)" @@ -1137,7 +1137,7 @@ msgstr "" msgid ":class:`ParamSpec`" msgstr ":class:`ParamSpec`。" -#: ../../library/typing.rst:1170 ../../library/typing.rst:1928 +#: ../../library/typing.rst:1170 ../../library/typing.rst:1932 msgid ":ref:`annotating-callables`" msgstr ":ref:`annotating-callables`" @@ -1199,7 +1199,7 @@ msgid "" "scopes cannot be overridden in subclasses." msgstr "" -#: ../../library/typing.rst:1248 ../../library/typing.rst:2844 +#: ../../library/typing.rst:1248 ../../library/typing.rst:2850 msgid "" "There is no runtime checking of these properties. See :pep:`591` for more " "details." @@ -1434,9 +1434,9 @@ msgstr "" #: ../../library/typing.rst:1485 msgid "" -"For example, using the unpack operator ``*`` on a :class:`type variable " -"tuple ` is equivalent to using ``Unpack`` to mark the type " -"variable tuple as having been unpacked::" +"For example, using the unpack operator ``*`` on a :ref:`type variable tuple " +"` is equivalent to using ``Unpack`` to mark the type variable " +"tuple as having been unpacked::" msgstr "" #: ../../library/typing.rst:1494 @@ -1510,29 +1510,29 @@ msgid "" "must be declared separately::" msgstr "" -#: ../../library/typing.rst:1579 +#: ../../library/typing.rst:1581 msgid "Type variable." msgstr "" -#: ../../library/typing.rst:1581 +#: ../../library/typing.rst:1583 msgid "" "The preferred way to construct a type variable is via the dedicated syntax " "for :ref:`generic functions `, :ref:`generic classes " "`, and :ref:`generic type aliases `::" msgstr "" -#: ../../library/typing.rst:1589 +#: ../../library/typing.rst:1591 msgid "" "This syntax can also be used to create bound and constrained type variables::" msgstr "" -#: ../../library/typing.rst:1599 +#: ../../library/typing.rst:1601 msgid "" "However, if desired, reusable type variables can also be constructed " "manually, like so::" msgstr "" -#: ../../library/typing.rst:1605 +#: ../../library/typing.rst:1607 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 " @@ -1540,13 +1540,13 @@ msgid "" "information on generic types. Generic functions work as follows::" msgstr "" -#: ../../library/typing.rst:1626 +#: ../../library/typing.rst:1628 msgid "" "Note that type variables can be *bound*, *constrained*, or neither, but " "cannot be both bound *and* constrained." msgstr "" -#: ../../library/typing.rst:1629 +#: ../../library/typing.rst:1631 msgid "" "The variance of type variables is inferred by type checkers when they are " "created through the :ref:`type parameter syntax ` or when " @@ -1556,92 +1556,92 @@ msgid "" "invariant. See :pep:`484` and :pep:`695` for more details." msgstr "" -#: ../../library/typing.rst:1637 +#: ../../library/typing.rst:1639 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:1652 +#: ../../library/typing.rst:1654 msgid "" "Type variables can be bound to concrete types, abstract types (ABCs or " "protocols), and even unions of types::" msgstr "" -#: ../../library/typing.rst:1664 +#: ../../library/typing.rst:1666 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:1675 +#: ../../library/typing.rst:1677 msgid "At runtime, ``isinstance(x, T)`` will raise :exc:`TypeError`." msgstr "" -#: ../../library/typing.rst:1679 +#: ../../library/typing.rst:1681 msgid "The name of the type variable." msgstr "" -#: ../../library/typing.rst:1683 +#: ../../library/typing.rst:1685 msgid "Whether the type var has been explicitly marked as covariant." msgstr "" -#: ../../library/typing.rst:1687 +#: ../../library/typing.rst:1689 msgid "Whether the type var has been explicitly marked as contravariant." msgstr "" -#: ../../library/typing.rst:1691 +#: ../../library/typing.rst:1693 msgid "" "Whether the type variable's variance should be inferred by type checkers." msgstr "" -#: ../../library/typing.rst:1697 +#: ../../library/typing.rst:1699 msgid "The bound of the type variable, if any." msgstr "" -#: ../../library/typing.rst:1701 +#: ../../library/typing.rst:1703 msgid "" "For type variables created through :ref:`type parameter syntax `, the bound is evaluated only when the attribute is accessed, not " "when the type variable is created (see :ref:`lazy-evaluation`)." msgstr "" -#: ../../library/typing.rst:1707 +#: ../../library/typing.rst:1709 msgid "A tuple containing the constraints of the type variable, if any." msgstr "" -#: ../../library/typing.rst:1711 +#: ../../library/typing.rst:1713 msgid "" "For type variables created through :ref:`type parameter syntax `, the constraints are evaluated only when the attribute is accessed, " "not when the type variable is created (see :ref:`lazy-evaluation`)." msgstr "" -#: ../../library/typing.rst:1717 +#: ../../library/typing.rst:1719 msgid "" "Type variables can now be declared using the :ref:`type parameter ` syntax introduced by :pep:`695`. The ``infer_variance`` parameter " "was added." msgstr "" -#: ../../library/typing.rst:1723 +#: ../../library/typing.rst:1727 msgid "" -"Type variable tuple. A specialized form of :class:`type variable ` " +"Type variable tuple. A specialized form of :ref:`type variable ` " "that enables *variadic* generics." msgstr "" -#: ../../library/typing.rst:1726 +#: ../../library/typing.rst:1730 msgid "" "Type variable tuples can be declared in :ref:`type parameter lists ` using a single asterisk (``*``) before the name::" msgstr "" -#: ../../library/typing.rst:1732 +#: ../../library/typing.rst:1736 msgid "Or by explicitly invoking the ``TypeVarTuple`` constructor::" msgstr "" -#: ../../library/typing.rst:1740 +#: ../../library/typing.rst:1744 msgid "" "A normal type variable enables parameterization with a single type. A type " "variable tuple, in contrast, allows parameterization with an *arbitrary* " @@ -1649,7 +1649,7 @@ msgid "" "wrapped in a tuple. For example::" msgstr "" -#: ../../library/typing.rst:1762 +#: ../../library/typing.rst:1766 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, " @@ -1659,36 +1659,36 @@ msgid "" "` instead, as ``Unpack[Ts]``.)" msgstr "" -#: ../../library/typing.rst:1770 +#: ../../library/typing.rst:1774 msgid "" "Type variable tuples must *always* be unpacked. This helps distinguish type " "variable tuples from normal type variables::" msgstr "" -#: ../../library/typing.rst:1777 +#: ../../library/typing.rst:1781 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:1785 +#: ../../library/typing.rst:1789 msgid "" "Type variable tuples can be happily combined with normal type variables:" msgstr "" -#: ../../library/typing.rst:1801 +#: ../../library/typing.rst:1805 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:1808 +#: ../../library/typing.rst:1812 msgid "" "Finally, an unpacked type variable tuple can be used as the type annotation " "of ``*args``::" msgstr "" -#: ../../library/typing.rst:1818 +#: ../../library/typing.rst:1822 msgid "" "In contrast to non-unpacked annotations of ``*args`` - e.g. ``*args: int``, " "which would specify that *all* arguments are ``int`` - ``*args: *Ts`` " @@ -1697,39 +1697,39 @@ msgid "" "``call_soon`` match the types of the (positional) arguments of ``callback``." msgstr "" -#: ../../library/typing.rst:1825 +#: ../../library/typing.rst:1829 msgid "See :pep:`646` for more details on type variable tuples." msgstr "" -#: ../../library/typing.rst:1829 +#: ../../library/typing.rst:1833 msgid "The name of the type variable tuple." msgstr "" -#: ../../library/typing.rst:1835 +#: ../../library/typing.rst:1839 msgid "" "Type variable tuples can now be declared using the :ref:`type parameter " "` syntax introduced by :pep:`695`." msgstr "" -#: ../../library/typing.rst:1840 +#: ../../library/typing.rst:1844 msgid "" -"Parameter specification variable. A specialized version of :class:`type " -"variables `." +"Parameter specification variable. A specialized version of :ref:`type " +"variables `." msgstr "" -#: ../../library/typing.rst:1843 +#: ../../library/typing.rst:1847 msgid "" "In :ref:`type parameter lists `, parameter specifications can " "be declared with two asterisks (``**``)::" msgstr "" -#: ../../library/typing.rst:1848 +#: ../../library/typing.rst:1852 msgid "" "For compatibility with Python 3.11 and earlier, ``ParamSpec`` objects can " "also be created as follows::" msgstr "" -#: ../../library/typing.rst:1853 +#: ../../library/typing.rst:1857 msgid "" "Parameter specification variables exist primarily for the benefit of static " "type checkers. They are used to forward the parameter types of one callable " @@ -1739,7 +1739,7 @@ msgid "" "See :class:`Generic` for more information on generic types." msgstr "" -#: ../../library/typing.rst:1860 +#: ../../library/typing.rst:1864 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 " @@ -1747,27 +1747,27 @@ msgid "" "new callable returned by it have inter-dependent type parameters::" msgstr "" -#: ../../library/typing.rst:1880 +#: ../../library/typing.rst:1884 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:1884 +#: ../../library/typing.rst:1888 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:1886 +#: ../../library/typing.rst:1890 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:1893 +#: ../../library/typing.rst:1897 msgid "" "Since ``ParamSpec`` captures both positional and keyword parameters, ``P." "args`` and ``P.kwargs`` can be used to split a ``ParamSpec`` into its " @@ -1780,11 +1780,11 @@ msgid "" "`ParamSpecKwargs`." msgstr "" -#: ../../library/typing.rst:1905 +#: ../../library/typing.rst:1909 msgid "The name of the parameter specification." msgstr "" -#: ../../library/typing.rst:1907 +#: ../../library/typing.rst:1911 msgid "" "Parameter specification variables created with ``covariant=True`` or " "``contravariant=True`` can be used to declare covariant or contravariant " @@ -1793,23 +1793,23 @@ msgid "" "decided." msgstr "" -#: ../../library/typing.rst:1917 +#: ../../library/typing.rst:1921 msgid "" "Parameter specifications can now be declared using the :ref:`type parameter " "` syntax introduced by :pep:`695`." msgstr "" -#: ../../library/typing.rst:1921 +#: ../../library/typing.rst:1925 msgid "" "Only parameter specification variables defined in global scope can be " "pickled." msgstr "" -#: ../../library/typing.rst:1927 +#: ../../library/typing.rst:1931 msgid ":data:`Concatenate`" msgstr "" -#: ../../library/typing.rst:1933 +#: ../../library/typing.rst:1937 msgid "" "Arguments and keyword arguments attributes of a :class:`ParamSpec`. The ``P." "args`` attribute of a ``ParamSpec`` is an instance of ``ParamSpecArgs``, and " @@ -1817,75 +1817,75 @@ msgid "" "runtime introspection and have no special meaning to static type checkers." msgstr "" -#: ../../library/typing.rst:1938 +#: ../../library/typing.rst:1942 msgid "" "Calling :func:`get_origin` on either of these objects will return the " "original ``ParamSpec``:" msgstr "" -#: ../../library/typing.rst:1955 +#: ../../library/typing.rst:1959 msgid "The type of type aliases created through the :keyword:`type` statement." msgstr "" -#: ../../library/typing.rst:1969 +#: ../../library/typing.rst:1973 msgid "The name of the type alias:" msgstr "" -#: ../../library/typing.rst:1979 +#: ../../library/typing.rst:1983 msgid "The module in which the type alias was defined::" msgstr "" -#: ../../library/typing.rst:1987 +#: ../../library/typing.rst:1991 msgid "" "The type parameters of the type alias, or an empty tuple if the alias is not " "generic:" msgstr "" -#: ../../library/typing.rst:2001 +#: ../../library/typing.rst:2005 msgid "" "The type alias's value. This is :ref:`lazily evaluated `, " "so names used in the definition of the alias are not resolved until the " "``__value__`` attribute is accessed:" msgstr "" -#: ../../library/typing.rst:2019 +#: ../../library/typing.rst:2023 msgid "Other special directives" msgstr "" -#: ../../library/typing.rst:2021 +#: ../../library/typing.rst:2025 msgid "" "These functions and classes should not be used directly as annotations. " "Their intended purpose is to be building blocks for creating and declaring " "types." msgstr "" -#: ../../library/typing.rst:2027 +#: ../../library/typing.rst:2031 msgid "Typed version of :func:`collections.namedtuple`." msgstr "" -#: ../../library/typing.rst:2029 ../../library/typing.rst:2106 -#: ../../library/typing.rst:3070 +#: ../../library/typing.rst:2033 ../../library/typing.rst:2110 +#: ../../library/typing.rst:3076 msgid "Usage::" msgstr "" -#: ../../library/typing.rst:2035 +#: ../../library/typing.rst:2039 msgid "This is equivalent to::" msgstr "" "這等價於:\n" "\n" "::" -#: ../../library/typing.rst:2039 +#: ../../library/typing.rst:2043 msgid "" "To give a field a default value, you can assign to it in the class body::" msgstr "" -#: ../../library/typing.rst:2048 +#: ../../library/typing.rst:2052 msgid "" "Fields with a default value must come after any fields without a default." msgstr "" -#: ../../library/typing.rst:2050 +#: ../../library/typing.rst:2054 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 " @@ -1894,83 +1894,83 @@ msgid "" "API.)" msgstr "" -#: ../../library/typing.rst:2056 +#: ../../library/typing.rst:2060 msgid "``NamedTuple`` subclasses can also have docstrings and methods::" msgstr "" -#: ../../library/typing.rst:2066 +#: ../../library/typing.rst:2070 msgid "``NamedTuple`` subclasses can be generic::" msgstr "" -#: ../../library/typing.rst:2072 +#: ../../library/typing.rst:2076 msgid "Backward-compatible usage::" msgstr "" -#: ../../library/typing.rst:2082 +#: ../../library/typing.rst:2086 msgid "Added support for :pep:`526` variable annotation syntax." msgstr "" -#: ../../library/typing.rst:2085 +#: ../../library/typing.rst:2089 msgid "Added support for default values, methods, and docstrings." msgstr "" -#: ../../library/typing.rst:2088 +#: ../../library/typing.rst:2092 msgid "" "The ``_field_types`` and ``__annotations__`` attributes are now regular " "dictionaries instead of instances of ``OrderedDict``." msgstr "" -#: ../../library/typing.rst:2092 +#: ../../library/typing.rst:2096 msgid "" "Removed the ``_field_types`` attribute in favor of the more standard " "``__annotations__`` attribute which has the same information." msgstr "" -#: ../../library/typing.rst:2096 +#: ../../library/typing.rst:2100 msgid "Added support for generic namedtuples." msgstr "" -#: ../../library/typing.rst:2101 +#: ../../library/typing.rst:2105 msgid "Helper class to create low-overhead :ref:`distinct types `." msgstr "" -#: ../../library/typing.rst:2103 +#: ../../library/typing.rst:2107 msgid "" "A ``NewType`` is considered a distinct type by a typechecker. At runtime, " "however, calling a ``NewType`` returns its argument unchanged." msgstr "" -#: ../../library/typing.rst:2113 +#: ../../library/typing.rst:2117 msgid "The module in which the new type is defined." msgstr "" -#: ../../library/typing.rst:2117 +#: ../../library/typing.rst:2121 msgid "The name of the new type." msgstr "" -#: ../../library/typing.rst:2121 +#: ../../library/typing.rst:2125 msgid "The type that the new type is based on." msgstr "" -#: ../../library/typing.rst:2125 +#: ../../library/typing.rst:2129 msgid "``NewType`` is now a class rather than a function." msgstr "" -#: ../../library/typing.rst:2130 +#: ../../library/typing.rst:2134 msgid "Base class for protocol classes." msgstr "" -#: ../../library/typing.rst:2132 +#: ../../library/typing.rst:2136 msgid "Protocol classes are defined like this::" msgstr "" -#: ../../library/typing.rst:2138 +#: ../../library/typing.rst:2142 msgid "" "Such classes are primarily used with static type checkers that recognize " "structural subtyping (static duck-typing), for example::" msgstr "" -#: ../../library/typing.rst:2150 +#: ../../library/typing.rst:2154 msgid "" "See :pep:`544` for more details. Protocol classes decorated with :func:" "`runtime_checkable` (described later) act as simple-minded runtime protocols " @@ -1978,21 +1978,21 @@ msgid "" "signatures." msgstr "" -#: ../../library/typing.rst:2155 +#: ../../library/typing.rst:2159 msgid "Protocol classes can be generic, for example::" msgstr "" -#: ../../library/typing.rst:2161 +#: ../../library/typing.rst:2165 msgid "" "In code that needs to be compatible with Python 3.11 or older, generic " "Protocols can be written as follows::" msgstr "" -#: ../../library/typing.rst:2174 +#: ../../library/typing.rst:2178 msgid "Mark a protocol class as a runtime protocol." msgstr "" -#: ../../library/typing.rst:2176 +#: ../../library/typing.rst:2180 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 " @@ -2001,7 +2001,7 @@ msgid "" "Iterable`. For example::" msgstr "" -#: ../../library/typing.rst:2196 +#: ../../library/typing.rst:2200 msgid "" ":func:`!runtime_checkable` will check only the presence of the required " "methods or attributes, not their type signatures or types. For example, :" @@ -2012,7 +2012,7 @@ msgid "" "(instantiate) :class:`ssl.SSLObject`." msgstr "" -#: ../../library/typing.rst:2207 +#: ../../library/typing.rst:2211 msgid "" "An :func:`isinstance` check against a runtime-checkable protocol can be " "surprisingly slow compared to an ``isinstance()`` check against a non-" @@ -2020,7 +2020,7 @@ msgid "" "calls for structural checks in performance-sensitive code." msgstr "" -#: ../../library/typing.rst:2215 +#: ../../library/typing.rst:2219 msgid "" "The internal implementation of :func:`isinstance` checks against runtime-" "checkable protocols now uses :func:`inspect.getattr_static` to look up " @@ -2030,7 +2030,7 @@ msgid "" "versa. Most users are unlikely to be affected by this change." msgstr "" -#: ../../library/typing.rst:2224 +#: ../../library/typing.rst:2228 msgid "" "The members of a runtime-checkable protocol are now considered \"frozen\" at " "runtime as soon as the class has been created. Monkey-patching attributes " @@ -2039,13 +2039,13 @@ msgid "" "`\"What's new in Python 3.12\" ` for more details." msgstr "" -#: ../../library/typing.rst:2235 +#: ../../library/typing.rst:2239 msgid "" "Special construct to add type hints to a dictionary. At runtime it is a " "plain :class:`dict`." msgstr "" -#: ../../library/typing.rst:2238 +#: ../../library/typing.rst:2242 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 " @@ -2053,53 +2053,53 @@ msgid "" "enforced by type checkers. Usage::" msgstr "" -#: ../../library/typing.rst:2254 +#: ../../library/typing.rst:2258 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:2258 +#: ../../library/typing.rst:2262 msgid "Using a literal :class:`dict` as the second argument::" msgstr "" -#: ../../library/typing.rst:2262 +#: ../../library/typing.rst:2266 msgid "Using keyword arguments::" msgstr "" -#: ../../library/typing.rst:2269 +#: ../../library/typing.rst:2273 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:2270 +#: ../../library/typing.rst:2274 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:2282 +#: ../../library/typing.rst:2286 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:2293 +#: ../../library/typing.rst:2297 msgid "" "This means that a ``Point2D`` ``TypedDict`` can have the ``label`` key " "omitted." msgstr "" -#: ../../library/typing.rst:2296 +#: ../../library/typing.rst:2300 msgid "" "It is also possible to mark all keys as non-required by default by " "specifying a totality of ``False``::" msgstr "" -#: ../../library/typing.rst:2306 +#: ../../library/typing.rst:2310 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 " @@ -2107,53 +2107,53 @@ msgid "" "and makes all items defined in the class body required." msgstr "" -#: ../../library/typing.rst:2311 +#: ../../library/typing.rst:2315 msgid "" "Individual keys of a ``total=False`` ``TypedDict`` can be marked as required " "using :data:`Required`::" msgstr "" -#: ../../library/typing.rst:2326 +#: ../../library/typing.rst:2330 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:2333 +#: ../../library/typing.rst:2337 msgid "" "``Point3D`` has three items: ``x``, ``y`` and ``z``. It is equivalent to " "this definition::" msgstr "" -#: ../../library/typing.rst:2341 +#: ../../library/typing.rst:2345 msgid "" "A ``TypedDict`` cannot inherit from a non-\\ ``TypedDict`` class, except " "for :class:`Generic`. For example::" msgstr "" -#: ../../library/typing.rst:2356 +#: ../../library/typing.rst:2360 msgid "A ``TypedDict`` can be generic::" msgstr "" -#: ../../library/typing.rst:2362 +#: ../../library/typing.rst:2366 msgid "" "To create a generic ``TypedDict`` that is compatible with Python 3.11 or " "lower, inherit from :class:`Generic` explicitly:" msgstr "" -#: ../../library/typing.rst:2373 +#: ../../library/typing.rst:2377 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:2379 +#: ../../library/typing.rst:2383 msgid "" "``Point2D.__total__`` gives the value of the ``total`` argument. Example:" msgstr "" -#: ../../library/typing.rst:2395 +#: ../../library/typing.rst:2399 msgid "" "This attribute reflects *only* the value of the ``total`` argument to the " "current ``TypedDict`` class, not whether the class is semantically total. " @@ -2164,21 +2164,21 @@ msgid "" "introspection." msgstr "" -#: ../../library/typing.rst:2408 +#: ../../library/typing.rst:2412 msgid "" "``Point2D.__required_keys__`` and ``Point2D.__optional_keys__`` return :" "class:`frozenset` objects containing required and non-required keys, " "respectively." msgstr "" -#: ../../library/typing.rst:2411 +#: ../../library/typing.rst:2415 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:2414 +#: ../../library/typing.rst:2418 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 " @@ -2187,7 +2187,7 @@ msgid "" "``TypedDict`` with a different value for ``total``:" msgstr "" -#: ../../library/typing.rst:2439 +#: ../../library/typing.rst:2443 msgid "" "If ``from __future__ import annotations`` is used or if annotations are " "given as strings, annotations are not evaluated when the ``TypedDict`` is " @@ -2196,133 +2196,133 @@ msgid "" "attributes may be incorrect." msgstr "" -#: ../../library/typing.rst:2445 +#: ../../library/typing.rst:2449 msgid "" "See :pep:`589` for more examples and detailed rules of using ``TypedDict``." msgstr "" -#: ../../library/typing.rst:2449 +#: ../../library/typing.rst:2453 msgid "" "Added support for marking individual keys as :data:`Required` or :data:" "`NotRequired`. See :pep:`655`." msgstr "" -#: ../../library/typing.rst:2453 +#: ../../library/typing.rst:2457 msgid "Added support for generic ``TypedDict``\\ s." msgstr "" -#: ../../library/typing.rst:2457 +#: ../../library/typing.rst:2461 msgid "Protocols" msgstr "協定" -#: ../../library/typing.rst:2459 +#: ../../library/typing.rst:2463 msgid "" "The following protocols are provided by the typing module. All are decorated " "with :func:`@runtime_checkable `." msgstr "" -#: ../../library/typing.rst:2464 +#: ../../library/typing.rst:2468 msgid "" "An ABC with one abstract method ``__abs__`` that is covariant in its return " "type." msgstr "" -#: ../../library/typing.rst:2469 +#: ../../library/typing.rst:2473 msgid "An ABC with one abstract method ``__bytes__``." msgstr "一個有抽象方法 ``__bytes__`` 的 ABC。" -#: ../../library/typing.rst:2473 +#: ../../library/typing.rst:2477 msgid "An ABC with one abstract method ``__complex__``." msgstr "一個有抽象方法 ``__complex__`` 的 ABC。" -#: ../../library/typing.rst:2477 +#: ../../library/typing.rst:2481 msgid "An ABC with one abstract method ``__float__``." msgstr "一個有抽象方法 ``__float__`` 的 ABC。" -#: ../../library/typing.rst:2481 +#: ../../library/typing.rst:2485 msgid "An ABC with one abstract method ``__index__``." msgstr "一個有抽象方法 ``__index__`` 的 ABC。" -#: ../../library/typing.rst:2487 +#: ../../library/typing.rst:2491 msgid "An ABC with one abstract method ``__int__``." msgstr "一個有抽象方法 ``__int__`` 的 ABC。" -#: ../../library/typing.rst:2491 +#: ../../library/typing.rst:2495 msgid "" "An ABC with one abstract method ``__round__`` that is covariant in its " "return type." msgstr "" -#: ../../library/typing.rst:2495 +#: ../../library/typing.rst:2499 msgid "ABCs for working with IO" msgstr "" -#: ../../library/typing.rst:2501 +#: ../../library/typing.rst:2505 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:2507 +#: ../../library/typing.rst:2511 msgid "Functions and decorators" msgstr "函式與裝飾器" -#: ../../library/typing.rst:2511 +#: ../../library/typing.rst:2515 msgid "Cast a value to a type." msgstr "" -#: ../../library/typing.rst:2513 +#: ../../library/typing.rst:2517 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:2520 +#: ../../library/typing.rst:2524 msgid "" "Ask a static type checker to confirm that *val* has an inferred type of " "*typ*." msgstr "" -#: ../../library/typing.rst:2522 +#: ../../library/typing.rst:2526 msgid "" "At runtime this does nothing: it returns the first argument unchanged with " "no checks or side effects, no matter the actual type of the argument." msgstr "" -#: ../../library/typing.rst:2525 +#: ../../library/typing.rst:2529 msgid "" "When a static 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:2532 +#: ../../library/typing.rst:2536 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:2546 +#: ../../library/typing.rst:2550 msgid "" "Ask a static type checker to confirm that a line of code is unreachable." msgstr "" -#: ../../library/typing.rst:2548 +#: ../../library/typing.rst:2552 msgid "Example::" msgstr "" "舉例來說:\n" "\n" "::" -#: ../../library/typing.rst:2559 +#: ../../library/typing.rst:2563 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`, " "and both options are covered by earlier cases." msgstr "" -#: ../../library/typing.rst:2564 +#: ../../library/typing.rst:2568 msgid "" "If a type checker finds that a call to ``assert_never()`` is reachable, it " "will emit an error. For example, if the type annotation for ``arg`` was " @@ -2332,59 +2332,59 @@ msgid "" "passed in must be the bottom type, :data:`Never`, and nothing else." msgstr "" -#: ../../library/typing.rst:2572 +#: ../../library/typing.rst:2576 msgid "At runtime, this throws an exception when called." msgstr "" -#: ../../library/typing.rst:2575 +#: ../../library/typing.rst:2579 msgid "" "`Unreachable Code and Exhaustiveness Checking `__ has more information about " "exhaustiveness checking with static typing." msgstr "" -#: ../../library/typing.rst:2583 +#: ../../library/typing.rst:2587 msgid "Reveal the inferred static type of an expression." msgstr "" -#: ../../library/typing.rst:2585 +#: ../../library/typing.rst:2589 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:2591 +#: ../../library/typing.rst:2595 msgid "" "This can be useful when you want to debug how your type checker handles a " "particular piece of code." msgstr "" -#: ../../library/typing.rst:2594 +#: ../../library/typing.rst:2598 msgid "" "The function returns its argument unchanged, which allows using it within an " "expression::" msgstr "" -#: ../../library/typing.rst:2599 +#: ../../library/typing.rst:2603 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:2604 +#: ../../library/typing.rst:2608 msgid "" "At runtime, this function prints the runtime type of its argument to stderr " "and returns it unchanged::" msgstr "" -#: ../../library/typing.rst:2616 +#: ../../library/typing.rst:2620 msgid "" "Decorator to mark an object as providing :func:`dataclass `-like behavior." msgstr "" -#: ../../library/typing.rst:2619 +#: ../../library/typing.rst:2623 msgid "" "``dataclass_transform`` may be used to decorate a class, metaclass, or a " "function that is itself a decorator. The presence of " @@ -2393,19 +2393,19 @@ msgid "" "to :func:`@dataclasses.dataclass `." msgstr "" -#: ../../library/typing.rst:2626 +#: ../../library/typing.rst:2630 msgid "Example usage with a decorator function:" msgstr "" -#: ../../library/typing.rst:2640 +#: ../../library/typing.rst:2644 msgid "On a base class::" msgstr "" -#: ../../library/typing.rst:2649 +#: ../../library/typing.rst:2653 msgid "On a metaclass::" msgstr "" -#: ../../library/typing.rst:2660 +#: ../../library/typing.rst:2664 msgid "" "The ``CustomerModel`` classes defined above will be treated by type checkers " "similarly to classes created with :func:`@dataclasses.dataclass `-decorated definitions for " "*func*." msgstr "" -#: ../../library/typing.rst:2798 +#: ../../library/typing.rst:2804 msgid "" "*func* is the function object for the implementation of the overloaded " "function. For example, given the definition of ``process`` in the " @@ -2623,32 +2623,32 @@ msgid "" "returns an empty sequence." msgstr "" -#: ../../library/typing.rst:2805 +#: ../../library/typing.rst:2811 msgid "" "``get_overloads()`` can be used for introspecting an overloaded function at " "runtime." msgstr "" -#: ../../library/typing.rst:2813 +#: ../../library/typing.rst:2819 msgid "Clear all registered overloads in the internal registry." msgstr "" -#: ../../library/typing.rst:2815 +#: ../../library/typing.rst:2821 msgid "This can be used to reclaim the memory used by the registry." msgstr "" -#: ../../library/typing.rst:2822 +#: ../../library/typing.rst:2828 msgid "Decorator to indicate final methods and final classes." msgstr "" -#: ../../library/typing.rst:2824 +#: ../../library/typing.rst:2830 msgid "" "Decorating a method with ``@final`` indicates to a type checker that the " "method cannot be overridden in a subclass. Decorating a class with " "``@final`` indicates that it cannot be subclassed." msgstr "" -#: ../../library/typing.rst:2849 +#: ../../library/typing.rst:2855 msgid "" "The decorator will now attempt to set a ``__final__`` attribute to ``True`` " "on the decorated object. Thus, a check like ``if getattr(obj, \"__final__\", " @@ -2658,11 +2658,11 @@ msgid "" "exception." msgstr "" -#: ../../library/typing.rst:2860 +#: ../../library/typing.rst:2866 msgid "Decorator to indicate that annotations are not type hints." msgstr "" -#: ../../library/typing.rst:2862 +#: ../../library/typing.rst:2868 msgid "" "This works as a class or function :term:`decorator`. With a class, it " "applies recursively to all methods and classes defined in that class (but " @@ -2670,38 +2670,38 @@ msgid "" "will ignore all annotations in a function or class with this decorator." msgstr "" -#: ../../library/typing.rst:2868 +#: ../../library/typing.rst:2874 msgid "``@no_type_check`` mutates the decorated object in place." msgstr "" -#: ../../library/typing.rst:2872 +#: ../../library/typing.rst:2878 msgid "Decorator to give another decorator the :func:`no_type_check` effect." msgstr "" -#: ../../library/typing.rst:2874 +#: ../../library/typing.rst:2880 msgid "" "This wraps the decorator with something that wraps the decorated function " "in :func:`no_type_check`." msgstr "" -#: ../../library/typing.rst:2880 +#: ../../library/typing.rst:2886 msgid "" "Decorator to indicate that a method in a subclass is intended to override a " "method or attribute in a superclass." msgstr "" -#: ../../library/typing.rst:2883 +#: ../../library/typing.rst:2889 msgid "" "Type checkers should emit an error if a method decorated with ``@override`` " "does not, in fact, override anything. This helps prevent bugs that may occur " "when a base class is changed without an equivalent change to a child class." msgstr "" -#: ../../library/typing.rst:2905 +#: ../../library/typing.rst:2911 msgid "There is no runtime checking of this property." msgstr "" -#: ../../library/typing.rst:2907 +#: ../../library/typing.rst:2913 msgid "" "The decorator will attempt to set an ``__override__`` attribute to ``True`` " "on the decorated object. Thus, a check like ``if getattr(obj, " @@ -2711,38 +2711,38 @@ msgid "" "without raising an exception." msgstr "" -#: ../../library/typing.rst:2914 +#: ../../library/typing.rst:2920 msgid "See :pep:`698` for more details." msgstr "更多細節請見 :pep:`698`。" -#: ../../library/typing.rst:2921 +#: ../../library/typing.rst:2927 msgid "Decorator to mark a class or function as unavailable at runtime." msgstr "" -#: ../../library/typing.rst:2923 +#: ../../library/typing.rst:2929 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:2934 +#: ../../library/typing.rst:2940 msgid "" "Note that returning instances of private classes is not recommended. It is " "usually preferable to make such classes public." msgstr "" -#: ../../library/typing.rst:2938 +#: ../../library/typing.rst:2944 msgid "Introspection helpers" msgstr "" -#: ../../library/typing.rst:2942 +#: ../../library/typing.rst:2948 msgid "" "Return a dictionary containing type hints for a function, method, module or " "class object." msgstr "" -#: ../../library/typing.rst:2945 +#: ../../library/typing.rst:2951 msgid "" "This is often the same as ``obj.__annotations__``. In addition, forward " "references encoded as string literals are handled by evaluating them in " @@ -2751,21 +2751,21 @@ msgid "" "__mro__`` in reverse order." msgstr "" -#: ../../library/typing.rst:2951 +#: ../../library/typing.rst:2957 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:2968 +#: ../../library/typing.rst:2974 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:2973 +#: ../../library/typing.rst:2979 msgid "" "Added ``include_extras`` parameter as part of :pep:`593`. See the " "documentation on :data:`Annotated` for more information." @@ -2773,20 +2773,20 @@ msgstr "" "新增 ``include_extras`` 參數(如 :pep:`593` 中所述)。更多資訊請見 :data:" "`Annotated` 的文件。" -#: ../../library/typing.rst:2977 +#: ../../library/typing.rst:2983 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:2984 +#: ../../library/typing.rst:2990 msgid "" "Get the unsubscripted version of a type: for a typing object of the form " "``X[Y, Z, ...]`` return ``X``." msgstr "" -#: ../../library/typing.rst:2987 +#: ../../library/typing.rst:2993 msgid "" "If ``X`` is a typing-module alias for a builtin or :mod:`collections` class, " "it will be normalized to the original class. If ``X`` is an instance of :" @@ -2794,17 +2794,17 @@ msgid "" "class:`ParamSpec`. Return ``None`` for unsupported objects." msgstr "" -#: ../../library/typing.rst:2993 ../../library/typing.rst:3016 +#: ../../library/typing.rst:2999 ../../library/typing.rst:3022 msgid "Examples:" msgstr "舉例:" -#: ../../library/typing.rst:3008 +#: ../../library/typing.rst:3014 msgid "" "Get type arguments with all substitutions performed: for a typing object of " "the form ``X[Y, Z, ...]`` return ``(Y, Z, ...)``." msgstr "" -#: ../../library/typing.rst:3011 +#: ../../library/typing.rst:3017 msgid "" "If ``X`` is a union or :class:`Literal` contained in another generic type, " "the order of ``(Y, Z, ...)`` may be different from the order of the original " @@ -2812,40 +2812,40 @@ msgid "" "objects." msgstr "" -#: ../../library/typing.rst:3028 +#: ../../library/typing.rst:3034 msgid "Check if a type is a :class:`TypedDict`." msgstr "" -#: ../../library/typing.rst:3049 +#: ../../library/typing.rst:3055 msgid "" "Class used for internal typing representation of string forward references." msgstr "" -#: ../../library/typing.rst:3051 +#: ../../library/typing.rst:3057 msgid "" "For example, ``List[\"SomeClass\"]`` is implicitly transformed into " "``List[ForwardRef(\"SomeClass\")]``. ``ForwardRef`` should not be " "instantiated by a user, but may be used by introspection tools." msgstr "" -#: ../../library/typing.rst:3056 +#: ../../library/typing.rst:3062 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:3063 +#: ../../library/typing.rst:3069 msgid "Constant" msgstr "常數" -#: ../../library/typing.rst:3067 +#: ../../library/typing.rst:3073 msgid "" "A special constant that is assumed to be ``True`` by 3rd party static type " "checkers. It is ``False`` at runtime." msgstr "" -#: ../../library/typing.rst:3078 +#: ../../library/typing.rst:3084 msgid "" "The first type annotation must be enclosed in quotes, making it a \"forward " "reference\", to hide the ``expensive_mod`` reference from the interpreter " @@ -2853,7 +2853,7 @@ msgid "" "second annotation does not need to be enclosed in quotes." msgstr "" -#: ../../library/typing.rst:3085 +#: ../../library/typing.rst:3091 msgid "" "If ``from __future__ import annotations`` is used, annotations are not " "evaluated at function definition time. Instead, they are stored as strings " @@ -2861,11 +2861,11 @@ msgid "" "annotation (see :pep:`563`)." msgstr "" -#: ../../library/typing.rst:3097 +#: ../../library/typing.rst:3103 msgid "Deprecated aliases" msgstr "棄用的別名" -#: ../../library/typing.rst:3099 +#: ../../library/typing.rst:3105 msgid "" "This module defines several deprecated aliases to pre-existing standard " "library classes. These were originally included in the typing module in " @@ -2874,7 +2874,7 @@ msgid "" "existing classes were enhanced to support ``[]`` (see :pep:`585`)." msgstr "" -#: ../../library/typing.rst:3106 +#: ../../library/typing.rst:3112 msgid "" "The redundant types are deprecated as of Python 3.9. However, while the " "aliases may be removed at some point, removal of these aliases is not " @@ -2882,7 +2882,7 @@ msgid "" "the interpreter for these aliases." msgstr "" -#: ../../library/typing.rst:3111 +#: ../../library/typing.rst:3117 msgid "" "If at some point it is decided to remove these deprecated aliases, a " "deprecation warning will be issued by the interpreter for at least two " @@ -2890,188 +2890,188 @@ msgid "" "typing module without deprecation warnings until at least Python 3.14." msgstr "" -#: ../../library/typing.rst:3116 +#: ../../library/typing.rst:3122 msgid "" "Type checkers are encouraged to flag uses of the deprecated types if the " "program they are checking targets a minimum Python version of 3.9 or newer." msgstr "" -#: ../../library/typing.rst:3122 +#: ../../library/typing.rst:3128 msgid "Aliases to built-in types" msgstr "內建型別的別名" -#: ../../library/typing.rst:3126 +#: ../../library/typing.rst:3132 msgid "Deprecated alias to :class:`dict`." msgstr "棄用 :class:`dict` 的別名。" -#: ../../library/typing.rst:3128 +#: ../../library/typing.rst:3134 msgid "" "Note that to annotate arguments, it is preferred to use an abstract " "collection type such as :class:`Mapping` rather than to use :class:`dict` " "or :class:`!typing.Dict`." msgstr "" -#: ../../library/typing.rst:3132 ../../library/typing.rst:3374 +#: ../../library/typing.rst:3138 ../../library/typing.rst:3380 msgid "This type can be used as follows::" msgstr "" -#: ../../library/typing.rst:3137 +#: ../../library/typing.rst:3143 msgid "" ":class:`builtins.dict ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3143 +#: ../../library/typing.rst:3149 msgid "Deprecated alias to :class:`list`." msgstr "棄用 :class:`list` 的別名。" -#: ../../library/typing.rst:3145 +#: ../../library/typing.rst:3151 msgid "" "Note that to annotate arguments, it is preferred to use an abstract " "collection type such as :class:`Sequence` or :class:`Iterable` rather than " "to use :class:`list` or :class:`!typing.List`." msgstr "" -#: ../../library/typing.rst:3149 +#: ../../library/typing.rst:3155 msgid "This type may be used as follows::" msgstr "" -#: ../../library/typing.rst:3157 +#: ../../library/typing.rst:3163 msgid "" ":class:`builtins.list ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3163 +#: ../../library/typing.rst:3169 msgid "Deprecated alias to :class:`builtins.set `." msgstr "棄用 :class:`builtins.set ` 的別名。" -#: ../../library/typing.rst:3165 +#: ../../library/typing.rst:3171 msgid "" "Note that to annotate arguments, it is preferred to use an abstract " "collection type such as :class:`AbstractSet` rather than to use :class:`set` " "or :class:`!typing.Set`." msgstr "" -#: ../../library/typing.rst:3169 +#: ../../library/typing.rst:3175 msgid "" ":class:`builtins.set ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3175 +#: ../../library/typing.rst:3181 msgid "Deprecated alias to :class:`builtins.frozenset `." msgstr "棄用 :class:`builtins.frozenset ` 的別名。" -#: ../../library/typing.rst:3177 +#: ../../library/typing.rst:3183 msgid "" ":class:`builtins.frozenset ` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3184 +#: ../../library/typing.rst:3190 msgid "Deprecated alias for :class:`tuple`." msgstr "棄用 :class:`tuple` 的別名。" -#: ../../library/typing.rst:3186 +#: ../../library/typing.rst:3192 msgid "" ":class:`tuple` and ``Tuple`` are special-cased in the type system; see :ref:" "`annotating-tuples` for more details." msgstr "" -#: ../../library/typing.rst:3189 +#: ../../library/typing.rst:3195 msgid "" ":class:`builtins.tuple ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3195 +#: ../../library/typing.rst:3201 msgid "Deprecated alias to :class:`type`." msgstr "棄用 :class:`type` 的別名。" -#: ../../library/typing.rst:3197 +#: ../../library/typing.rst:3203 msgid "" "See :ref:`type-of-class-objects` for details on using :class:`type` or " "``typing.Type`` in type annotations." msgstr "" -#: ../../library/typing.rst:3202 +#: ../../library/typing.rst:3208 msgid "" ":class:`builtins.type ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3209 +#: ../../library/typing.rst:3215 msgid "Aliases to types in :mod:`collections`" msgstr ":mod:`collections` 中型別的別名" -#: ../../library/typing.rst:3213 +#: ../../library/typing.rst:3219 msgid "Deprecated alias to :class:`collections.defaultdict`." msgstr "棄用 :class:`collections.defaultdict` 的別名。" -#: ../../library/typing.rst:3217 +#: ../../library/typing.rst:3223 msgid "" ":class:`collections.defaultdict` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3223 +#: ../../library/typing.rst:3229 msgid "Deprecated alias to :class:`collections.OrderedDict`." msgstr "棄用 :class:`collections.OrderedDict` 的別名。" -#: ../../library/typing.rst:3227 +#: ../../library/typing.rst:3233 msgid "" ":class:`collections.OrderedDict` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3233 +#: ../../library/typing.rst:3239 msgid "Deprecated alias to :class:`collections.ChainMap`." msgstr "棄用 :class:`collections.ChainMap` 的別名。" -#: ../../library/typing.rst:3238 +#: ../../library/typing.rst:3244 msgid "" ":class:`collections.ChainMap` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3244 +#: ../../library/typing.rst:3250 msgid "Deprecated alias to :class:`collections.Counter`." msgstr "棄用 :class:`collections.Counter` 的別名。" -#: ../../library/typing.rst:3249 +#: ../../library/typing.rst:3255 msgid "" ":class:`collections.Counter` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3255 +#: ../../library/typing.rst:3261 msgid "Deprecated alias to :class:`collections.deque`." msgstr "棄用 :class:`collections.deque` 的別名。" -#: ../../library/typing.rst:3260 +#: ../../library/typing.rst:3266 msgid "" ":class:`collections.deque` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3267 +#: ../../library/typing.rst:3273 msgid "Aliases to other concrete types" msgstr "" -#: ../../library/typing.rst:3272 +#: ../../library/typing.rst:3278 msgid "" "The ``typing.io`` namespace is deprecated and will be removed. These types " "should be directly imported from ``typing`` instead." msgstr "" -#: ../../library/typing.rst:3276 +#: ../../library/typing.rst:3282 msgid "" "Deprecated aliases corresponding to the return types from :func:`re.compile` " "and :func:`re.match`." msgstr "" -#: ../../library/typing.rst:3279 +#: ../../library/typing.rst:3285 msgid "" "These types (and the corresponding functions) are generic over :data:" "`AnyStr`. ``Pattern`` can be specialised as ``Pattern[str]`` or " @@ -3079,391 +3079,391 @@ msgid "" "``Match[bytes]``." msgstr "" -#: ../../library/typing.rst:3287 +#: ../../library/typing.rst:3293 msgid "" "The ``typing.re`` namespace is deprecated and will be removed. These types " "should be directly imported from ``typing`` instead." msgstr "" -#: ../../library/typing.rst:3288 +#: ../../library/typing.rst:3294 msgid "" "Classes ``Pattern`` and ``Match`` from :mod:`re` now support ``[]``. See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3294 +#: ../../library/typing.rst:3300 msgid "Deprecated alias for :class:`str`." msgstr "棄用 :class:`str` 的別名。" -#: ../../library/typing.rst:3296 +#: ../../library/typing.rst:3302 msgid "" "``Text`` 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:3300 +#: ../../library/typing.rst:3306 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:3308 +#: ../../library/typing.rst:3314 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 " "planned, but users are encouraged to use :class:`str` instead of ``Text``." msgstr "" -#: ../../library/typing.rst:3318 +#: ../../library/typing.rst:3324 msgid "Aliases to container ABCs in :mod:`collections.abc`" msgstr ":mod:`collections.abc` 中容器 ABC 的別名" -#: ../../library/typing.rst:3322 +#: ../../library/typing.rst:3328 msgid "Deprecated alias to :class:`collections.abc.Set`." msgstr "棄用 :class:`collections.abc.Set` 的別名。" -#: ../../library/typing.rst:3324 +#: ../../library/typing.rst:3330 msgid "" ":class:`collections.abc.Set` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3330 +#: ../../library/typing.rst:3336 msgid "" "This type represents the types :class:`bytes`, :class:`bytearray`, and :" "class:`memoryview` of byte sequences." msgstr "" -#: ../../library/typing.rst:3334 +#: ../../library/typing.rst:3340 msgid "" "Prefer :class:`collections.abc.Buffer`, or a union like ``bytes | bytearray " "| memoryview``." msgstr "" -#: ../../library/typing.rst:3338 +#: ../../library/typing.rst:3344 msgid "Deprecated alias to :class:`collections.abc.Collection`." msgstr "棄用 :class:`collections.abc.Collection` 的別名。" -#: ../../library/typing.rst:3342 +#: ../../library/typing.rst:3348 msgid "" ":class:`collections.abc.Collection` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3348 +#: ../../library/typing.rst:3354 msgid "Deprecated alias to :class:`collections.abc.Container`." msgstr "棄用 :class:`collections.abc.Container` 的別名。" -#: ../../library/typing.rst:3350 +#: ../../library/typing.rst:3356 msgid "" ":class:`collections.abc.Container` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3356 +#: ../../library/typing.rst:3362 msgid "Deprecated alias to :class:`collections.abc.ItemsView`." msgstr "棄用 :class:`collections.abc.ItemsView` 的別名。" -#: ../../library/typing.rst:3358 +#: ../../library/typing.rst:3364 msgid "" ":class:`collections.abc.ItemsView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3364 +#: ../../library/typing.rst:3370 msgid "Deprecated alias to :class:`collections.abc.KeysView`." msgstr "棄用 :class:`collections.abc.KeysView` 的別名。" -#: ../../library/typing.rst:3366 +#: ../../library/typing.rst:3372 msgid "" ":class:`collections.abc.KeysView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3372 +#: ../../library/typing.rst:3378 msgid "Deprecated alias to :class:`collections.abc.Mapping`." msgstr "棄用 :class:`collections.abc.Mapping` 的別名。" -#: ../../library/typing.rst:3379 +#: ../../library/typing.rst:3385 msgid "" ":class:`collections.abc.Mapping` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3385 +#: ../../library/typing.rst:3391 msgid "Deprecated alias to :class:`collections.abc.MappingView`." msgstr "棄用 :class:`collections.abc.MappingView` 的別名。" -#: ../../library/typing.rst:3387 +#: ../../library/typing.rst:3393 msgid "" ":class:`collections.abc.MappingView` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3393 +#: ../../library/typing.rst:3399 msgid "Deprecated alias to :class:`collections.abc.MutableMapping`." msgstr "棄用 :class:`collections.abc.MutableMapping` 的別名。" -#: ../../library/typing.rst:3395 +#: ../../library/typing.rst:3401 msgid "" ":class:`collections.abc.MutableMapping` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3402 +#: ../../library/typing.rst:3408 msgid "Deprecated alias to :class:`collections.abc.MutableSequence`." msgstr "棄用 :class:`collections.abc.MutableSequence` 的別名。" -#: ../../library/typing.rst:3404 +#: ../../library/typing.rst:3410 msgid "" ":class:`collections.abc.MutableSequence` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3411 +#: ../../library/typing.rst:3417 msgid "Deprecated alias to :class:`collections.abc.MutableSet`." msgstr "棄用 :class:`collections.abc.MutableSet` 的別名。" -#: ../../library/typing.rst:3413 +#: ../../library/typing.rst:3419 msgid "" ":class:`collections.abc.MutableSet` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3419 +#: ../../library/typing.rst:3425 msgid "Deprecated alias to :class:`collections.abc.Sequence`." msgstr "棄用 :class:`collections.abc.Sequence` 的別名。" -#: ../../library/typing.rst:3421 +#: ../../library/typing.rst:3427 msgid "" ":class:`collections.abc.Sequence` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3427 +#: ../../library/typing.rst:3433 msgid "Deprecated alias to :class:`collections.abc.ValuesView`." msgstr "棄用 :class:`collections.abc.ValuesView` 的別名。" -#: ../../library/typing.rst:3429 +#: ../../library/typing.rst:3435 msgid "" ":class:`collections.abc.ValuesView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3436 +#: ../../library/typing.rst:3442 msgid "Aliases to asynchronous ABCs in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:3440 +#: ../../library/typing.rst:3446 msgid "Deprecated alias to :class:`collections.abc.Coroutine`." msgstr "棄用 :class:`collections.abc.Coroutine` 的別名。" -#: ../../library/typing.rst:3442 +#: ../../library/typing.rst:3448 msgid "" "The variance and order of type variables correspond to those of :class:" "`Generator`, for example::" msgstr "" -#: ../../library/typing.rst:3453 +#: ../../library/typing.rst:3459 msgid "" ":class:`collections.abc.Coroutine` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3459 +#: ../../library/typing.rst:3465 msgid "Deprecated alias to :class:`collections.abc.AsyncGenerator`." msgstr "棄用 :class:`collections.abc.AsyncGenerator` 的別名。" -#: ../../library/typing.rst:3461 +#: ../../library/typing.rst:3467 msgid "" "An async generator can be annotated by the generic type " "``AsyncGenerator[YieldType, SendType]``. For example::" msgstr "" -#: ../../library/typing.rst:3470 +#: ../../library/typing.rst:3476 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:3474 +#: ../../library/typing.rst:3480 msgid "" "If your generator will only yield values, set the ``SendType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:3482 +#: ../../library/typing.rst:3488 msgid "" "Alternatively, annotate your generator as having a return type of either " "``AsyncIterable[YieldType]`` or ``AsyncIterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:3492 +#: ../../library/typing.rst:3498 msgid "" ":class:`collections.abc.AsyncGenerator` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3499 +#: ../../library/typing.rst:3505 msgid "Deprecated alias to :class:`collections.abc.AsyncIterable`." msgstr "棄用 :class:`collections.abc.AsyncIterable` 的別名。" -#: ../../library/typing.rst:3503 +#: ../../library/typing.rst:3509 msgid "" ":class:`collections.abc.AsyncIterable` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3509 +#: ../../library/typing.rst:3515 msgid "Deprecated alias to :class:`collections.abc.AsyncIterator`." msgstr "棄用 :class:`collections.abc.AsyncIterator` 的別名。" -#: ../../library/typing.rst:3513 +#: ../../library/typing.rst:3519 msgid "" ":class:`collections.abc.AsyncIterator` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3519 +#: ../../library/typing.rst:3525 msgid "Deprecated alias to :class:`collections.abc.Awaitable`." msgstr "棄用 :class:`collections.abc.Awaitable` 的別名。" -#: ../../library/typing.rst:3523 +#: ../../library/typing.rst:3529 msgid "" ":class:`collections.abc.Awaitable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3530 +#: ../../library/typing.rst:3536 msgid "Aliases to other ABCs in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:3534 +#: ../../library/typing.rst:3540 msgid "Deprecated alias to :class:`collections.abc.Iterable`." msgstr "棄用 :class:`collections.abc.Iterable` 的別名。" -#: ../../library/typing.rst:3536 +#: ../../library/typing.rst:3542 msgid "" ":class:`collections.abc.Iterable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3542 +#: ../../library/typing.rst:3548 msgid "Deprecated alias to :class:`collections.abc.Iterator`." msgstr "棄用 :class:`collections.abc.Iterator` 的別名。" -#: ../../library/typing.rst:3544 +#: ../../library/typing.rst:3550 msgid "" ":class:`collections.abc.Iterator` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3550 +#: ../../library/typing.rst:3556 msgid "Deprecated alias to :class:`collections.abc.Callable`." msgstr "棄用 :class:`collections.abc.Callable` 的別名。" -#: ../../library/typing.rst:3552 +#: ../../library/typing.rst:3558 msgid "" "See :ref:`annotating-callables` for details on how to use :class:" "`collections.abc.Callable` and ``typing.Callable`` in type annotations." msgstr "" -#: ../../library/typing.rst:3555 +#: ../../library/typing.rst:3561 msgid "" ":class:`collections.abc.Callable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3565 +#: ../../library/typing.rst:3571 msgid "Deprecated alias to :class:`collections.abc.Generator`." msgstr "棄用 :class:`collections.abc.Generator` 的別名。" -#: ../../library/typing.rst:3567 +#: ../../library/typing.rst:3573 msgid "" "A generator can be annotated by the generic type ``Generator[YieldType, " "SendType, ReturnType]``. For example::" msgstr "" -#: ../../library/typing.rst:3576 +#: ../../library/typing.rst:3582 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:3580 +#: ../../library/typing.rst:3586 msgid "" "If your generator will only yield values, set the ``SendType`` and " "``ReturnType`` to ``None``::" msgstr "" -#: ../../library/typing.rst:3588 +#: ../../library/typing.rst:3594 msgid "" "Alternatively, annotate your generator as having a return type of either " "``Iterable[YieldType]`` or ``Iterator[YieldType]``::" msgstr "" -#: ../../library/typing.rst:3596 +#: ../../library/typing.rst:3602 msgid "" ":class:`collections.abc.Generator` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3602 +#: ../../library/typing.rst:3608 msgid "Deprecated alias to :class:`collections.abc.Hashable`." msgstr "棄用 :class:`collections.abc.Hashable` 的別名。" -#: ../../library/typing.rst:3604 +#: ../../library/typing.rst:3610 msgid "Use :class:`collections.abc.Hashable` directly instead." msgstr "改為直接使用 :class:`collections.abc.Hashable`。" -#: ../../library/typing.rst:3609 +#: ../../library/typing.rst:3615 msgid "Deprecated alias to :class:`collections.abc.Reversible`." msgstr "棄用 :class:`collections.abc.Reversible` 的別名。" -#: ../../library/typing.rst:3611 +#: ../../library/typing.rst:3617 msgid "" ":class:`collections.abc.Reversible` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3617 +#: ../../library/typing.rst:3623 msgid "Deprecated alias to :class:`collections.abc.Sized`." msgstr "棄用 :class:`collections.abc.Sized` 的別名。" -#: ../../library/typing.rst:3619 +#: ../../library/typing.rst:3625 msgid "Use :class:`collections.abc.Sized` directly instead." msgstr "改為直接使用 :class:`collections.abc.Sized`。" -#: ../../library/typing.rst:3625 +#: ../../library/typing.rst:3631 msgid "Aliases to :mod:`contextlib` ABCs" msgstr ":mod:`contextlib` ABC 的別名" -#: ../../library/typing.rst:3629 +#: ../../library/typing.rst:3635 msgid "Deprecated alias to :class:`contextlib.AbstractContextManager`." msgstr "" -#: ../../library/typing.rst:3634 +#: ../../library/typing.rst:3640 msgid "" ":class:`contextlib.AbstractContextManager` now supports subscripting " "(``[]``). See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3641 +#: ../../library/typing.rst:3647 msgid "Deprecated alias to :class:`contextlib.AbstractAsyncContextManager`." msgstr "" -#: ../../library/typing.rst:3646 +#: ../../library/typing.rst:3652 msgid "" ":class:`contextlib.AbstractAsyncContextManager` now supports subscripting " "(``[]``). See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3652 +#: ../../library/typing.rst:3658 msgid "Deprecation Timeline of Major Features" msgstr "" -#: ../../library/typing.rst:3654 +#: ../../library/typing.rst:3660 msgid "" "Certain features in ``typing`` are deprecated and may be removed in a future " "version of Python. The following table summarizes major deprecations for " @@ -3471,99 +3471,99 @@ msgid "" "listed." msgstr "" -#: ../../library/typing.rst:3661 +#: ../../library/typing.rst:3667 msgid "Feature" msgstr "" -#: ../../library/typing.rst:3662 +#: ../../library/typing.rst:3668 msgid "Deprecated in" msgstr "棄用於" -#: ../../library/typing.rst:3663 +#: ../../library/typing.rst:3669 msgid "Projected removal" msgstr "" -#: ../../library/typing.rst:3664 +#: ../../library/typing.rst:3670 msgid "PEP/issue" msgstr "" -#: ../../library/typing.rst:3665 +#: ../../library/typing.rst:3671 msgid "``typing.io`` and ``typing.re`` submodules" msgstr "``typing.io`` 和 ``typing.re`` 子模組" -#: ../../library/typing.rst:3666 +#: ../../library/typing.rst:3672 msgid "3.8" msgstr "3.8" -#: ../../library/typing.rst:3667 +#: ../../library/typing.rst:3673 msgid "3.13" msgstr "3.13" -#: ../../library/typing.rst:3668 +#: ../../library/typing.rst:3674 msgid ":issue:`38291`" msgstr ":issue:`38291`" -#: ../../library/typing.rst:3669 +#: ../../library/typing.rst:3675 msgid "``typing`` versions of standard collections" msgstr "" -#: ../../library/typing.rst:3670 ../../library/typing.rst:3674 +#: ../../library/typing.rst:3676 ../../library/typing.rst:3680 msgid "3.9" msgstr "3.9" -#: ../../library/typing.rst:3671 +#: ../../library/typing.rst:3677 msgid "Undecided (see :ref:`deprecated-aliases` for more information)" msgstr "" -#: ../../library/typing.rst:3672 +#: ../../library/typing.rst:3678 msgid ":pep:`585`" msgstr ":pep:`585`" -#: ../../library/typing.rst:3673 +#: ../../library/typing.rst:3679 msgid ":class:`typing.ByteString`" msgstr ":class:`typing.ByteString`" -#: ../../library/typing.rst:3675 +#: ../../library/typing.rst:3681 msgid "3.14" msgstr "3.14" -#: ../../library/typing.rst:3676 +#: ../../library/typing.rst:3682 msgid ":gh:`91896`" msgstr ":gh:`91896`" -#: ../../library/typing.rst:3677 +#: ../../library/typing.rst:3683 msgid ":data:`typing.Text`" msgstr ":data:`typing.Text`" -#: ../../library/typing.rst:3678 +#: ../../library/typing.rst:3684 msgid "3.11" msgstr "3.11" -#: ../../library/typing.rst:3679 ../../library/typing.rst:3683 -#: ../../library/typing.rst:3687 +#: ../../library/typing.rst:3685 ../../library/typing.rst:3689 +#: ../../library/typing.rst:3693 msgid "Undecided" msgstr "" -#: ../../library/typing.rst:3680 +#: ../../library/typing.rst:3686 msgid ":gh:`92332`" msgstr ":gh:`92332`" -#: ../../library/typing.rst:3681 +#: ../../library/typing.rst:3687 msgid ":class:`typing.Hashable` and :class:`typing.Sized`" msgstr ":class:`typing.Hashable` 和 :class:`typing.Sized`。" -#: ../../library/typing.rst:3682 ../../library/typing.rst:3686 +#: ../../library/typing.rst:3688 ../../library/typing.rst:3692 msgid "3.12" msgstr "" -#: ../../library/typing.rst:3684 +#: ../../library/typing.rst:3690 msgid ":gh:`94309`" msgstr ":gh:`94309`" -#: ../../library/typing.rst:3685 +#: ../../library/typing.rst:3691 msgid ":data:`typing.TypeAlias`" msgstr ":data:`typing.TypeAlias`" -#: ../../library/typing.rst:3688 +#: ../../library/typing.rst:3694 msgid ":pep:`695`" msgstr ":pep:`695`" diff --git a/library/unittest.mock.po b/library/unittest.mock.po index 17cf967b7f..6b9d6326e3 100644 --- a/library/unittest.mock.po +++ b/library/unittest.mock.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" -"PO-Revision-Date: 2023-10-10 21:59+0800\n" +"POT-Creation-Date: 2023-10-20 00:03+0000\n" +"PO-Revision-Date: 2023-09-09 23:07+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -1459,7 +1459,7 @@ msgid "" ":func:`patch.dict` can be used with dictionary like objects that aren't " "actually dictionaries. At the very minimum they must support item getting, " "setting, deleting and either iteration or membership test. This corresponds " -"to the magic methods :meth:`__getitem__`, :meth:`__setitem__`, :meth:" +"to the magic methods :meth:`~object.__getitem__`, :meth:`__setitem__`, :meth:" "`__delitem__` and either :meth:`__iter__` or :meth:`__contains__`." msgstr "" @@ -2320,8 +2320,8 @@ msgstr "" #: ../../library/unittest.mock.rst:2484 msgid "" "The issue is that even if you mock out the call to :func:`open` it is the " -"*returned object* that is used as a context manager (and has :meth:" -"`__enter__` and :meth:`__exit__` called)." +"*returned object* that is used as a context manager (and has :meth:`~object." +"__enter__` and :meth:`~object.__exit__` called)." msgstr "" #: ../../library/unittest.mock.rst:2488 diff --git a/library/wsgiref.po b/library/wsgiref.po index ff281215b8..0c898ef064 100644 --- a/library/wsgiref.po +++ b/library/wsgiref.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-22 00:16+0000\n" +"POT-Creation-Date: 2023-10-20 00:03+0000\n" "PO-Revision-Date: 2016-11-19 00:36+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -246,7 +246,7 @@ msgid "" msgstr "" #: ../../library/wsgiref.rst:182 -msgid "Support for :meth:`__getitem__` method has been removed." +msgid "Support for :meth:`~object.__getitem__` method has been removed." msgstr "" #: ../../library/wsgiref.rst:187 @@ -269,13 +269,13 @@ msgstr "" #: ../../library/wsgiref.rst:203 msgid "" ":class:`Headers` objects support typical mapping operations including :meth:" -"`__getitem__`, :meth:`get`, :meth:`__setitem__`, :meth:`setdefault`, :meth:" -"`__delitem__` and :meth:`__contains__`. For each of these methods, the key " -"is the header name (treated case-insensitively), and the value is the first " -"value associated with that header name. Setting a header deletes any " -"existing values for that header, then adds a new value at the end of the " -"wrapped header list. Headers' existing order is generally maintained, with " -"new headers added to the end of the wrapped list." +"`~object.__getitem__`, :meth:`get`, :meth:`__setitem__`, :meth:" +"`setdefault`, :meth:`__delitem__` and :meth:`__contains__`. For each of " +"these methods, the key is the header name (treated case-insensitively), and " +"the value is the first value associated with that header name. Setting a " +"header deletes any existing values for that header, then adds a new value at " +"the end of the wrapped header list. Headers' existing order is generally " +"maintained, with new headers added to the end of the wrapped list." msgstr "" #: ../../library/wsgiref.rst:212 diff --git a/library/xml.dom.pulldom.po b/library/xml.dom.pulldom.po index 818fcc93e9..d8ead6c8c4 100644 --- a/library/xml.dom.pulldom.po +++ b/library/xml.dom.pulldom.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2023-10-20 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:16+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -153,7 +153,7 @@ msgid "DOMEventStream Objects" msgstr "DOMEventStream 物件" #: ../../library/xml.dom.pulldom.rst:117 -msgid "Support for :meth:`__getitem__` method has been removed." +msgid "Support for :meth:`~object.__getitem__` method has been removed." msgstr "" #: ../../library/xml.dom.pulldom.rst:122 diff --git a/library/xml.etree.elementtree.po b/library/xml.etree.elementtree.po index 99998e7c40..6985eb992d 100644 --- a/library/xml.etree.elementtree.po +++ b/library/xml.etree.elementtree.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-11 17:13+0000\n" +"POT-Creation-Date: 2023-11-01 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:16+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -38,7 +38,7 @@ msgstr "" #: ../../library/xml.etree.elementtree.rst:19 msgid "The :mod:`!xml.etree.cElementTree` module is deprecated." -msgstr "" +msgstr ":mod:`!xml.etree.cElementTree` 模組已被棄用。" #: ../../library/xml.etree.elementtree.rst:25 msgid "" @@ -49,7 +49,7 @@ msgstr "" #: ../../library/xml.etree.elementtree.rst:30 msgid "Tutorial" -msgstr "" +msgstr "教學" #: ../../library/xml.etree.elementtree.rst:32 msgid "" @@ -75,7 +75,7 @@ msgstr "" #: ../../library/xml.etree.elementtree.rst:50 msgid "Parsing XML" -msgstr "" +msgstr "剖析 XML" #: ../../library/xml.etree.elementtree.rst:52 msgid "" @@ -147,14 +147,14 @@ msgid "" "XML elements, call :meth:`XMLPullParser.read_events`. Here is an example::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:158 +#: ../../library/xml.etree.elementtree.rst:159 msgid "" "The obvious use case is applications that operate in a non-blocking fashion " "where the XML data is being received from a socket or read incrementally " "from some storage device. In such cases, blocking reads are unacceptable." msgstr "" -#: ../../library/xml.etree.elementtree.rst:162 +#: ../../library/xml.etree.elementtree.rst:163 msgid "" "Because it's so flexible, :class:`XMLPullParser` can be inconvenient to use " "for simpler use-cases. If you don't mind your application blocking on " @@ -164,18 +164,18 @@ msgid "" "memory." msgstr "" -#: ../../library/xml.etree.elementtree.rst:169 +#: ../../library/xml.etree.elementtree.rst:170 msgid "Finding interesting elements" msgstr "" -#: ../../library/xml.etree.elementtree.rst:171 +#: ../../library/xml.etree.elementtree.rst:172 msgid "" ":class:`Element` has some useful methods that help iterate recursively over " "all the sub-tree below it (its children, their children, and so on). For " "example, :meth:`Element.iter`::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:184 +#: ../../library/xml.etree.elementtree.rst:185 msgid "" ":meth:`Element.findall` finds only elements with a tag which are direct " "children of the current element. :meth:`Element.find` finds the *first* " @@ -183,23 +183,23 @@ msgid "" "text content. :meth:`Element.get` accesses the element's attributes::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:198 +#: ../../library/xml.etree.elementtree.rst:199 msgid "" "More sophisticated specification of which elements to look for is possible " "by using :ref:`XPath `." msgstr "" -#: ../../library/xml.etree.elementtree.rst:202 +#: ../../library/xml.etree.elementtree.rst:203 msgid "Modifying an XML File" -msgstr "" +msgstr "改動 XML 檔案" -#: ../../library/xml.etree.elementtree.rst:204 +#: ../../library/xml.etree.elementtree.rst:205 msgid "" ":class:`ElementTree` provides a simple way to build XML documents and write " "them to files. The :meth:`ElementTree.write` method serves this purpose." msgstr "" -#: ../../library/xml.etree.elementtree.rst:207 +#: ../../library/xml.etree.elementtree.rst:208 msgid "" "Once created, an :class:`Element` object may be manipulated by directly " "changing its fields (such as :attr:`Element.text`), adding and modifying " @@ -207,24 +207,24 @@ msgid "" "example with :meth:`Element.append`)." msgstr "" -#: ../../library/xml.etree.elementtree.rst:212 +#: ../../library/xml.etree.elementtree.rst:213 msgid "" "Let's say we want to add one to each country's rank, and add an ``updated`` " "attribute to the rank element::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:222 -#: ../../library/xml.etree.elementtree.rst:266 +#: ../../library/xml.etree.elementtree.rst:223 +#: ../../library/xml.etree.elementtree.rst:267 msgid "Our XML now looks like this:" -msgstr "" +msgstr "XML 現在看起來像這樣:" -#: ../../library/xml.etree.elementtree.rst:250 +#: ../../library/xml.etree.elementtree.rst:251 msgid "" "We can remove elements using :meth:`Element.remove`. Let's say we want to " "remove all countries with a rank higher than 50::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:261 +#: ../../library/xml.etree.elementtree.rst:262 msgid "" "Note that concurrent modification while iterating can lead to problems, just " "like when iterating and modifying Python lists or dicts. Therefore, the " @@ -232,21 +232,21 @@ msgid "" "only then iterates over the list of matches." msgstr "" -#: ../../library/xml.etree.elementtree.rst:288 +#: ../../library/xml.etree.elementtree.rst:289 msgid "Building XML documents" msgstr "" -#: ../../library/xml.etree.elementtree.rst:290 +#: ../../library/xml.etree.elementtree.rst:291 msgid "" "The :func:`SubElement` function also provides a convenient way to create new " "sub-elements for a given element::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:301 +#: ../../library/xml.etree.elementtree.rst:302 msgid "Parsing XML with Namespaces" msgstr "" -#: ../../library/xml.etree.elementtree.rst:303 +#: ../../library/xml.etree.elementtree.rst:304 msgid "" "If the XML input has `namespaces `__, tags and attributes with prefixes in the form ``prefix:" @@ -256,34 +256,34 @@ msgid "" "prefixed tags." msgstr "" -#: ../../library/xml.etree.elementtree.rst:311 +#: ../../library/xml.etree.elementtree.rst:312 msgid "" "Here is an XML example that incorporates two namespaces, one with the prefix " "\"fictional\" and the other serving as the default namespace:" msgstr "" -#: ../../library/xml.etree.elementtree.rst:332 +#: ../../library/xml.etree.elementtree.rst:333 msgid "" "One way to search and explore this XML example is to manually add the URI to " "every tag or attribute in the xpath of a :meth:`~Element.find` or :meth:" "`~Element.findall`::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:343 +#: ../../library/xml.etree.elementtree.rst:344 msgid "" "A better way to search the namespaced XML example is to create a dictionary " "with your own prefixes and use those in the search functions::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:355 +#: ../../library/xml.etree.elementtree.rst:356 msgid "These two approaches both output::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:369 +#: ../../library/xml.etree.elementtree.rst:370 msgid "XPath support" -msgstr "" +msgstr "XPath 支援" -#: ../../library/xml.etree.elementtree.rst:371 +#: ../../library/xml.etree.elementtree.rst:372 msgid "" "This module provides limited support for `XPath expressions `_ for locating elements in a tree. The goal is to support a " @@ -291,41 +291,41 @@ msgid "" "scope of the module." msgstr "" -#: ../../library/xml.etree.elementtree.rst:377 -#: ../../library/xml.etree.elementtree.rst:769 +#: ../../library/xml.etree.elementtree.rst:378 +#: ../../library/xml.etree.elementtree.rst:772 msgid "Example" msgstr "範例" -#: ../../library/xml.etree.elementtree.rst:379 +#: ../../library/xml.etree.elementtree.rst:380 msgid "" "Here's an example that demonstrates some of the XPath capabilities of the " "module. We'll be using the ``countrydata`` XML document from the :ref:" "`Parsing XML ` section::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:403 +#: ../../library/xml.etree.elementtree.rst:404 msgid "" "For XML with namespaces, use the usual qualified ``{namespace}tag`` " "notation::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:410 +#: ../../library/xml.etree.elementtree.rst:411 msgid "Supported XPath syntax" msgstr "" -#: ../../library/xml.etree.elementtree.rst:415 +#: ../../library/xml.etree.elementtree.rst:416 msgid "Syntax" -msgstr "" +msgstr "語法" -#: ../../library/xml.etree.elementtree.rst:415 +#: ../../library/xml.etree.elementtree.rst:416 msgid "Meaning" -msgstr "" +msgstr "意義" -#: ../../library/xml.etree.elementtree.rst:417 +#: ../../library/xml.etree.elementtree.rst:418 msgid "``tag``" msgstr "``tag``" -#: ../../library/xml.etree.elementtree.rst:417 +#: ../../library/xml.etree.elementtree.rst:418 msgid "" "Selects all child elements with the given tag. For example, ``spam`` selects " "all child elements named ``spam``, and ``spam/egg`` selects all " @@ -335,133 +335,133 @@ msgid "" "not in a namespace." msgstr "" -#: ../../library/xml.etree.elementtree.rst:426 +#: ../../library/xml.etree.elementtree.rst:427 msgid "Support for star-wildcards was added." -msgstr "" +msgstr "新增對星號萬用字元的支援。" -#: ../../library/xml.etree.elementtree.rst:429 +#: ../../library/xml.etree.elementtree.rst:430 msgid "``*``" msgstr "``*``" -#: ../../library/xml.etree.elementtree.rst:429 +#: ../../library/xml.etree.elementtree.rst:430 msgid "" "Selects all child elements, including comments and processing instructions. " "For example, ``*/egg`` selects all grandchildren named ``egg``." msgstr "" -#: ../../library/xml.etree.elementtree.rst:433 +#: ../../library/xml.etree.elementtree.rst:434 msgid "``.``" msgstr "``.``" -#: ../../library/xml.etree.elementtree.rst:433 +#: ../../library/xml.etree.elementtree.rst:434 msgid "" "Selects the current node. This is mostly useful at the beginning of the " "path, to indicate that it's a relative path." msgstr "" -#: ../../library/xml.etree.elementtree.rst:437 +#: ../../library/xml.etree.elementtree.rst:438 msgid "``//``" msgstr "``//``" -#: ../../library/xml.etree.elementtree.rst:437 +#: ../../library/xml.etree.elementtree.rst:438 msgid "" "Selects all subelements, on all levels beneath the current element. For " "example, ``.//egg`` selects all ``egg`` elements in the entire tree." msgstr "" -#: ../../library/xml.etree.elementtree.rst:441 +#: ../../library/xml.etree.elementtree.rst:442 msgid "``..``" msgstr "``..``" -#: ../../library/xml.etree.elementtree.rst:441 +#: ../../library/xml.etree.elementtree.rst:442 msgid "" "Selects the parent element. Returns ``None`` if the path attempts to reach " "the ancestors of the start element (the element ``find`` was called on)." msgstr "" -#: ../../library/xml.etree.elementtree.rst:445 +#: ../../library/xml.etree.elementtree.rst:446 msgid "``[@attrib]``" msgstr "``[@attrib]``" -#: ../../library/xml.etree.elementtree.rst:445 +#: ../../library/xml.etree.elementtree.rst:446 msgid "Selects all elements that have the given attribute." -msgstr "" +msgstr "選擇所有具有給定屬性的元素。" -#: ../../library/xml.etree.elementtree.rst:447 +#: ../../library/xml.etree.elementtree.rst:448 msgid "``[@attrib='value']``" msgstr "``[@attrib='value']``" -#: ../../library/xml.etree.elementtree.rst:447 +#: ../../library/xml.etree.elementtree.rst:448 msgid "" "Selects all elements for which the given attribute has the given value. The " "value cannot contain quotes." msgstr "" -#: ../../library/xml.etree.elementtree.rst:451 +#: ../../library/xml.etree.elementtree.rst:452 msgid "``[@attrib!='value']``" msgstr "``[@attrib!='value']``" -#: ../../library/xml.etree.elementtree.rst:451 +#: ../../library/xml.etree.elementtree.rst:452 msgid "" "Selects all elements for which the given attribute does not have the given " "value. The value cannot contain quotes." msgstr "" -#: ../../library/xml.etree.elementtree.rst:457 +#: ../../library/xml.etree.elementtree.rst:458 msgid "``[tag]``" msgstr "``[tag]``" -#: ../../library/xml.etree.elementtree.rst:457 +#: ../../library/xml.etree.elementtree.rst:458 msgid "" "Selects all elements that have a child named ``tag``. Only immediate " "children are supported." msgstr "" -#: ../../library/xml.etree.elementtree.rst:460 +#: ../../library/xml.etree.elementtree.rst:461 msgid "``[.='text']``" msgstr "``[.='text']``" -#: ../../library/xml.etree.elementtree.rst:460 +#: ../../library/xml.etree.elementtree.rst:461 msgid "" "Selects all elements whose complete text content, including descendants, " "equals the given ``text``." msgstr "" -#: ../../library/xml.etree.elementtree.rst:465 +#: ../../library/xml.etree.elementtree.rst:466 msgid "``[.!='text']``" msgstr "``[.!='text']``" -#: ../../library/xml.etree.elementtree.rst:465 +#: ../../library/xml.etree.elementtree.rst:466 msgid "" "Selects all elements whose complete text content, including descendants, " "does not equal the given ``text``." msgstr "" -#: ../../library/xml.etree.elementtree.rst:471 +#: ../../library/xml.etree.elementtree.rst:472 msgid "``[tag='text']``" msgstr "``[tag='text']``" -#: ../../library/xml.etree.elementtree.rst:471 +#: ../../library/xml.etree.elementtree.rst:472 msgid "" "Selects all elements that have a child named ``tag`` whose complete text " "content, including descendants, equals the given ``text``." msgstr "" -#: ../../library/xml.etree.elementtree.rst:475 +#: ../../library/xml.etree.elementtree.rst:476 msgid "``[tag!='text']``" msgstr "``[tag!='text']``" -#: ../../library/xml.etree.elementtree.rst:475 +#: ../../library/xml.etree.elementtree.rst:476 msgid "" "Selects all elements that have a child named ``tag`` whose complete text " "content, including descendants, does not equal the given ``text``." msgstr "" -#: ../../library/xml.etree.elementtree.rst:481 +#: ../../library/xml.etree.elementtree.rst:482 msgid "``[position]``" msgstr "``[position]``" -#: ../../library/xml.etree.elementtree.rst:481 +#: ../../library/xml.etree.elementtree.rst:482 msgid "" "Selects all elements that are located at the given position. The position " "can be either an integer (1 is the first position), the expression " @@ -469,28 +469,28 @@ msgid "" "position (e.g. ``last()-1``)." msgstr "" -#: ../../library/xml.etree.elementtree.rst:488 +#: ../../library/xml.etree.elementtree.rst:489 msgid "" "Predicates (expressions within square brackets) must be preceded by a tag " "name, an asterisk, or another predicate. ``position`` predicates must be " "preceded by a tag name." msgstr "" -#: ../../library/xml.etree.elementtree.rst:493 -#: ../../library/xml.etree.elementtree.rst:821 +#: ../../library/xml.etree.elementtree.rst:494 +#: ../../library/xml.etree.elementtree.rst:824 msgid "Reference" msgstr "" -#: ../../library/xml.etree.elementtree.rst:498 -#: ../../library/xml.etree.elementtree.rst:826 +#: ../../library/xml.etree.elementtree.rst:499 +#: ../../library/xml.etree.elementtree.rst:829 msgid "Functions" msgstr "函式" -#: ../../library/xml.etree.elementtree.rst:502 +#: ../../library/xml.etree.elementtree.rst:503 msgid "`C14N 2.0 `_ transformation function." msgstr "" -#: ../../library/xml.etree.elementtree.rst:504 +#: ../../library/xml.etree.elementtree.rst:505 msgid "" "Canonicalization is a way to normalise XML output in a way that allows byte-" "by-byte comparisons and digital signatures. It reduced the freedom that XML " @@ -499,7 +499,7 @@ msgid "" "declarations, the ordering of attributes, and ignorable whitespace." msgstr "" -#: ../../library/xml.etree.elementtree.rst:510 +#: ../../library/xml.etree.elementtree.rst:511 msgid "" "This function takes an XML data string (*xml_data*) or a file path or file-" "like object (*from_file*) as input, converts it to the canonical form, and " @@ -508,63 +508,63 @@ msgid "" "should therefore be opened in text mode with ``utf-8`` encoding." msgstr "" -#: ../../library/xml.etree.elementtree.rst:517 +#: ../../library/xml.etree.elementtree.rst:518 msgid "Typical uses::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:528 +#: ../../library/xml.etree.elementtree.rst:529 msgid "The configuration *options* are as follows:" msgstr "" -#: ../../library/xml.etree.elementtree.rst:530 +#: ../../library/xml.etree.elementtree.rst:531 msgid "*with_comments*: set to true to include comments (default: false)" msgstr "" -#: ../../library/xml.etree.elementtree.rst:531 +#: ../../library/xml.etree.elementtree.rst:532 msgid "" "*strip_text*: set to true to strip whitespace before and after text content" msgstr "" -#: ../../library/xml.etree.elementtree.rst:532 -#: ../../library/xml.etree.elementtree.rst:534 +#: ../../library/xml.etree.elementtree.rst:533 +#: ../../library/xml.etree.elementtree.rst:535 msgid "(default: false)" msgstr "" -#: ../../library/xml.etree.elementtree.rst:533 +#: ../../library/xml.etree.elementtree.rst:534 msgid "" "*rewrite_prefixes*: set to true to replace namespace prefixes by " "\"n{number}\"" msgstr "" -#: ../../library/xml.etree.elementtree.rst:535 +#: ../../library/xml.etree.elementtree.rst:536 msgid "*qname_aware_tags*: a set of qname aware tag names in which prefixes" msgstr "" -#: ../../library/xml.etree.elementtree.rst:536 -#: ../../library/xml.etree.elementtree.rst:538 +#: ../../library/xml.etree.elementtree.rst:537 +#: ../../library/xml.etree.elementtree.rst:539 msgid "should be replaced in text content (default: empty)" msgstr "" -#: ../../library/xml.etree.elementtree.rst:537 +#: ../../library/xml.etree.elementtree.rst:538 msgid "" "*qname_aware_attrs*: a set of qname aware attribute names in which prefixes" msgstr "" -#: ../../library/xml.etree.elementtree.rst:539 +#: ../../library/xml.etree.elementtree.rst:540 msgid "*exclude_attrs*: a set of attribute names that should not be serialised" msgstr "" -#: ../../library/xml.etree.elementtree.rst:540 +#: ../../library/xml.etree.elementtree.rst:541 msgid "*exclude_tags*: a set of tag names that should not be serialised" msgstr "" -#: ../../library/xml.etree.elementtree.rst:542 +#: ../../library/xml.etree.elementtree.rst:543 msgid "" "In the option list above, \"a set\" refers to any collection or iterable of " "strings, no ordering is expected." msgstr "" -#: ../../library/xml.etree.elementtree.rst:550 +#: ../../library/xml.etree.elementtree.rst:551 msgid "" "Comment element factory. This factory function creates a special element " "that will be serialized as an XML comment by the standard serializer. The " @@ -573,7 +573,7 @@ msgid "" "representing a comment." msgstr "" -#: ../../library/xml.etree.elementtree.rst:556 +#: ../../library/xml.etree.elementtree.rst:557 msgid "" "Note that :class:`XMLParser` skips over comments in the input instead of " "creating comment objects for them. An :class:`ElementTree` will only contain " @@ -581,29 +581,29 @@ msgid "" "class:`Element` methods." msgstr "" -#: ../../library/xml.etree.elementtree.rst:563 +#: ../../library/xml.etree.elementtree.rst:564 msgid "" "Writes an element tree or element structure to sys.stdout. This function " "should be used for debugging only." msgstr "" -#: ../../library/xml.etree.elementtree.rst:566 +#: ../../library/xml.etree.elementtree.rst:567 msgid "" "The exact output format is implementation dependent. In this version, it's " "written as an ordinary XML file." msgstr "" -#: ../../library/xml.etree.elementtree.rst:569 +#: ../../library/xml.etree.elementtree.rst:570 msgid "*elem* is an element tree or an individual element." msgstr "" -#: ../../library/xml.etree.elementtree.rst:571 +#: ../../library/xml.etree.elementtree.rst:572 msgid "" "The :func:`dump` function now preserves the attribute order specified by the " "user." msgstr "" -#: ../../library/xml.etree.elementtree.rst:578 +#: ../../library/xml.etree.elementtree.rst:579 msgid "" "Parses an XML section from a string constant. Same as :func:`XML`. *text* " "is a string containing XML data. *parser* is an optional parser instance. " @@ -611,7 +611,7 @@ msgid "" "class:`Element` instance." msgstr "" -#: ../../library/xml.etree.elementtree.rst:586 +#: ../../library/xml.etree.elementtree.rst:587 msgid "" "Parses an XML document from a sequence of string fragments. *sequence* is a " "list or other sequence containing XML data fragments. *parser* is an " @@ -619,7 +619,7 @@ msgid "" "parser is used. Returns an :class:`Element` instance." msgstr "" -#: ../../library/xml.etree.elementtree.rst:596 +#: ../../library/xml.etree.elementtree.rst:597 msgid "" "Appends whitespace to the subtree to indent the tree visually. This can be " "used to generate pretty-printed XML output. *tree* can be an Element or " @@ -629,13 +629,13 @@ msgid "" "indentation level as *level*." msgstr "" -#: ../../library/xml.etree.elementtree.rst:608 +#: ../../library/xml.etree.elementtree.rst:609 msgid "" "Check if an object appears to be a valid element object. *element* is an " "element instance. Return ``True`` if this is an element object." msgstr "" -#: ../../library/xml.etree.elementtree.rst:614 +#: ../../library/xml.etree.elementtree.rst:615 msgid "" "Parses an XML section into an element tree incrementally, and reports what's " "going on to the user. *source* is a filename or :term:`file object` " @@ -646,11 +646,13 @@ msgid "" "omitted, only ``\"end\"`` events are reported. *parser* is an optional " "parser instance. If not given, the standard :class:`XMLParser` parser is " "used. *parser* must be a subclass of :class:`XMLParser` and can only use " -"the default :class:`TreeBuilder` as a target. Returns an :term:`iterator` " -"providing ``(event, elem)`` pairs." +"the default :class:`TreeBuilder` as a target. Returns an :term:`iterator` " +"providing ``(event, elem)`` pairs; it has a ``root`` attribute that " +"references the root element of the resulting XML tree once *source* is fully " +"read." msgstr "" -#: ../../library/xml.etree.elementtree.rst:626 +#: ../../library/xml.etree.elementtree.rst:629 msgid "" "Note that while :func:`iterparse` builds the tree incrementally, it issues " "blocking reads on *source* (or the file it names). As such, it's unsuitable " @@ -658,7 +660,7 @@ msgid "" "parsing, see :class:`XMLPullParser`." msgstr "" -#: ../../library/xml.etree.elementtree.rst:633 +#: ../../library/xml.etree.elementtree.rst:636 msgid "" ":func:`iterparse` only guarantees that it has seen the \">\" character of a " "starting tag when it emits a \"start\" event, so the attributes are defined, " @@ -667,21 +669,21 @@ msgid "" "present." msgstr "" -#: ../../library/xml.etree.elementtree.rst:639 -#: ../../library/xml.etree.elementtree.rst:1478 +#: ../../library/xml.etree.elementtree.rst:642 +#: ../../library/xml.etree.elementtree.rst:1481 msgid "If you need a fully populated element, look for \"end\" events instead." msgstr "" -#: ../../library/xml.etree.elementtree.rst:641 +#: ../../library/xml.etree.elementtree.rst:644 msgid "The *parser* argument." msgstr "*parser* 引數。" -#: ../../library/xml.etree.elementtree.rst:644 -#: ../../library/xml.etree.elementtree.rst:1482 +#: ../../library/xml.etree.elementtree.rst:647 +#: ../../library/xml.etree.elementtree.rst:1485 msgid "The ``comment`` and ``pi`` events were added." msgstr "新增 *context* 與 *check_hostname* 事件。" -#: ../../library/xml.etree.elementtree.rst:650 +#: ../../library/xml.etree.elementtree.rst:653 msgid "" "Parses an XML section into an element tree. *source* is a filename or file " "object containing XML data. *parser* is an optional parser instance. If " @@ -689,7 +691,7 @@ msgid "" "class:`ElementTree` instance." msgstr "" -#: ../../library/xml.etree.elementtree.rst:658 +#: ../../library/xml.etree.elementtree.rst:661 msgid "" "PI element factory. This factory function creates a special element that " "will be serialized as an XML processing instruction. *target* is a string " @@ -697,7 +699,7 @@ msgid "" "given. Returns an element instance, representing a processing instruction." msgstr "" -#: ../../library/xml.etree.elementtree.rst:663 +#: ../../library/xml.etree.elementtree.rst:666 msgid "" "Note that :class:`XMLParser` skips over processing instructions in the input " "instead of creating comment objects for them. An :class:`ElementTree` will " @@ -705,7 +707,7 @@ msgid "" "the tree using one of the :class:`Element` methods." msgstr "" -#: ../../library/xml.etree.elementtree.rst:671 +#: ../../library/xml.etree.elementtree.rst:674 msgid "" "Registers a namespace prefix. The registry is global, and any existing " "mapping for either the given prefix or the namespace URI will be removed. " @@ -714,13 +716,13 @@ msgid "" "all possible." msgstr "" -#: ../../library/xml.etree.elementtree.rst:682 +#: ../../library/xml.etree.elementtree.rst:685 msgid "" "Subelement factory. This function creates an element instance, and appends " "it to an existing element." msgstr "" -#: ../../library/xml.etree.elementtree.rst:685 +#: ../../library/xml.etree.elementtree.rst:688 msgid "" "The element name, attribute names, and attribute values can be either " "bytestrings or Unicode strings. *parent* is the parent element. *tag* is " @@ -729,7 +731,7 @@ msgid "" "arguments. Returns an element instance." msgstr "" -#: ../../library/xml.etree.elementtree.rst:696 +#: ../../library/xml.etree.elementtree.rst:699 msgid "" "Generates a string representation of an XML element, including all " "subelements. *element* is an :class:`Element` instance. *encoding* [1]_ is " @@ -741,24 +743,24 @@ msgid "" "Returns an (optionally) encoded string containing the XML data." msgstr "" -#: ../../library/xml.etree.elementtree.rst:705 -#: ../../library/xml.etree.elementtree.rst:732 -#: ../../library/xml.etree.elementtree.rst:1189 +#: ../../library/xml.etree.elementtree.rst:708 +#: ../../library/xml.etree.elementtree.rst:735 +#: ../../library/xml.etree.elementtree.rst:1192 msgid "The *short_empty_elements* parameter." msgstr "*short_empty_elements* 參數。" -#: ../../library/xml.etree.elementtree.rst:708 -#: ../../library/xml.etree.elementtree.rst:735 +#: ../../library/xml.etree.elementtree.rst:711 +#: ../../library/xml.etree.elementtree.rst:738 msgid "The *xml_declaration* and *default_namespace* parameters." msgstr "" -#: ../../library/xml.etree.elementtree.rst:711 +#: ../../library/xml.etree.elementtree.rst:714 msgid "" "The :func:`tostring` function now preserves the attribute order specified by " "the user." msgstr "" -#: ../../library/xml.etree.elementtree.rst:720 +#: ../../library/xml.etree.elementtree.rst:723 msgid "" "Generates a string representation of an XML element, including all " "subelements. *element* is an :class:`Element` instance. *encoding* [1]_ is " @@ -772,13 +774,13 @@ msgid "" "join(tostringlist(element)) == tostring(element)``." msgstr "" -#: ../../library/xml.etree.elementtree.rst:738 +#: ../../library/xml.etree.elementtree.rst:741 msgid "" "The :func:`tostringlist` function now preserves the attribute order " "specified by the user." msgstr "" -#: ../../library/xml.etree.elementtree.rst:745 +#: ../../library/xml.etree.elementtree.rst:748 msgid "" "Parses an XML section from a string constant. This function can be used to " "embed \"XML literals\" in Python code. *text* is a string containing XML " @@ -786,7 +788,7 @@ msgid "" "class:`XMLParser` parser is used. Returns an :class:`Element` instance." msgstr "" -#: ../../library/xml.etree.elementtree.rst:753 +#: ../../library/xml.etree.elementtree.rst:756 msgid "" "Parses an XML section from a string constant, and also returns a dictionary " "which maps from element id:s to elements. *text* is a string containing XML " @@ -795,11 +797,11 @@ msgid "" "`Element` instance and a dictionary." msgstr "" -#: ../../library/xml.etree.elementtree.rst:763 +#: ../../library/xml.etree.elementtree.rst:766 msgid "XInclude support" msgstr "" -#: ../../library/xml.etree.elementtree.rst:765 +#: ../../library/xml.etree.elementtree.rst:768 msgid "" "This module provides limited support for `XInclude directives `_, via the :mod:`xml.etree.ElementInclude` helper " @@ -807,7 +809,7 @@ msgid "" "element trees, based on information in the tree." msgstr "" -#: ../../library/xml.etree.elementtree.rst:771 +#: ../../library/xml.etree.elementtree.rst:774 msgid "" "Here's an example that demonstrates use of the XInclude module. To include " "an XML document in the current document, use the ``{http://www.w3.org/2001/" @@ -815,43 +817,43 @@ msgid "" "and use the **href** attribute to specify the document to include." msgstr "" -#: ../../library/xml.etree.elementtree.rst:780 +#: ../../library/xml.etree.elementtree.rst:783 msgid "" "By default, the **href** attribute is treated as a file name. You can use " "custom loaders to override this behaviour. Also note that the standard " "helper does not support XPointer syntax." msgstr "" -#: ../../library/xml.etree.elementtree.rst:782 +#: ../../library/xml.etree.elementtree.rst:785 msgid "" "To process this file, load it as usual, and pass the root element to the :" "mod:`xml.etree.ElementTree` module:" msgstr "" -#: ../../library/xml.etree.elementtree.rst:793 +#: ../../library/xml.etree.elementtree.rst:796 msgid "" "The ElementInclude module replaces the ``{http://www.w3.org/2001/XInclude}" "include`` element with the root element from the **source.xml** document. " "The result might look something like this:" msgstr "" -#: ../../library/xml.etree.elementtree.rst:801 +#: ../../library/xml.etree.elementtree.rst:804 msgid "" "If the **parse** attribute is omitted, it defaults to \"xml\". The href " "attribute is required." msgstr "" -#: ../../library/xml.etree.elementtree.rst:803 +#: ../../library/xml.etree.elementtree.rst:806 msgid "" "To include a text document, use the ``{http://www.w3.org/2001/XInclude}" "include`` element, and set the **parse** attribute to \"text\":" msgstr "" -#: ../../library/xml.etree.elementtree.rst:812 +#: ../../library/xml.etree.elementtree.rst:815 msgid "The result might look something like:" msgstr "" -#: ../../library/xml.etree.elementtree.rst:833 +#: ../../library/xml.etree.elementtree.rst:836 msgid "" "Default loader. This default loader reads an included resource from disk. " "*href* is a URL. *parse* is for parse mode either \"xml\" or \"text\". " @@ -862,7 +864,7 @@ msgid "" "or raise an exception." msgstr "" -#: ../../library/xml.etree.elementtree.rst:845 +#: ../../library/xml.etree.elementtree.rst:848 msgid "" "This function expands XInclude directives. *elem* is the root element. " "*loader* is an optional resource loader. If omitted, it defaults to :func:" @@ -873,28 +875,28 @@ msgid "" "malicious content explosion. Pass a negative value to disable the limitation." msgstr "" -#: ../../library/xml.etree.elementtree.rst:853 +#: ../../library/xml.etree.elementtree.rst:856 msgid "" "Returns the expanded resource. If the parse mode is ``\"xml\"``, this is an " "ElementTree instance. If the parse mode is \"text\", this is a Unicode " "string. If the loader fails, it can return None or raise an exception." msgstr "" -#: ../../library/xml.etree.elementtree.rst:858 +#: ../../library/xml.etree.elementtree.rst:861 msgid "The *base_url* and *max_depth* parameters." msgstr "" -#: ../../library/xml.etree.elementtree.rst:865 +#: ../../library/xml.etree.elementtree.rst:868 msgid "Element Objects" msgstr "" -#: ../../library/xml.etree.elementtree.rst:872 +#: ../../library/xml.etree.elementtree.rst:875 msgid "" "Element class. This class defines the Element interface, and provides a " "reference implementation of this interface." msgstr "" -#: ../../library/xml.etree.elementtree.rst:875 +#: ../../library/xml.etree.elementtree.rst:878 msgid "" "The element name, attribute names, and attribute values can be either " "bytestrings or Unicode strings. *tag* is the element name. *attrib* is an " @@ -902,13 +904,13 @@ msgid "" "additional attributes, given as keyword arguments." msgstr "" -#: ../../library/xml.etree.elementtree.rst:883 +#: ../../library/xml.etree.elementtree.rst:886 msgid "" "A string identifying what kind of data this element represents (the element " "type, in other words)." msgstr "" -#: ../../library/xml.etree.elementtree.rst:890 +#: ../../library/xml.etree.elementtree.rst:893 msgid "" "These attributes can be used to hold additional data associated with the " "element. Their values are usually strings but may be any application-" @@ -919,7 +921,7 @@ msgid "" "the XML data" msgstr "" -#: ../../library/xml.etree.elementtree.rst:902 +#: ../../library/xml.etree.elementtree.rst:905 msgid "" "the *a* element has ``None`` for both *text* and *tail* attributes, the *b* " "element has *text* ``\"1\"`` and *tail* ``\"4\"``, the *c* element has " @@ -927,17 +929,17 @@ msgid "" "``None`` and *tail* ``\"3\"``." msgstr "" -#: ../../library/xml.etree.elementtree.rst:907 +#: ../../library/xml.etree.elementtree.rst:910 msgid "" "To collect the inner text of an element, see :meth:`itertext`, for example " "``\"\".join(element.itertext())``." msgstr "" -#: ../../library/xml.etree.elementtree.rst:910 +#: ../../library/xml.etree.elementtree.rst:913 msgid "Applications may store arbitrary objects in these attributes." msgstr "" -#: ../../library/xml.etree.elementtree.rst:915 +#: ../../library/xml.etree.elementtree.rst:918 msgid "" "A dictionary containing the element's attributes. Note that while the " "*attrib* value is always a real mutable Python dictionary, an ElementTree " @@ -946,59 +948,59 @@ msgid "" "implementations, use the dictionary methods below whenever possible." msgstr "" -#: ../../library/xml.etree.elementtree.rst:921 +#: ../../library/xml.etree.elementtree.rst:924 msgid "The following dictionary-like methods work on the element attributes." msgstr "" -#: ../../library/xml.etree.elementtree.rst:926 +#: ../../library/xml.etree.elementtree.rst:929 msgid "" "Resets an element. This function removes all subelements, clears all " "attributes, and sets the text and tail attributes to ``None``." msgstr "" -#: ../../library/xml.etree.elementtree.rst:932 +#: ../../library/xml.etree.elementtree.rst:935 msgid "Gets the element attribute named *key*." msgstr "" -#: ../../library/xml.etree.elementtree.rst:934 +#: ../../library/xml.etree.elementtree.rst:937 msgid "" "Returns the attribute value, or *default* if the attribute was not found." msgstr "" -#: ../../library/xml.etree.elementtree.rst:939 +#: ../../library/xml.etree.elementtree.rst:942 msgid "" "Returns the element attributes as a sequence of (name, value) pairs. The " "attributes are returned in an arbitrary order." msgstr "" -#: ../../library/xml.etree.elementtree.rst:945 +#: ../../library/xml.etree.elementtree.rst:948 msgid "" "Returns the elements attribute names as a list. The names are returned in " "an arbitrary order." msgstr "" -#: ../../library/xml.etree.elementtree.rst:951 +#: ../../library/xml.etree.elementtree.rst:954 msgid "Set the attribute *key* on the element to *value*." msgstr "" -#: ../../library/xml.etree.elementtree.rst:953 +#: ../../library/xml.etree.elementtree.rst:956 msgid "The following methods work on the element's children (subelements)." msgstr "" -#: ../../library/xml.etree.elementtree.rst:958 +#: ../../library/xml.etree.elementtree.rst:961 msgid "" "Adds the element *subelement* to the end of this element's internal list of " "subelements. Raises :exc:`TypeError` if *subelement* is not an :class:" "`Element`." msgstr "" -#: ../../library/xml.etree.elementtree.rst:965 +#: ../../library/xml.etree.elementtree.rst:968 msgid "" "Appends *subelements* from a sequence object with zero or more elements. " "Raises :exc:`TypeError` if a subelement is not an :class:`Element`." msgstr "" -#: ../../library/xml.etree.elementtree.rst:973 +#: ../../library/xml.etree.elementtree.rst:976 msgid "" "Finds the first subelement matching *match*. *match* may be a tag name or " "a :ref:`path `. Returns an element instance or " @@ -1007,7 +1009,7 @@ msgid "" "expression into the given namespace." msgstr "" -#: ../../library/xml.etree.elementtree.rst:982 +#: ../../library/xml.etree.elementtree.rst:985 msgid "" "Finds all matching subelements, by tag name or :ref:`path `. Returns a list containing all matching elements in document " @@ -1016,7 +1018,7 @@ msgid "" "expression into the given namespace." msgstr "" -#: ../../library/xml.etree.elementtree.rst:991 +#: ../../library/xml.etree.elementtree.rst:994 msgid "" "Finds text for the first subelement matching *match*. *match* may be a tag " "name or a :ref:`path `. Returns the text content of the " @@ -1027,13 +1029,13 @@ msgid "" "into the given namespace." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1002 +#: ../../library/xml.etree.elementtree.rst:1005 msgid "" "Inserts *subelement* at the given position in this element. Raises :exc:" "`TypeError` if *subelement* is not an :class:`Element`." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1008 +#: ../../library/xml.etree.elementtree.rst:1011 msgid "" "Creates a tree :term:`iterator` with the current element as the root. The " "iterator iterates over this element and all elements below it, in document " @@ -1042,7 +1044,7 @@ msgid "" "structure is modified during iteration, the result is undefined." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1019 +#: ../../library/xml.etree.elementtree.rst:1022 msgid "" "Finds all matching subelements, by tag name or :ref:`path `. Returns an iterable yielding all matching elements in document " @@ -1050,44 +1052,44 @@ msgid "" "name." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1030 +#: ../../library/xml.etree.elementtree.rst:1033 msgid "" "Creates a text iterator. The iterator loops over this element and all " "subelements, in document order, and returns all inner text." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1038 +#: ../../library/xml.etree.elementtree.rst:1041 msgid "" "Creates a new element object of the same type as this element. Do not call " "this method, use the :func:`SubElement` factory function instead." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1044 +#: ../../library/xml.etree.elementtree.rst:1047 msgid "" "Removes *subelement* from the element. Unlike the find\\* methods this " "method compares elements based on the instance identity, not on tag value or " "contents." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1048 +#: ../../library/xml.etree.elementtree.rst:1051 msgid "" ":class:`Element` objects also support the following sequence type methods " "for working with subelements: :meth:`~object.__delitem__`, :meth:`~object." "__getitem__`, :meth:`~object.__setitem__`, :meth:`~object.__len__`." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1053 +#: ../../library/xml.etree.elementtree.rst:1056 msgid "" "Caution: Elements with no subelements will test as ``False``. Testing the " "truth value of an Element is deprecated and will raise an exception in " "Python 3.14. Use specific ``len(elem)`` or ``elem is None`` test instead.::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:1065 +#: ../../library/xml.etree.elementtree.rst:1068 msgid "Testing the truth value of an Element emits :exc:`DeprecationWarning`." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1068 +#: ../../library/xml.etree.elementtree.rst:1071 msgid "" "Prior to Python 3.8, the serialisation order of the XML attributes of " "elements was artificially made predictable by sorting the attributes by " @@ -1096,7 +1098,7 @@ msgid "" "attributes were originally parsed or created by user code." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1074 +#: ../../library/xml.etree.elementtree.rst:1077 msgid "" "In general, user code should try not to depend on a specific ordering of " "attributes, given that the `XML Information Set `_ writer. Arguments are the " "same as for the :func:`canonicalize` function. This class does not build a " @@ -1332,11 +1334,11 @@ msgid "" "using the *write* function." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1353 +#: ../../library/xml.etree.elementtree.rst:1356 msgid "XMLParser Objects" msgstr "XMLParser 物件" -#: ../../library/xml.etree.elementtree.rst:1358 +#: ../../library/xml.etree.elementtree.rst:1361 msgid "" "This class is the low-level building block of the module. It uses :mod:`xml." "parsers.expat` for efficient, event-based parsing of XML. It can be fed XML " @@ -1347,24 +1349,24 @@ msgid "" "XML file." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1366 +#: ../../library/xml.etree.elementtree.rst:1369 msgid "" "Parameters are now :ref:`keyword-only `. The *html* " "argument no longer supported." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1373 +#: ../../library/xml.etree.elementtree.rst:1376 msgid "" "Finishes feeding data to the parser. Returns the result of calling the " "``close()`` method of the *target* passed during construction; by default, " "this is the toplevel document element." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1380 +#: ../../library/xml.etree.elementtree.rst:1383 msgid "Feeds data to the parser. *data* is encoded data." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1382 +#: ../../library/xml.etree.elementtree.rst:1385 msgid "" ":meth:`XMLParser.feed` calls *target*\\'s ``start(tag, attrs_dict)`` method " "for each opening tag, its ``end(tag)`` method for each closing tag, and data " @@ -1375,11 +1377,11 @@ msgid "" "of an XML file::" msgstr "" -#: ../../library/xml.etree.elementtree.rst:1426 +#: ../../library/xml.etree.elementtree.rst:1429 msgid "XMLPullParser Objects" msgstr "XMLPullParser 物件" -#: ../../library/xml.etree.elementtree.rst:1430 +#: ../../library/xml.etree.elementtree.rst:1433 msgid "" "A pull parser suitable for non-blocking applications. Its input-side API is " "similar to that of :class:`XMLParser`, but instead of pushing calls to a " @@ -1391,11 +1393,11 @@ msgid "" "If *events* is omitted, only ``\"end\"`` events are reported." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1441 +#: ../../library/xml.etree.elementtree.rst:1444 msgid "Feed the given bytes data to the parser." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1445 +#: ../../library/xml.etree.elementtree.rst:1448 msgid "" "Signal the parser that the data stream is terminated. Unlike :meth:" "`XMLParser.close`, this method always returns :const:`None`. Any events not " @@ -1403,7 +1405,7 @@ msgid "" "`read_events`." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1452 +#: ../../library/xml.etree.elementtree.rst:1455 msgid "" "Return an iterator over the events which have been encountered in the data " "fed to the parser. The iterator yields ``(event, elem)`` pairs, where " @@ -1412,25 +1414,25 @@ msgid "" "follows." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1458 +#: ../../library/xml.etree.elementtree.rst:1461 msgid "``start``, ``end``: the current Element." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1459 +#: ../../library/xml.etree.elementtree.rst:1462 msgid "``comment``, ``pi``: the current comment / processing instruction" msgstr "" -#: ../../library/xml.etree.elementtree.rst:1460 +#: ../../library/xml.etree.elementtree.rst:1463 msgid "" "``start-ns``: a tuple ``(prefix, uri)`` naming the declared namespace " "mapping." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1462 +#: ../../library/xml.etree.elementtree.rst:1465 msgid "``end-ns``: :const:`None` (this may change in a future version)" msgstr "" -#: ../../library/xml.etree.elementtree.rst:1464 +#: ../../library/xml.etree.elementtree.rst:1467 msgid "" "Events provided in a previous call to :meth:`read_events` will not be " "yielded again. Events are consumed from the internal queue only when they " @@ -1439,7 +1441,7 @@ msgid "" "results." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1472 +#: ../../library/xml.etree.elementtree.rst:1475 msgid "" ":class:`XMLPullParser` only guarantees that it has seen the \">\" character " "of a starting tag when it emits a \"start\" event, so the attributes are " @@ -1448,11 +1450,11 @@ msgid "" "be present." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1487 +#: ../../library/xml.etree.elementtree.rst:1490 msgid "Exceptions" msgstr "例外" -#: ../../library/xml.etree.elementtree.rst:1491 +#: ../../library/xml.etree.elementtree.rst:1494 msgid "" "XML parse error, raised by the various parsing methods in this module when " "parsing fails. The string representation of an instance of this exception " @@ -1460,22 +1462,22 @@ msgid "" "following attributes available:" msgstr "" -#: ../../library/xml.etree.elementtree.rst:1498 +#: ../../library/xml.etree.elementtree.rst:1501 msgid "" "A numeric error code from the expat parser. See the documentation of :mod:" "`xml.parsers.expat` for the list of error codes and their meanings." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1503 +#: ../../library/xml.etree.elementtree.rst:1506 msgid "" "A tuple of *line*, *column* numbers, specifying where the error occurred." msgstr "" -#: ../../library/xml.etree.elementtree.rst:1506 +#: ../../library/xml.etree.elementtree.rst:1509 msgid "Footnotes" msgstr "註解" -#: ../../library/xml.etree.elementtree.rst:1507 +#: ../../library/xml.etree.elementtree.rst:1510 msgid "" "The encoding string included in XML output should conform to the appropriate " "standards. For example, \"UTF-8\" is valid, but \"UTF8\" is not. See " diff --git a/reference/compound_stmts.po b/reference/compound_stmts.po index 2978dd7513..b235260ac4 100644 --- a/reference/compound_stmts.po +++ b/reference/compound_stmts.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-12 00:03+0000\n" +"POT-Creation-Date: 2023-10-20 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -395,30 +395,31 @@ msgid "" msgstr "" #: ../../reference/compound_stmts.rst:492 -msgid "The context manager's :meth:`__enter__` is loaded for later use." +msgid "" +"The context manager's :meth:`~object.__enter__` is loaded for later use." msgstr "" #: ../../reference/compound_stmts.rst:494 -msgid "The context manager's :meth:`__exit__` is loaded for later use." +msgid "The context manager's :meth:`~object.__exit__` is loaded for later use." msgstr "" #: ../../reference/compound_stmts.rst:496 -msgid "The context manager's :meth:`__enter__` method is invoked." +msgid "The context manager's :meth:`~object.__enter__` method is invoked." msgstr "" #: ../../reference/compound_stmts.rst:498 msgid "" "If a target was included in the :keyword:`with` statement, the return value " -"from :meth:`__enter__` is assigned to it." +"from :meth:`~object.__enter__` is assigned to it." msgstr "" #: ../../reference/compound_stmts.rst:503 msgid "" -"The :keyword:`with` statement guarantees that if the :meth:`__enter__` " -"method returns without an error, then :meth:`__exit__` will always be " -"called. Thus, if an error occurs during the assignment to the target list, " -"it will be treated the same as an error occurring within the suite would be. " -"See step 7 below." +"The :keyword:`with` statement guarantees that if the :meth:`~object." +"__enter__` method returns without an error, then :meth:`~object.__exit__` " +"will always be called. Thus, if an error occurs during the assignment to the " +"target list, it will be treated the same as an error occurring within the " +"suite would be. See step 7 below." msgstr "" #: ../../reference/compound_stmts.rst:509 @@ -427,25 +428,25 @@ msgstr "" #: ../../reference/compound_stmts.rst:511 msgid "" -"The context manager's :meth:`__exit__` method is invoked. If an exception " -"caused the suite to be exited, its type, value, and traceback are passed as " -"arguments to :meth:`__exit__`. Otherwise, three :const:`None` arguments are " -"supplied." +"The context manager's :meth:`~object.__exit__` method is invoked. If an " +"exception caused the suite to be exited, its type, value, and traceback are " +"passed as arguments to :meth:`~object.__exit__`. Otherwise, three :const:" +"`None` arguments are supplied." msgstr "" #: ../../reference/compound_stmts.rst:516 msgid "" "If the suite was exited due to an exception, and the return value from the :" -"meth:`__exit__` method was false, the exception is reraised. If the return " -"value was true, the exception is suppressed, and execution continues with " -"the statement following the :keyword:`with` statement." +"meth:`~object.__exit__` method was false, the exception is reraised. If the " +"return value was true, the exception is suppressed, and execution continues " +"with the statement following the :keyword:`with` statement." msgstr "" #: ../../reference/compound_stmts.rst:521 msgid "" "If the suite was exited for any reason other than an exception, the return " -"value from :meth:`__exit__` is ignored, and execution proceeds at the normal " -"location for the kind of exit that was taken." +"value from :meth:`~object.__exit__` is ignored, and execution proceeds at " +"the normal location for the kind of exit that was taken." msgstr "" #: ../../reference/compound_stmts.rst:525 @@ -1101,7 +1102,7 @@ msgid "" "Key-value pairs are matched using the two-argument form of the mapping " "subject's ``get()`` method. Matched key-value pairs must already be present " "in the mapping, and not created on-the-fly via :meth:`__missing__` or :meth:" -"`__getitem__`." +"`~object.__getitem__`." msgstr "" #: ../../reference/compound_stmts.rst:1063 diff --git a/reference/datamodel.po b/reference/datamodel.po index 984e121885..48ab47c007 100644 --- a/reference/datamodel.po +++ b/reference/datamodel.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-28 00:04+0000\n" +"POT-Creation-Date: 2023-10-20 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -3270,7 +3270,7 @@ msgstr "" #: ../../reference/datamodel.rst:2942 msgid "" -"Note that :meth:`__exit__` methods should not reraise the passed-in " +"Note that :meth:`~object.__exit__` methods should not reraise the passed-in " "exception; this is the caller's responsibility." msgstr "" @@ -3593,14 +3593,14 @@ msgstr "" #: ../../reference/datamodel.rst:3260 msgid "" -"Semantically similar to :meth:`__enter__`, the only difference being that it " -"must return an *awaitable*." +"Semantically similar to :meth:`~object.__enter__`, the only difference being " +"that it must return an *awaitable*." msgstr "" #: ../../reference/datamodel.rst:3265 msgid "" -"Semantically similar to :meth:`__exit__`, the only difference being that it " -"must return an *awaitable*." +"Semantically similar to :meth:`~object.__exit__`, the only difference being " +"that it must return an *awaitable*." msgstr "" #: ../../reference/datamodel.rst:3268 diff --git a/reference/expressions.po b/reference/expressions.po index 287b606b1e..a75824076f 100644 --- a/reference/expressions.po +++ b/reference/expressions.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 10:36+0000\n" +"POT-Creation-Date: 2023-10-20 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -931,9 +931,9 @@ msgid "" "the last item of ``x``. The resulting value must be a nonnegative integer " "less than the number of items in the sequence, and the subscription selects " "the item whose index is that value (counting from zero). Since the support " -"for negative indices and slicing occurs in the object's :meth:`__getitem__` " -"method, subclasses overriding this method will need to explicitly add that " -"support." +"for negative indices and slicing occurs in the object's :meth:`~object." +"__getitem__` method, subclasses overriding this method will need to " +"explicitly add that support." msgstr "" #: ../../reference/expressions.rst:892 @@ -967,16 +967,16 @@ msgstr "" #: ../../reference/expressions.rst:939 msgid "" "The semantics for a slicing are as follows. The primary is indexed (using " -"the same :meth:`__getitem__` method as normal subscription) with a key that " -"is constructed from the slice list, as follows. If the slice list contains " -"at least one comma, the key is a tuple containing the conversion of the " -"slice items; otherwise, the conversion of the lone slice item is the key. " -"The conversion of a slice item that is an expression is that expression. " -"The conversion of a proper slice is a slice object (see section :ref:" -"`types`) whose :attr:`~slice.start`, :attr:`~slice.stop` and :attr:`~slice." -"step` attributes are the values of the expressions given as lower bound, " -"upper bound and stride, respectively, substituting ``None`` for missing " -"expressions." +"the same :meth:`~object.__getitem__` method as normal subscription) with a " +"key that is constructed from the slice list, as follows. If the slice list " +"contains at least one comma, the key is a tuple containing the conversion of " +"the slice items; otherwise, the conversion of the lone slice item is the " +"key. The conversion of a slice item that is an expression is that " +"expression. The conversion of a proper slice is a slice object (see " +"section :ref:`types`) whose :attr:`~slice.start`, :attr:`~slice.stop` and :" +"attr:`~slice.step` attributes are the values of the expressions given as " +"lower bound, upper bound and stride, respectively, substituting ``None`` for " +"missing expressions." msgstr "" #: ../../reference/expressions.rst:963 @@ -1794,10 +1794,10 @@ msgstr "" #: ../../reference/expressions.rst:1665 msgid "" "Lastly, the old-style iteration protocol is tried: if a class defines :meth:" -"`__getitem__`, ``x in y`` is ``True`` if and only if there is a non-negative " -"integer index *i* such that ``x is y[i] or x == y[i]``, and no lower integer " -"index raises the :exc:`IndexError` exception. (If any other exception is " -"raised, it is as if :keyword:`in` raised that exception)." +"`~object.__getitem__`, ``x in y`` is ``True`` if and only if there is a non-" +"negative integer index *i* such that ``x is y[i] or x == y[i]``, and no " +"lower integer index raises the :exc:`IndexError` exception. (If any other " +"exception is raised, it is as if :keyword:`in` raised that exception)." msgstr "" #: ../../reference/expressions.rst:1677 diff --git a/reference/import.po b/reference/import.po index 20cc4973c8..d214c99770 100644 --- a/reference/import.po +++ b/reference/import.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-10-28 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -703,8 +703,8 @@ msgstr "" #: ../../reference/import.rst:561 ../../reference/import.rst:582 msgid "" -"It is **strongly** recommended that you rely on :attr:`__spec__` instead " -"instead of this attribute." +"It is **strongly** recommended that you rely on :attr:`__spec__` instead of " +"this attribute." msgstr "" #: ../../reference/import.rst:564 @@ -813,8 +813,8 @@ msgstr "" #: ../../reference/import.rst:652 msgid "" -"It is **strongly** recommended that you rely on :attr:`__spec__` instead " -"instead of ``__cached__``." +"It is **strongly** recommended that you rely on :attr:`__spec__` instead of " +"``__cached__``." msgstr "" #: ../../reference/import.rst:658 diff --git a/reference/introduction.po b/reference/introduction.po index 332705e041..d453a71ed1 100644 --- a/reference/introduction.po +++ b/reference/introduction.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-09 00:15+0000\n" +"POT-Creation-Date: 2023-10-16 00:03+0000\n" "PO-Revision-Date: 2017-09-22 18:27+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -156,11 +156,12 @@ msgstr "" #: ../../reference/introduction.rst:93 msgid "" -"The descriptions of lexical analysis and syntax use a modified BNF grammar " -"notation. This uses the following style of definition:" +"The descriptions of lexical analysis and syntax use a modified `Backus–Naur " +"form (BNF) `_ " +"grammar notation. This uses the following style of definition:" msgstr "" -#: ../../reference/introduction.rst:100 +#: ../../reference/introduction.rst:101 msgid "" "The first line says that a ``name`` is an ``lc_letter`` followed by a " "sequence of zero or more ``lc_letter``\\ s and underscores. An " @@ -169,7 +170,7 @@ msgid "" "and grammar rules in this document.)" msgstr "" -#: ../../reference/introduction.rst:105 +#: ../../reference/introduction.rst:106 msgid "" "Each rule begins with a name (which is the name defined by the rule) and ``::" "=``. A vertical bar (``|``) is used to separate alternatives; it is the " @@ -184,7 +185,7 @@ msgid "" "line after the first beginning with a vertical bar." msgstr "" -#: ../../reference/introduction.rst:119 +#: ../../reference/introduction.rst:120 msgid "" "In lexical definitions (as the example above), two more conventions are " "used: Two literal characters separated by three dots mean a choice of any " @@ -194,7 +195,7 @@ msgid "" "'control character' if needed." msgstr "" -#: ../../reference/introduction.rst:126 +#: ../../reference/introduction.rst:127 msgid "" "Even though the notation used is almost the same, there is a big difference " "between the meaning of lexical and syntactic definitions: a lexical " @@ -221,10 +222,10 @@ msgstr "syntax(語法)" msgid "notation" msgstr "notation(標記法)" -#: ../../reference/introduction.rst:117 +#: ../../reference/introduction.rst:118 msgid "lexical definitions" msgstr "lexical definitions(詞法定義)" -#: ../../reference/introduction.rst:117 +#: ../../reference/introduction.rst:118 msgid "ASCII" msgstr "ASCII" diff --git a/tutorial/introduction.po b/tutorial/introduction.po index 9979da11cf..75ee915511 100644 --- a/tutorial/introduction.po +++ b/tutorial/introduction.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-11 17:13+0000\n" +"POT-Creation-Date: 2023-10-22 12:58+0000\n" "PO-Revision-Date: 2022-10-16 03:20+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -549,10 +549,10 @@ msgstr "" #: ../../tutorial/introduction.rst:430 msgid "" -"You can also add new items at the end of the list, by using the :meth:`~list." +"You can also add new items at the end of the list, by using the :meth:`!list." "append` *method* (we will see more about methods later)::" msgstr "" -"你也可以在 list 的最後加入新元素,透過使用 :meth:`~list.append` *方法* " +"你也可以在 list 的最後加入新元素,透過使用 :meth:`!list.append` *方法* " "(method)(我們稍後會看到更多方法的說明):\n" "\n" "::" diff --git a/whatsnew/2.0.po b/whatsnew/2.0.po index b0fba98274..a3709bd620 100644 --- a/whatsnew/2.0.po +++ b/whatsnew/2.0.po @@ -1082,7 +1082,7 @@ msgstr "" #: ../../whatsnew/2.0.rst:880 msgid "XML Modules" -msgstr "" +msgstr "XML 模組" #: ../../whatsnew/2.0.rst:882 msgid "" @@ -1101,7 +1101,7 @@ msgstr "" #: ../../whatsnew/2.0.rst:896 msgid "SAX2 Support" -msgstr "" +msgstr "SAX2 支援" #: ../../whatsnew/2.0.rst:898 msgid "" @@ -1138,7 +1138,7 @@ msgstr "" #: ../../whatsnew/2.0.rst:940 msgid "DOM Support" -msgstr "" +msgstr "DOM 支援" #: ../../whatsnew/2.0.rst:942 msgid "" @@ -1301,7 +1301,7 @@ msgstr "" #: ../../whatsnew/2.0.rst:1074 msgid "New modules" -msgstr "" +msgstr "新增模組" #: ../../whatsnew/2.0.rst:1076 msgid "" diff --git a/whatsnew/2.2.po b/whatsnew/2.2.po index 2108feb605..2875c7f1d3 100644 --- a/whatsnew/2.2.po +++ b/whatsnew/2.2.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-23 00:03+0000\n" +"POT-Creation-Date: 2023-10-20 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:19+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -505,31 +505,33 @@ msgstr "" #: ../../whatsnew/2.2.rst:426 msgid "" "In Python versions up to 2.1, the usual way to make ``for item in obj`` work " -"is to define a :meth:`__getitem__` method that looks something like this::" +"is to define a :meth:`~object.__getitem__` method that looks something like " +"this::" msgstr "" #: ../../whatsnew/2.2.rst:432 msgid "" -":meth:`__getitem__` is more properly used to define an indexing operation on " -"an object so that you can write ``obj[5]`` to retrieve the sixth element. " -"It's a bit misleading when you're using this only to support :keyword:`for` " -"loops. Consider some file-like object that wants to be looped over; the " -"*index* parameter is essentially meaningless, as the class probably assumes " -"that a series of :meth:`__getitem__` calls will be made with *index* " -"incrementing by one each time. In other words, the presence of the :meth:" -"`__getitem__` method doesn't mean that using ``file[5]`` to randomly access " -"the sixth element will work, though it really should." +":meth:`~object.__getitem__` is more properly used to define an indexing " +"operation on an object so that you can write ``obj[5]`` to retrieve the " +"sixth element. It's a bit misleading when you're using this only to " +"support :keyword:`for` loops. Consider some file-like object that wants to " +"be looped over; the *index* parameter is essentially meaningless, as the " +"class probably assumes that a series of :meth:`~object.__getitem__` calls " +"will be made with *index* incrementing by one each time. In other words, " +"the presence of the :meth:`~object.__getitem__` method doesn't mean that " +"using ``file[5]`` to randomly access the sixth element will work, though it " +"really should." msgstr "" #: ../../whatsnew/2.2.rst:442 msgid "" -"In Python 2.2, iteration can be implemented separately, and :meth:" -"`__getitem__` methods can be limited to classes that really do support " -"random access. The basic idea of iterators is simple. A new built-in " -"function, ``iter(obj)`` or ``iter(C, sentinel)``, is used to get an " -"iterator. ``iter(obj)`` returns an iterator for the object *obj*, while " -"``iter(C, sentinel)`` returns an iterator that will invoke the callable " -"object *C* until it returns *sentinel* to signal that the iterator is done." +"In Python 2.2, iteration can be implemented separately, and :meth:`~object." +"__getitem__` methods can be limited to classes that really do support random " +"access. The basic idea of iterators is simple. A new built-in function, " +"``iter(obj)`` or ``iter(C, sentinel)``, is used to get an iterator. " +"``iter(obj)`` returns an iterator for the object *obj*, while ``iter(C, " +"sentinel)`` returns an iterator that will invoke the callable object *C* " +"until it returns *sentinel* to signal that the iterator is done." msgstr "" #: ../../whatsnew/2.2.rst:450 diff --git a/whatsnew/2.3.po b/whatsnew/2.3.po index f542f4b572..e2738a5e26 100644 --- a/whatsnew/2.3.po +++ b/whatsnew/2.3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-11 17:13+0000\n" +"POT-Creation-Date: 2023-10-20 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:19+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -958,8 +958,8 @@ msgstr "" #: ../../whatsnew/2.3.rst:928 msgid "" -"One can also now pass slice objects to the :meth:`__getitem__` methods of " -"the built-in sequences::" +"One can also now pass slice objects to the :meth:`~object.__getitem__` " +"methods of the built-in sequences::" msgstr "" #: ../../whatsnew/2.3.rst:934 @@ -1770,8 +1770,8 @@ msgstr "" #: ../../whatsnew/2.3.rst:1598 msgid "" "Adding the mix-in as a superclass provides the full dictionary interface " -"whenever the class defines :meth:`__getitem__`, :meth:`__setitem__`, :meth:" -"`__delitem__`, and :meth:`keys`. For example::" +"whenever the class defines :meth:`~object.__getitem__`, :meth:" +"`__setitem__`, :meth:`__delitem__`, and :meth:`keys`. For example::" msgstr "" #: ../../whatsnew/2.3.rst:1639 diff --git a/whatsnew/2.5.po b/whatsnew/2.5.po index f20f05f3ff..94418ebc94 100644 --- a/whatsnew/2.5.po +++ b/whatsnew/2.5.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-23 00:03+0000\n" +"POT-Creation-Date: 2023-10-24 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -689,22 +689,22 @@ msgstr "" #: ../../whatsnew/2.5.rst:577 msgid "" "The expression is evaluated, and it should result in an object that supports " -"the context management protocol (that is, has :meth:`__enter__` and :meth:" -"`__exit__` methods." +"the context management protocol (that is, has :meth:`~object.__enter__` and :" +"meth:`~object.__exit__` methods." msgstr "" #: ../../whatsnew/2.5.rst:581 msgid "" -"The object's :meth:`__enter__` is called before *with-block* is executed and " -"therefore can run set-up code. It also may return a value that is bound to " -"the name *variable*, if given. (Note carefully that *variable* is *not* " -"assigned the result of *expression*.)" +"The object's :meth:`~object.__enter__` is called before *with-block* is " +"executed and therefore can run set-up code. It also may return a value that " +"is bound to the name *variable*, if given. (Note carefully that *variable* " +"is *not* assigned the result of *expression*.)" msgstr "" #: ../../whatsnew/2.5.rst:586 msgid "" -"After execution of the *with-block* is finished, the object's :meth:" -"`__exit__` method is called, even if the block raised an exception, and can " +"After execution of the *with-block* is finished, the object's :meth:`~object." +"__exit__` method is called, even if the block raised an exception, and can " "therefore run clean-up code." msgstr "" @@ -735,7 +735,7 @@ msgstr "" #: ../../whatsnew/2.5.rst:611 msgid "" "In this case, *f* is the same object created by :func:`open`, because :meth:" -"`file.__enter__` returns *self*." +"`~object.__enter__` returns *self*." msgstr "" #: ../../whatsnew/2.5.rst:614 @@ -777,13 +777,13 @@ msgstr "" #: ../../whatsnew/2.5.rst:654 msgid "" "The expression is evaluated and should result in an object called a " -"\"context manager\". The context manager must have :meth:`__enter__` and :" -"meth:`__exit__` methods." +"\"context manager\". The context manager must have :meth:`~object." +"__enter__` and :meth:`~object.__exit__` methods." msgstr "" #: ../../whatsnew/2.5.rst:658 msgid "" -"The context manager's :meth:`__enter__` method is called. The value " +"The context manager's :meth:`~object.__enter__` method is called. The value " "returned is assigned to *VAR*. If no ``'as VAR'`` clause is present, the " "value is simply discarded." msgstr "" @@ -805,8 +805,8 @@ msgstr "" #: ../../whatsnew/2.5.rst:672 msgid "" -"If *BLOCK* didn't raise an exception, the :meth:`__exit__` method is still " -"called, but *type*, *value*, and *traceback* are all ``None``." +"If *BLOCK* didn't raise an exception, the :meth:`~object.__exit__` method " +"is still called, but *type*, *value*, and *traceback* are all ``None``." msgstr "" #: ../../whatsnew/2.5.rst:675 @@ -839,19 +839,19 @@ msgstr "" #: ../../whatsnew/2.5.rst:706 msgid "" -"The :meth:`__enter__` method is pretty easy, having only to start a new " -"transaction. For this application the resulting cursor object would be a " -"useful result, so the method will return it. The user can then add ``as " +"The :meth:`~object.__enter__` method is pretty easy, having only to start a " +"new transaction. For this application the resulting cursor object would be " +"a useful result, so the method will return it. The user can then add ``as " "cursor`` to their ':keyword:`with`' statement to bind the cursor to a " "variable name. ::" msgstr "" #: ../../whatsnew/2.5.rst:718 msgid "" -"The :meth:`__exit__` method is the most complicated because it's where most " -"of the work has to be done. The method has to check if an exception " -"occurred. If there was no exception, the transaction is committed. The " -"transaction is rolled back if there was an exception." +"The :meth:`~object.__exit__` method is the most complicated because it's " +"where most of the work has to be done. The method has to check if an " +"exception occurred. If there was no exception, the transaction is " +"committed. The transaction is rolled back if there was an exception." msgstr "" #: ../../whatsnew/2.5.rst:723 @@ -878,12 +878,12 @@ msgid "" "The decorator is called :func:`contextmanager`, and lets you write a single " "generator function instead of defining a new class. The generator should " "yield exactly one value. The code up to the :keyword:`yield` will be " -"executed as the :meth:`__enter__` method, and the value yielded will be the " -"method's return value that will get bound to the variable in the ':keyword:" -"`with`' statement's :keyword:`!as` clause, if any. The code after the :" -"keyword:`yield` will be executed in the :meth:`__exit__` method. Any " -"exception raised in the block will be raised by the :keyword:`!yield` " -"statement." +"executed as the :meth:`~object.__enter__` method, and the value yielded will " +"be the method's return value that will get bound to the variable in the ':" +"keyword:`with`' statement's :keyword:`!as` clause, if any. The code after " +"the :keyword:`yield` will be executed in the :meth:`~object.__exit__` " +"method. Any exception raised in the block will be raised by the :keyword:`!" +"yield` statement." msgstr "" #: ../../whatsnew/2.5.rst:757 @@ -1564,8 +1564,8 @@ msgid "" "`universal newlines` mode. Another new parameter, *openhook*, lets you use " "a function other than :func:`open` to open the input files. Once you're " "iterating over the set of files, the :class:`FileInput` object's new :meth:" -"`fileno` returns the file descriptor for the currently opened file. " -"(Contributed by Georg Brandl.)" +"`~fileinput.fileno` returns the file descriptor for the currently opened " +"file. (Contributed by Georg Brandl.)" msgstr "" #: ../../whatsnew/2.5.rst:1354 diff --git a/whatsnew/2.6.po b/whatsnew/2.6.po index ac6200eaa8..3343bbc83f 100644 --- a/whatsnew/2.6.po +++ b/whatsnew/2.6.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-11 17:13+0000\n" +"POT-Creation-Date: 2023-10-20 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -332,22 +332,22 @@ msgstr "" #: ../../whatsnew/2.6.rst:271 msgid "" "The expression is evaluated, and it should result in an object that supports " -"the context management protocol (that is, has :meth:`__enter__` and :meth:" -"`__exit__` methods)." +"the context management protocol (that is, has :meth:`~object.__enter__` and :" +"meth:`~object.__exit__` methods)." msgstr "" #: ../../whatsnew/2.6.rst:275 msgid "" -"The object's :meth:`__enter__` is called before *with-block* is executed and " -"therefore can run set-up code. It also may return a value that is bound to " -"the name *variable*, if given. (Note carefully that *variable* is *not* " -"assigned the result of *expression*.)" +"The object's :meth:`~object.__enter__` is called before *with-block* is " +"executed and therefore can run set-up code. It also may return a value that " +"is bound to the name *variable*, if given. (Note carefully that *variable* " +"is *not* assigned the result of *expression*.)" msgstr "" #: ../../whatsnew/2.6.rst:280 msgid "" -"After execution of the *with-block* is finished, the object's :meth:" -"`__exit__` method is called, even if the block raised an exception, and can " +"After execution of the *with-block* is finished, the object's :meth:`~object." +"__exit__` method is called, even if the block raised an exception, and can " "therefore run clean-up code." msgstr "" @@ -368,7 +368,7 @@ msgstr "" #: ../../whatsnew/2.6.rst:298 msgid "" "In this case, *f* is the same object created by :func:`open`, because :meth:" -"`file.__enter__` returns *self*." +"`~object.__enter__` returns *self*." msgstr "" #: ../../whatsnew/2.6.rst:301 @@ -410,13 +410,13 @@ msgstr "" #: ../../whatsnew/2.6.rst:341 msgid "" "The expression is evaluated and should result in an object called a " -"\"context manager\". The context manager must have :meth:`__enter__` and :" -"meth:`__exit__` methods." +"\"context manager\". The context manager must have :meth:`~object." +"__enter__` and :meth:`~object.__exit__` methods." msgstr "" #: ../../whatsnew/2.6.rst:345 msgid "" -"The context manager's :meth:`__enter__` method is called. The value " +"The context manager's :meth:`~object.__enter__` method is called. The value " "returned is assigned to *VAR*. If no ``as VAR`` clause is present, the " "value is simply discarded." msgstr "" @@ -427,21 +427,21 @@ msgstr "" #: ../../whatsnew/2.6.rst:351 msgid "" -"If *BLOCK* raises an exception, the context manager's :meth:`__exit__` " -"method is called with three arguments, the exception details (``type, value, " -"traceback``, the same values returned by :func:`sys.exc_info`, which can " -"also be ``None`` if no exception occurred). The method's return value " -"controls whether an exception is re-raised: any false value re-raises the " -"exception, and ``True`` will result in suppressing it. You'll only rarely " -"want to suppress the exception, because if you do the author of the code " -"containing the ':keyword:`with`' statement will never realize anything went " -"wrong." +"If *BLOCK* raises an exception, the context manager's :meth:`~object." +"__exit__` method is called with three arguments, the exception details " +"(``type, value, traceback``, the same values returned by :func:`sys." +"exc_info`, which can also be ``None`` if no exception occurred). The " +"method's return value controls whether an exception is re-raised: any false " +"value re-raises the exception, and ``True`` will result in suppressing it. " +"You'll only rarely want to suppress the exception, because if you do the " +"author of the code containing the ':keyword:`with`' statement will never " +"realize anything went wrong." msgstr "" #: ../../whatsnew/2.6.rst:360 msgid "" -"If *BLOCK* didn't raise an exception, the :meth:`__exit__` method is still " -"called, but *type*, *value*, and *traceback* are all ``None``." +"If *BLOCK* didn't raise an exception, the :meth:`~object.__exit__` method " +"is still called, but *type*, *value*, and *traceback* are all ``None``." msgstr "" #: ../../whatsnew/2.6.rst:363 @@ -474,19 +474,19 @@ msgstr "" #: ../../whatsnew/2.6.rst:394 msgid "" -"The :meth:`__enter__` method is pretty easy, having only to start a new " -"transaction. For this application the resulting cursor object would be a " -"useful result, so the method will return it. The user can then add ``as " +"The :meth:`~object.__enter__` method is pretty easy, having only to start a " +"new transaction. For this application the resulting cursor object would be " +"a useful result, so the method will return it. The user can then add ``as " "cursor`` to their ':keyword:`with`' statement to bind the cursor to a " "variable name. ::" msgstr "" #: ../../whatsnew/2.6.rst:406 msgid "" -"The :meth:`__exit__` method is the most complicated because it's where most " -"of the work has to be done. The method has to check if an exception " -"occurred. If there was no exception, the transaction is committed. The " -"transaction is rolled back if there was an exception." +"The :meth:`~object.__exit__` method is the most complicated because it's " +"where most of the work has to be done. The method has to check if an " +"exception occurred. If there was no exception, the transaction is " +"committed. The transaction is rolled back if there was an exception." msgstr "" #: ../../whatsnew/2.6.rst:411 @@ -512,12 +512,12 @@ msgid "" "The decorator is called :func:`contextmanager`, and lets you write a single " "generator function instead of defining a new class. The generator should " "yield exactly one value. The code up to the :keyword:`yield` will be " -"executed as the :meth:`__enter__` method, and the value yielded will be the " -"method's return value that will get bound to the variable in the ':keyword:" -"`with`' statement's :keyword:`!as` clause, if any. The code after the :" -"keyword:`!yield` will be executed in the :meth:`__exit__` method. Any " -"exception raised in the block will be raised by the :keyword:`!yield` " -"statement." +"executed as the :meth:`~object.__enter__` method, and the value yielded will " +"be the method's return value that will get bound to the variable in the ':" +"keyword:`with`' statement's :keyword:`!as` clause, if any. The code after " +"the :keyword:`!yield` will be executed in the :meth:`~object.__exit__` " +"method. Any exception raised in the block will be raised by the :keyword:`!" +"yield` statement." msgstr "" #: ../../whatsnew/2.6.rst:445 @@ -1892,8 +1892,8 @@ msgstr "" #: ../../whatsnew/2.6.rst:1740 msgid "" -"The ``with`` statement now stores the :meth:`__exit__` method on the stack, " -"producing a small speedup. (Implemented by Jeffrey Yasskin.)" +"The ``with`` statement now stores the :meth:`~object.__exit__` method on the " +"stack, producing a small speedup. (Implemented by Jeffrey Yasskin.)" msgstr "" #: ../../whatsnew/2.6.rst:1743 diff --git a/whatsnew/2.7.po b/whatsnew/2.7.po index 2b70b2c4ce..779dd14c01 100644 --- a/whatsnew/2.7.po +++ b/whatsnew/2.7.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-23 00:03+0000\n" +"POT-Creation-Date: 2023-10-20 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -966,8 +966,8 @@ msgstr "" #: ../../whatsnew/2.7.rst:932 msgid "" "A new opcode was added to perform the initial setup for :keyword:`with` " -"statements, looking up the :meth:`__enter__` and :meth:`__exit__` methods. " -"(Contributed by Benjamin Peterson.)" +"statements, looking up the :meth:`~object.__enter__` and :meth:`~object." +"__exit__` methods. (Contributed by Benjamin Peterson.)" msgstr "" #: ../../whatsnew/2.7.rst:936 @@ -2895,17 +2895,17 @@ msgstr "" #: ../../whatsnew/2.7.rst:2451 msgid "" "Because of an optimization for the :keyword:`with` statement, the special " -"methods :meth:`__enter__` and :meth:`__exit__` must belong to the object's " -"type, and cannot be directly attached to the object's instance. This " -"affects new-style classes (derived from :class:`object`) and C extension " -"types. (:issue:`6101`.)" +"methods :meth:`~object.__enter__` and :meth:`~object.__exit__` must belong " +"to the object's type, and cannot be directly attached to the object's " +"instance. This affects new-style classes (derived from :class:`object`) and " +"C extension types. (:issue:`6101`.)" msgstr "" #: ../../whatsnew/2.7.rst:2457 msgid "" -"Due to a bug in Python 2.6, the *exc_value* parameter to :meth:`__exit__` " -"methods was often the string representation of the exception, not an " -"instance. This was fixed in 2.7, so *exc_value* will be an instance as " +"Due to a bug in Python 2.6, the *exc_value* parameter to :meth:`~object." +"__exit__` methods was often the string representation of the exception, not " +"an instance. This was fixed in 2.7, so *exc_value* will be an instance as " "expected. (Fixed by Florent Xicluna; :issue:`7853`.)" msgstr "" diff --git a/whatsnew/3.11.po b/whatsnew/3.11.po index 32a6ae6486..78decf315a 100644 --- a/whatsnew/3.11.po +++ b/whatsnew/3.11.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-11 17:13+0000\n" +"POT-Creation-Date: 2023-10-28 00:03+0000\n" "PO-Revision-Date: 2023-05-28 18:21+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -796,7 +796,7 @@ msgstr "" #: ../../whatsnew/3.11.rst:572 msgid "Improved Modules" -msgstr "模組改進" +msgstr "改進的模組" #: ../../whatsnew/3.11.rst:577 msgid "asyncio" @@ -3202,11 +3202,11 @@ msgstr ":func:`importlib.resources.path`" #: ../../whatsnew/3.11.rst:1800 msgid "" "The :func:`locale.getdefaultlocale` function is deprecated and will be " -"removed in Python 3.13. Use :func:`locale.setlocale`, :func:`locale." +"removed in Python 3.15. Use :func:`locale.setlocale`, :func:`locale." "getpreferredencoding(False) ` and :func:`locale." "getlocale` functions instead. (Contributed by Victor Stinner in :gh:`90817`.)" msgstr "" -":func:`locale.getdefaultlocale` 函式已被棄用且將於 Python 3.13 中移除。請改" +":func:`locale.getdefaultlocale` 函式已被棄用且將於 Python 3.15 中移除。請改" "用 :func:`locale.setlocale`、:func:`locale.getpreferredencoding(False) " "` 和 :func:`locale.getlocale`。(Victor Stinner " "於 :gh:`90817` 中所貢獻。)" diff --git a/whatsnew/3.12.po b/whatsnew/3.12.po index caf6dee4a5..1da29c8b92 100644 --- a/whatsnew/3.12.po +++ b/whatsnew/3.12.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-11 17:13+0000\n" +"POT-Creation-Date: 2023-11-01 00:03+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -76,7 +76,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:90 msgid "New syntax features:" -msgstr "" +msgstr "新增語法特性:" #: ../../whatsnew/3.12.rst:92 msgid "" @@ -96,7 +96,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:98 msgid "Interpreter improvements:" -msgstr "" +msgstr "直譯器改進:" #: ../../whatsnew/3.12.rst:100 msgid "" @@ -130,7 +130,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:113 msgid "The :class:`pathlib.Path` class now supports subclassing" -msgstr "" +msgstr ":class:`pathlib.Path` 類別現在支援子類別化" #: ../../whatsnew/3.12.rst:114 msgid "The :mod:`os` module received several improvements for Windows support" @@ -168,7 +168,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:126 msgid "Security improvements:" -msgstr "" +msgstr "安全性改進:" #: ../../whatsnew/3.12.rst:128 msgid "" @@ -180,7 +180,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:134 msgid "C API improvements:" -msgstr "" +msgstr "C API 改進:" #: ../../whatsnew/3.12.rst:136 msgid ":ref:`PEP 697 `, unstable C API tier" @@ -215,10 +215,12 @@ msgid "" ":ref:`PEP 692 `, using :class:`~typing.TypedDict` to " "annotate :term:`**kwargs `" msgstr "" +":ref:`PEP 692 `、使用 :class:`~typing.TypedDict` 來標註 :" +"term:`**kwargs `" #: ../../whatsnew/3.12.rst:149 msgid ":ref:`PEP 698 `, :func:`typing.override` decorator" -msgstr "" +msgstr ":ref:`PEP 698 `、:func:`typing.override` 裝飾器" #: ../../whatsnew/3.12.rst:151 msgid "Important deprecations, removals or restrictions:" @@ -255,7 +257,7 @@ msgid "" "`_." msgstr "" -#: ../../whatsnew/3.12.rst:176 ../../whatsnew/3.12.rst:1917 +#: ../../whatsnew/3.12.rst:176 ../../whatsnew/3.12.rst:1931 msgid "New Features" msgstr "新增特性" @@ -457,7 +459,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:377 msgid "(Contributed by Mark Shannon in :gh:`103082`.)" -msgstr "" +msgstr "(由 Mark Shannon 於 :gh:`103082` 中貢獻。)" #: ../../whatsnew/3.12.rst:382 msgid "PEP 688: Making the buffer protocol accessible in Python" @@ -529,7 +531,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:423 msgid "(Contributed by Carl Meyer and Vladimir Matveev in :pep:`709`.)" -msgstr "" +msgstr "(由 Carl Meyer 和 Vladimir Matveev 於 :pep:`709` 中貢獻。)" #: ../../whatsnew/3.12.rst:426 msgid "Improved Error Messages" @@ -595,7 +597,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:503 msgid "See :pep:`692` for more details." -msgstr "" +msgstr "詳情請見 :pep:`692`。" #: ../../whatsnew/3.12.rst:505 msgid "(Contributed by Franek Magiera in :gh:`103629`.)" @@ -616,11 +618,11 @@ msgstr "" #: ../../whatsnew/3.12.rst:518 msgid "Example::" -msgstr "" +msgstr "範例: ::" #: ../../whatsnew/3.12.rst:536 msgid "See :pep:`698` for more details." -msgstr "" +msgstr "詳情請見 :pep:`698`。" #: ../../whatsnew/3.12.rst:538 msgid "(Contributed by Steven Troxler in :gh:`101561`.)" @@ -753,7 +755,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:626 msgid "New Modules" -msgstr "" +msgstr "新增模組" #: ../../whatsnew/3.12.rst:628 msgid "None." @@ -761,7 +763,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:632 msgid "Improved Modules" -msgstr "" +msgstr "改進的模組" #: ../../whatsnew/3.12.rst:635 msgid "array" @@ -886,7 +888,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:714 msgid "importlib.resources" -msgstr "" +msgstr "importlib.resources" #: ../../whatsnew/3.12.rst:716 msgid "" @@ -894,25 +896,31 @@ msgid "" "(Contributed by Jason R. Coombs in :gh:`97930`.)" msgstr "" -#: ../../whatsnew/3.12.rst:720 +#: ../../whatsnew/3.12.rst:719 +msgid "" +"Rename first parameter of :func:`importlib.resources.files` to *anchor*. " +"(Contributed by Jason R. Coombs in :gh:`100598`.)" +msgstr "" + +#: ../../whatsnew/3.12.rst:723 msgid "inspect" msgstr "inspect" -#: ../../whatsnew/3.12.rst:722 +#: ../../whatsnew/3.12.rst:725 msgid "" "Add :func:`inspect.markcoroutinefunction` to mark sync functions that return " "a :term:`coroutine` for use with :func:`inspect.iscoroutinefunction`. " "(Contributed Carlton Gibson in :gh:`99247`.)" msgstr "" -#: ../../whatsnew/3.12.rst:726 +#: ../../whatsnew/3.12.rst:729 msgid "" "Add :func:`inspect.getasyncgenstate` and :func:`inspect.getasyncgenlocals` " "for determining the current state of asynchronous generators. (Contributed " "by Thomas Krennwallner in :gh:`79940`.)" msgstr "" -#: ../../whatsnew/3.12.rst:730 +#: ../../whatsnew/3.12.rst:733 msgid "" "The performance of :func:`inspect.getattr_static` has been considerably " "improved. Most calls to the function should be at least 2x faster than they " @@ -920,60 +928,62 @@ msgid "" "Waygood in :gh:`103193`.)" msgstr "" -#: ../../whatsnew/3.12.rst:736 +#: ../../whatsnew/3.12.rst:739 msgid "itertools" msgstr "itertools" -#: ../../whatsnew/3.12.rst:738 +#: ../../whatsnew/3.12.rst:741 msgid "" "Add :class:`itertools.batched()` for collecting into even-sized tuples where " "the last batch may be shorter than the rest. (Contributed by Raymond " "Hettinger in :gh:`98363`.)" msgstr "" -#: ../../whatsnew/3.12.rst:743 +#: ../../whatsnew/3.12.rst:746 msgid "math" msgstr "math" -#: ../../whatsnew/3.12.rst:745 +#: ../../whatsnew/3.12.rst:748 msgid "" "Add :func:`math.sumprod` for computing a sum of products. (Contributed by " "Raymond Hettinger in :gh:`100485`.)" msgstr "" +"新增 :func:`math.sumprod` 以計算乘積總和。(由 Raymond Hettinger 於 :gh:" +"`100485` 中貢獻。)" -#: ../../whatsnew/3.12.rst:748 +#: ../../whatsnew/3.12.rst:751 msgid "" "Extend :func:`math.nextafter` to include a *steps* argument for moving up or " "down multiple steps at a time. (By Matthias Goergens, Mark Dickinson, and " "Raymond Hettinger in :gh:`94906`.)" msgstr "" -#: ../../whatsnew/3.12.rst:753 +#: ../../whatsnew/3.12.rst:756 msgid "os" msgstr "os" -#: ../../whatsnew/3.12.rst:755 +#: ../../whatsnew/3.12.rst:758 msgid "" "Add :const:`os.PIDFD_NONBLOCK` to open a file descriptor for a process with :" "func:`os.pidfd_open` in non-blocking mode. (Contributed by Kumar Aditya in :" "gh:`93312`.)" msgstr "" -#: ../../whatsnew/3.12.rst:759 +#: ../../whatsnew/3.12.rst:762 msgid "" ":class:`os.DirEntry` now includes an :meth:`os.DirEntry.is_junction` method " "to check if the entry is a junction. (Contributed by Charles Machalow in :gh:" "`99547`.)" msgstr "" -#: ../../whatsnew/3.12.rst:763 +#: ../../whatsnew/3.12.rst:766 msgid "" "Add :func:`os.listdrives`, :func:`os.listvolumes` and :func:`os.listmounts` " "functions on Windows for enumerating drives, volumes and mount points. " "(Contributed by Steve Dower in :gh:`102519`.)" msgstr "" -#: ../../whatsnew/3.12.rst:767 +#: ../../whatsnew/3.12.rst:770 msgid "" ":func:`os.stat` and :func:`os.lstat` are now more accurate on Windows. The " "``st_birthtime`` field will now be filled with the creation time of the " @@ -986,27 +996,27 @@ msgid "" "`99726`.)" msgstr "" -#: ../../whatsnew/3.12.rst:778 +#: ../../whatsnew/3.12.rst:781 msgid "os.path" msgstr "os.path" -#: ../../whatsnew/3.12.rst:780 +#: ../../whatsnew/3.12.rst:783 msgid "" "Add :func:`os.path.isjunction` to check if a given path is a junction. " "(Contributed by Charles Machalow in :gh:`99547`.)" msgstr "" -#: ../../whatsnew/3.12.rst:783 +#: ../../whatsnew/3.12.rst:786 msgid "" "Add :func:`os.path.splitroot` to split a path into a triad ``(drive, root, " "tail)``. (Contributed by Barney Gale in :gh:`101000`.)" msgstr "" -#: ../../whatsnew/3.12.rst:787 +#: ../../whatsnew/3.12.rst:790 msgid "pathlib" msgstr "pathlib" -#: ../../whatsnew/3.12.rst:789 +#: ../../whatsnew/3.12.rst:792 msgid "" "Add support for subclassing :class:`pathlib.PurePath` and :class:`pathlib." "Path`, plus their Posix- and Windows-specific variants. Subclasses may " @@ -1014,14 +1024,14 @@ msgid "" "information between path instances." msgstr "" -#: ../../whatsnew/3.12.rst:794 +#: ../../whatsnew/3.12.rst:797 msgid "" "Add :meth:`pathlib.Path.walk` for walking the directory trees and generating " "all file or directory names within them, similar to :func:`os.walk`. " "(Contributed by Stanislav Zmiev in :gh:`90385`.)" msgstr "" -#: ../../whatsnew/3.12.rst:798 +#: ../../whatsnew/3.12.rst:801 msgid "" "Add *walk_up* optional parameter to :meth:`pathlib.PurePath.relative_to` to " "allow the insertion of ``..`` entries in the result; this behavior is more " @@ -1029,13 +1039,13 @@ msgid "" "gh:`84538`.)" msgstr "" -#: ../../whatsnew/3.12.rst:803 +#: ../../whatsnew/3.12.rst:806 msgid "" "Add :meth:`pathlib.Path.is_junction` as a proxy to :func:`os.path." "isjunction`. (Contributed by Charles Machalow in :gh:`99547`.)" msgstr "" -#: ../../whatsnew/3.12.rst:806 +#: ../../whatsnew/3.12.rst:809 msgid "" "Add *case_sensitive* optional parameter to :meth:`pathlib.Path.glob`, :meth:" "`pathlib.Path.rglob` and :meth:`pathlib.PurePath.match` for matching the " @@ -1043,38 +1053,40 @@ msgid "" "process." msgstr "" -#: ../../whatsnew/3.12.rst:811 +#: ../../whatsnew/3.12.rst:814 msgid "pdb" msgstr "pdb" -#: ../../whatsnew/3.12.rst:813 +#: ../../whatsnew/3.12.rst:816 msgid "" "Add convenience variables to hold values temporarily for debug session and " "provide quick access to values like the current frame or the return value. " "(Contributed by Tian Gao in :gh:`103693`.)" msgstr "" -#: ../../whatsnew/3.12.rst:819 +#: ../../whatsnew/3.12.rst:822 msgid "random" msgstr "random" -#: ../../whatsnew/3.12.rst:821 +#: ../../whatsnew/3.12.rst:824 msgid "" "Add :func:`random.binomialvariate`. (Contributed by Raymond Hettinger in :gh:" "`81620`.)" msgstr "" +"新增 :func:`random.binomialvariate`。(由 Raymond Hettinger 於 :gh:`81620` 中" +"貢獻。)" -#: ../../whatsnew/3.12.rst:824 +#: ../../whatsnew/3.12.rst:827 msgid "" "Add a default of ``lambd=1.0`` to :func:`random.expovariate`. (Contributed " "by Raymond Hettinger in :gh:`100234`.)" msgstr "" -#: ../../whatsnew/3.12.rst:828 +#: ../../whatsnew/3.12.rst:831 msgid "shutil" msgstr "shutil" -#: ../../whatsnew/3.12.rst:830 +#: ../../whatsnew/3.12.rst:833 msgid "" ":func:`shutil.make_archive` now passes the *root_dir* argument to custom " "archivers which support it. In this case it no longer temporarily changes " @@ -1082,7 +1094,7 @@ msgid "" "archiving. (Contributed by Serhiy Storchaka in :gh:`74696`.)" msgstr "" -#: ../../whatsnew/3.12.rst:836 +#: ../../whatsnew/3.12.rst:839 msgid "" ":func:`shutil.rmtree` now accepts a new argument *onexc* which is an error " "handler like *onerror* but which expects an exception instance rather than a " @@ -1090,14 +1102,14 @@ msgid "" "Python 3.14. (Contributed by Irit Katriel in :gh:`102828`.)" msgstr "" -#: ../../whatsnew/3.12.rst:842 +#: ../../whatsnew/3.12.rst:845 msgid "" ":func:`shutil.which` now consults the *PATHEXT* environment variable to find " "matches within *PATH* on Windows even when the given *cmd* includes a " "directory component. (Contributed by Charles Machalow in :gh:`103179`.)" msgstr "" -#: ../../whatsnew/3.12.rst:847 +#: ../../whatsnew/3.12.rst:850 msgid "" ":func:`shutil.which` will call ``NeedCurrentDirectoryForExePathW`` when " "querying for executables on Windows to determine if the current working " @@ -1105,24 +1117,26 @@ msgid "" "Machalow in :gh:`103179`.)" msgstr "" -#: ../../whatsnew/3.12.rst:852 +#: ../../whatsnew/3.12.rst:855 msgid "" ":func:`shutil.which` will return a path matching the *cmd* with a component " "from ``PATHEXT`` prior to a direct match elsewhere in the search path on " "Windows. (Contributed by Charles Machalow in :gh:`103179`.)" msgstr "" -#: ../../whatsnew/3.12.rst:858 ../../whatsnew/3.12.rst:1637 +#: ../../whatsnew/3.12.rst:861 ../../whatsnew/3.12.rst:1651 msgid "sqlite3" msgstr "sqlite3" -#: ../../whatsnew/3.12.rst:860 +#: ../../whatsnew/3.12.rst:863 msgid "" "Add a :ref:`command-line interface `. (Contributed by Erlend E. " "Aasland in :gh:`77617`.)" msgstr "" +"新增\\ :ref:`命令列介面 `。(由 Erlend E. Aasland 於 :gh:" +"`77617` 中貢獻。)" -#: ../../whatsnew/3.12.rst:863 +#: ../../whatsnew/3.12.rst:866 msgid "" "Add the :attr:`sqlite3.Connection.autocommit` attribute to :class:`sqlite3." "Connection` and the *autocommit* parameter to :func:`sqlite3.connect` to " @@ -1130,43 +1144,43 @@ msgid "" "control-autocommit>`. (Contributed by Erlend E. Aasland in :gh:`83638`.)" msgstr "" -#: ../../whatsnew/3.12.rst:870 +#: ../../whatsnew/3.12.rst:873 msgid "" "Add *entrypoint* keyword-only parameter to :meth:`sqlite3.Connection." "load_extension`, for overriding the SQLite extension entry point. " "(Contributed by Erlend E. Aasland in :gh:`103015`.)" msgstr "" -#: ../../whatsnew/3.12.rst:875 +#: ../../whatsnew/3.12.rst:878 msgid "" "Add :meth:`sqlite3.Connection.getconfig` and :meth:`sqlite3.Connection." "setconfig` to :class:`sqlite3.Connection` to make configuration changes to a " "database connection. (Contributed by Erlend E. Aasland in :gh:`103489`.)" msgstr "" -#: ../../whatsnew/3.12.rst:881 +#: ../../whatsnew/3.12.rst:884 msgid "statistics" msgstr "statistics" -#: ../../whatsnew/3.12.rst:883 +#: ../../whatsnew/3.12.rst:886 msgid "" "Extend :func:`statistics.correlation` to include as a ``ranked`` method for " "computing the Spearman correlation of ranked data. (Contributed by Raymond " "Hettinger in :gh:`95861`.)" msgstr "" -#: ../../whatsnew/3.12.rst:888 +#: ../../whatsnew/3.12.rst:891 msgid "sys" msgstr "sys" -#: ../../whatsnew/3.12.rst:890 +#: ../../whatsnew/3.12.rst:893 msgid "" "Add the :mod:`sys.monitoring` namespace to expose the new :ref:`PEP 669 " "` monitoring API. (Contributed by Mark Shannon in :gh:" "`103082`.)" msgstr "" -#: ../../whatsnew/3.12.rst:894 +#: ../../whatsnew/3.12.rst:897 msgid "" "Add :func:`sys.activate_stack_trampoline` and :func:`sys." "deactivate_stack_trampoline` for activating and deactivating stack profiler " @@ -1176,7 +1190,7 @@ msgid "" "Shannon in :gh:`96123`.)" msgstr "" -#: ../../whatsnew/3.12.rst:903 +#: ../../whatsnew/3.12.rst:906 msgid "" "Add :data:`sys.last_exc` which holds the last unhandled exception that was " "raised (for post-mortem debugging use cases). Deprecate the three fields " @@ -1185,14 +1199,14 @@ msgid "" "Katriel in :gh:`102778`.)" msgstr "" -#: ../../whatsnew/3.12.rst:909 ../../whatsnew/3.12.rst:1825 +#: ../../whatsnew/3.12.rst:912 ../../whatsnew/3.12.rst:1839 msgid "" ":func:`sys._current_exceptions` now returns a mapping from thread-id to an " "exception instance, rather than to a ``(typ, exc, tb)`` tuple. (Contributed " "by Irit Katriel in :gh:`103176`.)" msgstr "" -#: ../../whatsnew/3.12.rst:913 +#: ../../whatsnew/3.12.rst:916 msgid "" ":func:`sys.setrecursionlimit` and :func:`sys.getrecursionlimit`. The " "recursion limit now applies only to Python code. Builtin functions do not " @@ -1200,27 +1214,27 @@ msgid "" "prevents recursion from causing a virtual machine crash." msgstr "" -#: ../../whatsnew/3.12.rst:919 +#: ../../whatsnew/3.12.rst:922 msgid "tempfile" msgstr "tempfile" -#: ../../whatsnew/3.12.rst:921 +#: ../../whatsnew/3.12.rst:924 msgid "" "The :class:`tempfile.NamedTemporaryFile` function has a new optional " "parameter *delete_on_close* (Contributed by Evgeny Zorin in :gh:`58451`.)" msgstr "" -#: ../../whatsnew/3.12.rst:923 +#: ../../whatsnew/3.12.rst:926 msgid "" ":func:`tempfile.mkdtemp` now always returns an absolute path, even if the " "argument provided to the *dir* parameter is a relative path." msgstr "" -#: ../../whatsnew/3.12.rst:929 +#: ../../whatsnew/3.12.rst:932 msgid "threading" msgstr "threading" -#: ../../whatsnew/3.12.rst:931 +#: ../../whatsnew/3.12.rst:934 msgid "" "Add :func:`threading.settrace_all_threads` and :func:`threading." "setprofile_all_threads` that allow to set tracing and profiling functions in " @@ -1228,11 +1242,11 @@ msgid "" "Galindo in :gh:`93503`.)" msgstr "" -#: ../../whatsnew/3.12.rst:937 +#: ../../whatsnew/3.12.rst:940 msgid "tkinter" msgstr "tkinter" -#: ../../whatsnew/3.12.rst:939 +#: ../../whatsnew/3.12.rst:942 msgid "" "``tkinter.Canvas.coords()`` now flattens its arguments. It now accepts not " "only coordinates as separate arguments (``x1, y1, x2, y2, ...``) and a " @@ -1242,11 +1256,11 @@ msgid "" "in :gh:`94473`.)" msgstr "" -#: ../../whatsnew/3.12.rst:948 +#: ../../whatsnew/3.12.rst:951 msgid "tokenize" msgstr "tokenize" -#: ../../whatsnew/3.12.rst:950 +#: ../../whatsnew/3.12.rst:953 msgid "" "The :mod:`tokenize` module includes the changes introduced in :pep:`701`. " "(Contributed by Marta Gómez Macías and Pablo Galindo in :gh:`102856`.) See :" @@ -1254,22 +1268,22 @@ msgid "" "to the :mod:`tokenize` module." msgstr "" -#: ../../whatsnew/3.12.rst:956 +#: ../../whatsnew/3.12.rst:959 msgid "types" msgstr "types" -#: ../../whatsnew/3.12.rst:958 +#: ../../whatsnew/3.12.rst:961 msgid "" "Add :func:`types.get_original_bases` to allow for further introspection of :" "ref:`user-defined-generics` when subclassed. (Contributed by James Hilton-" "Balfe and Alex Waygood in :gh:`101827`.)" msgstr "" -#: ../../whatsnew/3.12.rst:963 +#: ../../whatsnew/3.12.rst:966 msgid "typing" msgstr "typing" -#: ../../whatsnew/3.12.rst:965 +#: ../../whatsnew/3.12.rst:968 msgid "" ":func:`isinstance` checks against :func:`runtime-checkable protocols ` now use :func:`inspect.getattr_static` rather than :func:" @@ -1282,7 +1296,7 @@ msgid "" "affected by this change. (Contributed by Alex Waygood in :gh:`102433`.)" msgstr "" -#: ../../whatsnew/3.12.rst:976 +#: ../../whatsnew/3.12.rst:979 msgid "" "The members of a runtime-checkable protocol are now considered \"frozen\" at " "runtime as soon as the class has been created. Monkey-patching attributes " @@ -1290,13 +1304,13 @@ msgid "" "on :func:`isinstance` checks comparing objects to the protocol. For example::" msgstr "" -#: ../../whatsnew/3.12.rst:998 +#: ../../whatsnew/3.12.rst:1001 msgid "" "This change was made in order to speed up ``isinstance()`` checks against " "runtime-checkable protocols." msgstr "" -#: ../../whatsnew/3.12.rst:1001 +#: ../../whatsnew/3.12.rst:1004 msgid "" "The performance profile of :func:`isinstance` checks against :func:`runtime-" "checkable protocols ` has changed significantly. " @@ -1307,71 +1321,71 @@ msgid "" "in :gh:`74690` and :gh:`103193`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1009 +#: ../../whatsnew/3.12.rst:1012 msgid "" "All :data:`typing.TypedDict` and :data:`typing.NamedTuple` classes now have " "the ``__orig_bases__`` attribute. (Contributed by Adrian Garcia Badaracco " "in :gh:`103699`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1013 +#: ../../whatsnew/3.12.rst:1016 msgid "" "Add ``frozen_default`` parameter to :func:`typing.dataclass_transform`. " "(Contributed by Erik De Bonte in :gh:`99957`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1017 +#: ../../whatsnew/3.12.rst:1020 msgid "unicodedata" msgstr "unicodedata" -#: ../../whatsnew/3.12.rst:1019 +#: ../../whatsnew/3.12.rst:1022 msgid "" "The Unicode database has been updated to version 15.0.0. (Contributed by " "Benjamin Peterson in :gh:`96734`)." msgstr "" -#: ../../whatsnew/3.12.rst:1023 ../../whatsnew/3.12.rst:1678 +#: ../../whatsnew/3.12.rst:1026 ../../whatsnew/3.12.rst:1692 msgid "unittest" msgstr "unittest" -#: ../../whatsnew/3.12.rst:1025 +#: ../../whatsnew/3.12.rst:1028 msgid "" "Add a ``--durations`` command line option, showing the N slowest test cases::" msgstr "" -#: ../../whatsnew/3.12.rst:1041 +#: ../../whatsnew/3.12.rst:1044 msgid "(Contributed by Giampaolo Rodola in :gh:`48330`)" msgstr "" -#: ../../whatsnew/3.12.rst:1044 +#: ../../whatsnew/3.12.rst:1047 msgid "uuid" msgstr "uuid" -#: ../../whatsnew/3.12.rst:1046 +#: ../../whatsnew/3.12.rst:1049 msgid "" "Add a :ref:`command-line interface `. (Contributed by Adam Chhina " "in :gh:`88597`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1051 +#: ../../whatsnew/3.12.rst:1054 msgid "Optimizations" msgstr "最佳化" -#: ../../whatsnew/3.12.rst:1053 +#: ../../whatsnew/3.12.rst:1056 msgid "" "Remove ``wstr`` and ``wstr_length`` members from Unicode objects. It reduces " "object size by 8 or 16 bytes on 64bit platform. (:pep:`623`) (Contributed by " "Inada Naoki in :gh:`92536`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1057 +#: ../../whatsnew/3.12.rst:1060 msgid "" "Add experimental support for using the BOLT binary optimizer in the build " "process, which improves performance by 1-5%. (Contributed by Kevin " "Modzelewski in :gh:`90536` and tuned by Donghee Na in :gh:`101525`)" msgstr "" -#: ../../whatsnew/3.12.rst:1061 +#: ../../whatsnew/3.12.rst:1064 msgid "" "Speed up the regular expression substitution (functions :func:`re.sub` and :" "func:`re.subn` and corresponding :class:`!re.Pattern` methods) for " @@ -1379,13 +1393,13 @@ msgid "" "by Serhiy Storchaka in :gh:`91524`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1066 +#: ../../whatsnew/3.12.rst:1069 msgid "" "Speed up :class:`asyncio.Task` creation by deferring expensive string " "formatting. (Contributed by Itamar Oren in :gh:`103793`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1069 +#: ../../whatsnew/3.12.rst:1072 msgid "" "The :func:`tokenize.tokenize` and :func:`tokenize.generate_tokens` functions " "are up to 64% faster as a side effect of the changes required to cover :pep:" @@ -1393,18 +1407,18 @@ msgid "" "Pablo Galindo in :gh:`102856`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1074 +#: ../../whatsnew/3.12.rst:1077 msgid "" "Speed up :func:`super` method calls and attribute loads via the new :opcode:" "`LOAD_SUPER_ATTR` instruction. (Contributed by Carl Meyer and Vladimir " "Matveev in :gh:`103497`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1080 +#: ../../whatsnew/3.12.rst:1083 msgid "CPython bytecode changes" msgstr "" -#: ../../whatsnew/3.12.rst:1082 +#: ../../whatsnew/3.12.rst:1085 msgid "" "Remove the :opcode:`!LOAD_METHOD` instruction. It has been merged into :" "opcode:`LOAD_ATTR`. :opcode:`LOAD_ATTR` will now behave like the old :opcode:" @@ -1412,62 +1426,62 @@ msgid "" "by Ken Jin in :gh:`93429`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1087 +#: ../../whatsnew/3.12.rst:1090 msgid "" "Remove the :opcode:`!JUMP_IF_FALSE_OR_POP` and :opcode:`!" "JUMP_IF_TRUE_OR_POP` instructions. (Contributed by Irit Katriel in :gh:" "`102859`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1090 +#: ../../whatsnew/3.12.rst:1093 msgid "" "Remove the :opcode:`!PRECALL` instruction. (Contributed by Mark Shannon in :" "gh:`92925`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1093 +#: ../../whatsnew/3.12.rst:1096 msgid "" "Add the :opcode:`BINARY_SLICE` and :opcode:`STORE_SLICE` instructions. " "(Contributed by Mark Shannon in :gh:`94163`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1096 +#: ../../whatsnew/3.12.rst:1099 msgid "" "Add the :opcode:`CALL_INTRINSIC_1` instructions. (Contributed by Mark " "Shannon in :gh:`99005`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1099 +#: ../../whatsnew/3.12.rst:1102 msgid "" "Add the :opcode:`CALL_INTRINSIC_2` instruction. (Contributed by Irit Katriel " "in :gh:`101799`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1102 +#: ../../whatsnew/3.12.rst:1105 msgid "" "Add the :opcode:`CLEANUP_THROW` instruction. (Contributed by Brandt Bucher " "in :gh:`90997`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1105 +#: ../../whatsnew/3.12.rst:1108 msgid "" "Add the :opcode:`!END_SEND` instruction. (Contributed by Mark Shannon in :gh:" "`103082`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1108 +#: ../../whatsnew/3.12.rst:1111 msgid "" "Add the :opcode:`LOAD_FAST_AND_CLEAR` instruction as part of the " "implementation of :pep:`709`. (Contributed by Carl Meyer in :gh:`101441`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1111 +#: ../../whatsnew/3.12.rst:1114 msgid "" "Add the :opcode:`LOAD_FAST_CHECK` instruction. (Contributed by Dennis " "Sweeney in :gh:`93143`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1114 +#: ../../whatsnew/3.12.rst:1117 msgid "" "Add the :opcode:`LOAD_FROM_DICT_OR_DEREF`, :opcode:" "`LOAD_FROM_DICT_OR_GLOBALS`, and :opcode:`LOAD_LOCALS` opcodes as part of " @@ -1476,48 +1490,48 @@ msgid "" "`LOAD_FROM_DICT_OR_DEREF`. (Contributed by Jelle Zijlstra in :gh:`103764`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1120 +#: ../../whatsnew/3.12.rst:1123 msgid "" "Add the :opcode:`LOAD_SUPER_ATTR` instruction. (Contributed by Carl Meyer " "and Vladimir Matveev in :gh:`103497`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1123 +#: ../../whatsnew/3.12.rst:1126 msgid "" "Add the :opcode:`RETURN_CONST` instruction. (Contributed by Wenyang Wang in :" "gh:`101632`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1126 +#: ../../whatsnew/3.12.rst:1129 msgid "Demos and Tools" msgstr "" -#: ../../whatsnew/3.12.rst:1128 +#: ../../whatsnew/3.12.rst:1131 msgid "" "Remove the ``Tools/demo/`` directory which contained old demo scripts. A " "copy can be found in the `old-demos project `_. (Contributed by Victor Stinner in :gh:`97681`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1133 +#: ../../whatsnew/3.12.rst:1136 msgid "" "Remove outdated example scripts of the ``Tools/scripts/`` directory. A copy " "can be found in the `old-demos project `_. (Contributed by Victor Stinner in :gh:`97669`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1140 ../../whatsnew/3.12.rst:2219 +#: ../../whatsnew/3.12.rst:1143 ../../whatsnew/3.12.rst:2233 msgid "Deprecated" msgstr "已棄用" -#: ../../whatsnew/3.12.rst:1142 +#: ../../whatsnew/3.12.rst:1145 msgid "" ":mod:`argparse`: The *type*, *choices*, and *metavar* parameters of :class:`!" "argparse.BooleanOptionalAction` are deprecated and will be removed in 3.14. " "(Contributed by Nikita Sobolev in :gh:`92248`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1147 +#: ../../whatsnew/3.12.rst:1150 msgid "" ":mod:`ast`: The following :mod:`ast` features have been deprecated in " "documentation since Python 3.8, now cause a :exc:`DeprecationWarning` to be " @@ -1525,37 +1539,37 @@ msgid "" "Python 3.14:" msgstr "" -#: ../../whatsnew/3.12.rst:1151 ../../whatsnew/3.12.rst:1383 +#: ../../whatsnew/3.12.rst:1154 ../../whatsnew/3.12.rst:1386 msgid ":class:`!ast.Num`" msgstr ":class:`!ast.Num`" -#: ../../whatsnew/3.12.rst:1152 ../../whatsnew/3.12.rst:1384 +#: ../../whatsnew/3.12.rst:1155 ../../whatsnew/3.12.rst:1387 msgid ":class:`!ast.Str`" msgstr ":class:`!ast.Str`" -#: ../../whatsnew/3.12.rst:1153 ../../whatsnew/3.12.rst:1385 +#: ../../whatsnew/3.12.rst:1156 ../../whatsnew/3.12.rst:1388 msgid ":class:`!ast.Bytes`" msgstr ":class:`!ast.Bytes`" -#: ../../whatsnew/3.12.rst:1154 ../../whatsnew/3.12.rst:1386 +#: ../../whatsnew/3.12.rst:1157 ../../whatsnew/3.12.rst:1389 msgid ":class:`!ast.NameConstant`" msgstr ":class:`!ast.NameConstant`" -#: ../../whatsnew/3.12.rst:1155 ../../whatsnew/3.12.rst:1387 +#: ../../whatsnew/3.12.rst:1158 ../../whatsnew/3.12.rst:1390 msgid ":class:`!ast.Ellipsis`" msgstr ":class:`!ast.Ellipsis`" -#: ../../whatsnew/3.12.rst:1157 +#: ../../whatsnew/3.12.rst:1160 msgid "" "Use :class:`ast.Constant` instead. (Contributed by Serhiy Storchaka in :gh:" "`90953`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1160 ../../whatsnew/3.12.rst:1389 +#: ../../whatsnew/3.12.rst:1163 ../../whatsnew/3.12.rst:1392 msgid ":mod:`asyncio`:" -msgstr "" +msgstr ":mod:`asyncio`:" -#: ../../whatsnew/3.12.rst:1162 +#: ../../whatsnew/3.12.rst:1165 msgid "" "The child watcher classes :class:`asyncio.MultiLoopChildWatcher`, :class:" "`asyncio.FastChildWatcher`, :class:`asyncio.AbstractChildWatcher` and :class:" @@ -1563,7 +1577,7 @@ msgid "" "3.14. (Contributed by Kumar Aditya in :gh:`94597`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1168 +#: ../../whatsnew/3.12.rst:1171 msgid "" ":func:`asyncio.set_child_watcher`, :func:`asyncio.get_child_watcher`, :meth:" "`asyncio.AbstractEventLoopPolicy.set_child_watcher` and :meth:`asyncio." @@ -1571,7 +1585,7 @@ msgid "" "removed in Python 3.14. (Contributed by Kumar Aditya in :gh:`94597`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1174 +#: ../../whatsnew/3.12.rst:1177 msgid "" "The :meth:`~asyncio.get_event_loop` method of the default event loop policy " "now emits a :exc:`DeprecationWarning` if there is no current event loop set " @@ -1579,14 +1593,14 @@ msgid "" "Rossum in :gh:`100160`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1179 +#: ../../whatsnew/3.12.rst:1182 msgid "" ":mod:`calendar`: ``calendar.January`` and ``calendar.February`` constants " "are deprecated and replaced by :data:`calendar.JANUARY` and :data:`calendar." "FEBRUARY`. (Contributed by Prince Roshan in :gh:`103636`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1183 +#: ../../whatsnew/3.12.rst:1186 msgid "" ":mod:`collections.abc`: Deprecated :class:`collections.abc.ByteString`. " "Prefer :class:`Sequence` or :class:`collections.abc.Buffer`. For use in " @@ -1594,7 +1608,7 @@ msgid "" "abc.Buffer`. (Contributed by Shantanu Jain in :gh:`91896`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1188 +#: ../../whatsnew/3.12.rst:1191 msgid "" ":mod:`datetime`: :class:`datetime.datetime`'s :meth:`~datetime.datetime." "utcnow` and :meth:`~datetime.datetime.utcfromtimestamp` are deprecated and " @@ -1604,47 +1618,47 @@ msgid "" "set to :const:`datetime.UTC`. (Contributed by Paul Ganssle in :gh:`103857`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1196 +#: ../../whatsnew/3.12.rst:1199 msgid "" ":mod:`email`: Deprecate the *isdst* parameter in :func:`email.utils." "localtime`. (Contributed by Alan Williams in :gh:`72346`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1199 +#: ../../whatsnew/3.12.rst:1202 msgid "" ":mod:`importlib.abc`: Deprecated the following classes, scheduled for " "removal in Python 3.14:" msgstr "" -#: ../../whatsnew/3.12.rst:1202 ../../whatsnew/3.12.rst:1406 +#: ../../whatsnew/3.12.rst:1205 ../../whatsnew/3.12.rst:1409 msgid ":class:`!importlib.abc.ResourceReader`" msgstr ":class:`!importlib.abc.ResourceReader`" -#: ../../whatsnew/3.12.rst:1203 ../../whatsnew/3.12.rst:1407 +#: ../../whatsnew/3.12.rst:1206 ../../whatsnew/3.12.rst:1410 msgid ":class:`!importlib.abc.Traversable`" msgstr ":class:`!importlib.abc.Traversable`" -#: ../../whatsnew/3.12.rst:1204 ../../whatsnew/3.12.rst:1408 +#: ../../whatsnew/3.12.rst:1207 ../../whatsnew/3.12.rst:1411 msgid ":class:`!importlib.abc.TraversableResources`" msgstr ":class:`!importlib.abc.TraversableResources`" -#: ../../whatsnew/3.12.rst:1206 +#: ../../whatsnew/3.12.rst:1209 msgid "Use :mod:`importlib.resources.abc` classes instead:" -msgstr "" +msgstr "請改用 :mod:`importlib.resources.abc` 類別:" -#: ../../whatsnew/3.12.rst:1208 +#: ../../whatsnew/3.12.rst:1211 msgid ":class:`importlib.resources.abc.Traversable`" msgstr ":class:`importlib.resources.abc.Traversable`" -#: ../../whatsnew/3.12.rst:1209 +#: ../../whatsnew/3.12.rst:1212 msgid ":class:`importlib.resources.abc.TraversableResources`" msgstr ":class:`importlib.resources.abc.TraversableResources`" -#: ../../whatsnew/3.12.rst:1211 +#: ../../whatsnew/3.12.rst:1214 msgid "(Contributed by Jason R. Coombs and Hugo van Kemenade in :gh:`93963`.)" msgstr "(由 Jason R. Coombs 和 Hugo van Kemenade 於 :gh:`93963` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1213 +#: ../../whatsnew/3.12.rst:1216 msgid "" ":mod:`itertools`: Deprecate the support for copy, deepcopy, and pickle " "operations, which is undocumented, inefficient, historically buggy, and " @@ -1653,7 +1667,7 @@ msgid "" "`101588`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1219 +#: ../../whatsnew/3.12.rst:1222 msgid "" ":mod:`multiprocessing`: In Python 3.14, the default :mod:`multiprocessing` " "start method will change to a safer one on Linux, BSDs, and other non-macOS " @@ -1665,14 +1679,14 @@ msgid "" "methods `." msgstr "" -#: ../../whatsnew/3.12.rst:1229 +#: ../../whatsnew/3.12.rst:1232 msgid "" ":mod:`pkgutil`: :func:`pkgutil.find_loader` and :func:`pkgutil.get_loader` " "are deprecated and will be removed in Python 3.14; use :func:`importlib.util." "find_spec` instead. (Contributed by Nikita Sobolev in :gh:`97850`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1234 +#: ../../whatsnew/3.12.rst:1237 msgid "" ":mod:`pty`: The module has two undocumented ``master_open()`` and " "``slave_open()`` functions that have been deprecated since Python 2 but only " @@ -1680,11 +1694,11 @@ msgid "" "(Contributed by Soumendra Ganguly and Gregory P. Smith in :gh:`85984`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1239 +#: ../../whatsnew/3.12.rst:1242 msgid ":mod:`os`:" -msgstr "" +msgstr ":mod:`os`:" -#: ../../whatsnew/3.12.rst:1241 +#: ../../whatsnew/3.12.rst:1244 msgid "" "The ``st_ctime`` fields return by :func:`os.stat` and :func:`os.lstat` on " "Windows are deprecated. In a future release, they will contain the last " @@ -1693,7 +1707,7 @@ msgid "" "``st_birthtime`` field. (Contributed by Steve Dower in :gh:`99726`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1247 +#: ../../whatsnew/3.12.rst:1250 msgid "" "On POSIX platforms, :func:`os.fork` can now raise a :exc:" "`DeprecationWarning` when it can detect being called from a multithreaded " @@ -1706,32 +1720,32 @@ msgid "" "longstanding platform compatibility problem to developers." msgstr "" -#: ../../whatsnew/3.12.rst:1257 +#: ../../whatsnew/3.12.rst:1260 msgid "" "When this warning appears due to usage of :mod:`multiprocessing` or :mod:" "`concurrent.futures` the fix is to use a different :mod:`multiprocessing` " "start method such as ``\"spawn\"`` or ``\"forkserver\"``." msgstr "" -#: ../../whatsnew/3.12.rst:1261 +#: ../../whatsnew/3.12.rst:1264 msgid "" ":mod:`shutil`: The *onerror* argument of :func:`shutil.rmtree` is deprecated " "and will be removed in Python 3.14. Use *onexc* instead. (Contributed by " "Irit Katriel in :gh:`102828`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1264 +#: ../../whatsnew/3.12.rst:1267 msgid ":mod:`sqlite3`:" -msgstr "" +msgstr ":mod:`sqlite3`:" -#: ../../whatsnew/3.12.rst:1266 +#: ../../whatsnew/3.12.rst:1269 msgid "" ":ref:`default adapters and converters ` are now " "deprecated. Instead, use the :ref:`sqlite3-adapter-converter-recipes` and " "tailor them to your needs. (Contributed by Erlend E. Aasland in :gh:`90016`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1272 +#: ../../whatsnew/3.12.rst:1275 msgid "" "In :meth:`~sqlite3.Cursor.execute`, :exc:`DeprecationWarning` is now emitted " "when :ref:`named placeholders ` are used together with " @@ -1741,38 +1755,38 @@ msgid "" "Erlend E. Aasland in :gh:`101698`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1279 +#: ../../whatsnew/3.12.rst:1282 msgid "" ":mod:`sys`: The :data:`sys.last_type`, :data:`sys.last_value` and :data:`sys." "last_traceback` fields are deprecated. Use :data:`sys.last_exc` instead. " "(Contributed by Irit Katriel in :gh:`102778`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1283 +#: ../../whatsnew/3.12.rst:1286 msgid "" ":mod:`tarfile`: Extracting tar archives without specifying *filter* is " "deprecated until Python 3.14, when ``'data'`` filter will become the " "default. See :ref:`tarfile-extraction-filter` for details." msgstr "" -#: ../../whatsnew/3.12.rst:1287 +#: ../../whatsnew/3.12.rst:1290 msgid ":mod:`typing`:" msgstr "" -#: ../../whatsnew/3.12.rst:1289 +#: ../../whatsnew/3.12.rst:1292 msgid "" ":class:`typing.Hashable` and :class:`typing.Sized` aliases for :class:" "`collections.abc.Hashable` and :class:`collections.abc.Sized`. (:gh:`94309`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1292 +#: ../../whatsnew/3.12.rst:1295 msgid "" ":class:`typing.ByteString`, deprecated since Python 3.9, now causes a :exc:" "`DeprecationWarning` to be emitted when it is used. (Contributed by Alex " "Waygood in :gh:`91896`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1296 +#: ../../whatsnew/3.12.rst:1299 msgid "" ":mod:`xml.etree.ElementTree`: The module now emits :exc:`DeprecationWarning` " "when testing the truth value of an :class:`xml.etree.ElementTree.Element`. " @@ -1780,7 +1794,7 @@ msgid "" "implementation emitted nothing. (Contributed by Jacob Walls in :gh:`83122`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1302 +#: ../../whatsnew/3.12.rst:1305 msgid "" "The 3-arg signatures (type, value, traceback) of :meth:`coroutine throw() " "`, :meth:`generator throw() ` and :meth:" @@ -1789,21 +1803,21 @@ msgid "" "instead. (Contributed by Ofey Chan in :gh:`89874`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1308 +#: ../../whatsnew/3.12.rst:1311 msgid "" ":exc:`DeprecationWarning` is now raised when ``__package__`` on a module " "differs from ``__spec__.parent`` (previously it was :exc:`ImportWarning`). " "(Contributed by Brett Cannon in :gh:`65961`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1313 +#: ../../whatsnew/3.12.rst:1316 msgid "" "Setting ``__package__`` or ``__cached__`` on a module is deprecated, and " "will cease to be set or taken into consideration by the import system in " "Python 3.14. (Contributed by Brett Cannon in :gh:`65961`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1317 +#: ../../whatsnew/3.12.rst:1320 msgid "" "The bitwise inversion operator (``~``) on bool is deprecated. It will throw " "an error in Python 3.14. Use ``not`` for logical negation of bools instead. " @@ -1812,7 +1826,7 @@ msgid "" "Tim Hoffmann in :gh:`103487`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1323 +#: ../../whatsnew/3.12.rst:1326 msgid "" "Accessing ``co_lnotab`` on code objects was deprecated in Python 3.10 via :" "pep:`626`, but it only got a proper :exc:`DeprecationWarning` in 3.12, " @@ -1820,276 +1834,289 @@ msgid "" "`101866`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1329 +#: ../../whatsnew/3.12.rst:1332 msgid "Pending Removal in Python 3.13" -msgstr "" +msgstr "Python 3.13 中待決議的移除項目" -#: ../../whatsnew/3.12.rst:1331 +#: ../../whatsnew/3.12.rst:1334 msgid "" "The following modules and APIs have been deprecated in earlier Python " "releases, and will be removed in Python 3.13." msgstr "" -#: ../../whatsnew/3.12.rst:1334 +#: ../../whatsnew/3.12.rst:1337 msgid "Modules (see :pep:`594`):" msgstr "" -#: ../../whatsnew/3.12.rst:1336 +#: ../../whatsnew/3.12.rst:1339 msgid ":mod:`aifc`" msgstr ":mod:`aifc`" -#: ../../whatsnew/3.12.rst:1337 +#: ../../whatsnew/3.12.rst:1340 msgid ":mod:`audioop`" msgstr ":mod:`audioop`" -#: ../../whatsnew/3.12.rst:1338 +#: ../../whatsnew/3.12.rst:1341 msgid ":mod:`cgi`" msgstr ":mod:`cgi`" -#: ../../whatsnew/3.12.rst:1339 +#: ../../whatsnew/3.12.rst:1342 msgid ":mod:`cgitb`" msgstr ":mod:`cgitb`" -#: ../../whatsnew/3.12.rst:1340 +#: ../../whatsnew/3.12.rst:1343 msgid ":mod:`chunk`" msgstr ":mod:`chunk`" -#: ../../whatsnew/3.12.rst:1341 +#: ../../whatsnew/3.12.rst:1344 msgid ":mod:`crypt`" msgstr ":mod:`crypt`" -#: ../../whatsnew/3.12.rst:1342 +#: ../../whatsnew/3.12.rst:1345 msgid ":mod:`imghdr`" msgstr ":mod:`imghdr`" -#: ../../whatsnew/3.12.rst:1343 +#: ../../whatsnew/3.12.rst:1346 msgid ":mod:`mailcap`" msgstr ":mod:`mailcap`" -#: ../../whatsnew/3.12.rst:1344 +#: ../../whatsnew/3.12.rst:1347 msgid ":mod:`msilib`" msgstr ":mod:`msilib`" -#: ../../whatsnew/3.12.rst:1345 +#: ../../whatsnew/3.12.rst:1348 msgid ":mod:`nis`" msgstr ":mod:`nis`" -#: ../../whatsnew/3.12.rst:1346 +#: ../../whatsnew/3.12.rst:1349 msgid ":mod:`nntplib`" msgstr ":mod:`nntplib`" -#: ../../whatsnew/3.12.rst:1347 +#: ../../whatsnew/3.12.rst:1350 msgid ":mod:`ossaudiodev`" msgstr ":mod:`ossaudiodev`" -#: ../../whatsnew/3.12.rst:1348 +#: ../../whatsnew/3.12.rst:1351 msgid ":mod:`pipes`" msgstr ":mod:`pipes`" -#: ../../whatsnew/3.12.rst:1349 +#: ../../whatsnew/3.12.rst:1352 msgid ":mod:`sndhdr`" msgstr ":mod:`sndhdr`" -#: ../../whatsnew/3.12.rst:1350 +#: ../../whatsnew/3.12.rst:1353 msgid ":mod:`spwd`" msgstr ":mod:`spwd`" -#: ../../whatsnew/3.12.rst:1351 +#: ../../whatsnew/3.12.rst:1354 msgid ":mod:`sunau`" msgstr ":mod:`sunau`" -#: ../../whatsnew/3.12.rst:1352 +#: ../../whatsnew/3.12.rst:1355 msgid ":mod:`telnetlib`" msgstr ":mod:`telnetlib`" -#: ../../whatsnew/3.12.rst:1353 +#: ../../whatsnew/3.12.rst:1356 msgid ":mod:`uu`" msgstr ":mod:`uu`" -#: ../../whatsnew/3.12.rst:1354 +#: ../../whatsnew/3.12.rst:1357 msgid ":mod:`xdrlib`" msgstr ":mod:`xdrlib`" -#: ../../whatsnew/3.12.rst:1356 +#: ../../whatsnew/3.12.rst:1359 msgid "Other modules:" -msgstr "" +msgstr "其他模組:" -#: ../../whatsnew/3.12.rst:1358 +#: ../../whatsnew/3.12.rst:1361 msgid ":mod:`!lib2to3`, and the :program:`2to3` program (:gh:`84540`)" msgstr "" -#: ../../whatsnew/3.12.rst:1360 +#: ../../whatsnew/3.12.rst:1363 ../../whatsnew/3.12.rst:1441 msgid "APIs:" msgstr "" -#: ../../whatsnew/3.12.rst:1362 +#: ../../whatsnew/3.12.rst:1365 msgid ":class:`!configparser.LegacyInterpolation` (:gh:`90765`)" msgstr ":class:`!configparser.LegacyInterpolation` (:gh:`90765`)" -#: ../../whatsnew/3.12.rst:1363 -msgid ":func:`locale.getdefaultlocale` (:gh:`90817`)" -msgstr ":func:`locale.getdefaultlocale` (:gh:`90817`)" +#: ../../whatsnew/3.12.rst:1366 +msgid "``locale.resetlocale()`` (:gh:`90817`)" +msgstr "``locale.resetlocale()`` (:gh:`90817`)" -#: ../../whatsnew/3.12.rst:1364 +#: ../../whatsnew/3.12.rst:1367 msgid ":meth:`!turtle.RawTurtle.settiltangle` (:gh:`50096`)" msgstr ":meth:`!turtle.RawTurtle.settiltangle` (:gh:`50096`)" -#: ../../whatsnew/3.12.rst:1365 +#: ../../whatsnew/3.12.rst:1368 msgid ":func:`!unittest.findTestCases` (:gh:`50096`)" msgstr ":func:`!unittest.findTestCases` (:gh:`50096`)" -#: ../../whatsnew/3.12.rst:1366 +#: ../../whatsnew/3.12.rst:1369 msgid ":func:`!unittest.getTestCaseNames` (:gh:`50096`)" msgstr ":func:`!unittest.getTestCaseNames` (:gh:`50096`)" -#: ../../whatsnew/3.12.rst:1367 +#: ../../whatsnew/3.12.rst:1370 msgid ":func:`!unittest.makeSuite` (:gh:`50096`)" msgstr ":func:`!unittest.makeSuite` (:gh:`50096`)" -#: ../../whatsnew/3.12.rst:1368 +#: ../../whatsnew/3.12.rst:1371 msgid ":meth:`!unittest.TestProgram.usageExit` (:gh:`67048`)" msgstr ":meth:`!unittest.TestProgram.usageExit` (:gh:`67048`)" -#: ../../whatsnew/3.12.rst:1369 +#: ../../whatsnew/3.12.rst:1372 msgid ":class:`!webbrowser.MacOSX` (:gh:`86421`)" msgstr ":class:`!webbrowser.MacOSX` (:gh:`86421`)" -#: ../../whatsnew/3.12.rst:1370 +#: ../../whatsnew/3.12.rst:1373 msgid ":class:`classmethod` descriptor chaining (:gh:`89519`)" msgstr "" -#: ../../whatsnew/3.12.rst:1373 ../../whatsnew/3.12.rst:2306 +#: ../../whatsnew/3.12.rst:1376 ../../whatsnew/3.12.rst:2320 msgid "Pending Removal in Python 3.14" -msgstr "" +msgstr "Python 3.14 中待決議的移除項目" -#: ../../whatsnew/3.12.rst:1375 +#: ../../whatsnew/3.12.rst:1378 msgid "" "The following APIs have been deprecated and will be removed in Python 3.14." msgstr "" -#: ../../whatsnew/3.12.rst:1378 +#: ../../whatsnew/3.12.rst:1381 msgid "" ":mod:`argparse`: The *type*, *choices*, and *metavar* parameters of :class:`!" "argparse.BooleanOptionalAction`" msgstr "" -#: ../../whatsnew/3.12.rst:1381 +#: ../../whatsnew/3.12.rst:1384 msgid ":mod:`ast`:" msgstr ":mod:`ast`:" -#: ../../whatsnew/3.12.rst:1391 +#: ../../whatsnew/3.12.rst:1394 msgid ":class:`!asyncio.MultiLoopChildWatcher`" msgstr ":class:`!asyncio.MultiLoopChildWatcher`" -#: ../../whatsnew/3.12.rst:1392 +#: ../../whatsnew/3.12.rst:1395 msgid ":class:`!asyncio.FastChildWatcher`" msgstr ":class:`!asyncio.FastChildWatcher`" -#: ../../whatsnew/3.12.rst:1393 +#: ../../whatsnew/3.12.rst:1396 msgid ":class:`!asyncio.AbstractChildWatcher`" msgstr ":class:`!asyncio.AbstractChildWatcher`" -#: ../../whatsnew/3.12.rst:1394 +#: ../../whatsnew/3.12.rst:1397 msgid ":class:`!asyncio.SafeChildWatcher`" msgstr ":class:`!asyncio.SafeChildWatcher`" -#: ../../whatsnew/3.12.rst:1395 +#: ../../whatsnew/3.12.rst:1398 msgid ":func:`!asyncio.set_child_watcher`" msgstr ":func:`!asyncio.set_child_watcher`" -#: ../../whatsnew/3.12.rst:1396 +#: ../../whatsnew/3.12.rst:1399 msgid ":func:`!asyncio.get_child_watcher`," msgstr ":func:`!asyncio.get_child_watcher`、" -#: ../../whatsnew/3.12.rst:1397 +#: ../../whatsnew/3.12.rst:1400 msgid ":meth:`!asyncio.AbstractEventLoopPolicy.set_child_watcher`" msgstr ":meth:`!asyncio.AbstractEventLoopPolicy.set_child_watcher`" -#: ../../whatsnew/3.12.rst:1398 +#: ../../whatsnew/3.12.rst:1401 msgid ":meth:`!asyncio.AbstractEventLoopPolicy.get_child_watcher`" msgstr ":meth:`!asyncio.AbstractEventLoopPolicy.get_child_watcher`" -#: ../../whatsnew/3.12.rst:1400 +#: ../../whatsnew/3.12.rst:1403 msgid ":mod:`collections.abc`: :class:`!collections.abc.ByteString`." msgstr ":mod:`collections.abc`: :class:`!collections.abc.ByteString`。" -#: ../../whatsnew/3.12.rst:1402 +#: ../../whatsnew/3.12.rst:1405 msgid ":mod:`email`: the *isdst* parameter in :func:`email.utils.localtime`." msgstr "" -#: ../../whatsnew/3.12.rst:1404 +#: ../../whatsnew/3.12.rst:1407 msgid ":mod:`importlib.abc`:" msgstr ":mod:`importlib.abc`:" -#: ../../whatsnew/3.12.rst:1410 +#: ../../whatsnew/3.12.rst:1413 msgid ":mod:`itertools`: Support for copy, deepcopy, and pickle operations." msgstr "" -#: ../../whatsnew/3.12.rst:1412 +#: ../../whatsnew/3.12.rst:1415 msgid ":mod:`pkgutil`:" msgstr ":mod:`pkgutil`:" -#: ../../whatsnew/3.12.rst:1414 +#: ../../whatsnew/3.12.rst:1417 msgid ":func:`!pkgutil.find_loader`" msgstr ":func:`!pkgutil.find_loader`" -#: ../../whatsnew/3.12.rst:1415 +#: ../../whatsnew/3.12.rst:1418 msgid ":func:`!pkgutil.get_loader`." msgstr ":func:`!pkgutil.get_loader`。" -#: ../../whatsnew/3.12.rst:1417 +#: ../../whatsnew/3.12.rst:1420 msgid ":mod:`pty`:" msgstr ":mod:`pty`:" -#: ../../whatsnew/3.12.rst:1419 +#: ../../whatsnew/3.12.rst:1422 msgid ":func:`!pty.master_open`" msgstr ":func:`!pty.master_open`" -#: ../../whatsnew/3.12.rst:1420 +#: ../../whatsnew/3.12.rst:1423 msgid ":func:`!pty.slave_open`" msgstr ":func:`!pty.slave_open`" -#: ../../whatsnew/3.12.rst:1422 +#: ../../whatsnew/3.12.rst:1425 msgid ":mod:`shutil`: The *onerror* argument of :func:`shutil.rmtree`" msgstr "" -#: ../../whatsnew/3.12.rst:1424 +#: ../../whatsnew/3.12.rst:1427 msgid ":mod:`typing`: :class:`!typing.ByteString`" msgstr ":mod:`typing`::class:`!typing.ByteString`" -#: ../../whatsnew/3.12.rst:1426 +#: ../../whatsnew/3.12.rst:1429 msgid "" ":mod:`xml.etree.ElementTree`: Testing the truth value of an :class:`xml." "etree.ElementTree.Element`." msgstr "" -#: ../../whatsnew/3.12.rst:1428 +#: ../../whatsnew/3.12.rst:1431 msgid "The ``__package__`` and ``__cached__`` attributes on module objects." msgstr "" -#: ../../whatsnew/3.12.rst:1430 +#: ../../whatsnew/3.12.rst:1433 msgid "The ``co_lnotab`` attribute of code objects." msgstr "" -#: ../../whatsnew/3.12.rst:1433 ../../whatsnew/3.12.rst:2361 -msgid "Pending Removal in Future Versions" +#: ../../whatsnew/3.12.rst:1436 ../../whatsnew/3.12.rst:2357 +msgid "Pending Removal in Python 3.15" +msgstr "Python 3.15 中待決議的移除項目" + +#: ../../whatsnew/3.12.rst:1438 +msgid "" +"The following APIs have been deprecated and will be removed in Python 3.15." msgstr "" -#: ../../whatsnew/3.12.rst:1435 +#: ../../whatsnew/3.12.rst:1443 +msgid ":func:`locale.getdefaultlocale` (:gh:`90817`)" +msgstr ":func:`locale.getdefaultlocale` (:gh:`90817`)" + +#: ../../whatsnew/3.12.rst:1447 ../../whatsnew/3.12.rst:2375 +msgid "Pending Removal in Future Versions" +msgstr "未來版本中待決議的移除項目" + +#: ../../whatsnew/3.12.rst:1449 msgid "" "The following APIs were deprecated in earlier Python versions and will be " "removed, although there is currently no date scheduled for their removal." msgstr "" -#: ../../whatsnew/3.12.rst:1438 +#: ../../whatsnew/3.12.rst:1452 msgid ":mod:`array`'s ``'u'`` format code (:gh:`57281`)" msgstr "" -#: ../../whatsnew/3.12.rst:1440 +#: ../../whatsnew/3.12.rst:1454 msgid ":class:`typing.Text` (:gh:`92332`)" msgstr ":class:`typing.Text` (:gh:`92332`)" -#: ../../whatsnew/3.12.rst:1442 +#: ../../whatsnew/3.12.rst:1456 msgid "" "Currently Python accepts numeric literals immediately followed by keywords, " "for example ``0in x``, ``1or x``, ``0if 1else 2``. It allows confusing and " @@ -2101,54 +2128,54 @@ msgid "" "syntax error. (:gh:`87999`)" msgstr "" -#: ../../whatsnew/3.12.rst:1453 ../../whatsnew/3.12.rst:2393 +#: ../../whatsnew/3.12.rst:1467 ../../whatsnew/3.12.rst:2407 msgid "Removed" msgstr "已移除" -#: ../../whatsnew/3.12.rst:1456 +#: ../../whatsnew/3.12.rst:1470 msgid "asynchat and asyncore" msgstr "asynchat 和 asyncore" -#: ../../whatsnew/3.12.rst:1458 +#: ../../whatsnew/3.12.rst:1472 msgid "" "These two modules have been removed according to the schedule in :pep:`594`, " "having been deprecated in Python 3.6. Use :mod:`asyncio` instead. " "(Contributed by Nikita Sobolev in :gh:`96580`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1465 +#: ../../whatsnew/3.12.rst:1479 msgid "configparser" msgstr "configparser" -#: ../../whatsnew/3.12.rst:1467 +#: ../../whatsnew/3.12.rst:1481 msgid "" "Several names deprecated in the :mod:`configparser` way back in 3.2 have " "been removed per :gh:`89336`:" msgstr "" -#: ../../whatsnew/3.12.rst:1470 +#: ../../whatsnew/3.12.rst:1484 msgid "" ":class:`configparser.ParsingError` no longer has a ``filename`` attribute or " "argument. Use the ``source`` attribute and argument instead." msgstr "" -#: ../../whatsnew/3.12.rst:1472 +#: ../../whatsnew/3.12.rst:1486 msgid "" ":mod:`configparser` no longer has a ``SafeConfigParser`` class. Use the " "shorter :class:`~configparser.ConfigParser` name instead." msgstr "" -#: ../../whatsnew/3.12.rst:1474 +#: ../../whatsnew/3.12.rst:1488 msgid "" ":class:`configparser.ConfigParser` no longer has a ``readfp`` method. Use :" "meth:`~configparser.ConfigParser.read_file` instead." msgstr "" -#: ../../whatsnew/3.12.rst:1478 +#: ../../whatsnew/3.12.rst:1492 msgid "distutils" msgstr "distutils" -#: ../../whatsnew/3.12.rst:1480 +#: ../../whatsnew/3.12.rst:1494 msgid "" "Remove the :py:mod:`!distutils` package. It was deprecated in Python 3.10 " "by :pep:`632` \"Deprecate distutils module\". For projects still using " @@ -2157,17 +2184,17 @@ msgid "" "Victor Stinner in :gh:`92584`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1487 +#: ../../whatsnew/3.12.rst:1501 msgid "ensurepip" msgstr "ensurepip" -#: ../../whatsnew/3.12.rst:1489 +#: ../../whatsnew/3.12.rst:1503 msgid "" "Remove the bundled setuptools wheel from :mod:`ensurepip`, and stop " "installing setuptools in environments created by :mod:`venv`." msgstr "" -#: ../../whatsnew/3.12.rst:1492 +#: ../../whatsnew/3.12.rst:1506 msgid "" "``pip (>= 22.1)`` does not require setuptools to be installed in the " "environment. ``setuptools``-based (and ``distutils``-based) packages can " @@ -2175,7 +2202,7 @@ msgid "" "the build environment it uses for building a package." msgstr "" -#: ../../whatsnew/3.12.rst:1498 +#: ../../whatsnew/3.12.rst:1512 msgid "" "``easy_install``, ``pkg_resources``, ``setuptools`` and ``distutils`` are no " "longer provided by default in environments created with ``venv`` or " @@ -2185,35 +2212,35 @@ msgid "" "(typically, using pip)." msgstr "" -#: ../../whatsnew/3.12.rst:1505 +#: ../../whatsnew/3.12.rst:1519 msgid "(Contributed by Pradyun Gedam in :gh:`95299`.)" msgstr "(由 Pradyun Gedam 於 :gh:`95299` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1508 +#: ../../whatsnew/3.12.rst:1522 msgid "enum" msgstr "enum" -#: ../../whatsnew/3.12.rst:1510 +#: ../../whatsnew/3.12.rst:1524 msgid "" "Remove :mod:`enum`'s ``EnumMeta.__getattr__``, which is no longer needed for " "enum attribute access. (Contributed by Ethan Furman in :gh:`95083`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1515 +#: ../../whatsnew/3.12.rst:1529 msgid "ftplib" msgstr "ftplib" -#: ../../whatsnew/3.12.rst:1517 +#: ../../whatsnew/3.12.rst:1531 msgid "" "Remove :mod:`ftplib`'s ``FTP_TLS.ssl_version`` class attribute: use the " "*context* parameter instead. (Contributed by Victor Stinner in :gh:`94172`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1522 +#: ../../whatsnew/3.12.rst:1536 msgid "gzip" msgstr "gzip" -#: ../../whatsnew/3.12.rst:1524 +#: ../../whatsnew/3.12.rst:1538 msgid "" "Remove the ``filename`` attribute of :mod:`gzip`'s :class:`gzip.GzipFile`, " "deprecated since Python 2.6, use the :attr:`~gzip.GzipFile.name` attribute " @@ -2222,11 +2249,11 @@ msgid "" "`94196`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1531 +#: ../../whatsnew/3.12.rst:1545 msgid "hashlib" msgstr "hashlib" -#: ../../whatsnew/3.12.rst:1533 +#: ../../whatsnew/3.12.rst:1547 msgid "" "Remove the pure Python implementation of :mod:`hashlib`'s :func:`hashlib." "pbkdf2_hmac()`, deprecated in Python 3.10. Python 3.10 and newer requires " @@ -2235,191 +2262,191 @@ msgid "" "Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1540 ../../whatsnew/3.12.rst:1567 +#: ../../whatsnew/3.12.rst:1554 ../../whatsnew/3.12.rst:1581 msgid "importlib" msgstr "importlib" -#: ../../whatsnew/3.12.rst:1542 +#: ../../whatsnew/3.12.rst:1556 msgid "" "Many previously deprecated cleanups in :mod:`importlib` have now been " "completed:" msgstr "" -#: ../../whatsnew/3.12.rst:1545 +#: ../../whatsnew/3.12.rst:1559 msgid "" "References to, and support for :meth:`!module_repr()` has been removed. " "(Contributed by Barry Warsaw in :gh:`97850`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1548 +#: ../../whatsnew/3.12.rst:1562 msgid "" "``importlib.util.set_package``, ``importlib.util.set_loader`` and " "``importlib.util.module_for_loader`` have all been removed. (Contributed by " "Brett Cannon and Nikita Sobolev in :gh:`65961` and :gh:`97850`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1552 +#: ../../whatsnew/3.12.rst:1566 msgid "" "Support for ``find_loader()`` and ``find_module()`` APIs have been removed. " "(Contributed by Barry Warsaw in :gh:`98040`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1555 +#: ../../whatsnew/3.12.rst:1569 msgid "" "``importlib.abc.Finder``, ``pkgutil.ImpImporter``, and ``pkgutil.ImpLoader`` " "have been removed. (Contributed by Barry Warsaw in :gh:`98040`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1559 ../../whatsnew/3.12.rst:1567 +#: ../../whatsnew/3.12.rst:1573 ../../whatsnew/3.12.rst:1581 msgid "imp" msgstr "imp" -#: ../../whatsnew/3.12.rst:1561 +#: ../../whatsnew/3.12.rst:1575 msgid "" "The :mod:`!imp` module has been removed. (Contributed by Barry Warsaw in :" "gh:`98040`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1564 +#: ../../whatsnew/3.12.rst:1578 msgid "To migrate, consult the following correspondence table:" msgstr "" -#: ../../whatsnew/3.12.rst:1569 +#: ../../whatsnew/3.12.rst:1583 msgid "``imp.NullImporter``" msgstr "``imp.NullImporter``" -#: ../../whatsnew/3.12.rst:1569 +#: ../../whatsnew/3.12.rst:1583 msgid "Insert ``None`` into ``sys.path_importer_cache``" -msgstr "" +msgstr "將 ``None`` 插入 ``sys.path_importer_cache``" -#: ../../whatsnew/3.12.rst:1570 +#: ../../whatsnew/3.12.rst:1584 msgid "``imp.cache_from_source()``" msgstr "``imp.cache_from_source()``" -#: ../../whatsnew/3.12.rst:1570 +#: ../../whatsnew/3.12.rst:1584 msgid ":func:`importlib.util.cache_from_source`" msgstr ":func:`importlib.util.cache_from_source`" -#: ../../whatsnew/3.12.rst:1571 +#: ../../whatsnew/3.12.rst:1585 msgid "``imp.find_module()``" msgstr "``imp.find_module()``" -#: ../../whatsnew/3.12.rst:1571 +#: ../../whatsnew/3.12.rst:1585 msgid ":func:`importlib.util.find_spec`" msgstr ":func:`importlib.util.find_spec`" -#: ../../whatsnew/3.12.rst:1572 +#: ../../whatsnew/3.12.rst:1586 msgid "``imp.get_magic()``" msgstr "``imp.get_magic()``" -#: ../../whatsnew/3.12.rst:1572 +#: ../../whatsnew/3.12.rst:1586 msgid ":attr:`importlib.util.MAGIC_NUMBER`" msgstr ":attr:`importlib.util.MAGIC_NUMBER`" -#: ../../whatsnew/3.12.rst:1573 +#: ../../whatsnew/3.12.rst:1587 msgid "``imp.get_suffixes()``" msgstr "``imp.get_suffixes()``" -#: ../../whatsnew/3.12.rst:1573 +#: ../../whatsnew/3.12.rst:1587 msgid "" ":attr:`importlib.machinery.SOURCE_SUFFIXES`, :attr:`importlib.machinery." "EXTENSION_SUFFIXES`, and :attr:`importlib.machinery.BYTECODE_SUFFIXES`" msgstr "" -#: ../../whatsnew/3.12.rst:1574 +#: ../../whatsnew/3.12.rst:1588 msgid "``imp.get_tag()``" msgstr "``imp.get_tag()``" -#: ../../whatsnew/3.12.rst:1574 +#: ../../whatsnew/3.12.rst:1588 msgid ":attr:`sys.implementation.cache_tag `" msgstr ":attr:`sys.implementation.cache_tag `" -#: ../../whatsnew/3.12.rst:1575 +#: ../../whatsnew/3.12.rst:1589 msgid "``imp.load_module()``" msgstr "``imp.load_module()``" -#: ../../whatsnew/3.12.rst:1575 +#: ../../whatsnew/3.12.rst:1589 msgid ":func:`importlib.import_module`" msgstr ":func:`importlib.import_module`" -#: ../../whatsnew/3.12.rst:1576 +#: ../../whatsnew/3.12.rst:1590 msgid "``imp.new_module(name)``" msgstr "``imp.new_module(name)``" -#: ../../whatsnew/3.12.rst:1576 +#: ../../whatsnew/3.12.rst:1590 msgid "``types.ModuleType(name)``" msgstr "``types.ModuleType(name)``" -#: ../../whatsnew/3.12.rst:1577 +#: ../../whatsnew/3.12.rst:1591 msgid "``imp.reload()``" msgstr "``imp.reload()``" -#: ../../whatsnew/3.12.rst:1577 +#: ../../whatsnew/3.12.rst:1591 msgid ":func:`importlib.reload`" msgstr ":func:`importlib.reload`" -#: ../../whatsnew/3.12.rst:1578 +#: ../../whatsnew/3.12.rst:1592 msgid "``imp.source_from_cache()``" msgstr "``imp.source_from_cache()``" -#: ../../whatsnew/3.12.rst:1578 +#: ../../whatsnew/3.12.rst:1592 msgid ":func:`importlib.util.source_from_cache`" msgstr ":func:`importlib.util.source_from_cache`" -#: ../../whatsnew/3.12.rst:1579 +#: ../../whatsnew/3.12.rst:1593 msgid "``imp.load_source()``" msgstr "``imp.load_source()``" -#: ../../whatsnew/3.12.rst:1579 +#: ../../whatsnew/3.12.rst:1593 msgid "*See below*" msgstr "" -#: ../../whatsnew/3.12.rst:1582 +#: ../../whatsnew/3.12.rst:1596 msgid "Replace ``imp.load_source()`` with::" msgstr "" -#: ../../whatsnew/3.12.rst:1597 +#: ../../whatsnew/3.12.rst:1611 msgid "Remove :mod:`!imp` functions and attributes with no replacements:" msgstr "" -#: ../../whatsnew/3.12.rst:1599 +#: ../../whatsnew/3.12.rst:1613 msgid "Undocumented functions:" -msgstr "" +msgstr "未以文件記錄的函式:" -#: ../../whatsnew/3.12.rst:1601 +#: ../../whatsnew/3.12.rst:1615 msgid "``imp.init_builtin()``" msgstr "``imp.init_builtin()``" -#: ../../whatsnew/3.12.rst:1602 +#: ../../whatsnew/3.12.rst:1616 msgid "``imp.load_compiled()``" msgstr "``imp.load_compiled()``" -#: ../../whatsnew/3.12.rst:1603 +#: ../../whatsnew/3.12.rst:1617 msgid "``imp.load_dynamic()``" msgstr "``imp.load_dynamic()``" -#: ../../whatsnew/3.12.rst:1604 +#: ../../whatsnew/3.12.rst:1618 msgid "``imp.load_package()``" msgstr "``imp.load_package()``" -#: ../../whatsnew/3.12.rst:1606 +#: ../../whatsnew/3.12.rst:1620 msgid "" "``imp.lock_held()``, ``imp.acquire_lock()``, ``imp.release_lock()``: the " "locking scheme has changed in Python 3.3 to per-module locks." msgstr "" -#: ../../whatsnew/3.12.rst:1608 +#: ../../whatsnew/3.12.rst:1622 msgid "" "``imp.find_module()`` constants: ``SEARCH_ERROR``, ``PY_SOURCE``, " "``PY_COMPILED``, ``C_EXTENSION``, ``PY_RESOURCE``, ``PKG_DIRECTORY``, " "``C_BUILTIN``, ``PY_FROZEN``, ``PY_CODERESOURCE``, ``IMP_HOOK``." msgstr "" -#: ../../whatsnew/3.12.rst:1613 +#: ../../whatsnew/3.12.rst:1627 msgid "io" msgstr "io" -#: ../../whatsnew/3.12.rst:1615 +#: ../../whatsnew/3.12.rst:1629 msgid "" "Remove :mod:`io`'s ``io.OpenWrapper`` and ``_pyio.OpenWrapper``, deprecated " "in Python 3.10: just use :func:`open` instead. The :func:`open` (:func:`io." @@ -2428,18 +2455,18 @@ msgid "" "`94169`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1622 +#: ../../whatsnew/3.12.rst:1636 msgid "locale" msgstr "locale" -#: ../../whatsnew/3.12.rst:1624 +#: ../../whatsnew/3.12.rst:1638 msgid "" "Remove :mod:`locale`'s :func:`!locale.format` function, deprecated in Python " "3.7: use :func:`locale.format_string` instead. (Contributed by Victor " "Stinner in :gh:`94226`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1628 +#: ../../whatsnew/3.12.rst:1642 msgid "" "``smtpd``: The module has been removed according to the schedule in :pep:" "`594`, having been deprecated in Python 3.4.7 and 3.5.4. Use aiosmtpd_ PyPI " @@ -2447,27 +2474,27 @@ msgid "" "Oleg Iarygin in :gh:`93243`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1639 +#: ../../whatsnew/3.12.rst:1653 msgid "" "The following undocumented :mod:`sqlite3` features, deprecated in Python " "3.10, are now removed:" msgstr "" -#: ../../whatsnew/3.12.rst:1642 +#: ../../whatsnew/3.12.rst:1656 msgid "``sqlite3.enable_shared_cache()``" msgstr "``sqlite3.enable_shared_cache()``" -#: ../../whatsnew/3.12.rst:1643 +#: ../../whatsnew/3.12.rst:1657 msgid "``sqlite3.OptimizedUnicode``" msgstr "``sqlite3.OptimizedUnicode``" -#: ../../whatsnew/3.12.rst:1645 +#: ../../whatsnew/3.12.rst:1659 msgid "" "If a shared cache must be used, open the database in URI mode using the " "``cache=shared`` query parameter." msgstr "" -#: ../../whatsnew/3.12.rst:1648 +#: ../../whatsnew/3.12.rst:1662 msgid "" "The ``sqlite3.OptimizedUnicode`` text factory has been an alias for :class:" "`str` since Python 3.3. Code that previously set the text factory to " @@ -2475,22 +2502,22 @@ msgid "" "default value which is also ``str``." msgstr "" -#: ../../whatsnew/3.12.rst:1653 +#: ../../whatsnew/3.12.rst:1667 msgid "(Contributed by Erlend E. Aasland in :gh:`92548`.)" msgstr "(由 Erlend E. Aasland 於 :gh:`92548` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1656 +#: ../../whatsnew/3.12.rst:1670 msgid "ssl" msgstr "ssl" -#: ../../whatsnew/3.12.rst:1658 +#: ../../whatsnew/3.12.rst:1672 msgid "" "Remove :mod:`ssl`'s :func:`!ssl.RAND_pseudo_bytes` function, deprecated in " "Python 3.6: use :func:`os.urandom` or :func:`ssl.RAND_bytes` instead. " "(Contributed by Victor Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1662 +#: ../../whatsnew/3.12.rst:1676 msgid "" "Remove the :func:`!ssl.match_hostname` function. It was deprecated in Python " "3.7. OpenSSL performs hostname matching since Python 3.7, Python no longer " @@ -2498,7 +2525,7 @@ msgid "" "Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1668 +#: ../../whatsnew/3.12.rst:1682 msgid "" "Remove the :func:`!ssl.wrap_socket` function, deprecated in Python 3.7: " "instead, create a :class:`ssl.SSLContext` object and call its :class:`ssl." @@ -2509,189 +2536,189 @@ msgid "" "Validation. (Contributed by Victor Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1680 +#: ../../whatsnew/3.12.rst:1694 msgid "Remove many long-deprecated :mod:`unittest` features:" msgstr "" -#: ../../whatsnew/3.12.rst:1684 +#: ../../whatsnew/3.12.rst:1698 msgid "A number of :class:`~unittest.TestCase` method aliases:" msgstr "" -#: ../../whatsnew/3.12.rst:1687 +#: ../../whatsnew/3.12.rst:1701 msgid "Deprecated alias" msgstr "已棄用的別名" -#: ../../whatsnew/3.12.rst:1687 +#: ../../whatsnew/3.12.rst:1701 msgid "Method Name" msgstr "方法名稱" -#: ../../whatsnew/3.12.rst:1687 +#: ../../whatsnew/3.12.rst:1701 msgid "Deprecated in" msgstr "" -#: ../../whatsnew/3.12.rst:1689 +#: ../../whatsnew/3.12.rst:1703 msgid "``failUnless``" msgstr "``failUnless``" -#: ../../whatsnew/3.12.rst:1689 ../../whatsnew/3.12.rst:1696 +#: ../../whatsnew/3.12.rst:1703 ../../whatsnew/3.12.rst:1710 msgid ":meth:`.assertTrue`" msgstr ":meth:`.assertTrue`" -#: ../../whatsnew/3.12.rst:1689 ../../whatsnew/3.12.rst:1690 -#: ../../whatsnew/3.12.rst:1691 ../../whatsnew/3.12.rst:1692 -#: ../../whatsnew/3.12.rst:1693 ../../whatsnew/3.12.rst:1694 -#: ../../whatsnew/3.12.rst:1695 +#: ../../whatsnew/3.12.rst:1703 ../../whatsnew/3.12.rst:1704 +#: ../../whatsnew/3.12.rst:1705 ../../whatsnew/3.12.rst:1706 +#: ../../whatsnew/3.12.rst:1707 ../../whatsnew/3.12.rst:1708 +#: ../../whatsnew/3.12.rst:1709 msgid "3.1" msgstr "3.1" -#: ../../whatsnew/3.12.rst:1690 +#: ../../whatsnew/3.12.rst:1704 msgid "``failIf``" msgstr "``failIf``" -#: ../../whatsnew/3.12.rst:1690 +#: ../../whatsnew/3.12.rst:1704 msgid ":meth:`.assertFalse`" msgstr ":meth:`.assertFalse`" -#: ../../whatsnew/3.12.rst:1691 +#: ../../whatsnew/3.12.rst:1705 msgid "``failUnlessEqual``" msgstr "``failUnlessEqual``" -#: ../../whatsnew/3.12.rst:1691 ../../whatsnew/3.12.rst:1697 +#: ../../whatsnew/3.12.rst:1705 ../../whatsnew/3.12.rst:1711 msgid ":meth:`.assertEqual`" msgstr ":meth:`.assertEqual`" -#: ../../whatsnew/3.12.rst:1692 +#: ../../whatsnew/3.12.rst:1706 msgid "``failIfEqual``" msgstr "``failIfEqual``" -#: ../../whatsnew/3.12.rst:1692 ../../whatsnew/3.12.rst:1698 +#: ../../whatsnew/3.12.rst:1706 ../../whatsnew/3.12.rst:1712 msgid ":meth:`.assertNotEqual`" msgstr ":meth:`.assertNotEqual`" -#: ../../whatsnew/3.12.rst:1693 +#: ../../whatsnew/3.12.rst:1707 msgid "``failUnlessAlmostEqual``" msgstr "``failUnlessAlmostEqual``" -#: ../../whatsnew/3.12.rst:1693 ../../whatsnew/3.12.rst:1699 +#: ../../whatsnew/3.12.rst:1707 ../../whatsnew/3.12.rst:1713 msgid ":meth:`.assertAlmostEqual`" msgstr ":meth:`.assertAlmostEqual`" -#: ../../whatsnew/3.12.rst:1694 +#: ../../whatsnew/3.12.rst:1708 msgid "``failIfAlmostEqual``" msgstr "``failIfAlmostEqual``" -#: ../../whatsnew/3.12.rst:1694 ../../whatsnew/3.12.rst:1700 +#: ../../whatsnew/3.12.rst:1708 ../../whatsnew/3.12.rst:1714 msgid ":meth:`.assertNotAlmostEqual`" msgstr ":meth:`.assertNotAlmostEqual`" -#: ../../whatsnew/3.12.rst:1695 +#: ../../whatsnew/3.12.rst:1709 msgid "``failUnlessRaises``" msgstr "``failUnlessRaises``" -#: ../../whatsnew/3.12.rst:1695 +#: ../../whatsnew/3.12.rst:1709 msgid ":meth:`.assertRaises`" msgstr ":meth:`.assertRaises`" -#: ../../whatsnew/3.12.rst:1696 +#: ../../whatsnew/3.12.rst:1710 msgid "``assert_``" msgstr "``assert_``" -#: ../../whatsnew/3.12.rst:1696 ../../whatsnew/3.12.rst:1697 -#: ../../whatsnew/3.12.rst:1698 ../../whatsnew/3.12.rst:1699 -#: ../../whatsnew/3.12.rst:1700 ../../whatsnew/3.12.rst:1701 -#: ../../whatsnew/3.12.rst:1702 +#: ../../whatsnew/3.12.rst:1710 ../../whatsnew/3.12.rst:1711 +#: ../../whatsnew/3.12.rst:1712 ../../whatsnew/3.12.rst:1713 +#: ../../whatsnew/3.12.rst:1714 ../../whatsnew/3.12.rst:1715 +#: ../../whatsnew/3.12.rst:1716 msgid "3.2" msgstr "3.2" -#: ../../whatsnew/3.12.rst:1697 +#: ../../whatsnew/3.12.rst:1711 msgid "``assertEquals``" msgstr "``assertEquals``" -#: ../../whatsnew/3.12.rst:1698 +#: ../../whatsnew/3.12.rst:1712 msgid "``assertNotEquals``" msgstr "``assertNotEquals``" -#: ../../whatsnew/3.12.rst:1699 +#: ../../whatsnew/3.12.rst:1713 msgid "``assertAlmostEquals``" msgstr "``assertAlmostEquals``" -#: ../../whatsnew/3.12.rst:1700 +#: ../../whatsnew/3.12.rst:1714 msgid "``assertNotAlmostEquals``" msgstr "``assertNotAlmostEquals``" -#: ../../whatsnew/3.12.rst:1701 +#: ../../whatsnew/3.12.rst:1715 msgid "``assertRegexpMatches``" msgstr "``assertRegexpMatches``" -#: ../../whatsnew/3.12.rst:1701 +#: ../../whatsnew/3.12.rst:1715 msgid ":meth:`.assertRegex`" msgstr ":meth:`.assertRegex`" -#: ../../whatsnew/3.12.rst:1702 +#: ../../whatsnew/3.12.rst:1716 msgid "``assertRaisesRegexp``" msgstr "``assertRaisesRegexp``" -#: ../../whatsnew/3.12.rst:1702 +#: ../../whatsnew/3.12.rst:1716 msgid ":meth:`.assertRaisesRegex`" msgstr ":meth:`.assertRaisesRegex`" -#: ../../whatsnew/3.12.rst:1703 +#: ../../whatsnew/3.12.rst:1717 msgid "``assertNotRegexpMatches``" msgstr "``assertNotRegexpMatches``" -#: ../../whatsnew/3.12.rst:1703 +#: ../../whatsnew/3.12.rst:1717 msgid ":meth:`.assertNotRegex`" msgstr ":meth:`.assertNotRegex`" -#: ../../whatsnew/3.12.rst:1703 +#: ../../whatsnew/3.12.rst:1717 msgid "3.5" msgstr "3.5" -#: ../../whatsnew/3.12.rst:1706 +#: ../../whatsnew/3.12.rst:1720 msgid "" "You can use https://github.com/isidentical/teyit to automatically modernise " "your unit tests." msgstr "" -#: ../../whatsnew/3.12.rst:1709 +#: ../../whatsnew/3.12.rst:1723 msgid "" "Undocumented and broken :class:`~unittest.TestCase` method " "``assertDictContainsSubset`` (deprecated in Python 3.2)." msgstr "" -#: ../../whatsnew/3.12.rst:1712 +#: ../../whatsnew/3.12.rst:1726 msgid "" "Undocumented :meth:`TestLoader.loadTestsFromModule ` parameter *use_load_tests* (deprecated and ignored " "since Python 3.2)." msgstr "" -#: ../../whatsnew/3.12.rst:1716 +#: ../../whatsnew/3.12.rst:1730 msgid "" "An alias of the :class:`~unittest.TextTestResult` class: ``_TextTestResult`` " "(deprecated in Python 3.2)." msgstr "" -#: ../../whatsnew/3.12.rst:1719 +#: ../../whatsnew/3.12.rst:1733 msgid "(Contributed by Serhiy Storchaka in :gh:`89325`.)" msgstr "(由 Serhiy Storchaka 於 :gh:`89325` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1722 +#: ../../whatsnew/3.12.rst:1736 msgid "webbrowser" msgstr "webbrowser" -#: ../../whatsnew/3.12.rst:1724 +#: ../../whatsnew/3.12.rst:1738 msgid "" "Remove support for obsolete browsers from :mod:`webbrowser`. The removed " "browsers include: Grail, Mosaic, Netscape, Galeon, Skipstone, Iceape, " "Firebird, and Firefox versions 35 and below (:gh:`102871`)." msgstr "" -#: ../../whatsnew/3.12.rst:1729 +#: ../../whatsnew/3.12.rst:1743 msgid "xml.etree.ElementTree" msgstr "xml.etree.ElementTree" -#: ../../whatsnew/3.12.rst:1731 +#: ../../whatsnew/3.12.rst:1745 msgid "" "Remove the ``ElementTree.Element.copy()`` method of the pure Python " "implementation, deprecated in Python 3.10, use the :func:`copy.copy` " @@ -2700,22 +2727,22 @@ msgid "" "Stinner in :gh:`94383`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1738 +#: ../../whatsnew/3.12.rst:1752 msgid "zipimport" msgstr "zipimport" -#: ../../whatsnew/3.12.rst:1740 +#: ../../whatsnew/3.12.rst:1754 msgid "" "Remove :mod:`zipimport`'s ``find_loader()`` and ``find_module()`` methods, " "deprecated in Python 3.10: use the ``find_spec()`` method instead. See :pep:" "`451` for the rationale. (Contributed by Victor Stinner in :gh:`94379`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1746 +#: ../../whatsnew/3.12.rst:1760 msgid "Others" msgstr "其他" -#: ../../whatsnew/3.12.rst:1748 +#: ../../whatsnew/3.12.rst:1762 msgid "" "Remove the ``suspicious`` rule from the documentation :file:`Makefile` and :" "file:`Doc/tools/rstlint.py`, both in favor of `sphinx-lint `, " "intended for low-level tools like debuggers and JIT compilers. This API may " @@ -2960,84 +2987,84 @@ msgid "" "contents are marked by the ``PyUnstable_`` prefix in names." msgstr "" -#: ../../whatsnew/3.12.rst:1927 +#: ../../whatsnew/3.12.rst:1941 msgid "Code object constructors:" msgstr "" -#: ../../whatsnew/3.12.rst:1929 +#: ../../whatsnew/3.12.rst:1943 msgid "``PyUnstable_Code_New()`` (renamed from ``PyCode_New``)" msgstr "" -#: ../../whatsnew/3.12.rst:1930 +#: ../../whatsnew/3.12.rst:1944 msgid "" "``PyUnstable_Code_NewWithPosOnlyArgs()`` (renamed from " "``PyCode_NewWithPosOnlyArgs``)" msgstr "" -#: ../../whatsnew/3.12.rst:1932 +#: ../../whatsnew/3.12.rst:1946 msgid "Extra storage for code objects (:pep:`523`):" msgstr "" -#: ../../whatsnew/3.12.rst:1934 +#: ../../whatsnew/3.12.rst:1948 msgid "" "``PyUnstable_Eval_RequestCodeExtraIndex()`` (renamed from " "``_PyEval_RequestCodeExtraIndex``)" msgstr "" -#: ../../whatsnew/3.12.rst:1935 +#: ../../whatsnew/3.12.rst:1949 msgid "``PyUnstable_Code_GetExtra()`` (renamed from ``_PyCode_GetExtra``)" msgstr "" -#: ../../whatsnew/3.12.rst:1936 +#: ../../whatsnew/3.12.rst:1950 msgid "``PyUnstable_Code_SetExtra()`` (renamed from ``_PyCode_SetExtra``)" msgstr "" -#: ../../whatsnew/3.12.rst:1938 +#: ../../whatsnew/3.12.rst:1952 msgid "" "The original names will continue to be available until the respective API " "changes." msgstr "" -#: ../../whatsnew/3.12.rst:1941 +#: ../../whatsnew/3.12.rst:1955 msgid "(Contributed by Petr Viktorin in :gh:`101101`.)" msgstr "(由 Petr Viktorin 於 :gh:`101101` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1943 +#: ../../whatsnew/3.12.rst:1957 msgid "" ":pep:`697`: Add an API for extending types whose instance memory layout is " "opaque:" msgstr "" -#: ../../whatsnew/3.12.rst:1946 +#: ../../whatsnew/3.12.rst:1960 msgid "" ":c:member:`PyType_Spec.basicsize` can be zero or negative to specify " "inheriting or extending the base class size." msgstr "" -#: ../../whatsnew/3.12.rst:1948 +#: ../../whatsnew/3.12.rst:1962 msgid "" ":c:func:`PyObject_GetTypeData` and :c:func:`PyType_GetTypeDataSize` added to " "allow access to subclass-specific instance data." msgstr "" -#: ../../whatsnew/3.12.rst:1950 +#: ../../whatsnew/3.12.rst:1964 msgid "" ":c:macro:`Py_TPFLAGS_ITEMS_AT_END` and :c:func:`PyObject_GetItemData` added " "to allow safely extending certain variable-sized types, including :c:var:" "`PyType_Type`." msgstr "" -#: ../../whatsnew/3.12.rst:1953 +#: ../../whatsnew/3.12.rst:1967 msgid "" ":c:macro:`Py_RELATIVE_OFFSET` added to allow defining :c:type:`members " "` in terms of a subclass-specific struct." msgstr "" -#: ../../whatsnew/3.12.rst:1956 +#: ../../whatsnew/3.12.rst:1970 msgid "(Contributed by Petr Viktorin in :gh:`103509`.)" msgstr "(由 Petr Viktorin 於 :gh:`103509` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1958 +#: ../../whatsnew/3.12.rst:1972 msgid "" "Add the new :ref:`limited C API ` function :c:func:" "`PyType_FromMetaclass`, which generalizes the existing :c:func:" @@ -3045,29 +3072,29 @@ msgid "" "(Contributed by Wenzel Jakob in :gh:`93012`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1963 +#: ../../whatsnew/3.12.rst:1977 msgid "" "API for creating objects that can be called using :ref:`the vectorcall " "protocol ` was added to the :ref:`Limited API `:" msgstr "" -#: ../../whatsnew/3.12.rst:1967 +#: ../../whatsnew/3.12.rst:1981 msgid ":c:macro:`Py_TPFLAGS_HAVE_VECTORCALL`" -msgstr "" +msgstr ":c:macro:`Py_TPFLAGS_HAVE_VECTORCALL`" -#: ../../whatsnew/3.12.rst:1968 +#: ../../whatsnew/3.12.rst:1982 msgid ":c:func:`PyVectorcall_NARGS`" msgstr ":c:func:`PyVectorcall_NARGS`" -#: ../../whatsnew/3.12.rst:1969 +#: ../../whatsnew/3.12.rst:1983 msgid ":c:func:`PyVectorcall_Call`" msgstr ":c:func:`PyVectorcall_Call`" -#: ../../whatsnew/3.12.rst:1970 +#: ../../whatsnew/3.12.rst:1984 msgid ":c:type:`vectorcallfunc`" msgstr ":c:type:`vectorcallfunc`" -#: ../../whatsnew/3.12.rst:1972 +#: ../../whatsnew/3.12.rst:1986 msgid "" "The :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` flag is now removed from a class " "when the class's :py:meth:`~object.__call__` method is reassigned. This " @@ -3078,7 +3105,7 @@ msgid "" "`93274`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1980 +#: ../../whatsnew/3.12.rst:1994 msgid "" "The :c:macro:`Py_TPFLAGS_MANAGED_DICT` and :c:macro:" "`Py_TPFLAGS_MANAGED_WEAKREF` flags have been added. This allows extensions " @@ -3086,32 +3113,32 @@ msgid "" "using less memory and with faster access." msgstr "" -#: ../../whatsnew/3.12.rst:1985 +#: ../../whatsnew/3.12.rst:1999 msgid "" "API for performing calls using :ref:`the vectorcall protocol ` " "was added to the :ref:`Limited API `:" msgstr "" -#: ../../whatsnew/3.12.rst:1989 +#: ../../whatsnew/3.12.rst:2003 msgid ":c:func:`PyObject_Vectorcall`" msgstr ":c:func:`PyObject_Vectorcall`" -#: ../../whatsnew/3.12.rst:1990 +#: ../../whatsnew/3.12.rst:2004 msgid ":c:func:`PyObject_VectorcallMethod`" msgstr ":c:func:`PyObject_VectorcallMethod`" -#: ../../whatsnew/3.12.rst:1991 +#: ../../whatsnew/3.12.rst:2005 msgid ":c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET`" msgstr ":c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET`" -#: ../../whatsnew/3.12.rst:1993 +#: ../../whatsnew/3.12.rst:2007 msgid "" "This means that both the incoming and outgoing ends of the vector call " "protocol are now available in the :ref:`Limited API `. (Contributed " "by Wenzel Jakob in :gh:`98586`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1997 +#: ../../whatsnew/3.12.rst:2011 msgid "" "Add two new public functions, :c:func:`PyEval_SetProfileAllThreads` and :c:" "func:`PyEval_SetTraceAllThreads`, that allow to set tracing and profiling " @@ -3119,14 +3146,14 @@ msgid "" "(Contributed by Pablo Galindo in :gh:`93503`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2003 +#: ../../whatsnew/3.12.rst:2017 msgid "" "Add new function :c:func:`PyFunction_SetVectorcall` to the C API which sets " "the vectorcall field of a given :c:type:`PyFunctionObject`. (Contributed by " "Andrew Frost in :gh:`92257`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2007 +#: ../../whatsnew/3.12.rst:2021 msgid "" "The C API now permits registering callbacks via :c:func:" "`PyDict_AddWatcher`, :c:func:`PyDict_Watch` and related APIs to be called " @@ -3135,28 +3162,28 @@ msgid "" "`91052`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2013 +#: ../../whatsnew/3.12.rst:2027 msgid "" "Add :c:func:`PyType_AddWatcher` and :c:func:`PyType_Watch` API to register " "callbacks to receive notification on changes to a type. (Contributed by Carl " "Meyer in :gh:`91051`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2017 +#: ../../whatsnew/3.12.rst:2031 msgid "" "Add :c:func:`PyCode_AddWatcher` and :c:func:`PyCode_ClearWatcher` APIs to " "register callbacks to receive notification on creation and destruction of " "code objects. (Contributed by Itamar Oren in :gh:`91054`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2022 +#: ../../whatsnew/3.12.rst:2036 msgid "" "Add :c:func:`PyFrame_GetVar` and :c:func:`PyFrame_GetVarString` functions to " "get a frame variable by its name. (Contributed by Victor Stinner in :gh:" "`91248`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2026 +#: ../../whatsnew/3.12.rst:2040 msgid "" "Add :c:func:`PyErr_GetRaisedException` and :c:func:" "`PyErr_SetRaisedException` for saving and restoring the current exception. " @@ -3166,14 +3193,14 @@ msgid "" "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2034 +#: ../../whatsnew/3.12.rst:2048 msgid "" "Add ``_PyErr_ChainExceptions1``, which takes an exception instance, to " "replace the legacy-API ``_PyErr_ChainExceptions``, which is now deprecated. " "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2038 +#: ../../whatsnew/3.12.rst:2052 msgid "" "Add :c:func:`PyException_GetArgs` and :c:func:`PyException_SetArgs` as " "convenience functions for retrieving and modifying the :attr:`~BaseException." @@ -3181,71 +3208,71 @@ msgid "" "in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2043 +#: ../../whatsnew/3.12.rst:2057 msgid "" "Add :c:func:`PyErr_DisplayException`, which takes an exception instance, to " "replace the legacy-api :c:func:`!PyErr_Display`. (Contributed by Irit " "Katriel in :gh:`102755`)." msgstr "" -#: ../../whatsnew/3.12.rst:2049 +#: ../../whatsnew/3.12.rst:2063 msgid "" ":pep:`683`: Introduce *Immortal Objects*, which allows objects to bypass " "reference counts, and related changes to the C-API:" msgstr "" -#: ../../whatsnew/3.12.rst:2052 +#: ../../whatsnew/3.12.rst:2066 msgid "``_Py_IMMORTAL_REFCNT``: The reference count that defines an object" msgstr "" -#: ../../whatsnew/3.12.rst:2053 +#: ../../whatsnew/3.12.rst:2067 msgid "as immortal." msgstr "" -#: ../../whatsnew/3.12.rst:2054 +#: ../../whatsnew/3.12.rst:2068 msgid "" "``_Py_IsImmortal`` Checks if an object has the immortal reference count." msgstr "" -#: ../../whatsnew/3.12.rst:2055 +#: ../../whatsnew/3.12.rst:2069 msgid "``PyObject_HEAD_INIT`` This will now initialize reference count to" msgstr "" -#: ../../whatsnew/3.12.rst:2056 +#: ../../whatsnew/3.12.rst:2070 msgid "``_Py_IMMORTAL_REFCNT`` when used with ``Py_BUILD_CORE``." msgstr "" -#: ../../whatsnew/3.12.rst:2057 +#: ../../whatsnew/3.12.rst:2071 msgid "``SSTATE_INTERNED_IMMORTAL`` An identifier for interned unicode objects" msgstr "" -#: ../../whatsnew/3.12.rst:2058 +#: ../../whatsnew/3.12.rst:2072 msgid "that are immortal." msgstr "" -#: ../../whatsnew/3.12.rst:2059 +#: ../../whatsnew/3.12.rst:2073 msgid "``SSTATE_INTERNED_IMMORTAL_STATIC`` An identifier for interned unicode" msgstr "" -#: ../../whatsnew/3.12.rst:2060 +#: ../../whatsnew/3.12.rst:2074 msgid "objects that are immortal and static" msgstr "" -#: ../../whatsnew/3.12.rst:2063 +#: ../../whatsnew/3.12.rst:2077 msgid "``sys.getunicodeinternedsize`` This returns the total number of unicode" msgstr "" -#: ../../whatsnew/3.12.rst:2062 +#: ../../whatsnew/3.12.rst:2076 msgid "" "objects that have been interned. This is now needed for :file:`refleak.py` " "to correctly track reference counts and allocated blocks" msgstr "" -#: ../../whatsnew/3.12.rst:2065 +#: ../../whatsnew/3.12.rst:2079 msgid "(Contributed by Eddie Elizondo in :gh:`84436`.)" msgstr "(由 Eddie Elizondo 於 :gh:`84436` 中貢獻。)" -#: ../../whatsnew/3.12.rst:2067 +#: ../../whatsnew/3.12.rst:2081 msgid "" ":pep:`684`: Add the new :c:func:`Py_NewInterpreterFromConfig` function and :" "c:type:`PyInterpreterConfig`, which may be used to create sub-interpreters " @@ -3253,27 +3280,27 @@ msgid "" "(Contributed by Eric Snow in :gh:`104110`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2073 +#: ../../whatsnew/3.12.rst:2087 msgid "" "In the limited C API version 3.12, :c:func:`Py_INCREF` and :c:func:" "`Py_DECREF` functions are now implemented as opaque function calls to hide " "implementation details. (Contributed by Victor Stinner in :gh:`105387`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2081 +#: ../../whatsnew/3.12.rst:2095 msgid "" "Legacy Unicode APIs based on ``Py_UNICODE*`` representation has been " "removed. Please migrate to APIs based on UTF-8 or ``wchar_t*``." msgstr "" -#: ../../whatsnew/3.12.rst:2084 +#: ../../whatsnew/3.12.rst:2098 msgid "" "Argument parsing functions like :c:func:`PyArg_ParseTuple` doesn't support " "``Py_UNICODE*`` based format (e.g. ``u``, ``Z``) anymore. Please migrate to " "other formats for Unicode like ``s``, ``z``, ``es``, and ``U``." msgstr "" -#: ../../whatsnew/3.12.rst:2088 +#: ../../whatsnew/3.12.rst:2102 msgid "" "``tp_weaklist`` for all static builtin types is always ``NULL``. This is an " "internal-only field on ``PyTypeObject`` but we're pointing out the change in " @@ -3282,7 +3309,7 @@ msgid "" "necessary, the (internal-only) ``_PyObject_GET_WEAKREFS_LISTPTR()`` macro." msgstr "" -#: ../../whatsnew/3.12.rst:2095 +#: ../../whatsnew/3.12.rst:2109 msgid "" "This internal-only :c:member:`PyTypeObject.tp_subclasses` may now not be a " "valid object pointer. Its type was changed to :c:expr:`void *` to reflect " @@ -3290,13 +3317,13 @@ msgid "" "only field directly." msgstr "" -#: ../../whatsnew/3.12.rst:2100 +#: ../../whatsnew/3.12.rst:2114 msgid "" "To get a list of subclasses, call the Python method :py:meth:`~class." "__subclasses__` (using :c:func:`PyObject_CallMethod`, for example)." msgstr "" -#: ../../whatsnew/3.12.rst:2104 +#: ../../whatsnew/3.12.rst:2118 msgid "" "Add support of more formatting options (left aligning, octals, uppercase " "hexadecimals, :c:type:`intmax_t`, :c:type:`ptrdiff_t`, :c:type:`wchar_t` C " @@ -3305,7 +3332,7 @@ msgid "" "`98836`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2110 +#: ../../whatsnew/3.12.rst:2124 msgid "" "An unrecognized format character in :c:func:`PyUnicode_FromFormat` and :c:" "func:`PyUnicode_FromFormatV` now sets a :exc:`SystemError`. In previous " @@ -3314,13 +3341,13 @@ msgid "" "Storchaka in :gh:`95781`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2116 +#: ../../whatsnew/3.12.rst:2130 msgid "" "Fix wrong sign placement in :c:func:`PyUnicode_FromFormat` and :c:func:" "`PyUnicode_FromFormatV`. (Contributed by Philip Georgi in :gh:`95504`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2120 +#: ../../whatsnew/3.12.rst:2134 msgid "" "Extension classes wanting to add a ``__dict__`` or weak reference slot " "should use :c:macro:`Py_TPFLAGS_MANAGED_DICT` and :c:macro:" @@ -3334,7 +3361,7 @@ msgid "" "func:`PyObject_ClearWeakRefs`, as before." msgstr "" -#: ../../whatsnew/3.12.rst:2132 +#: ../../whatsnew/3.12.rst:2146 msgid "" "The :c:func:`PyUnicode_FSDecoder` function no longer accepts bytes-like " "paths, like :class:`bytearray` and :class:`memoryview` types: only the " @@ -3342,7 +3369,7 @@ msgid "" "Victor Stinner in :gh:`98393`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2137 +#: ../../whatsnew/3.12.rst:2151 msgid "" "The :c:macro:`Py_CLEAR`, :c:macro:`Py_SETREF` and :c:macro:`Py_XSETREF` " "macros now only evaluate their arguments once. If an argument has side " @@ -3350,7 +3377,7 @@ msgid "" "Stinner in :gh:`98724`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2142 +#: ../../whatsnew/3.12.rst:2156 msgid "" "The interpreter's error indicator is now always normalized. This means that :" "c:func:`PyErr_SetObject`, :c:func:`PyErr_SetString` and the other functions " @@ -3358,7 +3385,7 @@ msgid "" "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2147 +#: ../../whatsnew/3.12.rst:2161 msgid "" "``_Py_RefTotal`` is no longer authoritative and only kept around for ABI " "compatibility. Note that it is an internal global and only available on " @@ -3366,25 +3393,25 @@ msgid "" "``_Py_GetGlobalRefTotal()``." msgstr "" -#: ../../whatsnew/3.12.rst:2152 +#: ../../whatsnew/3.12.rst:2166 msgid "" "The following functions now select an appropriate metaclass for the newly " "created type:" msgstr "" -#: ../../whatsnew/3.12.rst:2155 +#: ../../whatsnew/3.12.rst:2169 msgid ":c:func:`PyType_FromSpec`" msgstr ":c:func:`PyType_FromSpec`" -#: ../../whatsnew/3.12.rst:2156 +#: ../../whatsnew/3.12.rst:2170 msgid ":c:func:`PyType_FromSpecWithBases`" msgstr ":c:func:`PyType_FromSpecWithBases`" -#: ../../whatsnew/3.12.rst:2157 +#: ../../whatsnew/3.12.rst:2171 msgid ":c:func:`PyType_FromModuleAndSpec`" msgstr ":c:func:`PyType_FromModuleAndSpec`" -#: ../../whatsnew/3.12.rst:2159 +#: ../../whatsnew/3.12.rst:2173 msgid "" "Creating classes whose metaclass overrides :c:member:`~PyTypeObject.tp_new` " "is deprecated, and in Python 3.14+ it will be disallowed. Note that these " @@ -3392,14 +3419,14 @@ msgid "" "initialization." msgstr "" -#: ../../whatsnew/3.12.rst:2164 +#: ../../whatsnew/3.12.rst:2178 msgid "" "Note that :c:func:`PyType_FromMetaclass` (added in Python 3.12) already " "disallows creating classes whose metaclass overrides ``tp_new`` (:meth:" "`~object.__new__` in Python)." msgstr "" -#: ../../whatsnew/3.12.rst:2168 +#: ../../whatsnew/3.12.rst:2182 msgid "" "Since ``tp_new`` overrides almost everything ``PyType_From*`` functions do, " "the two are incompatible with each other. The existing behavior -- ignoring " @@ -3408,17 +3435,17 @@ msgid "" "general workaround. One of the following may work for you:" msgstr "" -#: ../../whatsnew/3.12.rst:2175 +#: ../../whatsnew/3.12.rst:2189 msgid "If you control the metaclass, avoid using ``tp_new`` in it:" msgstr "" -#: ../../whatsnew/3.12.rst:2177 +#: ../../whatsnew/3.12.rst:2191 msgid "" "If initialization can be skipped, it can be done in :c:member:`~PyTypeObject." "tp_init` instead." msgstr "" -#: ../../whatsnew/3.12.rst:2179 +#: ../../whatsnew/3.12.rst:2193 msgid "" "If the metaclass doesn't need to be instantiated from Python, set its " "``tp_new`` to ``NULL`` using the :c:macro:" @@ -3426,20 +3453,20 @@ msgid "" "``PyType_From*`` functions." msgstr "" -#: ../../whatsnew/3.12.rst:2184 +#: ../../whatsnew/3.12.rst:2198 msgid "" "Avoid ``PyType_From*`` functions: if you don't need C-specific features " "(slots or setting the instance size), create types by :ref:`calling ` " "the metaclass." msgstr "" -#: ../../whatsnew/3.12.rst:2188 +#: ../../whatsnew/3.12.rst:2202 msgid "" "If you *know* the ``tp_new`` can be skipped safely, filter the deprecation " "warning out using :func:`warnings.catch_warnings` from Python." msgstr "" -#: ../../whatsnew/3.12.rst:2191 +#: ../../whatsnew/3.12.rst:2205 msgid "" ":c:var:`PyOS_InputHook` and :c:var:`PyOS_ReadlineFunctionPointer` are no " "longer called in :ref:`subinterpreters `. This is " @@ -3447,14 +3474,14 @@ msgid "" "callbacks have no way of recovering extension module state)." msgstr "" -#: ../../whatsnew/3.12.rst:2196 +#: ../../whatsnew/3.12.rst:2210 msgid "" "This also avoids situations where extensions may find themselves running in " "a subinterpreter that they don't support (or haven't yet been loaded in). " "See :gh:`104668` for more info." msgstr "" -#: ../../whatsnew/3.12.rst:2200 +#: ../../whatsnew/3.12.rst:2214 msgid "" ":c:struct:`PyLongObject` has had its internals changed for better " "performance. Although the internals of :c:struct:`PyLongObject` are private, " @@ -3465,15 +3492,15 @@ msgid "" "a single machine word:" msgstr "" -#: ../../whatsnew/3.12.rst:2208 +#: ../../whatsnew/3.12.rst:2222 msgid ":c:func:`PyUnstable_Long_IsCompact`" msgstr ":c:func:`PyUnstable_Long_IsCompact`" -#: ../../whatsnew/3.12.rst:2209 +#: ../../whatsnew/3.12.rst:2223 msgid ":c:func:`PyUnstable_Long_CompactValue`" msgstr ":c:func:`PyUnstable_Long_CompactValue`" -#: ../../whatsnew/3.12.rst:2211 +#: ../../whatsnew/3.12.rst:2225 msgid "" "Custom allocators, set via :c:func:`PyMem_SetAllocator`, are now required to " "be thread-safe, regardless of memory domain. Allocators that don't have " @@ -3482,7 +3509,7 @@ msgid "" "create a new GitHub issue and CC ``@ericsnowcurrently``." msgstr "" -#: ../../whatsnew/3.12.rst:2221 +#: ../../whatsnew/3.12.rst:2235 msgid "" "In accordance with :pep:`699`, the ``ma_version_tag`` field in :c:type:" "`PyDictObject` is deprecated for extension modules. Accessing this field " @@ -3491,137 +3518,162 @@ msgid "" "PEP by Ken Jin.)" msgstr "" -#: ../../whatsnew/3.12.rst:2226 +#: ../../whatsnew/3.12.rst:2240 msgid "Deprecate global configuration variable:" msgstr "" -#: ../../whatsnew/3.12.rst:2228 ../../whatsnew/3.12.rst:2313 +#: ../../whatsnew/3.12.rst:2242 ../../whatsnew/3.12.rst:2327 msgid ":c:var:`Py_DebugFlag`: use :c:member:`PyConfig.parser_debug`" -msgstr "" +msgstr ":c:var:`Py_DebugFlag`: 請改用 :c:member:`PyConfig.parser_debug`" -#: ../../whatsnew/3.12.rst:2229 ../../whatsnew/3.12.rst:2314 +#: ../../whatsnew/3.12.rst:2243 ../../whatsnew/3.12.rst:2328 msgid ":c:var:`Py_VerboseFlag`: use :c:member:`PyConfig.verbose`" -msgstr "" +msgstr ":c:var:`Py_VerboseFlag`: 請改用 :c:member:`PyConfig.verbose`" -#: ../../whatsnew/3.12.rst:2230 ../../whatsnew/3.12.rst:2315 +#: ../../whatsnew/3.12.rst:2244 ../../whatsnew/3.12.rst:2329 msgid ":c:var:`Py_QuietFlag`: use :c:member:`PyConfig.quiet`" -msgstr "" +msgstr ":c:var:`Py_QuietFlag`: 請改用 :c:member:`PyConfig.quiet`" -#: ../../whatsnew/3.12.rst:2231 ../../whatsnew/3.12.rst:2316 +#: ../../whatsnew/3.12.rst:2245 ../../whatsnew/3.12.rst:2330 msgid ":c:var:`Py_InteractiveFlag`: use :c:member:`PyConfig.interactive`" -msgstr "" +msgstr ":c:var:`Py_InteractiveFlag`: 請改用 :c:member:`PyConfig.interactive`" -#: ../../whatsnew/3.12.rst:2232 ../../whatsnew/3.12.rst:2317 +#: ../../whatsnew/3.12.rst:2246 ../../whatsnew/3.12.rst:2331 msgid ":c:var:`Py_InspectFlag`: use :c:member:`PyConfig.inspect`" -msgstr "" +msgstr ":c:var:`Py_InspectFlag`: 請改用 :c:member:`PyConfig.inspect`" -#: ../../whatsnew/3.12.rst:2233 ../../whatsnew/3.12.rst:2318 +#: ../../whatsnew/3.12.rst:2247 ../../whatsnew/3.12.rst:2332 msgid ":c:var:`Py_OptimizeFlag`: use :c:member:`PyConfig.optimization_level`" msgstr "" +":c:var:`Py_OptimizeFlag`: 請改用 :c:member:`PyConfig.optimization_level`" -#: ../../whatsnew/3.12.rst:2234 ../../whatsnew/3.12.rst:2319 +#: ../../whatsnew/3.12.rst:2248 ../../whatsnew/3.12.rst:2333 msgid ":c:var:`Py_NoSiteFlag`: use :c:member:`PyConfig.site_import`" -msgstr "" +msgstr ":c:var:`Py_NoSiteFlag`: 請改用 :c:member:`PyConfig.site_import`" -#: ../../whatsnew/3.12.rst:2235 ../../whatsnew/3.12.rst:2320 +#: ../../whatsnew/3.12.rst:2249 ../../whatsnew/3.12.rst:2334 msgid ":c:var:`Py_BytesWarningFlag`: use :c:member:`PyConfig.bytes_warning`" msgstr "" +":c:var:`Py_BytesWarningFlag`: 請改用 :c:member:`PyConfig.bytes_warning`" -#: ../../whatsnew/3.12.rst:2236 ../../whatsnew/3.12.rst:2321 +#: ../../whatsnew/3.12.rst:2250 ../../whatsnew/3.12.rst:2335 msgid ":c:var:`Py_FrozenFlag`: use :c:member:`PyConfig.pathconfig_warnings`" msgstr "" +":c:var:`Py_FrozenFlag`: 請改用 :c:member:`PyConfig.pathconfig_warnings`" -#: ../../whatsnew/3.12.rst:2237 ../../whatsnew/3.12.rst:2322 +#: ../../whatsnew/3.12.rst:2251 ../../whatsnew/3.12.rst:2336 msgid "" ":c:var:`Py_IgnoreEnvironmentFlag`: use :c:member:`PyConfig.use_environment`" msgstr "" +":c:var:`Py_IgnoreEnvironmentFlag`: 請改用 :c:member:`PyConfig." +"use_environment`" -#: ../../whatsnew/3.12.rst:2238 ../../whatsnew/3.12.rst:2323 +#: ../../whatsnew/3.12.rst:2252 ../../whatsnew/3.12.rst:2337 msgid "" ":c:var:`Py_DontWriteBytecodeFlag`: use :c:member:`PyConfig.write_bytecode`" msgstr "" +":c:var:`Py_DontWriteBytecodeFlag`: 請改用 :c:member:`PyConfig.write_bytecode`" -#: ../../whatsnew/3.12.rst:2239 ../../whatsnew/3.12.rst:2324 +#: ../../whatsnew/3.12.rst:2253 ../../whatsnew/3.12.rst:2338 msgid "" ":c:var:`Py_NoUserSiteDirectory`: use :c:member:`PyConfig.user_site_directory`" msgstr "" +":c:var:`Py_NoUserSiteDirectory`: 請改用 :c:member:`PyConfig." +"user_site_directory`" -#: ../../whatsnew/3.12.rst:2240 ../../whatsnew/3.12.rst:2325 +#: ../../whatsnew/3.12.rst:2254 ../../whatsnew/3.12.rst:2339 msgid "" ":c:var:`Py_UnbufferedStdioFlag`: use :c:member:`PyConfig.buffered_stdio`" msgstr "" +":c:var:`Py_UnbufferedStdioFlag`: 請改用 :c:member:`PyConfig.buffered_stdio`" -#: ../../whatsnew/3.12.rst:2241 ../../whatsnew/3.12.rst:2326 +#: ../../whatsnew/3.12.rst:2255 ../../whatsnew/3.12.rst:2340 msgid "" ":c:var:`Py_HashRandomizationFlag`: use :c:member:`PyConfig.use_hash_seed` " "and :c:member:`PyConfig.hash_seed`" msgstr "" +":c:var:`Py_HashRandomizationFlag`: 請改用 :c:member:`PyConfig.use_hash_seed` " +"和 :c:member:`PyConfig.hash_seed`" -#: ../../whatsnew/3.12.rst:2243 ../../whatsnew/3.12.rst:2328 +#: ../../whatsnew/3.12.rst:2257 ../../whatsnew/3.12.rst:2342 msgid ":c:var:`Py_IsolatedFlag`: use :c:member:`PyConfig.isolated`" -msgstr "" +msgstr ":c:var:`Py_IsolatedFlag`: 請改用 :c:member:`PyConfig.isolated`" -#: ../../whatsnew/3.12.rst:2244 ../../whatsnew/3.12.rst:2329 +#: ../../whatsnew/3.12.rst:2258 ../../whatsnew/3.12.rst:2343 msgid "" ":c:var:`Py_LegacyWindowsFSEncodingFlag`: use :c:member:`PyPreConfig." "legacy_windows_fs_encoding`" msgstr "" +":c:var:`Py_LegacyWindowsFSEncodingFlag`: 請改用 :c:member:`PyPreConfig." +"legacy_windows_fs_encoding`" -#: ../../whatsnew/3.12.rst:2245 ../../whatsnew/3.12.rst:2330 +#: ../../whatsnew/3.12.rst:2259 ../../whatsnew/3.12.rst:2344 msgid "" ":c:var:`Py_LegacyWindowsStdioFlag`: use :c:member:`PyConfig." "legacy_windows_stdio`" msgstr "" +":c:var:`Py_LegacyWindowsStdioFlag`: 請改用 :c:member:`PyConfig." +"legacy_windows_stdio`" -#: ../../whatsnew/3.12.rst:2246 ../../whatsnew/3.12.rst:2331 +#: ../../whatsnew/3.12.rst:2260 ../../whatsnew/3.12.rst:2345 msgid "" ":c:var:`!Py_FileSystemDefaultEncoding`: use :c:member:`PyConfig." "filesystem_encoding`" msgstr "" +":c:var:`!Py_FileSystemDefaultEncoding`: 請改用 :c:member:`PyConfig." +"filesystem_encoding`" -#: ../../whatsnew/3.12.rst:2247 ../../whatsnew/3.12.rst:2332 +#: ../../whatsnew/3.12.rst:2261 ../../whatsnew/3.12.rst:2346 msgid "" ":c:var:`!Py_HasFileSystemDefaultEncoding`: use :c:member:`PyConfig." "filesystem_encoding`" msgstr "" +":c:var:`!Py_HasFileSystemDefaultEncoding`: 請改用 :c:member:`PyConfig." +"filesystem_encoding`" -#: ../../whatsnew/3.12.rst:2248 ../../whatsnew/3.12.rst:2333 +#: ../../whatsnew/3.12.rst:2262 ../../whatsnew/3.12.rst:2347 msgid "" ":c:var:`!Py_FileSystemDefaultEncodeErrors`: use :c:member:`PyConfig." "filesystem_errors`" msgstr "" +":c:var:`!Py_FileSystemDefaultEncodeErrors`: 請改用 :c:member:`PyConfig." +"filesystem_errors`" -#: ../../whatsnew/3.12.rst:2249 ../../whatsnew/3.12.rst:2334 +#: ../../whatsnew/3.12.rst:2263 ../../whatsnew/3.12.rst:2348 msgid "" ":c:var:`!Py_UTF8Mode`: use :c:member:`PyPreConfig.utf8_mode` (see :c:func:" "`Py_PreInitialize`)" msgstr "" +":c:var:`!Py_UTF8Mode`: 請改用 :c:member:`PyPreConfig.utf8_mode`\\ (參見 :c:" +"func:`Py_PreInitialize`)" -#: ../../whatsnew/3.12.rst:2251 +#: ../../whatsnew/3.12.rst:2265 msgid "" "The :c:func:`Py_InitializeFromConfig` API should be used with :c:type:" "`PyConfig` instead. (Contributed by Victor Stinner in :gh:`77782`.)" msgstr "" +":c:func:`Py_InitializeFromConfig` API 應改為與 :c:type:`PyConfig` 一起使用。" +"(由 Victor Stinner 於 :gh:`77782` 中貢獻。)" -#: ../../whatsnew/3.12.rst:2255 +#: ../../whatsnew/3.12.rst:2269 msgid "" "Creating :c:data:`immutable types ` with mutable " "bases is deprecated and will be disabled in Python 3.14. (:gh:`95388`)" msgstr "" -#: ../../whatsnew/3.12.rst:2258 +#: ../../whatsnew/3.12.rst:2272 msgid "" "The :file:`structmember.h` header is deprecated, though it continues to be " "available and there are no plans to remove it." -msgstr "" +msgstr ":file:`structmember.h` 標頭已棄用,但仍可使用,且還沒有移除它的計畫。" -#: ../../whatsnew/3.12.rst:2261 +#: ../../whatsnew/3.12.rst:2275 msgid "" "Its contents are now available just by including :file:`Python.h`, with a " "``Py`` prefix added if it was missing:" msgstr "" -#: ../../whatsnew/3.12.rst:2264 +#: ../../whatsnew/3.12.rst:2278 msgid "" ":c:struct:`PyMemberDef`, :c:func:`PyMember_GetOne` and :c:func:" "`PyMember_SetOne`" @@ -3629,325 +3681,348 @@ msgstr "" ":c:struct:`PyMemberDef`、:c:func:`PyMember_GetOne` 和 :c:func:" "`PyMember_SetOne`" -#: ../../whatsnew/3.12.rst:2266 +#: ../../whatsnew/3.12.rst:2280 msgid "" "Type macros like :c:macro:`Py_T_INT`, :c:macro:`Py_T_DOUBLE`, etc. " "(previously ``T_INT``, ``T_DOUBLE``, etc.)" msgstr "" -#: ../../whatsnew/3.12.rst:2268 +#: ../../whatsnew/3.12.rst:2282 msgid "" "The flags :c:macro:`Py_READONLY` (previously ``READONLY``) and :c:macro:" "`Py_AUDIT_READ` (previously all uppercase)" msgstr "" +":c:macro:`Py_READONLY`\\ (先前為 ``READONLY``)和 :c:macro:" +"`Py_AUDIT_READ`\\ (先前全大寫)旗標" -#: ../../whatsnew/3.12.rst:2271 +#: ../../whatsnew/3.12.rst:2285 msgid "Several items are not exposed from :file:`Python.h`:" -msgstr "" +msgstr "數個項目不再從 :file:`Python.h` 中公開:" -#: ../../whatsnew/3.12.rst:2273 +#: ../../whatsnew/3.12.rst:2287 msgid ":c:macro:`T_OBJECT` (use :c:macro:`Py_T_OBJECT_EX`)" -msgstr "" +msgstr ":c:macro:`T_OBJECT`\\ (請改用 :c:macro:`Py_T_OBJECT_EX`)" -#: ../../whatsnew/3.12.rst:2274 +#: ../../whatsnew/3.12.rst:2288 msgid ":c:macro:`T_NONE` (previously undocumented, and pretty quirky)" -msgstr "" +msgstr ":c:macro:`T_NONE`\\ (先前未記錄於文件上,且相當古怪)" -#: ../../whatsnew/3.12.rst:2275 +#: ../../whatsnew/3.12.rst:2289 msgid "The macro ``WRITE_RESTRICTED`` which does nothing." -msgstr "" +msgstr "不做任何事的巨集 ``WRITE_RESTRICTED``。" -#: ../../whatsnew/3.12.rst:2276 +#: ../../whatsnew/3.12.rst:2290 msgid "" "The macros ``RESTRICTED`` and ``READ_RESTRICTED``, equivalents of :c:macro:" "`Py_AUDIT_READ`." msgstr "" +"``RESTRICTED`` 和 ``READ_RESTRICTED`` 這兩個巨集,相當於 :c:macro:" +"`Py_AUDIT_READ`。" -#: ../../whatsnew/3.12.rst:2278 +#: ../../whatsnew/3.12.rst:2292 msgid "" "In some configurations, ```` is not included from :file:`Python." "h`. It should be included manually when using ``offsetof()``." msgstr "" -#: ../../whatsnew/3.12.rst:2281 +#: ../../whatsnew/3.12.rst:2295 msgid "" "The deprecated header continues to provide its original contents under the " "original names. Your old code can stay unchanged, unless the extra include " "and non-namespaced macros bother you greatly." msgstr "" -#: ../../whatsnew/3.12.rst:2286 +#: ../../whatsnew/3.12.rst:2300 msgid "" "(Contributed in :gh:`47146` by Petr Viktorin, based on earlier work by " "Alexander Belopolsky and Matthias Braun.)" msgstr "" -#: ../../whatsnew/3.12.rst:2289 +#: ../../whatsnew/3.12.rst:2303 msgid "" ":c:func:`PyErr_Fetch` and :c:func:`PyErr_Restore` are deprecated. Use :c:" "func:`PyErr_GetRaisedException` and :c:func:`PyErr_SetRaisedException` " "instead. (Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2294 +#: ../../whatsnew/3.12.rst:2308 msgid "" ":c:func:`!PyErr_Display` is deprecated. Use :c:func:`PyErr_DisplayException` " "instead. (Contributed by Irit Katriel in :gh:`102755`)." msgstr "" +":c:func:`!PyErr_Display` 已棄用,請改用 :c:func:`PyErr_DisplayException`。" +"(由 Irit Katriel 於 :gh:`102755` 中貢獻。)" -#: ../../whatsnew/3.12.rst:2297 +#: ../../whatsnew/3.12.rst:2311 msgid "" "``_PyErr_ChainExceptions`` is deprecated. Use ``_PyErr_ChainExceptions1`` " "instead. (Contributed by Irit Katriel in :gh:`102192`.)" msgstr "" +"``_PyErr_ChainExceptions`` 已棄用,請改用 ``_PyErr_ChainExceptions1``。(由 " +"Irit Katriel 於 :gh:`102192` 中貢獻。)" -#: ../../whatsnew/3.12.rst:2300 +#: ../../whatsnew/3.12.rst:2314 msgid "" "Using :c:func:`PyType_FromSpec`, :c:func:`PyType_FromSpecWithBases` or :c:" "func:`PyType_FromModuleAndSpec` to create a class whose metaclass overrides :" "c:member:`~PyTypeObject.tp_new` is deprecated. Call the metaclass instead." msgstr "" -#: ../../whatsnew/3.12.rst:2308 +#: ../../whatsnew/3.12.rst:2322 msgid "" "The ``ma_version_tag`` field in :c:type:`PyDictObject` for extension modules " "(:pep:`699`; :gh:`101193`)." msgstr "" -#: ../../whatsnew/3.12.rst:2311 +#: ../../whatsnew/3.12.rst:2325 msgid "Global configuration variables:" msgstr "" -#: ../../whatsnew/3.12.rst:2336 +#: ../../whatsnew/3.12.rst:2350 msgid "" "The :c:func:`Py_InitializeFromConfig` API should be used with :c:type:" "`PyConfig` instead." msgstr "" +":c:func:`Py_InitializeFromConfig` API 應改為與 :c:type:`PyConfig` 一起使用。" -#: ../../whatsnew/3.12.rst:2339 +#: ../../whatsnew/3.12.rst:2353 msgid "" "Creating :c:data:`immutable types ` with mutable " "bases (:gh:`95388`)." msgstr "" -#: ../../whatsnew/3.12.rst:2343 -msgid "Pending Removal in Python 3.15" -msgstr "" - -#: ../../whatsnew/3.12.rst:2345 +#: ../../whatsnew/3.12.rst:2359 msgid "" ":c:func:`PyImport_ImportModuleNoBlock`: use :c:func:`PyImport_ImportModule`" msgstr "" +":c:func:`PyImport_ImportModuleNoBlock`:請改用 :c:func:" +"`PyImport_ImportModule`" -#: ../../whatsnew/3.12.rst:2346 +#: ../../whatsnew/3.12.rst:2360 msgid ":c:type:`!Py_UNICODE_WIDE` type: use :c:type:`wchar_t`" -msgstr "" +msgstr ":c:type:`!Py_UNICODE_WIDE` 型別:請改用 :c:type:`wchar_t`" -#: ../../whatsnew/3.12.rst:2347 +#: ../../whatsnew/3.12.rst:2361 msgid ":c:type:`Py_UNICODE` type: use :c:type:`wchar_t`" -msgstr "" +msgstr ":c:type:`Py_UNICODE` 型別:請改用 :c:type:`wchar_t`" -#: ../../whatsnew/3.12.rst:2348 +#: ../../whatsnew/3.12.rst:2362 msgid "Python initialization functions:" -msgstr "" +msgstr "Python 初始化函式:" -#: ../../whatsnew/3.12.rst:2350 +#: ../../whatsnew/3.12.rst:2364 msgid "" ":c:func:`PySys_ResetWarnOptions`: clear :data:`sys.warnoptions` and :data:`!" "warnings.filters`" msgstr "" +":c:func:`PySys_ResetWarnOptions`:清除 :data:`sys.warnoptions` 和 :data:`!" +"warnings.filters`" -#: ../../whatsnew/3.12.rst:2352 +#: ../../whatsnew/3.12.rst:2366 msgid ":c:func:`Py_GetExecPrefix`: get :data:`sys.exec_prefix`" -msgstr "" +msgstr ":c:func:`Py_GetExecPrefix`:取得 :data:`sys.exec_prefix`" -#: ../../whatsnew/3.12.rst:2353 +#: ../../whatsnew/3.12.rst:2367 msgid ":c:func:`Py_GetPath`: get :data:`sys.path`" -msgstr "" +msgstr ":c:func:`Py_GetPath`:取得 :data:`sys.path`" -#: ../../whatsnew/3.12.rst:2354 +#: ../../whatsnew/3.12.rst:2368 msgid ":c:func:`Py_GetPrefix`: get :data:`sys.prefix`" -msgstr "" +msgstr ":c:func:`Py_GetPrefix`:取得 :data:`sys.prefix`" -#: ../../whatsnew/3.12.rst:2355 +#: ../../whatsnew/3.12.rst:2369 msgid ":c:func:`Py_GetProgramFullPath`: get :data:`sys.executable`" -msgstr "" +msgstr ":c:func:`Py_GetProgramFullPath`:取得 :data:`sys.executable`" -#: ../../whatsnew/3.12.rst:2356 +#: ../../whatsnew/3.12.rst:2370 msgid ":c:func:`Py_GetProgramName`: get :data:`sys.executable`" -msgstr "" +msgstr ":c:func:`Py_GetProgramName`:取得 :data:`sys.executable`" -#: ../../whatsnew/3.12.rst:2357 +#: ../../whatsnew/3.12.rst:2371 msgid "" ":c:func:`Py_GetPythonHome`: get :c:member:`PyConfig.home` or the :envvar:" "`PYTHONHOME` environment variable" msgstr "" +":c:func:`Py_GetPythonHome`:取得 :c:member:`PyConfig.home` 或 :envvar:" +"`PYTHONHOME` 環境變數" -#: ../../whatsnew/3.12.rst:2363 +#: ../../whatsnew/3.12.rst:2377 msgid "" "The following APIs are deprecated and will be removed, although there is " "currently no date scheduled for their removal." -msgstr "" +msgstr "以下 API 已棄用,且將會被移除,雖目前尚未定下移除日期。" -#: ../../whatsnew/3.12.rst:2366 +#: ../../whatsnew/3.12.rst:2380 msgid ":c:macro:`Py_TPFLAGS_HAVE_FINALIZE`: unneeded since Python 3.8" -msgstr "" +msgstr ":c:macro:`Py_TPFLAGS_HAVE_FINALIZE`:自 Python 3.8 起不再需要" -#: ../../whatsnew/3.12.rst:2367 +#: ../../whatsnew/3.12.rst:2381 msgid ":c:func:`PyErr_Fetch`: use :c:func:`PyErr_GetRaisedException`" -msgstr "" +msgstr ":c:func:`PyErr_Fetch`:請改用 :c:func:`PyErr_GetRaisedException`" -#: ../../whatsnew/3.12.rst:2368 +#: ../../whatsnew/3.12.rst:2382 msgid "" ":c:func:`PyErr_NormalizeException`: use :c:func:`PyErr_GetRaisedException`" msgstr "" +":c:func:`PyErr_NormalizeException`:請改用 :c:func:`PyErr_GetRaisedException`" -#: ../../whatsnew/3.12.rst:2369 +#: ../../whatsnew/3.12.rst:2383 msgid ":c:func:`PyErr_Restore`: use :c:func:`PyErr_SetRaisedException`" -msgstr "" +msgstr ":c:func:`PyErr_Restore`:請改用 :c:func:`PyErr_SetRaisedException`" -#: ../../whatsnew/3.12.rst:2370 +#: ../../whatsnew/3.12.rst:2384 msgid "" ":c:func:`PyModule_GetFilename`: use :c:func:`PyModule_GetFilenameObject`" msgstr "" +":c:func:`PyModule_GetFilename`:請改用 :c:func:`PyModule_GetFilenameObject`" -#: ../../whatsnew/3.12.rst:2371 +#: ../../whatsnew/3.12.rst:2385 msgid ":c:func:`PyOS_AfterFork`: use :c:func:`PyOS_AfterFork_Child`" -msgstr "" +msgstr ":c:func:`PyOS_AfterFork`:請改用 :c:func:`PyOS_AfterFork_Child`" -#: ../../whatsnew/3.12.rst:2372 +#: ../../whatsnew/3.12.rst:2386 msgid "" ":c:func:`PySlice_GetIndicesEx`: use :c:func:`PySlice_Unpack` and :c:func:" "`PySlice_AdjustIndices`" msgstr "" +":c:func:`PySlice_GetIndicesEx`:請改用 :c:func:`PySlice_Unpack` 和 :c:func:" +"`PySlice_AdjustIndices`" -#: ../../whatsnew/3.12.rst:2373 +#: ../../whatsnew/3.12.rst:2387 msgid ":c:func:`!PyUnicode_AsDecodedObject`: use :c:func:`PyCodec_Decode`" -msgstr "" +msgstr ":c:func:`!PyUnicode_AsDecodedObject`:請改用 :c:func:`PyCodec_Decode`" -#: ../../whatsnew/3.12.rst:2374 +#: ../../whatsnew/3.12.rst:2388 msgid ":c:func:`!PyUnicode_AsDecodedUnicode`: use :c:func:`PyCodec_Decode`" -msgstr "" +msgstr ":c:func:`!PyUnicode_AsDecodedUnicode`:請改用 :c:func:`PyCodec_Decode`" -#: ../../whatsnew/3.12.rst:2375 +#: ../../whatsnew/3.12.rst:2389 msgid ":c:func:`!PyUnicode_AsEncodedObject`: use :c:func:`PyCodec_Encode`" -msgstr "" +msgstr ":c:func:`!PyUnicode_AsEncodedObject`:請改用 :c:func:`PyCodec_Encode`" -#: ../../whatsnew/3.12.rst:2376 +#: ../../whatsnew/3.12.rst:2390 msgid ":c:func:`!PyUnicode_AsEncodedUnicode`: use :c:func:`PyCodec_Encode`" -msgstr "" +msgstr ":c:func:`!PyUnicode_AsEncodedUnicode`:請改用 :c:func:`PyCodec_Encode`" -#: ../../whatsnew/3.12.rst:2377 +#: ../../whatsnew/3.12.rst:2391 msgid ":c:func:`PyUnicode_READY`: unneeded since Python 3.12" -msgstr "" +msgstr ":c:func:`PyUnicode_READY`:自 Python 3.12 起不再需要" -#: ../../whatsnew/3.12.rst:2378 +#: ../../whatsnew/3.12.rst:2392 msgid ":c:func:`!PyErr_Display`: use :c:func:`PyErr_DisplayException`" -msgstr "" +msgstr ":c:func:`!PyErr_Display`:請改用 :c:func:`PyErr_DisplayException`" -#: ../../whatsnew/3.12.rst:2379 +#: ../../whatsnew/3.12.rst:2393 msgid ":c:func:`!_PyErr_ChainExceptions`: use ``_PyErr_ChainExceptions1``" -msgstr "" +msgstr ":c:func:`!_PyErr_ChainExceptions`:請改用 ``_PyErr_ChainExceptions1``" -#: ../../whatsnew/3.12.rst:2380 +#: ../../whatsnew/3.12.rst:2394 msgid "" ":c:member:`!PyBytesObject.ob_shash` member: call :c:func:`PyObject_Hash` " "instead" msgstr "" +":c:member:`!PyBytesObject.ob_shash` 成員:請改用 :c:func:`PyObject_Hash`" -#: ../../whatsnew/3.12.rst:2382 +#: ../../whatsnew/3.12.rst:2396 msgid ":c:member:`!PyDictObject.ma_version_tag` member" msgstr ":c:member:`!PyDictObject.ma_version_tag` 成員" -#: ../../whatsnew/3.12.rst:2383 +#: ../../whatsnew/3.12.rst:2397 msgid "Thread Local Storage (TLS) API:" msgstr "" -#: ../../whatsnew/3.12.rst:2385 +#: ../../whatsnew/3.12.rst:2399 msgid ":c:func:`PyThread_create_key`: use :c:func:`PyThread_tss_alloc`" -msgstr "" +msgstr ":c:func:`PyThread_create_key`:請改用 :c:func:`PyThread_tss_alloc`" -#: ../../whatsnew/3.12.rst:2386 +#: ../../whatsnew/3.12.rst:2400 msgid ":c:func:`PyThread_delete_key`: use :c:func:`PyThread_tss_free`" -msgstr "" +msgstr ":c:func:`PyThread_delete_key`:請改用 :c:func:`PyThread_tss_free`" -#: ../../whatsnew/3.12.rst:2387 +#: ../../whatsnew/3.12.rst:2401 msgid ":c:func:`PyThread_set_key_value`: use :c:func:`PyThread_tss_set`" -msgstr "" +msgstr ":c:func:`PyThread_set_key_value`:請改用 :c:func:`PyThread_tss_set`" -#: ../../whatsnew/3.12.rst:2388 +#: ../../whatsnew/3.12.rst:2402 msgid ":c:func:`PyThread_get_key_value`: use :c:func:`PyThread_tss_get`" -msgstr "" +msgstr ":c:func:`PyThread_get_key_value`:請改用 :c:func:`PyThread_tss_get`" -#: ../../whatsnew/3.12.rst:2389 +#: ../../whatsnew/3.12.rst:2403 msgid ":c:func:`PyThread_delete_key_value`: use :c:func:`PyThread_tss_delete`" msgstr "" +":c:func:`PyThread_delete_key_value`:請改用 :c:func:`PyThread_tss_delete`" -#: ../../whatsnew/3.12.rst:2390 +#: ../../whatsnew/3.12.rst:2404 msgid ":c:func:`PyThread_ReInitTLS`: unneeded since Python 3.7" -msgstr "" +msgstr ":c:func:`PyThread_ReInitTLS`:自 Python 3.7 起不再需要" -#: ../../whatsnew/3.12.rst:2395 +#: ../../whatsnew/3.12.rst:2409 msgid "" "Remove the :file:`token.h` header file. There was never any public tokenizer " "C API. The :file:`token.h` header file was only designed to be used by " "Python internals. (Contributed by Victor Stinner in :gh:`92651`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2400 +#: ../../whatsnew/3.12.rst:2414 msgid "Legacy Unicode APIs have been removed. See :pep:`623` for detail." msgstr "" -#: ../../whatsnew/3.12.rst:2402 +#: ../../whatsnew/3.12.rst:2416 msgid ":c:macro:`!PyUnicode_WCHAR_KIND`" msgstr ":c:macro:`!PyUnicode_WCHAR_KIND`" -#: ../../whatsnew/3.12.rst:2403 +#: ../../whatsnew/3.12.rst:2417 msgid ":c:func:`!PyUnicode_AS_UNICODE`" msgstr ":c:func:`!PyUnicode_AS_UNICODE`" -#: ../../whatsnew/3.12.rst:2404 +#: ../../whatsnew/3.12.rst:2418 msgid ":c:func:`!PyUnicode_AsUnicode`" msgstr ":c:func:`!PyUnicode_AsUnicode`" -#: ../../whatsnew/3.12.rst:2405 +#: ../../whatsnew/3.12.rst:2419 msgid ":c:func:`!PyUnicode_AsUnicodeAndSize`" msgstr ":c:func:`!PyUnicode_AsUnicodeAndSize`" -#: ../../whatsnew/3.12.rst:2406 +#: ../../whatsnew/3.12.rst:2420 msgid ":c:func:`!PyUnicode_AS_DATA`" msgstr ":c:func:`!PyUnicode_AS_DATA`" -#: ../../whatsnew/3.12.rst:2407 +#: ../../whatsnew/3.12.rst:2421 msgid ":c:func:`!PyUnicode_FromUnicode`" msgstr ":c:func:`!PyUnicode_FromUnicode`" -#: ../../whatsnew/3.12.rst:2408 +#: ../../whatsnew/3.12.rst:2422 msgid ":c:func:`!PyUnicode_GET_SIZE`" msgstr ":c:func:`!PyUnicode_GET_SIZE`" -#: ../../whatsnew/3.12.rst:2409 +#: ../../whatsnew/3.12.rst:2423 msgid ":c:func:`!PyUnicode_GetSize`" msgstr ":c:func:`!PyUnicode_GetSize`" -#: ../../whatsnew/3.12.rst:2410 +#: ../../whatsnew/3.12.rst:2424 msgid ":c:func:`!PyUnicode_GET_DATA_SIZE`" msgstr ":c:func:`!PyUnicode_GET_DATA_SIZE`" -#: ../../whatsnew/3.12.rst:2412 +#: ../../whatsnew/3.12.rst:2426 msgid "" "Remove the ``PyUnicode_InternImmortal()`` function macro. (Contributed by " "Victor Stinner in :gh:`85858`.)" msgstr "" +"移除 ``PyUnicode_InternImmortal()`` 函式巨集。(由 Victor Stinner 於 :gh:" +"`85858` 中貢獻。)" -#: ../../whatsnew/3.12.rst:2415 +#: ../../whatsnew/3.12.rst:2429 msgid "" "Remove ``Jython`` compatibility hacks from several stdlib modules and tests. " "(Contributed by Nikita Sobolev in :gh:`99482`.)" msgstr "" +"移除數個標準函式庫模組與測試中的 ``Jython`` 相容性修補程式。(由 Nikita " +"Sobolev 於 :gh:`99482` 中貢獻。)" -#: ../../whatsnew/3.12.rst:2418 +#: ../../whatsnew/3.12.rst:2432 msgid "" "Remove ``_use_broken_old_ctypes_structure_semantics_`` flag from :mod:" "`ctypes` module. (Contributed by Nikita Sobolev in :gh:`99285`.)" msgstr "" +"移除 :mod:`ctypes` 模組中的 ``_use_broken_old_ctypes_structure_semantics_`` " +"旗標。(由 Nikita Sobolev 於 :gh:`99285` 中貢獻。)" diff --git a/whatsnew/3.3.po b/whatsnew/3.3.po index 0914591a50..615ebdc8c2 100644 --- a/whatsnew/3.3.po +++ b/whatsnew/3.3.po @@ -39,7 +39,7 @@ msgstr "" #: ../../whatsnew/3.3.rst:60 msgid "New syntax features:" -msgstr "新的語法特徵:" +msgstr "新增語法特性:" #: ../../whatsnew/3.3.rst:62 msgid "" diff --git a/whatsnew/3.4.po b/whatsnew/3.4.po index 2c35922a63..75456d370f 100644 --- a/whatsnew/3.4.po +++ b/whatsnew/3.4.po @@ -47,7 +47,7 @@ msgstr "" #: ../../whatsnew/3.4.rst:80 msgid "New syntax features:" -msgstr "" +msgstr "新增語法特性:" #: ../../whatsnew/3.4.rst:82 msgid "No new syntax features were added in Python 3.4." @@ -180,7 +180,7 @@ msgstr "" #: ../../whatsnew/3.4.rst:132 msgid "Security improvements:" -msgstr "" +msgstr "安全性改進:" #: ../../whatsnew/3.4.rst:134 msgid "" @@ -790,7 +790,7 @@ msgstr "由 Victor Stinner 撰寫 PEP 與實作" #: ../../whatsnew/3.4.rst:589 msgid "Improved Modules" -msgstr "" +msgstr "改進的模組" #: ../../whatsnew/3.4.rst:593 msgid "abc" diff --git a/whatsnew/3.5.po b/whatsnew/3.5.po index d09d5e9665..93350b023b 100644 --- a/whatsnew/3.5.po +++ b/whatsnew/3.5.po @@ -49,7 +49,7 @@ msgstr "" #: ../../whatsnew/3.5.rst:60 msgid "New syntax features:" -msgstr "" +msgstr "新增語法特性:" #: ../../whatsnew/3.5.rst:62 msgid "" @@ -184,7 +184,7 @@ msgstr "" #: ../../whatsnew/3.5.rst:136 msgid "Security improvements:" -msgstr "" +msgstr "安全性改進:" #: ../../whatsnew/3.5.rst:138 msgid "" @@ -829,7 +829,7 @@ msgstr "" #: ../../whatsnew/3.5.rst:724 msgid "New Modules" -msgstr "" +msgstr "新增模組" #: ../../whatsnew/3.5.rst:727 msgid "typing" @@ -873,7 +873,7 @@ msgstr "" #: ../../whatsnew/3.5.rst:761 msgid "Improved Modules" -msgstr "" +msgstr "改進的模組" #: ../../whatsnew/3.5.rst:764 msgid "argparse" diff --git a/whatsnew/3.6.po b/whatsnew/3.6.po index 722a05f71c..05160bd208 100644 --- a/whatsnew/3.6.po +++ b/whatsnew/3.6.po @@ -44,7 +44,7 @@ msgstr "" #: ../../whatsnew/3.6.rst:60 msgid "New syntax features:" -msgstr "" +msgstr "新增語法特性:" #: ../../whatsnew/3.6.rst:62 msgid ":ref:`PEP 498 `, formatted string literals." @@ -162,7 +162,7 @@ msgstr "" #: ../../whatsnew/3.6.rst:130 msgid "Security improvements:" -msgstr "" +msgstr "安全性改進:" #: ../../whatsnew/3.6.rst:132 msgid "" @@ -916,7 +916,7 @@ msgstr "由 Steven D'Aprano 撰寫 PEP 與實作。" #: ../../whatsnew/3.6.rst:792 msgid "Improved Modules" -msgstr "" +msgstr "改進的模組" #: ../../whatsnew/3.6.rst:795 msgid "array" diff --git a/whatsnew/3.7.po b/whatsnew/3.7.po index 29981b965a..573273daac 100644 --- a/whatsnew/3.7.po +++ b/whatsnew/3.7.po @@ -40,7 +40,7 @@ msgstr "" #: ../../whatsnew/3.7.rst:58 msgid "New syntax features:" -msgstr "" +msgstr "新增語法特性:" #: ../../whatsnew/3.7.rst:60 msgid "" @@ -152,7 +152,7 @@ msgstr "" #: ../../whatsnew/3.7.rst:109 msgid "C API improvements:" -msgstr "" +msgstr "C API 改進:" #: ../../whatsnew/3.7.rst:111 msgid ":ref:`PEP 539 `, new C API for thread-local storage" @@ -854,7 +854,7 @@ msgstr "" #: ../../whatsnew/3.7.rst:619 msgid "Improved Modules" -msgstr "" +msgstr "改進的模組" #: ../../whatsnew/3.7.rst:623 msgid "argparse" @@ -2321,7 +2321,7 @@ msgstr "" #: ../../whatsnew/3.7.rst:1645 msgid "C API Changes" -msgstr "" +msgstr "C API 變更" #: ../../whatsnew/3.7.rst:1647 msgid "" diff --git a/whatsnew/3.8.po b/whatsnew/3.8.po index 40a1f64f79..c7518e2e99 100644 --- a/whatsnew/3.8.po +++ b/whatsnew/3.8.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-10-13 00:03+0000\n" +"POT-Creation-Date: 2023-10-20 00:03+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-" @@ -686,7 +686,7 @@ msgstr "" #: ../../whatsnew/3.8.rst:543 msgid "New Modules" -msgstr "" +msgstr "新增模組" #: ../../whatsnew/3.8.rst:545 msgid "" @@ -701,7 +701,7 @@ msgstr "(由 Barry Warsaw 和 Jason R. Coombs 在 :issue:`34632` 中貢獻。 #: ../../whatsnew/3.8.rst:568 msgid "Improved Modules" -msgstr "" +msgstr "改進的模組" #: ../../whatsnew/3.8.rst:571 msgid "ast" @@ -2106,9 +2106,9 @@ msgstr "" #: ../../whatsnew/3.8.rst:1656 msgid "" -"The :meth:`__getitem__` methods of :class:`xml.dom.pulldom.DOMEventStream`, :" -"class:`wsgiref.util.FileWrapper` and :class:`fileinput.FileInput` have been " -"deprecated." +"The :meth:`~object.__getitem__` methods of :class:`xml.dom.pulldom." +"DOMEventStream`, :class:`wsgiref.util.FileWrapper` and :class:`fileinput." +"FileInput` have been deprecated." msgstr "" #: ../../whatsnew/3.8.rst:1660 diff --git a/whatsnew/3.9.po b/whatsnew/3.9.po index 08cc7c79e0..4b22ebcf8a 100644 --- a/whatsnew/3.9.po +++ b/whatsnew/3.9.po @@ -47,7 +47,7 @@ msgstr "" #: ../../whatsnew/3.9.rst:60 msgid "New syntax features:" -msgstr "" +msgstr "新增語法特性:" #: ../../whatsnew/3.9.rst:62 msgid ":pep:`584`, union operators added to ``dict``;" @@ -85,7 +85,7 @@ msgstr "" #: ../../whatsnew/3.9.rst:76 msgid "Interpreter improvements:" -msgstr "" +msgstr "直譯器的改進:" #: ../../whatsnew/3.9.rst:78 msgid "" @@ -428,7 +428,7 @@ msgstr "" #: ../../whatsnew/3.9.rst:325 msgid "Improved Modules" -msgstr "" +msgstr "改進的模組" #: ../../whatsnew/3.9.rst:328 msgid "ast" @@ -1809,7 +1809,7 @@ msgstr "" #: ../../whatsnew/3.9.rst:1270 msgid "C API Changes" -msgstr "" +msgstr "C API 變更" #: ../../whatsnew/3.9.rst:1275 msgid "" From 72726c24edc684cf56326b4f9d66ab132b685ef2 Mon Sep 17 00:00:00 2001 From: RockLeon <34214497+rockleona@users.noreply.github.com> Date: Sun, 5 Nov 2023 21:24:24 -0600 Subject: [PATCH 24/39] Update `library/typing` (#691) * Update NewType Section * Finish translate this section * Update with reviewer's suggestion * Update Reviewer's Comment Part 2 * Update library/typing.po --------- Co-authored-by: Wei-Hsiang (Matt) Wang --- library/typing.po | 86 ++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 74 insertions(+), 12 deletions(-) diff --git a/library/typing.po b/library/typing.po index 8267d8a0bf..f31e587f99 100644 --- a/library/typing.po +++ b/library/typing.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-10-25 00:03+0000\n" -"PO-Revision-Date: 2023-09-05 14:49+0800\n" +"PO-Revision-Date: 2023-11-06 10:51+0800\n" "Last-Translator: RockLeon \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.3.1\n" +"X-Generator: Poedit 3.4\n" #: ../../library/typing.rst:3 msgid ":mod:`typing` --- Support for type hints" @@ -33,7 +33,7 @@ msgid "" "They can be used by third party tools such as type checkers, IDEs, linters, " "etc." msgstr "" -"Python 執行環境不強制要求函式與變數的型別註釋。他們可以被第三方工具使用,如:" +"Python runtime 不強制要求函式與變數的型別註釋。他們可以被第三方工具使用,如:" "型別檢查器、IDE、linter 等。" #: ../../library/typing.rst:26 @@ -357,13 +357,15 @@ msgstr "NewType" #: ../../library/typing.rst:179 msgid "Use the :class:`NewType` helper to create distinct types::" -msgstr "" +msgstr "使用 :class:`NewType` 輔助工具 (helper) 建立獨特型別: ::" #: ../../library/typing.rst:186 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:198 msgid "" @@ -372,6 +374,9 @@ msgid "" "pass in a ``UserId`` wherever an ``int`` might be expected, but will prevent " "you from accidentally creating a ``UserId`` in an invalid way::" msgstr "" +"你依然可以在對於型別 ``UserId`` 的變數中執行所有 ``int`` 的操作。這讓你可以在" +"預期接受 ``int`` 的地方傳遞一個 ``UserId``,還能預防你意外使用無效的方法建立" +"一個 ``UserId``: ::" #: ../../library/typing.rst:206 msgid "" @@ -381,26 +386,33 @@ msgid "" "it. That means the expression ``Derived(some_value)`` does not create a new " "class or introduce much overhead beyond that of a regular function call." msgstr "" +"注意這只會透過靜態型別檢查器強制檢查。在 runtime 中,陳述式 (statement) " +"``Derived = NewType('Derived', Base)`` 會使 ``Derived`` 成為一個 callable(可" +"呼叫物件),會立即回傳任何你傳遞的引數。這意味著 expression (運算式)" +"``Derived(some_value)`` 不會建立一個新的類別或過度引入原有的函式呼叫。" #: ../../library/typing.rst:212 msgid "" "More precisely, the expression ``some_value is Derived(some_value)`` is " "always true at runtime." msgstr "" +"更精確地說,expression ``some_value is Derived(some_value)`` 在 runtime 永遠" +"為 true。" #: ../../library/typing.rst:215 msgid "It is invalid to create a subtype of ``Derived``::" -msgstr "" +msgstr "這會無法建立一個 ``Derived`` 的子型別: ::" #: ../../library/typing.rst:224 msgid "" "However, it is possible to create a :class:`NewType` based on a 'derived' " "``NewType``::" msgstr "" +"無論如何,這有辦法基於 '衍生的' ``NewType`` 建立一個 :class:`NewType`: ::" #: ../../library/typing.rst:232 msgid "and typechecking for ``ProUserId`` will work as expected." -msgstr "" +msgstr "以及針對 ``ProUserId`` 的型別檢查會如期運作。" #: ../../library/typing.rst:234 msgid "See :pep:`484` for more details." @@ -413,6 +425,9 @@ msgid "" "checker treat ``Alias`` as being *exactly equivalent* to ``Original`` in all " "cases. This is useful when you want to simplify complex type signatures." msgstr "" +"請記得使用型別別名是宣告兩種型別是互相\\ *相等*\\ 的。使用 ``type Alias = " +"Original`` 則會讓靜態型別檢查器在任何情況之下將 ``Alias`` 視為與 " +"``Original`` \\ *完全相等*\\ 。這當你想把複雜的型別簽名進行簡化時,非常好用。" #: ../../library/typing.rst:243 msgid "" @@ -423,6 +438,11 @@ msgid "" "``Derived`` is expected. This is useful when you want to prevent logic " "errors with minimal runtime cost." msgstr "" +"相反的,``NewType`` 宣告一個型別會是另外一種型別的子類別。使用 ``Derived = " +"NewType('Derived', Original)`` 會使靜態型別檢查器將 ``Derived`` 視為 " +"``Original`` 的子類別,也意味著一個型別為 ``Original`` 的值,不能被使用在任何" +"預期接收到型別 ``Derived`` 的值的區域。這當你想用最小的 runtime 成本預防邏輯" +"性錯誤而言,非常有用。" #: ../../library/typing.rst:252 msgid "" @@ -430,16 +450,18 @@ msgid "" "some additional runtime cost when calling ``NewType`` over a regular " "function." msgstr "" +"現在的 ``NewType`` 比起一個函式更像一個類別。因此,比起一般的函式,呼叫 " +"``NewType`` 需要額外的 runtime 成本。" #: ../../library/typing.rst:257 msgid "" "The performance of calling ``NewType`` has been restored to its level in " "Python 3.9." -msgstr "" +msgstr "呼叫 ``NewType`` 的效能已經恢復與 Python 3.9 相同的水準。" #: ../../library/typing.rst:264 msgid "Annotating callable objects" -msgstr "" +msgstr "註釋 callable 物件" #: ../../library/typing.rst:266 msgid "" @@ -448,6 +470,9 @@ msgid "" "``Callable[[int], str]`` signifies a function that takes a single parameter " "of type :class:`int` and returns a :class:`str`." msgstr "" +"函式,或者是其他 :term:`callable` 物件,可以使用 :class:`collections.abc." +"Callable` 或 :data:`typing.Callable` 進行註釋。 ``Callable[[int], str]`` 象徵" +"為一個函式,可以接受一個型別為 :class:`int` 的引數,並回傳一個 :class:`str`。" #: ../../library/typing.rst:271 ../../library/typing.rst:2894 #: ../../library/typing.rst:3036 @@ -461,12 +486,17 @@ msgid "" "types, a :class:`ParamSpec`, :data:`Concatenate`, or an ellipsis. The return " "type must be a single type." msgstr "" +"使用下標語法 (subscription syntax) 時,必須使用到兩個值,分別為引述串列以及回" +"傳類別。引數串列必須為一個型別串列::class:`ParamSpec`、:data:`Concatenate` " +"或是一個刪節號 (ellipsis)。回傳類別必為一個單一類別。" #: ../../library/typing.rst:294 msgid "" "If a literal ellipsis ``...`` is given as the argument list, it indicates " "that a callable with any arbitrary parameter list would be acceptable:" msgstr "" +"若刪節號文字 ``...`` 被當作引數串列給定,其指出一個具任何、任意參數列表的 " +"callable 會被接受: ::" #: ../../library/typing.rst:306 msgid "" @@ -476,6 +506,10 @@ msgid "" "be expressed by defining a :class:`Protocol` class with a :meth:`~object." "__call__` method:" msgstr "" +"``Callable`` 不如有可變數量引數的函式、:func:`overloaded functions " +"`、或是僅限關鍵字參數的函式,可以表示複雜簽名。然而,這些簽名可以透" +"過定義一個具有 :meth:`~object.__call__` 方法的 :class:`Protocol` 類別進行表" +"示:" #: ../../library/typing.rst:333 msgid "" @@ -487,22 +521,32 @@ msgid "" "``Callable[Concatenate[Arg1Type, Arg2Type, ..., ParamSpecVariable], " "ReturnType]`` respectively." msgstr "" +"Callable 物件可以取用其他 callable 當作引數使用,可以透過 :class:`ParamSpec` " +"指出他們的參數型別是個別獨立的。另外,如果這個 callable 從其他 callable 新增" +"或刪除引數時,將會使用到 :data:`Concatenate` 運算子。他們可以分別採用 " +"``Callable[ParamSpecVariable, ReturnType]`` 以及 " +"``Callable[Concatenate[Arg1Type, Arg2Type, ..., ParamSpecVariable], " +"ReturnType]`` 的形式。" #: ../../library/typing.rst:341 ../../library/typing.rst:3565 msgid "" "``Callable`` now supports :class:`ParamSpec` and :data:`Concatenate`. See :" "pep:`612` for more details." msgstr "" +"``Callable`` 現已支援 :class:`ParamSpec` 以及 :data:`Concatenate`。請參閱 :" +"pep:`612` 閱讀詳細內容。" #: ../../library/typing.rst:346 msgid "" "The documentation for :class:`ParamSpec` and :class:`Concatenate` provides " "examples of usage in ``Callable``." msgstr "" +":class:`ParamSpec` 以及 :class:`Concatenate` 的文件中,提供範例如何在 " +"``Callable`` 中使用。" #: ../../library/typing.rst:352 msgid "Generics" -msgstr "" +msgstr "泛型" #: ../../library/typing.rst:354 msgid "" @@ -510,30 +554,37 @@ msgid "" "inferred in a generic way, many container classes in the standard library " "support subscription to denote the expected types of container elements." msgstr "" +"因為關於物件的型別資訊留存在容器之內,且無法使用通用的方式進行靜態推論 " +"(statically inferred),許多標準函式庫的容器類別支援以下標來表示容器內預期的元" +"素。" #: ../../library/typing.rst:371 msgid "" "Generic functions and classes can be parameterized by using :ref:`type " "parameter syntax `::" msgstr "" +"泛型函式及類別可以使用\\ :ref:`型別參數語法 (type parameter syntax) ` 進行參數化 (parameterize) : ::" #: ../../library/typing.rst:379 msgid "Or by using the :class:`TypeVar` factory directly::" -msgstr "" +msgstr "或是直接使用 :class:`TypeVar` 工廠 (factory): ::" #: ../../library/typing.rst:389 msgid "Syntactic support for generics is new in Python 3.12." -msgstr "" +msgstr "在 Python 3.12 中,泛型的語法支援是全新功能。" #: ../../library/typing.rst:395 msgid "Annotating tuples" -msgstr "" +msgstr "註釋元組 (tuple)" #: ../../library/typing.rst:397 msgid "" "For most containers in Python, the typing system assumes that all elements " "in the container will be of the same type. For example::" msgstr "" +"在 Python 大多數的容器當中,加註型別系統認為容器內的所有元素會是相同型別。舉" +"例來說: ::" #: ../../library/typing.rst:412 msgid "" @@ -542,6 +593,10 @@ msgid "" "Mapping` only accepts two type arguments: the first indicates the type of " "the keys, and the second indicates the type of the values." msgstr "" +":class:`list` 只接受一個型別引數,所以型別檢查器可能在上述 ``y`` 賦值 " +"(assignment) 觸發錯誤。類似的範例,:class:`~collections.abc.Mapping` 只接受兩" +"個型別引數:第一個引數指出 keys(鍵)的型別;第二個引數指出 values(值)的型" +"別。" #: ../../library/typing.rst:418 msgid "" @@ -550,6 +605,10 @@ msgid "" "For this reason, tuples are special-cased in Python's typing system. :class:" "`tuple` accepts *any number* of type arguments::" msgstr "" +"然而,與其他多數的 Python 容器不同,在慣用的 (idiomatic) Python 程式碼中,元" +"組可以擁有不完全相同型別的元素是相當常見的。為此,元組在 Python 的加註型別系" +"統中是個特例 (special-cased)。:class:`tuple` 接受\\ *任何數量*\\ 的型別引" +"數: ::" #: ../../library/typing.rst:434 msgid "" @@ -558,6 +617,9 @@ msgid "" "use ``tuple[()]``. Using plain ``tuple`` as an annotation is equivalent to " "using ``tuple[Any, ...]``::" msgstr "" +"為了標示一個元組可以為\\ *任意*\\ 長度,且所有元素皆是相同型別 ``T``,請使用 " +"``tuple[T, ...]`` 進行標示。為了標示一個空元組,請使用 ``tuple[()]``。單純使" +"用 ``tuple`` 作為註釋,會與使用 ``tuple[Any, ...]`` 是相等的: ::" #: ../../library/typing.rst:457 msgid "The type of class objects" From 02d46f1e0e281652464a1b126b47a040683ad07c Mon Sep 17 00:00:00 2001 From: neo <71454430+neo-maker-sudo@users.noreply.github.com> Date: Mon, 6 Nov 2023 16:17:05 +0800 Subject: [PATCH 25/39] feat(translate): wsgiref.po (#641) * docs(wsgiref): add partial document translation from english to traditional chinese from rst:87 to rst:845 * docs(wsgiref): modified wsgiref.po for formatting via powrap library * docs(wsgiref): modified format issue at rst:250, rst:260, rst:816, rst:845 * docs(wsgiref): modified sphinx rst syntax issue * docs(wsgiref): modified simplified chinese word to traditional chinese word and correcting rst syntax issue * docs(wsgiref): modified simplified chinese word to traditional chinese word and correcting rst syntax issue part 2 --------- Co-authored-by: neochang --- library/wsgiref.po | 283 ++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 257 insertions(+), 26 deletions(-) diff --git a/library/wsgiref.po b/library/wsgiref.po index 0c898ef064..599513b00f 100644 --- a/library/wsgiref.po +++ b/library/wsgiref.po @@ -84,7 +84,7 @@ msgid "" "please see :pep:`3333` for a detailed specification and :data:`~wsgiref." "types.WSGIEnvironment` for a type alias that can be used in type annotations." msgstr "" -"這個模組提供許多用於處理 WSGI 環境運作的功能。WSGU 環境是一個包含 HTTP 請求變" +"這個模組提供許多用於處理 WSGI 環境運作的功能。WSGI 環境是一個包含 HTTP 請求變" "數的字典,如 :pep:`3333` 所述。所有接受 *environ* 的參數的函式都需要提供符合 " "WSGI 標準的字典;請參閱 :pep:`3333` 獲取詳細規格,以及 :data:`~wsgiref.types." "WSGIEnvironment` 獲取可用於使用型別註釋的型別別名。" @@ -161,7 +161,7 @@ msgid "" "and ``PATH_INFO`` will change from ``/bar/baz`` to ``/baz``." msgstr "" "通常,此程式用於處理請求 URI 的每一部分路徑,例如將路徑視為一系列的字典鍵此程" -"式會修改傳入的環境,使其適用於調用位於目標 URI 的 WSGI 應用程式。例如,如果" +"式會修改傳入的環境,使其適用於呼叫位於目標 URI 的 WSGI 應用程式。例如,如果" "在 ``/foo`` 上有一個 WSGI 應用程式且請求 URI 路徑為 ``/foo/bar/baz``,並且位" "於 ``/foo`` 的 WSGI 應用程式呼叫 :func:`shift_path_info`,它將接收字串 " "\"bar\",而環境將被更新為適用於傳遞給位於 ``/foo/bar`` 的 WSGI 應用程式。換句" @@ -220,13 +220,15 @@ msgstr "" msgid "" "In addition to the environment functions above, the :mod:`wsgiref.util` " "module also provides these miscellaneous utilities:" -msgstr "" +msgstr "除了上述的環境功能外,:mod:`wsgiref.util` 模組還提供以下各類工具:" #: ../../library/wsgiref.rst:152 msgid "" "Return ``True`` if 'header_name' is an HTTP/1.1 \"Hop-by-Hop\" header, as " "defined by :rfc:`2616`." msgstr "" +"如果 'header_name' 是根據 :rfc:`2616` 所定義的 HTTP/1.1 \"Hop-by-Hop\" 標頭," +"則回傳 ``True``。" #: ../../library/wsgiref.rst:158 msgid "" @@ -237,6 +239,10 @@ msgid "" "object's :meth:`read` method to obtain bytestrings to yield. When :meth:" "`read` returns an empty bytestring, iteration is ended and is not resumable." msgstr "" +":class:`wsgiref.types.FileWrapper` 協議的具體實作,用於將類檔案物件轉換" +"為 :term:`iterator`。產生的物件是 :term:`iterable`。當物件進行疊代時,將可選" +"的 *blksize* 引數重複傳遞給 *filelike* 物件的 :meth:`read` 方法來獲得將產生(yield)的" +"位元組字串。當 :meth:`read` 回傳一個空位元組字串,代表疊代已結束且無法回復。" #: ../../library/wsgiref.rst:166 msgid "" @@ -244,20 +250,24 @@ msgid "" "a :meth:`close` method, and it will invoke the *filelike* object's :meth:" "`close` method when called." msgstr "" +"如果 *filelike* 有 :meth:`close` 方法,則回傳的物件也會具有 :meth:`close` 方" +"法,並在呼叫時呼叫 *filelike* 物件的 :meth:`close` 方法。" #: ../../library/wsgiref.rst:182 -msgid "Support for :meth:`~object.__getitem__` method has been removed." -msgstr "" +msgid "Support for :meth:`__getitem__` method has been removed." +msgstr "已移除對 :meth:`__getitem__` 方法的支援。" #: ../../library/wsgiref.rst:187 msgid ":mod:`wsgiref.headers` -- WSGI response header tools" -msgstr "" +msgstr ":mod:`wsgiref.headers` -- WSGI 回應標頭工具。" #: ../../library/wsgiref.rst:193 msgid "" "This module provides a single class, :class:`Headers`, for convenient " "manipulation of WSGI response headers using a mapping-like interface." msgstr "" +"這個模組提供單一類別 :class:`Headers`,用於使用類似對映的介面方便地操作 WSGI " +"回應標頭。" #: ../../library/wsgiref.rst:199 msgid "" @@ -265,6 +275,8 @@ msgid "" "header name/value tuples as described in :pep:`3333`. The default value of " "*headers* is an empty list." msgstr "" +"建立一個類似對映物件並包裝 *headers*,並且必須是符合 :pep:`3333` 描述的 name/" +"value 元組的標頭串列。*headers* 的預設值是一個空串列。" #: ../../library/wsgiref.rst:203 msgid "" @@ -277,6 +289,12 @@ msgid "" "the end of the wrapped header list. Headers' existing order is generally " "maintained, with new headers added to the end of the wrapped list." msgstr "" +":class:`Headers` 物件支援典型對映操作包括 :meth:`__getitem__`、:meth:`get`、:" +"meth:`__setitem__`、:meth:`setdefault`、:meth:`__delitem__` 以及 :meth:" +"`__contains__`。對於這些方法中的每一個,鍵是標頭名稱(以不區分大小寫方式處" +"理),而值則是與該標頭名稱關聯的第一個值。設定標頭會刪除該標頭的所有現有值," +"然後將新值添加到包裝的標頭串列末尾。標頭的現有順序通常保持不變,新標頭會添加" +"到包裝串列的末尾。" #: ../../library/wsgiref.rst:212 msgid "" @@ -285,6 +303,9 @@ msgid "" "nonexistent header just returns ``None``, and deleting a nonexistent header " "does nothing." msgstr "" +"不同於字典,當你嘗試取得或刪除包裝的標頭串列不存在的鍵,:class:`Headers` 物件" +"不會引發例外錯誤。取得不存在的標頭只會回傳 ``None``,而刪除不存在的標頭則不會" +"有任何效果。" #: ../../library/wsgiref.rst:217 msgid "" @@ -296,6 +317,10 @@ msgid "" "In fact, the :meth:`items` method just returns a copy of the wrapped header " "list." msgstr "" +":class:`Headers` 物件還支援 :meth:`keys`、:meth:`value`、和 :meth:`items` 方" +"法。由 :meth:`keys` 和 :meth:`items` 回傳的串列在存在多值標頭時可能會包含相同" +"的鍵。:class:`Headers` 物件的 ``len()`` 與 :meth:`items` 的長度相同,也與包裝" +"標頭串列的長度相同。實際上,:meth:`items` 方法只是回傳包裝的標頭串列的副本。" #: ../../library/wsgiref.rst:224 msgid "" @@ -305,6 +330,9 @@ msgid "" "line is terminated by a carriage return and line feed, and the bytestring is " "terminated with a blank line." msgstr "" +"對 :class:`Header` 物件呼叫 ``bytes()`` 會回傳適合作為 HTTP 傳輸回應標頭的格" +"式化的位元組字串。每個標頭都與其值一起置於一行上,由冒號與空格分隔。每行以回" +"車(carriage return)和換行(line feed)結束,而該位元組字串則以空行結束。" #: ../../library/wsgiref.rst:230 msgid "" @@ -312,10 +340,12 @@ msgid "" "`Headers` objects also have the following methods for querying and adding " "multi-valued headers, and for adding headers with MIME parameters:" msgstr "" +"除了對映介面和格式化功能外,:class:`Headers` 物件還具有以下查詢及附加多值標頭" +"的以及附加 MIME 參數標頭的方法:" #: ../../library/wsgiref.rst:237 msgid "Return a list of all the values for the named header." -msgstr "" +msgstr "回傳指定標頭的所有值的串列。" #: ../../library/wsgiref.rst:239 msgid "" @@ -324,12 +354,16 @@ msgid "" "fields deleted and re-inserted are always appended to the header list. If " "no fields exist with the given name, returns an empty list." msgstr "" +"回傳的串列按照它們在在原始的標頭串列出現的順序或是被添加到此實例的順序進行排" +"序,並且可能包含重複的內容。任何被刪除並重新插入的欄位都會被添加到標頭串列的" +"末尾。如果不存在指定名稱的欄位,則回傳空串列。" #: ../../library/wsgiref.rst:247 msgid "" "Add a (possibly multi-valued) header, with optional MIME parameters " "specified via keyword arguments." msgstr "" +"添加一個(可能是多值的)標頭,可通過關鍵字引數來指定選擇性的 MIME 參數。" #: ../../library/wsgiref.rst:250 msgid "" @@ -342,18 +376,23 @@ msgid "" "only the parameter name is added. (This is used for MIME parameters without " "a value.) Example usage::" msgstr "" +"*name* 是要添加的標頭欄位。關鍵字引數可使於設定標頭欄位的 MIME 參數。每一個參" +"數必須是字串或是 ``None``。由於破折號在 Python 識別符中是非法的,但是許多 " +"MIME 參數名稱包含破折號,因此參數名稱的底線會轉換成破折號。如果參數值是字串," +"則以 ``name=\"value\"`` 的形式添加到標頭值參數中。如果它是 ``None``,則僅添加" +"參數名稱。(這使用於沒有值的 MIME 參數)使用範例: ::" #: ../../library/wsgiref.rst:260 msgid "The above will add a header that looks like this::" -msgstr "" +msgstr "上述操作將添加看起來像這樣的標頭: ::" #: ../../library/wsgiref.rst:265 msgid "*headers* parameter is optional." -msgstr "" +msgstr "*headers* 參數是可選的。" #: ../../library/wsgiref.rst:270 msgid ":mod:`wsgiref.simple_server` -- a simple WSGI HTTP server" -msgstr "" +msgstr ":mod:`wsgiref.simple_server` -- 一個簡單的 WSGI HTTP 伺服器" #: ../../library/wsgiref.rst:276 msgid "" @@ -365,6 +404,11 @@ msgid "" "request. (E.g., using the :func:`shift_path_info` function from :mod:" "`wsgiref.util`.)" msgstr "" +"這個模組實作一個簡單的的 HTTP 伺服器(基於 :mod:`http.server`)用於提供 WSGI " +"應用程式。每個伺服器執行個體在特定的主機與埠提供單一的 WSGI 應用程式。如果你" +"想要在單一主機與埠上提供多個應用程式,你應該建立一個 WSGI 應用程式以剖析 " +"``PATH_INFO`` 去選擇為每個請求呼叫哪個應用程式。(例如,使用來自 :mod:" +"`wsgiref.util` 的 :func:`shift_path_info` 函式。)" #: ../../library/wsgiref.rst:287 msgid "" @@ -374,6 +418,9 @@ msgid "" "*handler_class*. *app* must be a WSGI application object, as defined by :" "pep:`3333`." msgstr "" +"建立一個新的 WSGI 伺服器監聽 *host* 和 *port*,接受 *app* 的連線。回傳值是提" +"供 *server_class* 的實例,並將使用指定的 *handler_class* 處理請求。*app* 必須" +"是一個 WSGI 應用程式物件,如 :pep:`3333` 所定義。" #: ../../library/wsgiref.rst:308 msgid "" @@ -383,6 +430,10 @@ msgid "" "WSGI server (such as :mod:`wsgiref.simple_server`) is able to run a simple " "WSGI application correctly." msgstr "" +"這個函式是一個簡單但完整的 WSGI 應用程式,它回傳一個包含訊息 \"Hello world!" +"\" 和在 *environ* 參數中提供的鍵值對串列的文字頁面。這對於驗證 WSGI 伺服器" +"(例如 :mod:`wsgiref.simple_server`)是否能正確執行簡單的 WSGI 應用程式非常有" +"用。" #: ../../library/wsgiref.rst:317 msgid "" @@ -390,12 +441,17 @@ msgid "" "port)`` tuple, and *RequestHandlerClass* should be the subclass of :class:" "`http.server.BaseHTTPRequestHandler` that will be used to process requests." msgstr "" +"建立一個 :class:`WSGIServer` 實例。*server_address* 應該是一個 ``(host, " +"port)`` 元組,而 *RequestHandlerClass* 應該是 :class:`http.server." +"BaseHTTPRequestHandler` 的子類別,將用於處理請求。" #: ../../library/wsgiref.rst:322 msgid "" "You do not normally need to call this constructor, as the :func:" "`make_server` function can handle all the details for you." msgstr "" +"通常你不需要呼叫這個建構函式(constructor),因為 :func:`make_server` 函式可以為你處理所有細" +"節。" #: ../../library/wsgiref.rst:325 msgid "" @@ -403,16 +459,19 @@ msgid "" "of its methods (such as :meth:`serve_forever` and :meth:`handle_request`) " "are available. :class:`WSGIServer` also provides these WSGI-specific methods:" msgstr "" +":class:`WSGIServer` 是 :class:`http.server.HTTPServer` 的子類別,因此它的所有" +"方法(例如 :meth:`serve_forever` 和 :meth:`handle_request`)都可用。:class:" +"`WSGIServer` 也提供這些特定於 WSGI 的方法:" #: ../../library/wsgiref.rst:332 msgid "" "Sets the callable *application* as the WSGI application that will receive " "requests." -msgstr "" +msgstr "將可呼叫的 *application* 設定為接收請求的 WSGI 應用程式。" #: ../../library/wsgiref.rst:338 msgid "Returns the currently set application callable." -msgstr "" +msgstr "回傳目前設定應用程式的可呼叫物件。" #: ../../library/wsgiref.rst:340 msgid "" @@ -420,6 +479,9 @@ msgid "" "`set_app` is normally called by :func:`make_server`, and the :meth:`get_app` " "exists mainly for the benefit of request handler instances." msgstr "" +"然而,通常情況下你不需要去使用這些額外方法,因為 :meth:`set_app` 通常會被 :" +"func:`make_server` 呼叫而 :meth:`get_app` 主要存在於請求處理程式(handler)實" +"例的好處上。" #: ../../library/wsgiref.rst:347 msgid "" @@ -427,6 +489,9 @@ msgid "" "*client_address* (a ``(host,port)`` tuple), and *server* (:class:" "`WSGIServer` instance)." msgstr "" +"為給定的 *request*(即一個 socket)、*client_address*(一個 ``(host,port)`` " +"位元組)、*server* (:class:`WSGIServer` 實例) 建立一個 HTTP 處理程式" +"(handler)。" #: ../../library/wsgiref.rst:350 msgid "" @@ -436,6 +501,9 @@ msgid "" "`make_server` function. Some possibly relevant methods for overriding in " "subclasses:" msgstr "" +"你不需要直接建立這個類別的實例;它們會在需要時由 :class:`WSGIServer` 物件自動建" +"立。不過,你可以建立這個類別的子類別並將其作為 *handler_class* 提供給 :func:" +"`make_server` 函式。一些可能相關的方法可以在子類別中進行覆寫:" #: ../../library/wsgiref.rst:359 msgid "" @@ -446,12 +514,17 @@ msgid "" "return a new dictionary containing all of the relevant CGI environment " "variables as specified in :pep:`3333`." msgstr "" +"唯一個請求回傳一個 :data:`~wsgiref.types.WSGIEnvironment` 字典。預設的實作會" +"複製 :class:`WSGIServer` 物件的 :attr:`base_environ` 字典屬性的內容以及添加" +"從 HTTP 請求中衍生的各種標頭。每次呼叫這個方法都應該回傳一個包含所有如 :pep:" +"`3333` 所指定的相關 CGI 環境變數的新字典。" #: ../../library/wsgiref.rst:370 msgid "" "Return the object that should be used as the ``wsgi.errors`` stream. The " "default implementation just returns ``sys.stderr``." msgstr "" +"回傳的物件應該被用作 ``wsgi.errors`` 串流。預設實作只會回傳 ``sys.stderr``。" #: ../../library/wsgiref.rst:376 msgid "" @@ -459,10 +532,12 @@ msgid "" "instance using a :mod:`wsgiref.handlers` class to implement the actual WSGI " "application interface." msgstr "" +"處理 HTTP 請求。預設實作會使用 :mod:`wsgiref.handler` 類別來建立處置程式" +"(handler)實例來實作實際 WSGI 應用程式介面。" #: ../../library/wsgiref.rst:382 msgid ":mod:`wsgiref.validate` --- WSGI conformance checker" -msgstr "" +msgstr ":mod:`wsgiref.validate` --- WSGI 符合性檢查" #: ../../library/wsgiref.rst:388 msgid "" @@ -473,6 +548,10 @@ msgid "" "gateway and a WSGI application object, to check both sides for protocol " "conformance." msgstr "" +"當建立新的 WSGI 應用程式物件、框架、伺服器、或是中介軟體(middleware)時,使" +"用 :mod:`wsgiref.validate` 來驗證新程式碼的符合性可能會很有用。這個模組提供一" +"個函式用於建立 WSGI 應用程式物件,並用於驗證 WSGI 伺服器或是閘道與 WSGI 應用" +"程式物件之間的通訊,以檢查雙方協議的符合性。" #: ../../library/wsgiref.rst:395 msgid "" @@ -482,12 +561,17 @@ msgid "" "virtually certain that either the server or application is not 100% " "compliant." msgstr "" +"請注意這個工具並不保證完全符合 :pep:`3333`;這個模組中的錯誤不一定代表不存在" +"錯誤。但是,如果如果這個模組產生錯誤,那麼幾乎可以確定伺服器或應用程式不是 " +"100% 符合標準。" #: ../../library/wsgiref.rst:400 msgid "" "This module is based on the :mod:`paste.lint` module from Ian Bicking's " "\"Python Paste\" library." msgstr "" +"這個模組基於 Ian Bicking 的 \"Python Paste\" 函式庫的 :mod:`paste.lint` 模" +"組。" #: ../../library/wsgiref.rst:406 msgid "" @@ -496,6 +580,9 @@ msgid "" "will check that both the *application* and the server invoking it are " "conforming to the WSGI specification and to :rfc:`2616`." msgstr "" +"包裝 *application* 並回傳一個新的 WSGI 應用程式物件。回傳的應用程式將轉發所有" +"請求給原始的 *application*,並檢查 *application* 和呼叫它的伺服器是否符合 " +"WSGI 規範和 :rfc:`2616`。" #: ../../library/wsgiref.rst:411 msgid "" @@ -507,6 +594,11 @@ msgid "" "occurred, and dump the traceback to ``sys.stderr`` or some other error " "stream." msgstr "" +"任何在 :exc:`AssertionError` 中偵測不符合結果都會發起例外;但請注意,如何處理" +"這些錯誤取決於伺服器。例如,基於 :mod:`wsgiref.handlers` 的 :mod:`wsgiref." +"simple_server` 以及其他伺服器(未覆蓋錯誤處理方法以執行其他操作的伺服器)將僅" +"輸出一條錯誤訊息,指示發生錯誤,並將回溯訊息輸出到 ``sys.stderr`` 或是其他錯" +"誤串流。" #: ../../library/wsgiref.rst:418 msgid "" @@ -517,10 +609,14 @@ msgid "" "to ``sys.stderr`` (*not* ``wsgi.errors``, unless they happen to be the same " "object)." msgstr "" +"這個包裝器也可以使用 :mod:`warnings` 模組生成輸出去指示一些可能有疑慮但實際上" +"可能不會被 :pep:`3333` 禁止的行為。除非使用 Python 命令列選項或 :mod:" +"`warnings` API,抑制了這些警告,否則這類警告將被寫入到 ``sys.stderr``(*not* " +"``wsgi.errors``,除非它們碰巧是相同的物件)。" #: ../../library/wsgiref.rst:450 msgid ":mod:`wsgiref.handlers` -- server/gateway base classes" -msgstr "" +msgstr ":mod:`wsgiref.handlers` -- 伺服器 / 閘道基本類別" #: ../../library/wsgiref.rst:456 msgid "" @@ -529,6 +625,9 @@ msgid "" "a WSGI application, as long as they are given a CGI-like environment, along " "with input, output, and error streams." msgstr "" +"這個模組提供實作 WSGI 伺服器和閘道的基礎處理程式(handler)類別。這些基底類別" +"處理程式大部分與 WSGI 應用程式通訊的工作,只要它們被提供 CGI-like 環境,以及" +"輸入、輸出和錯誤串流。" #: ../../library/wsgiref.rst:464 msgid "" @@ -537,6 +636,10 @@ msgid "" "run it as a CGI script. Simply invoke ``CGIHandler().run(app)``, where " "``app`` is the WSGI application object you wish to invoke." msgstr "" +"這是基於 CGI 的呼叫方式並透過 ``sys.stdin``、``sys.stdout``、``sys.stderr`` " +"和 ``os.environ``。當你擁有一個 WSGI 應用程式並希望將其作為 CGI 腳本運行時是" +"很有用的。只需呼叫 ``CGIHandler().run(app)``,其中 ``app`` 是你希望呼叫的 " +"WSGI 應用程式物件。" #: ../../library/wsgiref.rst:469 msgid "" @@ -545,6 +648,9 @@ msgid "" "to true, and always uses :mod:`sys` and :mod:`os` to obtain the necessary " "CGI streams and environment." msgstr "" +"這個類別是 :class:`BaseCGIHandler` 的子類別將 ``wsgi.run_once`` 設置為 true," +"``wsgi.multithread``設置為 false,並將 ``wsgi.multiprocess`` 設置為 true,並" +"且始終使用 :mod:`sys` 和 :mod:`os` 來獲取所需的 CGI 串流以及環境。" #: ../../library/wsgiref.rst:477 msgid "" @@ -552,6 +658,9 @@ msgid "" "Microsoft's IIS web server, without having set the config allowPathInfo " "option (IIS>=7) or metabase allowPathInfoForScriptMappings (IIS<7)." msgstr "" +"這是用於在 Microsoft 的 IIS 網頁伺服器上部署時使用的 :class:`CGIHandler` 的一" +"個專門替代選擇,無需設置 config 的 allowPathInfo 選項(IIS>=7),或 metabase " +"的 allowPathInfoForScriptMappings 選項(IIS<7)。" #: ../../library/wsgiref.rst:481 msgid "" @@ -559,6 +668,9 @@ msgid "" "the front, causing problems for WSGI applications that wish to implement " "routing. This handler strips any such duplicated path." msgstr "" +"預設情況下,IIS 提供的 ``PATH_INFO`` 會在前面複製 ``SCRIPT_NAME``,對於希望實" +"作路由的 WSGI 應用程式造成問題。這個處理程式(handler)會移除任何這樣的重複路" +"徑。" #: ../../library/wsgiref.rst:485 msgid "" @@ -570,6 +682,11 @@ msgid "" "IIS<7 is almost never deployed with the fix (Even IIS7 rarely uses it " "because there is still no UI for it.)." msgstr "" +"IIS 可以配置去傳遞正確的 ``PATH_INFO``,但這會導致 ``PATH_TRANSLATED`` 是錯誤" +"的問題。幸運的是這個變數很少被使用並且不受 WSGI 保證。然而,在 IIS<7 上,這個" +"設置只能在虛擬主機層級進行,影響所有其他腳本的對映,其中許多在暴露 " +"``PATH_TRANSLATED`` 問題時會中斷。由於這個原因幾乎從不會使用修復的 IIS<7(即" +"使是 IIS7 也很少使用它,因為它仍然沒有相應的 UI)。" #: ../../library/wsgiref.rst:493 msgid "" @@ -578,6 +695,9 @@ msgid "" "`CGIHandler`, i.e., by calling ``IISCGIHandler().run(app)``, where ``app`` " "is the WSGI application object you wish to invoke." msgstr "" +"CGI 程式碼無法知道是否已設置該選項,因此提供了一個獨立的處理程式(handler)類" +"別。它的使用方式與 :class:`CGIHandler` 相同,即透過呼叫 ``IISCGIHandler()." +"run(app)`` 來使用,其中 ``app`` 是你希望呼叫的 WSGI 應用程式物件。" #: ../../library/wsgiref.rst:503 msgid "" @@ -587,6 +707,9 @@ msgid "" "multithread`` and ``wsgi.multiprocess`` flags for any applications run by " "the handler instance." msgstr "" +"類似於 :class:`CGIHandler`,但不是使用 :mod:`sys` 和 :mod:`os` 模組,而是明確" +"指定 CGI 環境與 I/O 串流。*multithread* 和 *multiprocess* 值用於設置由處理程" +"式(handler)實例運行的任何應用程式的旗標。" #: ../../library/wsgiref.rst:509 msgid "" @@ -596,6 +719,10 @@ msgid "" "``Status:`` header to send an HTTP status, you probably want to subclass " "this instead of :class:`SimpleHandler`." msgstr "" +"這個類別是專門為除了 HTTP \"origin servers\" 以外的軟體一起使用的 :class:" +"`SimpleHandler` 的子類別。如果你正在撰寫一個使用 ``Status:`` 標頭來發送 HTTP " +"狀態的閘道協議實作(例如 CGI、FastCGI、SCGI 等),你可能會想要子類化這個類別" +"來替代 :class:`SimpleHandler`。" #: ../../library/wsgiref.rst:518 msgid "" @@ -603,6 +730,9 @@ msgid "" "servers. If you are writing an HTTP server implementation, you will " "probably want to subclass this instead of :class:`BaseCGIHandler`." msgstr "" +"類似於 :class:`BaseCGIHandler`,但是被設計使用在 HTTP origin 伺服器。如果你正" +"在撰寫 HTTP 伺服器的實作,你可能會想要子類別化這個類別來替代 :class:" +"`BaseCGIHandler`。" #: ../../library/wsgiref.rst:522 msgid "" @@ -613,12 +743,19 @@ msgid "" "streams are stored in the :attr:`stdin`, :attr:`stdout`, :attr:`stderr`, " "and :attr:`environ` attributes." msgstr "" +"這個類別是 :class:`BaseHandler` 的子類別。它透過建構器去覆寫 :meth:" +"`__init__`、:meth:`get_stdin`、:meth:`get_stderr`、:meth:`add_cgi_vars`、:" +"meth:`_write`、和 :meth:`_flush` 方法來明確提供設置環境與串流。提供的環境與串" +"流被儲存在 :attr:`stdin`、:attr:`stdout`、:attr:`stderr`、和 :attr:`environ` " +"環境中。" #: ../../library/wsgiref.rst:529 msgid "" "The :meth:`~io.BufferedIOBase.write` method of *stdout* should write each " "chunk in full, like :class:`io.BufferedIOBase`." msgstr "" +"*stdout* 的 :meth:`~io.BufferedIOBase.write` 方法應該完整地寫入每個塊(chunk),像是 :" +"class:`io.BufferedIOBase`。" #: ../../library/wsgiref.rst:535 msgid "" @@ -626,16 +763,18 @@ msgid "" "will handle a single HTTP request, although in principle you could create a " "subclass that was reusable for multiple requests." msgstr "" +"這是一個運行 WSGI 應用程式的抽象基底類別。每個實例將處理單個 HTTP 請求,儘管" +"原則上你可以建立一個可重用於多個請求的子類別。" #: ../../library/wsgiref.rst:539 msgid "" ":class:`BaseHandler` instances have only one method intended for external " "use:" -msgstr "" +msgstr ":class:`BaseHandler` 實例只有一個供外部使用的方法:" #: ../../library/wsgiref.rst:544 msgid "Run the specified WSGI application, *app*." -msgstr "" +msgstr "運行指定 WSGI 應用程式,*app*。" #: ../../library/wsgiref.rst:546 msgid "" @@ -643,10 +782,12 @@ msgid "" "the process of running the application, and thus exist primarily to allow " "customizing the process." msgstr "" +"此方法在運行應用程式的過程中呼叫了所有其他 :class:`BaseHandler` 的方法,因此" +"這些方法主要存在是為了允許自定義整個過程。" #: ../../library/wsgiref.rst:550 msgid "The following methods MUST be overridden in a subclass:" -msgstr "" +msgstr "以下方法必須在子類別中覆寫:" #: ../../library/wsgiref.rst:555 msgid "" @@ -655,12 +796,17 @@ msgid "" "write and flush operations for greater efficiency when the underlying system " "actually has such a distinction." msgstr "" +"緩衝要傳送給用戶端的位元組 *data*。如果這個方法實際上傳送了數據也是可以的;當" +"底層系統實際具有這種區分時,:class:`BaseHandler` 為了更好的效能進而分離寫入和" +"刷新操作。" #: ../../library/wsgiref.rst:563 msgid "" "Force buffered data to be transmitted to the client. It's okay if this " "method is a no-op (i.e., if :meth:`_write` actually sends the data)." msgstr "" +"強制將緩衝數據傳送到用戶端。如果這是一個無操作(no-op)的方法(即,如果 :" +"meth:`_write` 實際上發送了數據),那麼是可以的。" #: ../../library/wsgiref.rst:569 msgid "" @@ -668,6 +814,8 @@ msgid "" "suitable for use as the ``wsgi.input`` of the request currently being " "processed." msgstr "" +"回傳一個與 :class:`~wsgiref.types.InputStream` 相容的物件並適用於用作當前正在" +"處理請求的 ``wsgi.input``。" #: ../../library/wsgiref.rst:576 msgid "" @@ -675,12 +823,14 @@ msgid "" "suitable for use as the ``wsgi.errors`` of the request currently being " "processed." msgstr "" +"回傳一個與 :class:`~wsgiref.types.ErrorStream` 相容的物件並適用於用作當前正在" +"處理請求的 ``wsgi.errors``。" #: ../../library/wsgiref.rst:583 msgid "" "Insert CGI variables for the current request into the :attr:`environ` " "attribute." -msgstr "" +msgstr "將當前請求的 CGI 變數插入到 :attr:`environ` 屬性中。" #: ../../library/wsgiref.rst:585 msgid "" @@ -690,10 +840,13 @@ msgid "" "additional information before attempting to create a customized :class:" "`BaseHandler` subclass." msgstr "" +"以下是你可能希望覆寫的其他方法和屬性。這個列表只是一個摘要,然而,不包括可以" +"被覆寫的每個方法。在嘗試建立自定義的 :class:`BaseHandler` 子類別之前,你應該" +"參考文件說明和原始碼以獲得更多資訊。" #: ../../library/wsgiref.rst:591 msgid "Attributes and methods for customizing the WSGI environment:" -msgstr "" +msgstr "用於自定義 WSGI 環境的屬性和方法:" #: ../../library/wsgiref.rst:596 msgid "" @@ -701,6 +854,8 @@ msgid "" "defaults to true in :class:`BaseHandler`, but may have a different default " "(or be set by the constructor) in the other subclasses." msgstr "" +"用於 ``wsgi.multithread`` 環境變數的值。在 :class:`BaseHandler` 中預設為 " +"true,但在其他子類別中可能有不同的預設值(或由建構函式設置)。" #: ../../library/wsgiref.rst:603 msgid "" @@ -708,6 +863,8 @@ msgid "" "defaults to true in :class:`BaseHandler`, but may have a different default " "(or be set by the constructor) in the other subclasses." msgstr "" +"用於 ``wsgi.multiprocess`` 環境變數的值。在 :class:`BaseHandler` 中預設為 " +"true,但在其他子類別中可能有不同的預設值(或由建構函式設置)。" #: ../../library/wsgiref.rst:610 msgid "" @@ -715,6 +872,8 @@ msgid "" "defaults to false in :class:`BaseHandler`, but :class:`CGIHandler` sets it " "to true by default." msgstr "" +"用於 ``wsgi.run_once`` 環境變數的值。在 :class:`BaseHandler` 中預設為 false," +"但 :class:`CGIHandler` 預設將其設置為 true。" #: ../../library/wsgiref.rst:617 msgid "" @@ -725,6 +884,9 @@ msgid "" "considered read-only, since the default value is shared between multiple " "classes and instances." msgstr "" +"預設環境變數包含在每一個請求的 WSGI 環境中。預設情況下,這是在載入 :mod:" +"`wsgiref.handlers` 時的 `os.environ` 副本,但子類別可以在類別或實例層級建立自" +"己的副本。注意字典應該被視為唯讀,因為預設值在多個類別與實例中共享。" #: ../../library/wsgiref.rst:627 msgid "" @@ -734,12 +896,17 @@ msgid "" "for handlers (such as :class:`BaseCGIHandler` and :class:`CGIHandler`) that " "are not HTTP origin servers." msgstr "" +"如果設置 :attr:`origin_server` 屬性,則此屬性的值將用於設置預設的 " +"``SERVER_SOFTWARE`` WSGI 環境變數,並且還將用於設置 HTTP 回應中的預設 " +"``Server:`` 標頭。對於不是 HTTP origin 伺服器的處置程式(例如 :class:" +"`BaseCGIHandler` 和 :class:`CGIHandler`),此屬性將被忽略。" #: ../../library/wsgiref.rst:633 msgid "" "The term \"Python\" is replaced with implementation specific term like " "\"CPython\", \"Jython\" etc." msgstr "" +"將術語 \"Python\" 替換為特定實作的術語,如 \"CPython\"、\"Jython\" 等。" #: ../../library/wsgiref.rst:639 msgid "" @@ -748,6 +915,9 @@ msgid "" "util` to guess whether the scheme should be \"http\" or \"https\", based on " "the current request's :attr:`environ` variables." msgstr "" +"回傳用於當前請求的 URL scheme。預設的實作使用 :mod:`wsgiref.util` 中的 :func:" +"`guess_scheme` 函式去猜測 scheme 是 \"http\" 或是 \"https\",基於目前請求的 :" +"attr:`environ` 變數。" #: ../../library/wsgiref.rst:647 msgid "" @@ -758,10 +928,15 @@ msgid "" "``SERVER_SOFTWARE`` key if not present, as long as the :attr:`origin_server` " "attribute is a true value and the :attr:`server_software` attribute is set." msgstr "" +"將 :attr:`environ` 屬性設置為完全填充的 WSGI 環境。預設的實作使用上述所有方法" +"和屬性,以及 :meth:`get_stdin`、:meth:`get_stderr` 和 :meth:`add_cgi_vars` 方" +"法以及 :attr:`wsgi_file_wrapper` 屬性。如果不呈現它也會插入一個 " +"``SERVER_SOFTWARE`` 關鍵字,只要 :attr:`origin_server` 屬性是一個 true 值並" +"且 :attr:`server_software` 屬性被設置。" #: ../../library/wsgiref.rst:654 msgid "Methods and attributes for customizing exception handling:" -msgstr "" +msgstr "用於自定義例外處理的屬性和方法:" #: ../../library/wsgiref.rst:659 msgid "" @@ -772,18 +947,26 @@ msgid "" "traceback to an administrator, or whatever other action may be deemed " "suitable." msgstr "" +"將 *exc_info* 元組記錄到伺服器日誌中。*exc_info* 是一個 ``(type, value, " +"traceback)`` 元組。預設實作只是將追蹤資訊寫入到請求的 ``wsgi.errors`` 串流中" +"並刷新它。子類別可以覆蓋此方法以更改格式或重新定向輸出,將追蹤資訊發送給管理" +"員,或執行其他被認為合適的操作。" #: ../../library/wsgiref.rst:668 msgid "" "The maximum number of frames to include in tracebacks output by the default :" "meth:`log_exception` method. If ``None``, all frames are included." msgstr "" +"預設的 :meth:`log_exception` 方法追蹤輸出中包含的最大幀數 。如果為 ``None``," +"則包含所有幀。" #: ../../library/wsgiref.rst:674 msgid "" "This method is a WSGI application to generate an error page for the user. " "It is only invoked if an error occurs before headers are sent to the client." msgstr "" +"這個方法是一個為使用者去產生錯誤頁面的 WSGI 應用程式。只有在標頭傳送給用戶端" +"前如果發生錯誤才會被呼叫。" #: ../../library/wsgiref.rst:677 msgid "" @@ -791,6 +974,8 @@ msgid "" "should pass that information to *start_response* when calling it (as " "described in the \"Error Handling\" section of :pep:`3333`)." msgstr "" +"此方法使用 ``sys.exception()`` 存取當前的錯誤,當呼叫它(如 :pep:`3333` 的 " +"\"Error Handling\" 部分所描述)時應該傳遞資訊給 *start_response*。" #: ../../library/wsgiref.rst:681 msgid "" @@ -798,6 +983,8 @@ msgid "" "`error_headers`, and :attr:`error_body` attributes to generate an output " "page. Subclasses can override this to produce more dynamic error output." msgstr "" +"預設的實作只是使用 :attr:`error_status`、:attr:`error_headers` 和 :attr:" +"`error_body` 屬性產生輸出頁面。子類別可以覆蓋此方法以生成更動態的錯誤輸出。" #: ../../library/wsgiref.rst:685 msgid "" @@ -806,12 +993,16 @@ msgid "" "special to enable diagnostic output, which is why the default implementation " "doesn't include any." msgstr "" +"然而,從安全的角度並不建議向任何普通使用者顯示診斷資訊;理想情況下,你應該需" +"要採取特殊措施才能啟用診斷輸出,這就是預設實作不包括任何診斷資訊的原因。" #: ../../library/wsgiref.rst:693 msgid "" "The HTTP status used for error responses. This should be a status string as " "defined in :pep:`3333`; it defaults to a 500 code and message." msgstr "" +"用於錯誤回應的 HTTP 狀態。這應該是一個按照 :pep:`3333` 定義的狀態字串;預設" +"為 500 狀態碼和訊息。" #: ../../library/wsgiref.rst:699 msgid "" @@ -819,6 +1010,9 @@ msgid "" "response headers (``(name, value)`` tuples), as described in :pep:`3333`. " "The default list just sets the content type to ``text/plain``." msgstr "" +"用於錯誤回應的 HTTP 標頭。這應該是一個 WSGI 回應標頭的串列(``(name, " +"value)`` 元組),如 :pep:`3333` 中所描述。預設串列只設置內容種類為 ``text/" +"plain``。" #: ../../library/wsgiref.rst:706 msgid "" @@ -826,12 +1020,16 @@ msgid "" "It defaults to the plain text, \"A server error occurred. Please contact " "the administrator.\"" msgstr "" +"錯誤回應的主體。這應該是一個 HTTP 回應內容的位元組字串。預設為純文字 \"A " +"server error occurred. Please contact the administrator.\"" #: ../../library/wsgiref.rst:710 msgid "" "Methods and attributes for :pep:`3333`'s \"Optional Platform-Specific File " "Handling\" feature:" msgstr "" +"用於 :pep:`3333` 中的 \"Optional Platform-Specific File Handling\" 功能的方法" +"和屬性:" #: ../../library/wsgiref.rst:716 msgid "" @@ -839,6 +1037,9 @@ msgid "" "FileWrapper`, or ``None``. The default value of this attribute is the :" "class:`wsgiref.util.FileWrapper` class." msgstr "" +"一個 ``wsgi.file_wrapper`` 工廠函式(factory),與 :class:`wsgiref.types." +"FileWrapper` 相容,或者為 ``None``。這個屬性的預設值是 :class:`wsgiref.util." +"FileWrapper` 類別。" #: ../../library/wsgiref.rst:723 msgid "" @@ -849,10 +1050,14 @@ msgid "" "default transmission code will not be executed. The default implementation " "of this method just returns a false value." msgstr "" +"覆蓋以實作特定平台的檔案傳輸。只有當應用程式的回傳值是由 :attr:" +"`wsgi_file_wrapper` 屬性指定的類別實例時才會呼叫此方法。如果它能夠成功傳輸檔" +"案應該回傳一個 true 值,以便不執行預設的傳輸程式碼。該方法的預設實作只回傳一" +"個 false 值。" #: ../../library/wsgiref.rst:730 msgid "Miscellaneous methods and attributes:" -msgstr "" +msgstr "其他方法和屬性:" #: ../../library/wsgiref.rst:735 msgid "" @@ -861,18 +1066,25 @@ msgid "" "rather than via a CGI-like gateway protocol that wants the HTTP status in a " "special ``Status:`` header." msgstr "" +"這個屬性應該被設置為 true 值,如果處理程式(handler)的 :meth:`_write` 和 :" +"meth:`_flush` 被用於直接與用戶端通訊,而不是透過 CGI-like 的閘道協議希望 " +"HTTP 狀態在特殊的 ``Status:`` 標頭中。" #: ../../library/wsgiref.rst:740 msgid "" "This attribute's default value is true in :class:`BaseHandler`, but false " "in :class:`BaseCGIHandler` and :class:`CGIHandler`." msgstr "" +"這個屬性在 :class:`BaseCGIHandler` 預設值為 true,但是在 :class:" +"`BaseCGIHandler` 和 :class:`CGIHandler` 為 false。" #: ../../library/wsgiref.rst:746 msgid "" "If :attr:`origin_server` is true, this string attribute is used to set the " "HTTP version of the response set to the client. It defaults to ``\"1.0\"``." msgstr "" +"如果 :attr:`origin_server` 為 true,則此字串屬性用於設定傳送給用戶端的回應的 " +"HTTP 版本。預設為 ``\"1.0\"``。" #: ../../library/wsgiref.rst:752 msgid "" @@ -885,6 +1097,12 @@ msgid "" "bytes, but the system encoding used by Python to decode it is anything other " "than ISO-8859-1 (e.g. Unix systems using UTF-8)." msgstr "" +"從 ``os.environ`` 轉碼 CGI 變數到 :pep:`3333` 中的 \"bytes in unicode\" 字" +"串,並回傳一個新字典。這個函式被 :class:`CGIHandler` 和 :class:" +"`IISCGIHandler` 使用來直接替代 ``os.environ``,在所有平台和使用 Python 3 的網" +"頁伺服器上不一定符合 WSGI 標準,具體來說,在 OS 的實際環境是 Unicode(例如 " +"Windows)的情況下,或者在環境是位元組的情況下,但 Python 用於解碼它的系統編碼" +"不是 ISO-8859-1 (例如使用 UTF-8 的 Unix 系統)。" #: ../../library/wsgiref.rst:761 msgid "" @@ -892,42 +1110,50 @@ msgid "" "to use this routine instead of just copying values out of ``os.environ`` " "directly." msgstr "" +"如果你自己正在實作 CGI-based 處理程式(handler),你可能想要使用這個函式來替" +"換單純直接從 ``os.environ`` 中複製值。" #: ../../library/wsgiref.rst:769 msgid ":mod:`wsgiref.types` -- WSGI types for static type checking" -msgstr "" +msgstr ":mod:`wsgiref.types` -- 用於靜態型別檢查的 WSGI 型別。" #: ../../library/wsgiref.rst:775 msgid "" "This module provides various types for static type checking as described in :" "pep:`3333`." -msgstr "" +msgstr "這個模組提供在 :pep:`3333` 中所描述的各種用於靜態型別檢查的型別。" #: ../../library/wsgiref.rst:783 msgid "" "A :class:`typing.Protocol` describing `start_response() `_ callables (:pep:`3333`)." msgstr "" +"一個描述 `start_response() `_ 可呼叫物件的 :class:`typing.Protocol` (:pep:`3333`)。" #: ../../library/wsgiref.rst:789 msgid "A type alias describing a WSGI environment dictionary." -msgstr "" +msgstr "一個描述 WSGI 環境字典的型別別名。" #: ../../library/wsgiref.rst:793 msgid "A type alias describing a WSGI application callable." -msgstr "" +msgstr "一個描述 WSGI 應用程式可呼叫物件的型別別名。" #: ../../library/wsgiref.rst:797 msgid "" "A :class:`typing.Protocol` describing a `WSGI Input Stream `_." msgstr "" +"一個描述 `WSGI 輸入串流 `_\\ 的 :class:`typing.Protocol`。" #: ../../library/wsgiref.rst:802 msgid "" "A :class:`typing.Protocol` describing a `WSGI Error Stream `_." msgstr "" +"一個描述 `WSGI 錯誤串流 `_\\ 的 :class:`typing.Protocol`。" #: ../../library/wsgiref.rst:807 msgid "" @@ -935,6 +1161,9 @@ msgid "" "org/pep-3333/#optional-platform-specific-file-handling>`_. See :class:" "`wsgiref.util.FileWrapper` for a concrete implementation of this protocol." msgstr "" +"一個描述\\ `檔案包裝器 `_\\ 的 :class:`typing.Protocol`。請參閱 :class:" +"`wsgiref.util.FileWrapper` 來瞭解此協議的具體實作。" #: ../../library/wsgiref.rst:814 msgid "Examples" @@ -942,10 +1171,12 @@ msgstr "範例" #: ../../library/wsgiref.rst:816 msgid "This is a working \"Hello World\" WSGI application::" -msgstr "" +msgstr "這個一個運作中的 \"Hello World\" WSGI 應用程式: ::" #: ../../library/wsgiref.rst:845 msgid "" "Example of a WSGI application serving the current directory, accept optional " "directory and port number (default: 8000) on the command line::" msgstr "" +"提供當前目錄的 WSGI 應用程式範例,並接受命令列上的可選目錄和埠號(預設:" +"8000): ::" From 430edde50b362ec6c7694426042b48081ebd6755 Mon Sep 17 00:00:00 2001 From: Becca <61359625+Tzu-Han5667@users.noreply.github.com> Date: Tue, 7 Nov 2023 06:39:39 +0800 Subject: [PATCH 26/39] 1106_stdtypes_3&4 (#697) * 1106_stdtypes_ & * 1106_stdtypes_3&4_v2 * 1106_stdtypes_3&4_v3 * 1106_stdtypes_3&4_v4 * 1107_stdtypes_3&4_v5 * 1107_stdtypes_3&4_v6 --- library/stdtypes.po | 65 +++++++++++++++++++++++++++++++++------------ 1 file changed, 48 insertions(+), 17 deletions(-) diff --git a/library/stdtypes.po b/library/stdtypes.po index bbf06b1866..a756d68e37 100644 --- a/library/stdtypes.po +++ b/library/stdtypes.po @@ -114,18 +114,18 @@ msgstr "" #: ../../library/stdtypes.rst:78 msgid "Boolean Operations --- :keyword:`!and`, :keyword:`!or`, :keyword:`!not`" -msgstr "" +msgstr "Boolean(布林)運算 --- :keyword:`!and`, :keyword:`!or`, :keyword:`!not`" #: ../../library/stdtypes.rst:82 msgid "These are the Boolean operations, ordered by ascending priority:" -msgstr "" +msgstr "下方為 Boolean 運算,按優先順序排序:" #: ../../library/stdtypes.rst:85 ../../library/stdtypes.rst:143 #: ../../library/stdtypes.rst:275 ../../library/stdtypes.rst:363 #: ../../library/stdtypes.rst:413 ../../library/stdtypes.rst:961 #: ../../library/stdtypes.rst:1166 msgid "Operation" -msgstr "" +msgstr "運算" #: ../../library/stdtypes.rst:85 ../../library/stdtypes.rst:275 #: ../../library/stdtypes.rst:363 ../../library/stdtypes.rst:413 @@ -146,7 +146,7 @@ msgstr "``x or y``" #: ../../library/stdtypes.rst:87 msgid "if *x* is true, then *x*, else *y*" -msgstr "" +msgstr "假如 *x* 為真,則 *x*,否則 *y*" #: ../../library/stdtypes.rst:87 ../../library/stdtypes.rst:285 #: ../../library/stdtypes.rst:963 ../../library/stdtypes.rst:966 @@ -161,7 +161,7 @@ msgstr "``x and y``" #: ../../library/stdtypes.rst:90 msgid "if *x* is false, then *x*, else *y*" -msgstr "" +msgstr "假如 *x* 為假,則 *x*,否則 *y*" #: ../../library/stdtypes.rst:90 ../../library/stdtypes.rst:288 #: ../../library/stdtypes.rst:308 ../../library/stdtypes.rst:1205 @@ -176,7 +176,7 @@ msgstr "``not x``" #: ../../library/stdtypes.rst:93 msgid "if *x* is false, then ``True``, else ``False``" -msgstr "" +msgstr "假如 *x* 為假,則 ``True``,否則 ``False``" #: ../../library/stdtypes.rst:93 ../../library/stdtypes.rst:975 #: ../../library/stdtypes.rst:1208 ../../library/stdtypes.rst:2430 @@ -199,22 +199,28 @@ msgid "" "This is a short-circuit operator, so it only evaluates the second argument " "if the first one is false." msgstr "" +"這是一個短路運算子,所以他只有在第一個變數為假時," +"才會對第二個變數求值。" #: ../../library/stdtypes.rst:109 msgid "" "This is a short-circuit operator, so it only evaluates the second argument " "if the first one is true." msgstr "" +"這是一個短路運算子,所以他只有在第一個變數為真時," +"才會對第二個變數求值。" #: ../../library/stdtypes.rst:113 msgid "" "``not`` has a lower priority than non-Boolean operators, so ``not a == b`` " "is interpreted as ``not (a == b)``, and ``a == not b`` is a syntax error." msgstr "" +"``not`` 比非 Boolean 運算子有較低的優先權,因此 ``not a == b`` " +"可直譯為 ``not (a == b)``,而 ``a == not b`` 會導致語法錯誤。" #: ../../library/stdtypes.rst:120 msgid "Comparisons" -msgstr "" +msgstr "比較運算" #: ../../library/stdtypes.rst:134 msgid "" @@ -224,16 +230,21 @@ msgid "" "< y and y <= z``, except that *y* is evaluated only once (but in both cases " "*z* is not evaluated at all when ``x < y`` is found to be false)." msgstr "" +"在 Python 裡共有 8 種比較運算。他們的優先順序都相同" +"(皆優先於 Boolean 運算)。比較運算" +"可以任意的串連;例如,``x < y <= z`` 等同於 " +"``x < y and y <= z``,差異只在於前者的 *y* 只有被求值一次(但在這兩個例子" +"中,當 ``x < y`` 為假時,*z* 皆不會被求值)。" #: ../../library/stdtypes.rst:140 msgid "This table summarizes the comparison operations:" -msgstr "" +msgstr "這個表格統整所有比較運算:" #: ../../library/stdtypes.rst:143 ../../library/stdtypes.rst:2393 #: ../../library/stdtypes.rst:2416 ../../library/stdtypes.rst:3611 #: ../../library/stdtypes.rst:3634 msgid "Meaning" -msgstr "" +msgstr "含義" #: ../../library/stdtypes.rst:145 msgid "``<``" @@ -241,7 +252,7 @@ msgstr "``<``" #: ../../library/stdtypes.rst:145 msgid "strictly less than" -msgstr "" +msgstr "小於" #: ../../library/stdtypes.rst:147 msgid "``<=``" @@ -249,7 +260,7 @@ msgstr "``<=``" #: ../../library/stdtypes.rst:147 msgid "less than or equal" -msgstr "" +msgstr "小於等於" #: ../../library/stdtypes.rst:149 msgid "``>``" @@ -257,7 +268,7 @@ msgstr "``>``" #: ../../library/stdtypes.rst:149 msgid "strictly greater than" -msgstr "" +msgstr "大於" #: ../../library/stdtypes.rst:151 msgid "``>=``" @@ -265,7 +276,7 @@ msgstr "``>=``" #: ../../library/stdtypes.rst:151 msgid "greater than or equal" -msgstr "" +msgstr "大於等於" #: ../../library/stdtypes.rst:153 msgid "``==``" @@ -273,7 +284,7 @@ msgstr "``==``" #: ../../library/stdtypes.rst:153 msgid "equal" -msgstr "" +msgstr "等於" #: ../../library/stdtypes.rst:155 msgid "``!=``" @@ -281,7 +292,7 @@ msgstr "``!=``" #: ../../library/stdtypes.rst:155 msgid "not equal" -msgstr "" +msgstr "不等於" #: ../../library/stdtypes.rst:157 msgid "``is``" @@ -289,7 +300,7 @@ msgstr "``is``" #: ../../library/stdtypes.rst:157 msgid "object identity" -msgstr "" +msgstr "物件識別" #: ../../library/stdtypes.rst:159 msgid "``is not``" @@ -297,7 +308,7 @@ msgstr "``is not``" #: ../../library/stdtypes.rst:159 msgid "negated object identity" -msgstr "" +msgstr "否定的物件識別" #: ../../library/stdtypes.rst:166 msgid "" @@ -308,12 +319,20 @@ msgid "" "example, they raise a :exc:`TypeError` exception when one of the arguments " "is a complex number." msgstr "" +"除了不同的數字型別外,不同型別的物件不能進行相等比較。" +"運算子 ``==`` 總有定義,但在某些物件類型(例如, " +"class 物件)時,運算子會等同於 :keyword:`is`。 其他運算子 ``<``、``<=``、" +"``>`` 及 ``>=`` 皆僅在有意義的部分有所定義;例如," +"當其中一個引數為複數時," +"將引發一個 :exc:`TypeError` 的例外。" #: ../../library/stdtypes.rst:180 msgid "" "Non-identical instances of a class normally compare as non-equal unless the " "class defines the :meth:`~object.__eq__` method." msgstr "" +"一個 class 的非相同實例通常會比較為不相等,除非 " +"class 有定義 :meth:`~object.__eq__` method。" #: ../../library/stdtypes.rst:183 msgid "" @@ -324,6 +343,12 @@ msgid "" "meth:`~object.__eq__` are sufficient, if you want the conventional meanings " "of the comparison operators)." msgstr "" +"一個 class 的實例不可以與其他相同 class 的實例" +"或其他物件的類別進行排序,除非 class 定義足夠的" +" method ,包含 :meth:`~object.__lt__`、:meth:`~object.__le__`、:meth:`~object." +"__gt__` 及 :meth:`~object.__ge__`\\ (一般來說,使用 :meth:`~object.__lt__` 及 :" +"meth:`~object.__eq__` 就可以滿足" +"常規意義上的比較運算子)。" #: ../../library/stdtypes.rst:190 msgid "" @@ -331,6 +356,9 @@ msgid "" "customized; also they can be applied to any two objects and never raise an " "exception." msgstr "" +"無法自定義 :keyword:`is` 與 :keyword:`is not` 運算子的行為" +";這兩個運算子也可以運用在任意兩個物件且不會導致" +"例外。" #: ../../library/stdtypes.rst:198 msgid "" @@ -338,6 +366,9 @@ msgid "" "keyword:`not in`, are supported by types that are :term:`iterable` or " "implement the :meth:`__contains__` method." msgstr "" +"此外,擁有相同的語法優先序的 :keyword:`in` 及 :keyword:`not in` 兩種運算" +"皆被是 :term:`iterable` 或者" +"有實作 :meth:`__contains__` method 的型別所支援。" #: ../../library/stdtypes.rst:205 msgid "Numeric Types --- :class:`int`, :class:`float`, :class:`complex`" From ff8005f8b029df9898f67278e0bc8130697c570e Mon Sep 17 00:00:00 2001 From: RockLeon <34214497+rockleona@users.noreply.github.com> Date: Thu, 9 Nov 2023 00:34:22 -0600 Subject: [PATCH 27/39] Update `library/csv` (#692) * Update * Fix error * Update with Reviewer's Commnet --- library/csv.po | 104 +++++++++++++++++++++++++++++++++++++------------ 1 file changed, 80 insertions(+), 24 deletions(-) diff --git a/library/csv.po b/library/csv.po index fa84384b89..b011a258fe 100644 --- a/library/csv.po +++ b/library/csv.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-07-17 17:39+0800\n" -"PO-Revision-Date: 2023-09-10 10:26+0800\n" +"PO-Revision-Date: 2023-11-08 15:06+0800\n" "Last-Translator: RockLeon \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.3.2\n" +"X-Generator: Poedit 3.4\n" #: ../../library/csv.rst:2 msgid ":mod:`csv` --- CSV File Reading and Writing" @@ -360,7 +360,7 @@ msgid "" msgstr "" "分析給定的 *sample* 且回傳一個 :class:`Dialect` 子類別,反應出找到的格式參" "數。如果給定選填的參數 *delimiters*,它會被解釋為一個字串且含有可能、有效的分" -"隔字符。" +"隔字元。" #: ../../library/csv.rst:286 msgid "" @@ -507,15 +507,21 @@ msgid "" "specify individual formatting parameters, which have the same names as the " "attributes defined below for the :class:`Dialect` class." msgstr "" +"為了讓指定輸入及輸出紀錄的格式更方便,特定的格式化參數會被組成 dialect。一個 " +"dialect 是 :class:`Dialect` class 的子類別,其有一組特定的方法及單獨的 :meth:" +"`validate` 方法。當建立 :class:`reader` 或 :class:`writer` 物件時,程式設計師" +"可以指定一個字串或是一個 :class:`Dialect` 的子類別作為 dialect 參數。此外,或" +"是作為替代,在\\ *dialect*\\ 參數中,程式設計師可以指定個別的格式化參數,其" +"與 :class:`Dialect` 類別定義的屬性具有相同的名字。" #: ../../library/csv.rst:382 msgid "Dialects support the following attributes:" -msgstr "" +msgstr "Dialect 支援下列屬性:" #: ../../library/csv.rst:387 msgid "" "A one-character string used to separate fields. It defaults to ``','``." -msgstr "" +msgstr "一個單一字元 (one-character) 的字串可已用來分割欄位。預設為 ``','``。" #: ../../library/csv.rst:392 msgid "" @@ -524,12 +530,17 @@ msgid "" "const:`False`, the *escapechar* is used as a prefix to the *quotechar*. It " "defaults to :const:`True`." msgstr "" +"控制 *quotechar* 的實例何時出現在欄位之中,並讓它們自己被放在引號之內。當屬性" +"為 :const:`True`,字元會是雙引號。若為 :const:`False`,在 *quotechar* 之前會" +"先使用 *escapechar* 作為前綴字。預設為 :const:`True`。" #: ../../library/csv.rst:397 msgid "" "On output, if *doublequote* is :const:`False` and no *escapechar* is set, :" "exc:`Error` is raised if a *quotechar* is found in a field." msgstr "" +"在輸出時,若 *doublequote* 是 :const:`False` 且\\ *逸出字元*\\ 沒有被設定,當" +"一個\\ *引號*\\ 在欄位中被發現時,:exc:`Error` 會被引發。" #: ../../library/csv.rst:403 msgid "" @@ -539,16 +550,20 @@ msgid "" "from the following character. It defaults to :const:`None`, which disables " "escaping." msgstr "" +"一個會被寫入器使用的單一字元的字串,當 *quoting* 設定為 :const:`QUOTE_NONE` " +"時逸出\\ *分隔符號*\\ ;當 *doublequote* 設定為 :const:`False` 時逸出\\ *引號" +"*\\ 。在讀取時,\\ *逸出字元*\\ 會移除後面的字元以及任何特殊意義。預設為 :" +"const:`None`,表示禁止逸出。" #: ../../library/csv.rst:408 msgid "An empty *escapechar* is not allowed." -msgstr "" +msgstr "*escapechar* 為空是不被接受的。" #: ../../library/csv.rst:413 msgid "" "The string used to terminate lines produced by the :class:`writer`. It " "defaults to ``'\\r\\n'``." -msgstr "" +msgstr "由 :class:`writer` 產生被用來分行的字串。預設為 ``'\\r\\n'``。" #: ../../library/csv.rst:418 msgid "" @@ -556,6 +571,8 @@ msgid "" "as end-of-line, and ignores *lineterminator*. This behavior may change in " "the future." msgstr "" +":class:`reader`是 hard-coded 辨別 ``'\\r'`` or ``'\\n'`` 作為行尾 (end-of-" +"line),並忽略\\ *分行符號*\\ 。未來可能會改變這個行為。" #: ../../library/csv.rst:425 msgid "" @@ -563,10 +580,12 @@ msgid "" "such as the *delimiter* or *quotechar*, or which contain new-line " "characters. It defaults to ``'\"'``." msgstr "" +"一個單一字元的字串被用於引用包含特殊字元的欄位,像是 *delimiter*、" +"*quotechar* 或是換行字元。預設為 ``'\"'``。" #: ../../library/csv.rst:429 msgid "An empty *quotechar* is not allowed." -msgstr "" +msgstr "*quotechar* 為空是不被允許的。" #: ../../library/csv.rst:434 msgid "" @@ -574,28 +593,36 @@ msgid "" "reader. It can take on any of the :const:`QUOTE_\\*` constants (see " "section :ref:`csv-contents`) and defaults to :const:`QUOTE_MINIMAL`." msgstr "" +"控制 writer 何時產生引號,以及 reader 如何辨識引號。他可以使用任何 :const:" +"`QUOTE_\\*` 常數(請見段落 :ref:`csv-contents`)且預設為 :const:" +"`QUOTE_MINIMAL`。" #: ../../library/csv.rst:441 msgid "" "When :const:`True`, spaces immediately following the *delimiter* are " "ignored. The default is :const:`False`." msgstr "" +"若為 :const:`True`,在緊接著\\ *分隔符號*\\ 後的空格會被忽略。預設為 :const:" +"`False`。" #: ../../library/csv.rst:447 msgid "" "When ``True``, raise exception :exc:`Error` on bad CSV input. The default is " "``False``." msgstr "" +"若為 ``True``,若有錯誤的 CSV 輸入則會引發 :exc:`Error`。預設為 ``False``。" #: ../../library/csv.rst:451 msgid "Reader Objects" -msgstr "" +msgstr "讀取器物件" #: ../../library/csv.rst:453 msgid "" "Reader objects (:class:`DictReader` instances and objects returned by the :" "func:`reader` function) have the following public methods:" msgstr "" +"讀取器物件(:func:`reader` 函式回傳的 :class:`DictReader` 實例與物件)有下列" +"公用方法 (public method):" #: ../../library/csv.rst:458 msgid "" @@ -604,34 +631,39 @@ msgid "" "instance), parsed according to the current :class:`Dialect`. Usually you " "should call this as ``next(reader)``." msgstr "" +"回傳一個列表為讀入器的可疊代物件的下一列內容(若該物件是由 :func:`reader` 回" +"傳)或是一個 dict(若為 :class:`DictReader` 實例),會依據當前的 :class:" +"`Dialect` 進行剖析。通常會用 ``next(reader)`` 來進行呼叫。" #: ../../library/csv.rst:464 msgid "Reader objects have the following public attributes:" -msgstr "" +msgstr "讀取器物件有下列公用屬性 (public attributes):" #: ../../library/csv.rst:468 msgid "A read-only description of the dialect in use by the parser." -msgstr "" +msgstr "dialect 的唯讀敘述,會被剖析器使用。" #: ../../library/csv.rst:473 msgid "" "The number of lines read from the source iterator. This is not the same as " "the number of records returned, as records can span multiple lines." -msgstr "" +msgstr "來源疊代器所讀取的行數。這與回傳的紀錄數不同,因為可以進行跨行紀錄。" #: ../../library/csv.rst:477 msgid "DictReader objects have the following public attribute:" -msgstr "" +msgstr "DictReader 物件有下列公用屬性:" #: ../../library/csv.rst:481 msgid "" "If not passed as a parameter when creating the object, this attribute is " "initialized upon first access or when the first record is read from the file." msgstr "" +"若在建立物件時沒有作為參數傳遞,這個屬性會在第一次存取之前或是第一筆資料被讀" +"取之前進行初始化 (initialize)。" #: ../../library/csv.rst:488 msgid "Writer Objects" -msgstr "" +msgstr "寫入器物件" #: ../../library/csv.rst:490 msgid "" @@ -644,6 +676,12 @@ msgid "" "problems for other programs which read CSV files (assuming they support " "complex numbers at all)." msgstr "" +":class:`Writer` 物件(:func:`writer` 函式回傳的 :class:`DictWriter` 實例與物" +"件)有下列公用方法。對於 :class:`Writer` 物件而言,一個\\ *列*\\ 中必須為一個" +"可疊代的字串或是數字;對於 :class:`DictWriter` 物件而言,則必須為一個 " +"dictionary ,且可以對應欄位標題至字串或數字(會先透過 :func:`str` 進行傳" +"遞)。請注意,在寫入複數 (complex number) 時會用小括號 (parens) 包起來。這可" +"能在其他程式讀取 CSV 檔案時導致某些問題(假設他們完全支援複雜數字)。" #: ../../library/csv.rst:501 msgid "" @@ -651,10 +689,12 @@ msgid "" "to the current :class:`Dialect`. Return the return value of the call to the " "*write* method of the underlying file object." msgstr "" +"將參數 *row* 寫入至寫入器的檔案物件中,並依照當前的 :class:`Dialect` 進行格式" +"化。回傳下層檔案物件 *write* 方法的回傳值。" #: ../../library/csv.rst:505 msgid "Added support of arbitrary iterables." -msgstr "新增對任意 iterable 的支援。" +msgstr "新增對任意可疊代物件 (arbitrary iterables) 的支援。" #: ../../library/csv.rst:510 msgid "" @@ -662,18 +702,20 @@ msgid "" "above) to the writer's file object, formatted according to the current " "dialect." msgstr "" +"將 *rows* 中所有元素(為上述的一個可疊代的 *row* 物件)寫入至寫入器的檔案物件" +"中,並依照當前的 dialect 進行格式化。" #: ../../library/csv.rst:514 msgid "Writer objects have the following public attribute:" -msgstr "" +msgstr "寫入器物件有下列公用屬性:" #: ../../library/csv.rst:519 msgid "A read-only description of the dialect in use by the writer." -msgstr "" +msgstr "dialect 的唯讀敘述,會被寫入器使用。" #: ../../library/csv.rst:522 msgid "DictWriter objects have the following public method:" -msgstr "" +msgstr "DictWriter 物件有下列公用方法:" #: ../../library/csv.rst:527 msgid "" @@ -681,12 +723,17 @@ msgid "" "writer's file object, formatted according to the current dialect. Return the " "return value of the :meth:`csvwriter.writerow` call used internally." msgstr "" +"將具欄位標題的一列(於建構函式 (constructor) 中指定的)寫入至寫入器的檔案物件" +"中,並依照當前的 dialect 進行格式化。回傳內部呼叫 :meth:`csvwriter.writerow` " +"的回傳值。" #: ../../library/csv.rst:532 msgid "" ":meth:`writeheader` now also returns the value returned by the :meth:" "`csvwriter.writerow` method it uses internally." msgstr "" +":meth:`writeheader` 現在也會回傳內部呼叫 :meth:`csvwriter.writerow` 的回傳" +"值。" #: ../../library/csv.rst:540 msgid "Examples" @@ -694,15 +741,15 @@ msgstr "範例" #: ../../library/csv.rst:542 msgid "The simplest example of reading a CSV file::" -msgstr "" +msgstr "最簡單的讀取 CSV 檔案範例: ::" #: ../../library/csv.rst:550 msgid "Reading a file with an alternate format::" -msgstr "" +msgstr "讀取一個其他格式的檔案: ::" #: ../../library/csv.rst:558 msgid "The corresponding simplest possible writing example is::" -msgstr "" +msgstr "相對最簡單、可行的寫入範例為: ::" #: ../../library/csv.rst:565 msgid "" @@ -711,28 +758,33 @@ msgid "" "`locale.getencoding`). To decode a file using a different encoding, use the " "``encoding`` argument of open::" msgstr "" +"當 :func:`open` 被使用於開啟並讀取一個 CSV 檔案,該檔案會預設使用系統預設的編" +"碼格式(請見 :func:`locale.getencoding`),並解碼為 unicode。若要使用不同編碼" +"格式進行檔案解碼,請使用 open 函式的 ``encoding`` 引數: ::" #: ../../library/csv.rst:576 msgid "" "The same applies to writing in something other than the system default " "encoding: specify the encoding argument when opening the output file." msgstr "" +"同理可以應用到使用不同編碼格式進行寫入:當開啟輸出檔案時,指定 ``encoding`` " +"引數。" #: ../../library/csv.rst:579 msgid "Registering a new dialect::" -msgstr "" +msgstr "註冊一個新的 dialect : ::" #: ../../library/csv.rst:586 msgid "" "A slightly more advanced use of the reader --- catching and reporting " "errors::" -msgstr "" +msgstr "稍微進階的讀取器用法 -- 擷取及回報錯誤: ::" #: ../../library/csv.rst:598 msgid "" "And while the module doesn't directly support parsing strings, it can easily " "be done::" -msgstr "" +msgstr "而當模組無法直接支援剖析字串時,仍可以輕鬆的解決: ::" #: ../../library/csv.rst:607 msgid "Footnotes" @@ -746,6 +798,10 @@ msgid "" "safe to specify ``newline=''``, since the csv module does its own (:term:" "`universal `) newline handling." msgstr "" +"如果 ``newline=''`` 沒有被指定,則嵌入引號中的換行符號不會被正確直譯,使用 " +"``\\r\\n`` 行尾 (linending) 的平台會寫入額外的 ``\\r``。自從 csv 模組有自己 " +"(:term:`統一的 `) 換行處理方式,因此指定 ``newline=''`` " +"會永遠是安全的。" #: ../../library/csv.rst:11 msgid "csv" From 7ff752c593d5e08052628aca983252bac6368bb1 Mon Sep 17 00:00:00 2001 From: AbyssDrake <40595377+AbyssDrake@users.noreply.github.com> Date: Thu, 9 Nov 2023 21:19:37 +0800 Subject: [PATCH 28/39] feat: translate library/eusurepip (#453) --- library/ensurepip.po | 66 ++++++++++++++++++++++++++++++++++---------- 1 file changed, 51 insertions(+), 15 deletions(-) diff --git a/library/ensurepip.po b/library/ensurepip.po index b2b3d46843..2574dff11b 100644 --- a/library/ensurepip.po +++ b/library/ensurepip.po @@ -20,7 +20,7 @@ msgstr "" #: ../../library/ensurepip.rst:2 msgid ":mod:`ensurepip` --- Bootstrapping the ``pip`` installer" -msgstr "" +msgstr ":mod:`ensurepip` --- ``pip`` 安裝器的初始建置 (bootstrapping)" #: ../../library/ensurepip.rst:10 msgid "**Source code:** :source:`Lib/ensurepip`" @@ -35,6 +35,10 @@ msgid "" "is bundled with maintenance and feature releases of the CPython reference " "interpreter." msgstr "" +":mod:`ensurepip` 套件 (package) 為既有的 Python 安裝或虛擬環境提供 ``pip`` 安" +"裝器初始建置 (bootstrapping) 的支援。這個初始建置的方式應證了事實 —— ``pip`` " +"是有其獨立發布週期的專案,且其最新可用穩定的版本,會與 CPython 直譯器 " +"(interpreter) 之維護和功能發布綁定。" #: ../../library/ensurepip.rst:21 msgid "" @@ -43,12 +47,17 @@ msgid "" "needed if installing ``pip`` was skipped when installing Python (or when " "creating a virtual environment) or after explicitly uninstalling ``pip``." msgstr "" +"大多數情況下,Python 的終端使用者不需要直接調用此模組(因為 ``pip`` 預設應為" +"初始建置),但若安裝 Python 時 ``pip`` 被省略(或建立一虛擬環境時),又或是 " +"``pip`` 被明確解除安裝時,則此模組的初始建置仍有可能用上。" #: ../../library/ensurepip.rst:29 msgid "" "This module *does not* access the internet. All of the components needed to " "bootstrap ``pip`` are included as internal parts of the package." msgstr "" +"此模組\\ *不會*\\ 通過網路存取。所有需要用來初始建置 ``pip`` 的元件都已包含在" +"套件之內。" #: ../../library/ensurepip.rst:36 msgid ":ref:`installing-index`" @@ -56,15 +65,15 @@ msgstr ":ref:`installing-index`" #: ../../library/ensurepip.rst:36 msgid "The end user guide for installing Python packages" -msgstr "" +msgstr "對於終端使用者安裝 Python 套件的指引" #: ../../library/ensurepip.rst:38 msgid ":pep:`453`: Explicit bootstrapping of pip in Python installations" -msgstr "" +msgstr ":pep:`453`: 在 Python 安裝中的 pip 明確初始建置" #: ../../library/ensurepip.rst:39 msgid "The original rationale and specification for this module." -msgstr "" +msgstr "此模組的最初設計理念與規範。" #: ../../includes/wasm-notavail.rst:3 msgid ":ref:`Availability `: not Emscripten, not WASI." @@ -86,11 +95,14 @@ msgstr "命令列介面" #: ../../library/ensurepip.rst:46 msgid "" "The command line interface is invoked using the interpreter's ``-m`` switch." -msgstr "" +msgstr "使用直譯器 (interpreter) 的 ``-m`` 來調用命令列介面" #: ../../library/ensurepip.rst:48 msgid "The simplest possible invocation is::" msgstr "" +"最簡單可行的調用:\n" +"\n" +"::" #: ../../library/ensurepip.rst:52 msgid "" @@ -99,6 +111,11 @@ msgid "" "least as recent as the one available in ``ensurepip``, pass the ``--" "upgrade`` option::" msgstr "" +"若 ``pip`` 未安裝,此調用會將其安裝;否則甚麼也不做。可透過傳入 ``--" +"upgrade`` 參數來確保 ``pip`` 的安裝版本至少為當前 ``ensurepip`` 中最新可用的" +"版本:\n" +"\n" +"::" #: ../../library/ensurepip.rst:59 msgid "" @@ -107,6 +124,8 @@ msgid "" "virtual environment). The installation location can be controlled through " "two additional command line options:" msgstr "" +"預設上,``pip`` 會被安裝至當前虛擬環境(若已啟動虛擬環境)或系統端的套件(若" +"沒有啟動的虛擬環境)。安裝位置可透過兩個額外的命令列選項來控制:" #: ../../library/ensurepip.rst:64 msgid "" @@ -114,6 +133,8 @@ msgid "" "rather than the root of the currently active virtual environment (if any) or " "the default root for the current Python installation." msgstr "" +"``--root ``:安裝 ``pip`` 到給定的根目錄 (root directory) 的相對路徑,而" +"不是當前虛擬環境(若存在)的根目錄,或當前 Python 安裝版所預設的根目錄。" #: ../../library/ensurepip.rst:67 msgid "" @@ -121,6 +142,8 @@ msgid "" "than globally for the current Python installation (this option is not " "permitted inside an active virtual environment)." msgstr "" +"``--user`` :安裝 ``pip`` 到使用者端的套件目錄,而不是全域安裝到當前的 " +"Python 安裝版(此選項不允許在一啟動的虛擬環境中使用)。" #: ../../library/ensurepip.rst:71 msgid "" @@ -128,23 +151,28 @@ msgid "" "stands for the version of Python used to invoke ``ensurepip``). The scripts " "installed can be controlled through two additional command line options:" msgstr "" +"預設會安裝 ``pipX`` 和 ``pipX.Y`` 腳本(X.Y 代表用來調用 ``ensurepip`` 的 " +"Python 之版本)。安裝的腳本可透過兩個額外的命令列選項來控制:" #: ../../library/ensurepip.rst:76 msgid "" "``--altinstall``: if an alternate installation is requested, the ``pipX`` " "script will *not* be installed." msgstr "" +"``--altinstall``:若要求一個替代安裝版,則\\ *不會*\\ 安裝 ``pipX`` 腳本。" #: ../../library/ensurepip.rst:79 msgid "" "``--default-pip``: if a \"default pip\" installation is requested, the " "``pip`` script will be installed in addition to the two regular scripts." msgstr "" +"``--default-pip``: 若要求安裝「預設 pip」,則會安裝 ``pip`` 腳本,及 2 個常" +"規腳本。" #: ../../library/ensurepip.rst:82 msgid "" "Providing both of the script selection options will trigger an exception." -msgstr "" +msgstr "提供兩種指令選項將會導致例外 (exception) 。" #: ../../library/ensurepip.rst:86 msgid "Module API" @@ -152,17 +180,17 @@ msgstr "模組 API" #: ../../library/ensurepip.rst:88 msgid ":mod:`ensurepip` exposes two functions for programmatic use:" -msgstr "" +msgstr ":mod:`ensurepip` 開放了兩個用於編寫程式的函式:" #: ../../library/ensurepip.rst:92 msgid "" "Returns a string specifying the available version of pip that will be " "installed when bootstrapping an environment." -msgstr "" +msgstr "回傳一個字串,用以標明初始建置時,安裝的 pip 的可行版本號。" #: ../../library/ensurepip.rst:99 msgid "Bootstraps ``pip`` into the current or designated environment." -msgstr "" +msgstr "在當前或指定的環境之中建立 ``pip``。" #: ../../library/ensurepip.rst:101 msgid "" @@ -170,45 +198,48 @@ msgid "" "*root* is ``None``, then installation uses the default install location for " "the current environment." msgstr "" +"*root* 指定一個替代的根目錄,作為安裝的相對路徑。若 *root* 為 ``None``,則安" +"裝使用當前環境的預設安裝位置。" #: ../../library/ensurepip.rst:105 msgid "" "*upgrade* indicates whether or not to upgrade an existing installation of an " "earlier version of ``pip`` to the available version." -msgstr "" +msgstr "*upgrade* 指出是否要將一個既有的較早版本的 ``pip`` 升級至可用的新版。" #: ../../library/ensurepip.rst:108 msgid "" "*user* indicates whether to use the user scheme rather than installing " "globally." -msgstr "" +msgstr "*user* 指出是否要使用使用者的安裝方案而不是全域安裝。" #: ../../library/ensurepip.rst:111 msgid "" "By default, the scripts ``pipX`` and ``pipX.Y`` will be installed (where X.Y " "stands for the current version of Python)." -msgstr "" +msgstr "預設會安裝 ``pipX`` 和 ``pipX.Y`` 腳本(X.Y 代表 Python 的當前版本)。" #: ../../library/ensurepip.rst:114 msgid "If *altinstall* is set, then ``pipX`` will *not* be installed." -msgstr "" +msgstr "如果啟用了 *altinstall*,則不會安裝 ``pipX``。" #: ../../library/ensurepip.rst:116 msgid "" "If *default_pip* is set, then ``pip`` will be installed in addition to the " "two regular scripts." -msgstr "" +msgstr "如果啟用了 *default_pip*,則會安裝 ``pip``,以及 2 個常規腳本。" #: ../../library/ensurepip.rst:119 msgid "" "Setting both *altinstall* and *default_pip* will trigger :exc:`ValueError`." -msgstr "" +msgstr "同時啟用 *altinstall* 跟 *default_pip*,將會觸發 :exc:`ValueError`。" #: ../../library/ensurepip.rst:122 msgid "" "*verbosity* controls the level of output to :data:`sys.stdout` from the " "bootstrapping operation." msgstr "" +"*verbosity* 用來控制初始建置操作內,對於 :data:`sys.stdout` 的輸出等級。" #: ../../library/ensurepip.rst:136 msgid "" @@ -224,6 +255,8 @@ msgid "" "environ``. Invoking the command line interface in a subprocess instead " "allows these side effects to be avoided." msgstr "" +"初始建置的過程對於 ``sys.path`` 及 ``os.environ`` 均有副作用。改為在一子行程 " +"(subprocess) 調用命令列介面可避免這些副作用。" #: ../../library/ensurepip.rst:135 msgid "" @@ -232,3 +265,6 @@ msgid "" "be present by default (as the dependencies may be removed in a future " "version of ``pip``)." msgstr "" +"初始建置的過程也許會安裝 ``pip`` 所需要的額外的模組,但其他軟體不應該假設這些" +"相依 (dependency) 總是預設存在(因為這些相依很可能會在未來版本的 ``pip`` 中被" +"移除)。" From 3a6e035727ba08a6e54782c45b760eb5eafd5306 Mon Sep 17 00:00:00 2001 From: Englam Date: Thu, 9 Nov 2023 23:12:42 +0800 Subject: [PATCH 29/39] 20230716 pathlib_1162_to_1279 (#479) --- library/pathlib.po | 38 ++++++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/library/pathlib.po b/library/pathlib.po index 96f16f5065..daad36597e 100644 --- a/library/pathlib.po +++ b/library/pathlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-08-14 22:55+0800\n" "PO-Revision-Date: 2023-07-11 01:08+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -972,7 +972,7 @@ msgstr "" #: ../../library/pathlib.rst:1201 msgid "Return the binary contents of the pointed-to file as a bytes object::" msgstr "" -"將指向檔案的二進制內容以一個位元組 (bytes) 物件回傳:\n" +"將指向檔案的二進為內容以一個位元組 (bytes) 物件回傳:\n" "\n" "::" @@ -1115,7 +1115,7 @@ msgid "" "be either a Path object, or a string. The semantics are similar to :func:" "`os.path.samefile` and :func:`os.path.samestat`." msgstr "" -"回傳是否此路徑指向與 *other_path* 相同的檔案,*other_path* 可以是路徑 (Path) " +"回傳此路徑是否指向與 *other_path* 相同的檔案,*other_path* 可以是路徑 (Path) " "物件或字串。其語義類似於 :func:`os.path.samefile` 和 :func:`os.path." "samestat`。" @@ -1123,7 +1123,7 @@ msgstr "" msgid "" "An :exc:`OSError` can be raised if either file cannot be accessed for some " "reason." -msgstr "" +msgstr "若任何一個檔案因為某些原因無法存取,則引發 :exc:`OSError`。" #: ../../library/pathlib.rst:1376 msgid "" @@ -1131,20 +1131,23 @@ msgid "" "*target_is_directory* must be true (default ``False``) if the link's target " "is a directory. Under POSIX, *target_is_directory*'s value is ignored." msgstr "" +"使這個路徑為一個 *target* 的符號連結。如果在 Windows 的連結目標是資料夾," +"*target_is_directory* 應該為 true(預設為 ``False``\\ )。如果在 POSIX 的連結" +"目標是資料夾,*target_is_directory* 的數值會被省略。" #: ../../library/pathlib.rst:1392 msgid "" "The order of arguments (link, target) is the reverse of :func:`os.symlink`'s." -msgstr "" +msgstr "引數的順序 (link, target) 和 :func:`os.symlink` 相反。" #: ../../library/pathlib.rst:1397 msgid "Make this path a hard link to the same file as *target*." -msgstr "" +msgstr "使這個路徑為與 *target* 相同檔案的一個硬連結 (hard link)。" #: ../../library/pathlib.rst:1400 msgid "" "The order of arguments (link, target) is the reverse of :func:`os.link`'s." -msgstr "" +msgstr "引數的順序 (link, target) 和 :func:`os.link` 相反。" #: ../../library/pathlib.rst:1408 msgid "" @@ -1154,24 +1157,33 @@ msgid "" "its modification time is updated to the current time), otherwise :exc:" "`FileExistsError` is raised." msgstr "" +"根據給定路徑來建立一個檔案。如果 *mode* 有給定,它會與行程的 ``umask`` 值結" +"合,以確定檔案模式和存取旗標。當檔案已經存在時,若 *exist_ok* 為 true 則函式" +"不會失敗(其變更時間會被更新為當下時間),否則 :exc:`FileExistsError` 會被引" +"發。" #: ../../library/pathlib.rst:1417 msgid "" "Remove this file or symbolic link. If the path points to a directory, use :" "func:`Path.rmdir` instead." msgstr "" +"移除這個檔案或符號連結。如果路徑指到資料夾,請改用 :func:`Path.rmdir`。" #: ../../library/pathlib.rst:1420 msgid "" "If *missing_ok* is false (the default), :exc:`FileNotFoundError` is raised " "if the path does not exist." msgstr "" +"如果 *missing_ok* 是 false(預設值), :exc:`FileNotFoundError` 會在路徑不存" +"在時被引發。" #: ../../library/pathlib.rst:1423 msgid "" "If *missing_ok* is true, :exc:`FileNotFoundError` exceptions will be ignored " "(same behavior as the POSIX ``rm -f`` command)." msgstr "" +"如果 *missing_ok* 為 true,:exc:`FileNotFoundError` 例外會被忽略(行為與 " +"POSIX ``rm -f`` 指令相同)。" #: ../../library/pathlib.rst:1426 msgid "The *missing_ok* parameter was added." @@ -1181,23 +1193,25 @@ msgstr "新增 *missing_ok* 參數。" msgid "" "Open the file pointed to in bytes mode, write *data* to it, and close the " "file::" -msgstr "" +msgstr "以位元組模式開啟指到的檔案,將 *data* 寫到檔案,並關閉檔案:: :" #: ../../library/pathlib.rst:1441 msgid "An existing file of the same name is overwritten." -msgstr "" +msgstr "一個名稱相同的已存在檔案會被覆寫。" #: ../../library/pathlib.rst:1448 msgid "" "Open the file pointed to in text mode, write *data* to it, and close the " "file::" -msgstr "" +msgstr "以文字模式開啟指到的檔案,將 *data* 寫到檔案,並關閉檔案:: :" #: ../../library/pathlib.rst:1457 msgid "" "An existing file of the same name is overwritten. The optional parameters " "have the same meaning as in :func:`open`." msgstr "" +"一個已經存在、名稱相同的檔案會被覆寫。可選參數和 :func:`open` 的參數有相同意" +"義。" #: ../../library/pathlib.rst:1462 msgid "The *newline* parameter was added." @@ -1291,7 +1305,7 @@ msgstr ":meth:`Path.rmdir`" #: ../../library/pathlib.rst:1489 msgid ":func:`os.remove`, :func:`os.unlink`" -msgstr ":func:`os.remove`, :func:`os.unlink`" +msgstr ":func:`os.remove`、:func:`os.unlink`" #: ../../library/pathlib.rst:1489 msgid ":meth:`Path.unlink`" @@ -1399,7 +1413,7 @@ msgstr ":func:`os.stat`" #: ../../library/pathlib.rst:1503 msgid ":meth:`Path.stat`, :meth:`Path.owner`, :meth:`Path.group`" -msgstr ":meth:`Path.stat`, :meth:`Path.owner`, :meth:`Path.group`" +msgstr ":meth:`Path.stat`、:meth:`Path.owner`、:meth:`Path.group`" #: ../../library/pathlib.rst:1506 msgid ":func:`os.path.isabs`" From ab5eecb5818c2de46c1fd569b9bbc6bd45eab53c Mon Sep 17 00:00:00 2001 From: Matt Wang Date: Fri, 10 Nov 2023 02:55:52 +0800 Subject: [PATCH 30/39] chore: rm outdated file --- install/index.po | 1479 ---------------------------------------------- 1 file changed, 1479 deletions(-) delete mode 100644 install/index.po diff --git a/install/index.po b/install/index.po deleted file mode 100644 index 5f0af56ea9..0000000000 --- a/install/index.po +++ /dev/null @@ -1,1479 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation -# This file is distributed under the same license as the Python package. -# -# Translators: -# Leon H., 2017 -msgid "" -msgstr "" -"Project-Id-Version: Python 3.12\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 10:36+0000\n" -"PO-Revision-Date: 2018-05-23 14:37+0000\n" -"Last-Translator: Adrian Liaw \n" -"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" -"tw)\n" -"Language: zh_TW\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: ../../install/index.rst:7 -msgid "Installing Python Modules (Legacy version)" -msgstr "安裝 Python 模組(舊版)" - -#: ../../install/index.rst:0 -msgid "Author" -msgstr "作者" - -#: ../../install/index.rst:9 -msgid "Greg Ward" -msgstr "Greg Ward" - -#: ../../install/index.rst:15 -msgid "" -"The entire ``distutils`` package has been deprecated and will be removed in " -"Python 3.12. This documentation is retained as a reference only, and will be " -"removed with the package. See the :ref:`What's New ` " -"entry for more information." -msgstr "" - -#: ../../install/index.rst:23 -msgid ":ref:`installing-index`" -msgstr ":ref:`installing-index`" - -#: ../../install/index.rst:23 -msgid "" -"The up to date module installation documentation. For regular Python usage, " -"you almost certainly want that document rather than this one." -msgstr "" - -#: ../../install/index.rst:28 -msgid "" -"This document is being retained solely until the ``setuptools`` " -"documentation at https://setuptools.readthedocs.io/en/latest/setuptools.html " -"independently covers all of the relevant information currently included here." -msgstr "" - -#: ../../install/index.rst:34 -msgid "" -"This guide only covers the basic tools for building and distributing " -"extensions that are provided as part of this version of Python. Third party " -"tools offer easier to use and more secure alternatives. Refer to the `quick " -"recommendations section `__ in the Python Packaging User Guide for more information." -msgstr "" - -#: ../../install/index.rst:45 -msgid "Introduction" -msgstr "簡介" - -#: ../../install/index.rst:47 -msgid "" -"In Python 2.0, the ``distutils`` API was first added to the standard " -"library. This provided Linux distro maintainers with a standard way of " -"converting Python projects into Linux distro packages, and system " -"administrators with a standard way of installing them directly onto target " -"systems." -msgstr "" - -#: ../../install/index.rst:52 -msgid "" -"In the many years since Python 2.0 was released, tightly coupling the build " -"system and package installer to the language runtime release cycle has " -"turned out to be problematic, and it is now recommended that projects use " -"the ``pip`` package installer and the ``setuptools`` build system, rather " -"than using ``distutils`` directly." -msgstr "" - -#: ../../install/index.rst:58 -msgid "" -"See :ref:`installing-index` and :ref:`distributing-index` for more details." -msgstr "" - -#: ../../install/index.rst:60 -msgid "" -"This legacy documentation is being retained only until we're confident that " -"the ``setuptools`` documentation covers everything needed." -msgstr "" - -#: ../../install/index.rst:66 -msgid "Distutils based source distributions" -msgstr "" - -#: ../../install/index.rst:68 -msgid "" -"If you download a module source distribution, you can tell pretty quickly if " -"it was packaged and distributed in the standard way, i.e. using the " -"Distutils. First, the distribution's name and version number will be " -"featured prominently in the name of the downloaded archive, e.g. :file:" -"`foo-1.0.tar.gz` or :file:`widget-0.9.7.zip`. Next, the archive will unpack " -"into a similarly named directory: :file:`foo-1.0` or :file:`widget-0.9.7`. " -"Additionally, the distribution will contain a setup script :file:`setup.py`, " -"and a file named :file:`README.txt` or possibly just :file:`README`, which " -"should explain that building and installing the module distribution is a " -"simple matter of running one command from a terminal::" -msgstr "" - -#: ../../install/index.rst:81 -msgid "" -"For Windows, this command should be run from a command prompt window (:" -"menuselection:`Start --> Accessories`)::" -msgstr "" - -#: ../../install/index.rst:86 -msgid "" -"If all these things are true, then you already know how to build and install " -"the modules you've just downloaded: Run the command above. Unless you need " -"to install things in a non-standard way or customize the build process, you " -"don't really need this manual. Or rather, the above command is everything " -"you need to get out of this manual." -msgstr "" - -#: ../../install/index.rst:96 -msgid "Standard Build and Install" -msgstr "" - -#: ../../install/index.rst:98 -msgid "" -"As described in section :ref:`inst-new-standard`, building and installing a " -"module distribution using the Distutils is usually one simple command to run " -"from a terminal::" -msgstr "" - -#: ../../install/index.rst:108 -msgid "Platform variations" -msgstr "" - -#: ../../install/index.rst:110 -msgid "" -"You should always run the setup command from the distribution root " -"directory, i.e. the top-level subdirectory that the module source " -"distribution unpacks into. For example, if you've just downloaded a module " -"source distribution :file:`foo-1.0.tar.gz` onto a Unix system, the normal " -"thing to do is::" -msgstr "" - -#: ../../install/index.rst:119 -msgid "" -"On Windows, you'd probably download :file:`foo-1.0.zip`. If you downloaded " -"the archive file to :file:`C:\\\\Temp`, then it would unpack into :file:`C:\\" -"\\Temp\\\\foo-1.0`; you can use either an archive manipulator with a " -"graphical user interface (such as WinZip) or a command-line tool (such as :" -"program:`unzip` or :program:`pkunzip`) to unpack the archive. Then, open a " -"command prompt window and run::" -msgstr "" - -#: ../../install/index.rst:133 -msgid "Splitting the job up" -msgstr "" - -#: ../../install/index.rst:135 -msgid "" -"Running ``setup.py install`` builds and installs all modules in one run. If " -"you prefer to work incrementally---especially useful if you want to " -"customize the build process, or if things are going wrong---you can use the " -"setup script to do one thing at a time. This is particularly helpful when " -"the build and install will be done by different users---for example, you " -"might want to build a module distribution and hand it off to a system " -"administrator for installation (or do it yourself, with super-user " -"privileges)." -msgstr "" - -#: ../../install/index.rst:143 -msgid "" -"For example, you can build everything in one step, and then install " -"everything in a second step, by invoking the setup script twice::" -msgstr "" - -#: ../../install/index.rst:149 -msgid "" -"If you do this, you will notice that running the :command:`install` command " -"first runs the :command:`build` command, which---in this case---quickly " -"notices that it has nothing to do, since everything in the :file:`build` " -"directory is up-to-date." -msgstr "" - -#: ../../install/index.rst:154 -msgid "" -"You may not need this ability to break things down often if all you do is " -"install modules downloaded off the 'net, but it's very handy for more " -"advanced tasks. If you get into distributing your own Python modules and " -"extensions, you'll run lots of individual Distutils commands on their own." -msgstr "" - -#: ../../install/index.rst:163 -msgid "How building works" -msgstr "" - -#: ../../install/index.rst:165 -msgid "" -"As implied above, the :command:`build` command is responsible for putting " -"the files to install into a *build directory*. By default, this is :file:" -"`build` under the distribution root; if you're excessively concerned with " -"speed, or want to keep the source tree pristine, you can change the build " -"directory with the :option:`!--build-base` option. For example::" -msgstr "" - -#: ../../install/index.rst:173 -msgid "" -"(Or you could do this permanently with a directive in your system or " -"personal Distutils configuration file; see section :ref:`inst-config-" -"files`.) Normally, this isn't necessary." -msgstr "" - -#: ../../install/index.rst:177 -msgid "The default layout for the build tree is as follows::" -msgstr "" - -#: ../../install/index.rst:184 -msgid "" -"where ```` expands to a brief description of the current OS/hardware " -"platform and Python version. The first form, with just a :file:`lib` " -"directory, is used for \"pure module distributions\"---that is, module " -"distributions that include only pure Python modules. If a module " -"distribution contains any extensions (modules written in C/C++), then the " -"second form, with two ```` directories, is used. In that case, the :" -"file:`temp.{plat}` directory holds temporary files generated by the compile/" -"link process that don't actually get installed. In either case, the :file:" -"`lib` (or :file:`lib.{plat}`) directory contains all Python modules (pure " -"Python and extensions) that will be installed." -msgstr "" - -#: ../../install/index.rst:194 -msgid "" -"In the future, more directories will be added to handle Python scripts, " -"documentation, binary executables, and whatever else is needed to handle the " -"job of installing Python modules and applications." -msgstr "" - -#: ../../install/index.rst:202 -msgid "How installation works" -msgstr "" - -#: ../../install/index.rst:204 -msgid "" -"After the :command:`build` command runs (whether you run it explicitly, or " -"the :command:`install` command does it for you), the work of the :command:" -"`install` command is relatively simple: all it has to do is copy everything " -"under :file:`build/lib` (or :file:`build/lib.{plat}`) to your chosen " -"installation directory." -msgstr "" - -#: ../../install/index.rst:210 -msgid "" -"If you don't choose an installation directory---i.e., if you just run " -"``setup.py install``\\ ---then the :command:`install` command installs to " -"the standard location for third-party Python modules. This location varies " -"by platform and by how you built/installed Python itself. On Unix (and " -"macOS, which is also Unix-based), it also depends on whether the module " -"distribution being installed is pure Python or contains extensions (\"non-" -"pure\"):" -msgstr "" - -#: ../../install/index.rst:220 -msgid "Platform" -msgstr "平台" - -#: ../../install/index.rst:220 -msgid "Standard installation location" -msgstr "" - -#: ../../install/index.rst:220 -msgid "Default value" -msgstr "" - -#: ../../install/index.rst:220 ../../install/index.rst:746 -#: ../../install/index.rst:758 -msgid "Notes" -msgstr "註解" - -#: ../../install/index.rst:222 -msgid "Unix (pure)" -msgstr "" - -#: ../../install/index.rst:222 ../../install/index.rst:435 -msgid ":file:`{prefix}/lib/python{X.Y}/site-packages`" -msgstr ":file:`{prefix}/lib/python{X.Y}/site-packages`" - -#: ../../install/index.rst:222 ../../install/index.rst:224 -msgid ":file:`/usr/local/lib/python{X.Y}/site-packages`" -msgstr ":file:`/usr/local/lib/python{X.Y}/site-packages`" - -#: ../../install/index.rst:222 ../../install/index.rst:224 -#: ../../install/index.rst:748 -msgid "\\(1)" -msgstr "\\(1)" - -#: ../../install/index.rst:224 -msgid "Unix (non-pure)" -msgstr "" - -#: ../../install/index.rst:224 ../../install/index.rst:436 -msgid ":file:`{exec-prefix}/lib/python{X.Y}/site-packages`" -msgstr ":file:`{exec-prefix}/lib/python{X.Y}/site-packages`" - -#: ../../install/index.rst:226 -msgid "Windows" -msgstr "Windows" - -#: ../../install/index.rst:226 ../../install/index.rst:487 -msgid ":file:`{prefix}\\\\Lib\\\\site-packages`" -msgstr ":file:`{prefix}\\\\Lib\\\\site-packages`" - -#: ../../install/index.rst:226 -msgid ":file:`C:\\\\Python{XY}\\\\Lib\\\\site-packages`" -msgstr ":file:`C:\\\\Python{XY}\\\\Lib\\\\site-packages`" - -#: ../../install/index.rst:226 ../../install/index.rst:750 -msgid "\\(2)" -msgstr "\\(2)" - -#: ../../install/index.rst:229 ../../install/index.rst:770 -msgid "Notes:" -msgstr "註解:" - -#: ../../install/index.rst:232 -msgid "" -"Most Linux distributions include Python as a standard part of the system, " -"so :file:`{prefix}` and :file:`{exec-prefix}` are usually both :file:`/usr` " -"on Linux. If you build Python yourself on Linux (or any Unix-like system), " -"the default :file:`{prefix}` and :file:`{exec-prefix}` are :file:`/usr/" -"local`." -msgstr "" - -#: ../../install/index.rst:238 -msgid "" -"The default installation directory on Windows was :file:`C:\\\\Program " -"Files\\\\Python` under Python 1.6a1, 1.5.2, and earlier." -msgstr "" - -#: ../../install/index.rst:241 -msgid "" -":file:`{prefix}` and :file:`{exec-prefix}` stand for the directories that " -"Python is installed to, and where it finds its libraries at run-time. They " -"are always the same under Windows, and very often the same under Unix and " -"macOS. You can find out what your Python installation uses for :file:" -"`{prefix}` and :file:`{exec-prefix}` by running Python in interactive mode " -"and typing a few simple commands. Under Unix, just type ``python`` at the " -"shell prompt. Under Windows, choose :menuselection:`Start --> Programs --> " -"Python X.Y --> Python (command line)`. Once the interpreter is started, " -"you type Python code at the prompt. For example, on my Linux system, I type " -"the three Python statements shown below, and get the output as shown, to " -"find out my :file:`{prefix}` and :file:`{exec-prefix}`:" -msgstr "" - -#: ../../install/index.rst:263 -msgid "" -"A few other placeholders are used in this document: :file:`{X.Y}` stands for " -"the version of Python, for example ``3.2``; :file:`{abiflags}` will be " -"replaced by the value of :data:`sys.abiflags` or the empty string for " -"platforms which don't define ABI flags; :file:`{distname}` will be replaced " -"by the name of the module distribution being installed. Dots and " -"capitalization are important in the paths; for example, a value that uses " -"``python3.2`` on UNIX will typically use ``Python32`` on Windows." -msgstr "" - -#: ../../install/index.rst:271 -msgid "" -"If you don't want to install modules to the standard location, or if you " -"don't have permission to write there, then you need to read about alternate " -"installations in section :ref:`inst-alt-install`. If you want to customize " -"your installation directories more heavily, see section :ref:`inst-custom-" -"install` on custom installations." -msgstr "" - -#: ../../install/index.rst:281 -msgid "Alternate Installation" -msgstr "" - -#: ../../install/index.rst:283 -msgid "" -"Often, it is necessary or desirable to install modules to a location other " -"than the standard location for third-party Python modules. For example, on " -"a Unix system you might not have permission to write to the standard third-" -"party module directory. Or you might wish to try out a module before making " -"it a standard part of your local Python installation. This is especially " -"true when upgrading a distribution already present: you want to make sure " -"your existing base of scripts still works with the new version before " -"actually upgrading." -msgstr "" - -#: ../../install/index.rst:291 -msgid "" -"The Distutils :command:`install` command is designed to make installing " -"module distributions to an alternate location simple and painless. The " -"basic idea is that you supply a base directory for the installation, and " -"the :command:`install` command picks a set of directories (called an " -"*installation scheme*) under this base directory in which to install files. " -"The details differ across platforms, so read whichever of the following " -"sections applies to you." -msgstr "" - -#: ../../install/index.rst:299 -msgid "" -"Note that the various alternate installation schemes are mutually exclusive: " -"you can pass ``--user``, or ``--home``, or ``--prefix`` and ``--exec-" -"prefix``, or ``--install-base`` and ``--install-platbase``, but you can't " -"mix from these groups." -msgstr "" - -#: ../../install/index.rst:308 -msgid "Alternate installation: the user scheme" -msgstr "" - -#: ../../install/index.rst:310 -msgid "" -"This scheme is designed to be the most convenient solution for users that " -"don't have write permission to the global site-packages directory or don't " -"want to install into it. It is enabled with a simple option::" -msgstr "" - -#: ../../install/index.rst:316 -msgid "" -"Files will be installed into subdirectories of :const:`site.USER_BASE` " -"(written as :file:`{userbase}` hereafter). This scheme installs pure Python " -"modules and extension modules in the same location (also known as :const:" -"`site.USER_SITE`). Here are the values for UNIX, including macOS:" -msgstr "" - -#: ../../install/index.rst:322 ../../install/index.rst:333 -#: ../../install/index.rst:384 ../../install/index.rst:433 -#: ../../install/index.rst:485 ../../install/index.rst:510 -#: ../../install/index.rst:746 ../../install/index.rst:758 -msgid "Type of file" -msgstr "" - -#: ../../install/index.rst:322 ../../install/index.rst:333 -#: ../../install/index.rst:384 ../../install/index.rst:433 -#: ../../install/index.rst:485 -msgid "Installation directory" -msgstr "" - -#: ../../install/index.rst:324 ../../install/index.rst:335 -#: ../../install/index.rst:386 ../../install/index.rst:487 -msgid "modules" -msgstr "模組" - -#: ../../install/index.rst:324 -msgid ":file:`{userbase}/lib/python{X.Y}/site-packages`" -msgstr ":file:`{userbase}/lib/python{X.Y}/site-packages`" - -#: ../../install/index.rst:325 ../../install/index.rst:336 -#: ../../install/index.rst:387 ../../install/index.rst:437 -#: ../../install/index.rst:488 ../../install/index.rst:515 -msgid "scripts" -msgstr "" - -#: ../../install/index.rst:325 -msgid ":file:`{userbase}/bin`" -msgstr ":file:`{userbase}/bin`" - -#: ../../install/index.rst:326 ../../install/index.rst:337 -#: ../../install/index.rst:388 ../../install/index.rst:438 -#: ../../install/index.rst:489 ../../install/index.rst:516 -msgid "data" -msgstr "" - -#: ../../install/index.rst:326 ../../install/index.rst:337 -msgid ":file:`{userbase}`" -msgstr ":file:`{userbase}`" - -#: ../../install/index.rst:327 ../../install/index.rst:338 -#: ../../install/index.rst:389 ../../install/index.rst:439 -#: ../../install/index.rst:490 ../../install/index.rst:517 -msgid "C headers" -msgstr "" - -#: ../../install/index.rst:327 -msgid ":file:`{userbase}/include/python{X.Y}{abiflags}/{distname}`" -msgstr ":file:`{userbase}/include/python{X.Y}{abiflags}/{distname}`" - -#: ../../install/index.rst:330 -msgid "And here are the values used on Windows:" -msgstr "" - -#: ../../install/index.rst:335 -msgid ":file:`{userbase}\\\\Python{XY}\\\\site-packages`" -msgstr ":file:`{userbase}\\\\Python{XY}\\\\site-packages`" - -#: ../../install/index.rst:336 -msgid ":file:`{userbase}\\\\Python{XY}\\\\Scripts`" -msgstr ":file:`{userbase}\\\\Python{XY}\\\\Scripts`" - -#: ../../install/index.rst:338 -msgid ":file:`{userbase}\\\\Python{XY}\\\\Include\\\\{distname}`" -msgstr ":file:`{userbase}\\\\Python{XY}\\\\Include\\\\{distname}`" - -#: ../../install/index.rst:341 -msgid "" -"The advantage of using this scheme compared to the other ones described " -"below is that the user site-packages directory is under normal conditions " -"always included in :data:`sys.path` (see :mod:`site` for more information), " -"which means that there is no additional step to perform after running the :" -"file:`setup.py` script to finalize the installation." -msgstr "" - -#: ../../install/index.rst:347 -msgid "" -"The :command:`build_ext` command also has a ``--user`` option to add :file:" -"`{userbase}/include` to the compiler search path for header files and :file:" -"`{userbase}/lib` to the compiler search path for libraries as well as to the " -"runtime search path for shared C libraries (rpath)." -msgstr "" - -#: ../../install/index.rst:356 -msgid "Alternate installation: the home scheme" -msgstr "" - -#: ../../install/index.rst:358 -msgid "" -"The idea behind the \"home scheme\" is that you build and maintain a " -"personal stash of Python modules. This scheme's name is derived from the " -"idea of a \"home\" directory on Unix, since it's not unusual for a Unix user " -"to make their home directory have a layout similar to :file:`/usr/` or :file:" -"`/usr/local/`. This scheme can be used by anyone, regardless of the " -"operating system they are installing for." -msgstr "" - -#: ../../install/index.rst:365 -msgid "Installing a new module distribution is as simple as ::" -msgstr "" - -#: ../../install/index.rst:369 -msgid "" -"where you can supply any directory you like for the :option:`!--home` " -"option. On Unix, lazy typists can just type a tilde (``~``); the :command:" -"`install` command will expand this to your home directory::" -msgstr "" - -#: ../../install/index.rst:375 -msgid "" -"To make Python find the distributions installed with this scheme, you may " -"have to :ref:`modify Python's search path ` or edit :mod:`!" -"sitecustomize` (see :mod:`site`) to call :func:`site.addsitedir` or edit :" -"data:`sys.path`." -msgstr "" - -#: ../../install/index.rst:380 -msgid "" -"The :option:`!--home` option defines the installation base directory. Files " -"are installed to the following directories under the installation base as " -"follows:" -msgstr "" - -#: ../../install/index.rst:386 -msgid ":file:`{home}/lib/python`" -msgstr ":file:`{home}/lib/python`" - -#: ../../install/index.rst:387 -msgid ":file:`{home}/bin`" -msgstr ":file:`{home}/bin`" - -#: ../../install/index.rst:388 -msgid ":file:`{home}`" -msgstr ":file:`{home}`" - -#: ../../install/index.rst:389 -msgid ":file:`{home}/include/python/{distname}`" -msgstr ":file:`{home}/include/python/{distname}`" - -#: ../../install/index.rst:392 -msgid "(Mentally replace slashes with backslashes if you're on Windows.)" -msgstr "" - -#: ../../install/index.rst:398 -msgid "Alternate installation: Unix (the prefix scheme)" -msgstr "" - -#: ../../install/index.rst:400 -msgid "" -"The \"prefix scheme\" is useful when you wish to use one Python installation " -"to perform the build/install (i.e., to run the setup script), but install " -"modules into the third-party module directory of a different Python " -"installation (or something that looks like a different Python " -"installation). If this sounds a trifle unusual, it is---that's why the user " -"and home schemes come before. However, there are at least two known cases " -"where the prefix scheme will be useful." -msgstr "" - -#: ../../install/index.rst:407 -msgid "" -"First, consider that many Linux distributions put Python in :file:`/usr`, " -"rather than the more traditional :file:`/usr/local`. This is entirely " -"appropriate, since in those cases Python is part of \"the system\" rather " -"than a local add-on. However, if you are installing Python modules from " -"source, you probably want them to go in :file:`/usr/local/lib/python2.{X}` " -"rather than :file:`/usr/lib/python2.{X}`. This can be done with ::" -msgstr "" - -#: ../../install/index.rst:416 -msgid "" -"Another possibility is a network filesystem where the name used to write to " -"a remote directory is different from the name used to read it: for example, " -"the Python interpreter accessed as :file:`/usr/local/bin/python` might " -"search for modules in :file:`/usr/local/lib/python2.{X}`, but those modules " -"would have to be installed to, say, :file:`/mnt/{@server}/export/lib/python2." -"{X}`. This could be done with ::" -msgstr "" - -#: ../../install/index.rst:425 -msgid "" -"In either case, the :option:`!--prefix` option defines the installation " -"base, and the :option:`!--exec-prefix` option defines the platform-specific " -"installation base, which is used for platform-specific files. (Currently, " -"this just means non-pure module distributions, but could be expanded to C " -"libraries, binary executables, etc.) If :option:`!--exec-prefix` is not " -"supplied, it defaults to :option:`!--prefix`. Files are installed as " -"follows:" -msgstr "" - -#: ../../install/index.rst:435 ../../install/index.rst:512 -msgid "Python modules" -msgstr "" - -#: ../../install/index.rst:436 ../../install/index.rst:513 -msgid "extension modules" -msgstr "" - -#: ../../install/index.rst:437 -msgid ":file:`{prefix}/bin`" -msgstr ":file:`{prefix}/bin`" - -#: ../../install/index.rst:438 ../../install/index.rst:489 -msgid ":file:`{prefix}`" -msgstr ":file:`{prefix}`" - -#: ../../install/index.rst:439 -msgid ":file:`{prefix}/include/python{X.Y}{abiflags}/{distname}`" -msgstr ":file:`{prefix}/include/python{X.Y}{abiflags}/{distname}`" - -#: ../../install/index.rst:442 -msgid "" -"There is no requirement that :option:`!--prefix` or :option:`!--exec-prefix` " -"actually point to an alternate Python installation; if the directories " -"listed above do not already exist, they are created at installation time." -msgstr "" - -#: ../../install/index.rst:446 -msgid "" -"Incidentally, the real reason the prefix scheme is important is simply that " -"a standard Unix installation uses the prefix scheme, but with :option:`!--" -"prefix` and :option:`!--exec-prefix` supplied by Python itself as ``sys." -"prefix`` and ``sys.exec_prefix``. Thus, you might think you'll never use " -"the prefix scheme, but every time you run ``python setup.py install`` " -"without any other options, you're using it." -msgstr "" - -#: ../../install/index.rst:453 -msgid "" -"Note that installing extensions to an alternate Python installation has no " -"effect on how those extensions are built: in particular, the Python header " -"files (:file:`Python.h` and friends) installed with the Python interpreter " -"used to run the setup script will be used in compiling extensions. It is " -"your responsibility to ensure that the interpreter used to run extensions " -"installed in this way is compatible with the interpreter used to build " -"them. The best way to do this is to ensure that the two interpreters are " -"the same version of Python (possibly different builds, or possibly copies of " -"the same build). (Of course, if your :option:`!--prefix` and :option:`!--" -"exec-prefix` don't even point to an alternate Python installation, this is " -"immaterial.)" -msgstr "" - -#: ../../install/index.rst:468 -msgid "Alternate installation: Windows (the prefix scheme)" -msgstr "" - -#: ../../install/index.rst:470 -msgid "" -"Windows has no concept of a user's home directory, and since the standard " -"Python installation under Windows is simpler than under Unix, the :option:" -"`!--prefix` option has traditionally been used to install additional " -"packages in separate locations on Windows. ::" -msgstr "" - -#: ../../install/index.rst:477 -msgid "" -"to install modules to the :file:`\\\\Temp\\\\Python` directory on the " -"current drive." -msgstr "" - -#: ../../install/index.rst:479 -msgid "" -"The installation base is defined by the :option:`!--prefix` option; the :" -"option:`!--exec-prefix` option is not supported under Windows, which means " -"that pure Python modules and extension modules are installed into the same " -"location. Files are installed as follows:" -msgstr "" - -#: ../../install/index.rst:488 -msgid ":file:`{prefix}\\\\Scripts`" -msgstr ":file:`{prefix}\\\\Scripts`" - -#: ../../install/index.rst:490 -msgid ":file:`{prefix}\\\\Include\\\\{distname}`" -msgstr ":file:`{prefix}\\\\Include\\\\{distname}`" - -#: ../../install/index.rst:497 -msgid "Custom Installation" -msgstr "" - -#: ../../install/index.rst:499 -msgid "" -"Sometimes, the alternate installation schemes described in section :ref:" -"`inst-alt-install` just don't do what you want. You might want to tweak " -"just one or two directories while keeping everything under the same base " -"directory, or you might want to completely redefine the installation " -"scheme. In either case, you're creating a *custom installation scheme*." -msgstr "" - -#: ../../install/index.rst:505 -msgid "" -"To create a custom installation scheme, you start with one of the alternate " -"schemes and override some of the installation directories used for the " -"various types of files, using these options:" -msgstr "" - -#: ../../install/index.rst:510 -msgid "Override option" -msgstr "" - -#: ../../install/index.rst:512 -msgid "``--install-purelib``" -msgstr "``--install-purelib``" - -#: ../../install/index.rst:513 -msgid "``--install-platlib``" -msgstr "``--install-platlib``" - -#: ../../install/index.rst:514 -msgid "all modules" -msgstr "" - -#: ../../install/index.rst:514 -msgid "``--install-lib``" -msgstr "``--install-lib``" - -#: ../../install/index.rst:515 -msgid "``--install-scripts``" -msgstr "``--install-scripts``" - -#: ../../install/index.rst:516 -msgid "``--install-data``" -msgstr "``--install-data``" - -#: ../../install/index.rst:517 -msgid "``--install-headers``" -msgstr "``--install-headers``" - -#: ../../install/index.rst:520 -msgid "" -"These override options can be relative, absolute, or explicitly defined in " -"terms of one of the installation base directories. (There are two " -"installation base directories, and they are normally the same---they only " -"differ when you use the Unix \"prefix scheme\" and supply different ``--" -"prefix`` and ``--exec-prefix`` options; using ``--install-lib`` will " -"override values computed or given for ``--install-purelib`` and ``--install-" -"platlib``, and is recommended for schemes that don't make a difference " -"between Python and extension modules.)" -msgstr "" - -#: ../../install/index.rst:529 -msgid "" -"For example, say you're installing a module distribution to your home " -"directory under Unix---but you want scripts to go in :file:`~/scripts` " -"rather than :file:`~/bin`. As you might expect, you can override this " -"directory with the :option:`!--install-scripts` option; in this case, it " -"makes most sense to supply a relative path, which will be interpreted " -"relative to the installation base directory (your home directory, in this " -"case)::" -msgstr "" - -#: ../../install/index.rst:538 -msgid "" -"Another Unix example: suppose your Python installation was built and " -"installed with a prefix of :file:`/usr/local/python`, so under a standard " -"installation scripts will wind up in :file:`/usr/local/python/bin`. If you " -"want them in :file:`/usr/local/bin` instead, you would supply this absolute " -"directory for the :option:`!--install-scripts` option::" -msgstr "" - -#: ../../install/index.rst:546 -msgid "" -"(This performs an installation using the \"prefix scheme\", where the prefix " -"is whatever your Python interpreter was installed with--- :file:`/usr/local/" -"python` in this case.)" -msgstr "" - -#: ../../install/index.rst:550 -msgid "" -"If you maintain Python on Windows, you might want third-party modules to " -"live in a subdirectory of :file:`{prefix}`, rather than right in :file:" -"`{prefix}` itself. This is almost as easy as customizing the script " -"installation directory---you just have to remember that there are two types " -"of modules to worry about, Python and extension modules, which can " -"conveniently be both controlled by one option::" -msgstr "" - -#: ../../install/index.rst:559 -msgid "" -"The specified installation directory is relative to :file:`{prefix}`. Of " -"course, you also have to ensure that this directory is in Python's module " -"search path, such as by putting a :file:`.pth` file in a site directory " -"(see :mod:`site`). See section :ref:`inst-search-path` to find out how to " -"modify Python's search path." -msgstr "" - -#: ../../install/index.rst:565 -msgid "" -"If you want to define an entire installation scheme, you just have to supply " -"all of the installation directory options. The recommended way to do this " -"is to supply relative paths; for example, if you want to maintain all Python " -"module-related files under :file:`python` in your home directory, and you " -"want a separate directory for each platform that you use your home directory " -"from, you might define the following installation scheme::" -msgstr "" - -#: ../../install/index.rst:578 -msgid "or, equivalently, ::" -msgstr "" - -#: ../../install/index.rst:586 -msgid "" -"``$PLAT`` is not (necessarily) an environment variable---it will be expanded " -"by the Distutils as it parses your command line options, just as it does " -"when parsing your configuration file(s)." -msgstr "" - -#: ../../install/index.rst:590 -msgid "" -"Obviously, specifying the entire installation scheme every time you install " -"a new module distribution would be very tedious. Thus, you can put these " -"options into your Distutils config file (see section :ref:`inst-config-" -"files`):" -msgstr "" - -#: ../../install/index.rst:603 -msgid "or, equivalently," -msgstr "" - -#: ../../install/index.rst:614 -msgid "" -"Note that these two are *not* equivalent if you supply a different " -"installation base directory when you run the setup script. For example, ::" -msgstr "" - -#: ../../install/index.rst:619 -msgid "" -"would install pure modules to :file:`/tmp/python/lib` in the first case, and " -"to :file:`/tmp/lib` in the second case. (For the second case, you probably " -"want to supply an installation base of :file:`/tmp/python`.)" -msgstr "" - -#: ../../install/index.rst:623 -msgid "" -"You probably noticed the use of ``$HOME`` and ``$PLAT`` in the sample " -"configuration file input. These are Distutils configuration variables, " -"which bear a strong resemblance to environment variables. In fact, you can " -"use environment variables in config files on platforms that have such a " -"notion but the Distutils additionally define a few extra variables that may " -"not be in your environment, such as ``$PLAT``. (And of course, on systems " -"that don't have environment variables, such as Mac OS 9, the configuration " -"variables supplied by the Distutils are the only ones you can use.) See " -"section :ref:`inst-config-files` for details." -msgstr "" - -#: ../../install/index.rst:633 -msgid "" -"When a :ref:`virtual environment ` is activated, any options that " -"change the installation path will be ignored from all distutils " -"configuration files to prevent inadvertently installing projects outside of " -"the virtual environment." -msgstr "" - -#: ../../install/index.rst:647 -msgid "Modifying Python's Search Path" -msgstr "" - -#: ../../install/index.rst:649 -msgid "" -"When the Python interpreter executes an :keyword:`import` statement, it " -"searches for both Python code and extension modules along a search path. A " -"default value for the path is configured into the Python binary when the " -"interpreter is built. You can determine the path by importing the :mod:`sys` " -"module and printing the value of ``sys.path``. ::" -msgstr "" - -#: ../../install/index.rst:666 -msgid "" -"The null string in ``sys.path`` represents the current working directory." -msgstr "" - -#: ../../install/index.rst:668 -msgid "" -"The expected convention for locally installed packages is to put them in " -"the :file:`{...}/site-packages/` directory, but you may want to install " -"Python modules into some arbitrary directory. For example, your site may " -"have a convention of keeping all software related to the web server under :" -"file:`/www`. Add-on Python modules might then belong in :file:`/www/python`, " -"and in order to import them, this directory must be added to ``sys.path``. " -"There are several different ways to add the directory." -msgstr "" - -#: ../../install/index.rst:676 -msgid "" -"The most convenient way is to add a path configuration file to a directory " -"that's already on Python's path, usually to the :file:`.../site-packages/` " -"directory. Path configuration files have an extension of :file:`.pth`, and " -"each line must contain a single path that will be appended to ``sys.path``. " -"(Because the new paths are appended to ``sys.path``, modules in the added " -"directories will not override standard modules. This means you can't use " -"this mechanism for installing fixed versions of standard modules.)" -msgstr "" - -#: ../../install/index.rst:684 -msgid "" -"Paths can be absolute or relative, in which case they're relative to the " -"directory containing the :file:`.pth` file. See the documentation of the :" -"mod:`site` module for more information." -msgstr "" - -#: ../../install/index.rst:688 -msgid "" -"A slightly less convenient way is to edit the :file:`site.py` file in " -"Python's standard library, and modify ``sys.path``. :file:`site.py` is " -"automatically imported when the Python interpreter is executed, unless the :" -"option:`-S` switch is supplied to suppress this behaviour. So you could " -"simply edit :file:`site.py` and add two lines to it:" -msgstr "" - -#: ../../install/index.rst:699 -msgid "" -"However, if you reinstall the same minor version of Python (perhaps when " -"upgrading from 2.2 to 2.2.2, for example) :file:`site.py` will be " -"overwritten by the stock version. You'd have to remember that it was " -"modified and save a copy before doing the installation." -msgstr "" - -#: ../../install/index.rst:704 -msgid "" -"There are two environment variables that can modify ``sys.path``. :envvar:" -"`PYTHONHOME` sets an alternate value for the prefix of the Python " -"installation. For example, if :envvar:`PYTHONHOME` is set to ``/www/" -"python``, the search path will be set to ``['', '/www/python/lib/pythonX." -"Y/', '/www/python/lib/pythonX.Y/plat-linux2', ...]``." -msgstr "" - -#: ../../install/index.rst:710 -msgid "" -"The :envvar:`PYTHONPATH` variable can be set to a list of paths that will be " -"added to the beginning of ``sys.path``. For example, if :envvar:" -"`PYTHONPATH` is set to ``/www/python:/opt/py``, the search path will begin " -"with ``['/www/python', '/opt/py']``. (Note that directories must exist in " -"order to be added to ``sys.path``; the :mod:`site` module removes paths that " -"don't exist.)" -msgstr "" - -#: ../../install/index.rst:717 -msgid "" -"Finally, ``sys.path`` is just a regular Python list, so any Python " -"application can modify it by adding or removing entries." -msgstr "" - -#: ../../install/index.rst:724 -msgid "Distutils Configuration Files" -msgstr "" - -#: ../../install/index.rst:726 -msgid "" -"As mentioned above, you can use Distutils configuration files to record " -"personal or site preferences for any Distutils options. That is, any option " -"to any command can be stored in one of two or three (depending on your " -"platform) configuration files, which will be consulted before the command-" -"line is parsed. This means that configuration files will override default " -"values, and the command-line will in turn override configuration files. " -"Furthermore, if multiple configuration files apply, values from \"earlier\" " -"files are overridden by \"later\" files." -msgstr "" - -#: ../../install/index.rst:739 -msgid "Location and names of config files" -msgstr "" - -#: ../../install/index.rst:741 -msgid "" -"The names and locations of the configuration files vary slightly across " -"platforms. On Unix and macOS, the three configuration files (in the order " -"they are processed) are:" -msgstr "" - -#: ../../install/index.rst:746 ../../install/index.rst:758 -msgid "Location and filename" -msgstr "" - -#: ../../install/index.rst:748 ../../install/index.rst:760 -msgid "system" -msgstr "" - -#: ../../install/index.rst:748 -msgid ":file:`{prefix}/lib/python{ver}/distutils/distutils.cfg`" -msgstr ":file:`{prefix}/lib/python{ver}/distutils/distutils.cfg`" - -#: ../../install/index.rst:750 ../../install/index.rst:762 -msgid "personal" -msgstr "" - -#: ../../install/index.rst:750 -msgid ":file:`$HOME/.pydistutils.cfg`" -msgstr ":file:`$HOME/.pydistutils.cfg`" - -#: ../../install/index.rst:752 ../../install/index.rst:764 -msgid "local" -msgstr "" - -#: ../../install/index.rst:752 ../../install/index.rst:764 -msgid ":file:`setup.cfg`" -msgstr ":file:`setup.cfg`" - -#: ../../install/index.rst:752 ../../install/index.rst:764 -msgid "\\(3)" -msgstr "\\(3)" - -#: ../../install/index.rst:755 -msgid "And on Windows, the configuration files are:" -msgstr "" - -#: ../../install/index.rst:760 -msgid ":file:`{prefix}\\\\Lib\\\\distutils\\\\distutils.cfg`" -msgstr ":file:`{prefix}\\\\Lib\\\\distutils\\\\distutils.cfg`" - -#: ../../install/index.rst:760 -msgid "\\(4)" -msgstr "\\(4)" - -#: ../../install/index.rst:762 -msgid ":file:`%HOME%\\\\pydistutils.cfg`" -msgstr ":file:`%HOME%\\\\pydistutils.cfg`" - -#: ../../install/index.rst:762 -msgid "\\(5)" -msgstr "\\(5)" - -#: ../../install/index.rst:767 -msgid "" -"On all platforms, the \"personal\" file can be temporarily disabled by " -"passing the ``--no-user-cfg`` option." -msgstr "" - -#: ../../install/index.rst:773 -msgid "" -"Strictly speaking, the system-wide configuration file lives in the directory " -"where the Distutils are installed; under Python 1.6 and later on Unix, this " -"is as shown. For Python 1.5.2, the Distutils will normally be installed to :" -"file:`{prefix}/lib/python1.5/site-packages/distutils`, so the system " -"configuration file should be put there under Python 1.5.2." -msgstr "" - -#: ../../install/index.rst:780 -msgid "" -"On Unix, if the :envvar:`HOME` environment variable is not defined, the " -"user's home directory will be determined with the :func:`~pwd.getpwuid` " -"function from the standard :mod:`pwd` module. This is done by the :func:`os." -"path.expanduser` function used by Distutils." -msgstr "" - -#: ../../install/index.rst:786 -msgid "" -"I.e., in the current directory (usually the location of the setup script)." -msgstr "" - -#: ../../install/index.rst:789 -msgid "" -"(See also note (1).) Under Python 1.6 and later, Python's default " -"\"installation prefix\" is :file:`C:\\\\Python`, so the system configuration " -"file is normally :file:`C:\\\\Python\\\\Lib\\\\distutils\\\\distutils.cfg`. " -"Under Python 1.5.2, the default prefix was :file:`C:\\\\Program Files\\" -"\\Python`, and the Distutils were not part of the standard library---so the " -"system configuration file would be :file:`C:\\\\Program Files\\\\Python\\" -"\\distutils\\\\distutils.cfg` in a standard Python 1.5.2 installation under " -"Windows." -msgstr "" - -#: ../../install/index.rst:798 -msgid "" -"On Windows, if the :envvar:`HOME` environment variable is not defined, :" -"envvar:`USERPROFILE` then :envvar:`HOMEDRIVE` and :envvar:`HOMEPATH` will be " -"tried. This is done by the :func:`os.path.expanduser` function used by " -"Distutils." -msgstr "" - -#: ../../install/index.rst:807 -msgid "Syntax of config files" -msgstr "" - -#: ../../install/index.rst:809 -msgid "" -"The Distutils configuration files all have the same syntax. The config " -"files are grouped into sections. There is one section for each Distutils " -"command, plus a ``global`` section for global options that affect every " -"command. Each section consists of one option per line, specified as " -"``option=value``." -msgstr "" - -#: ../../install/index.rst:814 -msgid "" -"For example, the following is a complete config file that just forces all " -"commands to run quietly by default:" -msgstr "" - -#: ../../install/index.rst:822 -msgid "" -"If this is installed as the system config file, it will affect all " -"processing of any Python module distribution by any user on the current " -"system. If it is installed as your personal config file (on systems that " -"support them), it will affect only module distributions processed by you. " -"And if it is used as the :file:`setup.cfg` for a particular module " -"distribution, it affects only that distribution." -msgstr "" - -#: ../../install/index.rst:829 -msgid "" -"You could override the default \"build base\" directory and make the :" -"command:`build\\*` commands always forcibly rebuild all files with the " -"following:" -msgstr "" - -#: ../../install/index.rst:839 -msgid "which corresponds to the command-line arguments ::" -msgstr "" - -#: ../../install/index.rst:843 -msgid "" -"except that including the :command:`build` command on the command-line means " -"that command will be run. Including a particular command in config files " -"has no such implication; it only means that if the command is run, the " -"options in the config file will apply. (Or if other commands that derive " -"values from it are run, they will use the values in the config file.)" -msgstr "" - -#: ../../install/index.rst:849 -msgid "" -"You can find out the complete list of options for any command using the :" -"option:`!--help` option, e.g.::" -msgstr "" - -#: ../../install/index.rst:854 -msgid "" -"and you can find out the complete list of global options by using :option:" -"`!--help` without a command::" -msgstr "" - -#: ../../install/index.rst:859 -msgid "" -"See also the \"Reference\" section of the \"Distributing Python Modules\" " -"manual." -msgstr "" - -#: ../../install/index.rst:865 -msgid "Building Extensions: Tips and Tricks" -msgstr "" - -#: ../../install/index.rst:867 -msgid "" -"Whenever possible, the Distutils try to use the configuration information " -"made available by the Python interpreter used to run the :file:`setup.py` " -"script. For example, the same compiler and linker flags used to compile " -"Python will also be used for compiling extensions. Usually this will work " -"well, but in complicated situations this might be inappropriate. This " -"section discusses how to override the usual Distutils behaviour." -msgstr "" - -#: ../../install/index.rst:878 -msgid "Tweaking compiler/linker flags" -msgstr "" - -#: ../../install/index.rst:880 -msgid "" -"Compiling a Python extension written in C or C++ will sometimes require " -"specifying custom flags for the compiler and linker in order to use a " -"particular library or produce a special kind of object code. This is " -"especially true if the extension hasn't been tested on your platform, or if " -"you're trying to cross-compile Python." -msgstr "" - -#: ../../install/index.rst:886 -msgid "" -"In the most general case, the extension author might have foreseen that " -"compiling the extensions would be complicated, and provided a :file:`Setup` " -"file for you to edit. This will likely only be done if the module " -"distribution contains many separate extension modules, or if they often " -"require elaborate sets of compiler flags in order to work." -msgstr "" - -#: ../../install/index.rst:892 -msgid "" -"A :file:`Setup` file, if present, is parsed in order to get a list of " -"extensions to build. Each line in a :file:`Setup` describes a single " -"module. Lines have the following structure::" -msgstr "" - -#: ../../install/index.rst:899 -msgid "Let's examine each of the fields in turn." -msgstr "" - -#: ../../install/index.rst:901 -msgid "" -"*module* is the name of the extension module to be built, and should be a " -"valid Python identifier. You can't just change this in order to rename a " -"module (edits to the source code would also be needed), so this should be " -"left alone." -msgstr "" - -#: ../../install/index.rst:905 -msgid "" -"*sourcefile* is anything that's likely to be a source code file, at least " -"judging by the filename. Filenames ending in :file:`.c` are assumed to be " -"written in C, filenames ending in :file:`.C`, :file:`.cc`, and :file:`.c++` " -"are assumed to be C++, and filenames ending in :file:`.m` or :file:`.mm` are " -"assumed to be in Objective C." -msgstr "" - -#: ../../install/index.rst:911 -msgid "" -"*cpparg* is an argument for the C preprocessor, and is anything starting " -"with :option:`!-I`, :option:`!-D`, :option:`!-U` or :option:`!-C`." -msgstr "" - -#: ../../install/index.rst:914 -msgid "" -"*library* is anything ending in :file:`.a` or beginning with :option:`!-l` " -"or :option:`!-L`." -msgstr "" - -#: ../../install/index.rst:917 -msgid "" -"If a particular platform requires a special library on your platform, you " -"can add it by editing the :file:`Setup` file and running ``python setup.py " -"build``. For example, if the module defined by the line ::" -msgstr "" - -#: ../../install/index.rst:923 -msgid "" -"must be linked with the math library :file:`libm.a` on your platform, simply " -"add :option:`!-lm` to the line::" -msgstr "" - -#: ../../install/index.rst:928 -msgid "" -"Arbitrary switches intended for the compiler or the linker can be supplied " -"with the :option:`!-Xcompiler` *arg* and :option:`!-Xlinker` *arg* options::" -msgstr "" - -#: ../../install/index.rst:933 -msgid "" -"The next option after :option:`!-Xcompiler` and :option:`!-Xlinker` will be " -"appended to the proper command line, so in the above example the compiler " -"will be passed the :option:`!-o32` option, and the linker will be passed :" -"option:`!-shared`. If a compiler option requires an argument, you'll have " -"to supply multiple :option:`!-Xcompiler` options; for example, to pass ``-x " -"c++`` the :file:`Setup` file would have to contain ``-Xcompiler -x -" -"Xcompiler c++``." -msgstr "" - -#: ../../install/index.rst:940 -msgid "" -"Compiler flags can also be supplied through setting the :envvar:`CFLAGS` " -"environment variable. If set, the contents of :envvar:`CFLAGS` will be " -"added to the compiler flags specified in the :file:`Setup` file." -msgstr "" - -#: ../../install/index.rst:948 -msgid "Using non-Microsoft compilers on Windows" -msgstr "" - -#: ../../install/index.rst:955 -msgid "Borland/CodeGear C++" -msgstr "" - -#: ../../install/index.rst:957 -msgid "" -"This subsection describes the necessary steps to use Distutils with the " -"Borland C++ compiler version 5.5. First you have to know that Borland's " -"object file format (OMF) is different from the format used by the Python " -"version you can download from the Python or ActiveState web site. (Python " -"is built with Microsoft Visual C++, which uses COFF as the object file " -"format.) For this reason you have to convert Python's library :file:" -"`python25.lib` into the Borland format. You can do this as follows:" -msgstr "" - -#: ../../install/index.rst:972 -msgid "" -"The :file:`coff2omf` program comes with the Borland compiler. The file :" -"file:`python25.lib` is in the :file:`Libs` directory of your Python " -"installation. If your extension uses other libraries (zlib, ...) you have " -"to convert them too." -msgstr "" - -#: ../../install/index.rst:977 -msgid "" -"The converted files have to reside in the same directories as the normal " -"libraries." -msgstr "" - -#: ../../install/index.rst:980 -msgid "" -"How does Distutils manage to use these libraries with their changed names? " -"If the extension needs a library (eg. :file:`foo`) Distutils checks first if " -"it finds a library with suffix :file:`_bcpp` (eg. :file:`foo_bcpp.lib`) and " -"then uses this library. In the case it doesn't find such a special library " -"it uses the default name (:file:`foo.lib`.) [#]_" -msgstr "" - -#: ../../install/index.rst:986 -msgid "" -"To let Distutils compile your extension with Borland C++ you now have to " -"type::" -msgstr "" - -#: ../../install/index.rst:990 -msgid "" -"If you want to use the Borland C++ compiler as the default, you could " -"specify this in your personal or system-wide configuration file for " -"Distutils (see section :ref:`inst-config-files`.)" -msgstr "" - -#: ../../install/index.rst:999 -msgid "`C++Builder Compiler `_" -msgstr "" - -#: ../../install/index.rst:998 -msgid "" -"Information about the free C++ compiler from Borland, including links to the " -"download pages." -msgstr "" - -#: ../../install/index.rst:1002 -msgid "" -"`Creating Python Extensions Using Borland's Free Compiler `_" -msgstr "" - -#: ../../install/index.rst:1002 -msgid "" -"Document describing how to use Borland's free command-line C++ compiler to " -"build Python." -msgstr "" - -#: ../../install/index.rst:1007 -msgid "GNU C / Cygwin / MinGW" -msgstr "" - -#: ../../install/index.rst:1009 -msgid "" -"This section describes the necessary steps to use Distutils with the GNU C/C+" -"+ compilers in their Cygwin and MinGW distributions. [#]_ For a Python " -"interpreter that was built with Cygwin, everything should work without any " -"of these following steps." -msgstr "" - -#: ../../install/index.rst:1014 -msgid "" -"Not all extensions can be built with MinGW or Cygwin, but many can. " -"Extensions most likely to not work are those that use C++ or depend on " -"Microsoft Visual C extensions." -msgstr "" - -#: ../../install/index.rst:1018 -msgid "To let Distutils compile your extension with Cygwin you have to type::" -msgstr "" - -#: ../../install/index.rst:1022 -msgid "and for Cygwin in no-cygwin mode [#]_ or for MinGW type::" -msgstr "" - -#: ../../install/index.rst:1026 -msgid "" -"If you want to use any of these options/compilers as default, you should " -"consider writing it in your personal or system-wide configuration file for " -"Distutils (see section :ref:`inst-config-files`.)" -msgstr "" - -#: ../../install/index.rst:1031 -msgid "Older Versions of Python and MinGW" -msgstr "" - -#: ../../install/index.rst:1032 -msgid "" -"The following instructions only apply if you're using a version of Python " -"inferior to 2.4.1 with a MinGW inferior to 3.0.0 (with " -"binutils-2.13.90-20030111-1)." -msgstr "" - -#: ../../install/index.rst:1036 -msgid "" -"These compilers require some special libraries. This task is more complex " -"than for Borland's C++, because there is no program to convert the library. " -"First you have to create a list of symbols which the Python DLL exports. " -"(You can find a good program for this task at https://sourceforge.net/" -"projects/mingw/files/MinGW/Extension/pexports/)." -msgstr "" - -#: ../../install/index.rst:1049 -msgid "" -"The location of an installed :file:`python25.dll` will depend on the " -"installation options and the version and language of Windows. In a \"just " -"for me\" installation, it will appear in the root of the installation " -"directory. In a shared installation, it will be located in the system " -"directory." -msgstr "" - -#: ../../install/index.rst:1054 -msgid "" -"Then you can create from these information an import library for gcc. ::" -msgstr "" - -#: ../../install/index.rst:1058 -msgid "" -"The resulting library has to be placed in the same directory as :file:" -"`python25.lib`. (Should be the :file:`libs` directory under your Python " -"installation directory.)" -msgstr "" - -#: ../../install/index.rst:1062 -msgid "" -"If your extension uses other libraries (zlib,...) you might have to convert " -"them too. The converted files have to reside in the same directories as the " -"normal libraries do." -msgstr "" - -#: ../../install/index.rst:1069 -msgid "" -"`Building Python modules on MS Windows platform with MinGW `_" -msgstr "" - -#: ../../install/index.rst:1070 -msgid "" -"Information about building the required libraries for the MinGW environment." -msgstr "" - -#: ../../install/index.rst:1074 -msgid "Footnotes" -msgstr "註解" - -#: ../../install/index.rst:1075 -msgid "" -"This also means you could replace all existing COFF-libraries with OMF-" -"libraries of the same name." -msgstr "" - -#: ../../install/index.rst:1078 -msgid "Check https://www.sourceware.org/cygwin/ for more information" -msgstr "更多資訊請見 https://www.sourceware.org/cygwin/" - -#: ../../install/index.rst:1080 -msgid "" -"Then you have no POSIX emulation available, but you also don't need :file:" -"`cygwin1.dll`." -msgstr "" From 3214269d515a4599d27311528dcf211a1b75630b Mon Sep 17 00:00:00 2001 From: LYC <67285884+Cliying94@users.noreply.github.com> Date: Sat, 11 Nov 2023 21:16:37 +0800 Subject: [PATCH 31/39] Working on binary. (#703) * Working on binary. * Update library/binary.po Co-authored-by: RockLeon <34214497+rockleona@users.noreply.github.com> * Working on binary. --------- Co-authored-by: RockLeon <34214497+rockleona@users.noreply.github.com> --- library/binary.po | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/library/binary.po b/library/binary.po index 96486cf5f1..edeb5839ed 100644 --- a/library/binary.po +++ b/library/binary.po @@ -20,7 +20,7 @@ msgstr "" #: ../../library/binary.rst:5 msgid "Binary Data Services" -msgstr "" +msgstr "二進位資料服務" #: ../../library/binary.rst:7 msgid "" @@ -29,6 +29,8 @@ msgid "" "specifically in relation to file formats and network protocols, are " "described in the relevant sections." msgstr "" +"本章所描述的模組提供了一些基本的二進位資料操作服務。而針對二進位資料的其他操" +"作──尤其是關於檔案格式和網路協定的部分──則會在相關章節中詳細描述。" #: ../../library/binary.rst:12 msgid "" @@ -36,9 +38,12 @@ msgid "" "ASCII-compatible binary formats (for example, :mod:`re`) or all binary data " "(for example, :mod:`difflib`)." msgstr "" +"一些在 :ref:`textservices` 中提及的函式庫也可處理 ASCII 相容的二進位格式(例" +"如,:mod:`re`)及所有的二進位資料(例如,:mod:`difflib`)。" #: ../../library/binary.rst:16 msgid "" "In addition, see the documentation for Python's built-in binary data types " "in :ref:`binaryseq`." msgstr "" +"此外,請參閱 Python 內建的二進位資料類型的文件,詳情請參考 :ref:`binaryseq`。" From a2d619bbc6ccbc816db1a611d489c27428eb2e4c Mon Sep 17 00:00:00 2001 From: RockLeon <34214497+rockleona@users.noreply.github.com> Date: Sun, 12 Nov 2023 10:55:17 -0600 Subject: [PATCH 32/39] Update Translation of `howto/annotations` (#699) * Finish Translation * Update Info * Update with reviewer's comment --- howto/annotations.po | 117 ++++++++++++++++++++++++++++++++++++++----- 1 file changed, 104 insertions(+), 13 deletions(-) diff --git a/howto/annotations.po b/howto/annotations.po index 95c2191a3a..9d94b9c572 100644 --- a/howto/annotations.po +++ b/howto/annotations.po @@ -8,18 +8,19 @@ msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-12-25 00:16+0000\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" +"PO-Revision-Date: 2023-11-08 23:11+0800\n" +"Last-Translator: rockleon \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" "Language: zh_TW\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 3.4.1\n" #: ../../howto/annotations.rst:5 msgid "Annotations Best Practices" -msgstr "" +msgstr "註釋 (annotation) 最佳實踐" #: ../../howto/annotations.rst:0 msgid "author" @@ -40,6 +41,9 @@ msgid "" "``__annotations__`` on Python objects, we encourage you to follow the " "guidelines described below." msgstr "" +"本文件旨在封裝 (encapsulate) 使用註釋字典 (annotations dicts) 的最佳實踐。如" +"果你寫 Python 程式碼並在調查 Python 物件上的 ``__annotations__`` ,我們鼓勵你" +"遵循下面描述的準則。" #: ../../howto/annotations.rst:16 msgid "" @@ -49,6 +53,9 @@ msgid "" "and older, other best practices for ``__annotations__`` that apply to any " "Python version, and quirks of ``__annotations__``." msgstr "" +"本文件分為四個部分:在 Python 3.10 及更高版本中存取物件註釋的最佳實踐、在 " +"Python 3.9 及更早版本中存取物件註釋的最佳實踐、適用於任何Python 版本 " +"``__annotations__`` 的最佳實踐,以及 ``__annotations__`` 的奇異之處。" #: ../../howto/annotations.rst:26 msgid "" @@ -57,10 +64,13 @@ msgid "" "information on how to use \"type hints\" in your code, please see the :mod:" "`typing` module." msgstr "" +"請注意,本文件是特別說明 ``__annotations__`` 的使用,而非\\ *如何使用*\\ 註" +"釋。如果你正在尋找如何在你的程式碼中使用「型別提示 (type hint)」的資訊,請查" +"閱模組 (module) :mod:`typing`。" #: ../../howto/annotations.rst:33 msgid "Accessing The Annotations Dict Of An Object In Python 3.10 And Newer" -msgstr "" +msgstr "在 Python 3.10 及更高版本中存取物件的註釋字典" #: ../../howto/annotations.rst:35 msgid "" @@ -70,6 +80,9 @@ msgid "" "supports annotations. This function can also \"un-stringize\" stringized " "annotations for you." msgstr "" +"Python 3.10 在標準函式庫中新增了一個新函式::func:`inspect.get_annotations`。" +"在 Python 3.10 及更高版本中,呼叫此函式是存取任何支援註釋的物件的註釋字典的最" +"佳實踐。此函式也可以為你「取消字串化 (un-stringize)」字串化註釋。" #: ../../howto/annotations.rst:42 msgid "" @@ -81,6 +94,11 @@ msgid "" "of these three *specific* objects, you may simply use ``o.__annotations__`` " "to get at the object's annotations dict." msgstr "" +"若由於某種原因 :func:`inspect.get_annotations` 對你的場合不可行,你可以手動存" +"取 ``__annotations__`` 資料成員。 Python 3.10 中的最佳實踐也已經改變:從 " +"Python 3.10 開始,保證 ``o.__annotations__`` \\ *始終*\\ 適用於 Python 函式、" +"類別 (class) 和模組。如果你確定正在檢查的物件是這三個\\ *特定*\\ 物件之一,你" +"可以簡單地使用 ``o.__annotations__`` 來取得物件的註釋字典。" #: ../../howto/annotations.rst:52 msgid "" @@ -90,6 +108,11 @@ msgid "" "practice in Python versions 3.10 and newer is to call :func:`getattr` with " "three arguments, for example ``getattr(o, '__annotations__', None)``." msgstr "" +"但是,其他型別的 callable(可呼叫物件)(例如,由 :func:`functools.partial` " +"建立的 callable)可能沒有定義 ``__annotations__`` 屬性 (attribute)。當存取可" +"能未知的物件的 ``__annotations__`` 時,Python 3.10 及更高版本中的最佳實踐是使" +"用三個參數呼叫 :func:`getattr`,例如 ``getattr(o, '__annotations__', " +"None)``。" #: ../../howto/annotations.rst:60 msgid "" @@ -98,10 +121,13 @@ msgid "" "parent's ``__annotations__``. In Python 3.10 and newer, the child class's " "annotations will be an empty dict instead." msgstr "" +"在 Python 3.10 之前,存取未定義註釋但具有註釋的父類別的類別上的 " +"``__annotations__`` 將傳回父類別的 `` __annotations__``。在 Python 3.10 及更" +"高版本中,子類別的註釋將會是一個空字典。" #: ../../howto/annotations.rst:68 msgid "Accessing The Annotations Dict Of An Object In Python 3.9 And Older" -msgstr "" +msgstr "在 Python 3.9 及更早版本中存取物件的註釋字典" #: ../../howto/annotations.rst:70 msgid "" @@ -109,6 +135,8 @@ msgid "" "more complicated than in newer versions. The problem is a design flaw in " "these older versions of Python, specifically to do with class annotations." msgstr "" +"在 Python 3.9 及更早版本中,存取物件的註釋字典比新版本複雜得多。問題出在於這" +"些舊版 Python 中有設計缺陷,特別是與類別註釋有關的設計缺陷。" #: ../../howto/annotations.rst:75 msgid "" @@ -118,6 +146,9 @@ msgid "" "should use three-argument :func:`getattr` to access the object's " "``__annotations__`` attribute." msgstr "" +"存取其他物件(如函式、其他 callable 和模組)的註釋字典的最佳實踐與 3.10 的最" +"佳實踐相同,假設你沒有呼叫 :func:`inspect.get_annotations`:你應該使用三個:" +"參數 :func:`getattr` 來存取物件的 ``__annotations__`` 屬性。" #: ../../howto/annotations.rst:82 msgid "" @@ -127,10 +158,14 @@ msgid "" "``__annotations__`` attribute of a class may inadvertently return the " "annotations dict of a *base class.* As an example::" msgstr "" +"不幸的是,這不是類別的最佳實踐。問題是,由於 ``__annotations__`` 在類別上是選" +"填的 (optional),並且因為類別可以從其基底類別 (base class) 繼承屬性,所以存取" +"類別的 ``__annotations__`` 屬性可能會無意中回傳\\ *基底類別的註釋字典。*\\ 舉" +"例來說: ::" #: ../../howto/annotations.rst:98 msgid "This will print the annotations dict from ``Base``, not ``Derived``." -msgstr "" +msgstr "這將印出 (print) 來自 ``Base`` 的註釋字典,而不是 ``Derived``。" #: ../../howto/annotations.rst:101 msgid "" @@ -141,6 +176,11 @@ msgid "" "dictionary. Since the class may or may not have annotations defined, best " "practice is to call the ``get`` method on the class dict." msgstr "" +"如果你正在檢查的物件是一個類別 (``isinstance(o, type)``),你的程式碼將必須有" +"一個單獨的程式碼路徑。在這種情況下,最佳實踐依賴 Python 3.9 及之前版本的實作" +"細節 (implementation detail):如果一個類別定義了註釋,它們將儲存在該類別的 " +"``__dict__`` 字典中。由於類別可能定義了註釋,也可能沒有定義,因此最佳實踐是在" +"類別字典上呼叫 ``get`` 方法。" #: ../../howto/annotations.rst:109 msgid "" @@ -148,6 +188,8 @@ msgid "" "``__annotations__`` attribute on an arbitrary object in Python 3.9 and " "before::" msgstr "" +"總而言之,以下是一些範例程式碼,可以安全地存取 Python 3.9 及先前版本中任意物" +"件上的 ``__annotations__`` 屬性:" #: ../../howto/annotations.rst:118 msgid "" @@ -155,6 +197,8 @@ msgid "" "You're encouraged to double-check the type of ``ann`` using :func:" "`isinstance` before further examination." msgstr "" +"運行此程式碼後,``ann`` 應該是字典或 ``None``。我們鼓勵你在進一步檢查之前使" +"用 :func:`isinstance` 仔細檢查 ``ann`` 的型別。" #: ../../howto/annotations.rst:123 msgid "" @@ -162,10 +206,13 @@ msgid "" "attribute, so for extra safety you may also wish to use :func:`getattr` to " "access ``__dict__``." msgstr "" +"請注意,某些外來 (exotic) 或格式錯誤 (malform) 的型別物件可能沒有 " +"``__dict__`` 屬性,因此為了額外的安全,你可能還希望使用 :func:`getattr` 來存" +"取 ``__dict__`` 。" #: ../../howto/annotations.rst:129 msgid "Manually Un-Stringizing Stringized Annotations" -msgstr "" +msgstr "手動取消字串化註釋" #: ../../howto/annotations.rst:131 msgid "" @@ -174,6 +221,8 @@ msgid "" "really is best to call :func:`inspect.get_annotations` to do this work for " "you." msgstr "" +"在某些註釋可能被「字串化」的情況下,並且你希望評估這些字串以產生它們表示的 " +"Python 值,最好呼叫 :func:`inspect.get_annotations` 來為你完成這項工作。" #: ../../howto/annotations.rst:137 msgid "" @@ -182,18 +231,23 @@ msgid "" "encouraged to examine the implementation of :func:`inspect.get_annotations` " "in the current Python version and follow a similar approach." msgstr "" +"如果你使用的是 Python 3.9 或更早版本,或者由於某種原因你無法使用 :func:" +"`inspect.get_annotations`,則需要複製其邏輯。我們鼓勵你檢查目前 Python 版本" +"中 :func:`inspect.get_annotations` 的實作並遵循類似的方法。" #: ../../howto/annotations.rst:143 msgid "" "In a nutshell, if you wish to evaluate a stringized annotation on an " "arbitrary object ``o``:" -msgstr "" +msgstr "簡而言之,如果你希望評估任意物件 ``o`` 上的字串化註釋: ::" #: ../../howto/annotations.rst:146 msgid "" "If ``o`` is a module, use ``o.__dict__`` as the ``globals`` when calling :" "func:`eval`." msgstr "" +"如果 ``o`` 是一個模組,則在呼叫 :func:`eval` 時使用 ``o.__dict__`` 作為\\ ``" +"全域變數``\\ 。" #: ../../howto/annotations.rst:148 msgid "" @@ -201,6 +255,9 @@ msgid "" "``globals``, and ``dict(vars(o))`` as the ``locals``, when calling :func:" "`eval`." msgstr "" +"如果 ``o`` 是一個類別,當呼叫 :func:`eval` 時,則使用 ``sys.modules[o." +"__module__].__dict__`` 作為\\ ``全域變數``\\ ,使用 ``dict(vars(o))`` 作為\\ " +"``區域變數``\\ 。" #: ../../howto/annotations.rst:151 msgid "" @@ -209,12 +266,17 @@ msgid "" "accessing either ``o.__wrapped__`` or ``o.func`` as appropriate, until you " "have found the root unwrapped function." msgstr "" +"如果 ``o`` 是使用 :func:`functools.update_wrapper`、:func:`functools.wraps` " +"或 :func:`functools.partial` 包裝的 callable ,請依據需求,透過存取 ``o." +"__wrapped__`` 或``o.func`` 來疊代解開它,直到找到根解包函式。" #: ../../howto/annotations.rst:155 msgid "" "If ``o`` is a callable (but not a class), use ``o.__globals__`` as the " "globals when calling :func:`eval`." msgstr "" +"如果 ``o`` 是 callable(但不是類別),則在呼叫 :func:`eval` 時使用 ``o." +"__globals__`` 作為全域變數。" #: ../../howto/annotations.rst:158 msgid "" @@ -224,18 +286,23 @@ msgid "" "hints that require annotating with string values that specifically *can't* " "be evaluated. For example:" msgstr "" +"然而,並非所有用作註釋的字串值都可以透過 :func:`eval` 成功轉換為 Python 值。" +"理論上,字串值可以包含任何有效的字串,並且在實踐中,型別提示存在有效的用例," +"需要使用特定「無法」評估的字串值進行註釋。例如: ::" #: ../../howto/annotations.rst:165 msgid "" ":pep:`604` union types using ``|``, before support for this was added to " "Python 3.10." msgstr "" +"在 Python 3.10 支援 :pep:`604` 聯合型別 (union type) ``|`` 之前使用它。" #: ../../howto/annotations.rst:167 msgid "" "Definitions that aren't needed at runtime, only imported when :const:`typing." "TYPE_CHECKING` is true." msgstr "" +"Runtime 中不需要的定義,僅在 :const:`typing.TYPE_CHECKING` 為 true 時匯入。" #: ../../howto/annotations.rst:170 msgid "" @@ -244,22 +311,28 @@ msgid "" "it's recommended to only attempt to evaluate string values when explicitly " "requested to by the caller." msgstr "" +"如果 :func:`eval` 嘗試計算這類型的值,它將失敗並引發例外。因此,在設計使用註" +"釋的函式庫 API 時,建議僅在呼叫者 (caller) 明確請求時嘗試評估字串值。" #: ../../howto/annotations.rst:178 msgid "Best Practices For ``__annotations__`` In Any Python Version" -msgstr "" +msgstr "任何 Python 版本中 ``__annotations__`` 的最佳實踐" #: ../../howto/annotations.rst:180 msgid "" "You should avoid assigning to the ``__annotations__`` member of objects " "directly. Let Python manage setting ``__annotations__``." msgstr "" +"你應該避免直接指派給物件的 ``__annotations__`` 成員。讓 Python 管理設定 " +"``__annotations__``。" #: ../../howto/annotations.rst:183 msgid "" "If you do assign directly to the ``__annotations__`` member of an object, " "you should always set it to a ``dict`` object." msgstr "" +"如果你直接指派給物件的 `` __annotations__`` 成員,則應始終將其設為 ``dict`` " +"物件。" #: ../../howto/annotations.rst:186 msgid "" @@ -267,19 +340,21 @@ msgid "" "should ensure that it's a dictionary before attempting to examine its " "contents." msgstr "" +"如果直接存取物件的 ``__annotations__`` 成員,則應在嘗試檢查其內容之前確保它是" +"字典。" #: ../../howto/annotations.rst:190 msgid "You should avoid modifying ``__annotations__`` dicts." -msgstr "" +msgstr "你應該避免修改 ``__annotations__`` 字典。" #: ../../howto/annotations.rst:192 msgid "" "You should avoid deleting the ``__annotations__`` attribute of an object." -msgstr "" +msgstr "你應該避免刪除物件的 ``__annotations__`` 屬性。" #: ../../howto/annotations.rst:197 msgid "``__annotations__`` Quirks" -msgstr "" +msgstr "``__annotations__`` 奇異之處" #: ../../howto/annotations.rst:199 msgid "" @@ -292,12 +367,18 @@ msgid "" "an ``AttributeError``; using ``del fn.__annotations__`` twice in a row is " "guaranteed to always throw an ``AttributeError``." msgstr "" +"在 Python 3 的所有版本中,如果沒有在該物件上定義註釋,則函式物件會延遲建立 " +"(lazy-create) 註釋字典。你可以使用 ``del fn.__annotations__`` 刪除 " +"``__annotations__`` 屬性,但如果你隨後存取 ``fn.__annotations__``,該物件將建" +"立一個新的空字典,它將作為註釋儲存並傳回。在函式延遲建立註釋字典之前刪除函式" +"上的註釋將拋出 ``AttributeError``;連續兩次使用 ``del fn.__annotations__`` 保" +"證總是拋出 ``AttributeError`` 。" #: ../../howto/annotations.rst:209 msgid "" "Everything in the above paragraph also applies to class and module objects " "in Python 3.10 and newer." -msgstr "" +msgstr "上一段的所有內容也適用於 Python 3.10 及更高版本中的類別和模組物件。" #: ../../howto/annotations.rst:212 msgid "" @@ -309,6 +390,11 @@ msgid "" "``__annotations__`` to any Python value, and will retain whatever value is " "set." msgstr "" +"在 Python 3 的所有版本中,你可以將函式物件上的 ``__annotations__`` 設定為 " +"``None``。但是,隨後使用 ``fn.__annotations__`` 存取該物件上的註釋將根據本節" +"第一段的內容延遲建立一個空字典。對於任何 Python 版本中的模組和類別來說,情況" +"\\ *並非如此*\\;這些物件允許將 ``__annotations__`` 設定為任何 Python 值,並" +"且將保留設定的任何值。" #: ../../howto/annotations.rst:220 msgid "" @@ -317,9 +403,14 @@ msgid "" "will itself be quoted. In effect the annotation is quoted *twice.* For " "example::" msgstr "" +"如果 Python 為你字串化你的註釋(使用 ``from __future__ import " +"annotations``),並且你指定一個字串作為註釋,則該字串本身將被引用。實際上,註" +"釋被引用了\\ *兩次。*\\ 例如: ::" #: ../../howto/annotations.rst:231 msgid "" "This prints ``{'a': \"'str'\"}``. This shouldn't really be considered a " "\"quirk\"; it's mentioned here simply because it might be surprising." msgstr "" +"這會印出 ``{'a': \"'str'\"}``。這不應該被認為是一個「奇異的事」,他在這裡被簡單" +"提及,因為他可能會讓人意想不到。" From aa39396400088efe90ca920eed1ba5fa8f709aaa Mon Sep 17 00:00:00 2001 From: cschan <45995789+cschan1828@users.noreply.github.com> Date: Wed, 22 Nov 2023 19:35:42 +0800 Subject: [PATCH 33/39] Add more translations of library/io (#707) Co-authored-by: Wei-Hsiang (Matt) Wang --- library/io.po | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/library/io.po b/library/io.po index fba54e7c27..10bc84371b 100644 --- a/library/io.po +++ b/library/io.po @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-08-30 00:04+0000\n" -"PO-Revision-Date: 2023-08-01 12:20+0800\n" +"PO-Revision-Date: 2023-11-22 00:45+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -16,7 +16,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.3.2\n" +"X-Generator: Poedit 3.4.1\n" #: ../../library/io.rst:2 msgid ":mod:`io` --- Core tools for working with streams" @@ -328,6 +328,10 @@ msgid "" "same as ``open(path, 'rb')``. Overriding the behavior is intended for " "additional validation or preprocessing of the file." msgstr "" +"這個函式的行為可能會被之前對 :c:func:`PyFile_SetOpenCodeHook` 的呼叫覆寫。然" +"而,假設 *path* 是個 :class:`str` 且為絕對路徑,則 ``open_code(path)`` 總是" +"與 ``open(path, 'rb')`` 有相同行為。覆寫這個行為是為了對檔案進行額外驗證或預" +"處理。" #: ../../library/io.rst:200 msgid "" @@ -343,6 +347,8 @@ msgid "" "returns ``\"locale\"`` or ``\"utf-8\"`` depending on :ref:`UTF-8 Mode `." msgstr "" +"若 *encoding* 不為 ``None``,此函式將回傳 *encoding*。否則,將根據 :ref:" +"`UTF-8 Mode ` 回傳 ``\"locale\"`` 或 ``\"utf-8\"``。" #: ../../library/io.rst:207 msgid "" @@ -350,6 +356,9 @@ msgid "" "warn_default_encoding ` is true and *encoding* is ``None``. " "*stacklevel* specifies where the warning is emitted. For example::" msgstr "" +"若 :data:`sys.flags.warn_default_encoding ` 為真,且 *encoding* " +"為 ``None``,此函式會發出一個 :class:`EncodingWarning`。*stacklevel* 指定警告" +"在哪層發出。範例: ::" #: ../../library/io.rst:217 msgid "" From 9187e5780fc474ab1c82e4824e9807f065a3b642 Mon Sep 17 00:00:00 2001 From: Payon Date: Fri, 24 Nov 2023 15:52:21 +0800 Subject: [PATCH 34/39] =?UTF-8?q?fix:=20=E4=BF=AE=E6=AD=A3render=E5=95=8F?= =?UTF-8?q?=E9=A1=8C=20(#708)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/unittest.mock.po | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/library/unittest.mock.po b/library/unittest.mock.po index 6b9d6326e3..b6774e1970 100644 --- a/library/unittest.mock.po +++ b/library/unittest.mock.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-10-20 00:03+0000\n" -"PO-Revision-Date: 2023-09-09 23:07+0800\n" +"PO-Revision-Date: 2023-11-23 21:46+0800\n" "Last-Translator: Adrian Liaw \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.4\n" +"X-Generator: Poedit 3.4.1\n" #: ../../library/unittest.mock.rst:3 msgid ":mod:`unittest.mock` --- mock object library" @@ -469,9 +469,9 @@ msgid "" "mocks and the return value mock (if any) are reset as well." msgstr "" "這在你想要進行一系列重複使用同一物件的斷言時非常有用。請注意,預設情況下,:" -"meth:`reset_mock` *不會*\\ 清除回傳值、:attr:`side_effect` 或使用普通賦值設定的" -"任何子屬性。如果你想要重置 *return_value* 或 :attr:`side_effect`,則將相應的" -"參數設置為 ``True``。Child mock 和回傳值 mock(如果有的話)也會被重置。" +"meth:`reset_mock` *不會*\\ 清除回傳值、:attr:`side_effect` 或使用普通賦值設定" +"的任何子屬性。如果你想要重置 *return_value* 或 :attr:`side_effect`,則將相應" +"的參數設置為 ``True``。Child mock 和回傳值 mock(如果有的話)也會被重置。" #: ../../library/unittest.mock.rst:420 msgid "*return_value*, and :attr:`side_effect` are keyword-only arguments." @@ -641,9 +641,9 @@ msgid "" "second member, which can also be accessed through the ``kwargs`` property, " "is any keyword arguments (or an empty dictionary)." msgstr "" -"這會是 ``None``(如果 mock 尚未被呼叫),或是 mock 上次被呼叫時使用的引數。這" -"將以元組的形式呈現:第一個成員 (member),其可以通過 ``args`` 屬性訪問,是 " -"mock 被呼叫時傳遞的所有有序引數(或一個空元組)。第二個成員,其可以通過 " +"這會是 ``None``\\ (如果 mock 尚未被呼叫),或是 mock 上次被呼叫時使用的引" +"數。這將以元組的形式呈現:第一個成員 (member),其可以通過 ``args`` 屬性訪問," +"是 mock 被呼叫時傳遞的所有有序引數(或一個空元組)。第二個成員,其可以通過 " "``kwargs`` 屬性訪問,是所有關鍵字引數(或一個空字典)。" #: ../../library/unittest.mock.rst:646 @@ -689,7 +689,7 @@ msgid "" "and attributes, and *their* methods and attributes:" msgstr "" "除了追蹤對自身的呼叫之外,mock 還會追蹤對方法和屬性的呼降,以及*它們(這些方" -"法和屬性)*的方法和屬性:" +"法和屬性)*\\ 的方法和屬性:" #: ../../library/unittest.mock.rst:692 msgid "" @@ -797,9 +797,9 @@ msgid "" "mock. Therefore, it can match the actual call's arguments regardless of " "whether they were passed positionally or by name::" msgstr "" -"在匹配對 mock 的呼叫時,使用 *spec*(或 *spec_set*)建立的可呼叫 mock 將會內" -"省規格物件的簽名 (signature)。因此,它可以匹配實際呼叫的引數,無論它們是按位" -"置傳遞還是按名稱傳遞:\n" +"在匹配對 mock 的呼叫時,使用 *spec*\\ (或 *spec_set*\\ )建立的可呼叫 mock " +"將會內省規格物件的簽名 (signature)。因此,它可以匹配實際呼叫的引數,無論它們" +"是按位置傳遞還是按名稱傳遞:\n" "\n" "::" From 4dbeab8ea72d12d3020a853c39ec6544ead8ae8a Mon Sep 17 00:00:00 2001 From: Payon Date: Wed, 29 Nov 2023 13:29:21 +0800 Subject: [PATCH 35/39] Translate mock example to rst:99 (#705) Co-authored-by: mindihx --- library/unittest.mock-examples.po | 38 ++++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/library/unittest.mock-examples.po b/library/unittest.mock-examples.po index badb5f9e01..d0479ae448 100644 --- a/library/unittest.mock-examples.po +++ b/library/unittest.mock-examples.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-09-09 00:03+0000\n" -"PO-Revision-Date: 2016-11-19 00:35+0000\n" +"PO-Revision-Date: 2023-11-21 22:16+0800\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -17,42 +17,47 @@ 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.4\n" #: ../../library/unittest.mock-examples.rst:2 msgid ":mod:`unittest.mock` --- getting started" -msgstr "" +msgstr ":mod:`unittest.mock` --- 入門指南" #: ../../library/unittest.mock-examples.rst:27 msgid "Using Mock" -msgstr "" +msgstr "使用 Mock 的方式" #: ../../library/unittest.mock-examples.rst:30 msgid "Mock Patching Methods" -msgstr "" +msgstr "使用 Mock 來 patching 方法" #: ../../library/unittest.mock-examples.rst:32 msgid "Common uses for :class:`Mock` objects include:" -msgstr "" +msgstr ":class:`Mock` 物件的常見用法包含:" #: ../../library/unittest.mock-examples.rst:34 msgid "Patching methods" -msgstr "" +msgstr "Patching 方法" #: ../../library/unittest.mock-examples.rst:35 msgid "Recording method calls on objects" -msgstr "" +msgstr "記錄在物件上的方法呼叫" #: ../../library/unittest.mock-examples.rst:37 msgid "" "You might want to replace a method on an object to check that it is called " "with the correct arguments by another part of the system:" msgstr "" +"你可能會想要取代一個物件上的方法,以便檢查系統的另一部分是否使用正確的引數呼" +"叫它:" #: ../../library/unittest.mock-examples.rst:45 msgid "" "Once our mock has been used (``real.method`` in this example) it has methods " "and attributes that allow you to make assertions about how it has been used." msgstr "" +"一旦我們的 mock 已經被使用(例如在這個範例中的 ``real.method``\\ ),它就有了" +"方法和屬性,允許你對其使用方式進行斷言 (assertions)。" #: ../../library/unittest.mock-examples.rst:50 msgid "" @@ -60,6 +65,8 @@ msgid "" "are interchangeable. As the ``MagicMock`` is the more capable class it makes " "a sensible one to use by default." msgstr "" +"在大多數的範例中,:class:`Mock` 和 :class:`MagicMock` 類別是可以互換的。不過" +"由於 ``MagicMock`` 是功能更強大的類別,因此通常它是一個更好的選擇。" #: ../../library/unittest.mock-examples.rst:54 msgid "" @@ -68,16 +75,21 @@ msgid "" "or :meth:`~Mock.assert_called_once_with` method to check that it was called " "with the correct arguments." msgstr "" +"一旦 mock 被呼叫,它的 :attr:`~Mock.called` 屬性將被設定為 ``True``。更重要的" +"是,我們可以使用 :meth:`~Mock.assert_called_with` 或 :meth:`~Mock." +"assert_called_once_with` 方法來檢查它是否被使用正確的引數來呼叫。" #: ../../library/unittest.mock-examples.rst:59 msgid "" "This example tests that calling ``ProductionClass().method`` results in a " "call to the ``something`` method:" msgstr "" +"這個範例測試呼叫 ``ProductionClass().method`` 是否導致對 ``something`` 方法的" +"呼叫:" #: ../../library/unittest.mock-examples.rst:76 msgid "Mock for Method Calls on an Object" -msgstr "" +msgstr "對物件的方法呼叫使用 mock" #: ../../library/unittest.mock-examples.rst:78 msgid "" @@ -86,18 +98,25 @@ msgid "" "method (or some part of the system under test) and then check that it is " "used in the correct way." msgstr "" +"在上一個範例中,我們直接對物件上的方法進行 patch,以檢查它是否被正確呼叫。另" +"一個常見的用法是將一個物件傳遞給一個方法(或受測系統的某一部分),然後檢查它" +"是否以正確的方式被使用。" #: ../../library/unittest.mock-examples.rst:83 msgid "" "The simple ``ProductionClass`` below has a ``closer`` method. If it is " "called with an object then it calls ``close`` on it." msgstr "" +"下面是一個單純的 ``ProductionClass``,含有一個 ``closer`` 方法。如果它被傳入" +"一個物件,它就會呼叫此物件中的 ``close``。" #: ../../library/unittest.mock-examples.rst:91 msgid "" "So to test it we need to pass in an object with a ``close`` method and check " "that it was called correctly." msgstr "" +"因此,為了對此進行測試,我們需要傳遞一個具有 ``close`` 方法的物件,並檢查它是" +"否被正確的呼叫。" #: ../../library/unittest.mock-examples.rst:99 msgid "" @@ -106,6 +125,9 @@ msgid "" "accessing it in the test will create it, but :meth:`~Mock." "assert_called_with` will raise a failure exception." msgstr "" +"我們不必做任何額外的事情來為 mock 提供 'close' 方法,存取 close 會建立它。因" +"此,如果 'close' 並未被呼叫過,在測試中存取 'close' 就會建立它,但 :meth:" +"`~Mock.assert_called_with` 就會引發一個失敗的例外。" #: ../../library/unittest.mock-examples.rst:106 msgid "Mocking Classes" From 77db6817222a31d054ff208be11fcdf4d168d6fb Mon Sep 17 00:00:00 2001 From: "Wei-Hsiang (Matt) Wang" Date: Wed, 29 Nov 2023 14:07:35 +0800 Subject: [PATCH 36/39] fix(action): should take default branch name as the version in CI (#730) --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d8d8a26561..07c004fb95 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,4 +13,4 @@ jobs: run: sudo apt-get install gettext - name: Validate - run: VERSION=${{ github.event.pull_request.base.ref }} MODE=dummy make all + run: VERSION=${{ github.event.repository.default_branch }} MODE=dummy make all From bc14c29ca87f928c6ee92849df5e75ddfbbe3760 Mon Sep 17 00:00:00 2001 From: "Wei-Hsiang (Matt) Wang" Date: Wed, 29 Nov 2023 16:31:00 +0800 Subject: [PATCH 37/39] fix(unittest.mock): render error (#732) --- library/unittest.mock.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/unittest.mock.po b/library/unittest.mock.po index b6774e1970..5afcfd1b40 100644 --- a/library/unittest.mock.po +++ b/library/unittest.mock.po @@ -688,8 +688,8 @@ msgid "" "As well as tracking calls to themselves, mocks also track calls to methods " "and attributes, and *their* methods and attributes:" msgstr "" -"除了追蹤對自身的呼叫之外,mock 還會追蹤對方法和屬性的呼降,以及*它們(這些方" -"法和屬性)*\\ 的方法和屬性:" +"除了追蹤對自身的呼叫之外,mock 還會追蹤對方法和屬性的呼叫,以及\\ *它們(這些" +"方法和屬性)*\\ 的方法和屬性:" #: ../../library/unittest.mock.rst:692 msgid "" From 44eb265d206cd27ab5db99012b520bb75c997306 Mon Sep 17 00:00:00 2001 From: RockLeon <34214497+rockleona@users.noreply.github.com> Date: Thu, 30 Nov 2023 00:11:39 -0600 Subject: [PATCH 38/39] Add a Script to List Translate Progress by File and Show the Assignee (#706) --- .github/workflows/summarize_progress.yml | 28 + .scripts/poetry.lock | 142 ++++- .scripts/pyproject.toml | 2 +- .scripts/summarize_progress.sh | 12 + .../dist/summarize_progress.md | 498 ++++++++++++++++++ .scripts/summarize_progress/main.py | 138 +++++ 6 files changed, 817 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/summarize_progress.yml create mode 100755 .scripts/summarize_progress.sh create mode 100644 .scripts/summarize_progress/dist/summarize_progress.md create mode 100644 .scripts/summarize_progress/main.py diff --git a/.github/workflows/summarize_progress.yml b/.github/workflows/summarize_progress.yml new file mode 100644 index 0000000000..32bbf5fd17 --- /dev/null +++ b/.github/workflows/summarize_progress.yml @@ -0,0 +1,28 @@ +name: summarize_progress + +on: + schedule: + - cron: '30 23 * * 5' + +jobs: + ci: + runs-on: ubuntu-latest + permissions: + # Give the default GITHUB_TOKEN write permission to commit and push the + # added or changed files to the repository. + contents: write + steps: + - uses: actions/checkout@v2 + + - name: Install poetry + uses: abatilo/actions-poetry@v2 + + - name: Execute Check Process + run: | + chmod +x .scripts/summarize_progress.sh + .scripts/summarize_progress.sh + shell: bash + + - uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: Weekly Update -- Summarize Progress \ No newline at end of file diff --git a/.scripts/poetry.lock b/.scripts/poetry.lock index 7fa4a914bc..51aa16cda8 100644 --- a/.scripts/poetry.lock +++ b/.scripts/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.5.0 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.7.0 and should not be changed by hand. [[package]] name = "certifi" @@ -22,6 +22,105 @@ files = [ {file = "chardet-3.0.4.tar.gz", hash = "sha256:84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae"}, ] +[[package]] +name = "charset-normalizer" +version = "3.3.2" +description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." +optional = false +python-versions = ">=3.7.0" +files = [ + {file = "charset-normalizer-3.3.2.tar.gz", hash = "sha256:f30c3cb33b24454a82faecaf01b19c18562b1e89558fb6c56de4d9118a032fd5"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:25baf083bf6f6b341f4121c2f3c548875ee6f5339300e08be3f2b2ba1721cdd3"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:06435b539f889b1f6f4ac1758871aae42dc3a8c0e24ac9e60c2384973ad73027"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:9063e24fdb1e498ab71cb7419e24622516c4a04476b17a2dab57e8baa30d6e03"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6897af51655e3691ff853668779c7bad41579facacf5fd7253b0133308cf000d"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1d3193f4a680c64b4b6a9115943538edb896edc190f0b222e73761716519268e"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:cd70574b12bb8a4d2aaa0094515df2463cb429d8536cfb6c7ce983246983e5a6"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8465322196c8b4d7ab6d1e049e4c5cb460d0394da4a27d23cc242fbf0034b6b5"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a9a8e9031d613fd2009c182b69c7b2c1ef8239a0efb1df3f7c8da66d5dd3d537"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:beb58fe5cdb101e3a055192ac291b7a21e3b7ef4f67fa1d74e331a7f2124341c"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:e06ed3eb3218bc64786f7db41917d4e686cc4856944f53d5bdf83a6884432e12"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:2e81c7b9c8979ce92ed306c249d46894776a909505d8f5a4ba55b14206e3222f"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:572c3763a264ba47b3cf708a44ce965d98555f618ca42c926a9c1616d8f34269"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:fd1abc0d89e30cc4e02e4064dc67fcc51bd941eb395c502aac3ec19fab46b519"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-win32.whl", hash = "sha256:3d47fa203a7bd9c5b6cee4736ee84ca03b8ef23193c0d1ca99b5089f72645c73"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-win_amd64.whl", hash = "sha256:10955842570876604d404661fbccbc9c7e684caf432c09c715ec38fbae45ae09"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:802fe99cca7457642125a8a88a084cef28ff0cf9407060f7b93dca5aa25480db"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:573f6eac48f4769d667c4442081b1794f52919e7edada77495aaed9236d13a96"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:549a3a73da901d5bc3ce8d24e0600d1fa85524c10287f6004fbab87672bf3e1e"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f27273b60488abe721a075bcca6d7f3964f9f6f067c8c4c605743023d7d3944f"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1ceae2f17a9c33cb48e3263960dc5fc8005351ee19db217e9b1bb15d28c02574"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:65f6f63034100ead094b8744b3b97965785388f308a64cf8d7c34f2f2e5be0c4"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:753f10e867343b4511128c6ed8c82f7bec3bd026875576dfd88483c5c73b2fd8"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4a78b2b446bd7c934f5dcedc588903fb2f5eec172f3d29e52a9096a43722adfc"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:e537484df0d8f426ce2afb2d0f8e1c3d0b114b83f8850e5f2fbea0e797bd82ae"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:eb6904c354526e758fda7167b33005998fb68c46fbc10e013ca97f21ca5c8887"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:deb6be0ac38ece9ba87dea880e438f25ca3eddfac8b002a2ec3d9183a454e8ae"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:4ab2fe47fae9e0f9dee8c04187ce5d09f48eabe611be8259444906793ab7cbce"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:80402cd6ee291dcb72644d6eac93785fe2c8b9cb30893c1af5b8fdd753b9d40f"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-win32.whl", hash = "sha256:7cd13a2e3ddeed6913a65e66e94b51d80a041145a026c27e6bb76c31a853c6ab"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-win_amd64.whl", hash = "sha256:663946639d296df6a2bb2aa51b60a2454ca1cb29835324c640dafb5ff2131a77"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:0b2b64d2bb6d3fb9112bafa732def486049e63de9618b5843bcdd081d8144cd8"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:ddbb2551d7e0102e7252db79ba445cdab71b26640817ab1e3e3648dad515003b"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:55086ee1064215781fff39a1af09518bc9255b50d6333f2e4c74ca09fac6a8f6"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8f4a014bc36d3c57402e2977dada34f9c12300af536839dc38c0beab8878f38a"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a10af20b82360ab00827f916a6058451b723b4e65030c5a18577c8b2de5b3389"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8d756e44e94489e49571086ef83b2bb8ce311e730092d2c34ca8f7d925cb20aa"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:90d558489962fd4918143277a773316e56c72da56ec7aa3dc3dbbe20fdfed15b"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6ac7ffc7ad6d040517be39eb591cac5ff87416c2537df6ba3cba3bae290c0fed"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:7ed9e526742851e8d5cc9e6cf41427dfc6068d4f5a3bb03659444b4cabf6bc26"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:8bdb58ff7ba23002a4c5808d608e4e6c687175724f54a5dade5fa8c67b604e4d"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-musllinux_1_1_ppc64le.whl", hash = "sha256:6b3251890fff30ee142c44144871185dbe13b11bab478a88887a639655be1068"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-musllinux_1_1_s390x.whl", hash = "sha256:b4a23f61ce87adf89be746c8a8974fe1c823c891d8f86eb218bb957c924bb143"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:efcb3f6676480691518c177e3b465bcddf57cea040302f9f4e6e191af91174d4"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-win32.whl", hash = "sha256:d965bba47ddeec8cd560687584e88cf699fd28f192ceb452d1d7ee807c5597b7"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-win_amd64.whl", hash = "sha256:96b02a3dc4381e5494fad39be677abcb5e6634bf7b4fa83a6dd3112607547001"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:95f2a5796329323b8f0512e09dbb7a1860c46a39da62ecb2324f116fa8fdc85c"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c002b4ffc0be611f0d9da932eb0f704fe2602a9a949d1f738e4c34c75b0863d5"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a981a536974bbc7a512cf44ed14938cf01030a99e9b3a06dd59578882f06f985"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3287761bc4ee9e33561a7e058c72ac0938c4f57fe49a09eae428fd88aafe7bb6"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:42cb296636fcc8b0644486d15c12376cb9fa75443e00fb25de0b8602e64c1714"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0a55554a2fa0d408816b3b5cedf0045f4b8e1a6065aec45849de2d6f3f8e9786"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:c083af607d2515612056a31f0a8d9e0fcb5876b7bfc0abad3ecd275bc4ebc2d5"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:87d1351268731db79e0f8e745d92493ee2841c974128ef629dc518b937d9194c"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:bd8f7df7d12c2db9fab40bdd87a7c09b1530128315d047a086fa3ae3435cb3a8"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-musllinux_1_1_s390x.whl", hash = "sha256:c180f51afb394e165eafe4ac2936a14bee3eb10debc9d9e4db8958fe36afe711"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:8c622a5fe39a48f78944a87d4fb8a53ee07344641b0562c540d840748571b811"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-win32.whl", hash = "sha256:db364eca23f876da6f9e16c9da0df51aa4f104a972735574842618b8c6d999d4"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-win_amd64.whl", hash = "sha256:86216b5cee4b06df986d214f664305142d9c76df9b6512be2738aa72a2048f99"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:6463effa3186ea09411d50efc7d85360b38d5f09b870c48e4600f63af490e56a"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:6c4caeef8fa63d06bd437cd4bdcf3ffefe6738fb1b25951440d80dc7df8c03ac"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:37e55c8e51c236f95b033f6fb391d7d7970ba5fe7ff453dad675e88cf303377a"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fb69256e180cb6c8a894fee62b3afebae785babc1ee98b81cdf68bbca1987f33"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ae5f4161f18c61806f411a13b0310bea87f987c7d2ecdbdaad0e94eb2e404238"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b2b0a0c0517616b6869869f8c581d4eb2dd83a4d79e0ebcb7d373ef9956aeb0a"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:45485e01ff4d3630ec0d9617310448a8702f70e9c01906b0d0118bdf9d124cf2"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:eb00ed941194665c332bf8e078baf037d6c35d7c4f3102ea2d4f16ca94a26dc8"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:2127566c664442652f024c837091890cb1942c30937add288223dc895793f898"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:a50aebfa173e157099939b17f18600f72f84eed3049e743b68ad15bd69b6bf99"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:4d0d1650369165a14e14e1e47b372cfcb31d6ab44e6e33cb2d4e57265290044d"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:923c0c831b7cfcb071580d3f46c4baf50f174be571576556269530f4bbd79d04"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:06a81e93cd441c56a9b65d8e1d043daeb97a3d0856d177d5c90ba85acb3db087"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-win32.whl", hash = "sha256:6ef1d82a3af9d3eecdba2321dc1b3c238245d890843e040e41e470ffa64c3e25"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-win_amd64.whl", hash = "sha256:eb8821e09e916165e160797a6c17edda0679379a4be5c716c260e836e122f54b"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:c235ebd9baae02f1b77bcea61bce332cb4331dc3617d254df3323aa01ab47bd4"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:5b4c145409bef602a690e7cfad0a15a55c13320ff7a3ad7ca59c13bb8ba4d45d"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:68d1f8a9e9e37c1223b656399be5d6b448dea850bed7d0f87a8311f1ff3dabb0"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:22afcb9f253dac0696b5a4be4a1c0f8762f8239e21b99680099abd9b2b1b2269"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e27ad930a842b4c5eb8ac0016b0a54f5aebbe679340c26101df33424142c143c"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1f79682fbe303db92bc2b1136016a38a42e835d932bab5b3b1bfcfbf0640e519"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b261ccdec7821281dade748d088bb6e9b69e6d15b30652b74cbbac25e280b796"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:122c7fa62b130ed55f8f285bfd56d5f4b4a5b503609d181f9ad85e55c89f4185"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:d0eccceffcb53201b5bfebb52600a5fb483a20b61da9dbc885f8b103cbe7598c"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:9f96df6923e21816da7e0ad3fd47dd8f94b2a5ce594e00677c0013018b813458"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:7f04c839ed0b6b98b1a7501a002144b76c18fb1c1850c8b98d458ac269e26ed2"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:34d1c8da1e78d2e001f363791c98a272bb734000fcef47a491c1e3b0505657a8"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:ff8fa367d09b717b2a17a052544193ad76cd49979c805768879cb63d9ca50561"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-win32.whl", hash = "sha256:aed38f6e4fb3f5d6bf81bfa990a07806be9d83cf7bacef998ab1a9bd660a581f"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-win_amd64.whl", hash = "sha256:b01b88d45a6fcb69667cd6d2f7a9aeb4bf53760d7fc536bf679ec94fe9f3ff3d"}, + {file = "charset_normalizer-3.3.2-py3-none-any.whl", hash = "sha256:3e4d1f6587322d2788836a99c69062fbb091331ec940e02d12d179c1d53e25fc"}, +] + [[package]] name = "googletrans" version = "3.1.0a0" @@ -151,6 +250,8 @@ files = [ {file = "lxml-4.9.3-cp27-cp27m-macosx_11_0_x86_64.whl", hash = "sha256:b0a545b46b526d418eb91754565ba5b63b1c0b12f9bd2f808c852d9b4b2f9b5c"}, {file = "lxml-4.9.3-cp27-cp27m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:075b731ddd9e7f68ad24c635374211376aa05a281673ede86cbe1d1b3455279d"}, {file = "lxml-4.9.3-cp27-cp27m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:1e224d5755dba2f4a9498e150c43792392ac9b5380aa1b845f98a1618c94eeef"}, + {file = "lxml-4.9.3-cp27-cp27m-win32.whl", hash = "sha256:2c74524e179f2ad6d2a4f7caf70e2d96639c0954c943ad601a9e146c76408ed7"}, + {file = "lxml-4.9.3-cp27-cp27m-win_amd64.whl", hash = "sha256:4f1026bc732b6a7f96369f7bfe1a4f2290fb34dce00d8644bc3036fb351a4ca1"}, {file = "lxml-4.9.3-cp27-cp27mu-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:c0781a98ff5e6586926293e59480b64ddd46282953203c76ae15dbbbf302e8bb"}, {file = "lxml-4.9.3-cp27-cp27mu-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:cef2502e7e8a96fe5ad686d60b49e1ab03e438bd9123987994528febd569868e"}, {file = "lxml-4.9.3-cp310-cp310-macosx_11_0_x86_64.whl", hash = "sha256:b86164d2cff4d3aaa1f04a14685cbc072efd0b4f99ca5708b2ad1b9b5988a991"}, @@ -257,6 +358,27 @@ files = [ {file = "polib-1.1.1.tar.gz", hash = "sha256:e02c355ae5e054912e3b0d16febc56510eff7e49d60bf22aecb463bd2f2a2dfa"}, ] +[[package]] +name = "requests" +version = "2.31.0" +description = "Python HTTP for Humans." +optional = false +python-versions = ">=3.7" +files = [ + {file = "requests-2.31.0-py3-none-any.whl", hash = "sha256:58cd2187c01e70e6e26505bca751777aa9f2ee0b7f4300988b709f44e013003f"}, + {file = "requests-2.31.0.tar.gz", hash = "sha256:942c5a758f98d790eaed1a29cb6eefc7ffb0d1cf7af05c3d2791656dbd6ad1e1"}, +] + +[package.dependencies] +certifi = ">=2017.4.17" +charset-normalizer = ">=2,<4" +idna = ">=2.5,<4" +urllib3 = ">=1.21.1,<3" + +[package.extras] +socks = ["PySocks (>=1.5.6,!=1.5.7)"] +use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"] + [[package]] name = "rfc3986" version = "1.5.0" @@ -312,7 +434,23 @@ tmserver = ["cheroot (==9.0.0)"] trados = ["BeautifulSoup4 (>=4.3)"] yaml = ["ruamel.yaml (==0.17.21)"] +[[package]] +name = "urllib3" +version = "2.1.0" +description = "HTTP library with thread-safe connection pooling, file post, and more." +optional = false +python-versions = ">=3.8" +files = [ + {file = "urllib3-2.1.0-py3-none-any.whl", hash = "sha256:55901e917a5896a349ff771be919f8bd99aff50b79fe58fec595eb37bbc56bb3"}, + {file = "urllib3-2.1.0.tar.gz", hash = "sha256:df7aa8afb0148fa78488e7899b2c59b5f4ffcfa82e6c54ccb9dd37c1d7b52d54"}, +] + +[package.extras] +brotli = ["brotli (>=1.0.9)", "brotlicffi (>=0.8.0)"] +socks = ["pysocks (>=1.5.6,!=1.5.7,<2.0)"] +zstd = ["zstandard (>=0.18.0)"] + [metadata] lock-version = "2.0" python-versions = "^3.10" -content-hash = "3e5dc631f7647aaa206c3b276ca58abd9162711ce9d618ad7be743d4f7b4c52c" +content-hash = "4c36095f6eed9772d24fda2b7fd4491f9c72ce40992ed2b39f5151d2ee5754bc" diff --git a/.scripts/pyproject.toml b/.scripts/pyproject.toml index cdb505ad0e..8c9487037d 100644 --- a/.scripts/pyproject.toml +++ b/.scripts/pyproject.toml @@ -10,7 +10,7 @@ python = "^3.10" polib = "1.1.1" googletrans = "3.1.0a0" translate-toolkit = "3.8.1" - +requests = "2.31.0" [build-system] requires = ["poetry-core"] diff --git a/.scripts/summarize_progress.sh b/.scripts/summarize_progress.sh new file mode 100755 index 0000000000..b715de1f32 --- /dev/null +++ b/.scripts/summarize_progress.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +WORK_DIR=.scripts +cd $WORK_DIR + +source utils/install_poetry.sh + +poetry lock +poetry install +poetry run bash -c " + python summarize_progress/main.py +" diff --git a/.scripts/summarize_progress/dist/summarize_progress.md b/.scripts/summarize_progress/dist/summarize_progress.md new file mode 100644 index 0000000000..145d5cbe28 --- /dev/null +++ b/.scripts/summarize_progress/dist/summarize_progress.md @@ -0,0 +1,498 @@ +- // + - about.po-----------------------------✅ + - bugs.po------------------------------✅ + - contents.po--------------------------✅ + - copyright.po-------------------------✅ + - glossary.po--------------------------✅ + - license.po---------------------------✅ + - sphinx.po----------------------------✅ +- c-api/ + - abstract.po--------------------------✅ + - allocation.po------------------------✅ + - apiabiversion.po---------------------✅ + - arg.po-------------------------------Ongoing, 47.59 % + - bool.po------------------------------Ongoing, 90.91 % + - buffer.po----------------------------Ongoing, 14.91 % + - bytearray.po-------------------------✅ + - bytes.po-----------------------------Ongoing, 51.61 % + - call.po------------------------------Ongoing, 98.96 % + - capsule.po---------------------------Ongoing, 6.25 % + - cell.po------------------------------✅ + - code.po------------------------------Ongoing, 19.3 % + - codec.po-----------------------------✅ + - complex.po---------------------------✅ + - concrete.po--------------------------✅ + - contextvars.po-----------------------Ongoing, 6.67 % + - conversion.po------------------------Ongoing, 11.54 % + - coro.po------------------------------✅ + - datetime.po--------------------------Ongoing, 82.69 % + - descriptor.po------------------------✅ + - dict.po------------------------------Ongoing, 22.92 % + - exceptions.po------------------------Ongoing, 59.78 % + - file.po------------------------------✅ + - float.po-----------------------------Ongoing, 8.57 % + - frame.po-----------------------------❌, 💻 xingularity + - function.po--------------------------Ongoing, 67.65 % + - gcsupport.po-------------------------Ongoing, 2.0 % + - gen.po-------------------------------✅ + - import.po----------------------------Ongoing, 21.82 % + - index.po-----------------------------✅ + - init.po------------------------------Ongoing, 25.42 % + - init_config.po-----------------------Ongoing, 12.87 % + - intro.po-----------------------------Ongoing, 98.43 % + - iter.po------------------------------✅ + - iterator.po--------------------------Ongoing, 25.0 % + - list.po------------------------------✅ + - long.po------------------------------Ongoing, 13.85 % + - mapping.po---------------------------Ongoing, 11.11 % + - marshal.po---------------------------❌ + - memory.po----------------------------Ongoing, 25.65 % + - memoryview.po------------------------Ongoing, 27.27 % + - method.po----------------------------✅ + - module.po----------------------------Ongoing, 12.07 % + - none.po------------------------------Ongoing, 57.14 % + - number.po----------------------------Ongoing, 12.5 % + - objbuffer.po-------------------------✅ + - object.po----------------------------Ongoing, 12.0 % + - objimpl.po---------------------------❌ + - perfmaps.po--------------------------❌ + - refcounting.po-----------------------✅ + - reflection.po------------------------Ongoing, 12.5 % + - sequence.po--------------------------Ongoing, 10.0 % + - set.po-------------------------------Ongoing, 17.86 % + - slice.po-----------------------------Ongoing, 9.52 % + - stable.po----------------------------Ongoing, 83.72 % + - structures.po------------------------Ongoing, 30.86 % + - sys.po-------------------------------Ongoing, 10.53 % + - tuple.po-----------------------------Ongoing, 7.5 % + - type.po------------------------------Ongoing, 7.07 % + - typehints.po-------------------------✅ + - typeobj.po---------------------------Ongoing, 42.35 % + - unicode.po---------------------------Ongoing, 13.8 % + - utilities.po-------------------------✅ + - veryhigh.po--------------------------Ongoing, 3.51 % + - weakref.po---------------------------Ongoing, 8.33 % +- distributing/ + - index.po-----------------------------✅ +- extending/ + - building.po--------------------------Ongoing, 22.22 % + - embedding.po-------------------------Ongoing, 4.44 % + - extending.po-------------------------Ongoing, 5.56 % + - index.po-----------------------------✅ + - newtypes.po--------------------------Ongoing, 12.36 % + - newtypes_tutorial.po-----------------Ongoing, 0.82 % + - windows.po---------------------------❌ +- faq/ + - design.po----------------------------✅ + - extending.po-------------------------✅ + - general.po---------------------------✅ + - gui.po-------------------------------✅ + - index.po-----------------------------✅ + - installed.po-------------------------✅ + - library.po---------------------------✅ + - programming.po-----------------------Ongoing, 98.72 % + - windows.po---------------------------✅ +- howto/ + - annotations.po-----------------------✅ + - argparse.po--------------------------Ongoing, 57.61 %, 💻 sweslo17 + - clinic.po----------------------------✅ + - cporting.po--------------------------Ongoing, 20.0 % + - curses.po----------------------------Ongoing, 17.14 % + - descriptor.po------------------------Ongoing, 10.17 % + - enum.po------------------------------❌ + - functional.po------------------------Ongoing, 7.25 % + - index.po-----------------------------✅ + - instrumentation.po-------------------✅ + - ipaddress.po-------------------------Ongoing, 10.42 % + - isolating-extensions.po--------------❌ + - logging-cookbook.po------------------Ongoing, 1.63 % + - logging.po---------------------------Ongoing, 11.06 % + - perf_profiling.po--------------------❌, 💻 mattwang44 + - pyporting.po-------------------------Ongoing, 13.83 % + - regex.po-----------------------------Ongoing, 20.91 % + - sockets.po---------------------------Ongoing, 98.28 % + - sorting.po---------------------------✅ + - unicode.po---------------------------Ongoing, 3.31 % + - urllib2.po---------------------------Ongoing, 16.67 % +- includes/ + - wasm-notavail.po---------------------❌ +- installing/ + - index.po-----------------------------✅ +- library/ + - 2to3.po------------------------------Ongoing, 32.23 % + - __future__.po------------------------✅ + - __main__.po--------------------------Ongoing, 3.7 % + - _thread.po---------------------------Ongoing, 9.62 % + - abc.po-------------------------------✅ + - aifc.po------------------------------Ongoing, 22.22 % + - allos.po-----------------------------✅ + - archiving.po-------------------------✅ + - argparse.po--------------------------Ongoing, 12.13 % + - array.po-----------------------------✅ + - ast.po-------------------------------Ongoing, 2.98 %, 💻 mattwang44 + - asyncio-api-index.po-----------------Ongoing, 97.0 % + - asyncio-dev.po-----------------------✅ + - asyncio-eventloop.po-----------------Ongoing, 6.6 %, 💻 xchux + - asyncio-exceptions.po----------------✅ + - asyncio-extending.po-----------------❌ + - asyncio-future.po--------------------✅ + - asyncio-llapi-index.po---------------✅ + - asyncio-platforms.po-----------------✅ + - asyncio-policy.po--------------------Ongoing, 1.49 % + - asyncio-protocol.po------------------Ongoing, 3.26 % + - asyncio-queue.po---------------------✅ + - asyncio-runner.po--------------------Ongoing, 17.14 % + - asyncio-stream.po--------------------Ongoing, 89.66 % + - asyncio-subprocess.po----------------Ongoing, 9.09 % + - asyncio-sync.po----------------------Ongoing, 83.15 % + - asyncio-task.po----------------------Ongoing, 7.17 % + - asyncio.po---------------------------✅ + - atexit.po----------------------------Ongoing, 10.53 % + - audioop.po---------------------------Ongoing, 12.0 % + - audit_events.po----------------------✅ + - base64.po----------------------------Ongoing, 15.0 %, 💻 Yang92047111 + - bdb.po-------------------------------Ongoing, 1.83 % + - binary.po----------------------------✅ + - binascii.po--------------------------Ongoing, 25.0 % + - bisect.po----------------------------✅ + - builtins.po--------------------------✅ + - bz2.po-------------------------------Ongoing, 4.17 % + - calendar.po--------------------------Ongoing, 74.74 % + - cgi.po-------------------------------Ongoing, 17.43 % + - cgitb.po-----------------------------Ongoing, 50.0 % + - chunk.po-----------------------------Ongoing, 43.59 % + - cmath.po-----------------------------Ongoing, 5.36 % + - cmd.po-------------------------------Ongoing, 10.87 % + - cmdline.po---------------------------✅ + - code.po------------------------------Ongoing, 6.45 % + - codecs.po----------------------------Ongoing, 49.53 % + - codeop.po----------------------------Ongoing, 7.14 % + - collections.abc.po-------------------Ongoing, 54.47 % + - collections.po-----------------------✅ + - colorsys.po--------------------------✅ + - compileall.po------------------------Ongoing, 13.56 % + - concurrency.po-----------------------✅ + - concurrent.futures.po----------------Ongoing, 97.89 % + - concurrent.po------------------------✅ + - configparser.po----------------------Ongoing, 9.34 % + - constants.po-------------------------✅ + - contextlib.po------------------------Ongoing, 5.34 % + - contextvars.po-----------------------Ongoing, 4.35 % + - copy.po------------------------------✅ + - copyreg.po---------------------------Ongoing, 41.67 % + - crypt.po-----------------------------Ongoing, 34.29 % + - crypto.po----------------------------✅ + - csv.po-------------------------------✅ + - ctypes.po----------------------------Ongoing, 14.35 % + - curses.ascii.po----------------------Ongoing, 7.25 % + - curses.panel.po----------------------Ongoing, 4.35 % + - curses.po----------------------------Ongoing, 11.57 % + - custominterp.po----------------------❌ + - dataclasses.po-----------------------Ongoing, 75.0 % + - datatypes.po-------------------------✅ + - datetime.po--------------------------Ongoing, 29.81 % + - dbm.po-------------------------------Ongoing, 18.18 % + - debug.po-----------------------------✅ + - decimal.po---------------------------Ongoing, 2.37 %, 💻 0gien + - development.po-----------------------Ongoing, 33.33 % + - devmode.po---------------------------Ongoing, 10.2 % + - dialog.po----------------------------Ongoing, 7.02 % + - difflib.po---------------------------Ongoing, 12.69 % + - dis.po-------------------------------Ongoing, 8.54 % + - distribution.po----------------------Ongoing, 50.0 % + - doctest.po---------------------------Ongoing, 6.01 % + - email.charset.po---------------------Ongoing, 13.64 %, 💻 isabellechiu + - email.compat32-message.po------------Ongoing, 2.88 % + - email.contentmanager.po--------------Ongoing, 7.32 % + - email.encoders.po--------------------Ongoing, 13.33 % + - email.errors.po----------------------Ongoing, 4.17 % + - email.examples.po--------------------Ongoing, 8.33 % + - email.generator.po-------------------Ongoing, 7.32 % + - email.header.po----------------------Ongoing, 7.89 % + - email.headerregistry.po--------------Ongoing, 34.95 % + - email.iterators.po-------------------Ongoing, 9.09 % + - email.message.po---------------------Ongoing, 2.91 % + - email.mime.po------------------------Ongoing, 26.32 % + - email.parser.po----------------------Ongoing, 4.26 % + - email.po-----------------------------Ongoing, 24.0 % + - email.policy.po----------------------Ongoing, 8.91 % + - email.utils.po-----------------------Ongoing, 12.9 % + - ensurepip.po-------------------------Ongoing, 97.3 % + - enum.po------------------------------✅ + - errno.po-----------------------------Ongoing, 0.75 % + - exceptions.po------------------------Ongoing, 8.47 % + - faulthandler.po----------------------Ongoing, 2.38 % + - fcntl.po-----------------------------Ongoing, 22.22 % + - filecmp.po---------------------------Ongoing, 2.5 % + - fileformats.po-----------------------Ongoing, 50.0 % + - fileinput.po-------------------------Ongoing, 4.65 % + - filesys.po---------------------------✅ + - fnmatch.po---------------------------Ongoing, 51.43 % + - fractions.po-------------------------Ongoing, 6.67 % + - frameworks.po------------------------Ongoing, 33.33 % + - ftplib.po----------------------------Ongoing, 98.55 % + - functional.po------------------------Ongoing, 66.67 % + - functions.po-------------------------Ongoing, 67.25 %, 💻 StevenHsuYL + - functools.po-------------------------Ongoing, 7.78 % + - gc.po--------------------------------Ongoing, 98.25 % + - getopt.po----------------------------Ongoing, 10.53 % + - getpass.po---------------------------Ongoing, 91.67 % + - gettext.po---------------------------Ongoing, 16.38 % + - glob.po------------------------------✅ + - graphlib.po--------------------------✅ + - grp.po-------------------------------Ongoing, 41.38 % + - gzip.po------------------------------Ongoing, 31.15 % + - hashlib.po---------------------------Ongoing, 18.52 %, 💻 mattwang44 + - heapq.po-----------------------------✅ + - hmac.po------------------------------✅ + - html.entities.po---------------------✅ + - html.parser.po-----------------------✅ + - html.po------------------------------✅ + - http.client.po-----------------------Ongoing, 14.55 % + - http.cookiejar.po--------------------Ongoing, 7.79 % + - http.cookies.po----------------------Ongoing, 26.79 % + - http.po------------------------------Ongoing, 98.35 % + - http.server.po-----------------------Ongoing, 11.43 % + - i18n.po------------------------------Ongoing, 33.33 % + - idle.po------------------------------Ongoing, 6.92 % + - imaplib.po---------------------------Ongoing, 12.5 % + - imghdr.po----------------------------Ongoing, 53.66 % + - importlib.metadata.po----------------Ongoing, 1.59 % + - importlib.po-------------------------Ongoing, 13.44 % + - importlib.resources.abc.po-----------Ongoing, 3.33 % + - importlib.resources.po---------------Ongoing, 5.0 % + - index.po-----------------------------✅ + - inspect.po---------------------------Ongoing, 17.63 % + - internet.po--------------------------✅ + - intro.po-----------------------------Ongoing, 60.0 % + - io.po--------------------------------Ongoing, 25.19 %, 💻 cschan1828 + - ipaddress.po-------------------------Ongoing, 1.35 % + - ipc.po-------------------------------❌ + - itertools.po-------------------------Ongoing, 45.73 % + - json.po------------------------------Ongoing, 25.34 % + - keyword.po---------------------------✅ + - language.po--------------------------❌ + - linecache.po-------------------------Ongoing, 35.71 % + - locale.po----------------------------Ongoing, 18.24 % + - logging.config.po--------------------Ongoing, 7.28 % + - logging.handlers.po------------------Ongoing, 33.46 % + - logging.po---------------------------Ongoing, 20.69 % + - lzma.po------------------------------Ongoing, 11.21 % + - mailbox.po---------------------------Ongoing, 8.87 % + - mailcap.po---------------------------Ongoing, 6.67 % + - markup.po----------------------------❌ + - marshal.po---------------------------✅ + - math.po------------------------------Ongoing, 4.76 % + - mimetypes.po-------------------------Ongoing, 18.0 % + - mm.po--------------------------------✅ + - mmap.po------------------------------Ongoing, 12.5 % + - modulefinder.po----------------------Ongoing, 7.69 % + - modules.po---------------------------Ongoing, 33.33 % + - msilib.po----------------------------Ongoing, 5.15 % + - msvcrt.po----------------------------Ongoing, 10.71 % + - multiprocessing.po-------------------Ongoing, 4.49 % + - multiprocessing.shared_memory.po-----Ongoing, 10.0 %, 💻 mattwang44 + - netdata.po---------------------------✅ + - netrc.po-----------------------------✅ + - nis.po-------------------------------Ongoing, 20.0 % + - nntplib.po---------------------------Ongoing, 13.48 % + - numbers.po---------------------------✅ + - numeric.po---------------------------Ongoing, 33.33 % + - operator.po--------------------------Ongoing, 98.89 % + - optparse.po--------------------------Ongoing, 8.65 % + - os.path.po---------------------------✅ + - os.po--------------------------------Ongoing, 18.2 % + - ossaudiodev.po-----------------------Ongoing, 20.41 % + - pathlib.po---------------------------Ongoing, 48.19 %, 💻 mindihx + - pdb.po-------------------------------Ongoing, 9.92 %, 💻 mattwang44 + - persistence.po-----------------------❌ + - pickle.po----------------------------Ongoing, 13.72 % + - pickletools.po-----------------------Ongoing, 23.53 %, 💻 mattwang44 + - pipes.po-----------------------------Ongoing, 25.0 % + - pkgutil.po---------------------------Ongoing, 10.64 % + - platform.po--------------------------Ongoing, 94.92 % + - plistlib.po--------------------------Ongoing, 11.63 % + - poplib.po----------------------------Ongoing, 20.75 % + - posix.po-----------------------------✅ + - pprint.po----------------------------Ongoing, 21.28 % + - profile.po---------------------------Ongoing, 23.57 % + - pty.po-------------------------------Ongoing, 21.05 % + - pwd.po-------------------------------✅ + - py_compile.po------------------------Ongoing, 26.67 % + - pyclbr.po----------------------------Ongoing, 8.0 % + - pydoc.po-----------------------------Ongoing, 30.43 % + - pyexpat.po---------------------------Ongoing, 5.93 % + - python.po----------------------------❌ + - queue.po-----------------------------✅ + - quopri.po----------------------------✅ + - random.po----------------------------Ongoing, 89.42 % + - re.po--------------------------------Ongoing, 35.07 %, 💻 ascodeasice + - readline.po--------------------------Ongoing, 2.08 % + - reprlib.po---------------------------Ongoing, 12.9 % + - resource.po--------------------------Ongoing, 36.52 % + - rlcompleter.po-----------------------Ongoing, 16.67 % + - runpy.po-----------------------------Ongoing, 7.5 % + - sched.po-----------------------------Ongoing, 20.83 % + - secrets.po---------------------------✅ + - security_warnings.po-----------------✅ + - select.po----------------------------Ongoing, 33.33 % + - selectors.po-------------------------Ongoing, 8.93 % + - shelve.po----------------------------Ongoing, 24.32 % + - shlex.po-----------------------------Ongoing, 5.41 % + - shutil.po----------------------------Ongoing, 15.12 % + - signal.po----------------------------Ongoing, 17.65 % + - site.po------------------------------Ongoing, 31.48 % + - smtplib.po---------------------------Ongoing, 17.7 % + - sndhdr.po----------------------------Ongoing, 67.57 % + - socket.po----------------------------Ongoing, 22.4 %, 💻 weijay0804 + - socketserver.po----------------------Ongoing, 5.75 % + - spwd.po------------------------------Ongoing, 52.17 % + - sqlite3.po---------------------------Ongoing, 15.79 % + - ssl.po-------------------------------Ongoing, 15.16 %, 💻 timmy0123 + - stat.po------------------------------Ongoing, 2.47 % + - statistics.po------------------------Ongoing, 99.48 % + - stdtypes.po--------------------------Ongoing, 33.55 % + - string.po----------------------------Ongoing, 35.35 % + - stringprep.po------------------------Ongoing, 4.0 % + - struct.po----------------------------Ongoing, 45.56 %, 💻 Cliying94 + - subprocess.po------------------------Ongoing, 14.83 % + - sunau.po-----------------------------✅ + - superseded.po------------------------✅ + - symtable.po--------------------------✅ + - sys.monitoring.po--------------------❌, 💻 mattwang44 + - sys.po-------------------------------Ongoing, 28.54 % + - sys_path_init.po---------------------❌ + - sysconfig.po-------------------------Ongoing, 40.44 % + - syslog.po----------------------------Ongoing, 29.03 % + - tabnanny.po--------------------------✅ + - tarfile.po---------------------------Ongoing, 11.49 % + - telnetlib.po-------------------------Ongoing, 17.65 % + - tempfile.po--------------------------✅ + - termios.po---------------------------Ongoing, 25.0 % + - test.po------------------------------Ongoing, 5.02 % + - text.po------------------------------✅ + - textwrap.po--------------------------Ongoing, 8.33 % + - threading.po-------------------------Ongoing, 4.07 %, 💻 SivanYeh + - time.po------------------------------Ongoing, 32.55 % + - timeit.po----------------------------✅ + - tk.po--------------------------------✅ + - tkinter.colorchooser.po--------------Ongoing, 33.33 % + - tkinter.dnd.po-----------------------Ongoing, 10.0 % + - tkinter.font.po----------------------Ongoing, 8.57 % + - tkinter.messagebox.po----------------Ongoing, 21.43 % + - tkinter.po---------------------------Ongoing, 24.35 % + - tkinter.scrolledtext.po--------------Ongoing, 14.29 % + - tkinter.tix.po-----------------------Ongoing, 11.11 % + - tkinter.ttk.po-----------------------Ongoing, 3.18 % + - token.po-----------------------------Ongoing, 1.52 % + - tokenize.po--------------------------Ongoing, 11.63 % + - tomllib.po---------------------------✅ + - trace.po-----------------------------Ongoing, 5.13 % + - traceback.po-------------------------Ongoing, 12.22 % + - tracemalloc.po-----------------------Ongoing, 15.97 % + - tty.po-------------------------------Ongoing, 72.73 % + - turtle.po----------------------------Ongoing, 21.25 % + - types.po-----------------------------Ongoing, 5.77 % + - typing.po----------------------------Ongoing, 30.0 %, 💻 rockleona + - undoc.po-----------------------------Ongoing, 22.22 % + - unicodedata.po-----------------------Ongoing, 21.88 % + - unittest.mock-examples.po------------❌, 💻 ken71301 + - unittest.mock.po---------------------Ongoing, 35.66 %, 💻 ken71301 + - unittest.po--------------------------Ongoing, 27.78 % + - unix.po------------------------------✅ + - urllib.error.po----------------------✅ + - urllib.parse.po----------------------Ongoing, 18.12 % + - urllib.po----------------------------✅ + - urllib.request.po--------------------Ongoing, 29.43 % + - urllib.robotparser.po----------------✅ + - uu.po--------------------------------Ongoing, 46.67 % + - uuid.po------------------------------✅, 💻 933yee + - venv.po------------------------------Ongoing, 60.18 % + - warnings.po--------------------------Ongoing, 20.0 % + - wave.po------------------------------Ongoing, 9.43 % + - weakref.po---------------------------Ongoing, 4.71 % + - webbrowser.po------------------------Ongoing, 55.84 %, 💻 griiid + - windows.po---------------------------✅ + - winreg.po----------------------------Ongoing, 14.45 % + - winsound.po--------------------------Ongoing, 29.41 % + - wsgiref.po---------------------------✅ + - xdrlib.po----------------------------Ongoing, 10.71 % + - xml.dom.minidom.po-------------------Ongoing, 13.73 % + - xml.dom.po---------------------------Ongoing, 29.91 % + - xml.dom.pulldom.po-------------------Ongoing, 40.74 % + - xml.etree.elementtree.po-------------Ongoing, 16.02 % + - xml.po-------------------------------✅ + - xml.sax.handler.po-------------------Ongoing, 5.83 % + - xml.sax.po---------------------------Ongoing, 18.75 % + - xml.sax.reader.po--------------------Ongoing, 8.0 % + - xml.sax.utils.po---------------------Ongoing, 14.29 % + - xmlrpc.client.po---------------------Ongoing, 23.0 % + - xmlrpc.po----------------------------✅ + - xmlrpc.server.po---------------------Ongoing, 18.37 %, 💻 paultsaich + - zipapp.po----------------------------Ongoing, 8.82 % + - zipfile.po---------------------------Ongoing, 9.9 % + - zipimport.po-------------------------Ongoing, 8.33 % + - zlib.po------------------------------✅ + - zoneinfo.po--------------------------Ongoing, 6.67 % +- reference/ + - compound_stmts.po--------------------Ongoing, 26.19 % + - datamodel.po-------------------------Ongoing, 34.96 % + - executionmodel.po--------------------Ongoing, 31.63 % + - expressions.po-----------------------Ongoing, 36.54 % + - grammar.po---------------------------Ongoing, 33.33 % + - import.po----------------------------Ongoing, 13.68 % + - index.po-----------------------------✅ + - introduction.po----------------------Ongoing, 35.48 % + - lexical_analysis.po------------------Ongoing, 46.73 % + - simple_stmts.po----------------------Ongoing, 37.18 % + - toplevel_components.po---------------✅ +- tutorial/ + - appendix.po--------------------------✅ + - appetite.po--------------------------✅ + - classes.po---------------------------✅ + - controlflow.po-----------------------✅ + - datastructures.po--------------------✅ + - errors.po----------------------------✅ + - floatingpoint.po---------------------✅ + - index.po-----------------------------✅ + - inputoutput.po-----------------------✅ + - interactive.po-----------------------✅ + - interpreter.po-----------------------✅ + - introduction.po----------------------✅, 💻 avatar220928 + - modules.po---------------------------✅ + - stdlib.po----------------------------✅ + - stdlib2.po---------------------------✅ + - venv.po------------------------------✅ + - whatnow.po---------------------------✅ +- using/ + - cmdline.po---------------------------Ongoing, 18.35 % + - configure.po-------------------------Ongoing, 35.11 % + - editors.po---------------------------Ongoing, 33.33 % + - index.po-----------------------------✅ + - mac.po-------------------------------✅ + - unix.po------------------------------✅ + - windows.po---------------------------Ongoing, 26.48 % +- whatsnew/ + - 2.0.po-------------------------------Ongoing, 6.59 % + - 2.1.po-------------------------------Ongoing, 12.23 % + - 2.2.po-------------------------------Ongoing, 2.62 % + - 2.3.po-------------------------------Ongoing, 4.91 % + - 2.4.po-------------------------------Ongoing, 6.34 % + - 2.5.po-------------------------------Ongoing, 12.63 % + - 2.6.po-------------------------------Ongoing, 8.32 % + - 2.7.po-------------------------------Ongoing, 4.64 % + - 3.0.po-------------------------------Ongoing, 17.56 % + - 3.1.po-------------------------------Ongoing, 35.71 % + - 3.10.po------------------------------✅ + - 3.11.po------------------------------Ongoing, 94.79 % + - 3.12.po------------------------------Ongoing, 43.82 %, 💻 mattwang44 + - 3.2.po-------------------------------Ongoing, 24.32 % + - 3.3.po-------------------------------Ongoing, 47.13 % + - 3.4.po-------------------------------Ongoing, 20.35 % + - 3.5.po-------------------------------Ongoing, 23.29 % + - 3.6.po-------------------------------Ongoing, 18.38 % + - 3.7.po-------------------------------Ongoing, 19.82 % + - 3.8.po-------------------------------Ongoing, 29.58 % + - 3.9.po-------------------------------Ongoing, 24.52 % + - changelog.po-------------------------✅ + - index.po-----------------------------✅ diff --git a/.scripts/summarize_progress/main.py b/.scripts/summarize_progress/main.py new file mode 100644 index 0000000000..c51541d347 --- /dev/null +++ b/.scripts/summarize_progress/main.py @@ -0,0 +1,138 @@ +import re +import polib +import glob +import datetime +import requests + +from pathlib import Path + + +def entry_check(pofile: polib.POFile) -> str: + ''' + Check the po file with how many entries are translated or not. + ''' + + lines_tranlated = len(pofile.translated_entries()) + lines_untranlated = len(pofile.untranslated_entries()) + + if lines_tranlated == 0: + result = "❌" + elif lines_untranlated == 0: + result = "✅" + else: + lines_all = lines_tranlated + lines_untranlated + progress = lines_tranlated / lines_all + progress_percentage = round(progress * 100, 2) + result = f"Ongoing, {progress_percentage} %" + + return result + + +def get_open_issues_count() -> int: + ''' + Fetch GitHub API to get the number of OPEN ISSUES. + ''' + + url = f"https://api.github.com/search/issues?q=repo:python/python-docs-zh-tw+type:issue+state:open" + headers = { + "Accept": "application/vnd.github+json", + "X-GitHub-Api-Version": "2022-11-28", + } + r = requests.get(url=url, headers=headers) + result = r.json() + + return result["total_count"] + + +def get_github_issues() -> list: + ''' + Fetch GitHub API to collect the infomation of OPEN ISSUES, + including issue title and assignee. + + Steps: + 1. Fetch GitHub API and get open issue list + 2. Filter the issue if it have no assignee + 3. Filter the issue if it have no "Translate" in the title + 4. Filter the issue if it have no correct filepath in the title + ''' + NUMBER_OF_ISSUES = get_open_issues_count() + + url = f"https://api.github.com/search/issues?q=repo:python/python-docs-zh-tw+type:issue+state:open&per_page={NUMBER_OF_ISSUES}" + headers = { + "Accept": "application/vnd.github+json", + "X-GitHub-Api-Version": "2022-11-28", + } + r = requests.get(url=url, headers=headers) + result = r.json() + + result_list = [] + for issue in result["items"]: + if issue["assignee"] is None: + continue + + title = issue["title"] + if "翻譯" not in title and "translate" not in title.lower(): + continue + + match = re.search("(?P[^\s`][a-zA-z-]+)/(?P[a-zA-Z0-9._-]+(.po)?)", title) + if not match: + continue + + dirname, filename = match.group('dirname', 'filename') + if not filename.endswith('.po'): + filename += '.po' + + result_list.append(((dirname, filename), issue["assignee"]["login"])) + + return result_list + +def format_line_file(filename: str, result: str) -> str: + return f" - {filename.ljust(37, '-')}{result}\r\n" + + +def format_line_directory(dirname: str) -> str: + return f"- {dirname}/\r\n" + + +if __name__ == "__main__": + issue_list = get_github_issues() + + ''' + Search all the po file in the directory, + and record the translation progress of each files. + ''' + BASE_DIR = Path("../") + summary = {} + for filepath in glob.glob(str(BASE_DIR / "**/*.po"), recursive=True): + path = Path(filepath) + filename = path.name + dirname = path.parent.name if path.parent.name != BASE_DIR.name else '/' + po = polib.pofile(filepath) + summary.setdefault(dirname, {})[filename] = entry_check(po) + + ''' + Unpack the open issue list, and add assignee after the progress + ''' + for (category, filename), assignee in issue_list: + try: + summary[category][filename] += f", 💻 {assignee}" + except KeyError: + pass + + ''' + Format the lines that will write into the markdown file, + also sort the directory name and file name. + ''' + writeliner = [] + summary_sorted = dict(sorted(summary.items())) + for dirname, filedict in summary_sorted.items(): + writeliner.append(format_line_directory(dirname)) + filedict_sorted = dict(sorted(filedict.items())) + for filename, result in filedict_sorted.items(): + writeliner.append(format_line_file(filename, result)) + + with open( + f"summarize_progress/dist/summarize_progress.md", + "w", + ) as file: + file.writelines(writeliner) From 8fef8f1296eca7783242a63df7ea08988c3da955 Mon Sep 17 00:00:00 2001 From: Payon Date: Mon, 4 Dec 2023 21:55:57 +0800 Subject: [PATCH 39/39] =?UTF-8?q?docs:=20=E7=BF=BB=E8=AD=AF=20unittest.moc?= =?UTF-8?q?k=20rst:823=E8=87=B3rst:1103=20(#735)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Wei-Hsiang (Matt) Wang --- library/unittest.mock.po | 55 ++++++++++++++++++++++++++++++++-------- 1 file changed, 45 insertions(+), 10 deletions(-) diff --git a/library/unittest.mock.po b/library/unittest.mock.po index 5afcfd1b40..2001f0e458 100644 --- a/library/unittest.mock.po +++ b/library/unittest.mock.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2023-10-20 00:03+0000\n" -"PO-Revision-Date: 2023-11-23 21:46+0800\n" +"PO-Revision-Date: 2023-12-04 21:31+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -827,12 +827,16 @@ msgid "" "class:`PropertyMock` provides :meth:`__get__` and :meth:`__set__` methods so " "you can specify a return value when it is fetched." msgstr "" +"一個理應在類別上當成屬性或其他描述器的 mock。:class:`PropertyMock` 提供了 :" +"meth:`__get__` 和 :meth:`__set__` 方法,因此你可以在它被提取時指定回傳值。" #: ../../library/unittest.mock.rst:827 msgid "" "Fetching a :class:`PropertyMock` instance from an object calls the mock, " "with no args. Setting it calls the mock with the value being set. ::" msgstr "" +"從物件中提取 :class:`PropertyMock` 實例會不帶任何引數呼叫 mock。設定它則會用" +"設定的值來呼叫 mock: ::" #: ../../library/unittest.mock.rst:848 msgid "" @@ -840,6 +844,8 @@ msgid "" "class:`PropertyMock` to a mock object. Instead you can attach it to the mock " "type object::" msgstr "" +"由於 mock 屬性的儲存方式,你無法直接將 :class:`PropertyMock` 附加到 mock 物" +"件。但是你可以將其附加到 mock 型別的物件: ::" #: ../../library/unittest.mock.rst:862 msgid "" @@ -847,24 +853,28 @@ msgid "" "will behave so the object is recognized as an async function, and the result " "of a call is an awaitable." msgstr "" +":class:`MagicMock` 的非同步版本。:class:`AsyncMock` 物件的表現將被視為非同步" +"函式,並且呼叫的結果是一個可等待物件。" #: ../../library/unittest.mock.rst:872 msgid "" "The result of ``mock()`` is an async function which will have the outcome of " "``side_effect`` or ``return_value`` after it has been awaited:" msgstr "" +"``mock()`` 的結果是一個非同步函式,在它被等待後將具有 ``side_effect`` 或 " +"``return_value`` 的結果:" #: ../../library/unittest.mock.rst:875 msgid "" "if ``side_effect`` is a function, the async function will return the result " "of that function," -msgstr "" +msgstr "如果 ``side_effect`` 是一個函式,非同步函式將回傳該函式的結果," #: ../../library/unittest.mock.rst:877 msgid "" "if ``side_effect`` is an exception, the async function will raise the " "exception," -msgstr "" +msgstr "如果 ``side_effect`` 是一個例外,則非同步函式將引發該例外," #: ../../library/unittest.mock.rst:879 msgid "" @@ -872,6 +882,8 @@ msgid "" "value of the iterable, however, if the sequence of result is exhausted, " "``StopAsyncIteration`` is raised immediately," msgstr "" +"如果 ``side_effect`` 是一個可疊代物件,非同步函式將回傳可疊代物件的下一個值," +"但如果結果序列耗盡,將立即引發 ``StopAsyncIteration``," #: ../../library/unittest.mock.rst:882 msgid "" @@ -879,12 +891,16 @@ msgid "" "defined by ``return_value``, hence, by default, the async function returns a " "new :class:`AsyncMock` object." msgstr "" +"如果 ``side_effect`` 沒有被定義,非同步函式將回傳由 ``return_value`` 定義的" +"值,因此在預設情況下,非同步函式回傳一個新的 :class:`AsyncMock` 物件。" #: ../../library/unittest.mock.rst:887 msgid "" "Setting the *spec* of a :class:`Mock` or :class:`MagicMock` to an async " "function will result in a coroutine object being returned after calling." msgstr "" +"將 :class:`Mock` 或 :class:`MagicMock` 的 *spec* 設定為非同步函式將導致在呼叫" +"後回傳一個協程物件。" #: ../../library/unittest.mock.rst:899 msgid "" @@ -895,63 +911,78 @@ msgid "" "or :class:`Mock` (if the parent mock is :class:`Mock`). All asynchronous " "functions will be :class:`AsyncMock`." msgstr "" +"將 :class:`Mock`、:class:`MagicMock` 或 :class:`AsyncMock` 的 *spec* 設定為具" +"有同步和非同步函式的類別,會自動檢測同步函式並將其設定為 :class:" +"`MagicMock`\\ (如果上代 mock 為 :class:`AsyncMock` 或 :class:" +"`MagicMock`\\ )或 :class:`Mock`\\ (如果上代 mock 為 :class:`Mock`\\ )。所" +"有非同步函式將被設定為 :class:`AsyncMock`。" #: ../../library/unittest.mock.rst:927 msgid "" "Assert that the mock was awaited at least once. Note that this is separate " "from the object having been called, the ``await`` keyword must be used:" msgstr "" +"斷言 mock 至少被等待過一次。請注意這與物件是否被呼叫是分開的,``await`` 關鍵" +"字必須被使用:" #: ../../library/unittest.mock.rst:946 msgid "Assert that the mock was awaited exactly once." -msgstr "" +msgstr "斷言 mock 正好被等待了一次。" #: ../../library/unittest.mock.rst:962 msgid "Assert that the last await was with the specified arguments." -msgstr "" +msgstr "斷言最後一次等待使用了指定的引數。" #: ../../library/unittest.mock.rst:979 msgid "" "Assert that the mock was awaited exactly once and with the specified " "arguments." -msgstr "" +msgstr "斷言 mock 只被等待了一次並使用了指定的引數。" #: ../../library/unittest.mock.rst:996 msgid "Assert the mock has ever been awaited with the specified arguments." -msgstr "" +msgstr "斷言 mock 曾經被使用指定的引數等待過。" #: ../../library/unittest.mock.rst:1012 msgid "" "Assert the mock has been awaited with the specified calls. The :attr:" "`await_args_list` list is checked for the awaits." msgstr "" +"斷言 mock 已被使用指定的呼叫進行等待。:attr:`await_args_list` 串列將被檢查以" +"確認等待的內容。" #: ../../library/unittest.mock.rst:1015 msgid "" "If *any_order* is false then the awaits must be sequential. There can be " "extra calls before or after the specified awaits." msgstr "" +"如果 *any_order* 為 false,則等待必須按照順序。指定的等待之前或之後可以有額外" +"的呼叫。" #: ../../library/unittest.mock.rst:1019 msgid "" "If *any_order* is true then the awaits can be in any order, but they must " "all appear in :attr:`await_args_list`." msgstr "" +"如果 *any_order* 為 true,則等待可以以任何順序出現,但它們必須全部出現在 :" +"attr:`await_args_list` 中。" #: ../../library/unittest.mock.rst:1039 msgid "Assert that the mock was never awaited." -msgstr "" +msgstr "斷言 mock 從未被等待。" #: ../../library/unittest.mock.rst:1046 msgid "" "See :func:`Mock.reset_mock`. Also sets :attr:`await_count` to 0, :attr:" "`await_args` to None, and clears the :attr:`await_args_list`." msgstr "" +"參見 :func:`Mock.reset_mock`。同時將 :attr:`await_count` 設定為 0,:attr:" +"`await_args` 設定為 None,並清除 :attr:`await_args_list`。" #: ../../library/unittest.mock.rst:1051 msgid "" "An integer keeping track of how many times the mock object has been awaited." -msgstr "" +msgstr "一個整數,用來記錄 mock 物件已被等待的次數。" #: ../../library/unittest.mock.rst:1066 msgid "" @@ -959,6 +990,8 @@ msgid "" "that the mock was last awaited with. Functions the same as :attr:`Mock." "call_args`." msgstr "" +"這可能是 ``None``\\ (如果 mock 尚未被等待),或者是上次等待 mock 時使用的引" +"數。與 :attr:`Mock.call_args` 的功能相同。" #: ../../library/unittest.mock.rst:1084 msgid "" @@ -966,10 +999,12 @@ msgid "" "length of the list is the number of times it has been awaited). Before any " "awaits have been made it is an empty list." msgstr "" +"這是一個按照順序記錄 mock 物件所有等待的串列(因此串列的長度表示該物件已被等" +"待的次數)。在進行任何等待之前,此串列為空。" #: ../../library/unittest.mock.rst:1103 msgid "Calling" -msgstr "" +msgstr "呼叫" #: ../../library/unittest.mock.rst:1105 msgid ""