diff --git a/c-api/capsule.po b/c-api/capsule.po index a322f2fd22..8caf48d64a 100644 --- a/c-api/capsule.po +++ b/c-api/capsule.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-29 00:17+0000\n" +"POT-Creation-Date: 2025-10-25 22:20+0000\n" "PO-Revision-Date: 2018-05-23 14:30+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -29,7 +29,7 @@ msgstr "" #: ../../c-api/capsule.rst:17 msgid "" "This subtype of :c:type:`PyObject` represents an opaque value, useful for C " -"extension modules who need to pass an opaque value (as a :c:expr:`void*` " +"extension modules which need to pass an opaque value (as a :c:expr:`void*` " "pointer) through Python code to other C code. It is often used to make a C " "function pointer defined in one module available to other modules, so the " "regular import mechanism can be used to access C APIs defined in dynamically " diff --git a/c-api/cell.po b/c-api/cell.po index cf1e495fc8..0f4a13c46c 100644 --- a/c-api/cell.po +++ b/c-api/cell.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-07-10 00:04+0000\n" +"POT-Creation-Date: 2025-11-05 00:16+0000\n" "PO-Revision-Date: 2022-10-16 15:33+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -30,7 +30,7 @@ msgstr "Cell 物件" msgid "" "\"Cell\" objects are used to implement variables referenced by multiple " "scopes. For each such variable, a cell object is created to store the value; " -"the local variables of each stack frame that references the value contains a " +"the local variables of each stack frame that references the value contain a " "reference to the cells from outer scopes which also use that variable. When " "the value is accessed, the value contained in the cell is used instead of " "the cell object itself. This de-referencing of the cell object requires " diff --git a/c-api/code.po b/c-api/code.po index 46a1a245fa..f920a88711 100644 --- a/c-api/code.po +++ b/c-api/code.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-10-25 22:20+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-" @@ -36,8 +36,8 @@ msgstr "" #: ../../c-api/code.rst:24 msgid "" -"This is an instance of :c:type:`PyTypeObject` representing the " -"Python :ref:`code object `." +"This is an instance of :c:type:`PyTypeObject` representing the Python :ref:" +"`code object `." msgstr "" #: ../../c-api/code.rst:30 @@ -73,9 +73,8 @@ msgstr "" #: ../../c-api/code.rst:54 msgid "" -"Since the definition of the bytecode changes often, " -"calling :c:func:`PyUnstable_Code_New` directly can bind you to a precise " -"Python version." +"Since the definition of the bytecode changes often, calling :c:func:" +"`PyUnstable_Code_New` directly can bind you to a precise Python version." msgstr "" #: ../../c-api/code.rst:57 @@ -132,9 +131,8 @@ msgstr "" #: ../../c-api/code.rst:101 msgid "" -"For efficiently iterating over the line numbers in a code object, " -"use :pep:`the API described in PEP 626 <0626#out-of-process-debuggers-and-" -"profilers>`." +"For efficiently iterating over the line numbers in a code object, use :pep:" +"`the API described in PEP 626 <0626#out-of-process-debuggers-and-profilers>`." msgstr "" #: ../../c-api/code.rst:106 @@ -180,9 +178,9 @@ msgstr "" #: ../../c-api/code.rst:147 msgid "" "Equivalent to the Python code ``getattr(co, 'co_freevars')``. Returns a new " -"reference to a :c:type:`PyTupleObject` containing the names of " -"the :term:`free (closure) variables `. On error, ``NULL`` " -"is returned and an exception is raised." +"reference to a :c:type:`PyTupleObject` containing the names of the :term:" +"`free (closure) variables `. On error, ``NULL`` is " +"returned and an exception is raised." msgstr "" #: ../../c-api/code.rst:156 @@ -195,10 +193,10 @@ msgstr "" #: ../../c-api/code.rst:165 msgid "" -"Clear watcher identified by *watcher_id* previously returned " -"from :c:func:`PyCode_AddWatcher` for the current interpreter. Return ``0`` " -"on success, or ``-1`` and set an exception on error (e.g. if the given " -"*watcher_id* was never registered.)" +"Clear watcher identified by *watcher_id* previously returned from :c:func:" +"`PyCode_AddWatcher` for the current interpreter. Return ``0`` on success, or " +"``-1`` and set an exception on error (e.g. if the given *watcher_id* was " +"never registered.)" msgstr "" #: ../../c-api/code.rst:174 @@ -240,8 +238,8 @@ msgstr "" #: ../../c-api/code.rst:201 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``." +"will be printed as an unraisable exception using :c:func:" +"`PyErr_WriteUnraisable`. Otherwise it should return ``0``." msgstr "" #: ../../c-api/code.rst:205 @@ -259,18 +257,18 @@ msgstr "程式碼物件旗標" #: ../../c-api/code.rst:219 msgid "" -"Code objects contain a bit-field of flags, which can be retrieved as " -"the :attr:`~codeobject.co_flags` Python attribute (for example " -"using :c:func:`PyObject_GetAttrString`), and set using a *flags* argument " -"to :c:func:`PyUnstable_Code_New` and similar functions." +"Code objects contain a bit-field of flags, which can be retrieved as the :" +"attr:`~codeobject.co_flags` Python attribute (for example using :c:func:" +"`PyObject_GetAttrString`), and set using a *flags* argument to :c:func:" +"`PyUnstable_Code_New` and similar functions." msgstr "" #: ../../c-api/code.rst:224 msgid "" "Flags whose names start with ``CO_FUTURE_`` correspond to features normally " -"selectable by :ref:`future statements `. These flags can be used " -"in :c:member:`PyCompilerFlags.cf_flags`. Note that many ``CO_FUTURE_`` flags " -"are mandatory in current versions of Python, and setting them has no effect." +"selectable by :ref:`future statements `. These flags can be used in :" +"c:member:`PyCompilerFlags.cf_flags`. Note that many ``CO_FUTURE_`` flags are " +"mandatory in current versions of Python, and setting them has no effect." msgstr "" #: ../../c-api/code.rst:230 @@ -378,7 +376,7 @@ msgid "" msgstr "" #: ../../c-api/code.rst:292 -msgid "Return a new an opaque index value used to adding data to code objects." +msgid "Return a new opaque index value used to adding data to code objects." msgstr "" #: ../../c-api/code.rst:294 @@ -391,8 +389,8 @@ msgstr "" #: ../../c-api/code.rst:298 msgid "" "If *free* is not ``NULL``: when a code object is deallocated, *free* will be " -"called on non-``NULL`` data stored under the new index. " -"Use :c:func:`Py_DecRef` when storing :c:type:`PyObject`." +"called on non-``NULL`` data stored under the new index. Use :c:func:" +"`Py_DecRef` when storing :c:type:`PyObject`." msgstr "" #: ../../c-api/code.rst:304 diff --git a/c-api/codec.po b/c-api/codec.po index 19e1d21e7f..9ca1d563d0 100644 --- a/c-api/codec.po +++ b/c-api/codec.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 00:03+0000\n" +"POT-Creation-Date: 2025-11-07 00:14+0000\n" "PO-Revision-Date: 2023-07-24 17:51+0000\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -28,8 +28,9 @@ msgstr "註冊一個新的編解碼器搜尋函式。" #: ../../c-api/codec.rst:10 msgid "" -"As side effect, this tries to load the :mod:`!encodings` package, if not yet " -"done, to make sure that it is always first in the list of search functions." +"As a side effect, this tries to load the :mod:`!encodings` package, if not " +"yet done, to make sure that it is always first in the list of search " +"functions." msgstr "" "作為副作用 (side effect),這會嘗試載入 :mod:`!encodings`\\ (如果尚未完成)," "以確保它始終位於搜尋函式列表中的第一個。" @@ -75,11 +76,11 @@ msgid "" "*object* is passed through the decoder function found for the given " "*encoding* using the error handling method defined by *errors*. *errors* " "may be ``NULL`` to use the default method defined for the codec. Raises a :" -"exc:`LookupError` if no encoder can be found." +"exc:`LookupError` if no decoder can be found." msgstr "" "*object* 被傳遞給以給定 *encoding* 所查找到的解碼器函式,並使用以 *errors* 定" "義的錯誤處理方法。*errors* 可以設為 ``NULL`` 來使用編解碼器定義的預設方法。如" -"果找不到編碼器,則引發 :exc:`LookupError`。" +"果找不到解碼器,則引發 :exc:`LookupError`。" #: ../../c-api/codec.rst:46 msgid "Codec lookup API" @@ -198,3 +199,13 @@ msgstr "將 unicode 編碼錯誤替換為反斜線跳脫(``\\x``、``\\u`` 和 #: ../../c-api/codec.rst:129 msgid "Replace the unicode encode error with ``\\N{...}`` escapes." msgstr "將 unicode 編碼錯誤替換為 ``\\N{...}`` 跳脫。" + +#: ../../c-api/codec.rst:135 +msgid "Codec utility variables" +msgstr "" + +#: ../../c-api/codec.rst:139 +msgid "" +"A string constant containing the lowercase hexadecimal digits: " +"``\"0123456789abcdef\"``." +msgstr "" diff --git a/c-api/conversion.po b/c-api/conversion.po index 2bc4186ebc..0bf7140fa9 100644 --- a/c-api/conversion.po +++ b/c-api/conversion.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-11-03 00:16+0000\n" "PO-Revision-Date: 2023-12-11 18:26+0000\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -31,8 +31,8 @@ msgstr "用於數字轉換和格式化字串輸出的函式。" #: ../../c-api/conversion.rst:13 msgid "" "Output not more than *size* bytes to *str* according to the format string " -"*format* and the extra arguments. See the Unix man " -"page :manpage:`snprintf(3)`." +"*format* and the extra arguments. See the Unix man page :manpage:" +"`snprintf(3)`." msgstr "" "根據格式字串 *format* 和額外引數,輸出不超過 *size* 位元組給 *str*。請參閱 " "Unix 使用手冊 :manpage:`snprintf(3)`。" @@ -40,8 +40,8 @@ msgstr "" #: ../../c-api/conversion.rst:19 msgid "" "Output not more than *size* bytes to *str* according to the format string " -"*format* and the variable argument list *va*. Unix man " -"page :manpage:`vsnprintf(3)`." +"*format* and the variable argument list *va*. Unix man page :manpage:" +"`vsnprintf(3)`." msgstr "" "根據格式字串 *format* 和變數引數串列 *va*,輸出不超過 *size* 位元組給 *str*。" "Unix 使用手冊 :manpage:`vsnprintf(3)`。" @@ -53,9 +53,9 @@ msgid "" "is to guarantee consistent behavior in corner cases, which the Standard C " "functions do not." msgstr "" -":c:func:`PyOS_snprintf` 和 :c:func:`PyOS_vsnprintf` 包裝標準 C 函式庫函" -"式 :c:func:`snprintf` 和 :c:func:`vsnprintf`。它們的目的是確保邊角案例 " -"(corner case) 下的行為一致,而標準 C 函式則不然。" +":c:func:`PyOS_snprintf` 和 :c:func:`PyOS_vsnprintf` 包裝標準 C 函式庫函式 :c:" +"func:`snprintf` 和 :c:func:`vsnprintf`。它們的目的是確保邊角案例 (corner " +"case) 下的行為一致,而標準 C 函式則不然。" #: ../../c-api/conversion.rst:28 msgid "" @@ -97,11 +97,11 @@ msgstr "" #: ../../c-api/conversion.rst:44 msgid "" -"When ``rv < 0``, \"something bad happened.\" ``str[size-1]`` is ``'\\0'`` in " -"this case too, but the rest of *str* is undefined. The exact cause of the " -"error depends on the underlying platform." +"When ``rv < 0``, the output conversion failed and ``str[size-1]`` is " +"``'\\0'`` in this case too, but the rest of *str* is undefined. The exact " +"cause of the error depends on the underlying platform." msgstr "" -"當 ``rv < 0`` 時,代表「有不好的事情發生了」。在這種情況下,``str[size-1]`` " +"當 ``rv < 0`` 時,代表輸出的轉換失敗,且在這種情況下 ``str[size-1]`` " "也是 ``'\\0'``,但 *str* 的其餘部分未定義。錯誤的確切原因取決於底層平台。" #: ../../c-api/conversion.rst:49 @@ -129,9 +129,9 @@ msgstr "" #: ../../c-api/conversion.rst:63 msgid "" "If the converted value falls out of range of corresponding return type, " -"range error occurs (:c:data:`errno` is set to :c:macro:`!ERANGE`) " -"and :c:macro:`!ULONG_MAX` is returned. If no conversion can be performed, " -"``0`` is returned." +"range error occurs (:c:data:`errno` is set to :c:macro:`!ERANGE`) and :c:" +"macro:`!ULONG_MAX` is returned. If no conversion can be performed, ``0`` is " +"returned." msgstr "" #: ../../c-api/conversion.rst:68 @@ -169,9 +169,9 @@ msgstr "" #: ../../c-api/conversion.rst:95 msgid "" -"If ``endptr`` is ``NULL``, convert the whole string. " -"Raise :exc:`ValueError` and return ``-1.0`` if the string is not a valid " -"representation of a floating-point number." +"If ``endptr`` is ``NULL``, convert the whole string. Raise :exc:" +"`ValueError` and return ``-1.0`` if the string is not a valid representation " +"of a floating-point number." msgstr "" "如果 ``endptr`` 為 ``NULL``,則轉換整個字串。如果字串不是浮點數的有效表示,則" "引發 :exc:`ValueError` 並回傳 ``-1.0``。" diff --git a/c-api/datetime.po b/c-api/datetime.po index 9927a5172e..ea1bea82a0 100644 --- a/c-api/datetime.po +++ b/c-api/datetime.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-22 00:03+0000\n" +"POT-Creation-Date: 2025-11-05 00:16+0000\n" "PO-Revision-Date: 2025-10-14 20:39+0800\n" "Last-Translator: Yorkxe \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -86,7 +86,7 @@ msgstr "" #: ../../c-api/datetime.rst:49 msgid "" -"This instance of :c:type:`PyTypeObject` represents Python type for the " +"This instance of :c:type:`PyTypeObject` represents the Python type for the " "difference between two datetime values; it is the same object as :class:" "`datetime.timedelta` in the Python layer." msgstr "" diff --git a/c-api/descriptor.po b/c-api/descriptor.po index 112cee717d..7dc8620da4 100644 --- a/c-api/descriptor.po +++ b/c-api/descriptor.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2025-11-05 00:16+0000\n" "PO-Revision-Date: 2021-12-09 20:56+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -39,9 +39,9 @@ msgstr "內建 descriptor 型別的型別物件。" #: ../../c-api/descriptor.rst:35 msgid "" -"Return non-zero if the descriptor objects *descr* describes a data " -"attribute, or ``0`` if it describes a method. *descr* must be a descriptor " -"object; there is no error checking." +"Return non-zero if the descriptor object *descr* describes a data attribute, " +"or ``0`` if it describes a method. *descr* must be a descriptor object; " +"there is no error checking." msgstr "" "如果 descriptor 物件 *descr* 描述的是一個資料屬性則回傳非零值,或者如果它描述" -"的是一個方法則返回 ``0``。*descr* 必須為一個 descriptor 物件;沒有錯誤檢查。" +"的是一個方法則回傳 ``0``。*descr* 必須為一個 descriptor 物件;沒有錯誤檢查。" diff --git a/c-api/dict.po b/c-api/dict.po index d730a330b9..e55ce40255 100644 --- a/c-api/dict.po +++ b/c-api/dict.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-11-06 00:14+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-" @@ -33,8 +33,8 @@ msgid "" "This instance of :c:type:`PyTypeObject` represents the Python dictionary " "type. This is the same object as :class:`dict` in the Python layer." msgstr "" -":c:type:`PyTypeObject` 實例代表一個 Python 字典型態。此與 Python 層中" -"的 :class:`dict` 為同一個物件。" +":c:type:`PyTypeObject` 實例代表一個 Python 字典型態。此與 Python 層中的 :" +"class:`dict` 為同一個物件。" #: ../../c-api/dict.rst:24 msgid "" @@ -69,16 +69,16 @@ msgstr "清空現有字典中的所有鍵值對。" #: ../../c-api/dict.rst:53 msgid "" -"Determine if dictionary *p* contains *key*. If an item in *p* is matches " +"Determine if dictionary *p* contains *key*. If an item in *p* matches " "*key*, return ``1``, otherwise return ``0``. On error, return ``-1``. This " "is equivalent to the Python expression ``key in p``." msgstr "" #: ../../c-api/dict.rst:60 msgid "" -"This is the same as :c:func:`PyDict_Contains`, but *key* is specified as " -"a :c:expr:`const char*` UTF-8 encoded bytes string, rather than " -"a :c:expr:`PyObject*`." +"This is the same as :c:func:`PyDict_Contains`, 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:69 @@ -87,32 +87,32 @@ msgstr "" #: ../../c-api/dict.rst:74 msgid "" -"Insert *val* into the dictionary *p* with a key of *key*. *key* must " -"be :term:`hashable`; if it isn't, :exc:`TypeError` will be raised. Return " -"``0`` on success or ``-1`` on failure. This function *does not* steal a " -"reference to *val*." +"Insert *val* into the dictionary *p* with a key of *key*. *key* must be :" +"term:`hashable`; if it isn't, :exc:`TypeError` will be raised. Return ``0`` " +"on success or ``-1`` on failure. This function *does not* steal a reference " +"to *val*." msgstr "" #: ../../c-api/dict.rst:82 msgid "" -"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*`." +"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:89 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 dictionary, :exc:`KeyError` is raised. Return ``0`` on success or " -"``-1`` on failure." +"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 " +"dictionary, :exc:`KeyError` is raised. Return ``0`` on success or ``-1`` on " +"failure." msgstr "" #: ../../c-api/dict.rst:97 msgid "" -"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*`." +"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:104 @@ -148,9 +148,9 @@ msgstr "" #: ../../c-api/dict.rst:125 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." +"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:129 @@ -168,25 +168,23 @@ msgstr "" #: ../../c-api/dict.rst:144 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*`." +"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:150 msgid "" -"Exceptions that occur while this calls :meth:`~object.__hash__` " -"and :meth:`~object.__eq__` methods or while creating the " -"temporary :class:`str` object are silently ignored. Prefer using " -"the :c:func:`PyDict_GetItemWithError` function with your " -"own :c:func:`PyUnicode_FromString` *key* instead." +"Exceptions that occur while this calls :meth:`~object.__hash__` and :meth:" +"`~object.__eq__` methods or while creating the temporary :class:`str` object " +"are silently ignored. Prefer using the :c:func:`PyDict_GetItemWithError` " +"function with your own :c:func:`PyUnicode_FromString` *key* instead." msgstr "" #: ../../c-api/dict.rst:159 msgid "" -"Similar to :c:func:`PyDict_GetItemRef`, but *key* is specified as " -"a :c:expr:`const char*` UTF-8 encoded bytes string, rather than " -"a :c:expr:`PyObject*`." +"Similar to :c:func:`PyDict_GetItemRef`, 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:168 @@ -222,7 +220,7 @@ msgstr "" #: ../../c-api/dict.rst:200 msgid "" "Remove *key* from dictionary *p* and optionally return the removed value. Do " -"not raise :exc:`KeyError` if the key missing." +"not raise :exc:`KeyError` if the key is missing." msgstr "" #: ../../c-api/dict.rst:203 @@ -239,8 +237,8 @@ msgstr "" #: ../../c-api/dict.rst:209 msgid "" -"Similar to :meth:`dict.pop`, but without the default value and not " -"raising :exc:`KeyError` if the key missing." +"Similar to :meth:`dict.pop`, but without the default value and not raising :" +"exc:`KeyError` if the key is missing." msgstr "" #: ../../c-api/dict.rst:217 @@ -272,24 +270,28 @@ msgid "" msgstr "回傳字典中項目的數量。此與於字典呼叫 ``len(p)`` 等效。" #: ../../c-api/dict.rst:250 +msgid "Similar to :c:func:`PyDict_Size`, but without error checking." +msgstr "" + +#: ../../c-api/dict.rst:255 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 first call to this function to start the iteration; the " -"function returns true for each pair in the dictionary, and false once all " -"pairs have been reported. The parameters *pkey* and *pvalue* should either " -"point to :c:expr:`PyObject*` variables that will be filled in with each key " -"and value, respectively, or may be ``NULL``. Any references returned " -"through them are borrowed. *ppos* should not be altered during iteration. " -"Its value represents offsets within the internal dictionary structure, and " -"since the structure is sparse, the offsets are not consecutive." +"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 " +"first call to this function to start the iteration; the function returns " +"true for each pair in the dictionary, and false once all pairs have been " +"reported. The parameters *pkey* and *pvalue* should either point to :c:expr:" +"`PyObject*` variables that will be filled in with each key and value, " +"respectively, or may be ``NULL``. Any references returned through them are " +"borrowed. *ppos* should not be altered during iteration. Its value " +"represents offsets within the internal dictionary structure, and since the " +"structure is sparse, the offsets are not consecutive." msgstr "" -#: ../../c-api/dict.rst:261 +#: ../../c-api/dict.rst:266 msgid "For example::" msgstr "舉例來說: ::" -#: ../../c-api/dict.rst:263 +#: ../../c-api/dict.rst:268 msgid "" "PyObject *key, *value;\n" "Py_ssize_t pos = 0;\n" @@ -300,14 +302,14 @@ msgid "" "}" msgstr "" -#: ../../c-api/dict.rst:271 +#: ../../c-api/dict.rst:276 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:275 +#: ../../c-api/dict.rst:280 msgid "" "PyObject *key, *value;\n" "Py_ssize_t pos = 0;\n" @@ -345,15 +347,14 @@ msgstr "" " Py_DECREF(o);\n" "}" -#: ../../c-api/dict.rst:293 +#: ../../c-api/dict.rst:298 msgid "" "The function is not thread-safe in the :term:`free-threaded ` build without external synchronization. You can " -"use :c:macro:`Py_BEGIN_CRITICAL_SECTION` to lock the dictionary while " -"iterating over it::" +"threading>` build without external synchronization. You can use :c:macro:" +"`Py_BEGIN_CRITICAL_SECTION` to lock the dictionary while iterating over it::" msgstr "" -#: ../../c-api/dict.rst:298 +#: ../../c-api/dict.rst:303 msgid "" "Py_BEGIN_CRITICAL_SECTION(self->dict);\n" "while (PyDict_Next(self->dict, &pos, &key, &value)) {\n" @@ -367,18 +368,18 @@ msgstr "" "}\n" "Py_END_CRITICAL_SECTION();" -#: ../../c-api/dict.rst:306 +#: ../../c-api/dict.rst:311 msgid "" "On the free-threaded build, this function can be used safely inside a " "critical section. However, the references returned for *pkey* and *pvalue* " "are :term:`borrowed ` and are only valid while the " "critical section is held. If you need to use these objects outside the " -"critical section or when the critical section can be suspended, create " -"a :term:`strong reference ` (for example, " -"using :c:func:`Py_NewRef`)." +"critical section or when the critical section can be suspended, create a :" +"term:`strong reference ` (for example, using :c:func:" +"`Py_NewRef`)." msgstr "" -#: ../../c-api/dict.rst:316 +#: ../../c-api/dict.rst:321 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` " @@ -388,16 +389,16 @@ msgid "" "or ``-1`` if an exception was raised." msgstr "" -#: ../../c-api/dict.rst:326 +#: ../../c-api/dict.rst:331 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 to the iterating over a sequence of key value pairs if the second " -"argument has no \"keys\" attribute. Return ``0`` on success or ``-1`` if an " +"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 " +"to the iterating over a sequence of key value pairs if the second argument " +"has no \"keys\" attribute. Return ``0`` on success or ``-1`` if an " "exception was raised." msgstr "" -#: ../../c-api/dict.rst:335 +#: ../../c-api/dict.rst:340 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, " @@ -406,7 +407,7 @@ msgid "" "if an exception was raised. Equivalent Python (except for the return value)::" msgstr "" -#: ../../c-api/dict.rst:342 +#: ../../c-api/dict.rst:347 msgid "" "def PyDict_MergeFromSeq2(a, seq2, override):\n" " for key, value in seq2:\n" @@ -418,7 +419,7 @@ msgstr "" " if override or key not in a:\n" " a[key] = value" -#: ../../c-api/dict.rst:349 +#: ../../c-api/dict.rst:354 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 " @@ -426,21 +427,21 @@ msgid "" "exception." msgstr "" -#: ../../c-api/dict.rst:358 +#: ../../c-api/dict.rst:363 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.)" +"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:366 +#: ../../c-api/dict.rst:371 msgid "" -"Mark dictionary *dict* as watched. The callback granted *watcher_id* " -"by :c:func:`PyDict_AddWatcher` will be called when *dict* is modified or " +"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:374 +#: ../../c-api/dict.rst:379 msgid "" "Mark dictionary *dict* as no longer watched. The callback granted " "*watcher_id* by :c:func:`PyDict_AddWatcher` will no longer be called when " @@ -448,7 +449,7 @@ msgid "" "watched by this watcher. Return ``0`` on success or ``-1`` on error." msgstr "" -#: ../../c-api/dict.rst:383 +#: ../../c-api/dict.rst:388 msgid "" "Enumeration of possible dictionary watcher events: ``PyDict_EVENT_ADDED``, " "``PyDict_EVENT_MODIFIED``, ``PyDict_EVENT_DELETED``, " @@ -456,11 +457,11 @@ msgid "" "``PyDict_EVENT_DEALLOCATED``." msgstr "" -#: ../../c-api/dict.rst:391 +#: ../../c-api/dict.rst:396 msgid "Type of a dict watcher callback function." msgstr "" -#: ../../c-api/dict.rst:393 +#: ../../c-api/dict.rst:398 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`` " @@ -469,7 +470,7 @@ msgid "" "dictionary and *new_value* will be ``NULL``." msgstr "" -#: ../../c-api/dict.rst:399 +#: ../../c-api/dict.rst:404 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 " @@ -477,14 +478,14 @@ msgid "" "``PyDict_EVENT_CLONED`` is issued, and *key* will be the source dictionary." msgstr "" -#: ../../c-api/dict.rst:405 +#: ../../c-api/dict.rst:410 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:409 +#: ../../c-api/dict.rst:414 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 " @@ -493,20 +494,20 @@ msgid "" "again." msgstr "" -#: ../../c-api/dict.rst:415 +#: ../../c-api/dict.rst:420 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:418 +#: ../../c-api/dict.rst:423 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``." +"will be printed as an unraisable exception using :c:func:" +"`PyErr_WriteUnraisable`. Otherwise it should return ``0``." msgstr "" -#: ../../c-api/dict.rst:422 +#: ../../c-api/dict.rst:427 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 " diff --git a/c-api/exceptions.po b/c-api/exceptions.po index 745cded957..c98d7ad7d2 100644 --- a/c-api/exceptions.po +++ b/c-api/exceptions.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-11-07 00:14+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-" @@ -93,9 +93,9 @@ msgstr "" msgid "" "If *set_sys_last_vars* is nonzero, the variable :data:`sys.last_exc` is set " "to the printed exception. For backwards compatibility, the deprecated " -"variables :data:`sys.last_type`, :data:`sys.last_value` " -"and :data:`sys.last_traceback` are also set to the type, value and traceback " -"of this exception, respectively." +"variables :data:`sys.last_type`, :data:`sys.last_value` and :data:`sys." +"last_traceback` are also set to the type, value and traceback of this " +"exception, respectively." msgstr "" #: ../../c-api/exceptions.rst:69 @@ -185,8 +185,8 @@ msgstr "" msgid "" "This function sets the error indicator and returns ``NULL``. *exception* " "should be a Python exception class. The *format* and subsequent parameters " -"help format the error message; they have the same meaning and values as " -"in :c:func:`PyUnicode_FromFormat`. *format* is an ASCII-encoded string." +"help format the error message; they have the same meaning and values as in :" +"c:func:`PyUnicode_FromFormat`. *format* is an ASCII-encoded string." msgstr "" #: ../../c-api/exceptions.rst:156 @@ -218,14 +218,13 @@ 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 " "constructs a tuple object whose first item is the integer :c:data:`errno` " -"value and whose second item is the corresponding error message (gotten " -"from :c:func:`!strerror`), and then calls ``PyErr_SetObject(type, " -"object)``. On Unix, when the :c:data:`errno` value is :c:macro:`!EINTR`, " -"indicating an interrupted system call, this " -"calls :c:func:`PyErr_CheckSignals`, and if that set the error indicator, " -"leaves it set to that. The function always returns ``NULL``, so a wrapper " -"function around a system call can write ``return PyErr_SetFromErrno(type);`` " -"when the system call returns an error." +"value and whose second item is the corresponding error message (gotten from :" +"c:func:`!strerror`), and then calls ``PyErr_SetObject(type, object)``. On " +"Unix, when the :c:data:`errno` value is :c:macro:`!EINTR`, indicating an " +"interrupted system call, this calls :c:func:`PyErr_CheckSignals`, and if " +"that set the error indicator, leaves it set to that. The function always " +"returns ``NULL``, so a wrapper function around a system call can write " +"``return PyErr_SetFromErrno(type);`` when the system call returns an error." msgstr "" #: ../../c-api/exceptions.rst:199 @@ -280,9 +279,9 @@ msgstr "" msgid "" "Similar to :c:func:`PyErr_SetFromWindowsErr`, with the additional behavior " "that if *filename* is not ``NULL``, it is decoded from the filesystem " -"encoding (:func:`os.fsdecode`) and passed to the constructor " -"of :exc:`OSError` as a third parameter to be used to define the :attr:`!" -"filename` attribute of the exception instance." +"encoding (:func:`os.fsdecode`) and passed to the constructor of :exc:" +"`OSError` as a third parameter to be used to define the :attr:`!filename` " +"attribute of the exception instance." msgstr "" #: ../../c-api/exceptions.rst:258 @@ -373,55 +372,53 @@ msgid "" "below) or ``NULL``; the *message* argument is a UTF-8 encoded string. " "*stack_level* is a positive number giving a number of stack frames; the " "warning will be issued from the currently executing line of code in that " -"stack frame. A *stack_level* of 1 is the function " -"calling :c:func:`PyErr_WarnEx`, 2 is the function above that, and so forth." +"stack frame. A *stack_level* of 1 is the function calling :c:func:" +"`PyErr_WarnEx`, 2 is the function above that, and so forth." msgstr "" #: ../../c-api/exceptions.rst:359 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 warning category " -"is :c:data:`PyExc_RuntimeWarning`. The standard Python warning categories " -"are available as global variables whose names are enumerated " -"at :ref:`standardwarningcategories`." +"Warning categories must be subclasses of :c:data:`PyExc_Warning`; :c:data:" +"`PyExc_Warning` is a subclass of :c:data:`PyExc_Exception`; the default " +"warning category is :c:data:`PyExc_RuntimeWarning`. The standard Python " +"warning categories are available as global variables whose names are " +"enumerated at :ref:`standardwarningcategories`." msgstr "" #: ../../c-api/exceptions.rst:365 msgid "" -"For information about warning control, see the documentation for " -"the :mod:`warnings` module and the :option:`-W` option in the command line " +"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:372 msgid "" "Issue a warning message with explicit control over all warning attributes. " -"This is a straightforward wrapper around the Python " -"function :func:`warnings.warn_explicit`; see there for more information. " -"The *module* and *registry* arguments may be set to ``NULL`` to get the " -"default effect described there." +"This is a straightforward wrapper around the Python function :func:`warnings." +"warn_explicit`; see there for more information. The *module* and *registry* " +"arguments may be set to ``NULL`` to get the default effect described there." msgstr "" #: ../../c-api/exceptions.rst:383 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`." +"*module* are UTF-8 encoded strings, and *filename* is decoded from the :term:" +"`filesystem encoding and error handler`." msgstr "" #: ../../c-api/exceptions.rst:390 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." +"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:399 msgid "" -"Function similar to :c:func:`PyErr_WarnFormat`, but *category* " -"is :exc:`ResourceWarning` and it passes *source* to :class:`!" -"warnings.WarningMessage`." +"Function similar to :c:func:`PyErr_WarnFormat`, but *category* is :exc:" +"`ResourceWarning` and it passes *source* to :class:`!warnings." +"WarningMessage`." msgstr "" #: ../../c-api/exceptions.rst:406 @@ -433,8 +430,8 @@ 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*`` " "functions or to :c:func:`PyErr_Restore`). If not set, return ``NULL``. You " -"do not own a reference to the return value, so you do not need " -"to :c:func:`Py_DECREF` it." +"do not own a reference to the return value, so you do not need to :c:func:" +"`Py_DECREF` it." msgstr "" #: ../../c-api/exceptions.rst:416 @@ -443,11 +440,10 @@ msgstr "" #: ../../c-api/exceptions.rst:420 msgid "" -"Do not compare the return value to a specific exception; " -"use :c:func:`PyErr_ExceptionMatches` instead, shown below. (The comparison " -"could easily fail since the exception may be an instance instead of a class, " -"in the case of a class exception, or it may be a subclass of the expected " -"exception.)" +"Do not compare the return value to a specific exception; use :c:func:" +"`PyErr_ExceptionMatches` instead, shown below. (The comparison could easily " +"fail since the exception may be an instance instead of a class, in the case " +"of a class exception, or it may be a subclass of the expected exception.)" msgstr "" #: ../../c-api/exceptions.rst:428 @@ -596,10 +592,9 @@ msgstr "" #: ../../c-api/exceptions.rst:545 msgid "" -"This function *does not* implicitly set " -"the :attr:`~BaseException.__traceback__` attribute on the exception value. " -"If setting the traceback appropriately is desired, the following additional " -"snippet is needed::" +"This function *does not* implicitly set the :attr:`~BaseException." +"__traceback__` attribute on the exception value. If setting the traceback " +"appropriately is desired, the following additional snippet is needed::" msgstr "" #: ../../c-api/exceptions.rst:550 @@ -614,11 +609,10 @@ msgstr "" #: ../../c-api/exceptions.rst:557 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 exception that was freshly raised. Returns a new " -"reference to the exception or ``NULL``. Does not modify the interpreter's " -"exception state." +"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 " +"exception that was freshly raised. Returns a new reference to the exception " +"or ``NULL``. Does not modify the interpreter's exception state." msgstr "" #: ../../c-api/exceptions.rst:564 @@ -646,12 +640,12 @@ msgstr "" #: ../../c-api/exceptions.rst:589 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*, not to an exception that was freshly raised. Returns new " -"references for the three objects, any of which may be ``NULL``. Does not " -"modify the exception info state. This function is kept for backwards " -"compatibility. Prefer using :c:func:`PyErr_GetHandledException`." +"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*, " +"not to an exception that was freshly raised. Returns new references for the " +"three objects, any of which may be ``NULL``. Does not modify the exception " +"info state. This function is kept for backwards compatibility. Prefer " +"using :c:func:`PyErr_GetHandledException`." msgstr "" #: ../../c-api/exceptions.rst:598 @@ -668,8 +662,8 @@ msgid "" "exception that was *already caught*, not to an exception that was freshly " "raised. This function steals the references of the arguments. To clear the " "exception state, pass ``NULL`` for all three arguments. This function is " -"kept for backwards compatibility. Prefer " -"using :c:func:`PyErr_SetHandledException`." +"kept for backwards compatibility. Prefer using :c:func:" +"`PyErr_SetHandledException`." msgstr "" #: ../../c-api/exceptions.rst:617 @@ -708,8 +702,8 @@ 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 " "is set and the function returns ``-1`` immediately (such that other pending " -"signals may not have been handled yet: they will be on the " -"next :c:func:`PyErr_CheckSignals()` invocation)." +"signals may not have been handled yet: they will be on the next :c:func:" +"`PyErr_CheckSignals()` invocation)." msgstr "" #: ../../c-api/exceptions.rst:655 @@ -726,8 +720,8 @@ msgstr "" #: ../../c-api/exceptions.rst:662 msgid "" -"The default Python signal handler for :c:macro:`!SIGINT` raises " -"the :exc:`KeyboardInterrupt` exception." +"The default Python signal handler for :c:macro:`!SIGINT` raises the :exc:" +"`KeyboardInterrupt` exception." msgstr "" #: ../../c-api/exceptions.rst:673 @@ -738,15 +732,15 @@ msgstr "" #: ../../c-api/exceptions.rst:677 ../../c-api/exceptions.rst:704 msgid "" -"This function is async-signal-safe. It can be called without " -"an :term:`attached thread state` and from a C signal handler." +"This function is async-signal-safe. It can be called without an :term:" +"`attached thread state` and from a C signal handler." msgstr "" #: ../../c-api/exceptions.rst:687 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." +"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:691 @@ -759,9 +753,8 @@ msgstr "" #: ../../c-api/exceptions.rst:696 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." +"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:699 @@ -896,11 +889,11 @@ 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 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`` if there is nothing to reraise." +"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`` " +"if there is nothing to reraise." msgstr "" #: ../../c-api/exceptions.rst:837 @@ -1037,9 +1030,9 @@ msgstr "" #: ../../c-api/exceptions.rst:953 msgid "" "Properly implementing :c:member:`~PyTypeObject.tp_repr` for container types " -"requires special recursion handling. In addition to protecting the " -"stack, :c:member:`~PyTypeObject.tp_repr` also needs to track objects to " -"prevent cycles. The following two functions facilitate this functionality. " +"requires special recursion handling. In addition to protecting the stack, :" +"c:member:`~PyTypeObject.tp_repr` also needs to track objects to prevent " +"cycles. The following two functions facilitate this functionality. " "Effectively, these are the C equivalent to :func:`reprlib.recursive_repr`." msgstr "" @@ -1053,9 +1046,8 @@ msgstr "" msgid "" "If the object has already been processed, the function returns a positive " "integer. In that case the :c:member:`~PyTypeObject.tp_repr` implementation " -"should return a string object indicating a cycle. As " -"examples, :class:`dict` objects return ``{...}`` and :class:`list` objects " -"return ``[...]``." +"should return a string object indicating a cycle. As examples, :class:" +"`dict` objects return ``{...}`` and :class:`list` objects return ``[...]``." msgstr "" #: ../../c-api/exceptions.rst:970 @@ -1067,373 +1059,410 @@ msgstr "" #: ../../c-api/exceptions.rst:974 msgid "" -"Otherwise, the function returns zero and " -"the :c:member:`~PyTypeObject.tp_repr` implementation can continue normally." +"Otherwise, the function returns zero and the :c:member:`~PyTypeObject." +"tp_repr` implementation can continue normally." msgstr "" #: ../../c-api/exceptions.rst:979 msgid "" -"Ends a :c:func:`Py_ReprEnter`. Must be called once for each invocation " -"of :c:func:`Py_ReprEnter` that returns zero." +"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:984 +msgid "" +"Get the recursion limit for the current interpreter. It can be set with :c:" +"func:`Py_SetRecursionLimit`. The recursion limit prevents the Python " +"interpreter stack from growing infinitely." +msgstr "" + +#: ../../c-api/exceptions.rst:988 ../../c-api/exceptions.rst:998 +msgid "" +"This function cannot fail, and the caller must hold an :term:`attached " +"thread state`." +msgstr "" + +#: ../../c-api/exceptions.rst:992 +msgid ":py:func:`sys.getrecursionlimit`" +msgstr ":py:func:`sys.getrecursionlimit`" + +#: ../../c-api/exceptions.rst:996 +msgid "Set the recursion limit for the current interpreter." msgstr "" -#: ../../c-api/exceptions.rst:986 +#: ../../c-api/exceptions.rst:1002 +msgid ":py:func:`sys.setrecursionlimit`" +msgstr ":py:func:`sys.setrecursionlimit`" + +#: ../../c-api/exceptions.rst:1007 msgid "Exception and warning types" msgstr "例外和警告型別" -#: ../../c-api/exceptions.rst:988 +#: ../../c-api/exceptions.rst:1009 msgid "" "All standard Python exceptions and warning categories are available as " "global variables whose names are ``PyExc_`` followed by the Python exception " "name. These have the type :c:expr:`PyObject*`; they are all class objects." msgstr "" -#: ../../c-api/exceptions.rst:992 +#: ../../c-api/exceptions.rst:1013 msgid "For completeness, here are all the variables:" msgstr "" -#: ../../c-api/exceptions.rst:995 +#: ../../c-api/exceptions.rst:1016 msgid "Exception types" msgstr "例外型別" -#: ../../c-api/exceptions.rst:1002 ../../c-api/exceptions.rst:1148 -#: ../../c-api/exceptions.rst:1178 +#: ../../c-api/exceptions.rst:1023 ../../c-api/exceptions.rst:1169 +#: ../../c-api/exceptions.rst:1199 msgid "C name" msgstr "C 名稱" -#: ../../c-api/exceptions.rst:1003 ../../c-api/exceptions.rst:1149 -#: ../../c-api/exceptions.rst:1179 +#: ../../c-api/exceptions.rst:1024 ../../c-api/exceptions.rst:1170 +#: ../../c-api/exceptions.rst:1200 msgid "Python name" msgstr "Python 名稱" -#: ../../c-api/exceptions.rst:1005 +#: ../../c-api/exceptions.rst:1026 msgid ":exc:`BaseException`" msgstr ":exc:`BaseException`" -#: ../../c-api/exceptions.rst:1007 +#: ../../c-api/exceptions.rst:1028 msgid ":exc:`BaseExceptionGroup`" msgstr ":exc:`BaseExceptionGroup`" -#: ../../c-api/exceptions.rst:1009 +#: ../../c-api/exceptions.rst:1030 msgid ":exc:`Exception`" msgstr ":exc:`Exception`" -#: ../../c-api/exceptions.rst:1011 +#: ../../c-api/exceptions.rst:1032 msgid ":exc:`ArithmeticError`" msgstr ":exc:`ArithmeticError`" -#: ../../c-api/exceptions.rst:1013 +#: ../../c-api/exceptions.rst:1034 msgid ":exc:`AssertionError`" msgstr ":exc:`AssertionError`" -#: ../../c-api/exceptions.rst:1015 +#: ../../c-api/exceptions.rst:1036 msgid ":exc:`AttributeError`" msgstr ":exc:`AttributeError`" -#: ../../c-api/exceptions.rst:1017 +#: ../../c-api/exceptions.rst:1038 msgid ":exc:`BlockingIOError`" msgstr ":exc:`BlockingIOError`" -#: ../../c-api/exceptions.rst:1019 +#: ../../c-api/exceptions.rst:1040 msgid ":exc:`BrokenPipeError`" msgstr ":exc:`BrokenPipeError`" -#: ../../c-api/exceptions.rst:1021 +#: ../../c-api/exceptions.rst:1042 msgid ":exc:`BufferError`" msgstr ":exc:`BufferError`" -#: ../../c-api/exceptions.rst:1023 +#: ../../c-api/exceptions.rst:1044 msgid ":exc:`ChildProcessError`" msgstr ":exc:`ChildProcessError`" -#: ../../c-api/exceptions.rst:1025 +#: ../../c-api/exceptions.rst:1046 msgid ":exc:`ConnectionAbortedError`" msgstr ":exc:`ConnectionAbortedError`" -#: ../../c-api/exceptions.rst:1027 +#: ../../c-api/exceptions.rst:1048 msgid ":exc:`ConnectionError`" msgstr ":exc:`ConnectionError`" -#: ../../c-api/exceptions.rst:1029 +#: ../../c-api/exceptions.rst:1050 msgid ":exc:`ConnectionRefusedError`" msgstr ":exc:`ConnectionRefusedError`" -#: ../../c-api/exceptions.rst:1031 +#: ../../c-api/exceptions.rst:1052 msgid ":exc:`ConnectionResetError`" msgstr ":exc:`ConnectionResetError`" -#: ../../c-api/exceptions.rst:1033 +#: ../../c-api/exceptions.rst:1054 msgid ":exc:`EOFError`" msgstr ":exc:`EOFError`" -#: ../../c-api/exceptions.rst:1035 +#: ../../c-api/exceptions.rst:1056 msgid ":exc:`FileExistsError`" msgstr ":exc:`FileExistsError`" -#: ../../c-api/exceptions.rst:1037 +#: ../../c-api/exceptions.rst:1058 msgid ":exc:`FileNotFoundError`" msgstr ":exc:`FileNotFoundError`" -#: ../../c-api/exceptions.rst:1039 +#: ../../c-api/exceptions.rst:1060 msgid ":exc:`FloatingPointError`" msgstr ":exc:`FloatingPointError`" -#: ../../c-api/exceptions.rst:1041 +#: ../../c-api/exceptions.rst:1062 msgid ":exc:`GeneratorExit`" msgstr ":exc:`GeneratorExit`" -#: ../../c-api/exceptions.rst:1043 +#: ../../c-api/exceptions.rst:1064 msgid ":exc:`ImportError`" msgstr ":exc:`ImportError`" -#: ../../c-api/exceptions.rst:1045 +#: ../../c-api/exceptions.rst:1066 msgid ":exc:`IndentationError`" msgstr ":exc:`IndentationError`" -#: ../../c-api/exceptions.rst:1047 +#: ../../c-api/exceptions.rst:1068 msgid ":exc:`IndexError`" msgstr ":exc:`IndexError`" -#: ../../c-api/exceptions.rst:1049 +#: ../../c-api/exceptions.rst:1070 msgid ":exc:`InterruptedError`" msgstr ":exc:`InterruptedError`" -#: ../../c-api/exceptions.rst:1051 +#: ../../c-api/exceptions.rst:1072 msgid ":exc:`IsADirectoryError`" msgstr ":exc:`IsADirectoryError`" -#: ../../c-api/exceptions.rst:1053 +#: ../../c-api/exceptions.rst:1074 msgid ":exc:`KeyError`" msgstr ":exc:`KeyError`" -#: ../../c-api/exceptions.rst:1055 +#: ../../c-api/exceptions.rst:1076 msgid ":exc:`KeyboardInterrupt`" msgstr ":exc:`KeyboardInterrupt`" -#: ../../c-api/exceptions.rst:1057 +#: ../../c-api/exceptions.rst:1078 msgid ":exc:`LookupError`" msgstr ":exc:`LookupError`" -#: ../../c-api/exceptions.rst:1059 +#: ../../c-api/exceptions.rst:1080 msgid ":exc:`MemoryError`" msgstr ":exc:`MemoryError`" -#: ../../c-api/exceptions.rst:1061 +#: ../../c-api/exceptions.rst:1082 msgid ":exc:`ModuleNotFoundError`" msgstr ":exc:`ModuleNotFoundError`" -#: ../../c-api/exceptions.rst:1063 +#: ../../c-api/exceptions.rst:1084 msgid ":exc:`NameError`" msgstr ":exc:`NameError`" -#: ../../c-api/exceptions.rst:1065 +#: ../../c-api/exceptions.rst:1086 msgid ":exc:`NotADirectoryError`" msgstr ":exc:`NotADirectoryError`" -#: ../../c-api/exceptions.rst:1067 +#: ../../c-api/exceptions.rst:1088 msgid ":exc:`NotImplementedError`" msgstr ":exc:`NotImplementedError`" -#: ../../c-api/exceptions.rst:1069 ../../c-api/exceptions.rst:1152 -#: ../../c-api/exceptions.rst:1155 ../../c-api/exceptions.rst:1158 +#: ../../c-api/exceptions.rst:1090 ../../c-api/exceptions.rst:1173 +#: ../../c-api/exceptions.rst:1176 ../../c-api/exceptions.rst:1179 msgid ":exc:`OSError`" msgstr ":exc:`OSError`" -#: ../../c-api/exceptions.rst:1071 +#: ../../c-api/exceptions.rst:1092 msgid ":exc:`OverflowError`" msgstr ":exc:`OverflowError`" -#: ../../c-api/exceptions.rst:1073 +#: ../../c-api/exceptions.rst:1094 msgid ":exc:`PermissionError`" msgstr ":exc:`PermissionError`" -#: ../../c-api/exceptions.rst:1075 +#: ../../c-api/exceptions.rst:1096 msgid ":exc:`ProcessLookupError`" msgstr ":exc:`ProcessLookupError`" -#: ../../c-api/exceptions.rst:1077 +#: ../../c-api/exceptions.rst:1098 msgid ":exc:`PythonFinalizationError`" msgstr ":exc:`PythonFinalizationError`" -#: ../../c-api/exceptions.rst:1079 +#: ../../c-api/exceptions.rst:1100 msgid ":exc:`RecursionError`" msgstr ":exc:`RecursionError`" -#: ../../c-api/exceptions.rst:1081 +#: ../../c-api/exceptions.rst:1102 msgid ":exc:`ReferenceError`" msgstr ":exc:`ReferenceError`" -#: ../../c-api/exceptions.rst:1083 +#: ../../c-api/exceptions.rst:1104 msgid ":exc:`RuntimeError`" msgstr ":exc:`RuntimeError`" -#: ../../c-api/exceptions.rst:1085 +#: ../../c-api/exceptions.rst:1106 msgid ":exc:`StopAsyncIteration`" msgstr ":exc:`StopAsyncIteration`" -#: ../../c-api/exceptions.rst:1087 +#: ../../c-api/exceptions.rst:1108 msgid ":exc:`StopIteration`" msgstr ":exc:`StopIteration`" -#: ../../c-api/exceptions.rst:1089 +#: ../../c-api/exceptions.rst:1110 msgid ":exc:`SyntaxError`" msgstr ":exc:`SyntaxError`" -#: ../../c-api/exceptions.rst:1091 +#: ../../c-api/exceptions.rst:1112 msgid ":exc:`SystemError`" msgstr ":exc:`SystemError`" -#: ../../c-api/exceptions.rst:1093 +#: ../../c-api/exceptions.rst:1114 msgid ":exc:`SystemExit`" msgstr ":exc:`SystemExit`" -#: ../../c-api/exceptions.rst:1095 +#: ../../c-api/exceptions.rst:1116 msgid ":exc:`TabError`" msgstr ":exc:`TabError`" -#: ../../c-api/exceptions.rst:1097 +#: ../../c-api/exceptions.rst:1118 msgid ":exc:`TimeoutError`" msgstr ":exc:`TimeoutError`" -#: ../../c-api/exceptions.rst:1099 +#: ../../c-api/exceptions.rst:1120 msgid ":exc:`TypeError`" msgstr ":exc:`TypeError`" -#: ../../c-api/exceptions.rst:1101 +#: ../../c-api/exceptions.rst:1122 msgid ":exc:`UnboundLocalError`" msgstr ":exc:`UnboundLocalError`" -#: ../../c-api/exceptions.rst:1103 +#: ../../c-api/exceptions.rst:1124 msgid ":exc:`UnicodeDecodeError`" msgstr ":exc:`UnicodeDecodeError`" -#: ../../c-api/exceptions.rst:1105 +#: ../../c-api/exceptions.rst:1126 msgid ":exc:`UnicodeEncodeError`" msgstr ":exc:`UnicodeEncodeError`" -#: ../../c-api/exceptions.rst:1107 +#: ../../c-api/exceptions.rst:1128 msgid ":exc:`UnicodeError`" msgstr ":exc:`UnicodeError`" -#: ../../c-api/exceptions.rst:1109 +#: ../../c-api/exceptions.rst:1130 msgid ":exc:`UnicodeTranslateError`" msgstr ":exc:`UnicodeTranslateError`" -#: ../../c-api/exceptions.rst:1111 +#: ../../c-api/exceptions.rst:1132 msgid ":exc:`ValueError`" msgstr ":exc:`ValueError`" -#: ../../c-api/exceptions.rst:1113 +#: ../../c-api/exceptions.rst:1134 msgid ":exc:`ZeroDivisionError`" msgstr ":exc:`ZeroDivisionError`" -#: ../../c-api/exceptions.rst:1115 +#: ../../c-api/exceptions.rst:1136 msgid "" -":c:data:`PyExc_BlockingIOError`, :c:data:`PyExc_BrokenPipeError`, :c:data:`PyExc_ChildProcessError`, :c:data:`PyExc_ConnectionError`, :c:data:`PyExc_ConnectionAbortedError`, :c:data:`PyExc_ConnectionRefusedError`, :c:data:`PyExc_ConnectionResetError`, :c:data:`PyExc_FileExistsError`, :c:data:`PyExc_FileNotFoundError`, :c:data:`PyExc_InterruptedError`, :c:data:`PyExc_IsADirectoryError`, :c:data:`PyExc_NotADirectoryError`, :c:data:`PyExc_PermissionError`, :c:data:`PyExc_ProcessLookupError` " -"and :c:data:`PyExc_TimeoutError` were introduced following :pep:`3151`." -msgstr "" -":c:data:`PyExc_BlockingIOError`, :c:data:`PyExc_BrokenPipeError`, :c:data:`PyExc_ChildProcessError`, :c:data:`PyExc_ConnectionError`, :c:data:`PyExc_ConnectionAbortedError`, :c:data:`PyExc_ConnectionRefusedError`, :c:data:`PyExc_ConnectionResetError`, :c:data:`PyExc_FileExistsError`, :c:data:`PyExc_FileNotFoundError`, :c:data:`PyExc_InterruptedError`, :c:data:`PyExc_IsADirectoryError`, :c:data:`PyExc_NotADirectoryError`, :c:data:`PyExc_PermissionError`, :c:data:`PyExc_ProcessLookupError` " -"和 :c:data:`PyExc_TimeoutError` 是在 :pep:`3151` 被引入。" - -#: ../../c-api/exceptions.rst:1125 +":c:data:`PyExc_BlockingIOError`, :c:data:`PyExc_BrokenPipeError`, :c:data:" +"`PyExc_ChildProcessError`, :c:data:`PyExc_ConnectionError`, :c:data:" +"`PyExc_ConnectionAbortedError`, :c:data:`PyExc_ConnectionRefusedError`, :c:" +"data:`PyExc_ConnectionResetError`, :c:data:`PyExc_FileExistsError`, :c:data:" +"`PyExc_FileNotFoundError`, :c:data:`PyExc_InterruptedError`, :c:data:" +"`PyExc_IsADirectoryError`, :c:data:`PyExc_NotADirectoryError`, :c:data:" +"`PyExc_PermissionError`, :c:data:`PyExc_ProcessLookupError` and :c:data:" +"`PyExc_TimeoutError` were introduced following :pep:`3151`." +msgstr "" +":c:data:`PyExc_BlockingIOError`, :c:data:`PyExc_BrokenPipeError`, :c:data:" +"`PyExc_ChildProcessError`, :c:data:`PyExc_ConnectionError`, :c:data:" +"`PyExc_ConnectionAbortedError`, :c:data:`PyExc_ConnectionRefusedError`, :c:" +"data:`PyExc_ConnectionResetError`, :c:data:`PyExc_FileExistsError`, :c:data:" +"`PyExc_FileNotFoundError`, :c:data:`PyExc_InterruptedError`, :c:data:" +"`PyExc_IsADirectoryError`, :c:data:`PyExc_NotADirectoryError`, :c:data:" +"`PyExc_PermissionError`, :c:data:`PyExc_ProcessLookupError` 和 :c:data:" +"`PyExc_TimeoutError` 是在 :pep:`3151` 被引入。" + +#: ../../c-api/exceptions.rst:1146 msgid ":c:data:`PyExc_StopAsyncIteration` and :c:data:`PyExc_RecursionError`." msgstr ":c:data:`PyExc_StopAsyncIteration` 和 :c:data:`PyExc_RecursionError`。" -#: ../../c-api/exceptions.rst:1128 +#: ../../c-api/exceptions.rst:1149 msgid ":c:data:`PyExc_ModuleNotFoundError`." msgstr ":c:data:`PyExc_ModuleNotFoundError`。" -#: ../../c-api/exceptions.rst:1131 +#: ../../c-api/exceptions.rst:1152 msgid ":c:data:`PyExc_BaseExceptionGroup`." msgstr ":c:data:`PyExc_BaseExceptionGroup`" -#: ../../c-api/exceptions.rst:1136 +#: ../../c-api/exceptions.rst:1157 msgid "OSError aliases" msgstr "OSError 別名" -#: ../../c-api/exceptions.rst:1138 +#: ../../c-api/exceptions.rst:1159 msgid "The following are a compatibility aliases to :c:data:`PyExc_OSError`." msgstr "" -#: ../../c-api/exceptions.rst:1140 +#: ../../c-api/exceptions.rst:1161 msgid "These aliases used to be separate exception types." msgstr "" -#: ../../c-api/exceptions.rst:1150 +#: ../../c-api/exceptions.rst:1171 msgid "Notes" msgstr "註解" -#: ../../c-api/exceptions.rst:1159 +#: ../../c-api/exceptions.rst:1180 msgid "[win]_" msgstr "[win]_" -#: ../../c-api/exceptions.rst:1161 +#: ../../c-api/exceptions.rst:1182 msgid "Notes:" msgstr "註解:" -#: ../../c-api/exceptions.rst:1164 +#: ../../c-api/exceptions.rst:1185 msgid "" ":c:var:`!PyExc_WindowsError` is only defined on Windows; protect code that " "uses this by testing that the preprocessor macro ``MS_WINDOWS`` is defined." msgstr "" -#: ../../c-api/exceptions.rst:1171 +#: ../../c-api/exceptions.rst:1192 msgid "Warning types" msgstr "警告型別" -#: ../../c-api/exceptions.rst:1181 +#: ../../c-api/exceptions.rst:1202 msgid ":exc:`Warning`" msgstr ":exc:`Warning`" -#: ../../c-api/exceptions.rst:1183 +#: ../../c-api/exceptions.rst:1204 msgid ":exc:`BytesWarning`" msgstr ":exc:`BytesWarning`" -#: ../../c-api/exceptions.rst:1185 +#: ../../c-api/exceptions.rst:1206 msgid ":exc:`DeprecationWarning`" msgstr ":exc:`DeprecationWarning`" -#: ../../c-api/exceptions.rst:1187 +#: ../../c-api/exceptions.rst:1208 msgid ":exc:`EncodingWarning`" msgstr ":exc:`EncodingWarning`" -#: ../../c-api/exceptions.rst:1189 +#: ../../c-api/exceptions.rst:1210 msgid ":exc:`FutureWarning`" msgstr ":exc:`FutureWarning`" -#: ../../c-api/exceptions.rst:1191 +#: ../../c-api/exceptions.rst:1212 msgid ":exc:`ImportWarning`" msgstr ":exc:`ImportWarning`" -#: ../../c-api/exceptions.rst:1193 +#: ../../c-api/exceptions.rst:1214 msgid ":exc:`PendingDeprecationWarning`" msgstr ":exc:`PendingDeprecationWarning`" -#: ../../c-api/exceptions.rst:1195 +#: ../../c-api/exceptions.rst:1216 msgid ":exc:`ResourceWarning`" msgstr ":exc:`ResourceWarning`" -#: ../../c-api/exceptions.rst:1197 +#: ../../c-api/exceptions.rst:1218 msgid ":exc:`RuntimeWarning`" msgstr ":exc:`RuntimeWarning`" -#: ../../c-api/exceptions.rst:1199 +#: ../../c-api/exceptions.rst:1220 msgid ":exc:`SyntaxWarning`" msgstr ":exc:`SyntaxWarning`" -#: ../../c-api/exceptions.rst:1201 +#: ../../c-api/exceptions.rst:1222 msgid ":exc:`UnicodeWarning`" msgstr ":exc:`UnicodeWarning`" -#: ../../c-api/exceptions.rst:1203 +#: ../../c-api/exceptions.rst:1224 msgid ":exc:`UserWarning`" msgstr ":exc:`UserWarning`" -#: ../../c-api/exceptions.rst:1205 +#: ../../c-api/exceptions.rst:1226 msgid ":c:data:`PyExc_ResourceWarning`." msgstr ":c:data:`PyExc_ResourceWarning`。" -#: ../../c-api/exceptions.rst:1208 +#: ../../c-api/exceptions.rst:1229 msgid ":c:data:`PyExc_EncodingWarning`." msgstr ":c:data:`PyExc_EncodingWarning`。" diff --git a/c-api/float.po b/c-api/float.po index 5db50e2c2e..e4fe8707e6 100644 --- a/c-api/float.po +++ b/c-api/float.po @@ -73,6 +73,11 @@ msgid "" "meth:`~object.__index__`. This method returns ``-1.0`` upon failure, so one " "should call :c:func:`PyErr_Occurred` to check for errors." msgstr "" +"回傳 *pyfloat* 內容的 C :c:expr:`double` 表示形式。" +"如果 *pyfloat* 不是 Python 浮點數物件,但具有 :meth:`~object.__float__` 方法," +"則會先呼叫此方法將 *pyfloat* 轉換為浮點數。" +"如果未定義 :meth:`!__float__`,則會用後備方法 :meth:`~object.__index__`。" +"此方法在失敗時回傳 ``-1.0``,因此應該呼叫 :c:func:`PyErr_Occurred` 來檢查錯誤。" #: ../../c-api/float.rst:54 msgid "Use :meth:`~object.__index__` if available." @@ -143,6 +148,37 @@ msgstr "" "打包例程從 C :c:expr:`double` 產生位元組字串,而解包例程則從這樣的位元組字串產生 " "C :c:expr:`double`。後綴(2、4 或 8)標示了位元組字串中的位元組數。" +#: ../../c-api/float.rst:107 +msgid "" +"Return :data:`math.inf` or :data:`-math.inf ` from a function, " +"depending on the sign of *sign*." +msgstr "" +"根據 *sign* 的正負號,從函式回傳 :data:`math.inf` 或 :data:`-math.inf `。" + +#: ../../c-api/float.rst:93 +msgid "On most platforms, this is equivalent to the following::" +msgstr "在大多數平台上,這相當於以下內容: ::" + +#: ../../c-api/float.rst:95 +msgid "return PyFloat_FromDouble(copysign(INFINITY, sign));" +msgstr "return PyFloat_FromDouble(copysign(INFINITY, sign));" + +#: ../../c-api/float.rst:99 +msgid "Pack and Unpack functions" +msgstr "打包和解包函式" + +#: ../../c-api/float.rst:101 +msgid "" +"The pack and unpack functions provide an efficient platform-independent way " +"to store floating-point values as byte strings. The Pack routines produce a " +"bytes string from a C :c:expr:`double`, and the Unpack routines produce a C :" +"c:expr:`double` from such a bytes string. The suffix (2, 4 or 8) specifies " +"the number of bytes in the bytes string." +msgstr "" +"打包和解包函式提供了一種有效的跨平台方式,來將浮點數值儲存為位元組字串。" +"打包例程從 C :c:expr:`double` 產生位元組字串,而解包例程則從這樣的位元組字串產生 " +"C :c:expr:`double`。後綴(2、4 或 8)標示了位元組字串中的位元組數。" + #: ../../c-api/float.rst:107 msgid "" "On platforms that appear to use IEEE 754 formats these functions work by " diff --git a/c-api/init_config.po b/c-api/init_config.po index b45fcc2319..e6e285c2c5 100644 --- a/c-api/init_config.po +++ b/c-api/init_config.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-11-05 00:16+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-" @@ -107,19 +107,19 @@ msgstr "" #: ../../c-api/init_config.rst:83 msgid "It must be freed by :c:func:`PyInitConfig_Free`." -msgstr "" +msgstr "必須由 :c:func:`PyInitConfig_Free` 來釋放。" #: ../../c-api/init_config.rst:85 msgid "Return ``NULL`` on memory allocation failure." -msgstr "" +msgstr "在記憶體配置失敗時回傳 ``NULL``。" #: ../../c-api/init_config.rst:90 msgid "Free memory of the initialization configuration *config*." -msgstr "" +msgstr "釋放初始化配置 *config* 的記憶體。" #: ../../c-api/init_config.rst:92 msgid "If *config* is ``NULL``, no operation is performed." -msgstr "" +msgstr "如果 *config* 是 ``NULL``,則不執行任何操作。" #: ../../c-api/init_config.rst:96 msgid "Error Handling" @@ -138,7 +138,7 @@ msgid "Set *\\*err_msg* to ``NULL`` and return ``0`` otherwise." msgstr "如果沒有設定錯誤,則設定 *\\*err_msg* 為 ``NULL`` 並回傳 ``0``。" #: ../../c-api/init_config.rst:105 -msgid "An error message is an UTF-8 encoded string." +msgid "An error message is a UTF-8 encoded string." msgstr "錯誤訊息是 UTF-8 編碼的字串。" #: ../../c-api/init_config.rst:107 @@ -189,11 +189,11 @@ msgstr "" #: ../../c-api/init_config.rst:138 msgid "Test if the configuration has an option called *name*." -msgstr "" +msgstr "測試配置是否有名為 *name* 的選項。" #: ../../c-api/init_config.rst:140 msgid "Return ``1`` if the option exists, or return ``0`` otherwise." -msgstr "" +msgstr "如果選項存在則回傳 ``1``,否則回傳 ``0``。" #: ../../c-api/init_config.rst:145 msgid "Get an integer configuration option." @@ -678,11 +678,11 @@ msgstr "``\"legacy_windows_fs_encoding\"``" #: ../../c-api/init_config.rst:389 msgid "" -":c:member:`legacy_windows_fs_encoding " -"`" +":c:member:`legacy_windows_fs_encoding `" msgstr "" -":c:member:`legacy_windows_fs_encoding " -"`" +":c:member:`legacy_windows_fs_encoding `" #: ../../c-api/init_config.rst:392 msgid "``\"legacy_windows_stdio\"``" @@ -998,14 +998,14 @@ msgstr "" #: ../../c-api/init_config.rst:547 msgid "" -"Public: Can by get by :c:func:`PyConfig_Get` and set " -"by :c:func:`PyConfig_Set`." +"Public: Can by get by :c:func:`PyConfig_Get` and set by :c:func:" +"`PyConfig_Set`." msgstr "" #: ../../c-api/init_config.rst:549 msgid "" -"Read-only: Can by get by :c:func:`PyConfig_Get`, but cannot be set " -"by :c:func:`PyConfig_Set`." +"Read-only: Can by get by :c:func:`PyConfig_Get`, but cannot be set by :c:" +"func:`PyConfig_Set`." msgstr "" #: ../../c-api/init_config.rst:554 @@ -1014,8 +1014,8 @@ msgstr "" #: ../../c-api/init_config.rst:556 msgid "" -"At runtime, it's possible to get and set configuration options " -"using :c:func:`PyConfig_Get` and :c:func:`PyConfig_Set` functions." +"At runtime, it's possible to get and set configuration options using :c:func:" +"`PyConfig_Get` and :c:func:`PyConfig_Set` functions." msgstr "" #: ../../c-api/init_config.rst:562 @@ -1092,9 +1092,9 @@ msgstr "PyConfig C API" #: ../../c-api/init_config.rst:634 msgid "" -"Python can be initialized with :c:func:`Py_InitializeFromConfig` and " -"the :c:type:`PyConfig` structure. It can be preinitialized " -"with :c:func:`Py_PreInitialize` and the :c:type:`PyPreConfig` structure." +"Python can be initialized with :c:func:`Py_InitializeFromConfig` and the :c:" +"type:`PyConfig` structure. It can be preinitialized with :c:func:" +"`Py_PreInitialize` and the :c:type:`PyPreConfig` structure." msgstr "" #: ../../c-api/init_config.rst:638 @@ -1241,7 +1241,7 @@ msgstr "" #: ../../c-api/init_config.rst:767 msgid "Functions to create a status:" -msgstr "" +msgstr "建立狀態的函式:" #: ../../c-api/init_config.rst:771 msgid "Success." @@ -1261,11 +1261,11 @@ msgstr "" #: ../../c-api/init_config.rst:785 msgid "Exit Python with the specified exit code." -msgstr "" +msgstr "以指定的退出代號退出 Python。" #: ../../c-api/init_config.rst:787 msgid "Functions to handle a status:" -msgstr "" +msgstr "處理狀態的函式:" #: ../../c-api/init_config.rst:791 msgid "" @@ -1392,8 +1392,8 @@ msgstr "" #: ../../c-api/init_config.rst:872 msgid "" -"``PYMEM_ALLOCATOR_MALLOC_DEBUG`` (``4``): force usage of ``malloc()`` " -"with :ref:`debug hooks `." +"``PYMEM_ALLOCATOR_MALLOC_DEBUG`` (``4``): force usage of ``malloc()`` with :" +"ref:`debug hooks `." msgstr "" #: ../../c-api/init_config.rst:874 @@ -1448,8 +1448,8 @@ msgstr "" #: ../../c-api/init_config.rst:902 msgid "" -"If equals to ``0``, set :c:member:`~PyPreConfig.coerce_c_locale` " -"and :c:member:`~PyPreConfig.coerce_c_locale_warn` members to ``0``." +"If equals to ``0``, set :c:member:`~PyPreConfig.coerce_c_locale` and :c:" +"member:`~PyPreConfig.coerce_c_locale_warn` members to ``0``." msgstr "" #: ../../c-api/init_config.rst:905 ../../c-api/init_config.rst:916 @@ -1538,16 +1538,16 @@ msgstr "預設:``0``。" #: ../../c-api/init_config.rst:957 msgid "" -"If non-zero, :c:func:`Py_PreInitializeFromArgs` " -"and :c:func:`Py_PreInitializeFromBytesArgs` parse their ``argv`` argument " -"the same way the regular Python parses command line arguments: " -"see :ref:`Command Line Arguments `." +"If non-zero, :c:func:`Py_PreInitializeFromArgs` and :c:func:" +"`Py_PreInitializeFromBytesArgs` parse their ``argv`` argument the same way " +"the regular Python parses command line arguments: see :ref:`Command Line " +"Arguments `." msgstr "" #: ../../c-api/init_config.rst:966 msgid "" -"Use :ref:`environment variables `? " -"See :c:member:`PyConfig.use_environment`." +"Use :ref:`environment variables `? See :c:member:`PyConfig." +"use_environment`." msgstr "" #: ../../c-api/init_config.rst:969 ../../c-api/init_config.rst:1933 @@ -1590,8 +1590,8 @@ msgstr "" #: ../../c-api/init_config.rst:992 msgid "" -"Set the :ref:`Python UTF-8 Mode ` " -"(:c:member:`PyPreConfig.utf8_mode`)" +"Set the :ref:`Python UTF-8 Mode ` (:c:member:`PyPreConfig." +"utf8_mode`)" msgstr "" #: ../../c-api/init_config.rst:995 @@ -1616,38 +1616,38 @@ msgstr "*preconfig* 不可為 ``NULL``。" #: ../../c-api/init_config.rst:1010 msgid "" -"Parse *argv* command line arguments (bytes strings) " -"if :c:member:`~PyPreConfig.parse_argv` of *preconfig* is non-zero." +"Parse *argv* command line arguments (bytes strings) if :c:member:" +"`~PyPreConfig.parse_argv` of *preconfig* is non-zero." msgstr "" #: ../../c-api/init_config.rst:1019 msgid "" -"Parse *argv* command line arguments (wide strings) " -"if :c:member:`~PyPreConfig.parse_argv` of *preconfig* is non-zero." +"Parse *argv* command line arguments (wide strings) if :c:member:" +"`~PyPreConfig.parse_argv` of *preconfig* is non-zero." msgstr "" #: ../../c-api/init_config.rst:1024 ../../c-api/init_config.rst:2041 msgid "" -"The caller is responsible to handle exceptions (error or exit) " -"using :c:func:`PyStatus_Exception` and :c:func:`Py_ExitStatusException`." +"The caller is responsible to handle exceptions (error or exit) using :c:func:" +"`PyStatus_Exception` and :c:func:`Py_ExitStatusException`." msgstr "" #: ../../c-api/init_config.rst:1027 msgid "" -"For :ref:`Python Configuration ` " -"(:c:func:`PyPreConfig_InitPythonConfig`), if Python is initialized with " -"command line arguments, the command line arguments must also be passed to " -"preinitialize Python, since they have an effect on the pre-configuration " -"like encodings. For example, the :option:`-X utf8 <-X>` command line option " -"enables the :ref:`Python UTF-8 Mode `." +"For :ref:`Python Configuration ` (:c:func:" +"`PyPreConfig_InitPythonConfig`), if Python is initialized with command line " +"arguments, the command line arguments must also be passed to preinitialize " +"Python, since they have an effect on the pre-configuration like encodings. " +"For example, the :option:`-X utf8 <-X>` command line option enables the :ref:" +"`Python UTF-8 Mode `." msgstr "" #: ../../c-api/init_config.rst:1034 msgid "" "``PyMem_SetAllocator()`` can be called after :c:func:`Py_PreInitialize` and " "before :c:func:`Py_InitializeFromConfig` to install a custom memory " -"allocator. It can be called before :c:func:`Py_PreInitialize` " -"if :c:member:`PyPreConfig.allocator` is set to ``PYMEM_ALLOCATOR_NOT_SET``." +"allocator. It can be called before :c:func:`Py_PreInitialize` if :c:member:" +"`PyPreConfig.allocator` is set to ``PYMEM_ALLOCATOR_NOT_SET``." msgstr "" #: ../../c-api/init_config.rst:1039 @@ -1739,8 +1739,8 @@ msgstr "" #: ../../c-api/init_config.rst:1111 msgid "" "Set command line arguments (:c:member:`~PyConfig.argv` member of *config*) " -"from the *argv* list of bytes strings. Decode bytes " -"using :c:func:`Py_DecodeLocale`." +"from the *argv* list of bytes strings. Decode bytes using :c:func:" +"`Py_DecodeLocale`." msgstr "" #: ../../c-api/init_config.rst:1119 @@ -1749,11 +1749,11 @@ msgstr "" #: ../../c-api/init_config.rst:1125 msgid "Read all Python configuration." -msgstr "" +msgstr "讀取所有 Python 配置。" #: ../../c-api/init_config.rst:1127 msgid "Fields which are already initialized are left unchanged." -msgstr "" +msgstr "已經初始化的欄位將保持不變。" #: ../../c-api/init_config.rst:1129 msgid "" @@ -1765,17 +1765,16 @@ msgstr "" msgid "" "The :c:func:`PyConfig_Read` function only parses :c:member:`PyConfig.argv` " "arguments once: :c:member:`PyConfig.parse_argv` is set to ``2`` after " -"arguments are parsed. Since Python arguments are stripped " -"from :c:member:`PyConfig.argv`, parsing arguments twice would parse the " -"application options as Python options." +"arguments are parsed. Since Python arguments are stripped from :c:member:" +"`PyConfig.argv`, parsing arguments twice would parse the application options " +"as Python options." msgstr "" #: ../../c-api/init_config.rst:1140 msgid "" -"The :c:member:`PyConfig.argv` arguments are now only parsed " -"once, :c:member:`PyConfig.parse_argv` is set to ``2`` after arguments are " -"parsed, and arguments are only parsed if :c:member:`PyConfig.parse_argv` " -"equals ``1``." +"The :c:member:`PyConfig.argv` arguments are now only parsed once, :c:member:" +"`PyConfig.parse_argv` is set to ``2`` after arguments are parsed, and " +"arguments are only parsed if :c:member:`PyConfig.parse_argv` equals ``1``." msgstr "" #: ../../c-api/init_config.rst:1146 @@ -1792,10 +1791,10 @@ msgstr "" #: ../../c-api/init_config.rst:1156 msgid "" "Most ``PyConfig`` methods :ref:`preinitialize Python ` if needed. " -"In that case, the Python preinitialization configuration " -"(:c:type:`PyPreConfig`) in based on the :c:type:`PyConfig`. If configuration " -"fields which are in common with :c:type:`PyPreConfig` are tuned, they must " -"be set before calling a :c:type:`PyConfig` method:" +"In that case, the Python preinitialization configuration (:c:type:" +"`PyPreConfig`) in based on the :c:type:`PyConfig`. If configuration fields " +"which are in common with :c:type:`PyPreConfig` are tuned, they must be set " +"before calling a :c:type:`PyConfig` method:" msgstr "" #: ../../c-api/init_config.rst:1162 @@ -1818,8 +1817,8 @@ msgstr ":c:member:`PyConfig.use_environment`" msgid "" "Moreover, if :c:func:`PyConfig_SetArgv` or :c:func:`PyConfig_SetBytesArgv` " "is used, this method must be called before other methods, since the " -"preinitialization configuration depends on command line arguments " -"(if :c:member:`~PyConfig.parse_argv` is non-zero)." +"preinitialization configuration depends on command line arguments (if :c:" +"member:`~PyConfig.parse_argv` is non-zero)." msgstr "" #: ../../c-api/init_config.rst:1172 @@ -1830,21 +1829,19 @@ msgstr "" #: ../../c-api/init_config.rst:1185 msgid "" -"Set :data:`sys.argv` command line arguments based " -"on :c:member:`~PyConfig.argv`. These parameters are similar to those passed " -"to the program's :c:func:`main` function with the difference that the first " -"entry should refer to the script file to be executed rather than the " -"executable hosting the Python interpreter. If there isn't a script that " -"will be run, the first entry in :c:member:`~PyConfig.argv` can be an empty " -"string." +"Set :data:`sys.argv` command line arguments based on :c:member:`~PyConfig." +"argv`. These parameters are similar to those passed to the program's :c:" +"func:`main` function with the difference that the first entry should refer " +"to the script file to be executed rather than the executable hosting the " +"Python interpreter. If there isn't a script that will be run, the first " +"entry in :c:member:`~PyConfig.argv` can be an empty string." msgstr "" #: ../../c-api/init_config.rst:1193 msgid "" -"Set :c:member:`~PyConfig.parse_argv` to ``1`` to " -"parse :c:member:`~PyConfig.argv` the same way the regular Python parses " -"Python command line arguments and then to strip Python arguments " -"from :c:member:`~PyConfig.argv`." +"Set :c:member:`~PyConfig.parse_argv` to ``1`` to parse :c:member:`~PyConfig." +"argv` the same way the regular Python parses Python command line arguments " +"and then to strip Python arguments from :c:member:`~PyConfig.argv`." msgstr "" #: ../../c-api/init_config.rst:1198 @@ -1871,8 +1868,8 @@ msgstr "另請參閱 :c:member:`~PyConfig.orig_argv` 成員。" #: ../../c-api/init_config.rst:1207 msgid "" -"If equals to zero, ``Py_RunMain()`` prepends a potentially unsafe path " -"to :data:`sys.path` at startup:" +"If equals to zero, ``Py_RunMain()`` prepends a potentially unsafe path to :" +"data:`sys.path` at startup:" msgstr "" #: ../../c-api/init_config.rst:1210 @@ -1895,8 +1892,8 @@ msgstr "" #: ../../c-api/init_config.rst:1217 msgid "" -"Set to ``1`` by the :option:`-P` command line option and " -"the :envvar:`PYTHONSAFEPATH` environment variable." +"Set to ``1`` by the :option:`-P` command line option and the :envvar:" +"`PYTHONSAFEPATH` environment variable." msgstr "" #: ../../c-api/init_config.rst:1220 @@ -1924,11 +1921,11 @@ msgstr "" #: ../../c-api/init_config.rst:1238 msgid "Set by the :envvar:`__PYVENV_LAUNCHER__` environment variable." -msgstr "" +msgstr "由 :envvar:`__PYVENV_LAUNCHER__` 環境變數設定。" #: ../../c-api/init_config.rst:1240 msgid "Set from :c:member:`PyConfig.executable` if ``NULL``." -msgstr "" +msgstr "如果為 ``NULL``,則從 :c:member:`PyConfig.executable` 設定。" #: ../../c-api/init_config.rst:1246 msgid "See also :c:member:`PyConfig.executable`." @@ -1950,8 +1947,8 @@ msgstr "" #: ../../c-api/init_config.rst:1263 msgid "" -"Set to ``0`` by the :option:`-u` command line option and " -"the :envvar:`PYTHONUNBUFFERED` environment variable." +"Set to ``0`` by the :option:`-u` command line option and the :envvar:" +"`PYTHONUNBUFFERED` environment variable." msgstr "" #: ../../c-api/init_config.rst:1266 @@ -1965,9 +1962,8 @@ msgstr "預設值:``1``。" #: ../../c-api/init_config.rst:1272 msgid "" -"If equals to ``1``, issue a warning when comparing :class:`bytes` " -"or :class:`bytearray` with :class:`str`, or comparing :class:`bytes` " -"with :class:`int`." +"If equals to ``1``, issue a warning when comparing :class:`bytes` or :class:" +"`bytearray` with :class:`str`, or comparing :class:`bytes` with :class:`int`." msgstr "" #: ../../c-api/init_config.rst:1276 @@ -1982,9 +1978,9 @@ msgstr "" #: ../../c-api/init_config.rst:1285 msgid "" -"If non-zero, emit a :exc:`EncodingWarning` warning " -"when :class:`io.TextIOWrapper` uses its default encoding. See :ref:`io-" -"encoding-warning` for details." +"If non-zero, emit a :exc:`EncodingWarning` warning when :class:`io." +"TextIOWrapper` uses its default encoding. See :ref:`io-encoding-warning` for " +"details." msgstr "" #: ../../c-api/init_config.rst:1294 @@ -2002,13 +1998,13 @@ msgstr "" #: ../../c-api/init_config.rst:1307 msgid "" -"Control the validation behavior of hash-based ``.pyc`` files: value of " -"the :option:`--check-hash-based-pycs` command line option." +"Control the validation behavior of hash-based ``.pyc`` files: value of the :" +"option:`--check-hash-based-pycs` command line option." msgstr "" #: ../../c-api/init_config.rst:1310 msgid "Valid values:" -msgstr "" +msgstr "有效值:" #: ../../c-api/init_config.rst:1312 msgid "" @@ -2061,8 +2057,8 @@ msgstr "" #: ../../c-api/init_config.rst:1339 msgid "" -"Set to ``1`` by the :option:`-X dev <-X>` option and " -"the :envvar:`PYTHONDEVMODE` environment variable." +"Set to ``1`` by the :option:`-X dev <-X>` option and the :envvar:" +"`PYTHONDEVMODE` environment variable." msgstr "" #: ../../c-api/init_config.rst:1346 @@ -2103,8 +2099,8 @@ msgstr "也請見 :c:member:`PyConfig.base_exec_prefix`" #: ../../c-api/init_config.rst:1380 msgid "" -"The absolute path of the executable binary for the Python " -"interpreter: :data:`sys.executable`." +"The absolute path of the executable binary for the Python interpreter: :data:" +"`sys.executable`." msgstr "" #: ../../c-api/init_config.rst:1387 @@ -2113,22 +2109,22 @@ msgstr "也請見 :c:member:`PyConfig.base_executable`" #: ../../c-api/init_config.rst:1391 msgid "Enable faulthandler?" -msgstr "" +msgstr "啟用 faulthandler?" #: ../../c-api/init_config.rst:1393 msgid "If non-zero, call :func:`faulthandler.enable` at startup." -msgstr "" +msgstr "如果非零,則在啟動時呼叫 :func:`faulthandler.enable`。" #: ../../c-api/init_config.rst:1395 msgid "" -"Set to ``1`` by :option:`-X faulthandler <-X>` and " -"the :envvar:`PYTHONFAULTHANDLER` environment variable." +"Set to ``1`` by :option:`-X faulthandler <-X>` and the :envvar:" +"`PYTHONFAULTHANDLER` environment variable." msgstr "" #: ../../c-api/init_config.rst:1402 msgid "" -":term:`Filesystem encoding `: :func:`sys.getfilesystemencoding`." +":term:`Filesystem encoding `: :func:" +"`sys.getfilesystemencoding`." msgstr "" #: ../../c-api/init_config.rst:1405 @@ -2137,18 +2133,18 @@ msgstr "" #: ../../c-api/init_config.rst:1407 msgid "" -"On Windows: use ``\"utf-8\"`` by default, or ``\"mbcs\"`` " -"if :c:member:`~PyPreConfig.legacy_windows_fs_encoding` " -"of :c:type:`PyPreConfig` is non-zero." +"On Windows: use ``\"utf-8\"`` by default, or ``\"mbcs\"`` if :c:member:" +"`~PyPreConfig.legacy_windows_fs_encoding` of :c:type:`PyPreConfig` is non-" +"zero." msgstr "" #: ../../c-api/init_config.rst:1411 msgid "Default encoding on other platforms:" -msgstr "" +msgstr "其他平台的預設編碼:" #: ../../c-api/init_config.rst:1413 msgid "``\"utf-8\"`` if :c:member:`PyPreConfig.utf8_mode` is non-zero." -msgstr "" +msgstr "如果 :c:member:`PyPreConfig.utf8_mode` 非零,則為 ``\"utf-8\"``。" #: ../../c-api/init_config.rst:1414 msgid "" @@ -2178,24 +2174,24 @@ msgstr "另請參閱 :c:member:`~PyConfig.filesystem_errors` 成員。" #: ../../c-api/init_config.rst:1428 msgid "" -":term:`Filesystem error handler `: :func:`sys.getfilesystemencodeerrors`." +":term:`Filesystem error handler `: :" +"func:`sys.getfilesystemencodeerrors`." msgstr "" #: ../../c-api/init_config.rst:1431 msgid "" -"On Windows: use ``\"surrogatepass\"`` by default, or ``\"replace\"`` " -"if :c:member:`~PyPreConfig.legacy_windows_fs_encoding` " -"of :c:type:`PyPreConfig` is non-zero." +"On Windows: use ``\"surrogatepass\"`` by default, or ``\"replace\"`` if :c:" +"member:`~PyPreConfig.legacy_windows_fs_encoding` of :c:type:`PyPreConfig` is " +"non-zero." msgstr "" #: ../../c-api/init_config.rst:1435 msgid "On other platforms: use ``\"surrogateescape\"`` by default." -msgstr "" +msgstr "其他平台:預設使用 ``\"surrogateescape\"``。" #: ../../c-api/init_config.rst:1437 msgid "Supported error handlers:" -msgstr "" +msgstr "支援的錯誤處理器:" #: ../../c-api/init_config.rst:1439 msgid "``\"strict\"``" @@ -2215,7 +2211,7 @@ msgstr "另請參閱 :c:member:`~PyConfig.filesystem_encoding` 成員。" #: ../../c-api/init_config.rst:1447 msgid "If non-zero, use frozen modules." -msgstr "" +msgstr "如果非零,則使用凍結模組。" #: ../../c-api/init_config.rst:1449 msgid "Set by the :envvar:`PYTHON_FROZEN_MODULES` environment variable." @@ -2270,17 +2266,19 @@ msgstr "" #: ../../c-api/init_config.rst:1484 msgid "" -"Set by the :option:`-X importtime <-X>` option and " -"the :envvar:`PYTHONPROFILEIMPORTTIME` environment variable." -msgstr "由 :option:`-X importtime <-X>` 選項與 :envvar:`PYTHONPROFILEIMPORTTIME` 環境變數設定。" +"Set by the :option:`-X importtime <-X>` option and the :envvar:" +"`PYTHONPROFILEIMPORTTIME` environment variable." +msgstr "" +"由 :option:`-X importtime <-X>` 選項與 :envvar:`PYTHONPROFILEIMPORTTIME` 環境" +"變數設定。" #: ../../c-api/init_config.rst:1491 msgid "Added support for ``import_time = 2``" -msgstr "" +msgstr "新增對 ``import_time = 2`` 的支援" #: ../../c-api/init_config.rst:1495 msgid "Enter interactive mode after executing a script or a command." -msgstr "" +msgstr "在執行腳本或命令後進入互動模式。" #: ../../c-api/init_config.rst:1497 msgid "" @@ -2292,8 +2290,8 @@ msgstr "" #: ../../c-api/init_config.rst:1502 msgid "" -"Incremented by the :option:`-i` command line option. Set to ``1`` if " -"the :envvar:`PYTHONINSPECT` environment variable is non-empty." +"Incremented by the :option:`-i` command line option. Set to ``1`` if the :" +"envvar:`PYTHONINSPECT` environment variable is non-empty." msgstr "" #: ../../c-api/init_config.rst:1509 @@ -2317,11 +2315,10 @@ msgstr "" msgid "" "Configures the :ref:`integer string conversion length limitation " "`. An initial value of ``-1`` means the value will be " -"taken from the command line or environment or otherwise default to 4300 " -"(:data:`sys.int_info.default_max_str_digits`). A value of ``0`` disables " -"the limitation. Values greater than zero but less than 640 " -"(:data:`sys.int_info.str_digits_check_threshold`) are unsupported and will " -"produce an error." +"taken from the command line or environment or otherwise default to 4300 (:" +"data:`sys.int_info.default_max_str_digits`). A value of ``0`` disables the " +"limitation. Values greater than zero but less than 640 (:data:`sys.int_info." +"str_digits_check_threshold`) are unsupported and will produce an error." msgstr "" #: ../../c-api/init_config.rst:1531 @@ -2332,22 +2329,21 @@ msgstr "" #: ../../c-api/init_config.rst:1534 msgid "" -"Default: ``-1`` in Python mode. 4300 " -"(:data:`sys.int_info.default_max_str_digits`) in isolated mode." +"Default: ``-1`` in Python mode. 4300 (:data:`sys.int_info." +"default_max_str_digits`) in isolated mode." msgstr "" #: ../../c-api/init_config.rst:1541 msgid "" "If the value of :c:member:`~PyConfig.cpu_count` is not ``-1`` then it will " -"override the return values " -"of :func:`os.cpu_count`, :func:`os.process_cpu_count`, " -"and :func:`multiprocessing.cpu_count`." +"override the return values of :func:`os.cpu_count`, :func:`os." +"process_cpu_count`, and :func:`multiprocessing.cpu_count`." msgstr "" #: ../../c-api/init_config.rst:1545 msgid "" -"Configured by the :samp:`-X cpu_count={n|default}` command line flag or " -"the :envvar:`PYTHON_CPU_COUNT` environment variable." +"Configured by the :samp:`-X cpu_count={n|default}` command line flag or the :" +"envvar:`PYTHON_CPU_COUNT` environment variable." msgstr "" #: ../../c-api/init_config.rst:1548 ../../c-api/init_config.rst:1909 @@ -2391,15 +2387,15 @@ msgstr "" #: ../../c-api/init_config.rst:1571 msgid "" -"See also the :ref:`Isolated Configuration ` " -"and :c:member:`PyPreConfig.isolated`." +"See also the :ref:`Isolated Configuration ` and :c:" +"member:`PyPreConfig.isolated`." msgstr "" #: ../../c-api/init_config.rst:1576 msgid "" -"If non-zero, use :class:`io.FileIO` instead of :class:`!" -"io._WindowsConsoleIO` for :data:`sys.stdin`, :data:`sys.stdout` " -"and :data:`sys.stderr`." +"If non-zero, use :class:`io.FileIO` instead of :class:`!io." +"_WindowsConsoleIO` for :data:`sys.stdin`, :data:`sys.stdout` and :data:`sys." +"stderr`." msgstr "" #: ../../c-api/init_config.rst:1580 @@ -2438,9 +2434,9 @@ msgstr "" #: ../../c-api/init_config.rst:1608 msgid "" -"Default: value of the ``PLATLIBDIR`` macro which is set by " -"the :option:`configure --with-platlibdir option <--with-platlibdir>` " -"(default: ``\"lib\"``, or ``\"DLLs\"`` on Windows)." +"Default: value of the ``PLATLIBDIR`` macro which is set by the :option:" +"`configure --with-platlibdir option <--with-platlibdir>` (default: " +"``\"lib\"``, or ``\"DLLs\"`` on Windows)." msgstr "" #: ../../c-api/init_config.rst:1616 @@ -2453,8 +2449,8 @@ msgstr "" #: ../../c-api/init_config.rst:1625 msgid "" -"Module search paths (:data:`sys.path`) as a string separated by ``DELIM`` " -"(:data:`os.pathsep`)." +"Module search paths (:data:`sys.path`) as a string separated by ``DELIM`` (:" +"data:`os.pathsep`)." msgstr "" #: ../../c-api/init_config.rst:1628 @@ -2467,10 +2463,10 @@ msgstr "" #: ../../c-api/init_config.rst:1639 msgid "" -"If :c:member:`~PyConfig.module_search_paths_set` is equal to " -"``0``, :c:func:`Py_InitializeFromConfig` will " -"replace :c:member:`~PyConfig.module_search_paths` and " -"sets :c:member:`~PyConfig.module_search_paths_set` to ``1``." +"If :c:member:`~PyConfig.module_search_paths_set` is equal to ``0``, :c:func:" +"`Py_InitializeFromConfig` will replace :c:member:`~PyConfig." +"module_search_paths` and sets :c:member:`~PyConfig.module_search_paths_set` " +"to ``1``." msgstr "" #: ../../c-api/init_config.rst:1644 @@ -2497,8 +2493,8 @@ msgstr "" #: ../../c-api/init_config.rst:1657 msgid "" -"Incremented by the :option:`-O` command line option. Set to " -"the :envvar:`PYTHONOPTIMIZE` environment variable value." +"Incremented by the :option:`-O` command line option. Set to the :envvar:" +"`PYTHONOPTIMIZE` environment variable value." msgstr "" #: ../../c-api/init_config.rst:1664 @@ -2509,18 +2505,17 @@ msgstr "" #: ../../c-api/init_config.rst:1667 msgid "" -"If :c:member:`~PyConfig.orig_argv` list is empty " -"and :c:member:`~PyConfig.argv` is not a list only containing an empty " -"string, :c:func:`PyConfig_Read` copies :c:member:`~PyConfig.argv` " -"into :c:member:`~PyConfig.orig_argv` before " -"modifying :c:member:`~PyConfig.argv` (if :c:member:`~PyConfig.parse_argv` is " -"non-zero)." +"If :c:member:`~PyConfig.orig_argv` list is empty and :c:member:`~PyConfig." +"argv` is not a list only containing an empty string, :c:func:`PyConfig_Read` " +"copies :c:member:`~PyConfig.argv` into :c:member:`~PyConfig.orig_argv` " +"before modifying :c:member:`~PyConfig.argv` (if :c:member:`~PyConfig." +"parse_argv` is non-zero)." msgstr "" #: ../../c-api/init_config.rst:1674 msgid "" -"See also the :c:member:`~PyConfig.argv` member and " -"the :c:func:`Py_GetArgcArgv` function." +"See also the :c:member:`~PyConfig.argv` member and the :c:func:" +"`Py_GetArgcArgv` function." msgstr "" #: ../../c-api/init_config.rst:1677 ../../c-api/init_config.rst:1990 @@ -2541,8 +2536,8 @@ msgstr "" #: ../../c-api/init_config.rst:1697 msgid "" -"The :c:member:`PyConfig.argv` arguments are now only parsed " -"if :c:member:`PyConfig.parse_argv` equals to ``1``." +"The :c:member:`PyConfig.argv` arguments are now only parsed if :c:member:" +"`PyConfig.parse_argv` equals to ``1``." msgstr "" #: ../../c-api/init_config.rst:1703 @@ -2553,8 +2548,8 @@ msgstr "" #: ../../c-api/init_config.rst:1706 msgid "" -"Incremented by the :option:`-d` command line option. Set to " -"the :envvar:`PYTHONDEBUG` environment variable value." +"Incremented by the :option:`-d` command line option. Set to the :envvar:" +"`PYTHONDEBUG` environment variable value." msgstr "" #: ../../c-api/init_config.rst:1709 ../../c-api/init_config.rst:1814 @@ -2571,7 +2566,7 @@ msgstr "" #: ../../c-api/init_config.rst:1723 msgid "Now also applies on Windows." -msgstr "" +msgstr "現在也適用於 Windows。" #: ../../c-api/init_config.rst:1728 msgid "" @@ -2595,8 +2590,8 @@ msgstr "" #: ../../c-api/init_config.rst:1743 msgid "" -"If the ``WITH_NEXT_FRAMEWORK`` macro is defined, " -"use :envvar:`__PYVENV_LAUNCHER__` environment variable if set." +"If the ``WITH_NEXT_FRAMEWORK`` macro is defined, use :envvar:" +"`__PYVENV_LAUNCHER__` environment variable if set." msgstr "" #: ../../c-api/init_config.rst:1745 @@ -2612,8 +2607,8 @@ msgstr "" #: ../../c-api/init_config.rst:1756 msgid "" -"Directory where cached ``.pyc`` files are " -"written: :data:`sys.pycache_prefix`." +"Directory where cached ``.pyc`` files are written: :data:`sys." +"pycache_prefix`." msgstr "" #: ../../c-api/init_config.rst:1759 @@ -2643,13 +2638,12 @@ msgstr "" #: ../../c-api/init_config.rst:1780 ../../c-api/init_config.rst:1801 msgid "Used by :c:func:`Py_RunMain`." -msgstr "" +msgstr "被 :c:func:`Py_RunMain` 使用。" #: ../../c-api/init_config.rst:1786 msgid "" -"Filename passed on the command line: trailing command line argument " -"without :option:`-c` or :option:`-m`. It is used by the :c:func:`Py_RunMain` " -"function." +"Filename passed on the command line: trailing command line argument without :" +"option:`-c` or :option:`-m`. It is used by the :c:func:`Py_RunMain` function." msgstr "" #: ../../c-api/init_config.rst:1790 @@ -2716,8 +2710,8 @@ msgstr "" #: ../../c-api/init_config.rst:1842 msgid "" -":data:`sys.flags.no_site ` is set to the inverted value " -"of :c:member:`~PyConfig.site_import`." +":data:`sys.flags.no_site ` is set to the inverted value of :c:" +"member:`~PyConfig.site_import`." msgstr "" #: ../../c-api/init_config.rst:1849 @@ -2738,8 +2732,8 @@ msgstr "" #: ../../c-api/init_config.rst:1862 msgid "" -"Encoding and encoding errors of :data:`sys.stdin`, :data:`sys.stdout` " -"and :data:`sys.stderr` (but :data:`sys.stderr` always uses " +"Encoding and encoding errors of :data:`sys.stdin`, :data:`sys.stdout` and :" +"data:`sys.stderr` (but :data:`sys.stderr` always uses " "``\"backslashreplace\"`` error handler)." msgstr "" @@ -2750,15 +2744,15 @@ msgstr "" #: ../../c-api/init_config.rst:1869 msgid "Default encoding:" -msgstr "" +msgstr "預設編碼:" #: ../../c-api/init_config.rst:1871 msgid "``\"UTF-8\"`` if :c:member:`PyPreConfig.utf8_mode` is non-zero." -msgstr "" +msgstr "如果 :c:member:`PyPreConfig.utf8_mode` 非零,則為 ``\"UTF-8\"``。" #: ../../c-api/init_config.rst:1872 msgid "Otherwise, use the :term:`locale encoding`." -msgstr "" +msgstr "否則使用 :term:`locale encoding`。" #: ../../c-api/init_config.rst:1874 msgid "Default error handler:" @@ -2766,7 +2760,7 @@ msgstr "" #: ../../c-api/init_config.rst:1876 msgid "On Windows: use ``\"surrogateescape\"``." -msgstr "" +msgstr "在 Windows 上:使用 ``\"surrogateescape\"``。" #: ../../c-api/init_config.rst:1877 msgid "" @@ -2792,34 +2786,35 @@ msgstr "" #: ../../c-api/init_config.rst:1889 msgid "" -"Set by :option:`-X tracemalloc=N <-X>` command line option and by " -"the :envvar:`PYTHONTRACEMALLOC` environment variable." +"Set by :option:`-X tracemalloc=N <-X>` command line option and by the :" +"envvar:`PYTHONTRACEMALLOC` environment variable." msgstr "" #: ../../c-api/init_config.rst:1896 msgid "Enable the Linux ``perf`` profiler support?" -msgstr "" +msgstr "要啟用 Linux ``perf`` 分析器支援嗎?" #: ../../c-api/init_config.rst:1898 msgid "If equals to ``1``, enable support for the Linux ``perf`` profiler." -msgstr "" +msgstr "如果等於 ``1``,則啟用對 Linux ``perf`` 分析器的支援。" #: ../../c-api/init_config.rst:1900 msgid "" "If equals to ``2``, enable support for the Linux ``perf`` profiler with " "DWARF JIT support." msgstr "" +"如果等於 ``2``,則啟用有 DWARF JIT 支援的 Linux ``perf`` 分析器的支援。" #: ../../c-api/init_config.rst:1903 msgid "" -"Set to ``1`` by :option:`-X perf <-X>` command-line option and " -"the :envvar:`PYTHONPERFSUPPORT` environment variable." +"Set to ``1`` by :option:`-X perf <-X>` command-line option and the :envvar:" +"`PYTHONPERFSUPPORT` environment variable." msgstr "" #: ../../c-api/init_config.rst:1906 msgid "" -"Set to ``2`` by the :option:`-X perf_jit <-X>` command-line option and " -"the :envvar:`PYTHON_PERF_JIT_SUPPORT` environment variable." +"Set to ``2`` by the :option:`-X perf_jit <-X>` command-line option and the :" +"envvar:`PYTHON_PERF_JIT_SUPPORT` environment variable." msgstr "" #: ../../c-api/init_config.rst:1912 @@ -2908,15 +2903,15 @@ msgstr "" #: ../../c-api/init_config.rst:1983 msgid "" -"The :option:`-W` command line options adds its value " -"to :c:member:`~PyConfig.warnoptions`, it can be used multiple times." +"The :option:`-W` command line options adds its value to :c:member:`~PyConfig." +"warnoptions`, it can be used multiple times." msgstr "" #: ../../c-api/init_config.rst:1986 msgid "" "The :envvar:`PYTHONWARNINGS` environment variable can also be used to add " -"warning options. Multiple options can be specified, separated by commas " -"(``,``)." +"warning options. Multiple options can be specified, separated by commas (``," +"``)." msgstr "" #: ../../c-api/init_config.rst:1994 @@ -2927,14 +2922,14 @@ msgstr "" #: ../../c-api/init_config.rst:1997 msgid "" -"Set to ``0`` by the :option:`-B` command line option and " -"the :envvar:`PYTHONDONTWRITEBYTECODE` environment variable." +"Set to ``0`` by the :option:`-B` command line option and the :envvar:" +"`PYTHONDONTWRITEBYTECODE` environment variable." msgstr "" #: ../../c-api/init_config.rst:2000 msgid "" -":data:`sys.dont_write_bytecode` is initialized to the inverted value " -"of :c:member:`~PyConfig.write_bytecode`." +":data:`sys.dont_write_bytecode` is initialized to the inverted value of :c:" +"member:`~PyConfig.write_bytecode`." msgstr "" #: ../../c-api/init_config.rst:2007 @@ -2955,8 +2950,8 @@ msgstr "" msgid "" "If :c:member:`~PyConfig.parse_argv` is non-zero, :c:member:`~PyConfig.argv` " "arguments are parsed the same way the regular Python parses :ref:`command " -"line arguments `, and Python arguments are stripped " -"from :c:member:`~PyConfig.argv`." +"line arguments `, and Python arguments are stripped from :" +"c:member:`~PyConfig.argv`." msgstr "" #: ../../c-api/init_config.rst:2025 @@ -2981,12 +2976,11 @@ msgstr "" #: ../../c-api/init_config.rst:2044 msgid "" -"If :c:func:`PyImport_FrozenModules`, :c:func:`PyImport_AppendInittab` " -"or :c:func:`PyImport_ExtendInittab` are used, they must be set or called " -"after Python preinitialization and before the Python initialization. If " -"Python is initialized multiple times, :c:func:`PyImport_AppendInittab` " -"or :c:func:`PyImport_ExtendInittab` must be called before each Python " -"initialization." +"If :c:func:`PyImport_FrozenModules`, :c:func:`PyImport_AppendInittab` or :c:" +"func:`PyImport_ExtendInittab` are used, they must be set or called after " +"Python preinitialization and before the Python initialization. If Python is " +"initialized multiple times, :c:func:`PyImport_AppendInittab` or :c:func:" +"`PyImport_ExtendInittab` must be called before each Python initialization." msgstr "" #: ../../c-api/init_config.rst:2051 @@ -3123,10 +3117,9 @@ msgstr "" #: ../../c-api/init_config.rst:2147 msgid "" -":c:func:`PyPreConfig_InitIsolatedConfig` " -"and :c:func:`PyConfig_InitIsolatedConfig` functions create a configuration " -"to isolate Python from the system. For example, to embed Python into an " -"application." +":c:func:`PyPreConfig_InitIsolatedConfig` and :c:func:" +"`PyConfig_InitIsolatedConfig` functions create a configuration to isolate " +"Python from the system. For example, to embed Python into an application." msgstr "" #: ../../c-api/init_config.rst:2152 @@ -3150,9 +3143,9 @@ msgstr "" #: ../../c-api/init_config.rst:2167 msgid "" -":c:func:`PyPreConfig_InitPythonConfig` " -"and :c:func:`PyConfig_InitPythonConfig` functions create a configuration to " -"build a customized Python which behaves as the regular Python." +":c:func:`PyPreConfig_InitPythonConfig` and :c:func:" +"`PyConfig_InitPythonConfig` functions create a configuration to build a " +"customized Python which behaves as the regular Python." msgstr "" #: ../../c-api/init_config.rst:2171 @@ -3164,9 +3157,8 @@ msgstr "" #: ../../c-api/init_config.rst:2174 msgid "" "This function enables C locale coercion (:pep:`538`) and :ref:`Python UTF-8 " -"Mode ` (:pep:`540`) depending on the LC_CTYPE " -"locale, :envvar:`PYTHONUTF8` and :envvar:`PYTHONCOERCECLOCALE` environment " -"variables." +"Mode ` (:pep:`540`) depending on the LC_CTYPE locale, :envvar:" +"`PYTHONUTF8` and :envvar:`PYTHONCOERCECLOCALE` environment variables." msgstr "" #: ../../c-api/init_config.rst:2183 @@ -3207,8 +3199,8 @@ msgstr "" #: ../../c-api/init_config.rst:2195 msgid "" -"``PATH`` environment variable to get the program full path " -"(from :c:member:`PyConfig.program_name`)" +"``PATH`` environment variable to get the program full path (from :c:member:" +"`PyConfig.program_name`)" msgstr "" #: ../../c-api/init_config.rst:2197 @@ -3247,8 +3239,12 @@ msgid ":c:member:`PyConfig.executable`" msgstr ":c:member:`PyConfig.executable`" #: ../../c-api/init_config.rst:2209 -msgid ":c:member:`PyConfig.module_search_paths_set`, :c:member:`PyConfig.module_search_paths`" -msgstr ":c:member:`PyConfig.module_search_paths_set`, :c:member:`PyConfig.module_search_paths`" +msgid "" +":c:member:`PyConfig.module_search_paths_set`, :c:member:`PyConfig." +"module_search_paths`" +msgstr "" +":c:member:`PyConfig.module_search_paths_set`, :c:member:`PyConfig." +"module_search_paths`" #: ../../c-api/init_config.rst:2211 msgid ":c:member:`PyConfig.prefix`" @@ -3257,10 +3253,10 @@ msgstr ":c:member:`PyConfig.prefix`" #: ../../c-api/init_config.rst:2213 msgid "" "If at least one \"output field\" is not set, Python calculates the path " -"configuration to fill unset fields. " -"If :c:member:`~PyConfig.module_search_paths_set` is equal to " -"``0``, :c:member:`~PyConfig.module_search_paths` is overridden " -"and :c:member:`~PyConfig.module_search_paths_set` is set to ``1``." +"configuration to fill unset fields. If :c:member:`~PyConfig." +"module_search_paths_set` is equal to ``0``, :c:member:`~PyConfig." +"module_search_paths` is overridden and :c:member:`~PyConfig." +"module_search_paths_set` is set to ``1``." msgstr "" #: ../../c-api/init_config.rst:2219 @@ -3282,10 +3278,9 @@ msgstr "" #: ../../c-api/init_config.rst:2229 msgid "" -"If :c:member:`~PyConfig.base_prefix` " -"or :c:member:`~PyConfig.base_exec_prefix` fields are not set, they inherit " -"their value from :c:member:`~PyConfig.prefix` " -"and :c:member:`~PyConfig.exec_prefix` respectively." +"If :c:member:`~PyConfig.base_prefix` or :c:member:`~PyConfig." +"base_exec_prefix` fields are not set, they inherit their value from :c:" +"member:`~PyConfig.prefix` and :c:member:`~PyConfig.exec_prefix` respectively." msgstr "" #: ../../c-api/init_config.rst:2233 @@ -3295,8 +3290,8 @@ msgstr ":c:func:`Py_RunMain` 和 :c:func:`Py_Main` 會修改 :data:`sys.path`: #: ../../c-api/init_config.rst:2235 msgid "" "If :c:member:`~PyConfig.run_filename` is set and is a directory which " -"contains a ``__main__.py`` script, " -"prepend :c:member:`~PyConfig.run_filename` to :data:`sys.path`." +"contains a ``__main__.py`` script, prepend :c:member:`~PyConfig." +"run_filename` to :data:`sys.path`." msgstr "" #: ../../c-api/init_config.rst:2238 @@ -3322,10 +3317,10 @@ msgstr "" #: ../../c-api/init_config.rst:2246 msgid "" "If :c:member:`~PyConfig.site_import` is non-zero, :data:`sys.path` can be " -"modified by the :mod:`site` module. " -"If :c:member:`~PyConfig.user_site_directory` is non-zero and the user's site-" -"package directory exists, the :mod:`site` module appends the user's site-" -"package directory to :data:`sys.path`." +"modified by the :mod:`site` module. If :c:member:`~PyConfig." +"user_site_directory` is non-zero and the user's site-package directory " +"exists, the :mod:`site` module appends the user's site-package directory to :" +"data:`sys.path`." msgstr "" #: ../../c-api/init_config.rst:2252 @@ -3377,15 +3372,15 @@ msgstr "" #: ../../c-api/init_config.rst:2273 msgid "" -"The ``__PYVENV_LAUNCHER__`` environment variable is used to " -"set :c:member:`PyConfig.base_executable`." +"The ``__PYVENV_LAUNCHER__`` environment variable is used to set :c:member:" +"`PyConfig.base_executable`." msgstr "" #: ../../c-api/init_config.rst:2278 msgid "" ":c:member:`~PyConfig.prefix`, and :c:member:`~PyConfig.exec_prefix`, are now " -"set to the ``pyvenv.cfg`` directory. This was previously done " -"by :mod:`site`, therefore affected by :option:`-S`." +"set to the ``pyvenv.cfg`` directory. This was previously done by :mod:" +"`site`, therefore affected by :option:`-S`." msgstr "" #: ../../c-api/init_config.rst:2284 @@ -3425,12 +3420,3 @@ msgstr "main()" #: ../../c-api/init_config.rst:1181 msgid "argv (in module sys)" msgstr "" - -#~ msgid "Builtin types;" -#~ msgstr "內建型別;" - -#~ msgid "Builtin exceptions;" -#~ msgstr "內建例外;" - -#~ msgid "Import the :mod:`site` module;" -#~ msgstr "引入 :mod:`site` 模組;" diff --git a/c-api/intro.po b/c-api/intro.po index 1a3e1e2a63..3e9ccded14 100644 --- a/c-api/intro.po +++ b/c-api/intro.po @@ -1046,6 +1046,12 @@ msgid "" " item = 0\n" " dict[key] = item + 1" msgstr "" +"def incr_item(dict, key):\n" +" try:\n" +" item = dict[key]\n" +" except KeyError:\n" +" item = 0\n" +" dict[key] = item + 1" #: ../../c-api/intro.rst:652 msgid "Here is the corresponding C code, in all its glory::" diff --git a/c-api/iterator.po b/c-api/iterator.po index a83e08ee22..d8a7178719 100644 --- a/c-api/iterator.po +++ b/c-api/iterator.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-24 00:03+0000\n" +"POT-Creation-Date: 2025-11-07 00:14+0000\n" "PO-Revision-Date: 2017-09-22 18:26+0000\n" "Last-Translator: Leon H.\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -76,3 +76,77 @@ msgid "" "should return the next item in the iteration. When *callable* returns a " "value equal to *sentinel*, the iteration will be terminated." msgstr "" + +#: ../../c-api/iterator.rst:56 +msgid "Range Objects" +msgstr "Range 物件" + +#: ../../c-api/iterator.rst:60 +msgid "The type object for :class:`range` objects." +msgstr ":class:`range` 物件的型別物件。" + +#: ../../c-api/iterator.rst:65 +msgid "" +"Return true if the object *o* is an instance of a :class:`range` object. " +"This function always succeeds." +msgstr "" + +#: ../../c-api/iterator.rst:70 +msgid "Builtin Iterator Types" +msgstr "內建疊代器型別" + +#: ../../c-api/iterator.rst:72 +msgid "" +"These are built-in iteration types that are included in Python's C API, but " +"provide no additional functions. They are here for completeness." +msgstr "" + +#: ../../c-api/iterator.rst:80 +msgid "C type" +msgstr "C 型別" + +#: ../../c-api/iterator.rst:81 +msgid "Python type" +msgstr "Python 型別" + +#: ../../c-api/iterator.rst:83 +msgid ":py:class:`enumerate`" +msgstr ":py:class:`enumerate`" + +#: ../../c-api/iterator.rst:85 +msgid ":py:class:`filter`" +msgstr ":py:class:`filter`" + +#: ../../c-api/iterator.rst:87 +msgid ":py:class:`map`" +msgstr ":py:class:`map`" + +#: ../../c-api/iterator.rst:89 +msgid ":py:class:`reversed`" +msgstr ":py:class:`reversed`" + +#: ../../c-api/iterator.rst:91 +msgid ":py:class:`zip`" +msgstr ":py:class:`zip`" + +#: ../../c-api/iterator.rst:95 +msgid "Other Iterator Objects" +msgstr "其他疊代器物件" + +#: ../../c-api/iterator.rst:112 +msgid "Type objects for iterators of various built-in objects." +msgstr "各種內建物件的疊代器型別物件。" + +#: ../../c-api/iterator.rst:114 +msgid "" +"Do not create instances of these directly; prefer calling :c:func:" +"`PyObject_GetIter` instead." +msgstr "" + +#: ../../c-api/iterator.rst:117 +msgid "" +"Note that there is no guarantee that a given built-in type uses a given " +"iterator type. For example, iterating over :class:`range` will use one of " +"two iterator types depending on the size of the range. Other types may start " +"using a similar scheme in the future, without warning." +msgstr "" diff --git a/c-api/long.po b/c-api/long.po index 17bf9290c6..ccf87256ab 100644 --- a/c-api/long.po +++ b/c-api/long.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-12 00:14+0000\n" +"POT-Creation-Date: 2025-11-07 00:14+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-" @@ -179,52 +179,62 @@ msgid "" "most-significant bit is not a sign bit. Flags other than endian are ignored." msgstr "" -#: ../../c-api/long.rst:170 ../../c-api/long.rst:206 +#: ../../c-api/long.rst:166 +msgid "Macro for creating a Python integer from a process identifier." +msgstr "" + +#: ../../c-api/long.rst:168 +msgid "" +"This can be defined as an alias to :c:func:`PyLong_FromLong` or :c:func:" +"`PyLong_FromLongLong`, depending on the size of the system's PID type." +msgstr "" + +#: ../../c-api/long.rst:181 ../../c-api/long.rst:217 msgid "" "Return a C :c:expr:`long` representation of *obj*. If *obj* is not an " "instance of :c:type:`PyLongObject`, first call its :meth:`~object.__index__` " "method (if present) to convert it to a :c:type:`PyLongObject`." msgstr "" -#: ../../c-api/long.rst:174 +#: ../../c-api/long.rst:185 msgid "" "Raise :exc:`OverflowError` if the value of *obj* is out of range for a :c:" "expr:`long`." msgstr "" -#: ../../c-api/long.rst:177 ../../c-api/long.rst:215 ../../c-api/long.rst:236 -#: ../../c-api/long.rst:256 ../../c-api/long.rst:279 +#: ../../c-api/long.rst:188 ../../c-api/long.rst:226 ../../c-api/long.rst:247 +#: ../../c-api/long.rst:267 ../../c-api/long.rst:290 msgid "Returns ``-1`` on error. Use :c:func:`PyErr_Occurred` to disambiguate." msgstr "" -#: ../../c-api/long.rst:179 ../../c-api/long.rst:217 ../../c-api/long.rst:238 -#: ../../c-api/long.rst:260 ../../c-api/long.rst:344 ../../c-api/long.rst:364 +#: ../../c-api/long.rst:190 ../../c-api/long.rst:228 ../../c-api/long.rst:249 +#: ../../c-api/long.rst:271 ../../c-api/long.rst:355 ../../c-api/long.rst:375 msgid "Use :meth:`~object.__index__` if available." msgstr "" -#: ../../c-api/long.rst:182 ../../c-api/long.rst:220 ../../c-api/long.rst:241 -#: ../../c-api/long.rst:263 ../../c-api/long.rst:347 ../../c-api/long.rst:367 +#: ../../c-api/long.rst:193 ../../c-api/long.rst:231 ../../c-api/long.rst:252 +#: ../../c-api/long.rst:274 ../../c-api/long.rst:358 ../../c-api/long.rst:378 msgid "This function will no longer use :meth:`~object.__int__`." msgstr "" -#: ../../c-api/long.rst:189 +#: ../../c-api/long.rst:200 msgid "" "A :term:`soft deprecated` alias. Exactly equivalent to the preferred " "``PyLong_AsLong``. In particular, it can fail with :exc:`OverflowError` or " "another exception." msgstr "" -#: ../../c-api/long.rst:193 +#: ../../c-api/long.rst:204 msgid "The function is soft deprecated." msgstr "" -#: ../../c-api/long.rst:198 +#: ../../c-api/long.rst:209 msgid "" "Similar to :c:func:`PyLong_AsLong`, but store the result in a C :c:expr:" "`int` instead of a C :c:expr:`long`." msgstr "" -#: ../../c-api/long.rst:210 +#: ../../c-api/long.rst:221 msgid "" "If the value of *obj* is greater than :c:macro:`LONG_MAX` or less than :c:" "macro:`LONG_MIN`, set *\\*overflow* to ``1`` or ``-1``, respectively, and " @@ -232,20 +242,20 @@ msgid "" "exception occurs set *\\*overflow* to ``0`` and return ``-1`` as usual." msgstr "" -#: ../../c-api/long.rst:229 ../../c-api/long.rst:247 +#: ../../c-api/long.rst:240 ../../c-api/long.rst:258 msgid "" "Return a C :c:expr:`long long` representation of *obj*. If *obj* is not an " "instance of :c:type:`PyLongObject`, first call its :meth:`~object.__index__` " "method (if present) to convert it to a :c:type:`PyLongObject`." msgstr "" -#: ../../c-api/long.rst:233 +#: ../../c-api/long.rst:244 msgid "" "Raise :exc:`OverflowError` if the value of *obj* is out of range for a :c:" "expr:`long long`." msgstr "" -#: ../../c-api/long.rst:251 +#: ../../c-api/long.rst:262 msgid "" "If the value of *obj* is greater than :c:macro:`LLONG_MAX` or less than :c:" "macro:`LLONG_MIN`, set *\\*overflow* to ``1`` or ``-1``, respectively, and " @@ -253,170 +263,170 @@ msgid "" "exception occurs set *\\*overflow* to ``0`` and return ``-1`` as usual." msgstr "" -#: ../../c-api/long.rst:273 +#: ../../c-api/long.rst:284 msgid "" "Return a C :c:type:`Py_ssize_t` representation of *pylong*. *pylong* must " "be an instance of :c:type:`PyLongObject`." msgstr "" -#: ../../c-api/long.rst:276 +#: ../../c-api/long.rst:287 msgid "" "Raise :exc:`OverflowError` if the value of *pylong* is out of range for a :c:" "type:`Py_ssize_t`." msgstr "" -#: ../../c-api/long.rst:288 +#: ../../c-api/long.rst:299 msgid "" "Return a C :c:expr:`unsigned long` representation of *pylong*. *pylong* " "must be an instance of :c:type:`PyLongObject`." msgstr "" -#: ../../c-api/long.rst:291 +#: ../../c-api/long.rst:302 msgid "" "Raise :exc:`OverflowError` if the value of *pylong* is out of range for a :c:" "expr:`unsigned long`." msgstr "" -#: ../../c-api/long.rst:294 +#: ../../c-api/long.rst:305 msgid "" "Returns ``(unsigned long)-1`` on error. Use :c:func:`PyErr_Occurred` to " "disambiguate." msgstr "" -#: ../../c-api/long.rst:304 +#: ../../c-api/long.rst:315 msgid "" "Return a C :c:type:`size_t` representation of *pylong*. *pylong* must be an " "instance of :c:type:`PyLongObject`." msgstr "" -#: ../../c-api/long.rst:307 +#: ../../c-api/long.rst:318 msgid "" "Raise :exc:`OverflowError` if the value of *pylong* is out of range for a :c:" "type:`size_t`." msgstr "" -#: ../../c-api/long.rst:310 +#: ../../c-api/long.rst:321 msgid "" "Returns ``(size_t)-1`` on error. Use :c:func:`PyErr_Occurred` to " "disambiguate." msgstr "" -#: ../../c-api/long.rst:319 +#: ../../c-api/long.rst:330 msgid "" "Return a C :c:expr:`unsigned long long` representation of *pylong*. " "*pylong* must be an instance of :c:type:`PyLongObject`." msgstr "" -#: ../../c-api/long.rst:322 +#: ../../c-api/long.rst:333 msgid "" "Raise :exc:`OverflowError` if the value of *pylong* is out of range for an :" "c:expr:`unsigned long long`." msgstr "" -#: ../../c-api/long.rst:325 +#: ../../c-api/long.rst:336 msgid "" "Returns ``(unsigned long long)-1`` on error. Use :c:func:`PyErr_Occurred` to " "disambiguate." msgstr "" -#: ../../c-api/long.rst:328 +#: ../../c-api/long.rst:339 msgid "" "A negative *pylong* now raises :exc:`OverflowError`, not :exc:`TypeError`." msgstr "" -#: ../../c-api/long.rst:334 +#: ../../c-api/long.rst:345 msgid "" "Return a C :c:expr:`unsigned long` representation of *obj*. If *obj* is not " "an instance of :c:type:`PyLongObject`, first call its :meth:`~object." "__index__` method (if present) to convert it to a :c:type:`PyLongObject`." msgstr "" -#: ../../c-api/long.rst:338 +#: ../../c-api/long.rst:349 msgid "" "If the value of *obj* is out of range for an :c:expr:`unsigned long`, return " "the reduction of that value modulo ``ULONG_MAX + 1``." msgstr "" -#: ../../c-api/long.rst:341 +#: ../../c-api/long.rst:352 msgid "" "Returns ``(unsigned long)-1`` on error. Use :c:func:`PyErr_Occurred` to " "disambiguate." msgstr "" -#: ../../c-api/long.rst:353 +#: ../../c-api/long.rst:364 msgid "" "Return a C :c:expr:`unsigned long long` representation of *obj*. If *obj* " "is not an instance of :c:type:`PyLongObject`, first call its :meth:`~object." "__index__` method (if present) to convert it to a :c:type:`PyLongObject`." msgstr "" -#: ../../c-api/long.rst:358 +#: ../../c-api/long.rst:369 msgid "" "If the value of *obj* is out of range for an :c:expr:`unsigned long long`, " "return the reduction of that value modulo ``ULLONG_MAX + 1``." msgstr "" -#: ../../c-api/long.rst:361 +#: ../../c-api/long.rst:372 msgid "" "Returns ``(unsigned long long)-1`` on error. Use :c:func:`PyErr_Occurred` " "to disambiguate." msgstr "" -#: ../../c-api/long.rst:374 +#: ../../c-api/long.rst:385 msgid "" "Set *\\*value* to a signed C :c:expr:`int32_t` or :c:expr:`int64_t` " "representation of *obj*." msgstr "" -#: ../../c-api/long.rst:377 ../../c-api/long.rst:397 +#: ../../c-api/long.rst:388 ../../c-api/long.rst:408 msgid "" "If *obj* is not an instance of :c:type:`PyLongObject`, first call its :meth:" "`~object.__index__` method (if present) to convert it to a :c:type:" "`PyLongObject`." msgstr "" -#: ../../c-api/long.rst:381 ../../c-api/long.rst:402 +#: ../../c-api/long.rst:392 ../../c-api/long.rst:413 msgid "If the *obj* value is out of range, raise an :exc:`OverflowError`." msgstr "" -#: ../../c-api/long.rst:383 ../../c-api/long.rst:404 +#: ../../c-api/long.rst:394 ../../c-api/long.rst:415 msgid "" "Set *\\*value* and return ``0`` on success. Set an exception and return " "``-1`` on error." msgstr "" -#: ../../c-api/long.rst:386 ../../c-api/long.rst:407 +#: ../../c-api/long.rst:397 ../../c-api/long.rst:418 msgid "*value* must not be ``NULL``." msgstr "" -#: ../../c-api/long.rst:394 +#: ../../c-api/long.rst:405 msgid "" "Set *\\*value* to an unsigned C :c:expr:`uint32_t` or :c:expr:`uint64_t` " "representation of *obj*." msgstr "" -#: ../../c-api/long.rst:401 +#: ../../c-api/long.rst:412 msgid "If *obj* is negative, raise a :exc:`ValueError`." msgstr "" -#: ../../c-api/long.rst:414 +#: ../../c-api/long.rst:425 msgid "" "Return a C :c:expr:`double` representation of *pylong*. *pylong* must be an " "instance of :c:type:`PyLongObject`." msgstr "" -#: ../../c-api/long.rst:417 +#: ../../c-api/long.rst:428 msgid "" "Raise :exc:`OverflowError` if the value of *pylong* is out of range for a :c:" "expr:`double`." msgstr "" -#: ../../c-api/long.rst:420 +#: ../../c-api/long.rst:431 msgid "" "Returns ``-1.0`` on error. Use :c:func:`PyErr_Occurred` to disambiguate." msgstr "" -#: ../../c-api/long.rst:425 +#: ../../c-api/long.rst:436 msgid "" "Convert a Python integer *pylong* to a C :c:expr:`void` pointer. If *pylong* " "cannot be converted, an :exc:`OverflowError` will be raised. This is only " @@ -424,33 +434,33 @@ msgid "" "c:func:`PyLong_FromVoidPtr`." msgstr "" -#: ../../c-api/long.rst:430 +#: ../../c-api/long.rst:441 msgid "" "Returns ``NULL`` on error. Use :c:func:`PyErr_Occurred` to disambiguate." msgstr "" -#: ../../c-api/long.rst:435 +#: ../../c-api/long.rst:446 msgid "" "Copy the Python integer value *pylong* to a native *buffer* of size " "*n_bytes*. The *flags* can be set to ``-1`` to behave similarly to a C cast, " "or to values documented below to control the behavior." msgstr "" -#: ../../c-api/long.rst:439 +#: ../../c-api/long.rst:450 msgid "" "Returns ``-1`` with an exception raised on error. This may happen if " "*pylong* cannot be interpreted as an integer, or if *pylong* was negative " "and the ``Py_ASNATIVEBYTES_REJECT_NEGATIVE`` flag was set." msgstr "" -#: ../../c-api/long.rst:443 +#: ../../c-api/long.rst:454 msgid "" "Otherwise, returns the number of bytes required to store the value. If this " "is equal to or less than *n_bytes*, the entire value was copied. All " "*n_bytes* of the buffer are written: large buffers are padded with zeroes." msgstr "" -#: ../../c-api/long.rst:448 +#: ../../c-api/long.rst:459 msgid "" "If the returned value is greater than *n_bytes*, the value was truncated: as " "many of the lowest bits of the value as could fit are written, and the " @@ -458,25 +468,25 @@ msgid "" "downcast." msgstr "" -#: ../../c-api/long.rst:455 +#: ../../c-api/long.rst:466 msgid "" "Overflow is not considered an error. If the returned value is larger than " "*n_bytes*, most significant bits were discarded." msgstr "" -#: ../../c-api/long.rst:458 +#: ../../c-api/long.rst:469 msgid "``0`` will never be returned." msgstr "``0`` 將永不被回傳。" -#: ../../c-api/long.rst:460 +#: ../../c-api/long.rst:471 msgid "Values are always copied as two's-complement." msgstr "" -#: ../../c-api/long.rst:462 +#: ../../c-api/long.rst:473 msgid "Usage example::" msgstr "使用範例: ::" -#: ../../c-api/long.rst:464 +#: ../../c-api/long.rst:475 msgid "" "int32_t value;\n" "Py_ssize_t bytes = PyLong_AsNativeBytes(pylong, &value, sizeof(value), -1);\n" @@ -493,26 +503,26 @@ msgid "" "}" msgstr "" -#: ../../c-api/long.rst:478 +#: ../../c-api/long.rst:489 msgid "" "Passing zero to *n_bytes* will return the size of a buffer that would be " "large enough to hold the value. This may be larger than technically " "necessary, but not unreasonably so. If *n_bytes=0*, *buffer* may be ``NULL``." msgstr "" -#: ../../c-api/long.rst:485 +#: ../../c-api/long.rst:496 msgid "" "Passing *n_bytes=0* to this function is not an accurate way to determine the " "bit length of the value." msgstr "" -#: ../../c-api/long.rst:488 +#: ../../c-api/long.rst:499 msgid "" "To get at the entire Python value of an unknown size, the function can be " "called twice: first to determine the buffer size, then to fill it::" msgstr "" -#: ../../c-api/long.rst:491 +#: ../../c-api/long.rst:502 msgid "" "// Ask how much space we need.\n" "Py_ssize_t expected = PyLong_AsNativeBytes(pylong, NULL, 0, -1);\n" @@ -543,69 +553,69 @@ msgid "" "free(bignum);" msgstr "" -#: ../../c-api/long.rst:519 +#: ../../c-api/long.rst:530 msgid "" "*flags* is either ``-1`` (``Py_ASNATIVEBYTES_DEFAULTS``) to select defaults " "that behave most like a C cast, or a combination of the other flags in the " "table below. Note that ``-1`` cannot be combined with other flags." msgstr "" -#: ../../c-api/long.rst:524 +#: ../../c-api/long.rst:535 msgid "" "Currently, ``-1`` corresponds to ``Py_ASNATIVEBYTES_NATIVE_ENDIAN | " "Py_ASNATIVEBYTES_UNSIGNED_BUFFER``." msgstr "" -#: ../../c-api/long.rst:530 +#: ../../c-api/long.rst:541 msgid "Flag" msgstr "旗標" -#: ../../c-api/long.rst:530 +#: ../../c-api/long.rst:541 msgid "Value" msgstr "數值" -#: ../../c-api/long.rst:532 +#: ../../c-api/long.rst:543 msgid "``-1``" msgstr "``-1``" -#: ../../c-api/long.rst:533 +#: ../../c-api/long.rst:544 msgid "``0``" msgstr "``0``" -#: ../../c-api/long.rst:534 +#: ../../c-api/long.rst:545 msgid "``1``" msgstr "``1``" -#: ../../c-api/long.rst:535 +#: ../../c-api/long.rst:546 msgid "``3``" msgstr "``3``" -#: ../../c-api/long.rst:536 +#: ../../c-api/long.rst:547 msgid "``4``" msgstr "``4``" -#: ../../c-api/long.rst:537 +#: ../../c-api/long.rst:548 msgid "``8``" msgstr "``8``" -#: ../../c-api/long.rst:538 +#: ../../c-api/long.rst:549 msgid "``16``" msgstr "``16``" -#: ../../c-api/long.rst:541 +#: ../../c-api/long.rst:552 msgid "" "Specifying ``Py_ASNATIVEBYTES_NATIVE_ENDIAN`` will override any other endian " "flags. Passing ``2`` is reserved." msgstr "" -#: ../../c-api/long.rst:544 +#: ../../c-api/long.rst:555 msgid "" "By default, sufficient buffer will be requested to include a sign bit. For " "example, when converting 128 with *n_bytes=1*, the function will return 2 " "(or more) in order to store a zero sign bit." msgstr "" -#: ../../c-api/long.rst:548 +#: ../../c-api/long.rst:559 msgid "" "If ``Py_ASNATIVEBYTES_UNSIGNED_BUFFER`` is specified, a zero sign bit will " "be omitted from size calculations. This allows, for example, 128 to fit in a " @@ -615,7 +625,7 @@ msgid "" "requested." msgstr "" -#: ../../c-api/long.rst:555 +#: ../../c-api/long.rst:566 msgid "" "Specifying ``Py_ASNATIVEBYTES_REJECT_NEGATIVE`` causes an exception to be " "set if *pylong* is negative. Without this flag, negative values will be " @@ -623,7 +633,7 @@ msgid "" "of whether ``Py_ASNATIVEBYTES_UNSIGNED_BUFFER`` was specified." msgstr "" -#: ../../c-api/long.rst:560 +#: ../../c-api/long.rst:571 msgid "" "If ``Py_ASNATIVEBYTES_ALLOW_INDEX`` is specified and a non-integer value is " "passed, its :meth:`~object.__index__` method will be called first. This may " @@ -633,7 +643,7 @@ msgid "" "`TypeError`." msgstr "" -#: ../../c-api/long.rst:569 +#: ../../c-api/long.rst:580 msgid "" "With the default *flags* (``-1``, or *UNSIGNED_BUFFER* without " "*REJECT_NEGATIVE*), multiple Python integers can map to a single value " @@ -641,71 +651,82 @@ msgid "" "buffer and set all its bits. This matches typical C cast behavior." msgstr "" -#: ../../c-api/long.rst:580 +#: ../../c-api/long.rst:591 +msgid "Macro for converting a Python integer into a process identifier." +msgstr "" + +#: ../../c-api/long.rst:593 +msgid "" +"This can be defined as an alias to :c:func:`PyLong_AsLong`, :c:func:" +"`PyLong_FromLongLong`, or :c:func:`PyLong_AsInt`, depending on the size of " +"the system's PID type." +msgstr "" + +#: ../../c-api/long.rst:602 msgid "Get the sign of the integer object *obj*." msgstr "" -#: ../../c-api/long.rst:582 +#: ../../c-api/long.rst:604 msgid "" "On success, set *\\*sign* to the integer sign (0, -1 or +1 for zero, " "negative or positive integer, respectively) and return 0." msgstr "" -#: ../../c-api/long.rst:585 +#: ../../c-api/long.rst:607 msgid "" "On failure, return -1 with an exception set. This function always succeeds " "if *obj* is a :c:type:`PyLongObject` or its subtype." msgstr "" -#: ../../c-api/long.rst:593 +#: ../../c-api/long.rst:615 msgid "Check if the integer object *obj* is positive (``obj > 0``)." msgstr "" -#: ../../c-api/long.rst:595 +#: ../../c-api/long.rst:617 msgid "" "If *obj* is an instance of :c:type:`PyLongObject` or its subtype, return " "``1`` when it's positive and ``0`` otherwise. Else set an exception and " "return ``-1``." msgstr "" -#: ../../c-api/long.rst:604 +#: ../../c-api/long.rst:626 msgid "Check if the integer object *obj* is negative (``obj < 0``)." msgstr "" -#: ../../c-api/long.rst:606 +#: ../../c-api/long.rst:628 msgid "" "If *obj* is an instance of :c:type:`PyLongObject` or its subtype, return " "``1`` when it's negative and ``0`` otherwise. Else set an exception and " "return ``-1``." msgstr "" -#: ../../c-api/long.rst:615 +#: ../../c-api/long.rst:637 msgid "Check if the integer object *obj* is zero." msgstr "" -#: ../../c-api/long.rst:617 +#: ../../c-api/long.rst:639 msgid "" "If *obj* is an instance of :c:type:`PyLongObject` or its subtype, return " "``1`` when it's zero and ``0`` otherwise. Else set an exception and return " "``-1``." msgstr "" -#: ../../c-api/long.rst:626 +#: ../../c-api/long.rst:648 msgid "" "On success, return a read only :term:`named tuple`, that holds information " "about Python's internal representation of integers. See :data:`sys.int_info` " "for description of individual fields." msgstr "" -#: ../../c-api/long.rst:630 +#: ../../c-api/long.rst:652 msgid "On failure, return ``NULL`` with an exception set." msgstr "在失敗時,會回傳 ``NULL`` 並設定例外。" -#: ../../c-api/long.rst:637 +#: ../../c-api/long.rst:659 msgid "Return 1 if *op* is compact, 0 otherwise." msgstr "" -#: ../../c-api/long.rst:639 +#: ../../c-api/long.rst:661 msgid "" "This function makes it possible for performance-critical code to implement a " "“fast path” for small integers. For compact values use :c:func:" @@ -713,93 +734,93 @@ msgid "" "`PyLong_As* ` function or :c:func:`PyLong_AsNativeBytes`." msgstr "" -#: ../../c-api/long.rst:645 +#: ../../c-api/long.rst:667 msgid "The speedup is expected to be negligible for most users." msgstr "" -#: ../../c-api/long.rst:647 +#: ../../c-api/long.rst:669 msgid "" "Exactly what values are considered compact is an implementation detail and " "is subject to change." msgstr "" -#: ../../c-api/long.rst:655 +#: ../../c-api/long.rst:677 msgid "" "If *op* is compact, as determined by :c:func:`PyUnstable_Long_IsCompact`, " "return its value." msgstr "" -#: ../../c-api/long.rst:658 +#: ../../c-api/long.rst:680 msgid "Otherwise, the return value is undefined." msgstr "" -#: ../../c-api/long.rst:664 +#: ../../c-api/long.rst:686 msgid "Export API" msgstr "" -#: ../../c-api/long.rst:670 +#: ../../c-api/long.rst:692 msgid "" "Layout of an array of \"digits\" (\"limbs\" in the GMP terminology), used to " "represent absolute value for arbitrary precision integers." msgstr "" -#: ../../c-api/long.rst:673 +#: ../../c-api/long.rst:695 msgid "" "Use :c:func:`PyLong_GetNativeLayout` to get the native layout of Python :" "class:`int` objects, used internally for integers with \"big enough\" " "absolute value." msgstr "" -#: ../../c-api/long.rst:677 +#: ../../c-api/long.rst:699 msgid "" "See also :data:`sys.int_info` which exposes similar information in Python." msgstr "" -#: ../../c-api/long.rst:681 +#: ../../c-api/long.rst:703 msgid "" "Bits per digit. For example, a 15 bit digit means that bits 0-14 contain " "meaningful information." msgstr "" -#: ../../c-api/long.rst:686 +#: ../../c-api/long.rst:708 msgid "" "Digit size in bytes. For example, a 15 bit digit will require at least 2 " "bytes." msgstr "" -#: ../../c-api/long.rst:691 +#: ../../c-api/long.rst:713 msgid "Digits order:" msgstr "" -#: ../../c-api/long.rst:693 +#: ../../c-api/long.rst:715 msgid "``1`` for most significant digit first" msgstr "" -#: ../../c-api/long.rst:694 +#: ../../c-api/long.rst:716 msgid "``-1`` for least significant digit first" msgstr "" -#: ../../c-api/long.rst:698 +#: ../../c-api/long.rst:720 msgid "Digit endianness:" msgstr "" -#: ../../c-api/long.rst:700 +#: ../../c-api/long.rst:722 msgid "``1`` for most significant byte first (big endian)" msgstr "" -#: ../../c-api/long.rst:701 +#: ../../c-api/long.rst:723 msgid "``-1`` for least significant byte first (little endian)" msgstr "" -#: ../../c-api/long.rst:706 +#: ../../c-api/long.rst:728 msgid "Get the native layout of Python :class:`int` objects." msgstr "" -#: ../../c-api/long.rst:708 +#: ../../c-api/long.rst:730 msgid "See the :c:struct:`PyLongLayout` structure." msgstr "" -#: ../../c-api/long.rst:710 +#: ../../c-api/long.rst:732 msgid "" "The function must not be called before Python initialization nor after " "Python finalization. The returned layout is valid until Python is finalized. " @@ -807,128 +828,128 @@ msgid "" "it can be cached." msgstr "" -#: ../../c-api/long.rst:718 +#: ../../c-api/long.rst:740 msgid "Export of a Python :class:`int` object." msgstr "" -#: ../../c-api/long.rst:720 +#: ../../c-api/long.rst:742 msgid "There are two cases:" msgstr "" -#: ../../c-api/long.rst:722 +#: ../../c-api/long.rst:744 msgid "" "If :c:member:`digits` is ``NULL``, only use the :c:member:`value` member." msgstr "" -#: ../../c-api/long.rst:723 +#: ../../c-api/long.rst:745 msgid "" "If :c:member:`digits` is not ``NULL``, use :c:member:`negative`, :c:member:" "`ndigits` and :c:member:`digits` members." msgstr "" -#: ../../c-api/long.rst:728 +#: ../../c-api/long.rst:750 msgid "" "The native integer value of the exported :class:`int` object. Only valid if :" "c:member:`digits` is ``NULL``." msgstr "" -#: ../../c-api/long.rst:733 +#: ../../c-api/long.rst:755 msgid "" "``1`` if the number is negative, ``0`` otherwise. Only valid if :c:member:" "`digits` is not ``NULL``." msgstr "" -#: ../../c-api/long.rst:738 +#: ../../c-api/long.rst:760 msgid "" "Number of digits in :c:member:`digits` array. Only valid if :c:member:" "`digits` is not ``NULL``." msgstr "" -#: ../../c-api/long.rst:743 +#: ../../c-api/long.rst:765 msgid "Read-only array of unsigned digits. Can be ``NULL``." msgstr "" -#: ../../c-api/long.rst:748 +#: ../../c-api/long.rst:770 msgid "Export a Python :class:`int` object." msgstr "" -#: ../../c-api/long.rst:750 +#: ../../c-api/long.rst:772 msgid "" "*export_long* must point to a :c:struct:`PyLongExport` structure allocated " "by the caller. It must not be ``NULL``." msgstr "" -#: ../../c-api/long.rst:753 +#: ../../c-api/long.rst:775 msgid "" "On success, fill in *\\*export_long* and return ``0``. On error, set an " "exception and return ``-1``." msgstr "" -#: ../../c-api/long.rst:756 +#: ../../c-api/long.rst:778 msgid "" ":c:func:`PyLong_FreeExport` must be called when the export is no longer " "needed." msgstr "" -#: ../../c-api/long.rst:760 +#: ../../c-api/long.rst:782 msgid "" "This function always succeeds if *obj* is a Python :class:`int` object or a " "subclass." msgstr "" -#: ../../c-api/long.rst:766 +#: ../../c-api/long.rst:788 msgid "Release the export *export_long* created by :c:func:`PyLong_Export`." msgstr "" -#: ../../c-api/long.rst:769 +#: ../../c-api/long.rst:791 msgid "" "Calling :c:func:`PyLong_FreeExport` is optional if *export_long->digits* is " "``NULL``." msgstr "" -#: ../../c-api/long.rst:774 +#: ../../c-api/long.rst:796 msgid "PyLongWriter API" msgstr "" -#: ../../c-api/long.rst:776 +#: ../../c-api/long.rst:798 msgid "The :c:type:`PyLongWriter` API can be used to import an integer." msgstr "" -#: ../../c-api/long.rst:782 +#: ../../c-api/long.rst:804 msgid "A Python :class:`int` writer instance." msgstr "" -#: ../../c-api/long.rst:784 +#: ../../c-api/long.rst:806 msgid "" "The instance must be destroyed by :c:func:`PyLongWriter_Finish` or :c:func:" "`PyLongWriter_Discard`." msgstr "" -#: ../../c-api/long.rst:790 +#: ../../c-api/long.rst:812 msgid "Create a :c:type:`PyLongWriter`." msgstr "" -#: ../../c-api/long.rst:792 +#: ../../c-api/long.rst:814 msgid "" "On success, allocate *\\*digits* and return a writer. On error, set an " "exception and return ``NULL``." msgstr "" -#: ../../c-api/long.rst:795 +#: ../../c-api/long.rst:817 msgid "*negative* is ``1`` if the number is negative, or ``0`` otherwise." msgstr "" -#: ../../c-api/long.rst:797 +#: ../../c-api/long.rst:819 msgid "" "*ndigits* is the number of digits in the *digits* array. It must be greater " "than 0." msgstr "" -#: ../../c-api/long.rst:800 +#: ../../c-api/long.rst:822 msgid "*digits* must not be NULL." msgstr "" -#: ../../c-api/long.rst:802 +#: ../../c-api/long.rst:824 msgid "" "After a successful call to this function, the caller should fill in the " "array of digits *digits* and then call :c:func:`PyLongWriter_Finish` to get " @@ -936,46 +957,46 @@ msgid "" "`PyLong_GetNativeLayout`." msgstr "" -#: ../../c-api/long.rst:807 +#: ../../c-api/long.rst:829 msgid "" "Digits must be in the range [``0``; ``(1 << bits_per_digit) - 1``] (where " "the :c:struct:`~PyLongLayout.bits_per_digit` is the number of bits per " "digit). Any unused most significant digits must be set to ``0``." msgstr "" -#: ../../c-api/long.rst:812 +#: ../../c-api/long.rst:834 msgid "" "Alternately, call :c:func:`PyLongWriter_Discard` to destroy the writer " "instance without creating an :class:`~int` object." msgstr "" -#: ../../c-api/long.rst:818 +#: ../../c-api/long.rst:840 msgid "" "Finish a :c:type:`PyLongWriter` created by :c:func:`PyLongWriter_Create`." msgstr "" -#: ../../c-api/long.rst:820 +#: ../../c-api/long.rst:842 msgid "" "On success, return a Python :class:`int` object. On error, set an exception " "and return ``NULL``." msgstr "" -#: ../../c-api/long.rst:823 +#: ../../c-api/long.rst:845 msgid "" "The function takes care of normalizing the digits and converts the object to " "a compact integer if needed." msgstr "" -#: ../../c-api/long.rst:826 ../../c-api/long.rst:835 +#: ../../c-api/long.rst:848 ../../c-api/long.rst:857 msgid "The writer instance and the *digits* array are invalid after the call." msgstr "" -#: ../../c-api/long.rst:831 +#: ../../c-api/long.rst:853 msgid "" "Discard a :c:type:`PyLongWriter` created by :c:func:`PyLongWriter_Create`." msgstr "" -#: ../../c-api/long.rst:833 +#: ../../c-api/long.rst:855 msgid "If *writer* is ``NULL``, no operation is performed." msgstr "" @@ -991,23 +1012,23 @@ msgstr "long integer(長整數)" msgid "integer" msgstr "integer(整數)" -#: ../../c-api/long.rst:166 +#: ../../c-api/long.rst:177 msgid "LONG_MAX (C macro)" msgstr "LONG_MAX(C 巨集)" -#: ../../c-api/long.rst:166 ../../c-api/long.rst:226 ../../c-api/long.rst:269 -#: ../../c-api/long.rst:284 ../../c-api/long.rst:300 ../../c-api/long.rst:316 +#: ../../c-api/long.rst:177 ../../c-api/long.rst:237 ../../c-api/long.rst:280 +#: ../../c-api/long.rst:295 ../../c-api/long.rst:311 ../../c-api/long.rst:327 msgid "OverflowError (built-in exception)" msgstr "OverflowError(內建例外)" -#: ../../c-api/long.rst:269 +#: ../../c-api/long.rst:280 msgid "PY_SSIZE_T_MAX (C macro)" msgstr "PY_SSIZE_T_MAX(C 巨集)" -#: ../../c-api/long.rst:284 +#: ../../c-api/long.rst:295 msgid "ULONG_MAX (C macro)" msgstr "ULONG_MAX(C 巨集)" -#: ../../c-api/long.rst:300 +#: ../../c-api/long.rst:311 msgid "SIZE_MAX (C macro)" msgstr "SIZE_MAX(C 巨集)" diff --git a/c-api/mapping.po b/c-api/mapping.po index 819cc04b26..1be66dc2c0 100644 --- a/c-api/mapping.po +++ b/c-api/mapping.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-23 07:52+0800\n" +"POT-Creation-Date: 2025-11-05 00:16+0000\n" "PO-Revision-Date: 2024-05-11 14:32+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -80,8 +80,8 @@ msgid "" "specified as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than " "a :c:expr:`PyObject*`." msgstr "" -"這與 :c:func:`PyMapping_GetOptionalItem` 相同,但 *key* 被指定為 :c:expr:`const " -"char*` UTF-8 編碼位元組字串,而不是 :c:expr:`PyObject*`。" +"這與 :c:func:`PyMapping_GetOptionalItem` 相同,但 *key* 被指定為 :c:expr:" +"`const char*` UTF-8 編碼位元組字串,而不是 :c:expr:`PyObject*`。" #: ../../c-api/mapping.rst:62 msgid "" @@ -120,8 +120,8 @@ msgid "" "specified as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than " "a :c:expr:`PyObject*`." msgstr "" -"這與 :c:func:`PyMapping_HasKeyWithError` 相同,但 *key* 被指定為 :c:expr:`const " -"char*` UTF-8 編碼位元組字串,而不是 :c:expr:`PyObject*`。" +"這與 :c:func:`PyMapping_HasKeyWithError` 相同,但 *key* 被指定為 :c:expr:" +"`const char*` UTF-8 編碼位元組字串,而不是 :c:expr:`PyObject*`。" #: ../../c-api/mapping.rst:99 msgid "" @@ -134,14 +134,14 @@ msgstr "" #: ../../c-api/mapping.rst:105 msgid "" -"Exceptions which occur when this calls :meth:`~object.__getitem__` method " -"are silently ignored. For proper error handling, use :c:func:" +"Exceptions which occur when this calls the :meth:`~object.__getitem__` " +"method are silently ignored. For proper error handling, use :c:func:" "`PyMapping_HasKeyWithError`, :c:func:`PyMapping_GetOptionalItem` or :c:func:" "`PyObject_GetItem()` instead." msgstr "" "當它呼叫 :meth:`~object.__getitem__` 方法時發生的例外將被默默忽略。為了適當地" -"處理錯誤,請改用 :c:func:`PyMapping_HasKeyWithError`、" -":c:func:`PyMapping_GetOptionalItem` 或 :c:func:`PyObject_GetItem()`。" +"處理錯誤,請改用 :c:func:`PyMapping_HasKeyWithError`、:c:func:" +"`PyMapping_GetOptionalItem` 或 :c:func:`PyObject_GetItem()`。" #: ../../c-api/mapping.rst:113 msgid "" @@ -154,15 +154,16 @@ msgstr "" #: ../../c-api/mapping.rst:119 msgid "" -"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_HasKeyStringWithError`, :c:" +"Exceptions that occur when this calls the :meth:`~object.__getitem__` method " +"or while creating the temporary :class:`str` object are silently ignored. " +"For proper error handling, use :c:func:`PyMapping_HasKeyStringWithError`, :c:" "func:`PyMapping_GetOptionalItemString` or :c:func:`PyMapping_GetItemString` " "instead." msgstr "" "當它呼叫 :meth:`~object.__getitem__` 方法或建立臨時 :class:`str` 物件時發生的" -"例外將被默默忽略。為了適當地處理錯誤,請改用 :c:func:`PyMapping_HasKeyStringWithError`、" -":c:func:`PyMapping_GetOptionalItemString` 或 :c:func:`PyMapping_GetItemString`。" +"例外將被默默忽略。為了適當地處理錯誤,請改用 :c:func:" +"`PyMapping_HasKeyStringWithError`、:c:func:`PyMapping_GetOptionalItemString` " +"或 :c:func:`PyMapping_GetItemString`。" #: ../../c-api/mapping.rst:129 msgid "" diff --git a/c-api/marshal.po b/c-api/marshal.po index 60485dbc0a..41698940f0 100644 --- a/c-api/marshal.po +++ b/c-api/marshal.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-11-05 00:16+0000\n" "PO-Revision-Date: 2025-06-28 02:44+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -42,8 +42,8 @@ msgstr "數值會以最低有效位元組 (the least significant byte) 優先的 #: ../../c-api/marshal.rst:16 msgid "" -"The module supports several versions of the data format; see " -"the :py:mod:`Python module documentation ` for details." +"The module supports several versions of the data format; see the :py:mod:" +"`Python module documentation ` for details." msgstr "" #: ../../c-api/marshal.rst:21 @@ -62,8 +62,8 @@ msgstr "" #: ../../c-api/marshal.rst:29 ../../c-api/marshal.rst:37 msgid "" -"This function can fail, in which case it sets the error indicator. " -"Use :c:func:`PyErr_Occurred` to check for that." +"This function can fail, in which case it sets the error indicator. Use :c:" +"func:`PyErr_Occurred` to check for that." msgstr "" "這個函式可能會失敗,這時會設定錯誤指示器。使用 :c:func:`PyErr_Occurred` 來檢" "查是否發生錯誤。" @@ -123,8 +123,8 @@ msgid "" "On error, sets the appropriate exception (:exc:`EOFError`, :exc:`ValueError` " "or :exc:`TypeError`) and returns ``NULL``." msgstr "" -"在錯誤發生時,會設定合適的例外(:exc:`EOFError`、:exc:`ValueError` " -"或 :exc:`TypeError`)並回傳 ``NULL``。" +"在錯誤發生時,會設定合適的例外(:exc:`EOFError`、:exc:`ValueError` 或 :exc:" +"`TypeError`)並回傳 ``NULL``。" #: ../../c-api/marshal.rst:80 msgid "" @@ -133,14 +133,14 @@ msgid "" "assumes that no further objects will be read from the file, allowing it to " "aggressively load file data into memory so that the de-serialization can " "operate from data in memory rather than reading a byte at a time from the " -"file. Only use these variant if you are certain that you won't be reading " +"file. Only use this variant if you are certain that you won't be reading " "anything else from the file." msgstr "" -"從一個為讀取而開啟的 :c:expr:`FILE*` 中的資料串流回傳一個 Python 物件。" -"與 :c:func:`PyMarshal_ReadObjectFromFile` 不同,這個函式假設不會從檔案中讀取" -"其他物件,允許它積極地將檔案資料載入記憶體,以便反序列化可以從記憶體中的資料" -"操作,而不是從檔案中逐位元組讀取。只有在確定不會從檔案中讀取其他內容時,才使" -"用這個變體。" +"從一個為讀取而開啟的 :c:expr:`FILE*` 中的資料串流回傳一個 Python 物件。與 :c:" +"func:`PyMarshal_ReadObjectFromFile` 不同,這個函式假設不會從檔案中讀取其他物" +"件,允許它積極地將檔案資料載入記憶體,以便反序列化可以從記憶體中的資料操作," +"而不是從檔案中逐位元組讀取。只有在確定不會從檔案中讀取其他內容時,才使用這個" +"變體。" #: ../../c-api/marshal.rst:94 msgid "" diff --git a/c-api/memory.po b/c-api/memory.po index d19ecbf292..a5631a2f0c 100644 --- a/c-api/memory.po +++ b/c-api/memory.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-11-05 00:16+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-" @@ -62,14 +62,13 @@ msgstr "" #: ../../c-api/memory.rst:49 msgid "" "To avoid memory corruption, extension writers should never try to operate on " -"Python objects with the functions exported by the C " -"library: :c:func:`malloc`, :c:func:`calloc`, :c:func:`realloc` " -"and :c:func:`free`. This will result in mixed calls between the C " -"allocator and the Python memory manager with fatal consequences, because " -"they implement different algorithms and operate on different heaps. " -"However, one may safely allocate and release memory blocks with the C " -"library allocator for individual purposes, as shown in the following " -"example::" +"Python objects with the functions exported by the C library: :c:func:" +"`malloc`, :c:func:`calloc`, :c:func:`realloc` and :c:func:`free`. This will " +"result in mixed calls between the C allocator and the Python memory manager " +"with fatal consequences, because they implement different algorithms and " +"operate on different heaps. However, one may safely allocate and release " +"memory blocks with the C library allocator for individual purposes, as shown " +"in the following example::" msgstr "" #: ../../c-api/memory.rst:58 @@ -134,8 +133,8 @@ msgid "" "allocation strategies and are optimized for different purposes. The specific " "details on how every domain allocates memory or what internal functions each " "domain calls is considered an implementation detail, but for debugging " -"purposes a simplified table can be found at :ref:`here `. The APIs used to allocate and free a block of memory must be " +"purposes a simplified table can be found at :ref:`default-memory-" +"allocators`. The APIs used to allocate and free a block of memory must be " "from the same domain. For example, :c:func:`PyMem_Free` must be used to free " "memory allocated using :c:func:`PyMem_Malloc`." msgstr "" @@ -178,9 +177,9 @@ msgstr "" #: ../../c-api/memory.rst:130 msgid "" -"For example, buffers (non-Python objects) should be allocated " -"using :c:func:`PyMem_Malloc`, :c:func:`PyMem_RawMalloc`, " -"or :c:func:`malloc`, but not :c:func:`PyObject_Malloc`." +"For example, buffers (non-Python objects) should be allocated using :c:func:" +"`PyMem_Malloc`, :c:func:`PyMem_RawMalloc`, or :c:func:`malloc`, but not :c:" +"func:`PyObject_Malloc`." msgstr "" #: ../../c-api/memory.rst:133 @@ -194,8 +193,8 @@ msgstr "" #: ../../c-api/memory.rst:141 msgid "" "The following function sets are wrappers to the system allocator. These " -"functions are thread-safe, so a :term:`thread state` does not need to " -"be :term:`attached `." +"functions are thread-safe, so a :term:`thread state` does not need to be :" +"term:`attached `." msgstr "" #: ../../c-api/memory.rst:145 @@ -251,9 +250,9 @@ msgstr "" #: ../../c-api/memory.rst:184 msgid "" -"Unless *p* is ``NULL``, it must have been returned by a previous call " -"to :c:func:`PyMem_RawMalloc`, :c:func:`PyMem_RawRealloc` " -"or :c:func:`PyMem_RawCalloc`." +"Unless *p* is ``NULL``, it must have been returned by a previous call to :c:" +"func:`PyMem_RawMalloc`, :c:func:`PyMem_RawRealloc` or :c:func:" +"`PyMem_RawCalloc`." msgstr "" #: ../../c-api/memory.rst:188 @@ -265,9 +264,9 @@ msgstr "" #: ../../c-api/memory.rst:194 msgid "" "Frees the memory block pointed to by *p*, which must have been returned by a " -"previous call to :c:func:`PyMem_RawMalloc`, :c:func:`PyMem_RawRealloc` " -"or :c:func:`PyMem_RawCalloc`. Otherwise, or if ``PyMem_RawFree(p)`` has " -"been called before, undefined behavior occurs." +"previous call to :c:func:`PyMem_RawMalloc`, :c:func:`PyMem_RawRealloc` or :c:" +"func:`PyMem_RawCalloc`. Otherwise, or if ``PyMem_RawFree(p)`` has been " +"called before, undefined behavior occurs." msgstr "" #: ../../c-api/memory.rst:199 ../../c-api/memory.rst:268 @@ -288,8 +287,8 @@ msgstr "" #: ../../c-api/memory.rst:211 msgid "" -"The :ref:`default memory allocator ` uses " -"the :ref:`pymalloc memory allocator `." +"The :ref:`default memory allocator ` uses the :" +"ref:`pymalloc memory allocator `." msgstr "" #: ../../c-api/memory.rst:216 ../../c-api/memory.rst:329 @@ -325,8 +324,8 @@ msgstr "" #: ../../c-api/memory.rst:254 msgid "" -"Unless *p* is ``NULL``, it must have been returned by a previous call " -"to :c:func:`PyMem_Malloc`, :c:func:`PyMem_Realloc` or :c:func:`PyMem_Calloc`." +"Unless *p* is ``NULL``, it must have been returned by a previous call to :c:" +"func:`PyMem_Malloc`, :c:func:`PyMem_Realloc` or :c:func:`PyMem_Calloc`." msgstr "" #: ../../c-api/memory.rst:257 @@ -338,9 +337,9 @@ msgstr "" #: ../../c-api/memory.rst:263 msgid "" "Frees the memory block pointed to by *p*, which must have been returned by a " -"previous call to :c:func:`PyMem_Malloc`, :c:func:`PyMem_Realloc` " -"or :c:func:`PyMem_Calloc`. Otherwise, or if ``PyMem_Free(p)`` has been " -"called before, undefined behavior occurs." +"previous call to :c:func:`PyMem_Malloc`, :c:func:`PyMem_Realloc` or :c:func:" +"`PyMem_Calloc`. Otherwise, or if ``PyMem_Free(p)`` has been called before, " +"undefined behavior occurs." msgstr "" #: ../../c-api/memory.rst:270 @@ -420,8 +419,8 @@ msgstr "" #: ../../c-api/memory.rst:324 msgid "" -"The :ref:`default object allocator ` uses " -"the :ref:`pymalloc memory allocator `." +"The :ref:`default object allocator ` uses the :" +"ref:`pymalloc memory allocator `." msgstr "" #: ../../c-api/memory.rst:336 @@ -447,9 +446,9 @@ msgstr "" #: ../../c-api/memory.rst:363 msgid "" -"Unless *p* is ``NULL``, it must have been returned by a previous call " -"to :c:func:`PyObject_Malloc`, :c:func:`PyObject_Realloc` " -"or :c:func:`PyObject_Calloc`." +"Unless *p* is ``NULL``, it must have been returned by a previous call to :c:" +"func:`PyObject_Malloc`, :c:func:`PyObject_Realloc` or :c:func:" +"`PyObject_Calloc`." msgstr "" #: ../../c-api/memory.rst:366 @@ -461,21 +460,21 @@ msgstr "" #: ../../c-api/memory.rst:372 msgid "" "Frees the memory block pointed to by *p*, which must have been returned by a " -"previous call to :c:func:`PyObject_Malloc`, :c:func:`PyObject_Realloc` " -"or :c:func:`PyObject_Calloc`. Otherwise, or if ``PyObject_Free(p)`` has " -"been called before, undefined behavior occurs." +"previous call to :c:func:`PyObject_Malloc`, :c:func:`PyObject_Realloc` or :c:" +"func:`PyObject_Calloc`. Otherwise, or if ``PyObject_Free(p)`` has been " +"called before, undefined behavior occurs." msgstr "" #: ../../c-api/memory.rst:379 msgid "" -"Do not call this directly to free an object's memory; call the " -"type's :c:member:`~PyTypeObject.tp_free` slot instead." +"Do not call this directly to free an object's memory; call the type's :c:" +"member:`~PyTypeObject.tp_free` slot instead." msgstr "" #: ../../c-api/memory.rst:382 msgid "" -"Do not use this for memory allocated by :c:macro:`PyObject_GC_New` " -"or :c:macro:`PyObject_GC_NewVar`; use :c:func:`PyObject_GC_Del` instead." +"Do not use this for memory allocated by :c:macro:`PyObject_GC_New` or :c:" +"macro:`PyObject_GC_NewVar`; use :c:func:`PyObject_GC_Del` instead." msgstr "" #: ../../c-api/memory.rst:387 @@ -598,9 +597,8 @@ msgstr "" #: ../../c-api/memory.rst:417 msgid "" -"``malloc``: system allocators from the standard C library, C " -"functions: :c:func:`malloc`, :c:func:`calloc`, :c:func:`realloc` " -"and :c:func:`free`." +"``malloc``: system allocators from the standard C library, C functions: :c:" +"func:`malloc`, :c:func:`calloc`, :c:func:`realloc` and :c:func:`free`." msgstr "" #: ../../c-api/memory.rst:419 @@ -683,8 +681,8 @@ msgstr "" #: ../../c-api/memory.rst:453 msgid "" -"The :c:type:`!PyMemAllocator` structure was renamed " -"to :c:type:`PyMemAllocatorEx` and a new ``calloc`` field was added." +"The :c:type:`!PyMemAllocator` structure was renamed to :c:type:" +"`PyMemAllocatorEx` and a new ``calloc`` field was added." msgstr "" #: ../../c-api/memory.rst:460 @@ -756,8 +754,8 @@ msgstr "" #: ../../c-api/memory.rst:507 msgid "" "For the remaining domains, the allocator must also be thread-safe: the " -"allocator may be called in different interpreters that do not share " -"a :term:`GIL`." +"allocator may be called in different interpreters that do not share a :term:" +"`GIL`." msgstr "" #: ../../c-api/memory.rst:511 @@ -779,21 +777,20 @@ msgstr "" #: ../../c-api/memory.rst:522 msgid "" -"It can be called after :c:func:`Py_PreInitialize` and " -"before :c:func:`Py_InitializeFromConfig` to install a custom memory " -"allocator. There are no restrictions over the installed allocator other than " -"the ones imposed by the domain (for instance, the Raw Domain allows the " -"allocator to be called without an :term:`attached thread state`). " -"See :ref:`the section on allocator domains ` for more " -"information." +"It can be called after :c:func:`Py_PreInitialize` and before :c:func:" +"`Py_InitializeFromConfig` to install a custom memory allocator. There are no " +"restrictions over the installed allocator other than the ones imposed by the " +"domain (for instance, the Raw Domain allows the allocator to be called " +"without an :term:`attached thread state`). See :ref:`the section on " +"allocator domains ` for more information." msgstr "" #: ../../c-api/memory.rst:530 msgid "" -"If called after Python has finish initializing " -"(after :c:func:`Py_InitializeFromConfig` has been called) the allocator " -"**must** wrap the existing allocator. Substituting the current allocator for " -"some other arbitrary one is **not supported**." +"If called after Python has finish initializing (after :c:func:" +"`Py_InitializeFromConfig` has been called) the allocator **must** wrap the " +"existing allocator. Substituting the current allocator for some other " +"arbitrary one is **not supported**." msgstr "" #: ../../c-api/memory.rst:535 @@ -812,8 +809,8 @@ msgstr "" #: ../../c-api/memory.rst:550 msgid "" -"When :ref:`Python is built in debug mode `, " -"the :c:func:`PyMem_SetupDebugHooks` function is called at the :ref:`Python " +"When :ref:`Python is built in debug mode `, the :c:func:" +"`PyMem_SetupDebugHooks` function is called at the :ref:`Python " "preinitialization ` to setup debug hooks on Python memory " "allocators to detect memory errors." msgstr "" @@ -981,11 +978,11 @@ msgstr "" #: ../../c-api/memory.rst:635 msgid "" "The :c:func:`PyMem_SetupDebugHooks` function now also works on Python " -"compiled in release mode. On error, the debug hooks now " -"use :mod:`tracemalloc` to get the traceback where a memory block was " -"allocated. The debug hooks now also check if there is an :term:`attached " -"thread state` when functions of :c:macro:`PYMEM_DOMAIN_OBJ` " -"and :c:macro:`PYMEM_DOMAIN_MEM` domains are called." +"compiled in release mode. On error, the debug hooks now use :mod:" +"`tracemalloc` to get the traceback where a memory block was allocated. The " +"debug hooks now also check if there is an :term:`attached thread state` when " +"functions of :c:macro:`PYMEM_DOMAIN_OBJ` and :c:macro:`PYMEM_DOMAIN_MEM` " +"domains are called." msgstr "" #: ../../c-api/memory.rst:643 @@ -1005,15 +1002,15 @@ 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 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." +"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:661 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." +"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:665 @@ -1035,9 +1032,8 @@ msgstr "否則使用 :c:func:`malloc` 和 :c:func:`free`。" #: ../../c-api/memory.rst:671 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``)." +"without-pymalloc` option. It can also be disabled at runtime using the :" +"envvar:`PYTHONMALLOC` environment variable (ex: ``PYTHONMALLOC=malloc``)." msgstr "" #: ../../c-api/memory.rst:675 @@ -1186,9 +1182,8 @@ msgstr "" #: ../../c-api/memory.rst:785 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_Free`." +"Python heap, objects in Python are allocated and released with :c:macro:" +"`PyObject_New`, :c:macro:`PyObject_NewVar` and :c:func:`PyObject_Free`." msgstr "" #: ../../c-api/memory.rst:789 diff --git a/c-api/memoryview.po b/c-api/memoryview.po index 28bd6dc68e..fd622b22e9 100644 --- a/c-api/memoryview.po +++ b/c-api/memoryview.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-01-30 00:03+0000\n" +"POT-Creation-Date: 2025-11-06 00:14+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,34 +30,40 @@ msgstr "" #: ../../c-api/memoryview.rst:18 msgid "" +"This instance of :c:type:`PyTypeObject` represents the Python memoryview " +"type. This is the same object as :class:`memoryview` in the Python layer." +msgstr "" + +#: ../../c-api/memoryview.rst:24 +msgid "" "Create a memoryview object from an object that provides the buffer " "interface. If *obj* supports writable buffer exports, the memoryview object " "will be read/write, otherwise it may be either read-only or read/write at " "the discretion of the exporter." msgstr "" -#: ../../c-api/memoryview.rst:26 +#: ../../c-api/memoryview.rst:32 msgid "Flag to request a readonly buffer." msgstr "" -#: ../../c-api/memoryview.rst:31 +#: ../../c-api/memoryview.rst:37 msgid "Flag to request a writable buffer." msgstr "" -#: ../../c-api/memoryview.rst:36 +#: ../../c-api/memoryview.rst:42 msgid "" "Create a memoryview object using *mem* as the underlying buffer. *flags* can " "be one of :c:macro:`PyBUF_READ` or :c:macro:`PyBUF_WRITE`." msgstr "" -#: ../../c-api/memoryview.rst:43 +#: ../../c-api/memoryview.rst:49 msgid "" "Create a memoryview object wrapping the given buffer structure *view*. For " "simple byte buffers, :c:func:`PyMemoryView_FromMemory` is the preferred " "function." msgstr "" -#: ../../c-api/memoryview.rst:49 +#: ../../c-api/memoryview.rst:55 msgid "" "Create a memoryview object to a :term:`contiguous` chunk of memory (in " "either 'C' or 'F'ortran *order*) from an object that defines the buffer " @@ -66,26 +72,26 @@ msgid "" "new bytes object." msgstr "" -#: ../../c-api/memoryview.rst:55 +#: ../../c-api/memoryview.rst:61 msgid "" "*buffertype* can be one of :c:macro:`PyBUF_READ` or :c:macro:`PyBUF_WRITE`." msgstr "" -#: ../../c-api/memoryview.rst:60 +#: ../../c-api/memoryview.rst:66 msgid "" "Return true if the object *obj* is a memoryview object. It is not currently " "allowed to create subclasses of :class:`memoryview`. This function always " "succeeds." msgstr "" -#: ../../c-api/memoryview.rst:67 +#: ../../c-api/memoryview.rst:73 msgid "" "Return a pointer to the memoryview's private copy of the exporter's buffer. " "*mview* **must** be a memoryview instance; this macro doesn't check its " "type, you must do it yourself or you will risk crashes." msgstr "" -#: ../../c-api/memoryview.rst:73 +#: ../../c-api/memoryview.rst:79 msgid "" "Return either a pointer to the exporting object that the memoryview is based " "on or ``NULL`` if the memoryview has been created by one of the functions :c:" diff --git a/c-api/module.po b/c-api/module.po index f00c8f3e2d..ff5900e620 100644 --- a/c-api/module.po +++ b/c-api/module.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-10-25 00:15+0000\n" +"POT-Creation-Date: 2025-11-05 00:16+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-" @@ -67,7 +67,8 @@ msgid "" "Similar to :c:func:`PyModule_NewObject`, but the name is a UTF-8 encoded " "string instead of a Unicode object." msgstr "" -"類似於 :c:func:`PyModule_NewObject`,但名稱是以 UTF-8 編碼的字串,而非 Unicode 物件。" +"類似於 :c:func:`PyModule_NewObject`,但名稱是以 UTF-8 編碼的字串,而非 " +"Unicode 物件。" #: ../../c-api/module.rst:65 msgid "" @@ -114,7 +115,7 @@ msgstr "" #: ../../c-api/module.rst:105 msgid "" "On error, return ``NULL`` with an exception set. Use :c:func:" -"`PyErr_Occurred` to tell this case apart from a mising :c:type:`!" +"`PyErr_Occurred` to tell this case apart from a missing :c:type:`!" "PyModuleDef`." msgstr "" @@ -131,7 +132,8 @@ msgid "" "Similar to :c:func:`PyModule_GetFilenameObject` but return the filename " "encoded to 'utf-8'." msgstr "" -"類似於 :c:func:`PyModule_GetFilenameObject`,但回傳以 'utf-8' 編碼的檔案名稱。" +"類似於 :c:func:`PyModule_GetFilenameObject`,但回傳以 'utf-8' 編碼的檔案名" +"稱。" #: ../../c-api/module.rst:129 msgid "" @@ -244,8 +246,7 @@ msgstr "" msgid "" "Prior to version 3.5, this member was always set to ``NULL``, and was " "defined as:" -msgstr "" -"在 3.5 版本之前,這個成員總是被設為 ``NULL``,並被定義為:" +msgstr "在 3.5 版本之前,這個成員總是被設為 ``NULL``,並被定義為:" #: ../../c-api/module.rst:220 msgid "" @@ -643,7 +644,8 @@ msgid "" "Similar to :c:func:`PyModule_AddObjectRef`, but steals a reference to " "*value* on success (if it returns ``0``)." msgstr "" -"類似於 :c:func:`PyModule_AddObjectRef`,但在成功時(如果回傳 ``0``)會偷走對 *value* 的參照。" +"類似於 :c:func:`PyModule_AddObjectRef`,但在成功時(如果回傳 ``0``)會偷走對 " +"*value* 的參照。" #: ../../c-api/module.rst:562 msgid "" @@ -680,7 +682,8 @@ msgstr "" #: ../../c-api/module.rst:590 msgid ":c:func:`PyModule_AddObject` is :term:`soft deprecated`." -msgstr ":c:func:`PyModule_AddObject` 已被\\ :term:`軟性棄用 `。" +msgstr "" +":c:func:`PyModule_AddObject` 已被\\ :term:`軟性棄用 `。" #: ../../c-api/module.rst:595 msgid "" diff --git a/c-api/monitoring.po b/c-api/monitoring.po index c542038550..8c2bc0c80c 100644 --- a/c-api/monitoring.po +++ b/c-api/monitoring.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-11-05 00:16+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-" @@ -42,10 +42,10 @@ msgid "" "accepts a ``PyMonitoringState`` struct which contains concise information " "about the activation state of events, as well as the event arguments, which " "include a ``PyObject*`` representing the code object, the instruction offset " -"and sometimes additional, event-specific arguments " -"(see :mod:`sys.monitoring` for details about the signatures of the different " -"event callbacks). The ``codelike`` argument should be an instance " -"of :class:`types.CodeType` or of a type that emulates it." +"and sometimes additional, event-specific arguments (see :mod:`sys." +"monitoring` for details about the signatures of the different event " +"callbacks). The ``codelike`` argument should be an instance of :class:`types." +"CodeType` or of a type that emulates it." msgstr "" #: ../../c-api/monitoring.rst:27 @@ -119,26 +119,26 @@ msgstr "發出一個 ``C_RETURN`` 事件。" #: ../../c-api/monitoring.rst:95 msgid "" -"Fire a ``PY_THROW`` event with the current exception (as returned " -"by :c:func:`PyErr_GetRaisedException`)." +"Fire a ``PY_THROW`` event with the current exception (as returned by :c:func:" +"`PyErr_GetRaisedException`)." msgstr "" #: ../../c-api/monitoring.rst:101 msgid "" -"Fire a ``RAISE`` event with the current exception (as returned " -"by :c:func:`PyErr_GetRaisedException`)." +"Fire a ``RAISE`` event with the current exception (as returned by :c:func:" +"`PyErr_GetRaisedException`)." msgstr "" #: ../../c-api/monitoring.rst:107 msgid "" -"Fire a ``C_RAISE`` event with the current exception (as returned " -"by :c:func:`PyErr_GetRaisedException`)." +"Fire a ``C_RAISE`` event with the current exception (as returned by :c:func:" +"`PyErr_GetRaisedException`)." msgstr "" #: ../../c-api/monitoring.rst:113 msgid "" -"Fire a ``RERAISE`` event with the current exception (as returned " -"by :c:func:`PyErr_GetRaisedException`)." +"Fire a ``RERAISE`` event with the current exception (as returned by :c:func:" +"`PyErr_GetRaisedException`)." msgstr "" #: ../../c-api/monitoring.rst:119 @@ -149,15 +149,15 @@ msgstr "" #: ../../c-api/monitoring.rst:125 msgid "" -"Fire a ``PY_UNWIND`` event with the current exception (as returned " -"by :c:func:`PyErr_GetRaisedException`)." +"Fire a ``PY_UNWIND`` event with the current exception (as returned by :c:" +"func:`PyErr_GetRaisedException`)." msgstr "" #: ../../c-api/monitoring.rst:131 msgid "" -"Fire a ``STOP_ITERATION`` event. If ``value`` is an instance " -"of :exc:`StopIteration`, it is used. Otherwise, a new :exc:`StopIteration` " -"instance is created with ``value`` as its argument." +"Fire a ``STOP_ITERATION`` event. If ``value`` is an instance of :exc:" +"`StopIteration`, it is used. Otherwise, a new :exc:`StopIteration` instance " +"is created with ``value`` as its argument." msgstr "" #: ../../c-api/monitoring.rst:136 @@ -167,7 +167,7 @@ msgstr "" #: ../../c-api/monitoring.rst:138 msgid "" "Monitoring states can be managed with the help of monitoring scopes. A scope " -"would typically correspond to a python function." +"would typically correspond to a Python function." msgstr "" #: ../../c-api/monitoring.rst:143 @@ -175,12 +175,12 @@ msgid "" "Enter a monitored scope. ``event_types`` is an array of the event IDs for " "events that may be fired from the scope. For example, the ID of a " "``PY_START`` event is the value ``PY_MONITORING_EVENT_PY_START``, which is " -"numerically equal to the base-2 logarithm of " -"``sys.monitoring.events.PY_START``. ``state_array`` is an array with a " -"monitoring state entry for each event in ``event_types``, it is allocated by " -"the user but populated by :c:func:`!PyMonitoring_EnterScope` with " -"information about the activation state of the event. The size of " -"``event_types`` (and hence also of ``state_array``) is given in ``length``." +"numerically equal to the base-2 logarithm of ``sys.monitoring.events." +"PY_START``. ``state_array`` is an array with a monitoring state entry for " +"each event in ``event_types``, it is allocated by the user but populated by :" +"c:func:`!PyMonitoring_EnterScope` with information about the activation " +"state of the event. The size of ``event_types`` (and hence also of " +"``state_array``) is given in ``length``." msgstr "" #: ../../c-api/monitoring.rst:153 diff --git a/c-api/object.po b/c-api/object.po index 2c7d919add..5cdde8ebd5 100644 --- a/c-api/object.po +++ b/c-api/object.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-10-14 00:14+0000\n" +"POT-Creation-Date: 2025-11-05 00:16+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-" @@ -161,7 +161,7 @@ msgstr "" msgid "" "Flag to be used with multiple functions that print the object (like :c:func:" "`PyObject_Print` and :c:func:`PyFile_WriteObject`). If passed, these " -"function would use the :func:`str` of the object instead of the :func:`repr`." +"functions use the :func:`str` of the object instead of the :func:`repr`." msgstr "" #: ../../c-api/object.rst:82 diff --git a/c-api/tuple.po b/c-api/tuple.po index 83d9284a8e..dac4336492 100644 --- a/c-api/tuple.po +++ b/c-api/tuple.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-11-05 00:16+0000\n" "PO-Revision-Date: 2017-09-22 18:26+0000\n" "Last-Translator: Leon H.\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -61,7 +61,7 @@ msgstr "" #: ../../c-api/tuple.rst:50 msgid "" "Take a pointer to a tuple object, and return the size of that tuple. On " -"error, return ``-1`` and with an exception set." +"error, return ``-1`` with an exception set." msgstr "" #: ../../c-api/tuple.rst:56 @@ -71,16 +71,16 @@ msgstr "" #: ../../c-api/tuple.rst:61 msgid "" "Return the object at position *pos* in the tuple pointed to by *p*. If " -"*pos* is negative or out of bounds, return ``NULL`` and set " -"an :exc:`IndexError` exception." +"*pos* is negative or out of bounds, return ``NULL`` and set an :exc:" +"`IndexError` exception." msgstr "" #: ../../c-api/tuple.rst:64 msgid "" "The returned reference is borrowed from the tuple *p* (that is: it is only " "valid as long as you hold a reference to *p*). To get a :term:`strong " -"reference`, use :c:func:`Py_NewRef(PyTuple_GetItem(...)) ` " -"or :c:func:`PySequence_GetItem`." +"reference`, use :c:func:`Py_NewRef(PyTuple_GetItem(...)) ` or :c:" +"func:`PySequence_GetItem`." msgstr "" #: ../../c-api/tuple.rst:73 @@ -121,17 +121,15 @@ msgstr "" #: ../../c-api/tuple.rst:102 ../../c-api/tuple.rst:224 #: ../../c-api/tuple.rst:242 msgid "" -"Bounds checking is performed as an assertion if Python is built " -"in :ref:`debug mode ` or :option:`with assertions <--with-" -"assertions>`." +"Bounds checking is performed as an assertion if Python is built in :ref:" +"`debug mode ` or :option:`with assertions <--with-assertions>`." msgstr "" #: ../../c-api/tuple.rst:107 msgid "" -"This function \"steals\" a reference to *o*, and, " -"unlike :c:func:`PyTuple_SetItem`, does *not* discard a reference to any item " -"that is being replaced; any reference in the tuple at position *pos* will be " -"leaked." +"This function \"steals\" a reference to *o*, and, unlike :c:func:" +"`PyTuple_SetItem`, does *not* discard a reference to any item that is being " +"replaced; any reference in the tuple at position *pos* will be leaked." msgstr "" #: ../../c-api/tuple.rst:114 @@ -152,8 +150,8 @@ msgid "" "Client code should never assume that the resulting value of ``*p`` will be " "the same as before calling this function. If the object referenced by ``*p`` " "is replaced, the original ``*p`` is destroyed. On failure, returns ``-1`` " -"and sets ``*p`` to ``NULL``, and raises :exc:`MemoryError` " -"or :exc:`SystemError`." +"and sets ``*p`` to ``NULL``, and raises :exc:`MemoryError` or :exc:" +"`SystemError`." msgstr "" #: ../../c-api/tuple.rst:136 @@ -162,17 +160,17 @@ msgstr "" #: ../../c-api/tuple.rst:138 msgid "" -"Struct sequence objects are the C equivalent " -"of :func:`~collections.namedtuple` objects, i.e. a sequence whose items can " -"also be accessed through attributes. To create a struct sequence, you first " -"have to create a specific struct sequence type." +"Struct sequence objects are the C equivalent of :func:`~collections." +"namedtuple` objects, i.e. a sequence whose items can also be accessed " +"through attributes. To create a struct sequence, you first have to create a " +"specific struct sequence type." msgstr "" #: ../../c-api/tuple.rst:145 msgid "" "Create a new struct sequence type from the data in *desc*, described below. " -"Instances of the resulting type can be created " -"with :c:func:`PyStructSequence_New`." +"Instances of the resulting type can be created with :c:func:" +"`PyStructSequence_New`." msgstr "" #: ../../c-api/tuple.rst:148 ../../c-api/tuple.rst:217 @@ -214,16 +212,16 @@ msgstr "" #: ../../c-api/tuple.rst:188 msgid "" "Describes a field of a struct sequence. As a struct sequence is modeled as a " -"tuple, all fields are typed as :c:expr:`PyObject*`. The index in " -"the :c:member:`~PyStructSequence_Desc.fields` array of " -"the :c:type:`PyStructSequence_Desc` determines which field of the struct " -"sequence is described." +"tuple, all fields are typed as :c:expr:`PyObject*`. The index in the :c:" +"member:`~PyStructSequence_Desc.fields` array of the :c:type:" +"`PyStructSequence_Desc` determines which field of the struct sequence is " +"described." msgstr "" #: ../../c-api/tuple.rst:196 msgid "" -"Name for the field or ``NULL`` to end the list of named fields, set " -"to :c:data:`PyStructSequence_UnnamedField` to leave unnamed." +"Name for the field or ``NULL`` to end the list of named fields, set to :c:" +"data:`PyStructSequence_UnnamedField` to leave unnamed." msgstr "" #: ../../c-api/tuple.rst:201 @@ -240,8 +238,8 @@ msgstr "" #: ../../c-api/tuple.rst:214 msgid "" -"Creates an instance of *type*, which must have been created " -"with :c:func:`PyStructSequence_NewType`." +"Creates an instance of *type*, which must have been created with :c:func:" +"`PyStructSequence_NewType`." msgstr "" #: ../../c-api/tuple.rst:222 diff --git a/c-api/typeobj.po b/c-api/typeobj.po index c1c5a71066..116fe97932 100644 --- a/c-api/typeobj.po +++ b/c-api/typeobj.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-10-14 00:14+0000\n" +"POT-Creation-Date: 2025-11-07 00:14+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-" @@ -1314,36 +1314,36 @@ msgstr "" #: ../../c-api/typeobj.rst:504 ../../c-api/typeobj.rst:527 #: ../../c-api/typeobj.rst:543 ../../c-api/typeobj.rst:587 -#: ../../c-api/typeobj.rst:665 ../../c-api/typeobj.rst:807 -#: ../../c-api/typeobj.rst:852 ../../c-api/typeobj.rst:869 -#: ../../c-api/typeobj.rst:886 ../../c-api/typeobj.rst:904 -#: ../../c-api/typeobj.rst:928 ../../c-api/typeobj.rst:945 -#: ../../c-api/typeobj.rst:957 ../../c-api/typeobj.rst:969 -#: ../../c-api/typeobj.rst:1002 ../../c-api/typeobj.rst:1024 -#: ../../c-api/typeobj.rst:1044 ../../c-api/typeobj.rst:1065 -#: ../../c-api/typeobj.rst:1091 ../../c-api/typeobj.rst:1110 -#: ../../c-api/typeobj.rst:1126 ../../c-api/typeobj.rst:1166 -#: ../../c-api/typeobj.rst:1177 ../../c-api/typeobj.rst:1187 -#: ../../c-api/typeobj.rst:1197 ../../c-api/typeobj.rst:1211 -#: ../../c-api/typeobj.rst:1229 ../../c-api/typeobj.rst:1252 -#: ../../c-api/typeobj.rst:1270 ../../c-api/typeobj.rst:1283 -#: ../../c-api/typeobj.rst:1305 ../../c-api/typeobj.rst:1349 -#: ../../c-api/typeobj.rst:1370 ../../c-api/typeobj.rst:1389 -#: ../../c-api/typeobj.rst:1419 ../../c-api/typeobj.rst:1441 -#: ../../c-api/typeobj.rst:1467 ../../c-api/typeobj.rst:1558 -#: ../../c-api/typeobj.rst:1702 ../../c-api/typeobj.rst:1767 -#: ../../c-api/typeobj.rst:1803 ../../c-api/typeobj.rst:1828 -#: ../../c-api/typeobj.rst:1851 ../../c-api/typeobj.rst:1864 -#: ../../c-api/typeobj.rst:1879 ../../c-api/typeobj.rst:1893 -#: ../../c-api/typeobj.rst:1923 ../../c-api/typeobj.rst:1955 -#: ../../c-api/typeobj.rst:1981 ../../c-api/typeobj.rst:1999 -#: ../../c-api/typeobj.rst:2028 ../../c-api/typeobj.rst:2072 -#: ../../c-api/typeobj.rst:2089 ../../c-api/typeobj.rst:2129 -#: ../../c-api/typeobj.rst:2152 ../../c-api/typeobj.rst:2190 -#: ../../c-api/typeobj.rst:2218 ../../c-api/typeobj.rst:2231 -#: ../../c-api/typeobj.rst:2241 ../../c-api/typeobj.rst:2258 -#: ../../c-api/typeobj.rst:2275 ../../c-api/typeobj.rst:2289 -#: ../../c-api/typeobj.rst:2431 ../../c-api/typeobj.rst:2489 +#: ../../c-api/typeobj.rst:665 ../../c-api/typeobj.rst:809 +#: ../../c-api/typeobj.rst:854 ../../c-api/typeobj.rst:873 +#: ../../c-api/typeobj.rst:892 ../../c-api/typeobj.rst:910 +#: ../../c-api/typeobj.rst:936 ../../c-api/typeobj.rst:953 +#: ../../c-api/typeobj.rst:965 ../../c-api/typeobj.rst:977 +#: ../../c-api/typeobj.rst:1012 ../../c-api/typeobj.rst:1036 +#: ../../c-api/typeobj.rst:1058 ../../c-api/typeobj.rst:1081 +#: ../../c-api/typeobj.rst:1109 ../../c-api/typeobj.rst:1128 +#: ../../c-api/typeobj.rst:1144 ../../c-api/typeobj.rst:1184 +#: ../../c-api/typeobj.rst:1195 ../../c-api/typeobj.rst:1205 +#: ../../c-api/typeobj.rst:1215 ../../c-api/typeobj.rst:1229 +#: ../../c-api/typeobj.rst:1247 ../../c-api/typeobj.rst:1270 +#: ../../c-api/typeobj.rst:1288 ../../c-api/typeobj.rst:1301 +#: ../../c-api/typeobj.rst:1323 ../../c-api/typeobj.rst:1367 +#: ../../c-api/typeobj.rst:1388 ../../c-api/typeobj.rst:1407 +#: ../../c-api/typeobj.rst:1437 ../../c-api/typeobj.rst:1459 +#: ../../c-api/typeobj.rst:1487 ../../c-api/typeobj.rst:1580 +#: ../../c-api/typeobj.rst:1726 ../../c-api/typeobj.rst:1793 +#: ../../c-api/typeobj.rst:1829 ../../c-api/typeobj.rst:1856 +#: ../../c-api/typeobj.rst:1881 ../../c-api/typeobj.rst:1896 +#: ../../c-api/typeobj.rst:1913 ../../c-api/typeobj.rst:1929 +#: ../../c-api/typeobj.rst:1961 ../../c-api/typeobj.rst:1993 +#: ../../c-api/typeobj.rst:2021 ../../c-api/typeobj.rst:2041 +#: ../../c-api/typeobj.rst:2070 ../../c-api/typeobj.rst:2116 +#: ../../c-api/typeobj.rst:2135 ../../c-api/typeobj.rst:2177 +#: ../../c-api/typeobj.rst:2202 ../../c-api/typeobj.rst:2242 +#: ../../c-api/typeobj.rst:2272 ../../c-api/typeobj.rst:2285 +#: ../../c-api/typeobj.rst:2295 ../../c-api/typeobj.rst:2312 +#: ../../c-api/typeobj.rst:2329 ../../c-api/typeobj.rst:2345 +#: ../../c-api/typeobj.rst:2489 ../../c-api/typeobj.rst:2549 msgid "**Inheritance:**" msgstr "" @@ -1380,12 +1380,12 @@ msgid "" "class. :c:func:`PyType_Ready` will not change this field if it is non-zero." msgstr "" -#: ../../c-api/typeobj.rst:529 ../../c-api/typeobj.rst:809 -#: ../../c-api/typeobj.rst:930 ../../c-api/typeobj.rst:1026 -#: ../../c-api/typeobj.rst:1046 ../../c-api/typeobj.rst:1830 -#: ../../c-api/typeobj.rst:1853 ../../c-api/typeobj.rst:1983 -#: ../../c-api/typeobj.rst:2001 ../../c-api/typeobj.rst:2074 -#: ../../c-api/typeobj.rst:2192 ../../c-api/typeobj.rst:2433 +#: ../../c-api/typeobj.rst:529 ../../c-api/typeobj.rst:811 +#: ../../c-api/typeobj.rst:938 ../../c-api/typeobj.rst:1038 +#: ../../c-api/typeobj.rst:1060 ../../c-api/typeobj.rst:1858 +#: ../../c-api/typeobj.rst:1883 ../../c-api/typeobj.rst:2023 +#: ../../c-api/typeobj.rst:2043 ../../c-api/typeobj.rst:2118 +#: ../../c-api/typeobj.rst:2244 ../../c-api/typeobj.rst:2491 msgid "This field is inherited by subtypes." msgstr "" @@ -1586,16 +1586,16 @@ msgid "" "implementation of the base type)." msgstr "" -#: ../../c-api/typeobj.rst:679 +#: ../../c-api/typeobj.rst:681 msgid "" "A pointer to the instance destructor function. The function signature is::" msgstr "" -#: ../../c-api/typeobj.rst:681 +#: ../../c-api/typeobj.rst:683 msgid "void tp_dealloc(PyObject *self);" msgstr "void tp_dealloc(PyObject *self);" -#: ../../c-api/typeobj.rst:683 +#: ../../c-api/typeobj.rst:685 msgid "" "The destructor function should remove all references which the instance owns " "(e.g., call :c:func:`Py_CLEAR`), free all memory buffers owned by the " @@ -1603,7 +1603,7 @@ msgid "" "free the object itself." msgstr "" -#: ../../c-api/typeobj.rst:688 +#: ../../c-api/typeobj.rst:690 msgid "" "If you may call functions that may set the error indicator, you must use :c:" "func:`PyErr_GetRaisedException` and :c:func:`PyErr_SetRaisedException` to " @@ -1611,7 +1611,7 @@ msgid "" "could have occurred while processing a different error):" msgstr "" -#: ../../c-api/typeobj.rst:693 +#: ../../c-api/typeobj.rst:695 msgid "" "static void\n" "foo_dealloc(foo_object *self)\n" @@ -1623,53 +1623,53 @@ msgid "" "}" msgstr "" -#: ../../c-api/typeobj.rst:704 +#: ../../c-api/typeobj.rst:706 msgid "" "The dealloc handler itself must not raise an exception; if it hits an error " "case it should call :c:func:`PyErr_FormatUnraisable` to log (and clear) an " "unraisable exception." msgstr "" -#: ../../c-api/typeobj.rst:708 +#: ../../c-api/typeobj.rst:710 msgid "No guarantees are made about when an object is destroyed, except:" msgstr "" -#: ../../c-api/typeobj.rst:710 +#: ../../c-api/typeobj.rst:712 msgid "" "Python will destroy an object immediately or some time after the final " "reference to the object is deleted, unless its finalizer (:c:member:" "`~PyTypeObject.tp_finalize`) subsequently resurrects the object." msgstr "" -#: ../../c-api/typeobj.rst:714 +#: ../../c-api/typeobj.rst:716 msgid "" "An object will not be destroyed while it is being automatically finalized (:" "c:member:`~PyTypeObject.tp_finalize`) or automatically cleared (:c:member:" "`~PyTypeObject.tp_clear`)." msgstr "" -#: ../../c-api/typeobj.rst:718 +#: ../../c-api/typeobj.rst:720 msgid "" "CPython currently destroys an object immediately from :c:func:`Py_DECREF` " "when the new reference count is zero, but this may change in a future " "version." msgstr "" -#: ../../c-api/typeobj.rst:722 +#: ../../c-api/typeobj.rst:724 msgid "" "It is recommended to call :c:func:`PyObject_CallFinalizerFromDealloc` at the " "beginning of :c:member:`!tp_dealloc` to guarantee that the object is always " "finalized before destruction." msgstr "" -#: ../../c-api/typeobj.rst:726 +#: ../../c-api/typeobj.rst:728 msgid "" "If the type supports garbage collection (the :c:macro:`Py_TPFLAGS_HAVE_GC` " "flag is set), the destructor should call :c:func:`PyObject_GC_UnTrack` " "before clearing any member fields." msgstr "" -#: ../../c-api/typeobj.rst:730 +#: ../../c-api/typeobj.rst:732 msgid "" "It is permissible to call :c:member:`~PyTypeObject.tp_clear` from :c:member:" "`!tp_dealloc` to reduce code duplication and to guarantee that the object is " @@ -1677,7 +1677,7 @@ msgid "" "have already been called." msgstr "" -#: ../../c-api/typeobj.rst:735 +#: ../../c-api/typeobj.rst:737 msgid "" "If the type is heap allocated (:c:macro:`Py_TPFLAGS_HEAPTYPE`), the " "deallocator should release the owned reference to its type object (via :c:" @@ -1685,7 +1685,7 @@ msgid "" "below.::" msgstr "" -#: ../../c-api/typeobj.rst:740 +#: ../../c-api/typeobj.rst:742 msgid "" "static void\n" "foo_dealloc(PyObject *op)\n" @@ -1705,7 +1705,7 @@ msgstr "" " Py_TYPE(self)->tp_free(self);\n" "}" -#: ../../c-api/typeobj.rst:749 +#: ../../c-api/typeobj.rst:751 msgid "" ":c:member:`!tp_dealloc` must leave the exception status unchanged. If it " "needs to call something that might raise an exception, the exception state " @@ -1713,11 +1713,11 @@ msgid "" "with :c:func:`PyErr_WriteUnraisable`)." msgstr "" -#: ../../c-api/typeobj.rst:754 +#: ../../c-api/typeobj.rst:756 msgid "Example::" msgstr "範例: ::" -#: ../../c-api/typeobj.rst:756 +#: ../../c-api/typeobj.rst:758 msgid "" "static void\n" "foo_dealloc(PyObject *self)\n" @@ -1759,7 +1759,7 @@ msgid "" "}" msgstr "" -#: ../../c-api/typeobj.rst:795 +#: ../../c-api/typeobj.rst:797 msgid "" ":c:member:`!tp_dealloc` may be called from any Python thread, not just the " "thread which created the object (if the object becomes part of a refcount " @@ -1772,34 +1772,34 @@ msgid "" "violate any assumptions of the library." msgstr "" -#: ../../c-api/typeobj.rst:813 ../../c-api/typeobj.rst:1713 -#: ../../c-api/typeobj.rst:2446 +#: ../../c-api/typeobj.rst:815 ../../c-api/typeobj.rst:1737 +#: ../../c-api/typeobj.rst:2504 msgid "" ":ref:`life-cycle` for details about how this slot relates to other slots." msgstr "" -#: ../../c-api/typeobj.rst:818 +#: ../../c-api/typeobj.rst:820 msgid "" "An optional offset to a per-instance function that implements calling the " "object using the :ref:`vectorcall protocol `, a more efficient " "alternative of the simpler :c:member:`~PyTypeObject.tp_call`." msgstr "" -#: ../../c-api/typeobj.rst:823 +#: ../../c-api/typeobj.rst:825 msgid "" "This field is only used if the flag :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` is " "set. If so, this must be a positive integer containing the offset in the " "instance of a :c:type:`vectorcallfunc` pointer." msgstr "" -#: ../../c-api/typeobj.rst:827 +#: ../../c-api/typeobj.rst:829 msgid "" "The *vectorcallfunc* pointer may be ``NULL``, in which case the instance " "behaves as if :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` was not set: calling the " "instance falls back to :c:member:`~PyTypeObject.tp_call`." msgstr "" -#: ../../c-api/typeobj.rst:831 +#: ../../c-api/typeobj.rst:833 msgid "" "Any class that sets ``Py_TPFLAGS_HAVE_VECTORCALL`` must also set :c:member:" "`~PyTypeObject.tp_call` and make sure its behaviour is consistent with the " @@ -1807,13 +1807,13 @@ msgid "" "`PyVectorcall_Call`." msgstr "" -#: ../../c-api/typeobj.rst:838 +#: ../../c-api/typeobj.rst:840 msgid "" "Before version 3.8, this slot was named ``tp_print``. In Python 2.x, it was " "used for printing to a file. In Python 3.0 to 3.7, it was unused." msgstr "" -#: ../../c-api/typeobj.rst:844 +#: ../../c-api/typeobj.rst:846 msgid "" "Before version 3.12, it was not recommended for :ref:`mutable heap types " "` to implement the vectorcall protocol. When a user sets :attr:" @@ -1823,7 +1823,7 @@ msgid "" "`Py_TPFLAGS_HAVE_VECTORCALL` flag." msgstr "" -#: ../../c-api/typeobj.rst:854 +#: ../../c-api/typeobj.rst:856 msgid "" "This field is always inherited. However, the :c:macro:" "`Py_TPFLAGS_HAVE_VECTORCALL` flag is not always inherited. If it's not set, " @@ -1831,21 +1831,21 @@ msgid "" "func:`PyVectorcall_Call` is explicitly called." msgstr "" -#: ../../c-api/typeobj.rst:863 +#: ../../c-api/typeobj.rst:867 msgid "An optional pointer to the get-attribute-string function." msgstr "" -#: ../../c-api/typeobj.rst:865 +#: ../../c-api/typeobj.rst:869 msgid "" "This field is deprecated. When it is defined, it should point to a function " "that acts the same as the :c:member:`~PyTypeObject.tp_getattro` function, " "but taking a C string instead of a Python string object to give the " "attribute name." msgstr "" -"此欄位已被棄用。當它被定義時,它應該指向一個與 :c:member:`~PyTypeObject.tp_getattro` " -"行為相同但使用 C 字串而非 Python 字串物件來提供屬性名稱的函式。" +"此欄位已被棄用。當它被定義時,它應該指向一個與 :c:member:`~PyTypeObject." +"tp_getattro` 行為相同但使用 C 字串而非 Python 字串物件來提供屬性名稱的函式。" -#: ../../c-api/typeobj.rst:871 ../../c-api/typeobj.rst:1067 +#: ../../c-api/typeobj.rst:875 ../../c-api/typeobj.rst:1083 msgid "" "Group: :c:member:`~PyTypeObject.tp_getattr`, :c:member:`~PyTypeObject." "tp_getattro`" @@ -1853,7 +1853,7 @@ msgstr "" "群組::c:member:`~PyTypeObject.tp_getattr`、:c:member:`~PyTypeObject." "tp_getattro`" -#: ../../c-api/typeobj.rst:873 +#: ../../c-api/typeobj.rst:877 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_getattro`: a subtype inherits both :c:member:`~PyTypeObject.tp_getattr` " @@ -1862,22 +1862,22 @@ msgid "" "tp_getattro` are both ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:880 ../../c-api/typeobj.rst:1080 +#: ../../c-api/typeobj.rst:886 ../../c-api/typeobj.rst:1098 msgid "" "An optional pointer to the function for setting and deleting attributes." msgstr "" -#: ../../c-api/typeobj.rst:882 +#: ../../c-api/typeobj.rst:888 msgid "" "This field is deprecated. When it is defined, it should point to a function " "that acts the same as the :c:member:`~PyTypeObject.tp_setattro` function, " "but taking a C string instead of a Python string object to give the " "attribute name." msgstr "" -"此欄位已被棄用。當它被定義時,它應該指向一個與 :c:member:`~PyTypeObject.tp_setattro` " -"行為相同但使用 C 字串而非 Python 字串物件來提供屬性名稱的函式。" +"此欄位已被棄用。當它被定義時,它應該指向一個與 :c:member:`~PyTypeObject." +"tp_setattro` 行為相同但使用 C 字串而非 Python 字串物件來提供屬性名稱的函式。" -#: ../../c-api/typeobj.rst:888 ../../c-api/typeobj.rst:1093 +#: ../../c-api/typeobj.rst:894 ../../c-api/typeobj.rst:1111 msgid "" "Group: :c:member:`~PyTypeObject.tp_setattr`, :c:member:`~PyTypeObject." "tp_setattro`" @@ -1885,7 +1885,7 @@ msgstr "" "群組::c:member:`~PyTypeObject.tp_setattr`、:c:member:`~PyTypeObject." "tp_setattro`" -#: ../../c-api/typeobj.rst:890 +#: ../../c-api/typeobj.rst:896 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_setattro`: a subtype inherits both :c:member:`~PyTypeObject.tp_setattr` " @@ -1894,38 +1894,38 @@ msgid "" "tp_setattro` are both ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:897 +#: ../../c-api/typeobj.rst:903 msgid "" "Pointer to an additional structure that contains fields relevant only to " "objects which implement :term:`awaitable` and :term:`asynchronous iterator` " "protocols at the C-level. See :ref:`async-structs` for details." msgstr "" -#: ../../c-api/typeobj.rst:901 +#: ../../c-api/typeobj.rst:907 msgid "Formerly known as ``tp_compare`` and ``tp_reserved``." msgstr "以前稱為 ``tp_compare`` 和 ``tp_reserved``。" -#: ../../c-api/typeobj.rst:906 +#: ../../c-api/typeobj.rst:912 msgid "" "The :c:member:`~PyTypeObject.tp_as_async` field is not inherited, but the " "contained fields are inherited individually." msgstr "" -#: ../../c-api/typeobj.rst:914 +#: ../../c-api/typeobj.rst:922 msgid "" "An optional pointer to a function that implements the built-in function :" "func:`repr`." msgstr "" -#: ../../c-api/typeobj.rst:917 +#: ../../c-api/typeobj.rst:925 msgid "The signature is the same as for :c:func:`PyObject_Repr`::" msgstr "函式簽名與 :c:func:`PyObject_Repr` 相同: ::" -#: ../../c-api/typeobj.rst:919 +#: ../../c-api/typeobj.rst:927 msgid "PyObject *tp_repr(PyObject *self);" msgstr "PyObject *tp_repr(PyObject *self);" -#: ../../c-api/typeobj.rst:921 +#: ../../c-api/typeobj.rst:929 msgid "" "The function must return a string or a Unicode object. Ideally, this " "function should return a string that, when passed to :func:`eval`, given a " @@ -1934,85 +1934,85 @@ msgid "" "``'>'`` from which both the type and the value of the object can be deduced." msgstr "" -#: ../../c-api/typeobj.rst:932 ../../c-api/typeobj.rst:1011 -#: ../../c-api/typeobj.rst:1048 ../../c-api/typeobj.rst:1073 -#: ../../c-api/typeobj.rst:1099 ../../c-api/typeobj.rst:1141 -#: ../../c-api/typeobj.rst:1776 ../../c-api/typeobj.rst:1810 -#: ../../c-api/typeobj.rst:1927 ../../c-api/typeobj.rst:1960 -#: ../../c-api/typeobj.rst:2035 ../../c-api/typeobj.rst:2076 -#: ../../c-api/typeobj.rst:2096 ../../c-api/typeobj.rst:2135 -#: ../../c-api/typeobj.rst:2163 ../../c-api/typeobj.rst:2194 +#: ../../c-api/typeobj.rst:940 ../../c-api/typeobj.rst:1021 +#: ../../c-api/typeobj.rst:1062 ../../c-api/typeobj.rst:1089 +#: ../../c-api/typeobj.rst:1117 ../../c-api/typeobj.rst:1159 +#: ../../c-api/typeobj.rst:1802 ../../c-api/typeobj.rst:1836 +#: ../../c-api/typeobj.rst:1965 ../../c-api/typeobj.rst:1998 +#: ../../c-api/typeobj.rst:2077 ../../c-api/typeobj.rst:2120 +#: ../../c-api/typeobj.rst:2142 ../../c-api/typeobj.rst:2183 +#: ../../c-api/typeobj.rst:2213 ../../c-api/typeobj.rst:2246 msgid "**Default:**" msgstr "**預設:**" -#: ../../c-api/typeobj.rst:934 +#: ../../c-api/typeobj.rst:942 msgid "" "When this field is not set, a string of the form ``<%s object at %p>`` is " "returned, where ``%s`` is replaced by the type name, and ``%p`` by the " "object's memory address." msgstr "" -#: ../../c-api/typeobj.rst:941 +#: ../../c-api/typeobj.rst:949 msgid "" "Pointer to an additional structure that contains fields relevant only to " "objects which implement the number protocol. These fields are documented " "in :ref:`number-structs`." msgstr "" -#: ../../c-api/typeobj.rst:947 +#: ../../c-api/typeobj.rst:955 msgid "" "The :c:member:`~PyTypeObject.tp_as_number` field is not inherited, but the " "contained fields are inherited individually." msgstr "" -#: ../../c-api/typeobj.rst:953 +#: ../../c-api/typeobj.rst:961 msgid "" "Pointer to an additional structure that contains fields relevant only to " "objects which implement the sequence protocol. These fields are documented " "in :ref:`sequence-structs`." msgstr "" -#: ../../c-api/typeobj.rst:959 +#: ../../c-api/typeobj.rst:967 msgid "" "The :c:member:`~PyTypeObject.tp_as_sequence` field is not inherited, but the " "contained fields are inherited individually." msgstr "" -#: ../../c-api/typeobj.rst:965 +#: ../../c-api/typeobj.rst:973 msgid "" "Pointer to an additional structure that contains fields relevant only to " "objects which implement the mapping protocol. These fields are documented " "in :ref:`mapping-structs`." msgstr "" -#: ../../c-api/typeobj.rst:971 +#: ../../c-api/typeobj.rst:979 msgid "" "The :c:member:`~PyTypeObject.tp_as_mapping` field is not inherited, but the " "contained fields are inherited individually." msgstr "" -#: ../../c-api/typeobj.rst:979 +#: ../../c-api/typeobj.rst:989 msgid "" "An optional pointer to a function that implements the built-in function :" "func:`hash`." msgstr "" -#: ../../c-api/typeobj.rst:982 +#: ../../c-api/typeobj.rst:992 msgid "The signature is the same as for :c:func:`PyObject_Hash`::" msgstr "函式簽名與 :c:func:`PyObject_Hash` 相同: ::" -#: ../../c-api/typeobj.rst:984 +#: ../../c-api/typeobj.rst:994 msgid "Py_hash_t tp_hash(PyObject *);" msgstr "Py_hash_t tp_hash(PyObject *);" -#: ../../c-api/typeobj.rst:986 +#: ../../c-api/typeobj.rst:996 msgid "" "The value ``-1`` should not be returned as a normal return value; when an " "error occurs during the computation of the hash value, the function should " "set an exception and return ``-1``." msgstr "" -#: ../../c-api/typeobj.rst:990 +#: ../../c-api/typeobj.rst:1000 msgid "" "When this field is not set (*and* :c:member:`~PyTypeObject.tp_richcompare` " "is not set), an attempt to take the hash of the object raises :exc:" @@ -2020,7 +2020,7 @@ msgid "" "`PyObject_HashNotImplemented`." msgstr "" -#: ../../c-api/typeobj.rst:994 +#: ../../c-api/typeobj.rst:1004 msgid "" "This field can be set explicitly to :c:func:`PyObject_HashNotImplemented` to " "block inheritance of the hash method from a parent type. This is interpreted " @@ -2031,7 +2031,7 @@ msgid "" "`PyObject_HashNotImplemented`." msgstr "" -#: ../../c-api/typeobj.rst:1004 ../../c-api/typeobj.rst:1769 +#: ../../c-api/typeobj.rst:1014 ../../c-api/typeobj.rst:1795 msgid "" "Group: :c:member:`~PyTypeObject.tp_hash`, :c:member:`~PyTypeObject." "tp_richcompare`" @@ -2039,7 +2039,7 @@ msgstr "" "群組::c:member:`~PyTypeObject.tp_hash`、:c:member:`~PyTypeObject." "tp_richcompare`" -#: ../../c-api/typeobj.rst:1006 +#: ../../c-api/typeobj.rst:1016 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_richcompare`: a subtype inherits both of :c:member:`~PyTypeObject." @@ -2048,22 +2048,22 @@ msgid "" "are both ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:1013 +#: ../../c-api/typeobj.rst:1023 msgid ":c:data:`PyBaseObject_Type` uses :c:func:`PyObject_GenericHash`." msgstr ":c:data:`PyBaseObject_Type` 會使用 :c:func:`PyObject_GenericHash`。" -#: ../../c-api/typeobj.rst:1018 +#: ../../c-api/typeobj.rst:1030 msgid "" "An optional pointer to a function that implements calling the object. This " "should be ``NULL`` if the object is not callable. The signature is the same " "as for :c:func:`PyObject_Call`::" msgstr "" -#: ../../c-api/typeobj.rst:1022 +#: ../../c-api/typeobj.rst:1034 msgid "PyObject *tp_call(PyObject *self, PyObject *args, PyObject *kwargs);" msgstr "PyObject *tp_call(PyObject *self, PyObject *args, PyObject *kwargs);" -#: ../../c-api/typeobj.rst:1031 +#: ../../c-api/typeobj.rst:1045 msgid "" "An optional pointer to a function that implements the built-in operation :" "func:`str`. (Note that :class:`str` is a type now, and :func:`str` calls " @@ -2072,15 +2072,15 @@ msgid "" "this handler.)" msgstr "" -#: ../../c-api/typeobj.rst:1036 +#: ../../c-api/typeobj.rst:1050 msgid "The signature is the same as for :c:func:`PyObject_Str`::" msgstr "函式簽名與 :c:func:`PyObject_Str` 相同: ::" -#: ../../c-api/typeobj.rst:1038 +#: ../../c-api/typeobj.rst:1052 msgid "PyObject *tp_str(PyObject *self);" msgstr "PyObject *tp_str(PyObject *self);" -#: ../../c-api/typeobj.rst:1040 +#: ../../c-api/typeobj.rst:1054 msgid "" "The function must return a string or a Unicode object. It should be a " "\"friendly\" string representation of the object, as this is the " @@ -2088,32 +2088,32 @@ msgid "" "function." msgstr "" -#: ../../c-api/typeobj.rst:1050 +#: ../../c-api/typeobj.rst:1064 msgid "" "When this field is not set, :c:func:`PyObject_Repr` is called to return a " "string representation." msgstr "" -#: ../../c-api/typeobj.rst:1056 +#: ../../c-api/typeobj.rst:1072 msgid "An optional pointer to the get-attribute function." msgstr "" -#: ../../c-api/typeobj.rst:1058 +#: ../../c-api/typeobj.rst:1074 msgid "The signature is the same as for :c:func:`PyObject_GetAttr`::" msgstr "函式簽名與 :c:func:`PyObject_GetAttr` 相同: ::" -#: ../../c-api/typeobj.rst:1060 +#: ../../c-api/typeobj.rst:1076 msgid "PyObject *tp_getattro(PyObject *self, PyObject *attr);" msgstr "PyObject *tp_getattro(PyObject *self, PyObject *attr);" -#: ../../c-api/typeobj.rst:1062 +#: ../../c-api/typeobj.rst:1078 msgid "" "It is usually convenient to set this field to :c:func:" "`PyObject_GenericGetAttr`, which implements the normal way of looking for " "object attributes." msgstr "" -#: ../../c-api/typeobj.rst:1069 +#: ../../c-api/typeobj.rst:1085 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_getattr`: a subtype inherits both :c:member:`~PyTypeObject.tp_getattr` " @@ -2122,19 +2122,19 @@ msgid "" "tp_getattro` are both ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:1075 +#: ../../c-api/typeobj.rst:1091 msgid ":c:data:`PyBaseObject_Type` uses :c:func:`PyObject_GenericGetAttr`." msgstr ":c:data:`PyBaseObject_Type` 會使用 :c:func:`PyObject_GenericGetAttr`。" -#: ../../c-api/typeobj.rst:1082 +#: ../../c-api/typeobj.rst:1100 msgid "The signature is the same as for :c:func:`PyObject_SetAttr`::" msgstr "函式簽名與 :c:func:`PyObject_SetAttr` 相同: ::" -#: ../../c-api/typeobj.rst:1084 +#: ../../c-api/typeobj.rst:1102 msgid "int tp_setattro(PyObject *self, PyObject *attr, PyObject *value);" msgstr "int tp_setattro(PyObject *self, PyObject *attr, PyObject *value);" -#: ../../c-api/typeobj.rst:1086 +#: ../../c-api/typeobj.rst:1104 msgid "" "In addition, setting *value* to ``NULL`` to delete an attribute must be " "supported. It is usually convenient to set this field to :c:func:" @@ -2142,7 +2142,7 @@ msgid "" "attributes." msgstr "" -#: ../../c-api/typeobj.rst:1095 +#: ../../c-api/typeobj.rst:1113 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_setattr`: a subtype inherits both :c:member:`~PyTypeObject.tp_setattr` " @@ -2151,24 +2151,24 @@ msgid "" "tp_setattro` are both ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:1101 +#: ../../c-api/typeobj.rst:1119 msgid ":c:data:`PyBaseObject_Type` uses :c:func:`PyObject_GenericSetAttr`." msgstr "" -#: ../../c-api/typeobj.rst:1106 +#: ../../c-api/typeobj.rst:1124 msgid "" "Pointer to an additional structure that contains fields relevant only to " "objects which implement the buffer interface. These fields are documented " "in :ref:`buffer-structs`." msgstr "" -#: ../../c-api/typeobj.rst:1112 +#: ../../c-api/typeobj.rst:1130 msgid "" "The :c:member:`~PyTypeObject.tp_as_buffer` field is not inherited, but the " "contained fields are inherited individually." msgstr "" -#: ../../c-api/typeobj.rst:1118 +#: ../../c-api/typeobj.rst:1136 msgid "" "This field is a bit mask of various flags. Some flags indicate variant " "semantics for certain situations; others are used to indicate that certain " @@ -2180,7 +2180,7 @@ msgid "" "accessed and must be considered to have a zero or ``NULL`` value instead." msgstr "" -#: ../../c-api/typeobj.rst:1128 +#: ../../c-api/typeobj.rst:1146 msgid "" "Inheritance of this field is complicated. Most flag bits are inherited " "individually, i.e. if the base type has a flag bit set, the subtype inherits " @@ -2195,7 +2195,7 @@ msgid "" "the subtype exist and have ``NULL`` values." msgstr "" -#: ../../c-api/typeobj.rst:1143 +#: ../../c-api/typeobj.rst:1161 msgid "" ":c:data:`PyBaseObject_Type` uses ``Py_TPFLAGS_DEFAULT | " "Py_TPFLAGS_BASETYPE``." @@ -2203,11 +2203,11 @@ msgstr "" ":c:data:`PyBaseObject_Type` 使用 ``Py_TPFLAGS_DEFAULT | " "Py_TPFLAGS_BASETYPE``。" -#: ../../c-api/typeobj.rst:1146 +#: ../../c-api/typeobj.rst:1164 msgid "**Bit Masks:**" msgstr "" -#: ../../c-api/typeobj.rst:1150 +#: ../../c-api/typeobj.rst:1168 msgid "" "The following bit masks are currently defined; these can be ORed together " "using the ``|`` operator to form the value of the :c:member:`~PyTypeObject." @@ -2216,7 +2216,7 @@ msgid "" "zero." msgstr "" -#: ../../c-api/typeobj.rst:1157 +#: ../../c-api/typeobj.rst:1175 msgid "" "This bit is set when the type object itself is allocated on the heap, for " "example, types created dynamically using :c:func:`PyType_FromSpec`. In this " @@ -2229,32 +2229,32 @@ msgid "" "reference cycle with their own module object." msgstr "" -#: ../../c-api/typeobj.rst:1168 ../../c-api/typeobj.rst:1179 -#: ../../c-api/typeobj.rst:1189 ../../c-api/typeobj.rst:1199 -#: ../../c-api/typeobj.rst:1231 +#: ../../c-api/typeobj.rst:1186 ../../c-api/typeobj.rst:1197 +#: ../../c-api/typeobj.rst:1207 ../../c-api/typeobj.rst:1217 +#: ../../c-api/typeobj.rst:1249 msgid "???" msgstr "???" -#: ../../c-api/typeobj.rst:1173 +#: ../../c-api/typeobj.rst:1191 msgid "" "This bit is set when the type can be used as the base type of another type. " "If this bit is clear, the type cannot be subtyped (similar to a \"final\" " "class in Java)." msgstr "" -#: ../../c-api/typeobj.rst:1184 +#: ../../c-api/typeobj.rst:1202 msgid "" "This bit is set when the type object has been fully initialized by :c:func:" "`PyType_Ready`." msgstr "" -#: ../../c-api/typeobj.rst:1194 +#: ../../c-api/typeobj.rst:1212 msgid "" "This bit is set while :c:func:`PyType_Ready` is in the process of " "initializing the type object." msgstr "" -#: ../../c-api/typeobj.rst:1204 +#: ../../c-api/typeobj.rst:1222 msgid "" "This bit is set when the object supports garbage collection. If this bit is " "set, memory for new instances (see :c:member:`~PyTypeObject.tp_alloc`) must " @@ -2264,14 +2264,14 @@ msgid "" "`supporting-cycle-detection`." msgstr "" -#: ../../c-api/typeobj.rst:1213 ../../c-api/typeobj.rst:1560 -#: ../../c-api/typeobj.rst:1704 +#: ../../c-api/typeobj.rst:1231 ../../c-api/typeobj.rst:1582 +#: ../../c-api/typeobj.rst:1728 msgid "" "Group: :c:macro:`Py_TPFLAGS_HAVE_GC`, :c:member:`~PyTypeObject." "tp_traverse`, :c:member:`~PyTypeObject.tp_clear`" msgstr "" -#: ../../c-api/typeobj.rst:1215 +#: ../../c-api/typeobj.rst:1233 msgid "" "The :c:macro:`Py_TPFLAGS_HAVE_GC` flag bit is inherited together with the :c:" "member:`~PyTypeObject.tp_traverse` and :c:member:`~PyTypeObject.tp_clear` " @@ -2281,109 +2281,110 @@ msgid "" "values." msgstr "" -#: ../../c-api/typeobj.rst:1225 +#: ../../c-api/typeobj.rst:1243 msgid "" "This is a bitmask of all the bits that pertain to the existence of certain " "fields in the type object and its extension structures. Currently, it " "includes the following bits: :c:macro:`Py_TPFLAGS_HAVE_STACKLESS_EXTENSION`." msgstr "" -#: ../../c-api/typeobj.rst:1236 +#: ../../c-api/typeobj.rst:1254 msgid "This bit indicates that objects behave like unbound methods." msgstr "" -#: ../../c-api/typeobj.rst:1238 +#: ../../c-api/typeobj.rst:1256 msgid "If this flag is set for ``type(meth)``, then:" msgstr "如果此旗標為 ``type(meth)`` 所設定,則:" -#: ../../c-api/typeobj.rst:1240 +#: ../../c-api/typeobj.rst:1258 msgid "" "``meth.__get__(obj, cls)(*args, **kwds)`` (with ``obj`` not None) must be " "equivalent to ``meth(obj, *args, **kwds)``." msgstr "" -"``meth.__get__(obj, cls)(*args, **kwds)``\\(其中 ``obj`` 並非 None)必須等價於 " -"``meth(obj, *args, **kwds)``。" +"``meth.__get__(obj, cls)(*args, **kwds)``\\(其中 ``obj`` 並非 None)必須等價" +"於 ``meth(obj, *args, **kwds)``。" -#: ../../c-api/typeobj.rst:1243 +#: ../../c-api/typeobj.rst:1261 msgid "" "``meth.__get__(None, cls)(*args, **kwds)`` must be equivalent to " "``meth(*args, **kwds)``." msgstr "" -"``meth.__get__(None, cls)(*args, **kwds)`` 必須等價於 ``meth(*args, **kwds)``。" +"``meth.__get__(None, cls)(*args, **kwds)`` 必須等價於 ``meth(*args, " +"**kwds)``。" -#: ../../c-api/typeobj.rst:1246 +#: ../../c-api/typeobj.rst:1264 msgid "" "This flag enables an optimization for typical method calls like ``obj." "meth()``: it avoids creating a temporary \"bound method\" object for ``obj." "meth``." msgstr "" -#: ../../c-api/typeobj.rst:1254 +#: ../../c-api/typeobj.rst:1272 msgid "" "This flag is never inherited by types without the :c:macro:" "`Py_TPFLAGS_IMMUTABLETYPE` flag set. For extension types, it is inherited " "whenever :c:member:`~PyTypeObject.tp_descr_get` is inherited." msgstr "" -#: ../../c-api/typeobj.rst:1260 +#: ../../c-api/typeobj.rst:1278 msgid "" "This bit indicates that instances of the class have a :attr:`~object." "__dict__` attribute, and that the space for the dictionary is managed by the " "VM." msgstr "" -#: ../../c-api/typeobj.rst:1263 +#: ../../c-api/typeobj.rst:1281 msgid "If this flag is set, :c:macro:`Py_TPFLAGS_HAVE_GC` should also be set." msgstr "如果有設定此旗標,則也應該設定 :c:macro:`Py_TPFLAGS_HAVE_GC`。" -#: ../../c-api/typeobj.rst:1265 +#: ../../c-api/typeobj.rst:1283 msgid "" "The type traverse function must call :c:func:`PyObject_VisitManagedDict` and " "its clear function must call :c:func:`PyObject_ClearManagedDict`." msgstr "" -#: ../../c-api/typeobj.rst:1272 +#: ../../c-api/typeobj.rst:1290 msgid "" "This flag is inherited unless the :c:member:`~PyTypeObject.tp_dictoffset` " "field is set in a superclass." msgstr "" -#: ../../c-api/typeobj.rst:1278 +#: ../../c-api/typeobj.rst:1296 msgid "" "This bit indicates that instances of the class should be weakly " "referenceable." msgstr "" -#: ../../c-api/typeobj.rst:1285 +#: ../../c-api/typeobj.rst:1303 msgid "" "This flag is inherited unless the :c:member:`~PyTypeObject." "tp_weaklistoffset` field is set in a superclass." msgstr "" -#: ../../c-api/typeobj.rst:1291 +#: ../../c-api/typeobj.rst:1309 msgid "" "Only usable with variable-size types, i.e. ones with non-zero :c:member:" "`~PyTypeObject.tp_itemsize`." msgstr "" -#: ../../c-api/typeobj.rst:1294 +#: ../../c-api/typeobj.rst:1312 msgid "" "Indicates that the variable-sized portion of an instance of this type is at " "the end of the instance's memory area, at an offset of ``Py_TYPE(obj)-" ">tp_basicsize`` (which may be different in each subclass)." msgstr "" -#: ../../c-api/typeobj.rst:1299 +#: ../../c-api/typeobj.rst:1317 msgid "" "When setting this flag, be sure that all superclasses either use this memory " "layout, or are not variable-sized. Python does not check this." msgstr "" -#: ../../c-api/typeobj.rst:1307 +#: ../../c-api/typeobj.rst:1325 msgid "This flag is inherited." msgstr "" -#: ../../c-api/typeobj.rst:1321 +#: ../../c-api/typeobj.rst:1339 msgid "" "These flags are used by functions such as :c:func:`PyLong_Check` to quickly " "determine if a type is a subclass of a built-in type; such specific checks " @@ -2393,90 +2394,90 @@ msgid "" "behave differently depending on what kind of check is used." msgstr "" -#: ../../c-api/typeobj.rst:1332 +#: ../../c-api/typeobj.rst:1350 msgid "" "This bit is set when the :c:member:`~PyTypeObject.tp_finalize` slot is " "present in the type structure." msgstr "" -#: ../../c-api/typeobj.rst:1337 +#: ../../c-api/typeobj.rst:1355 msgid "" "This flag isn't necessary anymore, as the interpreter assumes the :c:member:" "`~PyTypeObject.tp_finalize` slot is always present in the type structure." msgstr "" -#: ../../c-api/typeobj.rst:1345 +#: ../../c-api/typeobj.rst:1363 msgid "" "This bit is set when the class implements the :ref:`vectorcall protocol " "`. See :c:member:`~PyTypeObject.tp_vectorcall_offset` for " "details." msgstr "" -#: ../../c-api/typeobj.rst:1351 +#: ../../c-api/typeobj.rst:1369 msgid "" "This bit is inherited if :c:member:`~PyTypeObject.tp_call` is also inherited." msgstr "" -#: ../../c-api/typeobj.rst:1358 +#: ../../c-api/typeobj.rst:1376 msgid "" "This flag is now removed from a class when the class's :py:meth:`~object." "__call__` method is reassigned." msgstr "" -#: ../../c-api/typeobj.rst:1361 +#: ../../c-api/typeobj.rst:1379 msgid "This flag can now be inherited by mutable classes." msgstr "" -#: ../../c-api/typeobj.rst:1365 +#: ../../c-api/typeobj.rst:1383 msgid "" "This bit is set for type objects that are immutable: type attributes cannot " "be set nor deleted." msgstr "" -#: ../../c-api/typeobj.rst:1367 +#: ../../c-api/typeobj.rst:1385 msgid "" ":c:func:`PyType_Ready` automatically applies this flag to :ref:`static types " "`." msgstr "" -#: ../../c-api/typeobj.rst:1372 +#: ../../c-api/typeobj.rst:1390 msgid "This flag is not inherited." msgstr "" -#: ../../c-api/typeobj.rst:1378 +#: ../../c-api/typeobj.rst:1396 msgid "" "Disallow creating instances of the type: set :c:member:`~PyTypeObject." "tp_new` to NULL and don't create the ``__new__`` key in the type dictionary." msgstr "" -#: ../../c-api/typeobj.rst:1382 +#: ../../c-api/typeobj.rst:1400 msgid "" "The flag must be set before creating the type, not after. For example, it " "must be set before :c:func:`PyType_Ready` is called on the type." msgstr "" -#: ../../c-api/typeobj.rst:1385 +#: ../../c-api/typeobj.rst:1403 msgid "" "The flag is set automatically on :ref:`static types ` if :c:" "member:`~PyTypeObject.tp_base` is NULL or ``&PyBaseObject_Type`` and :c:" "member:`~PyTypeObject.tp_new` is NULL." msgstr "" -#: ../../c-api/typeobj.rst:1391 +#: ../../c-api/typeobj.rst:1409 msgid "" "This flag is not inherited. However, subclasses will not be instantiable " "unless they provide a non-NULL :c:member:`~PyTypeObject.tp_new` (which is " "only possible via the C API)." msgstr "" -#: ../../c-api/typeobj.rst:1398 +#: ../../c-api/typeobj.rst:1416 msgid "" "To disallow instantiating a class directly but allow instantiating its " "subclasses (e.g. for an :term:`abstract base class`), do not use this flag. " "Instead, make :c:member:`~PyTypeObject.tp_new` only succeed for subclasses." msgstr "" -#: ../../c-api/typeobj.rst:1409 +#: ../../c-api/typeobj.rst:1427 msgid "" "This bit indicates that instances of the class may match mapping patterns " "when used as the subject of a :keyword:`match` block. It is automatically " @@ -2484,23 +2485,23 @@ msgid "" "unset when registering :class:`collections.abc.Sequence`." msgstr "" -#: ../../c-api/typeobj.rst:1416 ../../c-api/typeobj.rst:1438 +#: ../../c-api/typeobj.rst:1434 ../../c-api/typeobj.rst:1456 msgid "" ":c:macro:`Py_TPFLAGS_MAPPING` and :c:macro:`Py_TPFLAGS_SEQUENCE` are " "mutually exclusive; it is an error to enable both flags simultaneously." msgstr "" -#: ../../c-api/typeobj.rst:1421 +#: ../../c-api/typeobj.rst:1439 msgid "" "This flag is inherited by types that do not already set :c:macro:" "`Py_TPFLAGS_SEQUENCE`." msgstr "" -#: ../../c-api/typeobj.rst:1424 ../../c-api/typeobj.rst:1446 +#: ../../c-api/typeobj.rst:1442 ../../c-api/typeobj.rst:1464 msgid ":pep:`634` -- Structural Pattern Matching: Specification" msgstr "" -#: ../../c-api/typeobj.rst:1431 +#: ../../c-api/typeobj.rst:1449 msgid "" "This bit indicates that instances of the class may match sequence patterns " "when used as the subject of a :keyword:`match` block. It is automatically " @@ -2508,53 +2509,53 @@ msgid "" "unset when registering :class:`collections.abc.Mapping`." msgstr "" -#: ../../c-api/typeobj.rst:1443 +#: ../../c-api/typeobj.rst:1461 msgid "" "This flag is inherited by types that do not already set :c:macro:" "`Py_TPFLAGS_MAPPING`." msgstr "" -#: ../../c-api/typeobj.rst:1453 +#: ../../c-api/typeobj.rst:1471 msgid "" "Internal. Do not set or unset this flag. To indicate that a class has " "changed call :c:func:`PyType_Modified`" msgstr "" -#: ../../c-api/typeobj.rst:1457 +#: ../../c-api/typeobj.rst:1475 msgid "" "This flag is present in header files, but is not be used. It will be removed " "in a future version of CPython" msgstr "" -#: ../../c-api/typeobj.rst:1463 +#: ../../c-api/typeobj.rst:1483 msgid "" "An optional pointer to a NUL-terminated C string giving the docstring for " "this type object. This is exposed as the :attr:`~type.__doc__` attribute on " "the type and instances of the type." msgstr "" -#: ../../c-api/typeobj.rst:1469 +#: ../../c-api/typeobj.rst:1489 msgid "This field is *not* inherited by subtypes." msgstr "此欄位不會被子型別繼承。" -#: ../../c-api/typeobj.rst:1474 +#: ../../c-api/typeobj.rst:1496 msgid "" "An optional pointer to a traversal function for the garbage collector. This " "is only used if the :c:macro:`Py_TPFLAGS_HAVE_GC` flag bit is set. The " "signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1477 +#: ../../c-api/typeobj.rst:1499 msgid "int tp_traverse(PyObject *self, visitproc visit, void *arg);" msgstr "int tp_traverse(PyObject *self, visitproc visit, void *arg);" -#: ../../c-api/typeobj.rst:1479 ../../c-api/typeobj.rst:1699 +#: ../../c-api/typeobj.rst:1501 ../../c-api/typeobj.rst:1723 msgid "" "More information about Python's garbage collection scheme can be found in " "section :ref:`supporting-cycle-detection`." msgstr "" -#: ../../c-api/typeobj.rst:1482 +#: ../../c-api/typeobj.rst:1504 msgid "" "The :c:member:`~PyTypeObject.tp_traverse` pointer is used by the garbage " "collector to detect reference cycles. A typical implementation of a :c:" @@ -2564,7 +2565,7 @@ msgid "" "`!_thread` extension module::" msgstr "" -#: ../../c-api/typeobj.rst:1488 +#: ../../c-api/typeobj.rst:1510 msgid "" "static int\n" "local_traverse(PyObject *op, visitproc visit, void *arg)\n" @@ -2586,7 +2587,7 @@ msgstr "" " return 0;\n" "}" -#: ../../c-api/typeobj.rst:1498 +#: ../../c-api/typeobj.rst:1520 msgid "" "Note that :c:func:`Py_VISIT` is called only on those members that can " "participate in reference cycles. Although there is also a ``self->key`` " @@ -2594,29 +2595,29 @@ msgid "" "part of a reference cycle." msgstr "" -#: ../../c-api/typeobj.rst:1502 +#: ../../c-api/typeobj.rst:1524 msgid "" "On the other hand, even if you know a member can never be part of a cycle, " "as a debugging aid you may want to visit it anyway just so the :mod:`gc` " "module's :func:`~gc.get_referents` function will include it." msgstr "" -#: ../../c-api/typeobj.rst:1506 +#: ../../c-api/typeobj.rst:1528 msgid "" "Heap types (:c:macro:`Py_TPFLAGS_HEAPTYPE`) must visit their type with::" msgstr "" -#: ../../c-api/typeobj.rst:1508 +#: ../../c-api/typeobj.rst:1530 msgid "Py_VISIT(Py_TYPE(self));" msgstr "Py_VISIT(Py_TYPE(self));" -#: ../../c-api/typeobj.rst:1510 +#: ../../c-api/typeobj.rst:1532 msgid "" "It is only needed since Python 3.9. To support Python 3.8 and older, this " "line must be conditional::" msgstr "" -#: ../../c-api/typeobj.rst:1513 +#: ../../c-api/typeobj.rst:1535 msgid "" "#if PY_VERSION_HEX >= 0x03090000\n" " Py_VISIT(Py_TYPE(self));\n" @@ -2626,18 +2627,18 @@ msgstr "" " Py_VISIT(Py_TYPE(self));\n" "#endif" -#: ../../c-api/typeobj.rst:1517 +#: ../../c-api/typeobj.rst:1539 msgid "" "If the :c:macro:`Py_TPFLAGS_MANAGED_DICT` bit is set in the :c:member:" "`~PyTypeObject.tp_flags` field, the traverse function must call :c:func:" "`PyObject_VisitManagedDict` like this::" msgstr "" -#: ../../c-api/typeobj.rst:1521 +#: ../../c-api/typeobj.rst:1543 msgid "PyObject_VisitManagedDict((PyObject*)self, visit, arg);" msgstr "PyObject_VisitManagedDict((PyObject*)self, visit, arg);" -#: ../../c-api/typeobj.rst:1524 +#: ../../c-api/typeobj.rst:1546 msgid "" "When implementing :c:member:`~PyTypeObject.tp_traverse`, only the members " "that the instance *owns* (by having :term:`strong references ` hold a reference to " "their type. Their traversal function must therefore either visit :c:func:" @@ -2666,20 +2667,20 @@ msgid "" "superclass). If they do not, the type object may not be garbage-collected." msgstr "" -#: ../../c-api/typeobj.rst:1548 +#: ../../c-api/typeobj.rst:1570 msgid "" "The :c:member:`~PyTypeObject.tp_traverse` function can be called from any " "thread." msgstr ":c:member:`~PyTypeObject.tp_traverse` 函式可以從任何執行緒呼叫。" -#: ../../c-api/typeobj.rst:1553 +#: ../../c-api/typeobj.rst:1575 msgid "" "Heap-allocated types are expected to visit ``Py_TYPE(self)`` in " "``tp_traverse``. In earlier versions of Python, due to `bug 40217 `_, doing this may lead to crashes in subclasses." msgstr "" -#: ../../c-api/typeobj.rst:1562 +#: ../../c-api/typeobj.rst:1584 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_clear` and the :c:macro:`Py_TPFLAGS_HAVE_GC` flag bit: the flag bit, :c:" @@ -2687,15 +2688,15 @@ msgid "" "are all inherited from the base type if they are all zero in the subtype." msgstr "" -#: ../../c-api/typeobj.rst:1570 +#: ../../c-api/typeobj.rst:1594 msgid "An optional pointer to a clear function. The signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1572 +#: ../../c-api/typeobj.rst:1596 msgid "int tp_clear(PyObject *);" msgstr "int tp_clear(PyObject *);" -#: ../../c-api/typeobj.rst:1574 +#: ../../c-api/typeobj.rst:1598 msgid "" "The purpose of this function is to break reference cycles that are causing " "a :term:`cyclic isolate` so that the objects can be safely destroyed. A " @@ -2703,7 +2704,7 @@ msgid "" "to satisfy design invariants held during normal use." msgstr "" -#: ../../c-api/typeobj.rst:1579 +#: ../../c-api/typeobj.rst:1603 msgid "" ":c:member:`!tp_clear` does not need to delete references to objects that " "can't participate in reference cycles, such as Python strings or Python " @@ -2714,44 +2715,44 @@ msgid "" "func:`Py_CLEAR`.)" msgstr "" -#: ../../c-api/typeobj.rst:1587 +#: ../../c-api/typeobj.rst:1611 msgid "" "Any non-trivial cleanup should be performed in :c:member:`~PyTypeObject." "tp_finalize` instead of :c:member:`!tp_clear`." msgstr "" -#: ../../c-api/typeobj.rst:1592 +#: ../../c-api/typeobj.rst:1616 msgid "" "If :c:member:`!tp_clear` fails to break a reference cycle then the objects " "in the :term:`cyclic isolate` may remain indefinitely uncollectable " "(\"leak\"). See :data:`gc.garbage`." msgstr "" -#: ../../c-api/typeobj.rst:1598 +#: ../../c-api/typeobj.rst:1622 msgid "" "Referents (direct and indirect) might have already been cleared; they are " "not guaranteed to be in a consistent state." msgstr "" -#: ../../c-api/typeobj.rst:1603 +#: ../../c-api/typeobj.rst:1627 msgid "" "The :c:member:`~PyTypeObject.tp_clear` function can be called from any " "thread." msgstr ":c:member:`~PyTypeObject.tp_clear` 函式可以從任何執行緒呼叫。" -#: ../../c-api/typeobj.rst:1608 +#: ../../c-api/typeobj.rst:1632 msgid "" "An object is not guaranteed to be automatically cleared before its " "destructor (:c:member:`~PyTypeObject.tp_dealloc`) is called." msgstr "" -#: ../../c-api/typeobj.rst:1611 +#: ../../c-api/typeobj.rst:1635 msgid "" "This function differs from the destructor (:c:member:`~PyTypeObject." "tp_dealloc`) in the following ways:" msgstr "" -#: ../../c-api/typeobj.rst:1614 +#: ../../c-api/typeobj.rst:1638 msgid "" "The purpose of clearing an object is to remove references to other objects " "that might participate in a reference cycle. The purpose of the destructor, " @@ -2761,7 +2762,7 @@ msgid "" "`~PyTypeObject.tp_free`)." msgstr "" -#: ../../c-api/typeobj.rst:1620 +#: ../../c-api/typeobj.rst:1644 msgid "" "When :c:member:`!tp_clear` is called, other objects might still hold " "references to the object being cleared. Because of this, :c:member:`!" @@ -2771,7 +2772,7 @@ msgid "" "object itself by deallocating it." msgstr "" -#: ../../c-api/typeobj.rst:1626 +#: ../../c-api/typeobj.rst:1650 msgid "" ":c:member:`!tp_clear` might never be automatically called. An object's " "destructor, on the other hand, will be automatically called some time after " @@ -2779,20 +2780,20 @@ msgid "" "object or the object is a member of a :term:`cyclic isolate`)." msgstr "" -#: ../../c-api/typeobj.rst:1631 +#: ../../c-api/typeobj.rst:1655 msgid "" "No guarantees are made about when, if, or how often Python automatically " "clears an object, except:" msgstr "" -#: ../../c-api/typeobj.rst:1634 +#: ../../c-api/typeobj.rst:1658 msgid "" "Python will not automatically clear an object if it is reachable, i.e., " "there is a reference to it and it is not a member of a :term:`cyclic " "isolate`." msgstr "" -#: ../../c-api/typeobj.rst:1637 +#: ../../c-api/typeobj.rst:1661 msgid "" "Python will not automatically clear an object if it has not been " "automatically finalized (see :c:member:`~PyTypeObject.tp_finalize`). (If " @@ -2800,14 +2801,14 @@ msgid "" "automatically finalized again before it is cleared.)" msgstr "" -#: ../../c-api/typeobj.rst:1641 +#: ../../c-api/typeobj.rst:1665 msgid "" "If an object is a member of a :term:`cyclic isolate`, Python will not " "automatically clear it if any member of the cyclic isolate has not yet been " "automatically finalized (:c:member:`~PyTypeObject.tp_finalize`)." msgstr "" -#: ../../c-api/typeobj.rst:1644 +#: ../../c-api/typeobj.rst:1668 msgid "" "Python will not destroy an object until after any automatic calls to its :c:" "member:`!tp_clear` function have returned. This ensures that the act of " @@ -2815,20 +2816,20 @@ msgid "" "member:`!tp_clear` is still executing." msgstr "" -#: ../../c-api/typeobj.rst:1648 +#: ../../c-api/typeobj.rst:1672 msgid "" "Python will not automatically call :c:member:`!tp_clear` multiple times " "concurrently." msgstr "" -#: ../../c-api/typeobj.rst:1651 +#: ../../c-api/typeobj.rst:1675 msgid "" "CPython currently only automatically clears objects as needed to break " "reference cycles in a :term:`cyclic isolate`, but future versions might " "clear objects regularly before their destruction." msgstr "" -#: ../../c-api/typeobj.rst:1655 +#: ../../c-api/typeobj.rst:1679 msgid "" "Taken together, all :c:member:`~PyTypeObject.tp_clear` functions in the " "system must combine to break all reference cycles. This is subtle, and if " @@ -2841,7 +2842,7 @@ msgid "" "good reason to avoid implementing :c:member:`~PyTypeObject.tp_clear`." msgstr "" -#: ../../c-api/typeobj.rst:1666 +#: ../../c-api/typeobj.rst:1690 msgid "" "Implementations of :c:member:`~PyTypeObject.tp_clear` should drop the " "instance's references to those of its members that may be Python objects, " @@ -2849,7 +2850,7 @@ msgid "" "example::" msgstr "" -#: ../../c-api/typeobj.rst:1670 +#: ../../c-api/typeobj.rst:1694 msgid "" "static int\n" "local_clear(PyObject *op)\n" @@ -2873,7 +2874,7 @@ msgstr "" " return 0;\n" "}" -#: ../../c-api/typeobj.rst:1681 +#: ../../c-api/typeobj.rst:1705 msgid "" "The :c:func:`Py_CLEAR` macro should be used, because clearing references is " "delicate: the reference to the contained object must not be released (via :" @@ -2888,18 +2889,18 @@ msgid "" "performs the operations in a safe order." msgstr "" -#: ../../c-api/typeobj.rst:1693 +#: ../../c-api/typeobj.rst:1717 msgid "" "If the :c:macro:`Py_TPFLAGS_MANAGED_DICT` bit is set in the :c:member:" "`~PyTypeObject.tp_flags` field, the clear function must call :c:func:" "`PyObject_ClearManagedDict` like this::" msgstr "" -#: ../../c-api/typeobj.rst:1697 +#: ../../c-api/typeobj.rst:1721 msgid "PyObject_ClearManagedDict((PyObject*)self);" msgstr "PyObject_ClearManagedDict((PyObject*)self);" -#: ../../c-api/typeobj.rst:1706 +#: ../../c-api/typeobj.rst:1730 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_traverse` and the :c:macro:`Py_TPFLAGS_HAVE_GC` flag bit: the flag bit, :" @@ -2907,22 +2908,22 @@ msgid "" "are all inherited from the base type if they are all zero in the subtype." msgstr "" -#: ../../c-api/typeobj.rst:1718 +#: ../../c-api/typeobj.rst:1744 msgid "" "An optional pointer to the rich comparison function, whose signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1720 +#: ../../c-api/typeobj.rst:1746 msgid "PyObject *tp_richcompare(PyObject *self, PyObject *other, int op);" msgstr "PyObject *tp_richcompare(PyObject *self, PyObject *other, int op);" -#: ../../c-api/typeobj.rst:1722 +#: ../../c-api/typeobj.rst:1748 msgid "" "The first parameter is guaranteed to be an instance of the type that is " "defined by :c:type:`PyTypeObject`." msgstr "" -#: ../../c-api/typeobj.rst:1725 +#: ../../c-api/typeobj.rst:1751 msgid "" "The function should return the result of the comparison (usually ``Py_True`` " "or ``Py_False``). If the comparison is undefined, it must return " @@ -2930,50 +2931,50 @@ msgid "" "set an exception condition." msgstr "" -#: ../../c-api/typeobj.rst:1730 +#: ../../c-api/typeobj.rst:1756 msgid "" "The following constants are defined to be used as the third argument for :c:" "member:`~PyTypeObject.tp_richcompare` and for :c:func:`PyObject_RichCompare`:" msgstr "" -#: ../../c-api/typeobj.rst:1736 +#: ../../c-api/typeobj.rst:1762 msgid "Constant" msgstr "常數" -#: ../../c-api/typeobj.rst:1736 +#: ../../c-api/typeobj.rst:1762 msgid "Comparison" msgstr "" -#: ../../c-api/typeobj.rst:1738 +#: ../../c-api/typeobj.rst:1764 msgid "``<``" msgstr "``<``" -#: ../../c-api/typeobj.rst:1740 +#: ../../c-api/typeobj.rst:1766 msgid "``<=``" msgstr "``<=``" -#: ../../c-api/typeobj.rst:1742 +#: ../../c-api/typeobj.rst:1768 msgid "``==``" msgstr "``==``" -#: ../../c-api/typeobj.rst:1744 +#: ../../c-api/typeobj.rst:1770 msgid "``!=``" msgstr "``!=``" -#: ../../c-api/typeobj.rst:1746 +#: ../../c-api/typeobj.rst:1772 msgid "``>``" msgstr "``>``" -#: ../../c-api/typeobj.rst:1748 +#: ../../c-api/typeobj.rst:1774 msgid "``>=``" msgstr "``>=``" -#: ../../c-api/typeobj.rst:1751 +#: ../../c-api/typeobj.rst:1777 msgid "" "The following macro is defined to ease writing rich comparison functions:" msgstr "" -#: ../../c-api/typeobj.rst:1755 +#: ../../c-api/typeobj.rst:1781 msgid "" "Return ``Py_True`` or ``Py_False`` from the function, depending on the " "result of a comparison. VAL_A and VAL_B must be orderable by C comparison " @@ -2981,15 +2982,15 @@ msgid "" "specifies the requested operation, as for :c:func:`PyObject_RichCompare`." msgstr "" -#: ../../c-api/typeobj.rst:1761 +#: ../../c-api/typeobj.rst:1787 msgid "The returned value is a new :term:`strong reference`." msgstr "" -#: ../../c-api/typeobj.rst:1763 +#: ../../c-api/typeobj.rst:1789 msgid "On error, sets an exception and returns ``NULL`` from the function." msgstr "" -#: ../../c-api/typeobj.rst:1771 +#: ../../c-api/typeobj.rst:1797 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_hash`: a subtype inherits :c:member:`~PyTypeObject.tp_richcompare` and :c:" @@ -2997,7 +2998,7 @@ msgid "" "tp_richcompare` and :c:member:`~PyTypeObject.tp_hash` are both ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:1778 +#: ../../c-api/typeobj.rst:1804 msgid "" ":c:data:`PyBaseObject_Type` provides a :c:member:`~PyTypeObject." "tp_richcompare` implementation, which may be inherited. However, if only :c:" @@ -3006,13 +3007,13 @@ msgid "" "comparisons." msgstr "" -#: ../../c-api/typeobj.rst:1787 +#: ../../c-api/typeobj.rst:1813 msgid "" "While this field is still supported, :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` " "should be used instead, if at all possible." msgstr "" -#: ../../c-api/typeobj.rst:1790 +#: ../../c-api/typeobj.rst:1816 msgid "" "If the instances of this type are weakly referenceable, this field is " "greater than zero and contains the offset in the instance structure of the " @@ -3022,19 +3023,19 @@ msgid "" "`PyObject*` which is initialized to ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:1797 +#: ../../c-api/typeobj.rst:1823 msgid "" "Do not confuse this field with :c:member:`~PyTypeObject.tp_weaklist`; that " "is the list head for weak references to the type object itself." msgstr "" -#: ../../c-api/typeobj.rst:1800 +#: ../../c-api/typeobj.rst:1826 msgid "" "It is an error to set both the :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` bit " "and :c:member:`~PyTypeObject.tp_weaklistoffset`." msgstr "" -#: ../../c-api/typeobj.rst:1805 +#: ../../c-api/typeobj.rst:1831 msgid "" "This field is inherited by subtypes, but see the rules listed below. A " "subtype may override this offset; this means that the subtype uses a " @@ -3043,7 +3044,7 @@ msgid "" "not be a problem." msgstr "" -#: ../../c-api/typeobj.rst:1812 +#: ../../c-api/typeobj.rst:1838 msgid "" "If the :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` bit is set in the :c:member:" "`~PyTypeObject.tp_flags` field, then :c:member:`~PyTypeObject." @@ -3051,32 +3052,32 @@ msgid "" "unsafe to use this field." msgstr "" -#: ../../c-api/typeobj.rst:1820 +#: ../../c-api/typeobj.rst:1848 msgid "" "An optional pointer to a function that returns an :term:`iterator` for the " "object. Its presence normally signals that the instances of this type are :" "term:`iterable` (although sequences may be iterable without this function)." msgstr "" -#: ../../c-api/typeobj.rst:1824 +#: ../../c-api/typeobj.rst:1852 msgid "This function has the same signature as :c:func:`PyObject_GetIter`::" msgstr "" -#: ../../c-api/typeobj.rst:1826 +#: ../../c-api/typeobj.rst:1854 msgid "PyObject *tp_iter(PyObject *self);" msgstr "PyObject *tp_iter(PyObject *self);" -#: ../../c-api/typeobj.rst:1835 +#: ../../c-api/typeobj.rst:1865 msgid "" "An optional pointer to a function that returns the next item in an :term:" "`iterator`. The signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1838 +#: ../../c-api/typeobj.rst:1868 msgid "PyObject *tp_iternext(PyObject *self);" msgstr "PyObject *tp_iternext(PyObject *self);" -#: ../../c-api/typeobj.rst:1840 +#: ../../c-api/typeobj.rst:1870 msgid "" "When the iterator is exhausted, it must return ``NULL``; a :exc:" "`StopIteration` exception may or may not be set. When another error occurs, " @@ -3084,74 +3085,74 @@ msgid "" "this type are iterators." msgstr "" -#: ../../c-api/typeobj.rst:1845 +#: ../../c-api/typeobj.rst:1875 msgid "" "Iterator types should also define the :c:member:`~PyTypeObject.tp_iter` " "function, and that function should return the iterator instance itself (not " "a new iterator instance)." msgstr "" -#: ../../c-api/typeobj.rst:1849 +#: ../../c-api/typeobj.rst:1879 msgid "This function has the same signature as :c:func:`PyIter_Next`." msgstr "" -#: ../../c-api/typeobj.rst:1858 +#: ../../c-api/typeobj.rst:1890 msgid "" "An optional pointer to a static ``NULL``-terminated array of :c:type:" "`PyMethodDef` structures, declaring regular methods of this type." msgstr "" -#: ../../c-api/typeobj.rst:1861 +#: ../../c-api/typeobj.rst:1893 msgid "" "For each entry in the array, an entry is added to the type's dictionary " "(see :c:member:`~PyTypeObject.tp_dict` below) containing a method descriptor." msgstr "" -#: ../../c-api/typeobj.rst:1866 +#: ../../c-api/typeobj.rst:1898 msgid "" "This field is not inherited by subtypes (methods are inherited through a " "different mechanism)." msgstr "" -#: ../../c-api/typeobj.rst:1872 +#: ../../c-api/typeobj.rst:1906 msgid "" "An optional pointer to a static ``NULL``-terminated array of :c:type:" "`PyMemberDef` structures, declaring regular data members (fields or slots) " "of instances of this type." msgstr "" -#: ../../c-api/typeobj.rst:1876 +#: ../../c-api/typeobj.rst:1910 msgid "" "For each entry in the array, an entry is added to the type's dictionary " "(see :c:member:`~PyTypeObject.tp_dict` below) containing a member descriptor." msgstr "" -#: ../../c-api/typeobj.rst:1881 +#: ../../c-api/typeobj.rst:1915 msgid "" "This field is not inherited by subtypes (members are inherited through a " "different mechanism)." msgstr "" -#: ../../c-api/typeobj.rst:1887 +#: ../../c-api/typeobj.rst:1923 msgid "" "An optional pointer to a static ``NULL``-terminated array of :c:type:" "`PyGetSetDef` structures, declaring computed attributes of instances of this " "type." msgstr "" -#: ../../c-api/typeobj.rst:1890 +#: ../../c-api/typeobj.rst:1926 msgid "" "For each entry in the array, an entry is added to the type's dictionary " "(see :c:member:`~PyTypeObject.tp_dict` below) containing a getset descriptor." msgstr "" -#: ../../c-api/typeobj.rst:1895 +#: ../../c-api/typeobj.rst:1931 msgid "" "This field is not inherited by subtypes (computed attributes are inherited " "through a different mechanism)." msgstr "" -#: ../../c-api/typeobj.rst:1901 +#: ../../c-api/typeobj.rst:1939 msgid "" "An optional pointer to a base type from which type properties are " "inherited. At this level, only single inheritance is supported; multiple " @@ -3159,7 +3160,7 @@ msgid "" "metatype." msgstr "" -#: ../../c-api/typeobj.rst:1909 +#: ../../c-api/typeobj.rst:1947 msgid "" "Slot initialization is subject to the rules of initializing globals. C99 " "requires the initializers to be \"address constants\". Function designators " @@ -3167,7 +3168,7 @@ msgid "" "valid C99 address constants." msgstr "" -#: ../../c-api/typeobj.rst:1914 +#: ../../c-api/typeobj.rst:1952 msgid "" "However, the unary '&' operator applied to a non-static variable like :c:" "data:`PyBaseObject_Type` is not required to produce an address constant. " @@ -3175,27 +3176,27 @@ msgid "" "strictly standard conforming in this particular behavior." msgstr "" -#: ../../c-api/typeobj.rst:1920 +#: ../../c-api/typeobj.rst:1958 msgid "" "Consequently, :c:member:`~PyTypeObject.tp_base` should be set in the " "extension module's init function." msgstr "" -#: ../../c-api/typeobj.rst:1925 +#: ../../c-api/typeobj.rst:1963 msgid "This field is not inherited by subtypes (obviously)." msgstr "" -#: ../../c-api/typeobj.rst:1929 +#: ../../c-api/typeobj.rst:1967 msgid "" "This field defaults to ``&PyBaseObject_Type`` (which to Python programmers " "is known as the type :class:`object`)." msgstr "" -#: ../../c-api/typeobj.rst:1935 +#: ../../c-api/typeobj.rst:1973 msgid "The type's dictionary is stored here by :c:func:`PyType_Ready`." msgstr "" -#: ../../c-api/typeobj.rst:1937 +#: ../../c-api/typeobj.rst:1975 msgid "" "This field should normally be initialized to ``NULL`` before PyType_Ready is " "called; it may also be initialized to a dictionary containing initial " @@ -3206,73 +3207,73 @@ msgid "" "be treated as read-only." msgstr "" -#: ../../c-api/typeobj.rst:1945 +#: ../../c-api/typeobj.rst:1983 msgid "" "Some types may not store their dictionary in this slot. Use :c:func:" "`PyType_GetDict` to retrieve the dictionary for an arbitrary type." msgstr "" -#: ../../c-api/typeobj.rst:1951 +#: ../../c-api/typeobj.rst:1989 msgid "" "Internals detail: For static builtin types, this is always ``NULL``. " "Instead, the dict for such types is stored on ``PyInterpreterState``. Use :c:" "func:`PyType_GetDict` to get the dict for an arbitrary type." msgstr "" -#: ../../c-api/typeobj.rst:1957 +#: ../../c-api/typeobj.rst:1995 msgid "" "This field is not inherited by subtypes (though the attributes defined in " "here are inherited through a different mechanism)." msgstr "" -#: ../../c-api/typeobj.rst:1962 +#: ../../c-api/typeobj.rst:2000 msgid "" "If this field is ``NULL``, :c:func:`PyType_Ready` will assign a new " "dictionary to it." msgstr "" -#: ../../c-api/typeobj.rst:1967 +#: ../../c-api/typeobj.rst:2005 msgid "" "It is not safe to use :c:func:`PyDict_SetItem` on or otherwise modify :c:" "member:`~PyTypeObject.tp_dict` with the dictionary C-API." msgstr "" -#: ../../c-api/typeobj.rst:1973 +#: ../../c-api/typeobj.rst:2013 msgid "An optional pointer to a \"descriptor get\" function." msgstr "" -#: ../../c-api/typeobj.rst:1975 ../../c-api/typeobj.rst:1991 -#: ../../c-api/typeobj.rst:2055 ../../c-api/typeobj.rst:2085 -#: ../../c-api/typeobj.rst:2108 +#: ../../c-api/typeobj.rst:2015 ../../c-api/typeobj.rst:2033 +#: ../../c-api/typeobj.rst:2099 ../../c-api/typeobj.rst:2131 +#: ../../c-api/typeobj.rst:2156 msgid "The function signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1977 +#: ../../c-api/typeobj.rst:2017 msgid "PyObject * tp_descr_get(PyObject *self, PyObject *obj, PyObject *type);" msgstr "" "PyObject * tp_descr_get(PyObject *self, PyObject *obj, PyObject *type);" -#: ../../c-api/typeobj.rst:1988 +#: ../../c-api/typeobj.rst:2030 msgid "" "An optional pointer to a function for setting and deleting a descriptor's " "value." msgstr "" -#: ../../c-api/typeobj.rst:1993 +#: ../../c-api/typeobj.rst:2035 msgid "int tp_descr_set(PyObject *self, PyObject *obj, PyObject *value);" msgstr "int tp_descr_set(PyObject *self, PyObject *obj, PyObject *value);" -#: ../../c-api/typeobj.rst:1995 +#: ../../c-api/typeobj.rst:2037 msgid "The *value* argument is set to ``NULL`` to delete the value." msgstr "" -#: ../../c-api/typeobj.rst:2006 +#: ../../c-api/typeobj.rst:2048 msgid "" "While this field is still supported, :c:macro:`Py_TPFLAGS_MANAGED_DICT` " "should be used instead, if at all possible." msgstr "" -#: ../../c-api/typeobj.rst:2009 +#: ../../c-api/typeobj.rst:2051 msgid "" "If the instances of this type have a dictionary containing instance " "variables, this field is non-zero and contains the offset in the instances " @@ -3280,19 +3281,19 @@ msgid "" "func:`PyObject_GenericGetAttr`." msgstr "" -#: ../../c-api/typeobj.rst:2014 +#: ../../c-api/typeobj.rst:2056 msgid "" "Do not confuse this field with :c:member:`~PyTypeObject.tp_dict`; that is " "the dictionary for attributes of the type object itself." msgstr "" -#: ../../c-api/typeobj.rst:2017 +#: ../../c-api/typeobj.rst:2059 msgid "" "The value specifies the offset of the dictionary from the start of the " "instance structure." msgstr "" -#: ../../c-api/typeobj.rst:2019 +#: ../../c-api/typeobj.rst:2061 msgid "" "The :c:member:`~PyTypeObject.tp_dictoffset` should be regarded as write-" "only. To get the pointer to the dictionary call :c:func:" @@ -3301,13 +3302,13 @@ msgid "" "to call :c:func:`PyObject_GetAttr` when accessing an attribute on the object." msgstr "" -#: ../../c-api/typeobj.rst:2025 +#: ../../c-api/typeobj.rst:2067 msgid "" "It is an error to set both the :c:macro:`Py_TPFLAGS_MANAGED_DICT` bit and :c:" "member:`~PyTypeObject.tp_dictoffset`." msgstr "" -#: ../../c-api/typeobj.rst:2030 +#: ../../c-api/typeobj.rst:2072 msgid "" "This field is inherited by subtypes. A subtype should not override this " "offset; doing so could be unsafe, if C code tries to access the dictionary " @@ -3315,25 +3316,25 @@ msgid "" "`Py_TPFLAGS_MANAGED_DICT`." msgstr "" -#: ../../c-api/typeobj.rst:2037 +#: ../../c-api/typeobj.rst:2079 msgid "" "This slot has no default. For :ref:`static types `, if the " "field is ``NULL`` then no :attr:`~object.__dict__` gets created for " "instances." msgstr "" -#: ../../c-api/typeobj.rst:2040 +#: ../../c-api/typeobj.rst:2082 msgid "" "If the :c:macro:`Py_TPFLAGS_MANAGED_DICT` bit is set in the :c:member:" "`~PyTypeObject.tp_flags` field, then :c:member:`~PyTypeObject.tp_dictoffset` " "will be set to ``-1``, to indicate that it is unsafe to use this field." msgstr "" -#: ../../c-api/typeobj.rst:2048 +#: ../../c-api/typeobj.rst:2092 msgid "An optional pointer to an instance initialization function." msgstr "" -#: ../../c-api/typeobj.rst:2050 +#: ../../c-api/typeobj.rst:2094 msgid "" "This function corresponds to the :meth:`~object.__init__` method of " "classes. Like :meth:`!__init__`, it is possible to create an instance " @@ -3341,18 +3342,18 @@ msgid "" "instance by calling its :meth:`!__init__` method again." msgstr "" -#: ../../c-api/typeobj.rst:2057 +#: ../../c-api/typeobj.rst:2101 msgid "int tp_init(PyObject *self, PyObject *args, PyObject *kwds);" msgstr "int tp_init(PyObject *self, PyObject *args, PyObject *kwds);" -#: ../../c-api/typeobj.rst:2059 +#: ../../c-api/typeobj.rst:2103 msgid "" "The self argument is the instance to be initialized; the *args* and *kwds* " "arguments represent positional and keyword arguments of the call to :meth:" "`~object.__init__`." msgstr "" -#: ../../c-api/typeobj.rst:2063 +#: ../../c-api/typeobj.rst:2107 msgid "" "The :c:member:`~PyTypeObject.tp_init` function, if not ``NULL``, is called " "when an instance is created normally by calling its type, after the type's :" @@ -3364,53 +3365,53 @@ msgid "" "subtype's :c:member:`~PyTypeObject.tp_init` is called." msgstr "" -#: ../../c-api/typeobj.rst:2070 +#: ../../c-api/typeobj.rst:2114 msgid "Returns ``0`` on success, ``-1`` and sets an exception on error." msgstr "" -#: ../../c-api/typeobj.rst:2078 +#: ../../c-api/typeobj.rst:2122 msgid "" "For :ref:`static types ` this field does not have a default." msgstr "" -#: ../../c-api/typeobj.rst:2083 +#: ../../c-api/typeobj.rst:2129 msgid "An optional pointer to an instance allocation function." msgstr "" -#: ../../c-api/typeobj.rst:2087 +#: ../../c-api/typeobj.rst:2133 msgid "PyObject *tp_alloc(PyTypeObject *self, Py_ssize_t nitems);" msgstr "PyObject *tp_alloc(PyTypeObject *self, Py_ssize_t nitems);" -#: ../../c-api/typeobj.rst:2091 +#: ../../c-api/typeobj.rst:2137 msgid "" "Static subtypes inherit this slot, which will be :c:func:" "`PyType_GenericAlloc` if inherited from :class:`object`." msgstr "" -#: ../../c-api/typeobj.rst:2094 ../../c-api/typeobj.rst:2161 +#: ../../c-api/typeobj.rst:2140 ../../c-api/typeobj.rst:2211 msgid ":ref:`Heap subtypes ` do not inherit this slot." msgstr "" -#: ../../c-api/typeobj.rst:2098 +#: ../../c-api/typeobj.rst:2144 msgid "" "For heap subtypes, this field is always set to :c:func:`PyType_GenericAlloc`." msgstr "" -#: ../../c-api/typeobj.rst:2101 ../../c-api/typeobj.rst:2169 +#: ../../c-api/typeobj.rst:2147 ../../c-api/typeobj.rst:2219 msgid "For static subtypes, this slot is inherited (see above)." msgstr "" -#: ../../c-api/typeobj.rst:2106 +#: ../../c-api/typeobj.rst:2154 msgid "An optional pointer to an instance creation function." msgstr "" -#: ../../c-api/typeobj.rst:2110 +#: ../../c-api/typeobj.rst:2158 msgid "" "PyObject *tp_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds);" msgstr "" "PyObject *tp_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds);" -#: ../../c-api/typeobj.rst:2112 +#: ../../c-api/typeobj.rst:2160 msgid "" "The *subtype* argument is the type of the object being created; the *args* " "and *kwds* arguments represent positional and keyword arguments of the call " @@ -3419,7 +3420,7 @@ msgid "" "that type (but not an unrelated type)." msgstr "" -#: ../../c-api/typeobj.rst:2118 +#: ../../c-api/typeobj.rst:2166 msgid "" "The :c:member:`~PyTypeObject.tp_new` function should call ``subtype-" ">tp_alloc(subtype, nitems)`` to allocate space for the object, and then do " @@ -3431,20 +3432,20 @@ msgid "" "be deferred to :c:member:`~PyTypeObject.tp_init`." msgstr "" -#: ../../c-api/typeobj.rst:2126 +#: ../../c-api/typeobj.rst:2174 msgid "" "Set the :c:macro:`Py_TPFLAGS_DISALLOW_INSTANTIATION` flag to disallow " "creating instances of the type in Python." msgstr "" -#: ../../c-api/typeobj.rst:2131 +#: ../../c-api/typeobj.rst:2179 msgid "" "This field is inherited by subtypes, except it is not inherited by :ref:" "`static types ` whose :c:member:`~PyTypeObject.tp_base` is " "``NULL`` or ``&PyBaseObject_Type``." msgstr "" -#: ../../c-api/typeobj.rst:2137 +#: ../../c-api/typeobj.rst:2185 msgid "" "For :ref:`static types ` this field has no default. This means " "if the slot is defined as ``NULL``, the type cannot be called to create new " @@ -3452,22 +3453,22 @@ msgid "" "factory function." msgstr "" -#: ../../c-api/typeobj.rst:2145 +#: ../../c-api/typeobj.rst:2195 msgid "" "An optional pointer to an instance deallocation function. Its signature is::" msgstr "" -#: ../../c-api/typeobj.rst:2147 +#: ../../c-api/typeobj.rst:2197 msgid "void tp_free(void *self);" msgstr "void tp_free(void *self);" -#: ../../c-api/typeobj.rst:2149 +#: ../../c-api/typeobj.rst:2199 msgid "" "This function must free the memory allocated by :c:member:`~PyTypeObject." "tp_alloc`." msgstr "" -#: ../../c-api/typeobj.rst:2154 +#: ../../c-api/typeobj.rst:2204 msgid "" "Static subtypes inherit this slot, which will be :c:func:`PyObject_Free` if " "inherited from :class:`object`. Exception: If the type supports garbage " @@ -3476,18 +3477,18 @@ msgid "" "this slot is not inherited but instead defaults to :c:func:`PyObject_GC_Del`." msgstr "" -#: ../../c-api/typeobj.rst:2165 +#: ../../c-api/typeobj.rst:2215 msgid "" "For :ref:`heap subtypes `, this slot defaults to a deallocator " "suitable to match :c:func:`PyType_GenericAlloc` and the value of the :c:" "macro:`Py_TPFLAGS_HAVE_GC` flag." msgstr "" -#: ../../c-api/typeobj.rst:2174 +#: ../../c-api/typeobj.rst:2226 msgid "An optional pointer to a function called by the garbage collector." msgstr "" -#: ../../c-api/typeobj.rst:2176 +#: ../../c-api/typeobj.rst:2228 msgid "" "The garbage collector needs to know whether a particular object is " "collectible or not. Normally, it is sufficient to look at the object's " @@ -3499,93 +3500,93 @@ msgid "" "instance. The signature is::" msgstr "" -#: ../../c-api/typeobj.rst:2184 +#: ../../c-api/typeobj.rst:2236 msgid "int tp_is_gc(PyObject *self);" msgstr "int tp_is_gc(PyObject *self);" -#: ../../c-api/typeobj.rst:2186 +#: ../../c-api/typeobj.rst:2238 msgid "" "(The only example of this are types themselves. The metatype, :c:data:" "`PyType_Type`, defines this function to distinguish between statically and :" "ref:`dynamically allocated types `.)" msgstr "" -#: ../../c-api/typeobj.rst:2196 +#: ../../c-api/typeobj.rst:2248 msgid "" "This slot has no default. If this field is ``NULL``, :c:macro:" "`Py_TPFLAGS_HAVE_GC` is used as the functional equivalent." msgstr "" -#: ../../c-api/typeobj.rst:2202 +#: ../../c-api/typeobj.rst:2256 msgid "Tuple of base types." msgstr "" -#: ../../c-api/typeobj.rst:2204 ../../c-api/typeobj.rst:2228 +#: ../../c-api/typeobj.rst:2258 ../../c-api/typeobj.rst:2282 msgid "" "This field should be set to ``NULL`` and treated as read-only. Python will " "fill it in when the type is :c:func:`initialized `." msgstr "" -#: ../../c-api/typeobj.rst:2207 +#: ../../c-api/typeobj.rst:2261 msgid "" "For dynamically created classes, the ``Py_tp_bases`` :c:type:`slot " "` can be used instead of the *bases* argument of :c:func:" "`PyType_FromSpecWithBases`. The argument form is preferred." msgstr "" -#: ../../c-api/typeobj.rst:2214 +#: ../../c-api/typeobj.rst:2268 msgid "" "Multiple inheritance does not work well for statically defined types. If you " "set ``tp_bases`` to a tuple, Python will not raise an error, but some slots " "will only be inherited from the first base." msgstr "" -#: ../../c-api/typeobj.rst:2220 ../../c-api/typeobj.rst:2243 -#: ../../c-api/typeobj.rst:2260 ../../c-api/typeobj.rst:2277 -#: ../../c-api/typeobj.rst:2291 +#: ../../c-api/typeobj.rst:2274 ../../c-api/typeobj.rst:2297 +#: ../../c-api/typeobj.rst:2314 ../../c-api/typeobj.rst:2331 +#: ../../c-api/typeobj.rst:2347 msgid "This field is not inherited." msgstr "" -#: ../../c-api/typeobj.rst:2225 +#: ../../c-api/typeobj.rst:2279 msgid "" "Tuple containing the expanded set of base types, starting with the type " "itself and ending with :class:`object`, in Method Resolution Order." msgstr "" -#: ../../c-api/typeobj.rst:2233 +#: ../../c-api/typeobj.rst:2287 msgid "" "This field is not inherited; it is calculated fresh by :c:func:" "`PyType_Ready`." msgstr "" -#: ../../c-api/typeobj.rst:2239 +#: ../../c-api/typeobj.rst:2293 msgid "Unused. Internal use only." msgstr "" -#: ../../c-api/typeobj.rst:2248 +#: ../../c-api/typeobj.rst:2302 msgid "" "A collection of subclasses. Internal use only. May be an invalid pointer." msgstr "" -#: ../../c-api/typeobj.rst:2250 +#: ../../c-api/typeobj.rst:2304 msgid "" "To get a list of subclasses, call the Python method :py:meth:`~type." "__subclasses__`." msgstr "" -#: ../../c-api/typeobj.rst:2255 +#: ../../c-api/typeobj.rst:2309 msgid "" "For some types, this field does not hold a valid :c:expr:`PyObject*`. The " "type was changed to :c:expr:`void*` to indicate this." msgstr "" -#: ../../c-api/typeobj.rst:2265 +#: ../../c-api/typeobj.rst:2319 msgid "" "Weak reference list head, for weak references to this type object. Not " "inherited. Internal use only." msgstr "" -#: ../../c-api/typeobj.rst:2270 +#: ../../c-api/typeobj.rst:2324 msgid "" "Internals detail: For the static builtin types this is always ``NULL``, even " "if weakrefs are added. Instead, the weakrefs for each are stored on " @@ -3593,27 +3594,27 @@ msgid "" "``_PyObject_GET_WEAKREFS_LISTPTR()`` macro to avoid the distinction." msgstr "" -#: ../../c-api/typeobj.rst:2282 +#: ../../c-api/typeobj.rst:2338 msgid "" "This field is deprecated. Use :c:member:`~PyTypeObject.tp_finalize` instead." msgstr "此欄位已被棄用。請改用 :c:member:`~PyTypeObject.tp_finalize`。" -#: ../../c-api/typeobj.rst:2287 +#: ../../c-api/typeobj.rst:2343 msgid "Used to index into the method cache. Internal use only." msgstr "" -#: ../../c-api/typeobj.rst:2296 +#: ../../c-api/typeobj.rst:2354 msgid "" "An optional pointer to an instance finalization function. This is the C " "implementation of the :meth:`~object.__del__` special method. Its signature " "is::" msgstr "" -#: ../../c-api/typeobj.rst:2300 +#: ../../c-api/typeobj.rst:2358 msgid "void tp_finalize(PyObject *self);" msgstr "void tp_finalize(PyObject *self);" -#: ../../c-api/typeobj.rst:2302 +#: ../../c-api/typeobj.rst:2360 msgid "" "The primary purpose of finalization is to perform any non-trivial cleanup " "that must be performed before the object is destroyed, while the object and " @@ -3621,7 +3622,7 @@ msgid "" "consistent state. The finalizer is allowed to execute arbitrary Python code." msgstr "" -#: ../../c-api/typeobj.rst:2308 +#: ../../c-api/typeobj.rst:2366 msgid "" "Before Python automatically finalizes an object, some of the object's direct " "or indirect referents might have themselves been automatically finalized. " @@ -3629,14 +3630,14 @@ msgid "" "member:`~PyTypeObject.tp_clear`) yet." msgstr "" -#: ../../c-api/typeobj.rst:2313 +#: ../../c-api/typeobj.rst:2371 msgid "" "Other non-finalized objects might still be using a finalized object, so the " "finalizer must leave the object in a sane state (e.g., invariants are still " "met)." msgstr "" -#: ../../c-api/typeobj.rst:2319 +#: ../../c-api/typeobj.rst:2377 msgid "" "After Python automatically finalizes an object, Python might start " "automatically clearing (:c:member:`~PyTypeObject.tp_clear`) the object and " @@ -3645,7 +3646,7 @@ msgid "" "cleared referents." msgstr "" -#: ../../c-api/typeobj.rst:2327 +#: ../../c-api/typeobj.rst:2385 msgid "" "An object is not guaranteed to be automatically finalized before its " "destructor (:c:member:`~PyTypeObject.tp_dealloc`) is called. It is " @@ -3654,25 +3655,25 @@ msgid "" "finalized before destruction." msgstr "" -#: ../../c-api/typeobj.rst:2335 +#: ../../c-api/typeobj.rst:2393 msgid "" "The :c:member:`~PyTypeObject.tp_finalize` function can be called from any " "thread, although the :term:`GIL` will be held." msgstr "" -#: ../../c-api/typeobj.rst:2340 +#: ../../c-api/typeobj.rst:2398 msgid "" "The :c:member:`!tp_finalize` function can be called during shutdown, after " "some global variables have been deleted. See the documentation of the :meth:" "`~object.__del__` method for details." msgstr "" -#: ../../c-api/typeobj.rst:2344 +#: ../../c-api/typeobj.rst:2402 msgid "" "When Python finalizes an object, it behaves like the following algorithm:" msgstr "" -#: ../../c-api/typeobj.rst:2346 +#: ../../c-api/typeobj.rst:2404 msgid "" "Python might mark the object as *finalized*. Currently, Python always marks " "objects whose type supports garbage collection (i.e., the :c:macro:" @@ -3680,13 +3681,13 @@ msgid "" "never marks other types of objects; this might change in a future version." msgstr "" -#: ../../c-api/typeobj.rst:2351 +#: ../../c-api/typeobj.rst:2409 msgid "" "If the object is not marked as *finalized* and its :c:member:`!tp_finalize` " "finalizer function is non-``NULL``, the finalizer function is called." msgstr "" -#: ../../c-api/typeobj.rst:2354 +#: ../../c-api/typeobj.rst:2412 msgid "" "If the finalizer function was called and the finalizer made the object " "reachable (i.e., there is a reference to the object and it is not a member " @@ -3696,7 +3697,7 @@ msgid "" "make it reachable, i.e., the object is (still) a member of a cyclic isolate." msgstr "" -#: ../../c-api/typeobj.rst:2361 +#: ../../c-api/typeobj.rst:2419 msgid "" "If the finalizer resurrected the object, the object's pending destruction is " "canceled and the object's *finalized* mark might be removed if present. " @@ -3704,7 +3705,7 @@ msgid "" "future version." msgstr "" -#: ../../c-api/typeobj.rst:2366 +#: ../../c-api/typeobj.rst:2424 msgid "" "*Automatic finalization* refers to any finalization performed by Python " "except via calls to :c:func:`PyObject_CallFinalizer` or :c:func:" @@ -3712,14 +3713,14 @@ msgid "" "or how often an object is automatically finalized, except:" msgstr "" -#: ../../c-api/typeobj.rst:2371 +#: ../../c-api/typeobj.rst:2429 msgid "" "Python will not automatically finalize an object if it is reachable, i.e., " "there is a reference to it and it is not a member of a :term:`cyclic " "isolate`." msgstr "" -#: ../../c-api/typeobj.rst:2374 +#: ../../c-api/typeobj.rst:2432 msgid "" "Python will not automatically finalize an object if finalizing it would not " "mark the object as *finalized*. Currently, this applies to objects whose " @@ -3729,53 +3730,53 @@ msgid "" "`PyObject_CallFinalizerFromDealloc`." msgstr "" -#: ../../c-api/typeobj.rst:2380 +#: ../../c-api/typeobj.rst:2438 msgid "" "Python will not automatically finalize any two members of a :term:`cyclic " "isolate` concurrently." msgstr "" -#: ../../c-api/typeobj.rst:2382 +#: ../../c-api/typeobj.rst:2440 msgid "" "Python will not automatically finalize an object after it has automatically " "cleared (:c:member:`~PyTypeObject.tp_clear`) the object." msgstr "" -#: ../../c-api/typeobj.rst:2384 +#: ../../c-api/typeobj.rst:2442 msgid "" "If an object is a member of a :term:`cyclic isolate`, Python will not " "automatically finalize it after automatically clearing (see :c:member:" "`~PyTypeObject.tp_clear`) any other member." msgstr "" -#: ../../c-api/typeobj.rst:2387 +#: ../../c-api/typeobj.rst:2445 msgid "" "Python will automatically finalize every member of a :term:`cyclic isolate` " "before it automatically clears (see :c:member:`~PyTypeObject.tp_clear`) any " "of them." msgstr "" -#: ../../c-api/typeobj.rst:2390 +#: ../../c-api/typeobj.rst:2448 msgid "" "If Python is going to automatically clear an object (:c:member:" "`~PyTypeObject.tp_clear`), it will automatically finalize the object first." msgstr "" -#: ../../c-api/typeobj.rst:2394 +#: ../../c-api/typeobj.rst:2452 msgid "" "Python currently only automatically finalizes objects that are members of a :" "term:`cyclic isolate`, but future versions might finalize objects regularly " "before their destruction." msgstr "" -#: ../../c-api/typeobj.rst:2398 +#: ../../c-api/typeobj.rst:2456 msgid "" "To manually finalize an object, do not call this function directly; call :c:" "func:`PyObject_CallFinalizer` or :c:func:`PyObject_CallFinalizerFromDealloc` " "instead." msgstr "" -#: ../../c-api/typeobj.rst:2402 +#: ../../c-api/typeobj.rst:2460 msgid "" ":c:member:`~PyTypeObject.tp_finalize` should leave the current exception " "status unchanged. The recommended way to write a non-trivial finalizer is " @@ -3786,7 +3787,7 @@ msgid "" "`PyErr_WriteUnraisable` or :c:func:`PyErr_FormatUnraisable`. For example::" msgstr "" -#: ../../c-api/typeobj.rst:2411 +#: ../../c-api/typeobj.rst:2469 msgid "" "static void\n" "foo_finalize(PyObject *self)\n" @@ -3809,26 +3810,26 @@ msgid "" "}" msgstr "" -#: ../../c-api/typeobj.rst:2439 +#: ../../c-api/typeobj.rst:2497 msgid "" "Before version 3.8 it was necessary to set the :c:macro:" "`Py_TPFLAGS_HAVE_FINALIZE` flags bit in order for this field to be used. " "This is no longer required." msgstr "" -#: ../../c-api/typeobj.rst:2445 +#: ../../c-api/typeobj.rst:2503 msgid ":pep:`442`: \"Safe object finalization\"" msgstr "" -#: ../../c-api/typeobj.rst:2448 +#: ../../c-api/typeobj.rst:2506 msgid ":c:func:`PyObject_CallFinalizer`" msgstr ":c:func:`PyObject_CallFinalizer`" -#: ../../c-api/typeobj.rst:2449 +#: ../../c-api/typeobj.rst:2507 msgid ":c:func:`PyObject_CallFinalizerFromDealloc`" msgstr ":c:func:`PyObject_CallFinalizerFromDealloc`" -#: ../../c-api/typeobj.rst:2454 +#: ../../c-api/typeobj.rst:2514 msgid "" "A :ref:`vectorcall function ` to use for calls of this type " "object (rather than instances). In other words, ``tp_vectorcall`` can be " @@ -3836,13 +3837,13 @@ msgid "" "of *type*." msgstr "" -#: ../../c-api/typeobj.rst:2459 +#: ../../c-api/typeobj.rst:2519 msgid "" "As with any vectorcall function, if ``tp_vectorcall`` is ``NULL``, the " "*tp_call* protocol (``Py_TYPE(type)->tp_call``) is used instead." msgstr "" -#: ../../c-api/typeobj.rst:2464 +#: ../../c-api/typeobj.rst:2524 msgid "" "The :ref:`vectorcall protocol ` requires that the vectorcall " "function has the same behavior as the corresponding ``tp_call``. This means " @@ -3850,27 +3851,27 @@ msgid "" ">tp_call``." msgstr "" -#: ../../c-api/typeobj.rst:2469 +#: ../../c-api/typeobj.rst:2529 msgid "" "Specifically, if *type* uses the default metaclass, ``type->tp_vectorcall`` " "must behave the same as :c:expr:`PyType_Type->tp_call`, which:" msgstr "" -#: ../../c-api/typeobj.rst:2473 +#: ../../c-api/typeobj.rst:2533 msgid "calls ``type->tp_new``," msgstr "呼叫 ``type->tp_new``," -#: ../../c-api/typeobj.rst:2475 +#: ../../c-api/typeobj.rst:2535 msgid "" "if the result is a subclass of *type*, calls ``type->tp_init`` on the result " "of ``tp_new``, and" msgstr "" -#: ../../c-api/typeobj.rst:2478 +#: ../../c-api/typeobj.rst:2538 msgid "returns the result of ``tp_new``." msgstr "回傳 ``tp_new`` 的結果。" -#: ../../c-api/typeobj.rst:2480 +#: ../../c-api/typeobj.rst:2540 msgid "" "Typically, ``tp_vectorcall`` is overridden to optimize this process for " "specific :c:member:`~PyTypeObject.tp_new` and :c:member:`~PyTypeObject." @@ -3879,65 +3880,65 @@ msgid "" "__init__`, respectively)." msgstr "" -#: ../../c-api/typeobj.rst:2491 +#: ../../c-api/typeobj.rst:2551 msgid "This field is never inherited." msgstr "" -#: ../../c-api/typeobj.rst:2493 +#: ../../c-api/typeobj.rst:2553 msgid "(the field exists since 3.8 but it's only used since 3.9)" msgstr "" -#: ../../c-api/typeobj.rst:2498 +#: ../../c-api/typeobj.rst:2558 msgid "Internal. Do not use." msgstr "" -#: ../../c-api/typeobj.rst:2506 +#: ../../c-api/typeobj.rst:2566 msgid "Static Types" msgstr "靜態型別" -#: ../../c-api/typeobj.rst:2508 +#: ../../c-api/typeobj.rst:2568 msgid "" "Traditionally, types defined in C code are *static*, that is, a static :c:" "type:`PyTypeObject` structure is defined directly in code and initialized " "using :c:func:`PyType_Ready`." msgstr "" -#: ../../c-api/typeobj.rst:2512 +#: ../../c-api/typeobj.rst:2572 msgid "" "This results in types that are limited relative to types defined in Python:" msgstr "" -#: ../../c-api/typeobj.rst:2514 +#: ../../c-api/typeobj.rst:2574 msgid "" "Static types are limited to one base, i.e. they cannot use multiple " "inheritance." msgstr "" -#: ../../c-api/typeobj.rst:2516 +#: ../../c-api/typeobj.rst:2576 msgid "" "Static type objects (but not necessarily their instances) are immutable. It " "is not possible to add or modify the type object's attributes from Python." msgstr "" -#: ../../c-api/typeobj.rst:2518 +#: ../../c-api/typeobj.rst:2578 msgid "" "Static type objects are shared across :ref:`sub-interpreters `, so they should not include any subinterpreter-" "specific state." msgstr "" -#: ../../c-api/typeobj.rst:2522 +#: ../../c-api/typeobj.rst:2582 msgid "" "Also, since :c:type:`PyTypeObject` is only part of the :ref:`Limited API " "` as an opaque struct, any extension modules using static " "types must be compiled for a specific Python minor version." msgstr "" -#: ../../c-api/typeobj.rst:2530 +#: ../../c-api/typeobj.rst:2590 msgid "Heap Types" msgstr "堆積型別" -#: ../../c-api/typeobj.rst:2532 +#: ../../c-api/typeobj.rst:2592 msgid "" "An alternative to :ref:`static types ` is *heap-allocated " "types*, or *heap types* for short, which correspond closely to classes " @@ -3945,29 +3946,29 @@ msgid "" "`Py_TPFLAGS_HEAPTYPE` flag set." msgstr "" -#: ../../c-api/typeobj.rst:2537 +#: ../../c-api/typeobj.rst:2597 msgid "" "This is done by filling a :c:type:`PyType_Spec` structure and calling :c:" "func:`PyType_FromSpec`, :c:func:`PyType_FromSpecWithBases`, :c:func:" "`PyType_FromModuleAndSpec`, or :c:func:`PyType_FromMetaclass`." msgstr "" -#: ../../c-api/typeobj.rst:2545 +#: ../../c-api/typeobj.rst:2605 msgid "Number Object Structures" msgstr "" -#: ../../c-api/typeobj.rst:2552 +#: ../../c-api/typeobj.rst:2612 msgid "" "This structure holds pointers to the functions which an object uses to " "implement the number protocol. Each function is used by the function of " "similar name documented in the :ref:`number` section." msgstr "" -#: ../../c-api/typeobj.rst:2558 ../../c-api/typeobj.rst:2882 +#: ../../c-api/typeobj.rst:2618 ../../c-api/typeobj.rst:3074 msgid "Here is the structure definition::" msgstr "" -#: ../../c-api/typeobj.rst:2560 +#: ../../c-api/typeobj.rst:2620 msgid "" "typedef struct {\n" " binaryfunc nb_add;\n" @@ -4055,7 +4056,7 @@ msgstr "" " binaryfunc nb_inplace_matrix_multiply;\n" "} PyNumberMethods;" -#: ../../c-api/typeobj.rst:2605 +#: ../../c-api/typeobj.rst:2665 msgid "" "Binary and ternary functions must check the type of all their operands, and " "implement the necessary conversions (at least one of the operands is an " @@ -4065,31 +4066,31 @@ msgid "" "and set an exception." msgstr "" -#: ../../c-api/typeobj.rst:2614 +#: ../../c-api/typeobj.rst:2674 msgid "" "The :c:member:`~PyNumberMethods.nb_reserved` field should always be " "``NULL``. It was previously called :c:member:`!nb_long`, and was renamed in " "Python 3.0.1." msgstr "" -#: ../../c-api/typeobj.rst:2659 +#: ../../c-api/typeobj.rst:2825 msgid "Mapping Object Structures" msgstr "對映物件結構" -#: ../../c-api/typeobj.rst:2666 +#: ../../c-api/typeobj.rst:2832 msgid "" "This structure holds pointers to the functions which an object uses to " "implement the mapping protocol. It has three members:" msgstr "" -#: ../../c-api/typeobj.rst:2671 +#: ../../c-api/typeobj.rst:2839 msgid "" "This function is used by :c:func:`PyMapping_Size` and :c:func:" "`PyObject_Size`, and has the same signature. This slot may be set to " "``NULL`` if the object has no defined length." msgstr "" -#: ../../c-api/typeobj.rst:2677 +#: ../../c-api/typeobj.rst:2847 msgid "" "This function is used by :c:func:`PyObject_GetItem` and :c:func:" "`PySequence_GetSlice`, and has the same signature as :c:func:`!" @@ -4097,7 +4098,7 @@ msgid "" "`PyMapping_Check` function to return ``1``, it can be ``NULL`` otherwise." msgstr "" -#: ../../c-api/typeobj.rst:2685 +#: ../../c-api/typeobj.rst:2857 msgid "" "This function is used by :c:func:`PyObject_SetItem`, :c:func:" "`PyObject_DelItem`, :c:func:`PySequence_SetSlice` and :c:func:" @@ -4107,17 +4108,17 @@ msgid "" "deletion." msgstr "" -#: ../../c-api/typeobj.rst:2696 +#: ../../c-api/typeobj.rst:2868 msgid "Sequence Object Structures" msgstr "序列物件結構" -#: ../../c-api/typeobj.rst:2703 +#: ../../c-api/typeobj.rst:2875 msgid "" "This structure holds pointers to the functions which an object uses to " "implement the sequence protocol." msgstr "" -#: ../../c-api/typeobj.rst:2708 +#: ../../c-api/typeobj.rst:2882 msgid "" "This function is used by :c:func:`PySequence_Size` and :c:func:" "`PyObject_Size`, and has the same signature. It is also used for handling " @@ -4125,21 +4126,21 @@ msgid "" "member:`~PySequenceMethods.sq_ass_item` slots." msgstr "" -#: ../../c-api/typeobj.rst:2715 +#: ../../c-api/typeobj.rst:2891 msgid "" "This function is used by :c:func:`PySequence_Concat` and has the same " "signature. It is also used by the ``+`` operator, after trying the numeric " "addition via the :c:member:`~PyNumberMethods.nb_add` slot." msgstr "" -#: ../../c-api/typeobj.rst:2721 +#: ../../c-api/typeobj.rst:2899 msgid "" "This function is used by :c:func:`PySequence_Repeat` and has the same " "signature. It is also used by the ``*`` operator, after trying numeric " "multiplication via the :c:member:`~PyNumberMethods.nb_multiply` slot." msgstr "" -#: ../../c-api/typeobj.rst:2727 +#: ../../c-api/typeobj.rst:2907 msgid "" "This function is used by :c:func:`PySequence_GetItem` and has the same " "signature. It is also used by :c:func:`PyObject_GetItem`, after trying the " @@ -4148,7 +4149,7 @@ msgid "" "``1``, it can be ``NULL`` otherwise." msgstr "" -#: ../../c-api/typeobj.rst:2733 +#: ../../c-api/typeobj.rst:2913 msgid "" "Negative indexes are handled as follows: if the :c:member:" "`~PySequenceMethods.sq_length` slot is filled, it is called and the sequence " @@ -4157,7 +4158,7 @@ msgid "" "index is passed as is to the function." msgstr "" -#: ../../c-api/typeobj.rst:2740 +#: ../../c-api/typeobj.rst:2922 msgid "" "This function is used by :c:func:`PySequence_SetItem` and has the same " "signature. It is also used by :c:func:`PyObject_SetItem` and :c:func:" @@ -4166,14 +4167,14 @@ msgid "" "``NULL`` if the object does not support item assignment and deletion." msgstr "" -#: ../../c-api/typeobj.rst:2749 +#: ../../c-api/typeobj.rst:2933 msgid "" "This function may be used by :c:func:`PySequence_Contains` and has the same " "signature. This slot may be left to ``NULL``, in this case :c:func:`!" "PySequence_Contains` simply traverses the sequence until it finds a match." msgstr "" -#: ../../c-api/typeobj.rst:2756 +#: ../../c-api/typeobj.rst:2942 msgid "" "This function is used by :c:func:`PySequence_InPlaceConcat` and has the same " "signature. It should modify its first operand, and return it. This slot " @@ -4183,7 +4184,7 @@ msgid "" "c:member:`~PyNumberMethods.nb_inplace_add` slot." msgstr "" -#: ../../c-api/typeobj.rst:2765 +#: ../../c-api/typeobj.rst:2953 msgid "" "This function is used by :c:func:`PySequence_InPlaceRepeat` and has the same " "signature. It should modify its first operand, and return it. This slot " @@ -4193,76 +4194,76 @@ msgid "" "via the :c:member:`~PyNumberMethods.nb_inplace_multiply` slot." msgstr "" -#: ../../c-api/typeobj.rst:2776 +#: ../../c-api/typeobj.rst:2964 msgid "Buffer Object Structures" msgstr "緩衝區物件結構" -#: ../../c-api/typeobj.rst:2784 +#: ../../c-api/typeobj.rst:2972 msgid "" "This structure holds pointers to the functions required by the :ref:`Buffer " "protocol `. The protocol defines how an exporter object can " "expose its internal data to consumer objects." msgstr "" -#: ../../c-api/typeobj.rst:2790 ../../c-api/typeobj.rst:2839 -#: ../../c-api/typeobj.rst:2893 ../../c-api/typeobj.rst:2904 -#: ../../c-api/typeobj.rst:2916 ../../c-api/typeobj.rst:2926 +#: ../../c-api/typeobj.rst:2980 ../../c-api/typeobj.rst:3031 +#: ../../c-api/typeobj.rst:3087 ../../c-api/typeobj.rst:3100 +#: ../../c-api/typeobj.rst:3114 ../../c-api/typeobj.rst:3126 msgid "The signature of this function is::" msgstr "函式的簽名為: ::" -#: ../../c-api/typeobj.rst:2792 +#: ../../c-api/typeobj.rst:2982 msgid "int (PyObject *exporter, Py_buffer *view, int flags);" msgstr "int (PyObject *exporter, Py_buffer *view, int flags);" -#: ../../c-api/typeobj.rst:2794 +#: ../../c-api/typeobj.rst:2984 msgid "" "Handle a request to *exporter* to fill in *view* as specified by *flags*. " "Except for point (3), an implementation of this function MUST take these " "steps:" msgstr "" -#: ../../c-api/typeobj.rst:2798 +#: ../../c-api/typeobj.rst:2988 msgid "" "Check if the request can be met. If not, raise :exc:`BufferError`, set :c:" "expr:`view->obj` to ``NULL`` and return ``-1``." msgstr "" -#: ../../c-api/typeobj.rst:2801 +#: ../../c-api/typeobj.rst:2991 msgid "Fill in the requested fields." msgstr "" -#: ../../c-api/typeobj.rst:2803 +#: ../../c-api/typeobj.rst:2993 msgid "Increment an internal counter for the number of exports." msgstr "" -#: ../../c-api/typeobj.rst:2805 +#: ../../c-api/typeobj.rst:2995 msgid "" "Set :c:expr:`view->obj` to *exporter* and increment :c:expr:`view->obj`." msgstr "" -#: ../../c-api/typeobj.rst:2807 +#: ../../c-api/typeobj.rst:2997 msgid "Return ``0``." msgstr "回傳 ``0``。" -#: ../../c-api/typeobj.rst:2809 +#: ../../c-api/typeobj.rst:2999 msgid "" "If *exporter* is part of a chain or tree of buffer providers, two main " "schemes can be used:" msgstr "" -#: ../../c-api/typeobj.rst:2812 +#: ../../c-api/typeobj.rst:3002 msgid "" "Re-export: Each member of the tree acts as the exporting object and sets :c:" "expr:`view->obj` to a new reference to itself." msgstr "" -#: ../../c-api/typeobj.rst:2815 +#: ../../c-api/typeobj.rst:3005 msgid "" "Redirect: The buffer request is redirected to the root object of the tree. " "Here, :c:expr:`view->obj` will be a new reference to the root object." msgstr "" -#: ../../c-api/typeobj.rst:2819 +#: ../../c-api/typeobj.rst:3009 msgid "" "The individual fields of *view* are described in section :ref:`Buffer " "structure `, the rules how an exporter must react to " @@ -4270,7 +4271,7 @@ msgid "" "types>`." msgstr "" -#: ../../c-api/typeobj.rst:2824 +#: ../../c-api/typeobj.rst:3014 msgid "" "All memory pointed to in the :c:type:`Py_buffer` structure belongs to the " "exporter and must remain valid until there are no consumers left. :c:member:" @@ -4279,23 +4280,23 @@ msgid "" "internal` are read-only for the consumer." msgstr "" -#: ../../c-api/typeobj.rst:2831 +#: ../../c-api/typeobj.rst:3021 msgid "" ":c:func:`PyBuffer_FillInfo` provides an easy way of exposing a simple bytes " "buffer while dealing correctly with all request types." msgstr "" -#: ../../c-api/typeobj.rst:2834 +#: ../../c-api/typeobj.rst:3024 msgid "" ":c:func:`PyObject_GetBuffer` is the interface for the consumer that wraps " "this function." msgstr "" -#: ../../c-api/typeobj.rst:2841 +#: ../../c-api/typeobj.rst:3033 msgid "void (PyObject *exporter, Py_buffer *view);" msgstr "void (PyObject *exporter, Py_buffer *view);" -#: ../../c-api/typeobj.rst:2843 +#: ../../c-api/typeobj.rst:3035 msgid "" "Handle a request to release the resources of the buffer. If no resources " "need to be released, :c:member:`PyBufferProcs.bf_releasebuffer` may be " @@ -4303,15 +4304,15 @@ msgid "" "these optional steps:" msgstr "" -#: ../../c-api/typeobj.rst:2848 +#: ../../c-api/typeobj.rst:3040 msgid "Decrement an internal counter for the number of exports." msgstr "" -#: ../../c-api/typeobj.rst:2850 +#: ../../c-api/typeobj.rst:3042 msgid "If the counter is ``0``, free all memory associated with *view*." msgstr "" -#: ../../c-api/typeobj.rst:2852 +#: ../../c-api/typeobj.rst:3044 msgid "" "The exporter MUST use the :c:member:`~Py_buffer.internal` field to keep " "track of buffer-specific resources. This field is guaranteed to remain " @@ -4319,30 +4320,30 @@ msgid "" "*view* argument." msgstr "" -#: ../../c-api/typeobj.rst:2858 +#: ../../c-api/typeobj.rst:3050 msgid "" "This function MUST NOT decrement :c:expr:`view->obj`, since that is done " "automatically in :c:func:`PyBuffer_Release` (this scheme is useful for " "breaking reference cycles)." msgstr "" -#: ../../c-api/typeobj.rst:2863 +#: ../../c-api/typeobj.rst:3055 msgid "" ":c:func:`PyBuffer_Release` is the interface for the consumer that wraps this " "function." msgstr "" -#: ../../c-api/typeobj.rst:2871 +#: ../../c-api/typeobj.rst:3063 msgid "Async Object Structures" msgstr "非同步物件結構" -#: ../../c-api/typeobj.rst:2879 +#: ../../c-api/typeobj.rst:3071 msgid "" "This structure holds pointers to the functions required to implement :term:" "`awaitable` and :term:`asynchronous iterator` objects." msgstr "" -#: ../../c-api/typeobj.rst:2884 +#: ../../c-api/typeobj.rst:3076 msgid "" "typedef struct {\n" " unaryfunc am_await;\n" @@ -4358,62 +4359,62 @@ msgstr "" " sendfunc am_send;\n" "} PyAsyncMethods;" -#: ../../c-api/typeobj.rst:2895 +#: ../../c-api/typeobj.rst:3089 msgid "PyObject *am_await(PyObject *self);" msgstr "PyObject *am_await(PyObject *self);" -#: ../../c-api/typeobj.rst:2897 +#: ../../c-api/typeobj.rst:3091 msgid "" "The returned object must be an :term:`iterator`, i.e. :c:func:`PyIter_Check` " "must return ``1`` for it." msgstr "" -#: ../../c-api/typeobj.rst:2900 +#: ../../c-api/typeobj.rst:3094 msgid "" "This slot may be set to ``NULL`` if an object is not an :term:`awaitable`." msgstr "" -#: ../../c-api/typeobj.rst:2906 +#: ../../c-api/typeobj.rst:3102 msgid "PyObject *am_aiter(PyObject *self);" msgstr "PyObject *am_aiter(PyObject *self);" -#: ../../c-api/typeobj.rst:2908 +#: ../../c-api/typeobj.rst:3104 msgid "" "Must return an :term:`asynchronous iterator` object. See :meth:`~object." "__anext__` for details." msgstr "" -#: ../../c-api/typeobj.rst:2911 +#: ../../c-api/typeobj.rst:3107 msgid "" "This slot may be set to ``NULL`` if an object does not implement " "asynchronous iteration protocol." msgstr "" -#: ../../c-api/typeobj.rst:2918 +#: ../../c-api/typeobj.rst:3116 msgid "PyObject *am_anext(PyObject *self);" msgstr "PyObject *am_anext(PyObject *self);" -#: ../../c-api/typeobj.rst:2920 +#: ../../c-api/typeobj.rst:3118 msgid "" "Must return an :term:`awaitable` object. See :meth:`~object.__anext__` for " "details. This slot may be set to ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:2928 +#: ../../c-api/typeobj.rst:3128 msgid "PySendResult am_send(PyObject *self, PyObject *arg, PyObject **result);" msgstr "" "PySendResult am_send(PyObject *self, PyObject *arg, PyObject **result);" -#: ../../c-api/typeobj.rst:2930 +#: ../../c-api/typeobj.rst:3130 msgid "" "See :c:func:`PyIter_Send` for details. This slot may be set to ``NULL``." msgstr "" -#: ../../c-api/typeobj.rst:2939 +#: ../../c-api/typeobj.rst:3139 msgid "Slot Type typedefs" msgstr "" -#: ../../c-api/typeobj.rst:2943 +#: ../../c-api/typeobj.rst:3143 msgid "" "The purpose of this function is to separate memory allocation from memory " "initialization. It should return a pointer to a block of memory of adequate " @@ -4427,80 +4428,80 @@ msgid "" "length of the block should be :c:member:`~PyTypeObject.tp_basicsize`." msgstr "" -#: ../../c-api/typeobj.rst:2953 +#: ../../c-api/typeobj.rst:3153 msgid "" "This function should not do any other instance initialization, not even to " "allocate additional memory; that should be done by :c:member:`~PyTypeObject." "tp_new`." msgstr "" -#: ../../c-api/typeobj.rst:2960 +#: ../../c-api/typeobj.rst:3160 msgid "See :c:member:`~PyTypeObject.tp_free`." msgstr "請見 :c:member:`~PyTypeObject.tp_free`。" -#: ../../c-api/typeobj.rst:2964 +#: ../../c-api/typeobj.rst:3164 msgid "See :c:member:`~PyTypeObject.tp_new`." msgstr "請見 :c:member:`~PyTypeObject.tp_new`。" -#: ../../c-api/typeobj.rst:2968 +#: ../../c-api/typeobj.rst:3168 msgid "See :c:member:`~PyTypeObject.tp_init`." msgstr "請見 :c:member:`~PyTypeObject.tp_init`。" -#: ../../c-api/typeobj.rst:2972 +#: ../../c-api/typeobj.rst:3172 msgid "See :c:member:`~PyTypeObject.tp_repr`." msgstr "請見 :c:member:`~PyTypeObject.tp_repr`。" -#: ../../c-api/typeobj.rst:2976 ../../c-api/typeobj.rst:2985 +#: ../../c-api/typeobj.rst:3176 ../../c-api/typeobj.rst:3185 msgid "Return the value of the named attribute for the object." msgstr "" -#: ../../c-api/typeobj.rst:2980 ../../c-api/typeobj.rst:2991 +#: ../../c-api/typeobj.rst:3180 ../../c-api/typeobj.rst:3191 msgid "" "Set the value of the named attribute for the object. The value argument is " "set to ``NULL`` to delete the attribute." msgstr "" -#: ../../c-api/typeobj.rst:2987 +#: ../../c-api/typeobj.rst:3187 msgid "See :c:member:`~PyTypeObject.tp_getattro`." msgstr "請見 :c:member:`~PyTypeObject.tp_getattro`。" -#: ../../c-api/typeobj.rst:2994 +#: ../../c-api/typeobj.rst:3194 msgid "See :c:member:`~PyTypeObject.tp_setattro`." msgstr "請見 :c:member:`~PyTypeObject.tp_setattro`。" -#: ../../c-api/typeobj.rst:2998 +#: ../../c-api/typeobj.rst:3198 msgid "See :c:member:`~PyTypeObject.tp_descr_get`." msgstr "請見 :c:member:`~PyTypeObject.tp_descr_get`。" -#: ../../c-api/typeobj.rst:3002 +#: ../../c-api/typeobj.rst:3202 msgid "See :c:member:`~PyTypeObject.tp_descr_set`." msgstr "請見 :c:member:`~PyTypeObject.tp_descr_set`。" -#: ../../c-api/typeobj.rst:3006 +#: ../../c-api/typeobj.rst:3206 msgid "See :c:member:`~PyTypeObject.tp_hash`." msgstr "請見 :c:member:`~PyTypeObject.tp_hash`。" -#: ../../c-api/typeobj.rst:3010 +#: ../../c-api/typeobj.rst:3210 msgid "See :c:member:`~PyTypeObject.tp_richcompare`." msgstr "請見 :c:member:`~PyTypeObject.tp_richcompare`。" -#: ../../c-api/typeobj.rst:3014 +#: ../../c-api/typeobj.rst:3214 msgid "See :c:member:`~PyTypeObject.tp_iter`." msgstr "請見 :c:member:`~PyTypeObject.tp_iter`。" -#: ../../c-api/typeobj.rst:3018 +#: ../../c-api/typeobj.rst:3218 msgid "See :c:member:`~PyTypeObject.tp_iternext`." msgstr "請見 :c:member:`~PyTypeObject.tp_iternext`。" -#: ../../c-api/typeobj.rst:3032 +#: ../../c-api/typeobj.rst:3232 msgid "See :c:member:`~PyAsyncMethods.am_send`." msgstr "請見 :c:member:`~PyAsyncMethods.am_send`。" -#: ../../c-api/typeobj.rst:3048 +#: ../../c-api/typeobj.rst:3248 msgid "Examples" msgstr "範例" -#: ../../c-api/typeobj.rst:3050 +#: ../../c-api/typeobj.rst:3250 msgid "" "The following are simple examples of Python type definitions. They include " "common usage you may encounter. Some demonstrate tricky corner cases. For " @@ -4508,11 +4509,11 @@ msgid "" "and :ref:`new-types-topics`." msgstr "" -#: ../../c-api/typeobj.rst:3055 +#: ../../c-api/typeobj.rst:3255 msgid "A basic :ref:`static type `::" msgstr "" -#: ../../c-api/typeobj.rst:3057 +#: ../../c-api/typeobj.rst:3257 msgid "" "typedef struct {\n" " PyObject_HEAD\n" @@ -4544,13 +4545,13 @@ msgstr "" " .tp_repr = (reprfunc)myobj_repr,\n" "};" -#: ../../c-api/typeobj.rst:3072 +#: ../../c-api/typeobj.rst:3272 msgid "" "You may also find older code (especially in the CPython code base) with a " "more verbose initializer::" msgstr "" -#: ../../c-api/typeobj.rst:3075 +#: ../../c-api/typeobj.rst:3275 msgid "" "static PyTypeObject MyObject_Type = {\n" " PyVarObject_HEAD_INIT(NULL, 0)\n" @@ -4634,11 +4635,11 @@ msgstr "" " myobj_new, /* tp_new */\n" "};" -#: ../../c-api/typeobj.rst:3116 +#: ../../c-api/typeobj.rst:3316 msgid "A type that supports weakrefs, instance dicts, and hashing::" msgstr "" -#: ../../c-api/typeobj.rst:3118 +#: ../../c-api/typeobj.rst:3318 msgid "" "typedef struct {\n" " PyObject_HEAD\n" @@ -4664,14 +4665,14 @@ msgid "" "};" msgstr "" -#: ../../c-api/typeobj.rst:3141 +#: ../../c-api/typeobj.rst:3341 msgid "" "A str subclass that cannot be subclassed and cannot be called to create " "instances (e.g. uses a separate factory func) using :c:macro:" "`Py_TPFLAGS_DISALLOW_INSTANTIATION` flag::" msgstr "" -#: ../../c-api/typeobj.rst:3145 +#: ../../c-api/typeobj.rst:3345 msgid "" "typedef struct {\n" " PyUnicodeObject raw;\n" @@ -4689,12 +4690,12 @@ msgid "" "};" msgstr "" -#: ../../c-api/typeobj.rst:3160 +#: ../../c-api/typeobj.rst:3360 msgid "" "The simplest :ref:`static type ` with fixed-length instances::" msgstr "" -#: ../../c-api/typeobj.rst:3162 +#: ../../c-api/typeobj.rst:3362 msgid "" "typedef struct {\n" " PyObject_HEAD\n" @@ -4714,13 +4715,13 @@ msgstr "" " .tp_name = \"mymod.MyObject\",\n" "};" -#: ../../c-api/typeobj.rst:3171 +#: ../../c-api/typeobj.rst:3371 msgid "" "The simplest :ref:`static type ` with variable-length " "instances::" msgstr "" -#: ../../c-api/typeobj.rst:3173 +#: ../../c-api/typeobj.rst:3373 msgid "" "typedef struct {\n" " PyObject_VAR_HEAD\n" @@ -4746,14 +4747,14 @@ msgstr "" " .tp_itemsize = sizeof(char *),\n" "};" -#: ../../c-api/typeobj.rst:912 ../../c-api/typeobj.rst:977 +#: ../../c-api/typeobj.rst:920 ../../c-api/typeobj.rst:987 msgid "built-in function" msgstr "built-in function(內建函式)" -#: ../../c-api/typeobj.rst:912 +#: ../../c-api/typeobj.rst:920 msgid "repr" msgstr "repr" -#: ../../c-api/typeobj.rst:977 +#: ../../c-api/typeobj.rst:987 msgid "hash" msgstr "hash(雜湊)" diff --git a/c-api/unicode.po b/c-api/unicode.po index 031c9279e7..7d9e21a667 100644 --- a/c-api/unicode.po +++ b/c-api/unicode.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-10-08 00:15+0000\n" +"POT-Creation-Date: 2025-11-05 00:16+0000\n" "PO-Revision-Date: 2018-05-23 14:08+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -324,34 +324,46 @@ msgstr "" #: ../../c-api/unicode.rst:310 msgid "" +"Return the high UTF-16 surrogate (``0xD800`` to ``0xDBFF``) for a Unicode " +"code point in the range ``[0x10000; 0x10FFFF]``." +msgstr "" + +#: ../../c-api/unicode.rst:315 +msgid "" +"Return the low UTF-16 surrogate (``0xDC00`` to ``0xDFFF``) for a Unicode " +"code point in the range ``[0x10000; 0x10FFFF]``." +msgstr "" + +#: ../../c-api/unicode.rst:320 +msgid "" "Join two surrogate code points and return a single :c:type:`Py_UCS4` value. " "*high* and *low* are respectively the leading and trailing surrogates in a " -"surrogate pair. *high* must be in the range [0xD800; 0xDBFF] and *low* must " -"be in the range [0xDC00; 0xDFFF]." +"surrogate pair. *high* must be in the range ``[0xD800; 0xDBFF]`` and *low* " +"must be in the range ``[0xDC00; 0xDFFF]``." msgstr "" -#: ../../c-api/unicode.rst:317 +#: ../../c-api/unicode.rst:327 msgid "Creating and accessing Unicode strings" msgstr "" -#: ../../c-api/unicode.rst:319 +#: ../../c-api/unicode.rst:329 msgid "" "To create Unicode objects and access their basic sequence properties, use " "these APIs:" msgstr "" -#: ../../c-api/unicode.rst:324 +#: ../../c-api/unicode.rst:334 msgid "" "Create a new Unicode object. *maxchar* should be the true maximum code " "point to be placed in the string. As an approximation, it can be rounded up " "to the nearest value in the sequence 127, 255, 65535, 1114111." msgstr "" -#: ../../c-api/unicode.rst:328 +#: ../../c-api/unicode.rst:338 msgid "On error, set an exception and return ``NULL``." msgstr "" -#: ../../c-api/unicode.rst:330 +#: ../../c-api/unicode.rst:340 msgid "" "After creation, the string can be filled by :c:func:`PyUnicode_WriteChar`, :" "c:func:`PyUnicode_CopyCharacters`, :c:func:`PyUnicode_Fill`, :c:func:" @@ -360,38 +372,38 @@ msgid "" "before it's filled with its final contents, a string:" msgstr "" -#: ../../c-api/unicode.rst:337 +#: ../../c-api/unicode.rst:347 msgid "must not be hashed," msgstr "" -#: ../../c-api/unicode.rst:338 +#: ../../c-api/unicode.rst:348 msgid "" "must not be :c:func:`converted to UTF-8 `, or " "another non-\"canonical\" representation," msgstr "" -#: ../../c-api/unicode.rst:340 +#: ../../c-api/unicode.rst:350 msgid "must not have its reference count changed," msgstr "" -#: ../../c-api/unicode.rst:341 +#: ../../c-api/unicode.rst:351 msgid "must not be shared with code that might do one of the above." msgstr "" -#: ../../c-api/unicode.rst:343 +#: ../../c-api/unicode.rst:353 msgid "" "This list is not exhaustive. Avoiding these uses is your responsibility; " "Python does not always check these requirements." msgstr "" -#: ../../c-api/unicode.rst:346 +#: ../../c-api/unicode.rst:356 msgid "" "To avoid accidentally exposing a partially-written string object, prefer " "using the :c:type:`PyUnicodeWriter` API, or one of the ``PyUnicode_From*`` " "functions below." msgstr "" -#: ../../c-api/unicode.rst:357 +#: ../../c-api/unicode.rst:367 msgid "" "Create a new Unicode object with the given *kind* (possible values are :c:" "macro:`PyUnicode_1BYTE_KIND` etc., as returned by :c:func:" @@ -399,7 +411,7 @@ msgid "" "1, 2 or 4 bytes per character, as given by the kind." msgstr "" -#: ../../c-api/unicode.rst:362 +#: ../../c-api/unicode.rst:372 msgid "" "If necessary, the input *buffer* is copied and transformed into the " "canonical representation. For example, if the *buffer* is a UCS4 string (:c:" @@ -407,7 +419,7 @@ msgid "" "range, it will be transformed into UCS1 (:c:macro:`PyUnicode_1BYTE_KIND`)." msgstr "" -#: ../../c-api/unicode.rst:373 +#: ../../c-api/unicode.rst:383 msgid "" "Create a Unicode object from the char buffer *str*. The bytes will be " "interpreted as being UTF-8 encoded. The buffer is copied into the new " @@ -415,29 +427,29 @@ msgid "" "data is not allowed." msgstr "" -#: ../../c-api/unicode.rst:379 +#: ../../c-api/unicode.rst:389 msgid "This function raises :exc:`SystemError` when:" msgstr "此函式在以下情況下會引發 :exc:`SystemError`:" -#: ../../c-api/unicode.rst:381 +#: ../../c-api/unicode.rst:391 msgid "*size* < 0," msgstr "*size* < 0," -#: ../../c-api/unicode.rst:382 +#: ../../c-api/unicode.rst:392 msgid "*str* is ``NULL`` and *size* > 0" msgstr "*str* 為 ``NULL`` 且 *size* > 0" -#: ../../c-api/unicode.rst:384 +#: ../../c-api/unicode.rst:394 msgid "*str* == ``NULL`` with *size* > 0 is not allowed anymore." msgstr "*str* == ``NULL`` 且 *size* > 0 不再被允許。" -#: ../../c-api/unicode.rst:390 +#: ../../c-api/unicode.rst:400 msgid "" "Create a Unicode object from a UTF-8 encoded null-terminated char buffer " "*str*." msgstr "" -#: ../../c-api/unicode.rst:396 +#: ../../c-api/unicode.rst:406 msgid "" "Take a C :c:func:`printf`\\ -style *format* string and a variable number of " "arguments, calculate the size of the resulting Python Unicode string and " @@ -446,23 +458,23 @@ msgid "" "*format* ASCII-encoded string." msgstr "" -#: ../../c-api/unicode.rst:402 +#: ../../c-api/unicode.rst:412 msgid "" "A conversion specifier contains two or more characters and has the following " "components, which must occur in this order:" msgstr "" -#: ../../c-api/unicode.rst:405 +#: ../../c-api/unicode.rst:415 msgid "The ``'%'`` character, which marks the start of the specifier." msgstr "" -#: ../../c-api/unicode.rst:407 +#: ../../c-api/unicode.rst:417 msgid "" "Conversion flags (optional), which affect the result of some conversion " "types." msgstr "" -#: ../../c-api/unicode.rst:410 +#: ../../c-api/unicode.rst:420 msgid "" "Minimum field width (optional). If specified as an ``'*'`` (asterisk), the " "actual width is given in the next argument, which must be of type :c:expr:" @@ -470,7 +482,7 @@ msgid "" "optional precision." msgstr "" -#: ../../c-api/unicode.rst:415 +#: ../../c-api/unicode.rst:425 msgid "" "Precision (optional), given as a ``'.'`` (dot) followed by the precision. If " "specified as ``'*'`` (an asterisk), the actual precision is given in the " @@ -478,316 +490,316 @@ msgid "" "comes after the precision." msgstr "" -#: ../../c-api/unicode.rst:420 +#: ../../c-api/unicode.rst:430 msgid "Length modifier (optional)." msgstr "" -#: ../../c-api/unicode.rst:422 +#: ../../c-api/unicode.rst:432 msgid "Conversion type." msgstr "" -#: ../../c-api/unicode.rst:424 +#: ../../c-api/unicode.rst:434 msgid "The conversion flag characters are:" msgstr "" -#: ../../c-api/unicode.rst:429 +#: ../../c-api/unicode.rst:439 msgid "Flag" msgstr "旗標" -#: ../../c-api/unicode.rst:429 +#: ../../c-api/unicode.rst:439 msgid "Meaning" msgstr "含義" -#: ../../c-api/unicode.rst:431 +#: ../../c-api/unicode.rst:441 msgid "``0``" msgstr "``0``" -#: ../../c-api/unicode.rst:431 +#: ../../c-api/unicode.rst:441 msgid "The conversion will be zero padded for numeric values." msgstr "" -#: ../../c-api/unicode.rst:433 +#: ../../c-api/unicode.rst:443 msgid "``-``" msgstr "``-``" -#: ../../c-api/unicode.rst:433 +#: ../../c-api/unicode.rst:443 msgid "" "The converted value is left adjusted (overrides the ``0`` flag if both are " "given)." msgstr "" -#: ../../c-api/unicode.rst:437 +#: ../../c-api/unicode.rst:447 msgid "" "The length modifiers for following integer conversions (``d``, ``i``, ``o``, " "``u``, ``x``, or ``X``) specify the type of the argument (:c:expr:`int` by " "default):" msgstr "" -#: ../../c-api/unicode.rst:444 +#: ../../c-api/unicode.rst:454 msgid "Modifier" msgstr "" -#: ../../c-api/unicode.rst:444 +#: ../../c-api/unicode.rst:454 msgid "Types" msgstr "" -#: ../../c-api/unicode.rst:446 +#: ../../c-api/unicode.rst:456 msgid "``l``" msgstr "``l``" -#: ../../c-api/unicode.rst:446 +#: ../../c-api/unicode.rst:456 msgid ":c:expr:`long` or :c:expr:`unsigned long`" msgstr ":c:expr:`long` 或 :c:expr:`unsigned long`" -#: ../../c-api/unicode.rst:448 +#: ../../c-api/unicode.rst:458 msgid "``ll``" msgstr "``ll``" -#: ../../c-api/unicode.rst:448 +#: ../../c-api/unicode.rst:458 msgid ":c:expr:`long long` or :c:expr:`unsigned long long`" msgstr ":c:expr:`long long` 或 :c:expr:`unsigned long long`" -#: ../../c-api/unicode.rst:450 +#: ../../c-api/unicode.rst:460 msgid "``j``" msgstr "``j``" -#: ../../c-api/unicode.rst:450 +#: ../../c-api/unicode.rst:460 msgid ":c:type:`intmax_t` or :c:type:`uintmax_t`" msgstr ":c:type:`intmax_t` 或 :c:type:`uintmax_t`" -#: ../../c-api/unicode.rst:452 +#: ../../c-api/unicode.rst:462 msgid "``z``" msgstr "``z``" -#: ../../c-api/unicode.rst:452 +#: ../../c-api/unicode.rst:462 msgid ":c:type:`size_t` or :c:type:`ssize_t`" msgstr ":c:type:`size_t` 或 :c:type:`ssize_t`" -#: ../../c-api/unicode.rst:454 +#: ../../c-api/unicode.rst:464 msgid "``t``" msgstr "``t``" -#: ../../c-api/unicode.rst:454 +#: ../../c-api/unicode.rst:464 msgid ":c:type:`ptrdiff_t`" msgstr ":c:type:`ptrdiff_t`" -#: ../../c-api/unicode.rst:457 +#: ../../c-api/unicode.rst:467 msgid "" "The length modifier ``l`` for following conversions ``s`` or ``V`` specify " "that the type of the argument is :c:expr:`const wchar_t*`." msgstr "" -#: ../../c-api/unicode.rst:460 +#: ../../c-api/unicode.rst:470 msgid "The conversion specifiers are:" msgstr "" -#: ../../c-api/unicode.rst:466 +#: ../../c-api/unicode.rst:476 msgid "Conversion Specifier" msgstr "" -#: ../../c-api/unicode.rst:467 +#: ../../c-api/unicode.rst:477 msgid "Type" msgstr "" -#: ../../c-api/unicode.rst:468 +#: ../../c-api/unicode.rst:478 msgid "Comment" msgstr "" -#: ../../c-api/unicode.rst:470 +#: ../../c-api/unicode.rst:480 msgid "``%``" msgstr "``%``" -#: ../../c-api/unicode.rst:471 +#: ../../c-api/unicode.rst:481 msgid "*n/a*" msgstr "*n/a*" -#: ../../c-api/unicode.rst:472 +#: ../../c-api/unicode.rst:482 msgid "The literal ``%`` character." msgstr "字面 ``%`` 字元。" -#: ../../c-api/unicode.rst:474 +#: ../../c-api/unicode.rst:484 msgid "``d``, ``i``" msgstr "``d``, ``i``" -#: ../../c-api/unicode.rst:475 ../../c-api/unicode.rst:479 -#: ../../c-api/unicode.rst:483 ../../c-api/unicode.rst:487 -#: ../../c-api/unicode.rst:491 +#: ../../c-api/unicode.rst:485 ../../c-api/unicode.rst:489 +#: ../../c-api/unicode.rst:493 ../../c-api/unicode.rst:497 +#: ../../c-api/unicode.rst:501 msgid "Specified by the length modifier" msgstr "" -#: ../../c-api/unicode.rst:476 +#: ../../c-api/unicode.rst:486 msgid "The decimal representation of a signed C integer." msgstr "一個有符號 C 整數的十進位表示法。" -#: ../../c-api/unicode.rst:478 +#: ../../c-api/unicode.rst:488 msgid "``u``" msgstr "``u``" -#: ../../c-api/unicode.rst:480 +#: ../../c-api/unicode.rst:490 msgid "The decimal representation of an unsigned C integer." msgstr "一個無符號 C 整數的十進位表示法。" -#: ../../c-api/unicode.rst:482 +#: ../../c-api/unicode.rst:492 msgid "``o``" msgstr "``o``" -#: ../../c-api/unicode.rst:484 +#: ../../c-api/unicode.rst:494 msgid "The octal representation of an unsigned C integer." msgstr "一個無符號 C 整數的八進位表示法。" -#: ../../c-api/unicode.rst:486 +#: ../../c-api/unicode.rst:496 msgid "``x``" msgstr "``x``" -#: ../../c-api/unicode.rst:488 +#: ../../c-api/unicode.rst:498 msgid "The hexadecimal representation of an unsigned C integer (lowercase)." msgstr "一個無符號 C 整數的十六進位表示法(小寫)。" -#: ../../c-api/unicode.rst:490 +#: ../../c-api/unicode.rst:500 msgid "``X``" msgstr "``X``" -#: ../../c-api/unicode.rst:492 +#: ../../c-api/unicode.rst:502 msgid "The hexadecimal representation of an unsigned C integer (uppercase)." msgstr "一個無符號 C 整數的十六進位表示法(大寫)。" -#: ../../c-api/unicode.rst:494 +#: ../../c-api/unicode.rst:504 msgid "``c``" msgstr "``c``" -#: ../../c-api/unicode.rst:495 +#: ../../c-api/unicode.rst:505 msgid ":c:expr:`int`" msgstr ":c:expr:`int`" -#: ../../c-api/unicode.rst:496 +#: ../../c-api/unicode.rst:506 msgid "A single character." msgstr "一個單一字元。" -#: ../../c-api/unicode.rst:498 +#: ../../c-api/unicode.rst:508 msgid "``s``" msgstr "``s``" -#: ../../c-api/unicode.rst:499 +#: ../../c-api/unicode.rst:509 msgid ":c:expr:`const char*` or :c:expr:`const wchar_t*`" msgstr ":c:expr:`const char*` 或 :c:expr:`const wchar_t*`" -#: ../../c-api/unicode.rst:500 +#: ../../c-api/unicode.rst:510 msgid "A null-terminated C character array." msgstr "一個以 null 結尾的 C 字元陣列。" -#: ../../c-api/unicode.rst:502 +#: ../../c-api/unicode.rst:512 msgid "``p``" msgstr "``p``" -#: ../../c-api/unicode.rst:503 +#: ../../c-api/unicode.rst:513 msgid ":c:expr:`const void*`" msgstr ":c:expr:`const void*`" -#: ../../c-api/unicode.rst:504 +#: ../../c-api/unicode.rst:514 msgid "" "The hex representation of a C pointer. Mostly equivalent to " "``printf(\"%p\")`` except that it is guaranteed to start with the literal " "``0x`` regardless of what the platform's ``printf`` yields." msgstr "" -#: ../../c-api/unicode.rst:509 +#: ../../c-api/unicode.rst:519 msgid "``A``" msgstr "``A``" -#: ../../c-api/unicode.rst:510 ../../c-api/unicode.rst:514 -#: ../../c-api/unicode.rst:524 ../../c-api/unicode.rst:528 -#: ../../c-api/unicode.rst:532 ../../c-api/unicode.rst:537 +#: ../../c-api/unicode.rst:520 ../../c-api/unicode.rst:524 +#: ../../c-api/unicode.rst:534 ../../c-api/unicode.rst:538 +#: ../../c-api/unicode.rst:542 ../../c-api/unicode.rst:547 msgid ":c:expr:`PyObject*`" msgstr ":c:expr:`PyObject*`" -#: ../../c-api/unicode.rst:511 +#: ../../c-api/unicode.rst:521 msgid "The result of calling :func:`ascii`." msgstr "呼叫 :func:`ascii` 的結果。" -#: ../../c-api/unicode.rst:513 +#: ../../c-api/unicode.rst:523 msgid "``U``" msgstr "``U``" -#: ../../c-api/unicode.rst:515 +#: ../../c-api/unicode.rst:525 msgid "A Unicode object." msgstr "一個 Unicode 物件。" -#: ../../c-api/unicode.rst:517 +#: ../../c-api/unicode.rst:527 msgid "``V``" msgstr "``V``" -#: ../../c-api/unicode.rst:518 +#: ../../c-api/unicode.rst:528 msgid ":c:expr:`PyObject*`, :c:expr:`const char*` or :c:expr:`const wchar_t*`" msgstr ":c:expr:`PyObject*`、:c:expr:`const char*` 或 :c:expr:`const wchar_t*`" -#: ../../c-api/unicode.rst:519 +#: ../../c-api/unicode.rst:529 msgid "" "A Unicode object (which may be ``NULL``) and a null-terminated C character " "array as a second parameter (which will be used, if the first parameter is " "``NULL``)." msgstr "" -#: ../../c-api/unicode.rst:523 +#: ../../c-api/unicode.rst:533 msgid "``S``" msgstr "``S``" -#: ../../c-api/unicode.rst:525 +#: ../../c-api/unicode.rst:535 msgid "The result of calling :c:func:`PyObject_Str`." msgstr "呼叫 :c:func:`PyObject_Str` 的結果。" -#: ../../c-api/unicode.rst:527 +#: ../../c-api/unicode.rst:537 msgid "``R``" msgstr "``R``" -#: ../../c-api/unicode.rst:529 +#: ../../c-api/unicode.rst:539 msgid "The result of calling :c:func:`PyObject_Repr`." msgstr "呼叫 :c:func:`PyObject_Repr` 的結果。" -#: ../../c-api/unicode.rst:531 +#: ../../c-api/unicode.rst:541 msgid "``T``" msgstr "``T``" -#: ../../c-api/unicode.rst:533 +#: ../../c-api/unicode.rst:543 msgid "" "Get the fully qualified name of an object type; call :c:func:" "`PyType_GetFullyQualifiedName`." msgstr "" -#: ../../c-api/unicode.rst:536 +#: ../../c-api/unicode.rst:546 msgid "``#T``" msgstr "``#T``" -#: ../../c-api/unicode.rst:538 +#: ../../c-api/unicode.rst:548 msgid "" "Similar to ``T`` format, but use a colon (``:``) as separator between the " "module name and the qualified name." msgstr "" -#: ../../c-api/unicode.rst:541 +#: ../../c-api/unicode.rst:551 msgid "``N``" msgstr "``N``" -#: ../../c-api/unicode.rst:542 ../../c-api/unicode.rst:547 +#: ../../c-api/unicode.rst:552 ../../c-api/unicode.rst:557 msgid ":c:expr:`PyTypeObject*`" msgstr ":c:expr:`PyTypeObject*`" -#: ../../c-api/unicode.rst:543 +#: ../../c-api/unicode.rst:553 msgid "" "Get the fully qualified name of a type; call :c:func:" "`PyType_GetFullyQualifiedName`." msgstr "" -#: ../../c-api/unicode.rst:546 +#: ../../c-api/unicode.rst:556 msgid "``#N``" msgstr "``#N``" -#: ../../c-api/unicode.rst:548 +#: ../../c-api/unicode.rst:558 msgid "" "Similar to ``N`` format, but use a colon (``:``) as separator between the " "module name and the qualified name." msgstr "" -#: ../../c-api/unicode.rst:552 +#: ../../c-api/unicode.rst:562 msgid "" "The width formatter unit is number of characters rather than bytes. The " "precision formatter unit is number of bytes or :c:type:`wchar_t` items (if " @@ -797,22 +809,22 @@ msgid "" "``PyObject*`` argument is not ``NULL``)." msgstr "" -#: ../../c-api/unicode.rst:560 +#: ../../c-api/unicode.rst:570 msgid "" "Unlike to C :c:func:`printf` the ``0`` flag has effect even when a precision " "is given for integer conversions (``d``, ``i``, ``u``, ``o``, ``x``, or " "``X``)." msgstr "" -#: ../../c-api/unicode.rst:564 +#: ../../c-api/unicode.rst:574 msgid "Support for ``\"%lld\"`` and ``\"%llu\"`` added." msgstr "新增對 ``\"%lld\"`` 和 ``\"%llu\"`` 的支援。" -#: ../../c-api/unicode.rst:567 +#: ../../c-api/unicode.rst:577 msgid "Support for ``\"%li\"``, ``\"%lli\"`` and ``\"%zi\"`` added." msgstr "新增對 ``\"%li\"``、``\"%lli\"`` 和 ``\"%zi\"`` 的支援。" -#: ../../c-api/unicode.rst:570 +#: ../../c-api/unicode.rst:580 msgid "" "Support width and precision formatter for ``\"%s\"``, ``\"%A\"``, " "``\"%U\"``, ``\"%V\"``, ``\"%S\"``, ``\"%R\"`` added." @@ -820,7 +832,7 @@ msgstr "" "新增對 ``\"%s\"``、``\"%A\"``、``\"%U\"``、``\"%V\"``、``\"%S\"``、" "``\"%R\"`` 的寬度和精確度格式化支援。" -#: ../../c-api/unicode.rst:574 +#: ../../c-api/unicode.rst:584 msgid "" "Support for conversion specifiers ``o`` and ``X``. Support for length " "modifiers ``j`` and ``t``. Length modifiers are now applied to all integer " @@ -829,50 +841,50 @@ msgid "" "flag ``-``." msgstr "" -#: ../../c-api/unicode.rst:582 +#: ../../c-api/unicode.rst:592 msgid "" "An unrecognized format character now sets a :exc:`SystemError`. In previous " "versions it caused all the rest of the format string to be copied as-is to " "the result string, and any extra arguments discarded." msgstr "" -#: ../../c-api/unicode.rst:586 +#: ../../c-api/unicode.rst:596 msgid "Support for ``%T``, ``%#T``, ``%N`` and ``%#N`` formats added." msgstr "新增對 ``%T``、``%#T``、``%N`` 和 ``%#N`` 格式的支援。" -#: ../../c-api/unicode.rst:592 +#: ../../c-api/unicode.rst:602 msgid "" "Identical to :c:func:`PyUnicode_FromFormat` except that it takes exactly two " "arguments." msgstr "" -#: ../../c-api/unicode.rst:598 +#: ../../c-api/unicode.rst:608 msgid "" "Copy an instance of a Unicode subtype to a new true Unicode object if " "necessary. If *obj* is already a true Unicode object (not a subtype), return " "a new :term:`strong reference` to the object." msgstr "" -#: ../../c-api/unicode.rst:602 +#: ../../c-api/unicode.rst:612 msgid "" "Objects other than Unicode or its subtypes will cause a :exc:`TypeError`." msgstr "" -#: ../../c-api/unicode.rst:607 +#: ../../c-api/unicode.rst:617 msgid "Create a Unicode Object from the given Unicode code point *ordinal*." msgstr "" -#: ../../c-api/unicode.rst:609 +#: ../../c-api/unicode.rst:619 msgid "" "The ordinal must be in ``range(0x110000)``. A :exc:`ValueError` is raised in " "the case it is not." msgstr "" -#: ../../c-api/unicode.rst:616 +#: ../../c-api/unicode.rst:626 msgid "Decode an encoded object *obj* to a Unicode object." msgstr "" -#: ../../c-api/unicode.rst:618 +#: ../../c-api/unicode.rst:628 msgid "" ":class:`bytes`, :class:`bytearray` and other :term:`bytes-like objects " "` are decoded according to the given *encoding* and using " @@ -880,40 +892,40 @@ msgid "" "interface use the default values (see :ref:`builtincodecs` for details)." msgstr "" -#: ../../c-api/unicode.rst:624 +#: ../../c-api/unicode.rst:634 msgid "" "All other objects, including Unicode objects, cause a :exc:`TypeError` to be " "set." msgstr "" -#: ../../c-api/unicode.rst:627 +#: ../../c-api/unicode.rst:637 msgid "" "The API returns ``NULL`` if there was an error. The caller is responsible " "for decref'ing the returned objects." msgstr "" -#: ../../c-api/unicode.rst:633 +#: ../../c-api/unicode.rst:643 msgid "" "Append the string *right* to the end of *p_left*. *p_left* must point to a :" "term:`strong reference` to a Unicode object; :c:func:`!PyUnicode_Append` " "releases (\"steals\") this reference." msgstr "" -#: ../../c-api/unicode.rst:637 +#: ../../c-api/unicode.rst:647 msgid "On error, set *\\*p_left* to ``NULL`` and set an exception." msgstr "於錯誤發生時,將 *\\*p_left* 設為 ``NULL`` 並設定例外。" -#: ../../c-api/unicode.rst:639 +#: ../../c-api/unicode.rst:649 msgid "On success, set *\\*p_left* to a new strong reference to the result." msgstr "" -#: ../../c-api/unicode.rst:644 +#: ../../c-api/unicode.rst:654 msgid "" "The function is similar to :c:func:`PyUnicode_Append`, with the only " "difference being that it decrements the reference count of *right* by one." msgstr "" -#: ../../c-api/unicode.rst:650 +#: ../../c-api/unicode.rst:660 msgid "" "Return a mapping suitable for decoding a custom single-byte encoding. Given " "a Unicode string *string* of up to 256 characters representing an encoding " @@ -922,27 +934,27 @@ msgid "" "return ``NULL`` on invalid input." msgstr "" -#: ../../c-api/unicode.rst:661 +#: ../../c-api/unicode.rst:671 msgid "" "Return the name of the default string encoding, ``\"utf-8\"``. See :func:" "`sys.getdefaultencoding`." msgstr "" -#: ../../c-api/unicode.rst:664 +#: ../../c-api/unicode.rst:674 msgid "" "The returned string does not need to be freed, and is valid until " "interpreter shutdown." msgstr "" -#: ../../c-api/unicode.rst:670 +#: ../../c-api/unicode.rst:680 msgid "Return the length of the Unicode object, in code points." msgstr "" -#: ../../c-api/unicode.rst:672 +#: ../../c-api/unicode.rst:682 msgid "On error, set an exception and return ``-1``." msgstr "發生錯誤時,設定例外並回傳 ``-1``。" -#: ../../c-api/unicode.rst:683 +#: ../../c-api/unicode.rst:693 msgid "" "Copy characters from one Unicode object into another. This function " "performs character conversion when necessary and falls back to :c:func:`!" @@ -950,62 +962,62 @@ msgid "" "otherwise returns the number of copied characters." msgstr "" -#: ../../c-api/unicode.rst:688 ../../c-api/unicode.rst:718 -#: ../../c-api/unicode.rst:738 +#: ../../c-api/unicode.rst:698 ../../c-api/unicode.rst:728 +#: ../../c-api/unicode.rst:748 msgid "" "The string must not have been “used” yet. See :c:func:`PyUnicode_New` for " "details." msgstr "" -#: ../../c-api/unicode.rst:696 +#: ../../c-api/unicode.rst:706 msgid "" "Resize a Unicode object *\\*unicode* to the new *length* in code points." msgstr "" -#: ../../c-api/unicode.rst:698 +#: ../../c-api/unicode.rst:708 msgid "" "Try to resize the string in place (which is usually faster than allocating a " "new string and copying characters), or create a new string." msgstr "" -#: ../../c-api/unicode.rst:701 +#: ../../c-api/unicode.rst:711 msgid "" "*\\*unicode* is modified to point to the new (resized) object and ``0`` is " "returned on success. Otherwise, ``-1`` is returned and an exception is set, " "and *\\*unicode* is left untouched." msgstr "" -#: ../../c-api/unicode.rst:705 +#: ../../c-api/unicode.rst:715 msgid "" "The function doesn't check string content, the result may not be a string in " "canonical representation." msgstr "" -#: ../../c-api/unicode.rst:712 +#: ../../c-api/unicode.rst:722 msgid "" "Fill a string with a character: write *fill_char* into ``unicode[start:" "start+length]``." msgstr "" -#: ../../c-api/unicode.rst:715 +#: ../../c-api/unicode.rst:725 msgid "" "Fail if *fill_char* is bigger than the string maximum character, or if the " "string has more than 1 reference." msgstr "" -#: ../../c-api/unicode.rst:721 +#: ../../c-api/unicode.rst:731 msgid "" "Return the number of written character, or return ``-1`` and raise an " "exception on error." msgstr "" -#: ../../c-api/unicode.rst:730 +#: ../../c-api/unicode.rst:740 msgid "" "Write a *character* to the string *unicode* at the zero-based *index*. " "Return ``0`` on success, ``-1`` on error with an exception set." msgstr "" -#: ../../c-api/unicode.rst:733 +#: ../../c-api/unicode.rst:743 msgid "" "This function checks that *unicode* is a Unicode object, that the index is " "not out of bounds, and that the object's reference count is one. See :c:func:" @@ -1013,25 +1025,25 @@ msgid "" "responsibility." msgstr "" -#: ../../c-api/unicode.rst:746 +#: ../../c-api/unicode.rst:756 msgid "" "Read a character from a string. This function checks that *unicode* is a " "Unicode object and the index is not out of bounds, in contrast to :c:func:" "`PyUnicode_READ_CHAR`, which performs no error checking." msgstr "" -#: ../../c-api/unicode.rst:750 +#: ../../c-api/unicode.rst:760 msgid "Return character on success, ``-1`` on error with an exception set." msgstr "成功時回傳字元,發生錯誤時設定例外並回傳 ``-1``。" -#: ../../c-api/unicode.rst:758 +#: ../../c-api/unicode.rst:768 msgid "" "Return a substring of *unicode*, from character index *start* (included) to " "character index *end* (excluded). Negative indices are not supported. On " "error, set an exception and return ``NULL``." msgstr "" -#: ../../c-api/unicode.rst:768 +#: ../../c-api/unicode.rst:778 msgid "" "Copy the string *unicode* into a UCS4 buffer, including a null character, if " "*copy_null* is set. Returns ``NULL`` and sets an exception on error (in " @@ -1039,7 +1051,7 @@ msgid "" "*unicode*). *buffer* is returned on success." msgstr "" -#: ../../c-api/unicode.rst:778 +#: ../../c-api/unicode.rst:788 msgid "" "Copy the string *unicode* into a new UCS4 buffer that is allocated using :c:" "func:`PyMem_Malloc`. If this fails, ``NULL`` is returned with a :exc:" @@ -1047,17 +1059,17 @@ msgid "" "appended." msgstr "" -#: ../../c-api/unicode.rst:787 +#: ../../c-api/unicode.rst:797 msgid "Locale Encoding" msgstr "" -#: ../../c-api/unicode.rst:789 +#: ../../c-api/unicode.rst:799 msgid "" "The current locale encoding can be used to decode text from the operating " "system." msgstr "" -#: ../../c-api/unicode.rst:796 +#: ../../c-api/unicode.rst:806 msgid "" "Decode a string from UTF-8 on Android and VxWorks, or from the current " "locale encoding on other platforms. The supported error handlers are " @@ -1066,21 +1078,21 @@ msgid "" "null character but cannot contain embedded null characters." msgstr "" -#: ../../c-api/unicode.rst:803 +#: ../../c-api/unicode.rst:813 msgid "" "Use :c:func:`PyUnicode_DecodeFSDefaultAndSize` to decode a string from the :" "term:`filesystem encoding and error handler`." msgstr "" -#: ../../c-api/unicode.rst:806 ../../c-api/unicode.rst:841 +#: ../../c-api/unicode.rst:816 ../../c-api/unicode.rst:851 msgid "This function ignores the :ref:`Python UTF-8 Mode `." msgstr "此函式會忽略 :ref:`Python UTF-8 模式 `。" -#: ../../c-api/unicode.rst:810 ../../c-api/unicode.rst:926 +#: ../../c-api/unicode.rst:820 ../../c-api/unicode.rst:936 msgid "The :c:func:`Py_DecodeLocale` function." msgstr ":c:func:`Py_DecodeLocale` 函式。" -#: ../../c-api/unicode.rst:814 +#: ../../c-api/unicode.rst:824 msgid "" "The function now also uses the current locale encoding for the " "``surrogateescape`` error handler, except on Android. Previously, :c:func:" @@ -1088,7 +1100,7 @@ msgid "" "locale encoding was used for ``strict``." msgstr "" -#: ../../c-api/unicode.rst:823 +#: ../../c-api/unicode.rst:833 msgid "" "Similar to :c:func:`PyUnicode_DecodeLocaleAndSize`, but compute the string " "length using :c:func:`!strlen`." @@ -1096,7 +1108,7 @@ msgstr "" "類似於 :c:func:`PyUnicode_DecodeLocaleAndSize`,但使用 :c:func:`!strlen` 計算" "字串長度。" -#: ../../c-api/unicode.rst:831 +#: ../../c-api/unicode.rst:841 msgid "" "Encode a Unicode object to UTF-8 on Android and VxWorks, or to the current " "locale encoding on other platforms. The supported error handlers are " @@ -1105,17 +1117,17 @@ msgid "" "`bytes` object. *unicode* cannot contain embedded null characters." msgstr "" -#: ../../c-api/unicode.rst:838 +#: ../../c-api/unicode.rst:848 msgid "" "Use :c:func:`PyUnicode_EncodeFSDefault` to encode a string to the :term:" "`filesystem encoding and error handler`." msgstr "" -#: ../../c-api/unicode.rst:845 ../../c-api/unicode.rst:957 +#: ../../c-api/unicode.rst:855 ../../c-api/unicode.rst:967 msgid "The :c:func:`Py_EncodeLocale` function." msgstr ":c:func:`Py_EncodeLocale` 函式。" -#: ../../c-api/unicode.rst:849 +#: ../../c-api/unicode.rst:859 msgid "" "The function now also uses the current locale encoding for the " "``surrogateescape`` error handler, except on Android. Previously, :c:func:" @@ -1123,24 +1135,24 @@ msgid "" "locale encoding was used for ``strict``." msgstr "" -#: ../../c-api/unicode.rst:858 +#: ../../c-api/unicode.rst:868 msgid "File System Encoding" msgstr "檔案系統編碼" -#: ../../c-api/unicode.rst:860 +#: ../../c-api/unicode.rst:870 msgid "" "Functions encoding to and decoding from the :term:`filesystem encoding and " "error handler` (:pep:`383` and :pep:`529`)." msgstr "" -#: ../../c-api/unicode.rst:863 +#: ../../c-api/unicode.rst:873 msgid "" "To encode file names to :class:`bytes` during argument parsing, the " "``\"O&\"`` converter should be used, passing :c:func:`!" "PyUnicode_FSConverter` as the conversion function:" msgstr "" -#: ../../c-api/unicode.rst:869 +#: ../../c-api/unicode.rst:879 msgid "" ":ref:`PyArg_Parse\\* converter `: encode :class:`str` objects " "-- obtained directly or through the :class:`os.PathLike` interface -- to :" @@ -1153,24 +1165,24 @@ msgid "" "not allowed in the result. On failure, return ``0`` with an exception set." msgstr "" -#: ../../c-api/unicode.rst:881 +#: ../../c-api/unicode.rst:891 msgid "" "If *obj* is ``NULL``, the function releases a strong reference stored in the " "variable referred by *result* and returns ``1``." msgstr "" -#: ../../c-api/unicode.rst:886 ../../c-api/unicode.rst:913 +#: ../../c-api/unicode.rst:896 ../../c-api/unicode.rst:923 msgid "Accepts a :term:`path-like object`." msgstr "接受一個 :term:`path-like object`。" -#: ../../c-api/unicode.rst:889 +#: ../../c-api/unicode.rst:899 msgid "" "To decode file names to :class:`str` during argument parsing, the ``\"O&\"`` " "converter should be used, passing :c:func:`!PyUnicode_FSDecoder` as the " "conversion function:" msgstr "" -#: ../../c-api/unicode.rst:895 +#: ../../c-api/unicode.rst:905 msgid "" ":ref:`PyArg_Parse\\* converter `: decode :class:`bytes` objects " "-- obtained either directly or indirectly through the :class:`os.PathLike` " @@ -1184,63 +1196,63 @@ msgid "" "result. On failure, return ``0`` with an exception set." msgstr "" -#: ../../c-api/unicode.rst:908 +#: ../../c-api/unicode.rst:918 msgid "" "If *obj* is ``NULL``, release the strong reference to the object referred to " "by *result* and return ``1``." msgstr "" -#: ../../c-api/unicode.rst:919 +#: ../../c-api/unicode.rst:929 msgid "Decode a string from the :term:`filesystem encoding and error handler`." msgstr "" -#: ../../c-api/unicode.rst:921 +#: ../../c-api/unicode.rst:931 msgid "" "If you need to decode a string from the current locale encoding, use :c:func:" "`PyUnicode_DecodeLocaleAndSize`." msgstr "" -#: ../../c-api/unicode.rst:928 ../../c-api/unicode.rst:941 -#: ../../c-api/unicode.rst:961 +#: ../../c-api/unicode.rst:938 ../../c-api/unicode.rst:951 +#: ../../c-api/unicode.rst:971 msgid "" "The :term:`filesystem error handler ` " "is now used." msgstr "" -#: ../../c-api/unicode.rst:935 +#: ../../c-api/unicode.rst:945 msgid "" "Decode a null-terminated string from the :term:`filesystem encoding and " "error handler`." msgstr "" -#: ../../c-api/unicode.rst:938 +#: ../../c-api/unicode.rst:948 msgid "" "If the string length is known, use :c:func:" "`PyUnicode_DecodeFSDefaultAndSize`." msgstr "如果字串長度已知,請使用 :c:func:`PyUnicode_DecodeFSDefaultAndSize`。" -#: ../../c-api/unicode.rst:948 +#: ../../c-api/unicode.rst:958 msgid "" "Encode a Unicode object to the :term:`filesystem encoding and error " "handler`, and return :class:`bytes`. Note that the resulting :class:`bytes` " "object can contain null bytes." msgstr "" -#: ../../c-api/unicode.rst:952 +#: ../../c-api/unicode.rst:962 msgid "" "If you need to encode a string to the current locale encoding, use :c:func:" "`PyUnicode_EncodeLocale`." msgstr "" -#: ../../c-api/unicode.rst:966 +#: ../../c-api/unicode.rst:976 msgid "wchar_t Support" msgstr "wchar_t 支援" -#: ../../c-api/unicode.rst:968 +#: ../../c-api/unicode.rst:978 msgid ":c:type:`wchar_t` support for platforms which support it:" msgstr "對支援 :c:type:`wchar_t` 的平台提供支援:" -#: ../../c-api/unicode.rst:972 +#: ../../c-api/unicode.rst:982 msgid "" "Create a Unicode object from the :c:type:`wchar_t` buffer *wstr* of the " "given *size*. Passing ``-1`` as the *size* indicates that the function must " @@ -1248,7 +1260,7 @@ msgid "" "failure." msgstr "" -#: ../../c-api/unicode.rst:980 +#: ../../c-api/unicode.rst:990 msgid "" "Copy the Unicode object contents into the :c:type:`wchar_t` buffer *wstr*. " "At most *size* :c:type:`wchar_t` characters are copied (excluding a possibly " @@ -1256,13 +1268,13 @@ msgid "" "`wchar_t` characters copied or ``-1`` in case of an error." msgstr "" -#: ../../c-api/unicode.rst:985 +#: ../../c-api/unicode.rst:995 msgid "" "When *wstr* is ``NULL``, instead return the *size* that would be required to " "store all of *unicode* including a terminating null." msgstr "" -#: ../../c-api/unicode.rst:988 +#: ../../c-api/unicode.rst:998 msgid "" "Note that the resulting :c:expr:`wchar_t*` string may or may not be null-" "terminated. It is the responsibility of the caller to make sure that the :c:" @@ -1272,7 +1284,7 @@ msgid "" "most C functions." msgstr "" -#: ../../c-api/unicode.rst:998 +#: ../../c-api/unicode.rst:1008 msgid "" "Convert the Unicode object to a wide character string. The output string " "always ends with a null character. If *size* is not ``NULL``, write the " @@ -1283,37 +1295,37 @@ msgid "" "`wchar_t*` string contains null characters a :exc:`ValueError` is raised." msgstr "" -#: ../../c-api/unicode.rst:1006 +#: ../../c-api/unicode.rst:1016 msgid "" "Returns a buffer allocated by :c:macro:`PyMem_New` (use :c:func:`PyMem_Free` " "to free it) on success. On error, returns ``NULL`` and *\\*size* is " "undefined. Raises a :exc:`MemoryError` if memory allocation is failed." msgstr "" -#: ../../c-api/unicode.rst:1013 +#: ../../c-api/unicode.rst:1023 msgid "" "Raises a :exc:`ValueError` if *size* is ``NULL`` and the :c:expr:`wchar_t*` " "string contains null characters." msgstr "" -#: ../../c-api/unicode.rst:1021 +#: ../../c-api/unicode.rst:1031 msgid "Built-in Codecs" msgstr "內建編解碼器" -#: ../../c-api/unicode.rst:1023 +#: ../../c-api/unicode.rst:1033 msgid "" "Python provides a set of built-in codecs which are written in C for speed. " "All of these codecs are directly usable via the following functions." msgstr "" -#: ../../c-api/unicode.rst:1026 +#: ../../c-api/unicode.rst:1036 msgid "" "Many of the following APIs take two arguments encoding and errors, and they " "have the same semantics as the ones of the built-in :func:`str` string " "object constructor." msgstr "" -#: ../../c-api/unicode.rst:1030 +#: ../../c-api/unicode.rst:1040 msgid "" "Setting encoding to ``NULL`` causes the default encoding to be used which is " "UTF-8. The file system calls should use :c:func:`PyUnicode_FSConverter` for " @@ -1321,42 +1333,42 @@ msgid "" "handler` internally." msgstr "" -#: ../../c-api/unicode.rst:1035 +#: ../../c-api/unicode.rst:1045 msgid "" "Error handling is set by errors which may also be set to ``NULL`` meaning to " "use the default handling defined for the codec. Default error handling for " "all built-in codecs is \"strict\" (:exc:`ValueError` is raised)." msgstr "" -#: ../../c-api/unicode.rst:1039 +#: ../../c-api/unicode.rst:1049 msgid "" "The codecs all use a similar interface. Only deviations from the following " "generic ones are documented for simplicity." msgstr "" -#: ../../c-api/unicode.rst:1044 +#: ../../c-api/unicode.rst:1054 msgid "Generic Codecs" msgstr "泛用編解碼器" -#: ../../c-api/unicode.rst:1046 +#: ../../c-api/unicode.rst:1056 msgid "The following macro is provided:" msgstr "" -#: ../../c-api/unicode.rst:1051 +#: ../../c-api/unicode.rst:1061 msgid "The Unicode code point ``U+FFFD`` (replacement character)." msgstr "" -#: ../../c-api/unicode.rst:1053 +#: ../../c-api/unicode.rst:1063 msgid "" "This Unicode character is used as the replacement character during decoding " "if the *errors* argument is set to \"replace\"." msgstr "" -#: ../../c-api/unicode.rst:1057 +#: ../../c-api/unicode.rst:1067 msgid "These are the generic codec APIs:" msgstr "這些是泛用編解碼器的 API:" -#: ../../c-api/unicode.rst:1063 +#: ../../c-api/unicode.rst:1073 msgid "" "Create a Unicode object by decoding *size* bytes of the encoded string " "*str*. *encoding* and *errors* have the same meaning as the parameters of " @@ -1365,7 +1377,7 @@ msgid "" "was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1073 +#: ../../c-api/unicode.rst:1083 msgid "" "Encode a Unicode object and return the result as Python bytes object. " "*encoding* and *errors* have the same meaning as the parameters of the same " @@ -1374,21 +1386,21 @@ msgid "" "was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1081 +#: ../../c-api/unicode.rst:1091 msgid "UTF-8 Codecs" msgstr "UTF-8 編解碼器" -#: ../../c-api/unicode.rst:1083 +#: ../../c-api/unicode.rst:1093 msgid "These are the UTF-8 codec APIs:" msgstr "這些是 UTF-8 編解碼器的 API:" -#: ../../c-api/unicode.rst:1088 +#: ../../c-api/unicode.rst:1098 msgid "" "Create a Unicode object by decoding *size* bytes of the UTF-8 encoded string " "*str*. Return ``NULL`` if an exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1095 +#: ../../c-api/unicode.rst:1105 msgid "" "If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeUTF8`. If " "*consumed* is not ``NULL``, trailing incomplete UTF-8 byte sequences will " @@ -1396,20 +1408,20 @@ msgid "" "of bytes that have been decoded will be stored in *consumed*." msgstr "" -#: ../../c-api/unicode.rst:1103 +#: ../../c-api/unicode.rst:1113 msgid "" "Encode a Unicode object using UTF-8 and return the result as Python bytes " "object. Error handling is \"strict\". Return ``NULL`` if an exception was " "raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1107 ../../c-api/unicode.rst:1122 +#: ../../c-api/unicode.rst:1117 ../../c-api/unicode.rst:1132 msgid "" "The function fails if the string contains surrogate code points (``U+D800`` " "- ``U+DFFF``)." msgstr "" -#: ../../c-api/unicode.rst:1113 +#: ../../c-api/unicode.rst:1123 msgid "" "Return a pointer to the UTF-8 encoding of the Unicode object, and store the " "size of the encoded representation (in bytes) in *size*. The *size* " @@ -1418,7 +1430,7 @@ msgid "" "regardless of whether there are any other null code points." msgstr "" -#: ../../c-api/unicode.rst:1119 +#: ../../c-api/unicode.rst:1129 msgid "" "On error, set an exception, set *size* to ``-1`` (if it's not NULL) and " "return ``NULL``." @@ -1426,7 +1438,7 @@ msgstr "" "發生錯誤時,設定例外並將 *size* 設為 ``-1``\\ (如果不是 NULL),並回傳 " "``NULL``。" -#: ../../c-api/unicode.rst:1125 +#: ../../c-api/unicode.rst:1135 msgid "" "This caches the UTF-8 representation of the string in the Unicode object, " "and subsequent calls will return a pointer to the same buffer. The caller " @@ -1435,19 +1447,19 @@ msgid "" "collected." msgstr "" -#: ../../c-api/unicode.rst:1132 ../../c-api/unicode.rst:1154 +#: ../../c-api/unicode.rst:1142 ../../c-api/unicode.rst:1164 msgid "The return type is now ``const char *`` rather of ``char *``." msgstr "回傳型別現在是 ``const char *`` 而不是 ``char *``。" -#: ../../c-api/unicode.rst:1135 +#: ../../c-api/unicode.rst:1145 msgid "This function is a part of the :ref:`limited API `." msgstr "" -#: ../../c-api/unicode.rst:1141 +#: ../../c-api/unicode.rst:1151 msgid "As :c:func:`PyUnicode_AsUTF8AndSize`, but does not store the size." msgstr "與 :c:func:`PyUnicode_AsUTF8AndSize` 類似,但不儲存大小。" -#: ../../c-api/unicode.rst:1145 +#: ../../c-api/unicode.rst:1155 msgid "" "This function does not have any special behavior for `null characters " "`_ embedded within *unicode*. " @@ -1457,35 +1469,35 @@ msgid "" "c:func:`PyUnicode_AsUTF8AndSize` instead." msgstr "" -#: ../../c-api/unicode.rst:1159 +#: ../../c-api/unicode.rst:1169 msgid "UTF-32 Codecs" msgstr "UTF-32 編解碼器" -#: ../../c-api/unicode.rst:1161 +#: ../../c-api/unicode.rst:1171 msgid "These are the UTF-32 codec APIs:" msgstr "這些是 UTF-32 編解碼器的 API:" -#: ../../c-api/unicode.rst:1167 +#: ../../c-api/unicode.rst:1177 msgid "" "Decode *size* bytes from a UTF-32 encoded buffer string and return the " "corresponding Unicode object. *errors* (if non-``NULL``) defines the error " "handling. It defaults to \"strict\"." msgstr "" -#: ../../c-api/unicode.rst:1171 ../../c-api/unicode.rst:1221 +#: ../../c-api/unicode.rst:1181 ../../c-api/unicode.rst:1231 msgid "" "If *byteorder* is non-``NULL``, the decoder starts decoding using the given " "byte order::" msgstr "" -#: ../../c-api/unicode.rst:1174 ../../c-api/unicode.rst:1224 +#: ../../c-api/unicode.rst:1184 ../../c-api/unicode.rst:1234 msgid "" "*byteorder == -1: little endian\n" "*byteorder == 0: native order\n" "*byteorder == 1: big endian" msgstr "" -#: ../../c-api/unicode.rst:1178 +#: ../../c-api/unicode.rst:1188 msgid "" "If ``*byteorder`` is zero, and the first four bytes of the input data are a " "byte order mark (BOM), the decoder switches to this byte order and the BOM " @@ -1493,21 +1505,21 @@ msgid "" "``-1`` or ``1``, any byte order mark is copied to the output." msgstr "" -#: ../../c-api/unicode.rst:1183 +#: ../../c-api/unicode.rst:1193 msgid "" "After completion, *\\*byteorder* is set to the current byte order at the end " "of input data." msgstr "" -#: ../../c-api/unicode.rst:1186 ../../c-api/unicode.rst:1237 +#: ../../c-api/unicode.rst:1196 ../../c-api/unicode.rst:1247 msgid "If *byteorder* is ``NULL``, the codec starts in native order mode." msgstr "" -#: ../../c-api/unicode.rst:1188 ../../c-api/unicode.rst:1239 +#: ../../c-api/unicode.rst:1198 ../../c-api/unicode.rst:1249 msgid "Return ``NULL`` if an exception was raised by the codec." msgstr "如果編解碼器引發例外則回傳 ``NULL``。" -#: ../../c-api/unicode.rst:1194 +#: ../../c-api/unicode.rst:1204 msgid "" "If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeUTF32`. If " "*consumed* is not ``NULL``, :c:func:`PyUnicode_DecodeUTF32Stateful` will not " @@ -1516,29 +1528,29 @@ msgid "" "number of bytes that have been decoded will be stored in *consumed*." msgstr "" -#: ../../c-api/unicode.rst:1203 +#: ../../c-api/unicode.rst:1213 msgid "" "Return a Python byte string using the UTF-32 encoding in native byte order. " "The string always starts with a BOM mark. Error handling is \"strict\". " "Return ``NULL`` if an exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1209 +#: ../../c-api/unicode.rst:1219 msgid "UTF-16 Codecs" msgstr "UTF-16 編解碼器" -#: ../../c-api/unicode.rst:1211 +#: ../../c-api/unicode.rst:1221 msgid "These are the UTF-16 codec APIs:" msgstr "這些是 UTF-16 編解碼器的 API:" -#: ../../c-api/unicode.rst:1217 +#: ../../c-api/unicode.rst:1227 msgid "" "Decode *size* bytes from a UTF-16 encoded buffer string and return the " "corresponding Unicode object. *errors* (if non-``NULL``) defines the error " "handling. It defaults to \"strict\"." msgstr "" -#: ../../c-api/unicode.rst:1228 +#: ../../c-api/unicode.rst:1238 msgid "" "If ``*byteorder`` is zero, and the first two bytes of the input data are a " "byte order mark (BOM), the decoder switches to this byte order and the BOM " @@ -1547,13 +1559,13 @@ msgid "" "result in either a ``\\ufeff`` or a ``\\ufffe`` character)." msgstr "" -#: ../../c-api/unicode.rst:1234 +#: ../../c-api/unicode.rst:1244 msgid "" "After completion, ``*byteorder`` is set to the current byte order at the end " "of input data." msgstr "" -#: ../../c-api/unicode.rst:1245 +#: ../../c-api/unicode.rst:1255 msgid "" "If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeUTF16`. If " "*consumed* is not ``NULL``, :c:func:`PyUnicode_DecodeUTF16Stateful` will not " @@ -1563,28 +1575,28 @@ msgid "" "*consumed*." msgstr "" -#: ../../c-api/unicode.rst:1254 +#: ../../c-api/unicode.rst:1264 msgid "" "Return a Python byte string using the UTF-16 encoding in native byte order. " "The string always starts with a BOM mark. Error handling is \"strict\". " "Return ``NULL`` if an exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1260 +#: ../../c-api/unicode.rst:1270 msgid "UTF-7 Codecs" msgstr "UTF-7 編解碼器" -#: ../../c-api/unicode.rst:1262 +#: ../../c-api/unicode.rst:1272 msgid "These are the UTF-7 codec APIs:" msgstr "這些是 UTF-7 編解碼器的 API:" -#: ../../c-api/unicode.rst:1267 +#: ../../c-api/unicode.rst:1277 msgid "" "Create a Unicode object by decoding *size* bytes of the UTF-7 encoded string " "*str*. Return ``NULL`` if an exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1274 +#: ../../c-api/unicode.rst:1284 msgid "" "If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeUTF7`. If " "*consumed* is not ``NULL``, trailing incomplete UTF-7 base-64 sections will " @@ -1592,101 +1604,101 @@ msgid "" "of bytes that have been decoded will be stored in *consumed*." msgstr "" -#: ../../c-api/unicode.rst:1281 +#: ../../c-api/unicode.rst:1291 msgid "Unicode-Escape Codecs" msgstr "" -#: ../../c-api/unicode.rst:1283 +#: ../../c-api/unicode.rst:1293 msgid "These are the \"Unicode Escape\" codec APIs:" msgstr "" -#: ../../c-api/unicode.rst:1289 +#: ../../c-api/unicode.rst:1299 msgid "" "Create a Unicode object by decoding *size* bytes of the Unicode-Escape " "encoded string *str*. Return ``NULL`` if an exception was raised by the " "codec." msgstr "" -#: ../../c-api/unicode.rst:1295 +#: ../../c-api/unicode.rst:1305 msgid "" "Encode a Unicode object using Unicode-Escape and return the result as a " "bytes object. Error handling is \"strict\". Return ``NULL`` if an " "exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1301 +#: ../../c-api/unicode.rst:1311 msgid "Raw-Unicode-Escape Codecs" msgstr "" -#: ../../c-api/unicode.rst:1303 +#: ../../c-api/unicode.rst:1313 msgid "These are the \"Raw Unicode Escape\" codec APIs:" msgstr "" -#: ../../c-api/unicode.rst:1309 +#: ../../c-api/unicode.rst:1319 msgid "" "Create a Unicode object by decoding *size* bytes of the Raw-Unicode-Escape " "encoded string *str*. Return ``NULL`` if an exception was raised by the " "codec." msgstr "" -#: ../../c-api/unicode.rst:1315 +#: ../../c-api/unicode.rst:1325 msgid "" "Encode a Unicode object using Raw-Unicode-Escape and return the result as a " "bytes object. Error handling is \"strict\". Return ``NULL`` if an " "exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1321 +#: ../../c-api/unicode.rst:1331 msgid "Latin-1 Codecs" msgstr "Latin-1 編解碼器" -#: ../../c-api/unicode.rst:1323 +#: ../../c-api/unicode.rst:1333 msgid "" "These are the Latin-1 codec APIs: Latin-1 corresponds to the first 256 " "Unicode ordinals and only these are accepted by the codecs during encoding." msgstr "" -#: ../../c-api/unicode.rst:1329 +#: ../../c-api/unicode.rst:1339 msgid "" "Create a Unicode object by decoding *size* bytes of the Latin-1 encoded " "string *str*. Return ``NULL`` if an exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1335 +#: ../../c-api/unicode.rst:1345 msgid "" "Encode a Unicode object using Latin-1 and return the result as Python bytes " "object. Error handling is \"strict\". Return ``NULL`` if an exception was " "raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1341 +#: ../../c-api/unicode.rst:1351 msgid "ASCII Codecs" msgstr "ASCII 編解碼器" -#: ../../c-api/unicode.rst:1343 +#: ../../c-api/unicode.rst:1353 msgid "" "These are the ASCII codec APIs. Only 7-bit ASCII data is accepted. All " "other codes generate errors." msgstr "" -#: ../../c-api/unicode.rst:1349 +#: ../../c-api/unicode.rst:1359 msgid "" "Create a Unicode object by decoding *size* bytes of the ASCII encoded string " "*str*. Return ``NULL`` if an exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1355 +#: ../../c-api/unicode.rst:1365 msgid "" "Encode a Unicode object using ASCII and return the result as Python bytes " "object. Error handling is \"strict\". Return ``NULL`` if an exception was " "raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1361 +#: ../../c-api/unicode.rst:1371 msgid "Character Map Codecs" msgstr "" -#: ../../c-api/unicode.rst:1363 +#: ../../c-api/unicode.rst:1373 msgid "" "This codec is special in that it can be used to implement many different " "codecs (and this is in fact what was done to obtain most of the standard " @@ -1696,18 +1708,18 @@ msgid "" "sequences work well." msgstr "" -#: ../../c-api/unicode.rst:1369 +#: ../../c-api/unicode.rst:1379 msgid "These are the mapping codec APIs:" msgstr "這些是對映編解碼器的 API:" -#: ../../c-api/unicode.rst:1374 +#: ../../c-api/unicode.rst:1384 msgid "" "Create a Unicode object by decoding *size* bytes of the encoded string *str* " "using the given *mapping* object. Return ``NULL`` if an exception was " "raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1378 +#: ../../c-api/unicode.rst:1388 msgid "" "If *mapping* is ``NULL``, Latin-1 decoding will be applied. Else *mapping* " "must map bytes ordinals (integers in the range from 0 to 255) to Unicode " @@ -1717,14 +1729,14 @@ msgid "" "treated as undefined mappings and cause an error." msgstr "" -#: ../../c-api/unicode.rst:1389 +#: ../../c-api/unicode.rst:1399 msgid "" "Encode a Unicode object using the given *mapping* object and return the " "result as a bytes object. Error handling is \"strict\". Return ``NULL`` if " "an exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1393 +#: ../../c-api/unicode.rst:1403 msgid "" "The *mapping* object must map Unicode ordinal integers to bytes objects, " "integers in the range from 0 to 255 or ``None``. Unmapped character " @@ -1732,41 +1744,41 @@ msgid "" "``None`` are treated as \"undefined mapping\" and cause an error." msgstr "" -#: ../../c-api/unicode.rst:1399 +#: ../../c-api/unicode.rst:1409 msgid "The following codec API is special in that maps Unicode to Unicode." msgstr "" -#: ../../c-api/unicode.rst:1403 +#: ../../c-api/unicode.rst:1413 msgid "" "Translate a string by applying a character mapping table to it and return " "the resulting Unicode object. Return ``NULL`` if an exception was raised by " "the codec." msgstr "" -#: ../../c-api/unicode.rst:1407 +#: ../../c-api/unicode.rst:1417 msgid "" "The mapping table must map Unicode ordinal integers to Unicode ordinal " "integers or ``None`` (causing deletion of the character)." msgstr "" -#: ../../c-api/unicode.rst:1410 +#: ../../c-api/unicode.rst:1420 msgid "" "Mapping tables need only provide the :meth:`~object.__getitem__` interface; " "dictionaries and sequences work well. Unmapped character ordinals (ones " "which cause a :exc:`LookupError`) are left untouched and are copied as-is." msgstr "" -#: ../../c-api/unicode.rst:1414 +#: ../../c-api/unicode.rst:1424 msgid "" "*errors* has the usual meaning for codecs. It may be ``NULL`` which " "indicates to use the default error handling." msgstr "" -#: ../../c-api/unicode.rst:1419 +#: ../../c-api/unicode.rst:1429 msgid "MBCS codecs for Windows" msgstr "Windows 的 MBCS 編解碼器" -#: ../../c-api/unicode.rst:1421 +#: ../../c-api/unicode.rst:1431 msgid "" "These are the MBCS codec APIs. They are currently only available on Windows " "and use the Win32 MBCS converters to implement the conversions. Note that " @@ -1774,13 +1786,13 @@ msgid "" "is defined by the user settings on the machine running the codec." msgstr "" -#: ../../c-api/unicode.rst:1428 +#: ../../c-api/unicode.rst:1438 msgid "" "Create a Unicode object by decoding *size* bytes of the MBCS encoded string " "*str*. Return ``NULL`` if an exception was raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1435 +#: ../../c-api/unicode.rst:1445 msgid "" "If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeMBCS`. If " "*consumed* is not ``NULL``, :c:func:`PyUnicode_DecodeMBCSStateful` will not " @@ -1788,46 +1800,46 @@ msgid "" "will be stored in *consumed*." msgstr "" -#: ../../c-api/unicode.rst:1444 +#: ../../c-api/unicode.rst:1454 msgid "" "Similar to :c:func:`PyUnicode_DecodeMBCSStateful`, except uses the code page " "specified by *code_page*." msgstr "" -#: ../../c-api/unicode.rst:1450 +#: ../../c-api/unicode.rst:1460 msgid "" "Encode a Unicode object using MBCS and return the result as Python bytes " "object. Error handling is \"strict\". Return ``NULL`` if an exception was " "raised by the codec." msgstr "" -#: ../../c-api/unicode.rst:1457 +#: ../../c-api/unicode.rst:1467 msgid "" "Encode the Unicode object using the specified code page and return a Python " "bytes object. Return ``NULL`` if an exception was raised by the codec. Use :" "c:macro:`!CP_ACP` code page to get the MBCS encoder." msgstr "" -#: ../../c-api/unicode.rst:1467 +#: ../../c-api/unicode.rst:1477 msgid "Methods and Slot Functions" msgstr "" -#: ../../c-api/unicode.rst:1469 +#: ../../c-api/unicode.rst:1479 msgid "" "The following APIs are capable of handling Unicode objects and strings on " "input (we refer to them as strings in the descriptions) and return Unicode " "objects or integers as appropriate." msgstr "" -#: ../../c-api/unicode.rst:1473 +#: ../../c-api/unicode.rst:1483 msgid "They all return ``NULL`` or ``-1`` if an exception occurs." msgstr "如果發生例外,則回傳 ``NULL`` 或 ``-1``。" -#: ../../c-api/unicode.rst:1478 +#: ../../c-api/unicode.rst:1488 msgid "Concat two strings giving a new Unicode string." msgstr "" -#: ../../c-api/unicode.rst:1483 +#: ../../c-api/unicode.rst:1493 msgid "" "Split a string giving a list of Unicode strings. If *sep* is ``NULL``, " "splitting will be done at all whitespace substrings. Otherwise, splits " @@ -1836,33 +1848,33 @@ msgid "" "list." msgstr "" -#: ../../c-api/unicode.rst:1488 ../../c-api/unicode.rst:1498 -#: ../../c-api/unicode.rst:1519 ../../c-api/unicode.rst:1532 +#: ../../c-api/unicode.rst:1498 ../../c-api/unicode.rst:1508 +#: ../../c-api/unicode.rst:1529 ../../c-api/unicode.rst:1542 msgid "On error, return ``NULL`` with an exception set." msgstr "於錯誤發生時回傳 ``NULL`` 並設定例外。" -#: ../../c-api/unicode.rst:1490 +#: ../../c-api/unicode.rst:1500 msgid "Equivalent to :py:meth:`str.split`." msgstr "等價於 :py:meth:`str.split`。" -#: ../../c-api/unicode.rst:1495 +#: ../../c-api/unicode.rst:1505 msgid "" "Similar to :c:func:`PyUnicode_Split`, but splitting will be done beginning " "at the end of the string." msgstr "" -#: ../../c-api/unicode.rst:1500 +#: ../../c-api/unicode.rst:1510 msgid "Equivalent to :py:meth:`str.rsplit`." msgstr "等價於 :py:meth:`str.rsplit`。" -#: ../../c-api/unicode.rst:1505 +#: ../../c-api/unicode.rst:1515 msgid "" "Split a Unicode string at line breaks, returning a list of Unicode strings. " "CRLF is considered to be one line break. If *keepends* is ``0``, the Line " "break characters are not included in the resulting strings." msgstr "" -#: ../../c-api/unicode.rst:1512 +#: ../../c-api/unicode.rst:1522 msgid "" "Split a Unicode string at the first occurrence of *sep*, and return a 3-" "tuple containing the part before the separator, the separator itself, and " @@ -1870,39 +1882,39 @@ msgid "" "tuple containing the string itself, followed by two empty strings." msgstr "" -#: ../../c-api/unicode.rst:1517 ../../c-api/unicode.rst:1530 +#: ../../c-api/unicode.rst:1527 ../../c-api/unicode.rst:1540 msgid "*sep* must not be empty." msgstr "*sep* 不得為空。" -#: ../../c-api/unicode.rst:1521 +#: ../../c-api/unicode.rst:1531 msgid "Equivalent to :py:meth:`str.partition`." msgstr "等價於 :py:meth:`str.partition`。" -#: ../../c-api/unicode.rst:1526 +#: ../../c-api/unicode.rst:1536 msgid "" "Similar to :c:func:`PyUnicode_Partition`, but split a Unicode string at the " "last occurrence of *sep*. If the separator is not found, return a 3-tuple " "containing two empty strings, followed by the string itself." msgstr "" -#: ../../c-api/unicode.rst:1534 +#: ../../c-api/unicode.rst:1544 msgid "Equivalent to :py:meth:`str.rpartition`." msgstr "等價於 :py:meth:`str.rpartition`。" -#: ../../c-api/unicode.rst:1539 +#: ../../c-api/unicode.rst:1549 msgid "" "Join a sequence of strings using the given *separator* and return the " "resulting Unicode string." msgstr "" -#: ../../c-api/unicode.rst:1546 +#: ../../c-api/unicode.rst:1556 msgid "" "Return ``1`` if *substr* matches ``unicode[start:end]`` at the given tail " "end (*direction* == ``-1`` means to do a prefix match, *direction* == ``1`` " "a suffix match), ``0`` otherwise. Return ``-1`` if an error occurred." msgstr "" -#: ../../c-api/unicode.rst:1554 +#: ../../c-api/unicode.rst:1564 msgid "" "Return the first position of *substr* in ``unicode[start:end]`` using the " "given *direction* (*direction* == ``1`` means to do a forward search, " @@ -1911,7 +1923,7 @@ msgid "" "``-2`` indicates that an error occurred and an exception has been set." msgstr "" -#: ../../c-api/unicode.rst:1564 +#: ../../c-api/unicode.rst:1574 msgid "" "Return the first position of the character *ch* in ``unicode[start:end]`` " "using the given *direction* (*direction* == ``1`` means to do a forward " @@ -1921,73 +1933,73 @@ msgid "" "set." msgstr "" -#: ../../c-api/unicode.rst:1572 +#: ../../c-api/unicode.rst:1582 msgid "" "*start* and *end* are now adjusted to behave like ``unicode[start:end]``." msgstr "" -#: ../../c-api/unicode.rst:1579 +#: ../../c-api/unicode.rst:1589 msgid "" "Return the number of non-overlapping occurrences of *substr* in " "``unicode[start:end]``. Return ``-1`` if an error occurred." msgstr "" -#: ../../c-api/unicode.rst:1586 +#: ../../c-api/unicode.rst:1596 msgid "" "Replace at most *maxcount* occurrences of *substr* in *unicode* with " "*replstr* and return the resulting Unicode object. *maxcount* == ``-1`` " "means replace all occurrences." msgstr "" -#: ../../c-api/unicode.rst:1593 +#: ../../c-api/unicode.rst:1603 msgid "" "Compare two strings and return ``-1``, ``0``, ``1`` for less than, equal, " "and greater than, respectively." msgstr "" -#: ../../c-api/unicode.rst:1596 +#: ../../c-api/unicode.rst:1606 msgid "" "This function returns ``-1`` upon failure, so one should call :c:func:" "`PyErr_Occurred` to check for errors." msgstr "" -#: ../../c-api/unicode.rst:1601 +#: ../../c-api/unicode.rst:1611 msgid "The :c:func:`PyUnicode_Equal` function." msgstr ":c:func:`PyUnicode_Equal` 函式。" -#: ../../c-api/unicode.rst:1606 +#: ../../c-api/unicode.rst:1616 msgid "Test if two strings are equal:" msgstr "測試兩個字串是否相等:" -#: ../../c-api/unicode.rst:1608 +#: ../../c-api/unicode.rst:1618 msgid "Return ``1`` if *a* is equal to *b*." msgstr "如果 *a* 等於 *b*,則回傳 ``1``。" -#: ../../c-api/unicode.rst:1609 +#: ../../c-api/unicode.rst:1619 msgid "Return ``0`` if *a* is not equal to *b*." msgstr "如果 *a* 不等於 *b*,則回傳 ``0``。" -#: ../../c-api/unicode.rst:1610 +#: ../../c-api/unicode.rst:1620 msgid "" "Set a :exc:`TypeError` exception and return ``-1`` if *a* or *b* is not a :" "class:`str` object." msgstr "" -#: ../../c-api/unicode.rst:1613 +#: ../../c-api/unicode.rst:1623 msgid "The function always succeeds if *a* and *b* are :class:`str` objects." msgstr "" -#: ../../c-api/unicode.rst:1615 +#: ../../c-api/unicode.rst:1625 msgid "" "The function works for :class:`str` subclasses, but does not honor custom " "``__eq__()`` method." msgstr "" -#: ../../c-api/unicode.rst:1620 +#: ../../c-api/unicode.rst:1630 msgid "The :c:func:`PyUnicode_Compare` function." msgstr ":c:func:`PyUnicode_Compare` 函式。" -#: ../../c-api/unicode.rst:1627 +#: ../../c-api/unicode.rst:1637 msgid "" "Compare a Unicode object with a char buffer which is interpreted as being " "UTF-8 or ASCII encoded and return true (``1``) if they are equal, or false " @@ -1996,18 +2008,18 @@ msgid "" "is returned." msgstr "" -#: ../../c-api/unicode.rst:1634 ../../c-api/unicode.rst:1655 +#: ../../c-api/unicode.rst:1644 ../../c-api/unicode.rst:1665 msgid "This function does not raise exceptions." msgstr "此函式不會引發例外。" -#: ../../c-api/unicode.rst:1641 +#: ../../c-api/unicode.rst:1651 msgid "" "Similar to :c:func:`PyUnicode_EqualToUTF8AndSize`, but compute *string* " "length using :c:func:`!strlen`. If the Unicode object contains null " "characters, false (``0``) is returned." msgstr "" -#: ../../c-api/unicode.rst:1650 +#: ../../c-api/unicode.rst:1660 msgid "" "Compare a Unicode object, *unicode*, with *string* and return ``-1``, ``0``, " "``1`` for less than, equal, and greater than, respectively. It is best to " @@ -2015,47 +2027,47 @@ msgid "" "string as ISO-8859-1 if it contains non-ASCII characters." msgstr "" -#: ../../c-api/unicode.rst:1660 +#: ../../c-api/unicode.rst:1670 msgid "Rich compare two Unicode strings and return one of the following:" msgstr "" -#: ../../c-api/unicode.rst:1662 +#: ../../c-api/unicode.rst:1672 msgid "``NULL`` in case an exception was raised" msgstr "" -#: ../../c-api/unicode.rst:1663 +#: ../../c-api/unicode.rst:1673 msgid ":c:data:`Py_True` or :c:data:`Py_False` for successful comparisons" msgstr "" -#: ../../c-api/unicode.rst:1664 +#: ../../c-api/unicode.rst:1674 msgid ":c:data:`Py_NotImplemented` in case the type combination is unknown" msgstr "" -#: ../../c-api/unicode.rst:1666 +#: ../../c-api/unicode.rst:1676 msgid "" "Possible values for *op* are :c:macro:`Py_GT`, :c:macro:`Py_GE`, :c:macro:" "`Py_EQ`, :c:macro:`Py_NE`, :c:macro:`Py_LT`, and :c:macro:`Py_LE`." msgstr "" -#: ../../c-api/unicode.rst:1672 +#: ../../c-api/unicode.rst:1682 msgid "" "Return a new string object from *format* and *args*; this is analogous to " "``format % args``." msgstr "" -#: ../../c-api/unicode.rst:1678 +#: ../../c-api/unicode.rst:1688 msgid "" "Check whether *substr* is contained in *unicode* and return true or false " "accordingly." msgstr "" -#: ../../c-api/unicode.rst:1681 +#: ../../c-api/unicode.rst:1691 msgid "" "*substr* has to coerce to a one element Unicode string. ``-1`` is returned " "if there was an error." msgstr "" -#: ../../c-api/unicode.rst:1687 +#: ../../c-api/unicode.rst:1697 msgid "" "Intern the argument :c:expr:`*p_unicode` in place. The argument must be the " "address of a pointer variable pointing to a Python Unicode string object. " @@ -2066,7 +2078,7 @@ msgid "" "interns it." msgstr "" -#: ../../c-api/unicode.rst:1694 +#: ../../c-api/unicode.rst:1704 msgid "" "(Clarification: even though there is a lot of talk about references, think " "of this function as reference-neutral. You must own the object you pass in; " @@ -2074,39 +2086,39 @@ msgid "" "the result.)" msgstr "" -#: ../../c-api/unicode.rst:1699 +#: ../../c-api/unicode.rst:1709 msgid "" "This function never raises an exception. On error, it leaves its argument " "unchanged without interning it." msgstr "" -#: ../../c-api/unicode.rst:1702 +#: ../../c-api/unicode.rst:1712 msgid "" "Instances of subclasses of :py:class:`str` may not be interned, that is, :c:" "expr:`PyUnicode_CheckExact(*p_unicode)` must be true. If it is not, then -- " "as with any other error -- the argument is left unchanged." msgstr "" -#: ../../c-api/unicode.rst:1706 +#: ../../c-api/unicode.rst:1716 msgid "" "Note that interned strings are not “immortal”. You must keep a reference to " "the result to benefit from interning." msgstr "" -#: ../../c-api/unicode.rst:1712 +#: ../../c-api/unicode.rst:1722 msgid "" "A combination of :c:func:`PyUnicode_FromString` and :c:func:" "`PyUnicode_InternInPlace`, meant for statically allocated strings." msgstr "" -#: ../../c-api/unicode.rst:1715 +#: ../../c-api/unicode.rst:1725 msgid "" "Return a new (\"owned\") reference to either a new Unicode string object " "that has been interned, or an earlier interned string object with the same " "value." msgstr "" -#: ../../c-api/unicode.rst:1719 +#: ../../c-api/unicode.rst:1729 msgid "" "Python may keep a reference to the result, or make it :term:`immortal`, " "preventing it from being garbage-collected promptly. For interning an " @@ -2115,14 +2127,14 @@ msgid "" "`PyUnicode_InternInPlace` directly." msgstr "" -#: ../../c-api/unicode.rst:1728 +#: ../../c-api/unicode.rst:1738 msgid "" "Return a non-zero value if *str* is interned, zero if not. The *str* " "argument must be a string; this is not checked. This function always " "succeeds." msgstr "" -#: ../../c-api/unicode.rst:1734 +#: ../../c-api/unicode.rst:1744 msgid "" "A non-zero return value may carry additional information about *how* the " "string is interned. The meaning of such non-zero values, as well as each " @@ -2130,212 +2142,212 @@ msgid "" "versions." msgstr "" -#: ../../c-api/unicode.rst:1741 +#: ../../c-api/unicode.rst:1751 msgid "PyUnicodeWriter" msgstr "PyUnicodeWriter" -#: ../../c-api/unicode.rst:1743 +#: ../../c-api/unicode.rst:1753 msgid "" "The :c:type:`PyUnicodeWriter` API can be used to create a Python :class:" "`str` object." msgstr "" -#: ../../c-api/unicode.rst:1750 +#: ../../c-api/unicode.rst:1760 msgid "A Unicode writer instance." msgstr "一個 Unicode 寫入器實例。" -#: ../../c-api/unicode.rst:1752 +#: ../../c-api/unicode.rst:1762 msgid "" "The instance must be destroyed by :c:func:`PyUnicodeWriter_Finish` on " "success, or :c:func:`PyUnicodeWriter_Discard` on error." msgstr "" -#: ../../c-api/unicode.rst:1757 +#: ../../c-api/unicode.rst:1767 msgid "Create a Unicode writer instance." msgstr "" -#: ../../c-api/unicode.rst:1759 +#: ../../c-api/unicode.rst:1769 msgid "*length* must be greater than or equal to ``0``." msgstr "" -#: ../../c-api/unicode.rst:1761 +#: ../../c-api/unicode.rst:1771 msgid "" "If *length* is greater than ``0``, preallocate an internal buffer of " "*length* characters." msgstr "" -#: ../../c-api/unicode.rst:1764 ../../c-api/unicode.rst:1770 +#: ../../c-api/unicode.rst:1774 ../../c-api/unicode.rst:1780 msgid "Set an exception and return ``NULL`` on error." msgstr "發生錯誤時,設定例外並回傳 ``NULL``。" -#: ../../c-api/unicode.rst:1768 +#: ../../c-api/unicode.rst:1778 msgid "" "Return the final Python :class:`str` object and destroy the writer instance." msgstr "" -#: ../../c-api/unicode.rst:1772 ../../c-api/unicode.rst:1780 +#: ../../c-api/unicode.rst:1782 ../../c-api/unicode.rst:1790 msgid "The writer instance is invalid after this call." msgstr "" -#: ../../c-api/unicode.rst:1776 +#: ../../c-api/unicode.rst:1786 msgid "Discard the internal Unicode buffer and destroy the writer instance." msgstr "" -#: ../../c-api/unicode.rst:1778 +#: ../../c-api/unicode.rst:1788 msgid "If *writer* is ``NULL``, no operation is performed." msgstr "" -#: ../../c-api/unicode.rst:1784 +#: ../../c-api/unicode.rst:1794 msgid "Write the single Unicode character *ch* into *writer*." msgstr "" -#: ../../c-api/unicode.rst:1786 ../../c-api/unicode.rst:1796 -#: ../../c-api/unicode.rst:1811 ../../c-api/unicode.rst:1823 -#: ../../c-api/unicode.rst:1832 ../../c-api/unicode.rst:1839 -#: ../../c-api/unicode.rst:1846 ../../c-api/unicode.rst:1857 -#: ../../c-api/unicode.rst:1864 ../../c-api/unicode.rst:1883 +#: ../../c-api/unicode.rst:1796 ../../c-api/unicode.rst:1806 +#: ../../c-api/unicode.rst:1821 ../../c-api/unicode.rst:1833 +#: ../../c-api/unicode.rst:1842 ../../c-api/unicode.rst:1849 +#: ../../c-api/unicode.rst:1856 ../../c-api/unicode.rst:1867 +#: ../../c-api/unicode.rst:1874 ../../c-api/unicode.rst:1893 msgid "" "On success, return ``0``. On error, set an exception, leave the writer " "unchanged, and return ``-1``." msgstr "成功時回傳 ``0``,發生錯誤時設定例外、保持寫入器不變,並回傳 ``-1``。" -#: ../../c-api/unicode.rst:1791 +#: ../../c-api/unicode.rst:1801 msgid "" "Decode the string *str* from UTF-8 in strict mode and write the output into " "*writer*." msgstr "" -#: ../../c-api/unicode.rst:1793 ../../c-api/unicode.rst:1805 -#: ../../c-api/unicode.rst:1872 +#: ../../c-api/unicode.rst:1803 ../../c-api/unicode.rst:1815 +#: ../../c-api/unicode.rst:1882 msgid "" "*size* is the string length in bytes. If *size* is equal to ``-1``, call " "``strlen(str)`` to get the string length." msgstr "" -#: ../../c-api/unicode.rst:1799 +#: ../../c-api/unicode.rst:1809 msgid "See also :c:func:`PyUnicodeWriter_DecodeUTF8Stateful`." msgstr "另請參閱 :c:func:`PyUnicodeWriter_DecodeUTF8Stateful`。" -#: ../../c-api/unicode.rst:1803 +#: ../../c-api/unicode.rst:1813 msgid "Write the ASCII string *str* into *writer*." msgstr "" -#: ../../c-api/unicode.rst:1808 +#: ../../c-api/unicode.rst:1818 msgid "" "*str* must only contain ASCII characters. The behavior is undefined if *str* " "contains non-ASCII characters." msgstr "" -#: ../../c-api/unicode.rst:1818 +#: ../../c-api/unicode.rst:1828 msgid "Write the wide string *str* into *writer*." msgstr "" -#: ../../c-api/unicode.rst:1820 +#: ../../c-api/unicode.rst:1830 msgid "" "*size* is a number of wide characters. If *size* is equal to ``-1``, call " "``wcslen(str)`` to get the string length." msgstr "" -#: ../../c-api/unicode.rst:1828 +#: ../../c-api/unicode.rst:1838 msgid "Writer the UCS4 string *str* into *writer*." msgstr "" -#: ../../c-api/unicode.rst:1830 +#: ../../c-api/unicode.rst:1840 msgid "*size* is a number of UCS4 characters." msgstr "" -#: ../../c-api/unicode.rst:1837 +#: ../../c-api/unicode.rst:1847 msgid "" "Call :c:func:`PyObject_Str` on *obj* and write the output into *writer*." msgstr "" -#: ../../c-api/unicode.rst:1844 +#: ../../c-api/unicode.rst:1854 msgid "" "Call :c:func:`PyObject_Repr` on *obj* and write the output into *writer*." msgstr "" -#: ../../c-api/unicode.rst:1851 +#: ../../c-api/unicode.rst:1861 msgid "Write the substring ``str[start:end]`` into *writer*." msgstr "" -#: ../../c-api/unicode.rst:1853 +#: ../../c-api/unicode.rst:1863 msgid "" "*str* must be Python :class:`str` object. *start* must be greater than or " "equal to 0, and less than or equal to *end*. *end* must be less than or " "equal to *str* length." msgstr "" -#: ../../c-api/unicode.rst:1862 +#: ../../c-api/unicode.rst:1872 msgid "" "Similar to :c:func:`PyUnicode_FromFormat`, but write the output directly " "into *writer*." msgstr "類似於 :c:func:`PyUnicode_FromFormat`,但是直接將輸出寫入 *writer*。" -#: ../../c-api/unicode.rst:1869 +#: ../../c-api/unicode.rst:1879 msgid "" "Decode the string *str* from UTF-8 with *errors* error handler and write the " "output into *writer*." msgstr "" -#: ../../c-api/unicode.rst:1875 +#: ../../c-api/unicode.rst:1885 msgid "" "*errors* is an :ref:`error handler ` name, such as " "``\"replace\"``. If *errors* is ``NULL``, use the strict error handler." msgstr "" -#: ../../c-api/unicode.rst:1878 +#: ../../c-api/unicode.rst:1888 msgid "" "If *consumed* is not ``NULL``, set *\\*consumed* to the number of decoded " "bytes on success. If *consumed* is ``NULL``, treat trailing incomplete UTF-8 " "byte sequences as an error." msgstr "" -#: ../../c-api/unicode.rst:1886 +#: ../../c-api/unicode.rst:1896 msgid "See also :c:func:`PyUnicodeWriter_WriteUTF8`." msgstr "另請參閱 :c:func:`PyUnicodeWriter_WriteUTF8`。" -#: ../../c-api/unicode.rst:1889 +#: ../../c-api/unicode.rst:1899 msgid "Deprecated API" msgstr "已棄用的 API" -#: ../../c-api/unicode.rst:1891 +#: ../../c-api/unicode.rst:1901 msgid "The following API is deprecated." msgstr "以下 API 已棄用。" -#: ../../c-api/unicode.rst:1895 +#: ../../c-api/unicode.rst:1905 msgid "" "This is a typedef of :c:type:`wchar_t`, which is a 16-bit type or 32-bit " "type depending on the platform. Please use :c:type:`wchar_t` directly " "instead." msgstr "" -#: ../../c-api/unicode.rst:1899 +#: ../../c-api/unicode.rst:1909 msgid "" "In previous versions, this was a 16-bit type or a 32-bit type depending on " "whether you selected a \"narrow\" or \"wide\" Unicode version of Python at " "build time." msgstr "" -#: ../../c-api/unicode.rst:1909 +#: ../../c-api/unicode.rst:1919 msgid "" "Do nothing and return ``0``. This API is kept only for backward " "compatibility, but there are no plans to remove it." msgstr "" -#: ../../c-api/unicode.rst:1915 +#: ../../c-api/unicode.rst:1925 msgid "" "This API does nothing since Python 3.12. Previously, this needed to be " "called for each string created using the old API (:c:func:`!" "PyUnicode_FromUnicode` or similar)." msgstr "" -#: ../../c-api/unicode.rst:1923 +#: ../../c-api/unicode.rst:1933 msgid "" "Do nothing and return ``1``. This API is kept only for backward " "compatibility, but there are no plans to remove it." msgstr "" -#: ../../c-api/unicode.rst:1929 +#: ../../c-api/unicode.rst:1939 msgid "" "This API does nothing since Python 3.12. Previously, this could be called to " "check if :c:func:`PyUnicode_READY` is necessary." diff --git a/c-api/veryhigh.po b/c-api/veryhigh.po index 3149d8034c..60d246703c 100644 --- a/c-api/veryhigh.po +++ b/c-api/veryhigh.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-10-08 00:15+0000\n" +"POT-Creation-Date: 2025-11-05 00:16+0000\n" "PO-Revision-Date: 2018-05-23 14:08+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -170,8 +170,8 @@ msgid "" "The function will be called when Python's interpreter prompt is about to " "become idle and wait for user input from the terminal. The return value is " "ignored. Overriding this hook can be used to integrate the interpreter's " -"prompt with other event loops, as done in the :file:`Modules/_tkinter.c` in " -"the Python source code." +"prompt with other event loops, as done in :file:`Modules/_tkinter.c` in the " +"Python source code." msgstr "" #: ../../c-api/veryhigh.rst:146 ../../c-api/veryhigh.rst:170 diff --git a/howto/free-threading-extensions.po b/howto/free-threading-extensions.po index dcbc3e8940..fbb9971737 100644 --- a/howto/free-threading-extensions.po +++ b/howto/free-threading-extensions.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-11-07 00:14+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-" @@ -22,9 +22,9 @@ msgstr "支援自由執行緒的 C API 擴充" #: ../../howto/free-threading-extensions.rst:9 msgid "" -"Starting with the 3.13 release, CPython has support for running with " -"the :term:`global interpreter lock` (GIL) disabled in a configuration " -"called :term:`free threading`. This document describes how to adapt C API " +"Starting with the 3.13 release, CPython has support for running with the :" +"term:`global interpreter lock` (GIL) disabled in a configuration called :" +"term:`free threading`. This document describes how to adapt C API " "extensions to support free threading." msgstr "" @@ -79,10 +79,10 @@ msgstr "" #: ../../howto/free-threading-extensions.rst:48 msgid "" -"Extensions that use multi-phase initialization " -"(i.e., :c:func:`PyModuleDef_Init`) should add a :c:data:`Py_mod_gil` slot in " -"the module definition. If your extension supports older versions of " -"CPython, you should guard the slot with a :c:data:`PY_VERSION_HEX` check." +"Extensions that use multi-phase initialization (i.e., :c:func:" +"`PyModuleDef_Init`) should add a :c:data:`Py_mod_gil` slot in the module " +"definition. If your extension supports older versions of CPython, you " +"should guard the slot with a :c:data:`PY_VERSION_HEX` check." msgstr "" #: ../../howto/free-threading-extensions.rst:55 @@ -121,12 +121,11 @@ msgstr "單一階段初始化 (Single-Phase Initialization)" #: ../../howto/free-threading-extensions.rst:73 msgid "" -"Extensions that use single-phase initialization " -"(i.e., :c:func:`PyModule_Create`) should " -"call :c:func:`PyUnstable_Module_SetGIL` to indicate that they support " -"running with the GIL disabled. The function is only defined in the free-" -"threaded build, so you should guard the call with ``#ifdef Py_GIL_DISABLED`` " -"to avoid compilation errors in the regular build." +"Extensions that use single-phase initialization (i.e., :c:func:" +"`PyModule_Create`) should call :c:func:`PyUnstable_Module_SetGIL` to " +"indicate that they support running with the GIL disabled. The function is " +"only defined in the free-threaded build, so you should guard the call with " +"``#ifdef Py_GIL_DISABLED`` to avoid compilation errors in the regular build." msgstr "" #: ../../howto/free-threading-extensions.rst:81 @@ -183,12 +182,11 @@ msgstr "" #: ../../howto/free-threading-extensions.rst:107 msgid "" -"**Macros**: Accessor macros " -"like :c:macro:`PyList_GET_ITEM`, :c:macro:`PyList_SET_ITEM`, and macros " -"like :c:macro:`PySequence_Fast_GET_SIZE` that use the object returned " -"by :c:func:`PySequence_Fast` do not perform any error checking or locking. " -"These macros are not thread-safe if the container object may be modified " -"concurrently." +"**Macros**: Accessor macros like :c:macro:`PyList_GET_ITEM`, :c:macro:" +"`PyList_SET_ITEM`, and macros like :c:macro:`PySequence_Fast_GET_SIZE` that " +"use the object returned by :c:func:`PySequence_Fast` do not perform any " +"error checking or locking. These macros are not thread-safe if the container " +"object may be modified concurrently." msgstr "" #: ../../howto/free-threading-extensions.rst:113 @@ -205,10 +203,10 @@ msgstr "容器執行緒安全性" #: ../../howto/free-threading-extensions.rst:122 msgid "" -"Containers like :c:struct:`PyListObject`, :c:struct:`PyDictObject`, " -"and :c:struct:`PySetObject` perform internal locking in the free-threaded " -"build. For example, the :c:func:`PyList_Append` will lock the list before " -"appending an item." +"Containers like :c:struct:`PyListObject`, :c:struct:`PyDictObject`, and :c:" +"struct:`PySetObject` perform internal locking in the free-threaded build. " +"For example, the :c:func:`PyList_Append` will lock the list before appending " +"an item." msgstr "" #: ../../howto/free-threading-extensions.rst:130 @@ -249,8 +247,8 @@ msgstr "借用參照" msgid "" "Some C API functions return :term:`borrowed references `. These APIs are not thread-safe if the containing object is " -"modified concurrently. For example, it's not safe to " -"use :c:func:`PyList_GetItem` if the list may be modified concurrently." +"modified concurrently. For example, it's not safe to use :c:func:" +"`PyList_GetItem` if the list may be modified concurrently." msgstr "" #: ../../howto/free-threading-extensions.rst:156 @@ -348,13 +346,13 @@ msgstr ":c:func:`PyCell_Get`" #: ../../howto/free-threading-extensions.rst:185 msgid "" -"Not all APIs that return borrowed references are problematic. For " -"example, :c:func:`PyTuple_GetItem` is safe because tuples are immutable. " -"Similarly, not all uses of the above APIs are problematic. For " -"example, :c:func:`PyDict_GetItem` is often used for parsing keyword argument " -"dictionaries in function calls; those keyword argument dictionaries are " -"effectively private (not accessible by other threads), so using borrowed " -"references in that context is safe." +"Not all APIs that return borrowed references are problematic. For example, :" +"c:func:`PyTuple_GetItem` is safe because tuples are immutable. Similarly, " +"not all uses of the above APIs are problematic. For example, :c:func:" +"`PyDict_GetItem` is often used for parsing keyword argument dictionaries in " +"function calls; those keyword argument dictionaries are effectively private " +"(not accessible by other threads), so using borrowed references in that " +"context is safe." msgstr "" #: ../../howto/free-threading-extensions.rst:193 @@ -370,21 +368,19 @@ msgstr "" #: ../../howto/free-threading-extensions.rst:203 msgid "" -"Python's memory management C API provides functions in three " -"different :ref:`allocation domains `: \"raw\", \"mem\", " -"and \"object\". For thread-safety, the free-threaded build requires that " -"only Python objects are allocated using the object domain, and that all " -"Python object are allocated using that domain. This differs from the prior " -"Python versions, where this was only a best practice and not a hard " -"requirement." +"Python's memory management C API provides functions in three different :ref:" +"`allocation domains `: \"raw\", \"mem\", and \"object\". " +"For thread-safety, the free-threaded build requires that only Python objects " +"are allocated using the object domain, and that all Python objects are " +"allocated using that domain. This differs from the prior Python versions, " +"where this was only a best practice and not a hard requirement." msgstr "" #: ../../howto/free-threading-extensions.rst:212 msgid "" "Search for uses of :c:func:`PyObject_Malloc` in your extension and check " -"that the allocated memory is used for Python objects. " -"Use :c:func:`PyMem_Malloc` to allocate buffers instead " -"of :c:func:`PyObject_Malloc`." +"that the allocated memory is used for Python objects. Use :c:func:" +"`PyMem_Malloc` to allocate buffers instead of :c:func:`PyObject_Malloc`." msgstr "" #: ../../howto/free-threading-extensions.rst:219 @@ -420,10 +416,10 @@ msgstr "" #: ../../howto/free-threading-extensions.rst:234 msgid "" -"You should continue to call :c:func:`PyEval_SaveThread` " -"or :c:macro:`Py_BEGIN_ALLOW_THREADS` around blocking operations, such as I/O " -"or lock acquisitions, to allow other threads to run the :term:`cyclic " -"garbage collector `." +"You should continue to call :c:func:`PyEval_SaveThread` or :c:macro:" +"`Py_BEGIN_ALLOW_THREADS` around blocking operations, such as I/O or lock " +"acquisitions, to allow other threads to run the :term:`cyclic garbage " +"collector `." msgstr "" #: ../../howto/free-threading-extensions.rst:241 @@ -474,9 +470,9 @@ msgid "" "Conceptually, critical sections act as a deadlock avoidance layer built on " "top of simple mutexes. Each thread maintains a stack of active critical " "sections. When a thread needs to acquire a lock associated with a critical " -"section (e.g., implicitly when calling a thread-safe C API function " -"like :c:func:`PyDict_SetItem`, or explicitly using macros), it attempts to " -"acquire the underlying mutex." +"section (e.g., implicitly when calling a thread-safe C API function like :c:" +"func:`PyDict_SetItem`, or explicitly using macros), it attempts to acquire " +"the underlying mutex." msgstr "" #: ../../howto/free-threading-extensions.rst:278 @@ -495,9 +491,8 @@ msgstr "" #: ../../howto/free-threading-extensions.rst:285 msgid "" -":c:macro:`Py_BEGIN_CRITICAL_SECTION2` " -"and :c:macro:`Py_END_CRITICAL_SECTION2` - For locking two objects " -"simultaneously" +":c:macro:`Py_BEGIN_CRITICAL_SECTION2` and :c:macro:" +"`Py_END_CRITICAL_SECTION2` - For locking two objects simultaneously" msgstr "" #: ../../howto/free-threading-extensions.rst:288 @@ -598,12 +593,12 @@ msgstr "" #: ../../howto/free-threading-extensions.rst:347 msgid "" -"Note that the locks described above are only :c:type:`!PyMutex` based locks. " +"Note that the locks described above are only :c:type:`PyMutex` based locks. " "The critical section implementation does not know about or affect other " "locking mechanisms that might be in use, like POSIX mutexes. Also note that " -"while blocking on any :c:type:`!PyMutex` causes the critical sections to be " +"while blocking on any :c:type:`PyMutex` causes the critical sections to be " "suspended, only the mutexes that are part of the critical sections are " -"released. If :c:type:`!PyMutex` is used without a critical section, it will " +"released. If :c:type:`PyMutex` is used without a critical section, it will " "not be released and therefore does not get the same deadlock avoidance." msgstr "" @@ -683,15 +678,17 @@ msgstr "" #: ../../howto/free-threading-extensions.rst:399 msgid "" "`pypa/cibuildwheel `_ supports the " -"free-threaded build if you set `CIBW_ENABLE to cpython-freethreading " -"`_." +"free-threaded build on Python 3.13 and 3.14. On Python 3.14, free-threaded " +"wheels will be built by default. On Python 3.13, you will need to set " +"`CIBW_ENABLE to cpython-freethreading `_." msgstr "" -#: ../../howto/free-threading-extensions.rst:404 +#: ../../howto/free-threading-extensions.rst:405 msgid "Limited C API and Stable ABI" msgstr "" -#: ../../howto/free-threading-extensions.rst:406 +#: ../../howto/free-threading-extensions.rst:407 msgid "" "The free-threaded build does not currently support the :ref:`Limited C API " "` or the stable ABI. If you use `setuptools `_: A community-maintained porting guide for " diff --git a/howto/free-threading-python.po b/howto/free-threading-python.po index ac3bcc5d1f..3218edc5d9 100644 --- a/howto/free-threading-python.po +++ b/howto/free-threading-python.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-11-07 00:14+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-" @@ -85,9 +85,9 @@ msgstr "" #: ../../howto/free-threading-python.rst:48 msgid "" "To check if the current interpreter supports free-threading, :option:`python " -"-VV <-V>` and :data:`sys.version` contain \"free-threading build\". The " -"new :func:`sys._is_gil_enabled` function can be used to check whether the " -"GIL is actually disabled in the running process." +"-VV <-V>` and :data:`sys.version` contain \"free-threading build\". The new :" +"func:`sys._is_gil_enabled` function can be used to check whether the GIL is " +"actually disabled in the running process." msgstr "" #: ../../howto/free-threading-python.rst:53 @@ -168,10 +168,10 @@ msgstr "不滅化 (Immortalization)" #: ../../howto/free-threading-python.rst:104 msgid "" -"The free-threaded build of the 3.13 release makes some " -"objects :term:`immortal`. Immortal objects are not deallocated and have " -"reference counts that are never modified. This is done to avoid reference " -"count contention that would prevent efficient multi-threaded scaling." +"The free-threaded build of the 3.13 release makes some objects :term:" +"`immortal`. Immortal objects are not deallocated and have reference counts " +"that are never modified. This is done to avoid reference count contention " +"that would prevent efficient multi-threaded scaling." msgstr "" #: ../../howto/free-threading-python.rst:109 @@ -205,96 +205,101 @@ msgstr ":ref:`類別 `\\ (型別物件)" #: ../../howto/free-threading-python.rst:118 msgid "" "Because immortal objects are never deallocated, applications that create " -"many objects of these types may see increased memory usage. This is " -"expected to be addressed in the 3.14 release." +"many objects of these types may see increased memory usage under Python " +"3.13. This has been addressed in the 3.14 release, where the aforementioned " +"objects use deferred reference counting to avoid reference count contention." msgstr "" -#: ../../howto/free-threading-python.rst:122 +#: ../../howto/free-threading-python.rst:123 msgid "" "Additionally, numeric and string literals in the code as well as strings " -"returned by :func:`sys.intern` are also immortalized. This behavior is " -"expected to remain in the 3.14 free-threaded build." +"returned by :func:`sys.intern` are also immortalized in the 3.13 release. " +"This behavior is part of the 3.14 release as well and it is expected to " +"remain in future free-threaded builds." msgstr "" -#: ../../howto/free-threading-python.rst:128 +#: ../../howto/free-threading-python.rst:130 msgid "Frame objects" msgstr "" -#: ../../howto/free-threading-python.rst:130 +#: ../../howto/free-threading-python.rst:132 msgid "" "It is not safe to access :ref:`frame ` objects from other " -"threads and doing so may cause your program to crash . This means " -"that :func:`sys._current_frames` is generally not safe to use in a free-" -"threaded build. Functions like :func:`inspect.currentframe` " -"and :func:`sys._getframe` are generally safe as long as the resulting frame " -"object is not passed to another thread." +"threads and doing so may cause your program to crash . This means that :" +"func:`sys._current_frames` is generally not safe to use in a free-threaded " +"build. Functions like :func:`inspect.currentframe` and :func:`sys." +"_getframe` are generally safe as long as the resulting frame object is not " +"passed to another thread." msgstr "" -#: ../../howto/free-threading-python.rst:138 +#: ../../howto/free-threading-python.rst:140 msgid "Iterators" msgstr "疊代器" -#: ../../howto/free-threading-python.rst:140 +#: ../../howto/free-threading-python.rst:142 msgid "" "Sharing the same iterator object between multiple threads is generally not " "safe and threads may see duplicate or missing elements when iterating or " "crash the interpreter." msgstr "" -#: ../../howto/free-threading-python.rst:146 +#: ../../howto/free-threading-python.rst:148 msgid "Single-threaded performance" msgstr "單執行緒效能" -#: ../../howto/free-threading-python.rst:148 +#: ../../howto/free-threading-python.rst:150 msgid "" "The free-threaded build has additional overhead when executing Python code " "compared to the default GIL-enabled build. In 3.13, this overhead is about " "40% on the `pyperformance `_ suite. " "Programs that spend most of their time in C extensions or I/O will see less " "of an impact. The largest impact is because the specializing adaptive " -"interpreter (:pep:`659`) is disabled in the free-threaded build. We expect " -"to re-enable it in a thread-safe way in the 3.14 release. This overhead is " -"expected to be reduced in upcoming Python release. We are aiming for an " -"overhead of 10% or less on the pyperformance suite compared to the default " -"GIL-enabled build." +"interpreter (:pep:`659`) is disabled in the free-threaded build." +msgstr "" + +#: ../../howto/free-threading-python.rst:157 +msgid "" +"The specializing adaptive interpreter has been re-enabled in a thread-safe " +"way in the 3.14 release. The performance penalty on single-threaded code in " +"free-threaded mode is now roughly 5-10%, depending on the platform and C " +"compiler used." msgstr "" -#: ../../howto/free-threading-python.rst:161 +#: ../../howto/free-threading-python.rst:164 msgid "Behavioral changes" msgstr "" -#: ../../howto/free-threading-python.rst:163 +#: ../../howto/free-threading-python.rst:166 msgid "" "This section describes CPython behavioural changes with the free-threaded " "build." msgstr "" -#: ../../howto/free-threading-python.rst:168 +#: ../../howto/free-threading-python.rst:171 msgid "Context variables" msgstr "" -#: ../../howto/free-threading-python.rst:170 +#: ../../howto/free-threading-python.rst:173 msgid "" -"In the free-threaded build, the " -"flag :data:`~sys.flags.thread_inherit_context` is set to true by default " -"which causes threads created with :class:`threading.Thread` to start with a " -"copy of the :class:`~contextvars.Context()` of the caller " -"of :meth:`~threading.Thread.start`. In the default GIL-enabled build, the " -"flag defaults to false so threads start with an " -"empty :class:`~contextvars.Context()`." +"In the free-threaded build, the flag :data:`~sys.flags." +"thread_inherit_context` is set to true by default which causes threads " +"created with :class:`threading.Thread` to start with a copy of the :class:" +"`~contextvars.Context()` of the caller of :meth:`~threading.Thread.start`. " +"In the default GIL-enabled build, the flag defaults to false so threads " +"start with an empty :class:`~contextvars.Context()`." msgstr "" -#: ../../howto/free-threading-python.rst:180 +#: ../../howto/free-threading-python.rst:183 msgid "Warning filters" msgstr "" -#: ../../howto/free-threading-python.rst:182 +#: ../../howto/free-threading-python.rst:185 msgid "" -"In the free-threaded build, the " -"flag :data:`~sys.flags.context_aware_warnings` is set to true by default. " -"In the default GIL-enabled build, the flag defaults to false. If the flag " -"is true then the :class:`warnings.catch_warnings` context manager uses a " -"context variable for warning filters. If the flag is false " -"then :class:`~warnings.catch_warnings` modifies the global filters list, " -"which is not thread-safe. See the :mod:`warnings` module for more details." +"In the free-threaded build, the flag :data:`~sys.flags." +"context_aware_warnings` is set to true by default. In the default GIL-" +"enabled build, the flag defaults to false. If the flag is true then the :" +"class:`warnings.catch_warnings` context manager uses a context variable for " +"warning filters. If the flag is false then :class:`~warnings." +"catch_warnings` modifies the global filters list, which is not thread-safe. " +"See the :mod:`warnings` module for more details." msgstr "" diff --git a/howto/logging-cookbook.po b/howto/logging-cookbook.po index 15d2b2fcd6..a29aa388d3 100644 --- a/howto/logging-cookbook.po +++ b/howto/logging-cookbook.po @@ -496,6 +496,13 @@ msgid "" "\n" " return filter" msgstr "" +"def filter_maker(level):\n" +" level = getattr(logging, level)\n" +"\n" +" def filter(record):\n" +" return record.levelno <= level\n" +"\n" +" return filter" #: ../../howto/logging-cookbook.rst:379 msgid "" diff --git a/library/annotationlib.po b/library/annotationlib.po index 93d55b02d9..1ec686c8a7 100644 --- a/library/annotationlib.po +++ b/library/annotationlib.po @@ -151,10 +151,16 @@ msgid "" "\n" "print(func.__annotations__)" msgstr "" +"def func(a: Cls) -> None:\n" +" print(a)\n" +"\n" +"class Cls: pass\n" +"\n" +"print(func.__annotations__)" #: ../../library/annotationlib.rst:92 msgid "This will behave as follows:" -msgstr "" +msgstr "這會有以下行為:" #: ../../library/annotationlib.rst:94 msgid "" diff --git a/library/argparse.po b/library/argparse.po index 075bef6951..cfd49a9868 100644 --- a/library/argparse.po +++ b/library/argparse.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-18 00:15+0000\n" +"POT-Creation-Date: 2025-11-06 00:14+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-" @@ -233,7 +233,7 @@ msgstr "新增 *exit_on_error* 參數。" msgid "*suggest_on_error* and *color* parameters were added." msgstr "新增 *suggest_on_error* 和 *color* 參數。" -#: ../../library/argparse.rst:137 ../../library/argparse.rst:684 +#: ../../library/argparse.rst:137 ../../library/argparse.rst:689 msgid "The following sections describe how each of these are used." msgstr "" @@ -1127,81 +1127,89 @@ msgstr "" "... help='an integer for the accumulator')\n" ">>> parser.parse_args(['--help'])" -#: ../../library/argparse.rst:646 +#: ../../library/argparse.rst:642 +msgid "" +"Note that when ``color=True``, colored output depends on both environment " +"variables and terminal capabilities. However, if ``color=False``, colored " +"output is always disabled, even if environment variables like " +"``FORCE_COLOR`` are set." +msgstr "" + +#: ../../library/argparse.rst:651 msgid "The add_argument() method" msgstr "add_argument() 方法" -#: ../../library/argparse.rst:652 +#: ../../library/argparse.rst:657 msgid "" "Define how a single command-line argument should be parsed. Each parameter " "has its own more detailed description below, but in short they are:" msgstr "" -#: ../../library/argparse.rst:655 +#: ../../library/argparse.rst:660 msgid "" "`name or flags`_ - Either a name or a list of option strings, e.g. ``'foo'`` " "or ``'-f', '--foo'``." msgstr "" -#: ../../library/argparse.rst:658 +#: ../../library/argparse.rst:663 msgid "" "action_ - The basic type of action to be taken when this argument is " "encountered at the command line." msgstr "" -#: ../../library/argparse.rst:661 +#: ../../library/argparse.rst:666 msgid "nargs_ - The number of command-line arguments that should be consumed." msgstr "" -#: ../../library/argparse.rst:663 +#: ../../library/argparse.rst:668 msgid "" "const_ - A constant value required by some action_ and nargs_ selections." msgstr "" -#: ../../library/argparse.rst:665 +#: ../../library/argparse.rst:670 msgid "" "default_ - The value produced if the argument is absent from the command " "line and if it is absent from the namespace object." msgstr "" -#: ../../library/argparse.rst:668 +#: ../../library/argparse.rst:673 msgid "" "type_ - The type to which the command-line argument should be converted." msgstr "" -#: ../../library/argparse.rst:670 +#: ../../library/argparse.rst:675 msgid "choices_ - A sequence of the allowable values for the argument." msgstr "" -#: ../../library/argparse.rst:672 +#: ../../library/argparse.rst:677 msgid "" "required_ - Whether or not the command-line option may be omitted (optionals " "only)." msgstr "" -#: ../../library/argparse.rst:675 +#: ../../library/argparse.rst:680 msgid "help_ - A brief description of what the argument does." msgstr "" -#: ../../library/argparse.rst:677 +#: ../../library/argparse.rst:682 msgid "metavar_ - A name for the argument in usage messages." msgstr "" -#: ../../library/argparse.rst:679 +#: ../../library/argparse.rst:684 msgid "" "dest_ - The name of the attribute to be added to the object returned by :" "meth:`parse_args`." msgstr "" -#: ../../library/argparse.rst:682 +#: ../../library/argparse.rst:687 msgid "deprecated_ - Whether or not use of the argument is deprecated." msgstr "" -#: ../../library/argparse.rst:690 +#: ../../library/argparse.rst:695 msgid "name or flags" msgstr "name or flags" -#: ../../library/argparse.rst:692 +#: ../../library/argparse.rst:697 msgid "" "The :meth:`~ArgumentParser.add_argument` method must know whether an " "optional argument, like ``-f`` or ``--foo``, or a positional argument, like " @@ -1210,30 +1218,30 @@ msgid "" "or a simple argument name." msgstr "" -#: ../../library/argparse.rst:698 +#: ../../library/argparse.rst:703 msgid "For example, an optional argument could be created like::" msgstr "" -#: ../../library/argparse.rst:700 +#: ../../library/argparse.rst:705 msgid ">>> parser.add_argument('-f', '--foo')" msgstr ">>> parser.add_argument('-f', '--foo')" -#: ../../library/argparse.rst:702 +#: ../../library/argparse.rst:707 msgid "while a positional argument could be created like::" msgstr "" -#: ../../library/argparse.rst:704 +#: ../../library/argparse.rst:709 msgid ">>> parser.add_argument('bar')" msgstr ">>> parser.add_argument('bar')" -#: ../../library/argparse.rst:706 +#: ../../library/argparse.rst:711 msgid "" "When :meth:`~ArgumentParser.parse_args` is called, optional arguments will " "be identified by the ``-`` prefix, and the remaining arguments will be " "assumed to be positional::" msgstr "" -#: ../../library/argparse.rst:710 +#: ../../library/argparse.rst:715 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-f', '--foo')\n" @@ -1257,7 +1265,7 @@ msgstr "" "usage: PROG [-h] [-f FOO] bar\n" "PROG: error: the following arguments are required: bar" -#: ../../library/argparse.rst:721 +#: ../../library/argparse.rst:726 msgid "" "By default, :mod:`!argparse` automatically handles the internal naming and " "display names of arguments, simplifying the process without requiring " @@ -1267,7 +1275,7 @@ msgid "" "to the upper-cased name. For example::" msgstr "" -#: ../../library/argparse.rst:729 +#: ../../library/argparse.rst:734 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('--foo-bar')\n" @@ -1291,11 +1299,11 @@ msgstr "" " -h, --help show this help message and exit\n" " --foo-bar FOO-BAR" -#: ../../library/argparse.rst:744 +#: ../../library/argparse.rst:749 msgid "action" msgstr "action" -#: ../../library/argparse.rst:746 +#: ../../library/argparse.rst:751 msgid "" ":class:`ArgumentParser` objects associate command-line arguments with " "actions. These actions can do just about anything with the command-line " @@ -1305,13 +1313,13 @@ msgid "" "be handled. The supplied actions are:" msgstr "" -#: ../../library/argparse.rst:752 +#: ../../library/argparse.rst:757 msgid "" "``'store'`` - This just stores the argument's value. This is the default " "action." msgstr "" -#: ../../library/argparse.rst:755 +#: ../../library/argparse.rst:760 msgid "" "``'store_const'`` - This stores the value specified by the const_ keyword " "argument; note that the const_ keyword argument defaults to ``None``. The " @@ -1319,7 +1327,7 @@ msgid "" "specify some sort of flag. For example::" msgstr "" -#: ../../library/argparse.rst:760 +#: ../../library/argparse.rst:765 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', action='store_const', const=42)\n" @@ -1331,7 +1339,7 @@ msgstr "" ">>> parser.parse_args(['--foo'])\n" "Namespace(foo=42)" -#: ../../library/argparse.rst:765 +#: ../../library/argparse.rst:770 msgid "" "``'store_true'`` and ``'store_false'`` - These are special cases of " "``'store_const'`` used for storing the values ``True`` and ``False`` " @@ -1339,7 +1347,7 @@ msgid "" "``True`` respectively::" msgstr "" -#: ../../library/argparse.rst:770 +#: ../../library/argparse.rst:775 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', action='store_true')\n" @@ -1355,7 +1363,7 @@ msgstr "" ">>> parser.parse_args('--foo --bar'.split())\n" "Namespace(foo=True, bar=False, baz=True)" -#: ../../library/argparse.rst:777 +#: ../../library/argparse.rst:782 msgid "" "``'append'`` - This appends each argument value to a list. It is useful for " "allowing an option to be specified multiple times. If the default value is a " @@ -1364,7 +1372,7 @@ msgid "" "values. Example usage::" msgstr "" -#: ../../library/argparse.rst:783 +#: ../../library/argparse.rst:788 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', action='append', default=['0'])\n" @@ -1376,7 +1384,7 @@ msgstr "" ">>> parser.parse_args('--foo 1 --foo 2'.split())\n" "Namespace(foo=['0', '1', '2'])" -#: ../../library/argparse.rst:788 +#: ../../library/argparse.rst:793 msgid "" "``'append_const'`` - This stores a list, and appends the value specified by " "the const_ keyword argument to the list; note that the const_ keyword " @@ -1385,7 +1393,7 @@ msgid "" "example::" msgstr "" -#: ../../library/argparse.rst:794 +#: ../../library/argparse.rst:799 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--str', dest='types', action='append_const', " @@ -1403,7 +1411,7 @@ msgstr "" ">>> parser.parse_args('--str --int'.split())\n" "Namespace(types=[, ])" -#: ../../library/argparse.rst:800 +#: ../../library/argparse.rst:805 msgid "" "``'extend'`` - This stores a list and appends each item from the multi-value " "argument list to it. The ``'extend'`` action is typically used with the " @@ -1412,7 +1420,7 @@ msgid "" "will be appended to the list. Example usage::" msgstr "" -#: ../../library/argparse.rst:808 +#: ../../library/argparse.rst:813 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument(\"--foo\", action=\"extend\", nargs=\"+\", " @@ -1428,13 +1436,13 @@ msgstr "" "\"f4\"])\n" "Namespace(foo=['f1', 'f2', 'f3', 'f4'])" -#: ../../library/argparse.rst:815 +#: ../../library/argparse.rst:820 msgid "" "``'count'`` - This counts the number of times a keyword argument occurs. For " "example, this is useful for increasing verbosity levels::" msgstr "" -#: ../../library/argparse.rst:818 +#: ../../library/argparse.rst:823 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--verbose', '-v', action='count', default=0)\n" @@ -1446,11 +1454,11 @@ msgstr "" ">>> parser.parse_args(['-vvv'])\n" "Namespace(verbose=3)" -#: ../../library/argparse.rst:823 +#: ../../library/argparse.rst:828 msgid "Note, the *default* will be ``None`` unless explicitly set to *0*." msgstr "" -#: ../../library/argparse.rst:825 +#: ../../library/argparse.rst:830 msgid "" "``'help'`` - This prints a complete help message for all the options in the " "current parser and then exits. By default a help action is automatically " @@ -1458,14 +1466,14 @@ msgid "" "output is created." msgstr "" -#: ../../library/argparse.rst:830 +#: ../../library/argparse.rst:835 msgid "" "``'version'`` - This expects a ``version=`` keyword argument in the :meth:" "`~ArgumentParser.add_argument` call, and prints version information and " "exits when invoked::" msgstr "" -#: ../../library/argparse.rst:834 +#: ../../library/argparse.rst:839 msgid "" ">>> import argparse\n" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" @@ -1481,7 +1489,7 @@ msgstr "" ">>> parser.parse_args(['--version'])\n" "PROG 2.0" -#: ../../library/argparse.rst:840 +#: ../../library/argparse.rst:845 msgid "" "You may also specify an arbitrary action by passing an :class:`Action` " "subclass (e.g. :class:`BooleanOptionalAction`) or other object that " @@ -1494,7 +1502,7 @@ msgstr "" "action(例如 ``'store'``、``'append'``、``'extend'`` 或 ``nargs`` 不為零的自" "定義 action)可以被用於位置引數。" -#: ../../library/argparse.rst:846 +#: ../../library/argparse.rst:851 msgid "" "The recommended way to create a custom action is to extend :class:`Action`, " "overriding the :meth:`!__call__` method and optionally the :meth:`!__init__` " @@ -1503,11 +1511,11 @@ msgid "" "their registered name." msgstr "" -#: ../../library/argparse.rst:851 +#: ../../library/argparse.rst:856 msgid "An example of a custom action::" msgstr "" -#: ../../library/argparse.rst:853 +#: ../../library/argparse.rst:858 msgid "" ">>> class FooAction(argparse.Action):\n" "... def __init__(self, option_strings, dest, nargs=None, **kwargs):\n" @@ -1545,15 +1553,15 @@ msgstr "" ">>> args\n" "Namespace(bar='1', foo='2')" -#: ../../library/argparse.rst:871 +#: ../../library/argparse.rst:876 msgid "For more details, see :class:`Action`." msgstr "更多詳情請見 :class:`Action`。" -#: ../../library/argparse.rst:877 +#: ../../library/argparse.rst:882 msgid "nargs" msgstr "nargs" -#: ../../library/argparse.rst:879 +#: ../../library/argparse.rst:884 msgid "" ":class:`ArgumentParser` objects usually associate a single command-line " "argument with a single action to be taken. The ``nargs`` keyword argument " @@ -1562,13 +1570,13 @@ msgid "" "are:" msgstr "" -#: ../../library/argparse.rst:884 +#: ../../library/argparse.rst:889 msgid "" "``N`` (an integer). ``N`` arguments from the command line will be gathered " "together into a list. For example::" msgstr "" -#: ../../library/argparse.rst:887 +#: ../../library/argparse.rst:892 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', nargs=2)\n" @@ -1582,13 +1590,13 @@ msgstr "" ">>> parser.parse_args('c --foo a b'.split())\n" "Namespace(bar=['c'], foo=['a', 'b'])" -#: ../../library/argparse.rst:893 +#: ../../library/argparse.rst:898 msgid "" "Note that ``nargs=1`` produces a list of one item. This is different from " "the default, in which the item is produced by itself." msgstr "" -#: ../../library/argparse.rst:898 +#: ../../library/argparse.rst:903 msgid "" "``'?'``. One argument will be consumed from the command line if possible, " "and produced as a single item. If no command-line argument is present, the " @@ -1598,7 +1606,7 @@ msgid "" "produced. Some examples to illustrate this::" msgstr "" -#: ../../library/argparse.rst:905 +#: ../../library/argparse.rst:910 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', nargs='?', const='c', default='d')\n" @@ -1620,13 +1628,13 @@ msgstr "" ">>> parser.parse_args([])\n" "Namespace(bar='d', foo='d')" -#: ../../library/argparse.rst:915 +#: ../../library/argparse.rst:920 msgid "" "One of the more common uses of ``nargs='?'`` is to allow optional input and " "output files::" msgstr "" -#: ../../library/argparse.rst:918 +#: ../../library/argparse.rst:923 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('infile', nargs='?')\n" @@ -1648,7 +1656,7 @@ msgstr "" ">>> parser.parse_args([])\n" "Namespace(infile=None, outfile=None)" -#: ../../library/argparse.rst:930 +#: ../../library/argparse.rst:935 msgid "" "``'*'``. All command-line arguments present are gathered into a list. Note " "that it generally doesn't make much sense to have more than one positional " @@ -1656,7 +1664,7 @@ msgid "" "``nargs='*'`` is possible. For example::" msgstr "" -#: ../../library/argparse.rst:935 +#: ../../library/argparse.rst:940 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', nargs='*')\n" @@ -1672,14 +1680,14 @@ msgstr "" ">>> parser.parse_args('a b --foo x y --bar 1 2'.split())\n" "Namespace(bar=['1', '2'], baz=['a', 'b'], foo=['x', 'y'])" -#: ../../library/argparse.rst:944 +#: ../../library/argparse.rst:949 msgid "" "``'+'``. Just like ``'*'``, all command-line arguments present are gathered " "into a list. Additionally, an error message will be generated if there " "wasn't at least one command-line argument present. For example::" msgstr "" -#: ../../library/argparse.rst:948 +#: ../../library/argparse.rst:953 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('foo', nargs='+')\n" @@ -1697,7 +1705,7 @@ msgstr "" "usage: PROG [-h] foo [foo ...]\n" "PROG: error: the following arguments are required: foo" -#: ../../library/argparse.rst:956 +#: ../../library/argparse.rst:961 msgid "" "If the ``nargs`` keyword argument is not provided, the number of arguments " "consumed is determined by the action_. Generally this means a single " @@ -1706,11 +1714,11 @@ msgid "" "``'store_const'``) set ``nargs=0``." msgstr "" -#: ../../library/argparse.rst:966 +#: ../../library/argparse.rst:971 msgid "const" msgstr "const" -#: ../../library/argparse.rst:968 +#: ../../library/argparse.rst:973 msgid "" "The ``const`` argument of :meth:`~ArgumentParser.add_argument` is used to " "hold constant values that are not read from the command line but are " @@ -1718,7 +1726,7 @@ msgid "" "common uses of it are:" msgstr "" -#: ../../library/argparse.rst:972 +#: ../../library/argparse.rst:977 msgid "" "When :meth:`~ArgumentParser.add_argument` is called with " "``action='store_const'`` or ``action='append_const'``. These actions add " @@ -1728,7 +1736,7 @@ msgid "" "receive a default value of ``None``." msgstr "" -#: ../../library/argparse.rst:980 +#: ../../library/argparse.rst:985 msgid "" "When :meth:`~ArgumentParser.add_argument` is called with option strings " "(like ``-f`` or ``--foo``) and ``nargs='?'``. This creates an optional " @@ -1738,17 +1746,17 @@ msgid "" "See the nargs_ description for examples." msgstr "" -#: ../../library/argparse.rst:987 +#: ../../library/argparse.rst:992 msgid "" "``const=None`` by default, including when ``action='append_const'`` or " "``action='store_const'``." msgstr "" -#: ../../library/argparse.rst:994 +#: ../../library/argparse.rst:999 msgid "default" msgstr "default" -#: ../../library/argparse.rst:996 +#: ../../library/argparse.rst:1001 msgid "" "All optional arguments and some positional arguments may be omitted at the " "command line. The ``default`` keyword argument of :meth:`~ArgumentParser." @@ -1758,7 +1766,7 @@ msgid "" "command line::" msgstr "" -#: ../../library/argparse.rst:1003 +#: ../../library/argparse.rst:1008 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default=42)\n" @@ -1774,13 +1782,13 @@ msgstr "" ">>> parser.parse_args([])\n" "Namespace(foo=42)" -#: ../../library/argparse.rst:1010 +#: ../../library/argparse.rst:1015 msgid "" "If the target namespace already has an attribute set, the action *default* " "will not overwrite it::" msgstr "" -#: ../../library/argparse.rst:1013 +#: ../../library/argparse.rst:1018 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default=42)\n" @@ -1792,7 +1800,7 @@ msgstr "" ">>> parser.parse_args([], namespace=argparse.Namespace(foo=101))\n" "Namespace(foo=101)" -#: ../../library/argparse.rst:1018 +#: ../../library/argparse.rst:1023 msgid "" "If the ``default`` value is a string, the parser parses the value as if it " "were a command-line argument. In particular, the parser applies any type_ " @@ -1800,7 +1808,7 @@ msgid "" "`Namespace` return value. Otherwise, the parser uses the value as is::" msgstr "" -#: ../../library/argparse.rst:1023 +#: ../../library/argparse.rst:1028 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--length', default='10', type=int)\n" @@ -1814,13 +1822,13 @@ msgstr "" ">>> parser.parse_args()\n" "Namespace(length=10, width=10.5)" -#: ../../library/argparse.rst:1029 +#: ../../library/argparse.rst:1034 msgid "" "For positional arguments with nargs_ equal to ``?`` or ``*``, the " "``default`` value is used when no command-line argument was present::" msgstr "" -#: ../../library/argparse.rst:1032 +#: ../../library/argparse.rst:1037 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('foo', nargs='?', default=42)\n" @@ -1836,20 +1844,20 @@ msgstr "" ">>> parser.parse_args([])\n" "Namespace(foo=42)" -#: ../../library/argparse.rst:1039 +#: ../../library/argparse.rst:1044 msgid "" "For required_ arguments, the ``default`` value is ignored. For example, this " "applies to positional arguments with nargs_ values other than ``?`` or " "``*``, or optional arguments marked as ``required=True``." msgstr "" -#: ../../library/argparse.rst:1043 +#: ../../library/argparse.rst:1048 msgid "" "Providing ``default=argparse.SUPPRESS`` causes no attribute to be added if " "the command-line argument was not present::" msgstr "" -#: ../../library/argparse.rst:1046 +#: ../../library/argparse.rst:1051 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default=argparse.SUPPRESS)\n" @@ -1865,11 +1873,11 @@ msgstr "" ">>> parser.parse_args(['--foo', '1'])\n" "Namespace(foo='1')" -#: ../../library/argparse.rst:1057 +#: ../../library/argparse.rst:1062 msgid "type" msgstr "type" -#: ../../library/argparse.rst:1059 +#: ../../library/argparse.rst:1064 msgid "" "By default, the parser reads command-line arguments in as simple strings. " "However, quite often the command-line string should instead be interpreted " @@ -1878,13 +1886,13 @@ msgid "" "checking and type conversions to be performed." msgstr "" -#: ../../library/argparse.rst:1065 +#: ../../library/argparse.rst:1070 msgid "" "If the type_ keyword is used with the default_ keyword, the type converter " "is only applied if the default is a string." msgstr "" -#: ../../library/argparse.rst:1068 +#: ../../library/argparse.rst:1073 msgid "" "The argument to ``type`` can be a callable that accepts a single string or " "the name of a registered type (see :meth:`~ArgumentParser.register`) If the " @@ -1893,11 +1901,11 @@ msgid "" "is displayed. Other exception types are not handled." msgstr "" -#: ../../library/argparse.rst:1074 +#: ../../library/argparse.rst:1079 msgid "Common built-in types and functions can be used as type converters:" msgstr "" -#: ../../library/argparse.rst:1076 +#: ../../library/argparse.rst:1081 msgid "" "import argparse\n" "import pathlib\n" @@ -1919,11 +1927,11 @@ msgstr "" "parser.add_argument('code_point', type=ord)\n" "parser.add_argument('datapath', type=pathlib.Path)" -#: ../../library/argparse.rst:1088 +#: ../../library/argparse.rst:1093 msgid "User defined functions can be used as well:" msgstr "" -#: ../../library/argparse.rst:1090 +#: ../../library/argparse.rst:1095 msgid "" ">>> def hyphenated(string):\n" "... return '-'.join([word[:4] for word in string.casefold().split()])\n" @@ -1941,14 +1949,14 @@ msgstr "" ">>> parser.parse_args(['\"The Tale of Two Cities\"'])\n" "Namespace(short_title='\"the-tale-of-two-citi')" -#: ../../library/argparse.rst:1100 +#: ../../library/argparse.rst:1105 msgid "" "The :func:`bool` function is not recommended as a type converter. All it " "does is convert empty strings to ``False`` and non-empty strings to " "``True``. This is usually not what is desired." msgstr "" -#: ../../library/argparse.rst:1104 +#: ../../library/argparse.rst:1109 msgid "" "In general, the ``type`` keyword is a convenience that should only be used " "for simple conversions that can only raise one of the three supported " @@ -1956,7 +1964,7 @@ msgid "" "management should be done downstream after the arguments are parsed." msgstr "" -#: ../../library/argparse.rst:1109 +#: ../../library/argparse.rst:1114 msgid "" "For example, JSON or YAML conversions have complex error cases that require " "better reporting than can be given by the ``type`` keyword. A :exc:`~json." @@ -1964,7 +1972,7 @@ msgid "" "exception would not be handled at all." msgstr "" -#: ../../library/argparse.rst:1114 +#: ../../library/argparse.rst:1119 msgid "" "Even :class:`~argparse.FileType` has its limitations for use with the " "``type`` keyword. If one argument uses :class:`~argparse.FileType` and then " @@ -1974,17 +1982,17 @@ msgid "" "files." msgstr "" -#: ../../library/argparse.rst:1121 +#: ../../library/argparse.rst:1126 msgid "" "For type checkers that simply check against a fixed set of values, consider " "using the choices_ keyword instead." msgstr "" -#: ../../library/argparse.rst:1128 +#: ../../library/argparse.rst:1133 msgid "choices" msgstr "choices" -#: ../../library/argparse.rst:1130 +#: ../../library/argparse.rst:1135 msgid "" "Some command-line arguments should be selected from a restricted set of " "values. These can be handled by passing a sequence object as the *choices* " @@ -1993,7 +2001,7 @@ msgid "" "be displayed if the argument was not one of the acceptable values::" msgstr "" -#: ../../library/argparse.rst:1136 +#: ../../library/argparse.rst:1141 msgid "" ">>> parser = argparse.ArgumentParser(prog='game.py')\n" ">>> parser.add_argument('move', choices=['rock', 'paper', 'scissors'])\n" @@ -2013,33 +2021,33 @@ msgstr "" "game.py: error: argument move: invalid choice: 'fire' (choose from 'rock',\n" "'paper', 'scissors')" -#: ../../library/argparse.rst:1145 +#: ../../library/argparse.rst:1150 msgid "" "Any sequence can be passed as the *choices* value, so :class:`list` " "objects, :class:`tuple` objects, and custom sequences are all supported." msgstr "" -#: ../../library/argparse.rst:1148 +#: ../../library/argparse.rst:1153 msgid "" "Use of :class:`enum.Enum` is not recommended because it is difficult to " "control its appearance in usage, help, and error messages." msgstr "" -#: ../../library/argparse.rst:1151 +#: ../../library/argparse.rst:1156 msgid "" "Note that *choices* are checked after any type_ conversions have been " "performed, so objects in *choices* should match the type_ specified. This " "can make *choices* appear unfamiliar in usage, help, or error messages." msgstr "" -#: ../../library/argparse.rst:1156 +#: ../../library/argparse.rst:1161 msgid "" "To keep *choices* user-friendly, consider a custom type wrapper that " "converts and formats values, or omit type_ and handle conversion in your " "application code." msgstr "" -#: ../../library/argparse.rst:1160 +#: ../../library/argparse.rst:1165 msgid "" "Formatted choices override the default *metavar* which is normally derived " "from *dest*. This is usually what you want because the user never sees the " @@ -2047,11 +2055,11 @@ msgid "" "are many choices), just specify an explicit metavar_." msgstr "" -#: ../../library/argparse.rst:1169 +#: ../../library/argparse.rst:1174 msgid "required" msgstr "required" -#: ../../library/argparse.rst:1171 +#: ../../library/argparse.rst:1176 msgid "" "In general, the :mod:`!argparse` module assumes that flags like ``-f`` and " "``--bar`` indicate *optional* arguments, which can always be omitted at the " @@ -2059,7 +2067,7 @@ msgid "" "the ``required=`` keyword argument to :meth:`~ArgumentParser.add_argument`::" msgstr "" -#: ../../library/argparse.rst:1176 +#: ../../library/argparse.rst:1181 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', required=True)\n" @@ -2077,24 +2085,24 @@ msgstr "" "usage: [-h] --foo FOO\n" ": error: the following arguments are required: --foo" -#: ../../library/argparse.rst:1184 +#: ../../library/argparse.rst:1189 msgid "" "As the example shows, if an option is marked as ``required``, :meth:" "`~ArgumentParser.parse_args` will report an error if that option is not " "present at the command line." msgstr "" -#: ../../library/argparse.rst:1190 +#: ../../library/argparse.rst:1195 msgid "" "Required options are generally considered bad form because users expect " "*options* to be *optional*, and thus they should be avoided when possible." msgstr "" -#: ../../library/argparse.rst:1197 +#: ../../library/argparse.rst:1202 msgid "help" msgstr "help" -#: ../../library/argparse.rst:1199 +#: ../../library/argparse.rst:1204 msgid "" "The ``help`` value is a string containing a brief description of the " "argument. When a user requests help (usually by using ``-h`` or ``--help`` " @@ -2102,7 +2110,7 @@ msgid "" "each argument." msgstr "" -#: ../../library/argparse.rst:1204 +#: ../../library/argparse.rst:1209 msgid "" "The ``help`` strings can include various format specifiers to avoid " "repetition of things like the program name or the argument default_. The " @@ -2111,7 +2119,7 @@ msgid "" "``%(type)s``, etc.::" msgstr "" -#: ../../library/argparse.rst:1209 +#: ../../library/argparse.rst:1214 msgid "" ">>> parser = argparse.ArgumentParser(prog='frobble')\n" ">>> parser.add_argument('bar', nargs='?', type=int, default=42,\n" @@ -2137,19 +2145,19 @@ msgstr "" "options:\n" " -h, --help show this help message and exit" -#: ../../library/argparse.rst:1221 +#: ../../library/argparse.rst:1226 msgid "" "As the help string supports %-formatting, if you want a literal ``%`` to " "appear in the help string, you must escape it as ``%%``." msgstr "" -#: ../../library/argparse.rst:1224 +#: ../../library/argparse.rst:1229 msgid "" ":mod:`!argparse` supports silencing the help entry for certain options, by " "setting the ``help`` value to ``argparse.SUPPRESS``::" msgstr "" -#: ../../library/argparse.rst:1227 +#: ../../library/argparse.rst:1232 msgid "" ">>> parser = argparse.ArgumentParser(prog='frobble')\n" ">>> parser.add_argument('--foo', help=argparse.SUPPRESS)\n" @@ -2167,11 +2175,11 @@ msgstr "" "options:\n" " -h, --help show this help message and exit" -#: ../../library/argparse.rst:1239 +#: ../../library/argparse.rst:1244 msgid "metavar" msgstr "metavar" -#: ../../library/argparse.rst:1241 +#: ../../library/argparse.rst:1246 msgid "" "When :class:`ArgumentParser` generates help messages, it needs some way to " "refer to each expected argument. By default, :class:`!ArgumentParser` " @@ -2183,7 +2191,7 @@ msgid "" "command-line argument will be referred to as ``FOO``. An example::" msgstr "" -#: ../../library/argparse.rst:1250 +#: ../../library/argparse.rst:1255 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo')\n" @@ -2215,11 +2223,11 @@ msgstr "" " -h, --help show this help message and exit\n" " --foo FOO" -#: ../../library/argparse.rst:1265 +#: ../../library/argparse.rst:1270 msgid "An alternative name can be specified with ``metavar``::" msgstr "" -#: ../../library/argparse.rst:1267 +#: ../../library/argparse.rst:1272 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', metavar='YYY')\n" @@ -2251,21 +2259,21 @@ msgstr "" " -h, --help show this help message and exit\n" " --foo YYY" -#: ../../library/argparse.rst:1282 +#: ../../library/argparse.rst:1287 msgid "" "Note that ``metavar`` only changes the *displayed* name - the name of the " "attribute on the :meth:`~ArgumentParser.parse_args` object is still " "determined by the dest_ value." msgstr "" -#: ../../library/argparse.rst:1286 +#: ../../library/argparse.rst:1291 msgid "" "Different values of ``nargs`` may cause the metavar to be used multiple " "times. Providing a tuple to ``metavar`` specifies a different display for " "each of the arguments::" msgstr "" -#: ../../library/argparse.rst:1290 +#: ../../library/argparse.rst:1295 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-x', nargs=2)\n" @@ -2289,11 +2297,11 @@ msgstr "" " -x X X\n" " --foo bar baz" -#: ../../library/argparse.rst:1305 +#: ../../library/argparse.rst:1310 msgid "dest" msgstr "dest" -#: ../../library/argparse.rst:1307 +#: ../../library/argparse.rst:1312 msgid "" "Most :class:`ArgumentParser` actions add some value as an attribute of the " "object returned by :meth:`~ArgumentParser.parse_args`. The name of this " @@ -2303,7 +2311,7 @@ msgid "" "add_argument`::" msgstr "" -#: ../../library/argparse.rst:1314 +#: ../../library/argparse.rst:1319 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('bar')\n" @@ -2315,7 +2323,7 @@ msgstr "" ">>> parser.parse_args(['XXX'])\n" "Namespace(bar='XXX')" -#: ../../library/argparse.rst:1319 +#: ../../library/argparse.rst:1324 msgid "" "For optional argument actions, the value of ``dest`` is normally inferred " "from the option strings. :class:`ArgumentParser` generates the value of " @@ -2327,7 +2335,7 @@ msgid "" "below illustrate this behavior::" msgstr "" -#: ../../library/argparse.rst:1328 +#: ../../library/argparse.rst:1333 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('-f', '--foo-bar', '--foo')\n" @@ -2345,11 +2353,11 @@ msgstr "" ">>> parser.parse_args('--foo 1 -y 2'.split())\n" "Namespace(foo_bar='1', x='2')" -#: ../../library/argparse.rst:1336 +#: ../../library/argparse.rst:1341 msgid "``dest`` allows a custom attribute name to be provided::" msgstr "" -#: ../../library/argparse.rst:1338 +#: ../../library/argparse.rst:1343 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', dest='bar')\n" @@ -2361,11 +2369,11 @@ msgstr "" ">>> parser.parse_args('--foo XXX'.split())\n" "Namespace(bar='XXX')" -#: ../../library/argparse.rst:1347 +#: ../../library/argparse.rst:1352 msgid "deprecated" msgstr "deprecated" -#: ../../library/argparse.rst:1349 +#: ../../library/argparse.rst:1354 msgid "" "During a project's lifetime, some arguments may need to be removed from the " "command line. Before removing them, you should inform your users that the " @@ -2376,7 +2384,7 @@ msgid "" "will be printed to :data:`sys.stderr` when the argument is used::" msgstr "" -#: ../../library/argparse.rst:1359 +#: ../../library/argparse.rst:1364 msgid "" ">>> import argparse\n" ">>> parser = argparse.ArgumentParser(prog='snake.py')\n" @@ -2396,11 +2404,11 @@ msgstr "" "snake.py: warning: option '--legs' is deprecated\n" "Namespace(legs=4)" -#: ../../library/argparse.rst:1372 +#: ../../library/argparse.rst:1377 msgid "Action classes" msgstr "Action 類別" -#: ../../library/argparse.rst:1374 +#: ../../library/argparse.rst:1379 msgid "" ":class:`!Action` classes implement the Action API, a callable which returns " "a callable which processes arguments from the command-line. Any object which " @@ -2408,7 +2416,7 @@ msgid "" "`~ArgumentParser.add_argument`." msgstr "" -#: ../../library/argparse.rst:1383 +#: ../../library/argparse.rst:1388 msgid "" ":class:`!Action` objects are used by an :class:`ArgumentParser` to represent " "the information needed to parse a single argument from one or more strings " @@ -2417,7 +2425,7 @@ msgid "" "`ArgumentParser.add_argument` except for the ``action`` itself." msgstr "" -#: ../../library/argparse.rst:1389 +#: ../../library/argparse.rst:1394 msgid "" "Instances of :class:`!Action` (or return value of any callable to the " "``action`` parameter) should have attributes :attr:`!dest`, :attr:`!" @@ -2426,46 +2434,46 @@ msgid "" "is to call :meth:`!Action.__init__`." msgstr "" -#: ../../library/argparse.rst:1397 +#: ../../library/argparse.rst:1402 msgid "" ":class:`!Action` instances should be callable, so subclasses must override " "the :meth:`!__call__` method, which should accept four parameters:" msgstr "" -#: ../../library/argparse.rst:1400 +#: ../../library/argparse.rst:1405 msgid "" "*parser* - The :class:`ArgumentParser` object which contains this action." msgstr "" -#: ../../library/argparse.rst:1402 +#: ../../library/argparse.rst:1407 msgid "" "*namespace* - The :class:`Namespace` object that will be returned by :meth:" "`~ArgumentParser.parse_args`. Most actions add an attribute to this object " "using :func:`setattr`." msgstr "" -#: ../../library/argparse.rst:1406 +#: ../../library/argparse.rst:1411 msgid "" "*values* - The associated command-line arguments, with any type conversions " "applied. Type conversions are specified with the type_ keyword argument to :" "meth:`~ArgumentParser.add_argument`." msgstr "" -#: ../../library/argparse.rst:1410 +#: ../../library/argparse.rst:1415 msgid "" "*option_string* - The option string that was used to invoke this action. The " "``option_string`` argument is optional, and will be absent if the action is " "associated with a positional argument." msgstr "" -#: ../../library/argparse.rst:1414 +#: ../../library/argparse.rst:1419 msgid "" "The :meth:`!__call__` method may perform arbitrary actions, but will " "typically set attributes on the ``namespace`` based on ``dest`` and " "``values``." msgstr "" -#: ../../library/argparse.rst:1419 +#: ../../library/argparse.rst:1424 msgid "" ":class:`!Action` subclasses can define a :meth:`!format_usage` method that " "takes no argument and return a string which will be used when printing the " @@ -2473,7 +2481,7 @@ msgid "" "will be used." msgstr "" -#: ../../library/argparse.rst:1425 +#: ../../library/argparse.rst:1430 msgid "" "A subclass of :class:`Action` for handling boolean flags with positive and " "negative options. Adding a single argument such as ``--foo`` automatically " @@ -2481,7 +2489,7 @@ msgid "" "``False`` respectively::" msgstr "" -#: ../../library/argparse.rst:1430 +#: ../../library/argparse.rst:1435 msgid "" ">>> import argparse\n" ">>> parser = argparse.ArgumentParser()\n" @@ -2495,47 +2503,47 @@ msgstr "" ">>> parser.parse_args(['--no-foo'])\n" "Namespace(foo=False)" -#: ../../library/argparse.rst:1440 +#: ../../library/argparse.rst:1445 msgid "The parse_args() method" msgstr "parse_args() 方法" -#: ../../library/argparse.rst:1444 +#: ../../library/argparse.rst:1449 msgid "" "Convert argument strings to objects and assign them as attributes of the " "namespace. Return the populated namespace." msgstr "" -#: ../../library/argparse.rst:1447 +#: ../../library/argparse.rst:1452 msgid "" "Previous calls to :meth:`add_argument` determine exactly what objects are " "created and how they are assigned. See the documentation for :meth:`!" "add_argument` for details." msgstr "" -#: ../../library/argparse.rst:1451 +#: ../../library/argparse.rst:1456 msgid "" "args_ - List of strings to parse. The default is taken from :data:`sys." "argv`." msgstr "" -#: ../../library/argparse.rst:1454 +#: ../../library/argparse.rst:1459 msgid "" "namespace_ - An object to take the attributes. The default is a new empty :" "class:`Namespace` object." msgstr "" -#: ../../library/argparse.rst:1459 +#: ../../library/argparse.rst:1464 msgid "Option value syntax" msgstr "" -#: ../../library/argparse.rst:1461 +#: ../../library/argparse.rst:1466 msgid "" "The :meth:`~ArgumentParser.parse_args` method supports several ways of " "specifying the value of an option (if it takes one). In the simplest case, " "the option and its value are passed as two separate arguments::" msgstr "" -#: ../../library/argparse.rst:1465 +#: ../../library/argparse.rst:1470 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-x')\n" @@ -2553,14 +2561,14 @@ msgstr "" ">>> parser.parse_args(['--foo', 'FOO'])\n" "Namespace(foo='FOO', x=None)" -#: ../../library/argparse.rst:1473 +#: ../../library/argparse.rst:1478 msgid "" "For long options (options with names longer than a single character), the " "option and value can also be passed as a single command-line argument, using " "``=`` to separate them::" msgstr "" -#: ../../library/argparse.rst:1477 +#: ../../library/argparse.rst:1482 msgid "" ">>> parser.parse_args(['--foo=FOO'])\n" "Namespace(foo='FOO', x=None)" @@ -2568,13 +2576,13 @@ msgstr "" ">>> parser.parse_args(['--foo=FOO'])\n" "Namespace(foo='FOO', x=None)" -#: ../../library/argparse.rst:1480 +#: ../../library/argparse.rst:1485 msgid "" "For short options (options only one character long), the option and its " "value can be concatenated::" msgstr "" -#: ../../library/argparse.rst:1483 +#: ../../library/argparse.rst:1488 msgid "" ">>> parser.parse_args(['-xX'])\n" "Namespace(foo=None, x='X')" @@ -2582,13 +2590,13 @@ msgstr "" ">>> parser.parse_args(['-xX'])\n" "Namespace(foo=None, x='X')" -#: ../../library/argparse.rst:1486 +#: ../../library/argparse.rst:1491 msgid "" "Several short options can be joined together, using only a single ``-`` " "prefix, as long as only the last option (or none of them) requires a value::" msgstr "" -#: ../../library/argparse.rst:1489 +#: ../../library/argparse.rst:1494 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-x', action='store_true')\n" @@ -2604,11 +2612,11 @@ msgstr "" ">>> parser.parse_args(['-xyzZ'])\n" "Namespace(x=True, y=True, z='Z')" -#: ../../library/argparse.rst:1498 +#: ../../library/argparse.rst:1503 msgid "Invalid arguments" msgstr "無效引數" -#: ../../library/argparse.rst:1500 +#: ../../library/argparse.rst:1505 msgid "" "While parsing the command line, :meth:`~ArgumentParser.parse_args` checks " "for a variety of errors, including ambiguous options, invalid types, invalid " @@ -2616,7 +2624,7 @@ msgid "" "an error, it exits and prints the error along with a usage message::" msgstr "" -#: ../../library/argparse.rst:1505 +#: ../../library/argparse.rst:1510 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('--foo', type=int)\n" @@ -2656,11 +2664,11 @@ msgstr "" "usage: PROG [-h] [--foo FOO] [bar]\n" "PROG: error: extra arguments found: badger" -#: ../../library/argparse.rst:1526 +#: ../../library/argparse.rst:1531 msgid "Arguments containing ``-``" msgstr "包含 ``-`` 的引數" -#: ../../library/argparse.rst:1528 +#: ../../library/argparse.rst:1533 msgid "" "The :meth:`~ArgumentParser.parse_args` method attempts to give errors " "whenever the user has clearly made a mistake, but some situations are " @@ -2672,7 +2680,7 @@ msgid "" "negative numbers::" msgstr "" -#: ../../library/argparse.rst:1536 +#: ../../library/argparse.rst:1541 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-x')\n" @@ -2705,7 +2713,7 @@ msgid "" "PROG: error: argument -1: expected one argument" msgstr "" -#: ../../library/argparse.rst:1566 +#: ../../library/argparse.rst:1571 msgid "" "If you have positional arguments that must begin with ``-`` and don't look " "like negative numbers, you can insert the pseudo-argument ``'--'`` which " @@ -2713,7 +2721,7 @@ msgid "" "positional argument::" msgstr "" -#: ../../library/argparse.rst:1571 +#: ../../library/argparse.rst:1576 msgid "" ">>> parser.parse_args(['--', '-f'])\n" "Namespace(foo='-f', one=None)" @@ -2721,24 +2729,24 @@ msgstr "" ">>> parser.parse_args(['--', '-f'])\n" "Namespace(foo='-f', one=None)" -#: ../../library/argparse.rst:1574 +#: ../../library/argparse.rst:1579 msgid "" "See also :ref:`the argparse howto on ambiguous arguments ` for more details." msgstr "" -#: ../../library/argparse.rst:1580 +#: ../../library/argparse.rst:1585 msgid "Argument abbreviations (prefix matching)" msgstr "引數縮寫 (前綴匹配)" -#: ../../library/argparse.rst:1582 +#: ../../library/argparse.rst:1587 msgid "" "The :meth:`~ArgumentParser.parse_args` method :ref:`by default " "` allows long options to be abbreviated to a prefix, if the " "abbreviation is unambiguous (the prefix matches a unique option)::" msgstr "" -#: ../../library/argparse.rst:1586 +#: ../../library/argparse.rst:1591 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-bacon')\n" @@ -2762,17 +2770,17 @@ msgstr "" "usage: PROG [-h] [-bacon BACON] [-badger BADGER]\n" "PROG: error: ambiguous option: -ba could match -badger, -bacon" -#: ../../library/argparse.rst:1597 +#: ../../library/argparse.rst:1602 msgid "" "An error is produced for arguments that could produce more than one options. " "This feature can be disabled by setting :ref:`allow_abbrev` to ``False``." msgstr "" -#: ../../library/argparse.rst:1603 +#: ../../library/argparse.rst:1608 msgid "Beyond ``sys.argv``" msgstr "``sys.argv`` 之外" -#: ../../library/argparse.rst:1605 +#: ../../library/argparse.rst:1610 msgid "" "Sometimes it may be useful to have an :class:`ArgumentParser` parse " "arguments other than those of :data:`sys.argv`. This can be accomplished by " @@ -2780,7 +2788,7 @@ msgid "" "useful for testing at the interactive prompt::" msgstr "" -#: ../../library/argparse.rst:1610 +#: ../../library/argparse.rst:1615 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument(\n" @@ -2806,24 +2814,24 @@ msgstr "" ">>> parser.parse_args(['1', '2', '3', '4', '--sum'])\n" "Namespace(accumulate=, integers=[1, 2, 3, 4])" -#: ../../library/argparse.rst:1625 +#: ../../library/argparse.rst:1630 msgid "The Namespace object" msgstr "命名空間物件" -#: ../../library/argparse.rst:1629 +#: ../../library/argparse.rst:1634 msgid "" "Simple class used by default by :meth:`~ArgumentParser.parse_args` to create " "an object holding attributes and return it." msgstr "" -#: ../../library/argparse.rst:1632 +#: ../../library/argparse.rst:1637 msgid "" "This class is deliberately simple, just an :class:`object` subclass with a " "readable string representation. If you prefer to have dict-like view of the " "attributes, you can use the standard Python idiom, :func:`vars`::" msgstr "" -#: ../../library/argparse.rst:1636 +#: ../../library/argparse.rst:1641 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo')\n" @@ -2837,14 +2845,14 @@ msgstr "" ">>> vars(args)\n" "{'foo': 'BAR'}" -#: ../../library/argparse.rst:1642 +#: ../../library/argparse.rst:1647 msgid "" "It may also be useful to have an :class:`ArgumentParser` assign attributes " "to an already existing object, rather than a new :class:`Namespace` object. " "This can be achieved by specifying the ``namespace=`` keyword argument::" msgstr "" -#: ../../library/argparse.rst:1646 +#: ../../library/argparse.rst:1651 msgid "" ">>> class C:\n" "... pass\n" @@ -2866,15 +2874,15 @@ msgstr "" ">>> c.foo\n" "'BAR'" -#: ../../library/argparse.rst:1658 +#: ../../library/argparse.rst:1663 msgid "Other utilities" msgstr "" -#: ../../library/argparse.rst:1661 +#: ../../library/argparse.rst:1666 msgid "Sub-commands" msgstr "子命令" -#: ../../library/argparse.rst:1668 +#: ../../library/argparse.rst:1673 msgid "" "Many programs split up their functionality into a number of subcommands, for " "example, the ``svn`` program can invoke subcommands like ``svn checkout``, " @@ -2889,69 +2897,69 @@ msgid "" "returns an :class:`!ArgumentParser` object that can be modified as usual." msgstr "" -#: ../../library/argparse.rst:1680 +#: ../../library/argparse.rst:1685 msgid "Description of parameters:" msgstr "參數的解釋:" -#: ../../library/argparse.rst:1682 +#: ../../library/argparse.rst:1687 msgid "" "*title* - title for the sub-parser group in help output; by default " "\"subcommands\" if description is provided, otherwise uses title for " "positional arguments" msgstr "" -#: ../../library/argparse.rst:1686 +#: ../../library/argparse.rst:1691 msgid "" "*description* - description for the sub-parser group in help output, by " "default ``None``" msgstr "" -#: ../../library/argparse.rst:1689 +#: ../../library/argparse.rst:1694 msgid "" "*prog* - usage information that will be displayed with sub-command help, by " "default the name of the program and any positional arguments before the " "subparser argument" msgstr "" -#: ../../library/argparse.rst:1693 +#: ../../library/argparse.rst:1698 msgid "" "*parser_class* - class which will be used to create sub-parser instances, by " "default the class of the current parser (e.g. :class:`ArgumentParser`)" msgstr "" -#: ../../library/argparse.rst:1696 +#: ../../library/argparse.rst:1701 msgid "" "action_ - the basic type of action to be taken when this argument is " "encountered at the command line" msgstr "" -#: ../../library/argparse.rst:1699 +#: ../../library/argparse.rst:1704 msgid "" "dest_ - name of the attribute under which sub-command name will be stored; " "by default ``None`` and no value is stored" msgstr "" -#: ../../library/argparse.rst:1702 +#: ../../library/argparse.rst:1707 msgid "" "required_ - Whether or not a subcommand must be provided, by default " "``False`` (added in 3.7)" msgstr "" -#: ../../library/argparse.rst:1705 +#: ../../library/argparse.rst:1710 msgid "help_ - help for sub-parser group in help output, by default ``None``" msgstr "" -#: ../../library/argparse.rst:1707 +#: ../../library/argparse.rst:1712 msgid "" "metavar_ - string presenting available subcommands in help; by default it is " "``None`` and presents subcommands in form {cmd1, cmd2, ..}" msgstr "" -#: ../../library/argparse.rst:1710 +#: ../../library/argparse.rst:1715 msgid "Some example usage::" msgstr "一些使用範例: ::" -#: ../../library/argparse.rst:1712 +#: ../../library/argparse.rst:1717 msgid "" ">>> # create the top-level parser\n" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" @@ -2974,7 +2982,7 @@ msgid "" "Namespace(baz='Z', foo=True)" msgstr "" -#: ../../library/argparse.rst:1731 +#: ../../library/argparse.rst:1736 msgid "" "Note that the object returned by :meth:`parse_args` will only contain " "attributes for the main parser and the subparser that was selected by the " @@ -2984,7 +2992,7 @@ msgid "" "``baz`` attributes are present." msgstr "" -#: ../../library/argparse.rst:1738 +#: ../../library/argparse.rst:1743 msgid "" "Similarly, when a help message is requested from a subparser, only the help " "for that particular parser will be printed. The help message will not " @@ -2993,7 +3001,7 @@ msgid "" "to :meth:`~_SubParsersAction.add_parser` as above.)" msgstr "" -#: ../../library/argparse.rst:1746 +#: ../../library/argparse.rst:1751 msgid "" ">>> parser.parse_args(['--help'])\n" "usage: PROG [-h] [--foo] {a,b} ...\n" @@ -3051,14 +3059,14 @@ msgstr "" " -h, --help show this help message and exit\n" " --baz {X,Y,Z} baz help" -#: ../../library/argparse.rst:1774 +#: ../../library/argparse.rst:1779 msgid "" "The :meth:`add_subparsers` method also supports ``title`` and " "``description`` keyword arguments. When either is present, the subparser's " "commands will appear in their own group in the help output. For example::" msgstr "" -#: ../../library/argparse.rst:1778 +#: ../../library/argparse.rst:1783 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> subparsers = parser.add_subparsers(title='subcommands',\n" @@ -3094,7 +3102,7 @@ msgstr "" "\n" " {foo,bar} additional help" -#: ../../library/argparse.rst:1795 +#: ../../library/argparse.rst:1800 msgid "" "Furthermore, :meth:`~_SubParsersAction.add_parser` supports an additional " "*aliases* argument, which allows multiple strings to refer to the same " @@ -3102,7 +3110,7 @@ msgid "" "``checkout``::" msgstr "" -#: ../../library/argparse.rst:1800 +#: ../../library/argparse.rst:1805 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> subparsers = parser.add_subparsers()\n" @@ -3118,13 +3126,13 @@ msgstr "" ">>> parser.parse_args(['co', 'bar'])\n" "Namespace(foo='bar')" -#: ../../library/argparse.rst:1807 +#: ../../library/argparse.rst:1812 msgid "" ":meth:`~_SubParsersAction.add_parser` supports also an additional " "*deprecated* argument, which allows to deprecate the subparser." msgstr "" -#: ../../library/argparse.rst:1821 +#: ../../library/argparse.rst:1826 msgid "" "One particularly effective way of handling subcommands is to combine the use " "of the :meth:`add_subparsers` method with calls to :meth:`set_defaults` so " @@ -3132,7 +3140,7 @@ msgid "" "example::" msgstr "" -#: ../../library/argparse.rst:1826 +#: ../../library/argparse.rst:1831 msgid "" ">>> # subcommand functions\n" ">>> def foo(args):\n" @@ -3167,7 +3175,7 @@ msgid "" "((XYZYX))" msgstr "" -#: ../../library/argparse.rst:1858 +#: ../../library/argparse.rst:1863 msgid "" "This way, you can let :meth:`parse_args` do the job of calling the " "appropriate function after argument parsing is complete. Associating " @@ -3177,7 +3185,7 @@ msgid "" "argument to the :meth:`add_subparsers` call will work::" msgstr "" -#: ../../library/argparse.rst:1865 +#: ../../library/argparse.rst:1870 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> subparsers = parser.add_subparsers(dest='subparser_name')\n" @@ -3197,21 +3205,21 @@ msgstr "" ">>> parser.parse_args(['2', 'frobble'])\n" "Namespace(subparser_name='2', y='frobble')" -#: ../../library/argparse.rst:1874 +#: ../../library/argparse.rst:1879 msgid "New *required* keyword-only parameter." msgstr "" -#: ../../library/argparse.rst:1877 +#: ../../library/argparse.rst:1882 msgid "" "Subparser's *prog* is no longer affected by a custom usage message in the " "main parser." msgstr "" -#: ../../library/argparse.rst:1883 +#: ../../library/argparse.rst:1888 msgid "FileType objects" msgstr "FileType 物件" -#: ../../library/argparse.rst:1887 +#: ../../library/argparse.rst:1892 msgid "" "The :class:`FileType` factory creates objects that can be passed to the type " "argument of :meth:`ArgumentParser.add_argument`. Arguments that have :class:" @@ -3220,7 +3228,7 @@ msgid "" "the :func:`open` function for more details)::" msgstr "" -#: ../../library/argparse.rst:1893 +#: ../../library/argparse.rst:1898 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--raw', type=argparse.FileType('wb', 0))\n" @@ -3238,14 +3246,14 @@ msgstr "" "Namespace(out=<_io.TextIOWrapper name='file.txt' mode='w' encoding='UTF-8'>, " "raw=<_io.FileIO name='raw.dat' mode='wb'>)" -#: ../../library/argparse.rst:1899 +#: ../../library/argparse.rst:1904 msgid "" "FileType objects understand the pseudo-argument ``'-'`` and automatically " "convert this into :data:`sys.stdin` for readable :class:`FileType` objects " "and :data:`sys.stdout` for writable :class:`FileType` objects::" msgstr "" -#: ../../library/argparse.rst:1903 +#: ../../library/argparse.rst:1908 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('infile', type=argparse.FileType('r'))\n" @@ -3257,7 +3265,7 @@ msgstr "" ">>> parser.parse_args(['-'])\n" "Namespace(infile=<_io.TextIOWrapper name='' encoding='UTF-8'>)" -#: ../../library/argparse.rst:1910 +#: ../../library/argparse.rst:1915 msgid "" "If one argument uses *FileType* and then a subsequent argument fails, an " "error is reported but the file is not automatically closed. This can also " @@ -3266,15 +3274,15 @@ msgid "" "manage the files." msgstr "" -#: ../../library/argparse.rst:1916 +#: ../../library/argparse.rst:1921 msgid "Added the *encodings* and *errors* parameters." msgstr "" -#: ../../library/argparse.rst:1923 +#: ../../library/argparse.rst:1928 msgid "Argument groups" msgstr "" -#: ../../library/argparse.rst:1928 +#: ../../library/argparse.rst:1933 msgid "" "By default, :class:`ArgumentParser` groups command-line arguments into " "\"positional arguments\" and \"options\" when displaying help messages. When " @@ -3283,7 +3291,7 @@ msgid "" "method::" msgstr "" -#: ../../library/argparse.rst:1934 +#: ../../library/argparse.rst:1939 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', add_help=False)\n" ">>> group = parser.add_argument_group('group')\n" @@ -3307,7 +3315,7 @@ msgstr "" " bar bar help\n" " --foo FOO foo help" -#: ../../library/argparse.rst:1945 +#: ../../library/argparse.rst:1950 msgid "" "The :meth:`add_argument_group` method returns an argument group object which " "has an :meth:`~ArgumentParser.add_argument` method just like a regular :" @@ -3318,7 +3326,7 @@ msgid "" "this display::" msgstr "" -#: ../../library/argparse.rst:1953 +#: ../../library/argparse.rst:1958 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', add_help=False)\n" ">>> group1 = parser.add_argument_group('group1', 'group1 description')\n" @@ -3356,7 +3364,7 @@ msgstr "" "\n" " --bar BAR bar help" -#: ../../library/argparse.rst:1971 +#: ../../library/argparse.rst:1976 msgid "" "The optional, keyword-only parameters argument_default_ and " "conflict_handler_ allow for finer-grained control of the behavior of the " @@ -3365,35 +3373,35 @@ msgid "" "rather than the entire parser." msgstr "" -#: ../../library/argparse.rst:1976 +#: ../../library/argparse.rst:1981 msgid "" "Note that any arguments not in your user-defined groups will end up back in " "the usual \"positional arguments\" and \"optional arguments\" sections." msgstr "" -#: ../../library/argparse.rst:1979 +#: ../../library/argparse.rst:1984 msgid "" "Calling :meth:`add_argument_group` on an argument group now raises an " "exception. This nesting was never supported, often failed to work correctly, " "and was unintentionally exposed through inheritance." msgstr "" -#: ../../library/argparse.rst:1984 +#: ../../library/argparse.rst:1989 msgid "Passing prefix_chars_ to :meth:`add_argument_group` is now deprecated." msgstr "" -#: ../../library/argparse.rst:1990 +#: ../../library/argparse.rst:1995 msgid "Mutual exclusion" msgstr "" -#: ../../library/argparse.rst:1994 +#: ../../library/argparse.rst:1999 msgid "" "Create a mutually exclusive group. :mod:`!argparse` will make sure that only " "one of the arguments in the mutually exclusive group was present on the " "command line::" msgstr "" -#: ../../library/argparse.rst:1998 +#: ../../library/argparse.rst:2003 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> group = parser.add_mutually_exclusive_group()\n" @@ -3419,14 +3427,14 @@ msgstr "" "usage: PROG [-h] [--foo | --bar]\n" "PROG: error: argument --bar: not allowed with argument --foo" -#: ../../library/argparse.rst:2010 +#: ../../library/argparse.rst:2015 msgid "" "The :meth:`add_mutually_exclusive_group` method also accepts a *required* " "argument, to indicate that at least one of the mutually exclusive arguments " "is required::" msgstr "" -#: ../../library/argparse.rst:2014 +#: ../../library/argparse.rst:2019 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> group = parser.add_mutually_exclusive_group(required=True)\n" @@ -3444,7 +3452,7 @@ msgstr "" "usage: PROG [-h] (--foo | --bar)\n" "PROG: error: one of the arguments --foo --bar is required" -#: ../../library/argparse.rst:2022 +#: ../../library/argparse.rst:2027 msgid "" "Note that currently mutually exclusive argument groups do not support the " "*title* and *description* arguments of :meth:`~ArgumentParser." @@ -3452,7 +3460,7 @@ msgid "" "argument group that has a title and description. For example::" msgstr "" -#: ../../library/argparse.rst:2028 +#: ../../library/argparse.rst:2033 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> group = parser.add_argument_group('Group title', 'Group description')\n" @@ -3488,7 +3496,7 @@ msgstr "" " --foo FOO foo help\n" " --bar BAR bar help" -#: ../../library/argparse.rst:2045 +#: ../../library/argparse.rst:2050 msgid "" "Calling :meth:`add_argument_group` or :meth:`add_mutually_exclusive_group` " "on a mutually exclusive group now raises an exception. This nesting was " @@ -3496,11 +3504,11 @@ msgid "" "exposed through inheritance." msgstr "" -#: ../../library/argparse.rst:2053 +#: ../../library/argparse.rst:2058 msgid "Parser defaults" msgstr "" -#: ../../library/argparse.rst:2057 +#: ../../library/argparse.rst:2062 msgid "" "Most of the time, the attributes of the object returned by :meth:" "`parse_args` will be fully determined by inspecting the command-line " @@ -3509,7 +3517,7 @@ msgid "" "command line to be added::" msgstr "" -#: ../../library/argparse.rst:2063 +#: ../../library/argparse.rst:2068 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('foo', type=int)\n" @@ -3523,12 +3531,15 @@ msgstr "" ">>> parser.parse_args(['736'])\n" "Namespace(bar=42, baz='badger', foo=736)" -#: ../../library/argparse.rst:2069 +#: ../../library/argparse.rst:2074 msgid "" -"Note that parser-level defaults always override argument-level defaults::" +"Note that defaults can be set at both the parser level using :meth:" +"`set_defaults` and at the argument level using :meth:`add_argument`. If both " +"are called for the same argument, the last default set for an argument is " +"used::" msgstr "" -#: ../../library/argparse.rst:2071 +#: ../../library/argparse.rst:2078 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default='bar')\n" @@ -3542,20 +3553,20 @@ msgstr "" ">>> parser.parse_args([])\n" "Namespace(foo='spam')" -#: ../../library/argparse.rst:2077 +#: ../../library/argparse.rst:2084 msgid "" "Parser-level defaults can be particularly useful when working with multiple " "parsers. See the :meth:`~ArgumentParser.add_subparsers` method for an " "example of this type." msgstr "" -#: ../../library/argparse.rst:2083 +#: ../../library/argparse.rst:2090 msgid "" "Get the default value for a namespace attribute, as set by either :meth:" "`~ArgumentParser.add_argument` or by :meth:`~ArgumentParser.set_defaults`::" msgstr "" -#: ../../library/argparse.rst:2087 +#: ../../library/argparse.rst:2094 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default='badger')\n" @@ -3567,54 +3578,54 @@ msgstr "" ">>> parser.get_default('foo')\n" "'badger'" -#: ../../library/argparse.rst:2094 +#: ../../library/argparse.rst:2101 msgid "Printing help" msgstr "印出幫助訊息" -#: ../../library/argparse.rst:2096 +#: ../../library/argparse.rst:2103 msgid "" "In most typical applications, :meth:`~ArgumentParser.parse_args` will take " "care of formatting and printing any usage or error messages. However, " "several formatting methods are available:" msgstr "" -#: ../../library/argparse.rst:2102 +#: ../../library/argparse.rst:2109 msgid "" "Print a brief description of how the :class:`ArgumentParser` should be " "invoked on the command line. If *file* is ``None``, :data:`sys.stdout` is " "assumed." msgstr "" -#: ../../library/argparse.rst:2108 +#: ../../library/argparse.rst:2115 msgid "" "Print a help message, including the program usage and information about the " "arguments registered with the :class:`ArgumentParser`. If *file* is " "``None``, :data:`sys.stdout` is assumed." msgstr "" -#: ../../library/argparse.rst:2112 +#: ../../library/argparse.rst:2119 msgid "" "There are also variants of these methods that simply return a string instead " "of printing it:" msgstr "" -#: ../../library/argparse.rst:2117 +#: ../../library/argparse.rst:2124 msgid "" "Return a string containing a brief description of how the :class:" "`ArgumentParser` should be invoked on the command line." msgstr "" -#: ../../library/argparse.rst:2122 +#: ../../library/argparse.rst:2129 msgid "" "Return a string containing a help message, including the program usage and " "information about the arguments registered with the :class:`ArgumentParser`." msgstr "" -#: ../../library/argparse.rst:2127 +#: ../../library/argparse.rst:2134 msgid "Partial parsing" msgstr "" -#: ../../library/argparse.rst:2131 +#: ../../library/argparse.rst:2138 msgid "" "Sometimes a script only needs to handle a specific set of command-line " "arguments, leaving any unrecognized arguments for another script or program. " @@ -3622,7 +3633,7 @@ msgid "" "useful." msgstr "" -#: ../../library/argparse.rst:2136 +#: ../../library/argparse.rst:2143 msgid "" "This method works similarly to :meth:`~ArgumentParser.parse_args`, but it " "does not raise an error for extra, unrecognized arguments. Instead, it " @@ -3630,7 +3641,7 @@ msgid "" "populated namespace and the list of any unrecognized arguments." msgstr "" -#: ../../library/argparse.rst:2143 +#: ../../library/argparse.rst:2150 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', action='store_true')\n" @@ -3644,7 +3655,7 @@ msgstr "" ">>> parser.parse_known_args(['--foo', '--badger', 'BAR', 'spam'])\n" "(Namespace(bar='BAR', foo=True), ['--badger', 'spam'])" -#: ../../library/argparse.rst:2150 +#: ../../library/argparse.rst:2157 msgid "" ":ref:`Prefix matching ` rules apply to :meth:" "`~ArgumentParser.parse_known_args`. The parser may consume an option even if " @@ -3652,11 +3663,11 @@ msgid "" "remaining arguments list." msgstr "" -#: ../../library/argparse.rst:2157 +#: ../../library/argparse.rst:2164 msgid "Customizing file parsing" msgstr "" -#: ../../library/argparse.rst:2161 +#: ../../library/argparse.rst:2168 msgid "" "Arguments that are read from a file (see the *fromfile_prefix_chars* keyword " "argument to the :class:`ArgumentParser` constructor) are read one argument " @@ -3664,20 +3675,20 @@ msgid "" "reading." msgstr "" -#: ../../library/argparse.rst:2166 +#: ../../library/argparse.rst:2173 msgid "" "This method takes a single argument *arg_line* which is a string read from " "the argument file. It returns a list of arguments parsed from this string. " "The method is called once per line read from the argument file, in order." msgstr "" -#: ../../library/argparse.rst:2170 +#: ../../library/argparse.rst:2177 msgid "" "A useful override of this method is one that treats each space-separated " "word as an argument. The following example demonstrates how to do this::" msgstr "" -#: ../../library/argparse.rst:2173 +#: ../../library/argparse.rst:2180 msgid "" "class MyArgumentParser(argparse.ArgumentParser):\n" " def convert_arg_line_to_args(self, arg_line):\n" @@ -3687,18 +3698,18 @@ msgstr "" " def convert_arg_line_to_args(self, arg_line):\n" " return arg_line.split()" -#: ../../library/argparse.rst:2179 +#: ../../library/argparse.rst:2186 msgid "Exiting methods" msgstr "" -#: ../../library/argparse.rst:2183 +#: ../../library/argparse.rst:2190 msgid "" "This method terminates the program, exiting with the specified *status* and, " "if given, it prints a *message* to :data:`sys.stderr` before that. The user " "can override this method to handle these steps differently::" msgstr "" -#: ../../library/argparse.rst:2187 +#: ../../library/argparse.rst:2194 msgid "" "class ErrorCatchingArgumentParser(argparse.ArgumentParser):\n" " def exit(self, status=0, message=None):\n" @@ -3712,17 +3723,17 @@ msgstr "" " raise Exception(f'Exiting because of an error: {message}')\n" " exit(status)" -#: ../../library/argparse.rst:2195 +#: ../../library/argparse.rst:2202 msgid "" "This method prints a usage message, including the *message*, to :data:`sys." "stderr` and terminates the program with a status code of 2." msgstr "" -#: ../../library/argparse.rst:2200 +#: ../../library/argparse.rst:2207 msgid "Intermixed parsing" msgstr "" -#: ../../library/argparse.rst:2205 +#: ../../library/argparse.rst:2212 msgid "" "A number of Unix commands allow the user to intermix optional arguments with " "positional arguments. The :meth:`~ArgumentParser.parse_intermixed_args` " @@ -3730,7 +3741,7 @@ msgid "" "parsing style." msgstr "" -#: ../../library/argparse.rst:2210 +#: ../../library/argparse.rst:2217 msgid "" "These parsers do not support all the :mod:`!argparse` features, and will " "raise exceptions if unsupported features are used. In particular, " @@ -3738,7 +3749,7 @@ msgid "" "positionals are not supported." msgstr "" -#: ../../library/argparse.rst:2215 +#: ../../library/argparse.rst:2222 msgid "" "The following example shows the difference between :meth:`~ArgumentParser." "parse_known_args` and :meth:`~ArgumentParser.parse_intermixed_args`: the " @@ -3746,7 +3757,7 @@ msgid "" "collects all the positionals into ``rest``. ::" msgstr "" -#: ../../library/argparse.rst:2221 +#: ../../library/argparse.rst:2228 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo')\n" @@ -3766,7 +3777,7 @@ msgstr "" ">>> parser.parse_intermixed_args('doit 1 --foo bar 2 3'.split())\n" "Namespace(cmd='doit', foo='bar', rest=[1, 2, 3])" -#: ../../library/argparse.rst:2230 +#: ../../library/argparse.rst:2237 msgid "" ":meth:`~ArgumentParser.parse_known_intermixed_args` returns a two item tuple " "containing the populated namespace and the list of remaining argument " @@ -3774,11 +3785,11 @@ msgid "" "there are any remaining unparsed argument strings." msgstr "" -#: ../../library/argparse.rst:2239 +#: ../../library/argparse.rst:2246 msgid "Registering custom types or actions" msgstr "" -#: ../../library/argparse.rst:2243 +#: ../../library/argparse.rst:2250 msgid "" "Sometimes it's desirable to use a custom string in error messages to provide " "more user-friendly output. In these cases, :meth:`!register` can be used to " @@ -3786,7 +3797,7 @@ msgid "" "the type by their registered name instead of their callable name." msgstr "" -#: ../../library/argparse.rst:2248 +#: ../../library/argparse.rst:2255 msgid "" "The :meth:`!register` method accepts three arguments - a *registry_name*, " "specifying the internal registry where the object will be stored (e.g., " @@ -3794,12 +3805,12 @@ msgid "" "be registered, and object, the callable to be registered." msgstr "" -#: ../../library/argparse.rst:2253 +#: ../../library/argparse.rst:2260 msgid "" "The following example shows how to register a custom type with a parser::" msgstr "" -#: ../../library/argparse.rst:2255 +#: ../../library/argparse.rst:2262 msgid "" ">>> import argparse\n" ">>> parser = argparse.ArgumentParser()\n" @@ -3827,43 +3838,43 @@ msgstr "" "usage: PROG [-h] [--foo FOO]\n" "PROG: error: argument --foo: invalid 'hexadecimal integer' value: '1.2'" -#: ../../library/argparse.rst:2267 +#: ../../library/argparse.rst:2274 msgid "Exceptions" msgstr "例外" -#: ../../library/argparse.rst:2271 +#: ../../library/argparse.rst:2278 msgid "An error from creating or using an argument (optional or positional)." msgstr "" -#: ../../library/argparse.rst:2273 +#: ../../library/argparse.rst:2280 msgid "" "The string value of this exception is the message, augmented with " "information about the argument that caused it." msgstr "" -#: ../../library/argparse.rst:2278 +#: ../../library/argparse.rst:2285 msgid "" "Raised when something goes wrong converting a command line string to a type." msgstr "" -#: ../../library/argparse.rst:2282 +#: ../../library/argparse.rst:2289 msgid "Guides and Tutorials" msgstr "" -#: ../../library/argparse.rst:896 +#: ../../library/argparse.rst:901 msgid "? (question mark)" msgstr "? (問號)" -#: ../../library/argparse.rst:896 ../../library/argparse.rst:928 -#: ../../library/argparse.rst:942 +#: ../../library/argparse.rst:901 ../../library/argparse.rst:933 +#: ../../library/argparse.rst:947 msgid "in argparse module" msgstr "於 argparse 模組中" -#: ../../library/argparse.rst:928 +#: ../../library/argparse.rst:933 msgid "* (asterisk)" msgstr "* (星號)" -#: ../../library/argparse.rst:942 +#: ../../library/argparse.rst:947 msgid "+ (plus)" msgstr "+ (加號)" diff --git a/library/asyncio-eventloop.po b/library/asyncio-eventloop.po index 0c8a655875..dcffc7ac43 100644 --- a/library/asyncio-eventloop.po +++ b/library/asyncio-eventloop.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-11-07 00:14+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-" @@ -94,8 +94,8 @@ msgid "" "If there is no running event loop set, the function will return the result " "of the ``get_event_loop_policy().get_event_loop()`` call." msgstr "" -"如果沒有設定正在運行的事件迴圈,該函式將回傳 " -"``get_event_loop_policy().get_event_loop()`` 呼叫的結果。" +"如果沒有設定正在運行的事件迴圈,該函式將回傳 ``get_event_loop_policy()." +"get_event_loop()`` 呼叫的結果。" #: ../../library/asyncio-eventloop.rst:53 msgid "" @@ -104,8 +104,8 @@ msgid "" "is preferred to :func:`get_event_loop` in coroutines and callbacks." msgstr "" "由於此函式具有相當複雜的行為(尤其是在使用自訂事件迴圈策略時),在協程和回呼" -"函式中,建議使用 :func:`get_running_loop` 函式,而不" -"是 :func:`get_event_loop`。" +"函式中,建議使用 :func:`get_running_loop` 函式,而不是 :func:" +"`get_event_loop`。" #: ../../library/asyncio-eventloop.rst:58 msgid "" @@ -124,8 +124,8 @@ msgstr "如果沒有目前的事件迴圈,則引發 :exc:`RuntimeError`。" msgid "" "The :mod:`!asyncio` policy system is deprecated and will be removed in " "Python 3.16; from there on, this function will return the current running " -"event loop if present else it will return the loop set " -"by :func:`set_event_loop`." +"event loop if present else it will return the loop set by :func:" +"`set_event_loop`." msgstr "" #: ../../library/asyncio-eventloop.rst:74 @@ -142,9 +142,9 @@ msgid "" "and :func:`new_event_loop` functions can be altered by :ref:`setting a " "custom event loop policy `." msgstr "" -"請注意 :func:`get_event_loop`、:func:`set_event_loop` " -"和 :func:`new_event_loop` 函式的行為可以透過\\ :ref:`設定自訂事件迴圈策略 " -"`\\ 進行調整。" +"請注意 :func:`get_event_loop`、:func:`set_event_loop` 和 :func:" +"`new_event_loop` 函式的行為可以透過\\ :ref:`設定自訂事件迴圈策略 `\\ 進行調整。" #: ../../library/asyncio-eventloop.rst:86 msgid "Contents" @@ -163,29 +163,29 @@ msgstr "" #: ../../library/asyncio-eventloop.rst:92 msgid "" -"The `Callback Handles`_ section documents the :class:`Handle` " -"and :class:`TimerHandle` instances which are returned from scheduling " -"methods such as :meth:`loop.call_soon` and :meth:`loop.call_later`;" +"The `Callback Handles`_ section documents the :class:`Handle` and :class:" +"`TimerHandle` instances which are returned from scheduling methods such as :" +"meth:`loop.call_soon` and :meth:`loop.call_later`;" msgstr "" -"`回呼處理 `_\\ 章節記錄了從排程方法" -"(如 :meth:`loop.call_soon` 和 :meth:`loop.call_later`)回傳" -"的 :class:`Handle` 和 :class:`TimerHandle` 實例;" +"`回呼處理 `_\\ 章節記錄了從排程方法(如 :meth:`loop." +"call_soon` 和 :meth:`loop.call_later`)回傳的 :class:`Handle` 和 :class:" +"`TimerHandle` 實例;" #: ../../library/asyncio-eventloop.rst:96 msgid "" "The `Server Objects`_ section documents types returned from event loop " "methods like :meth:`loop.create_server`;" msgstr "" -"`Server 物件 `_\\ 章節記錄了從事件迴圈方法" -"(如 :meth:`loop.create_server`)回傳的資料型別;" +"`Server 物件 `_\\ 章節記錄了從事件迴圈方法(如 :meth:`loop." +"create_server`)回傳的資料型別;" #: ../../library/asyncio-eventloop.rst:99 msgid "" -"The `Event Loop Implementations`_ section documents " -"the :class:`SelectorEventLoop` and :class:`ProactorEventLoop` classes;" +"The `Event Loop Implementations`_ section documents the :class:" +"`SelectorEventLoop` and :class:`ProactorEventLoop` classes;" msgstr "" -"`事件迴圈實作 `_\\ 章節記錄" -"了 :class:`SelectorEventLoop` 和 :class:`ProactorEventLoop` 類別;" +"`事件迴圈實作 `_\\ 章節記錄了 :class:" +"`SelectorEventLoop` 和 :class:`ProactorEventLoop` 類別;" #: ../../library/asyncio-eventloop.rst:102 msgid "" @@ -213,8 +213,8 @@ msgid "" "If the argument is a :ref:`coroutine object ` it is implicitly " "scheduled to run as a :class:`asyncio.Task`." msgstr "" -"如果引數是\\ :ref:`協程物件 `,則它將被隱式排程" -"為 :class:`asyncio.Task` 運行。" +"如果引數是\\ :ref:`協程物件 `,則它將被隱式排程為 :class:`asyncio." +"Task` 運行。" #: ../../library/asyncio-eventloop.rst:129 msgid "Return the Future's result or raise its exception." @@ -300,7 +300,7 @@ msgstr "請注意,使用 :func:`asyncio.run` 時不需要呼叫此函式。" #: ../../library/asyncio-eventloop.rst:183 #: ../../library/asyncio-eventloop.rst:1354 -#: ../../library/asyncio-eventloop.rst:1810 +#: ../../library/asyncio-eventloop.rst:1816 msgid "Example::" msgstr "範例: ::" @@ -322,13 +322,12 @@ msgstr "" msgid "" "Schedule the closure of the default executor and wait for it to join all of " "the threads in the :class:`~concurrent.futures.ThreadPoolExecutor`. Once " -"this method has been called, using the default executor " -"with :meth:`loop.run_in_executor` will raise a :exc:`RuntimeError`." +"this method has been called, using the default executor with :meth:`loop." +"run_in_executor` will raise a :exc:`RuntimeError`." msgstr "" -"排程預設執行器的關閉,並等待它加" -"入 :class:`~concurrent.futures.ThreadPoolExecutor` 中的所有執行緒。一旦呼叫了" -"此方法,使用預設執行器與 :meth:`loop.run_in_executor` 將引" -"發 :exc:`RuntimeError`。" +"排程預設執行器的關閉,並等待它加入 :class:`~concurrent.futures." +"ThreadPoolExecutor` 中的所有執行緒。一旦呼叫了此方法,使用預設執行器與 :meth:" +"`loop.run_in_executor` 將引發 :exc:`RuntimeError`。" #: ../../library/asyncio-eventloop.rst:202 msgid "" @@ -385,13 +384,12 @@ msgstr "回呼函式按照其註冊的順序呼叫。每個回呼函式將被呼 #: ../../library/asyncio-eventloop.rst:235 msgid "" -"The optional keyword-only *context* argument specifies a " -"custom :class:`contextvars.Context` for the *callback* to run in. Callbacks " -"use the current context when no *context* is provided." +"The optional keyword-only *context* argument specifies a custom :class:" +"`contextvars.Context` for the *callback* to run in. Callbacks use the " +"current context when no *context* is provided." msgstr "" -"選用的僅限關鍵字引數 *context* 指定了要給 *callback* 執行的自定" -"義 :class:`contextvars.Context`。當未提供 *context* 時,回呼函式使用目前情" -"境。" +"選用的僅限關鍵字引數 *context* 指定了要給 *callback* 執行的自定義 :class:" +"`contextvars.Context`。當未提供 *context* 時,回呼函式使用目前情境。" #: ../../library/asyncio-eventloop.rst:239 msgid "Unlike :meth:`call_soon_threadsafe`, this method is not thread-safe." @@ -497,27 +495,26 @@ msgstr "" #: ../../library/asyncio-eventloop.rst:299 msgid "" "The optional positional *args* will be passed to the callback when it is " -"called. If you want the callback to be called with keyword arguments " -"use :func:`functools.partial`." +"called. If you want the callback to be called with keyword arguments use :" +"func:`functools.partial`." msgstr "" "可選的位置引數 *args* 將在呼叫回呼函式時傳遞。如果要使用關鍵字引數呼叫回呼函" "數,請使用 :func:`functools.partial`。" #: ../../library/asyncio-eventloop.rst:303 msgid "" -"An optional keyword-only *context* argument allows specifying a " -"custom :class:`contextvars.Context` for the *callback* to run in. The " -"current context is used when no *context* is provided." +"An optional keyword-only *context* argument allows specifying a custom :" +"class:`contextvars.Context` for the *callback* to run in. The current " +"context is used when no *context* is provided." msgstr "" -"可選的僅限關鍵字 *context* 引數允許為 *callback* 指定自定義" -"的 :class:`contextvars.Context` 以提供運行。當未提供 *context* 時,將使用目前" -"情境。" +"可選的僅限關鍵字 *context* 引數允許為 *callback* 指定自定義的 :class:" +"`contextvars.Context` 以提供運行。當未提供 *context* 時,將使用目前情境。" #: ../../library/asyncio-eventloop.rst:309 msgid "" "For performance, callbacks scheduled with :meth:`loop.call_later` may run up " -"to one clock-resolution early (see " -"``time.get_clock_info('monotonic').resolution``)." +"to one clock-resolution early (see ``time.get_clock_info('monotonic')." +"resolution``)." msgstr "" #: ../../library/asyncio-eventloop.rst:317 @@ -533,8 +530,8 @@ msgid "" "Schedule *callback* to be called at the given absolute timestamp *when* (an " "int or a float), using the same time reference as :meth:`loop.time`." msgstr "" -"排程 *callback* 在給定的絕對時間戳 *when* (整數或浮點數)處呼叫,使用" -"與 :meth:`loop.time` 相同的時間參照。" +"排程 *callback* 在給定的絕對時間戳 *when* (整數或浮點數)處呼叫,使用與 :" +"meth:`loop.time` 相同的時間參照。" #: ../../library/asyncio-eventloop.rst:328 msgid "This method's behavior is the same as :meth:`call_later`." @@ -543,8 +540,8 @@ msgstr "此方法的行為與 :meth:`call_later` 相同。" #: ../../library/asyncio-eventloop.rst:335 msgid "" "For performance, callbacks scheduled with :meth:`loop.call_at` may run up to " -"one clock-resolution early (see " -"``time.get_clock_info('monotonic').resolution``)." +"one clock-resolution early (see ``time.get_clock_info('monotonic')." +"resolution``)." msgstr "" #: ../../library/asyncio-eventloop.rst:343 @@ -593,15 +590,15 @@ msgstr "" #: ../../library/asyncio-eventloop.rst:378 msgid "" -"Schedule the execution of :ref:`coroutine ` *coro*. Return " -"a :class:`Task` object." +"Schedule the execution of :ref:`coroutine ` *coro*. Return a :" +"class:`Task` object." msgstr "排程執行\\ :ref:`協程 ` *coro*。回傳 :class:`Task` 物件。" #: ../../library/asyncio-eventloop.rst:381 msgid "" "Third-party event loops can use their own subclass of :class:`Task` for " -"interoperability. In this case, the result type is a subclass " -"of :class:`Task`." +"interoperability. In this case, the result type is a subclass of :class:" +"`Task`." msgstr "" "第三方事件迴圈可以使用其自己的 :class:`Task` 子類別以實現互操作性" "(interoperability)。在這種情況下,結果類型是 :class:`Task` 的子類別。" @@ -618,25 +615,25 @@ msgid "" "If the *name* argument is provided and not ``None``, it is set as the name " "of the task using :meth:`Task.set_name`." msgstr "" -"如果提供了 *name* 引數且不為 ``None``,則將其設置為任務的名稱,使" -"用 :meth:`Task.set_name`。" +"如果提供了 *name* 引數且不為 ``None``,則將其設置為任務的名稱,使用 :meth:" +"`Task.set_name`。" #: ../../library/asyncio-eventloop.rst:392 msgid "" -"An optional keyword-only *context* argument allows specifying a " -"custom :class:`contextvars.Context` for the *coro* to run in. The current " -"context copy is created when no *context* is provided." +"An optional keyword-only *context* argument allows specifying a custom :" +"class:`contextvars.Context` for the *coro* to run in. The current context " +"copy is created when no *context* is provided." msgstr "" -"可選的僅限關鍵字 *context* 引數允許為 *coro* 指定自定義" -"的 :class:`contextvars.Context` 以提供運行。當未提供 *context* 時,將建立目前" -"情境的副本。" +"可選的僅限關鍵字 *context* 引數允許為 *coro* 指定自定義的 :class:" +"`contextvars.Context` 以提供運行。當未提供 *context* 時,將建立目前情境的副" +"本。" #: ../../library/asyncio-eventloop.rst:396 msgid "" "An optional keyword-only *eager_start* argument allows specifying if the " "task should execute eagerly during the call to create_task, or be scheduled " -"later. If *eager_start* is not passed the mode set " -"by :meth:`loop.set_task_factory` will be used." +"later. If *eager_start* is not passed the mode set by :meth:`loop." +"set_task_factory` will be used." msgstr "" #: ../../library/asyncio-eventloop.rst:401 @@ -715,12 +712,12 @@ msgstr "打開以 *host* 和 *port* 指定之給定地址的串流傳輸連線 #: ../../library/asyncio-eventloop.rst:459 msgid "" -"The socket family can be either :py:const:`~socket.AF_INET` " -"or :py:const:`~socket.AF_INET6` depending on *host* (or the *family* " -"argument, if provided)." +"The socket family can be either :py:const:`~socket.AF_INET` or :py:const:" +"`~socket.AF_INET6` depending on *host* (or the *family* argument, if " +"provided)." msgstr "" -"根據 *host*(或提供的 *family* 引數)的情況,socket 家族可以" -"是 :py:const:`~socket.AF_INET` 或 :py:const:`~socket.AF_INET6`。" +"根據 *host*(或提供的 *family* 引數)的情況,socket 家族可以是 :py:const:" +"`~socket.AF_INET` 或 :py:const:`~socket.AF_INET6`。" #: ../../library/asyncio-eventloop.rst:463 msgid "The socket type will be :py:const:`~socket.SOCK_STREAM`." @@ -755,16 +752,16 @@ msgstr "建立連線並為其建立\\ :ref:`傳輸 `。" #: ../../library/asyncio-eventloop.rst:476 msgid "" -"*protocol_factory* is called without arguments and is expected to return " -"a :ref:`protocol ` instance." +"*protocol_factory* is called without arguments and is expected to return a :" +"ref:`protocol ` instance." msgstr "" "*protocol_factory* 在無引數的情況下被呼叫,並且預計回傳一個 :ref:`協定 " "` 實例。" #: ../../library/asyncio-eventloop.rst:479 msgid "" -"The protocol instance is coupled with the transport by calling " -"its :meth:`~BaseProtocol.connection_made` method." +"The protocol instance is coupled with the transport by calling its :meth:" +"`~BaseProtocol.connection_made` method." msgstr "" "通過呼叫其 :meth:`~BaseProtocol.connection_made` 方法,將協定實例與傳輸連線在" "一起。" @@ -787,9 +784,9 @@ msgstr "其他引數:" msgid "" "*ssl*: if given and not false, a SSL/TLS transport is created (by default a " "plain TCP transport is created). If *ssl* is a :class:`ssl.SSLContext` " -"object, this context is used to create the transport; if *ssl* " -"is :const:`True`, a default context returned " -"from :func:`ssl.create_default_context` is used." +"object, this context is used to create the transport; if *ssl* is :const:" +"`True`, a default context returned from :func:`ssl.create_default_context` " +"is used." msgstr "" "若有給定 *ssl* 且非 false,將建立 SSL/TLS 傳輸(預設建立普通 TCP 傳輸)。如" "果 *ssl* 為 :class:`ssl.SSLContext` 物件,則使用該情境來建立傳輸;如果 *ssl* " @@ -835,9 +832,9 @@ msgid "" "the RFC is ``0.25`` (250 milliseconds)." msgstr "" "若有給定,*happy_eyeballs_delay* 會啟用此連線的 Happy Eyeballs。它應該是一個" -"浮點數,表示等待連線嘗試完成的秒數,然後在並行啟動下一次嘗試。這" -"是 :rfc:`8305` 中定義的「連線嘗試延遲」。RFC 建議的合理預設值為 ``0.25`` 秒" -"(250 毫秒)。" +"浮點數,表示等待連線嘗試完成的秒數,然後在並行啟動下一次嘗試。這是 :rfc:" +"`8305` 中定義的「連線嘗試延遲」。RFC 建議的合理預設值為 ``0.25`` 秒(250 毫" +"秒)。" #: ../../library/asyncio-eventloop.rst:518 msgid "" @@ -857,10 +854,10 @@ msgstr "" #: ../../library/asyncio-eventloop.rst:527 msgid "" -"*sock*, if given, should be an existing, already " -"connected :class:`socket.socket` object to be used by the transport. If " -"*sock* is given, none of *host*, *port*, *family*, *proto*, *flags*, " -"*happy_eyeballs_delay*, *interleave* and *local_addr* should be specified." +"*sock*, if given, should be an existing, already connected :class:`socket." +"socket` object to be used by the transport. If *sock* is given, none of " +"*host*, *port*, *family*, *proto*, *flags*, *happy_eyeballs_delay*, " +"*interleave* and *local_addr* should be specified." msgstr "" "若有給定 *sock* 則其應為已存在且已連線的 :class:`socket.socket` 物件,可供傳" "輸使用。如果提供了 *sock*,則不應指定 *host*、*port*、*family*、*proto*、" @@ -871,11 +868,11 @@ msgstr "" #: ../../library/asyncio-eventloop.rst:905 msgid "" "The *sock* argument transfers ownership of the socket to the transport " -"created. To close the socket, call the " -"transport's :meth:`~asyncio.BaseTransport.close` method." +"created. To close the socket, call the transport's :meth:`~asyncio." +"BaseTransport.close` method." msgstr "" -"引數 *sock* 將 socket 所有權轉移給所建立的傳輸 socket,請呼叫傳輸" -"的 :meth:`~asyncio.BaseTransport.close` 方法。" +"引數 *sock* 將 socket 所有權轉移給所建立的傳輸 socket,請呼叫傳輸的 :meth:" +"`~asyncio.BaseTransport.close` 方法。" #: ../../library/asyncio-eventloop.rst:539 msgid "" @@ -985,9 +982,8 @@ msgid "" "returns a pair of (:class:`StreamReader`, :class:`StreamWriter`) that can be " "used directly in async/await code." msgstr "" -"函式 :func:`open_connection` 是高階的替代 API。它回傳一對 " -"(:class:`StreamReader`, :class:`StreamWriter`) 可直接在 async/await 程式碼中" -"使用。" +"函式 :func:`open_connection` 是高階的替代 API。它回傳一對 (:class:" +"`StreamReader`, :class:`StreamWriter`) 可直接在 async/await 程式碼中使用。" #: ../../library/asyncio-eventloop.rst:607 msgid "Create a datagram connection." @@ -995,10 +991,9 @@ msgstr "建立一個資料報連線。" #: ../../library/asyncio-eventloop.rst:609 msgid "" -"The socket family can be " -"either :py:const:`~socket.AF_INET`, :py:const:`~socket.AF_INET6`, " -"or :py:const:`~socket.AF_UNIX`, depending on *host* (or the *family* " -"argument, if provided)." +"The socket family can be either :py:const:`~socket.AF_INET`, :py:const:" +"`~socket.AF_INET6`, or :py:const:`~socket.AF_UNIX`, depending on *host* (or " +"the *family* argument, if provided)." msgstr "" "Socket 家族可以是 :py:const:`~socket.AF_INET`、:py:const:`~socket.AF_INET6` " "或 :py:const:`~socket.AF_UNIX`,視乎 *host*\\ (或提供的 *family* 引數)而" @@ -1026,17 +1021,16 @@ msgstr "成功時回傳 ``(transport, protocol)`` 元組。" #: ../../library/asyncio-eventloop.rst:622 msgid "" "*local_addr*, if given, is a ``(local_host, local_port)`` tuple used to bind " -"the socket locally. The *local_host* and *local_port* are looked up " -"using :meth:`getaddrinfo`." +"the socket locally. The *local_host* and *local_port* are looked up using :" +"meth:`getaddrinfo`." msgstr "" "*local_addr*,如果提供,是一個 ``(local_host, local_port)`` 元組,用於在本地" "綁定 socket。*local_host* 和 *local_port* 使用 :meth:`getaddrinfo` 來查找。" #: ../../library/asyncio-eventloop.rst:628 msgid "" -"On Windows, when using the proactor event loop with ``local_addr=None``, " -"an :exc:`OSError` with :attr:`!errno.WSAEINVAL` will be raised when running " -"it." +"On Windows, when using the proactor event loop with ``local_addr=None``, an :" +"exc:`OSError` with :attr:`!errno.WSAEINVAL` will be raised when running it." msgstr "" #: ../../library/asyncio-eventloop.rst:632 @@ -1046,8 +1040,8 @@ msgid "" "are looked up using :meth:`getaddrinfo`." msgstr "" "*remote_addr*,如果提供,是一個 ``(remote_host, remote_port)`` 元組,用於將 " -"socket 連線到遠端位址。 *remote_host* 和 *remote_port* 使" -"用 :meth:`getaddrinfo` 來查找。" +"socket 連線到遠端位址。 *remote_host* 和 *remote_port* 使用 :meth:" +"`getaddrinfo` 來查找。" #: ../../library/asyncio-eventloop.rst:636 msgid "" @@ -1069,8 +1063,8 @@ msgid "" "is not defined then this capability is unsupported." msgstr "" "*reuse_port* 告訴核心允許將此端點綁定到與其他現有端點相同的埠,只要它們在建立" -"時都設定了此旗標。此選項不受 Windows 和某些 Unix 系統支援。如果未定" -"義 :py:const:`~socket.SO_REUSEPORT` 常數,則不支援此功能。" +"時都設定了此旗標。此選項不受 Windows 和某些 Unix 系統支援。如果未定義 :py:" +"const:`~socket.SO_REUSEPORT` 常數,則不支援此功能。" #: ../../library/asyncio-eventloop.rst:647 msgid "" @@ -1082,21 +1076,20 @@ msgstr "*allow_broadcast* 告訴核心允許此端點向廣播位址發送訊息 msgid "" "*sock* can optionally be specified in order to use a preexisting, already " "connected, :class:`socket.socket` object to be used by the transport. If " -"specified, *local_addr* and *remote_addr* should be omitted (must " -"be :const:`None`)." +"specified, *local_addr* and *remote_addr* should be omitted (must be :const:" +"`None`)." msgstr "" "*sock* 可以選擇性地指定,以使用預先存在且已連線的 :class:`socket.socket` 物件" -"供傳輸使用。如果指定,*local_addr* 和 *remote_addr* 應省略(必須" -"是 :const:`None`\\ )。" +"供傳輸使用。如果指定,*local_addr* 和 *remote_addr* 應省略(必須是 :const:" +"`None`\\ )。" #: ../../library/asyncio-eventloop.rst:661 msgid "" -"See :ref:`UDP echo client protocol ` " -"and :ref:`UDP echo server protocol ` " -"examples." +"See :ref:`UDP echo client protocol ` and :" +"ref:`UDP echo server protocol ` examples." msgstr "" -"請參閱 :ref:`UDP 回應用戶端協定 ` " -"和 :ref:`UDP 回應伺服器協定 ` 範例。" +"請參閱 :ref:`UDP 回應用戶端協定 ` 和 :ref:" +"`UDP 回應伺服器協定 ` 範例。" #: ../../library/asyncio-eventloop.rst:664 msgid "" @@ -1112,10 +1105,9 @@ msgstr "新增對於 Windows 的支援。" #: ../../library/asyncio-eventloop.rst:671 msgid "" -"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." +"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 "" "不再支援 *reuse_address* 參數,因為使用 :py:const:`~sockets.SO_REUSEADDR` 對" "於 UDP 存有重大的安全疑慮。明確傳遞 ``reuse_address=True`` 將引發例外。" @@ -1153,18 +1145,17 @@ msgstr "建立一個 Unix 連線。" #: ../../library/asyncio-eventloop.rst:700 msgid "" -"The socket family will be :py:const:`~socket.AF_UNIX`; socket type will " -"be :py:const:`~socket.SOCK_STREAM`." +"The socket family will be :py:const:`~socket.AF_UNIX`; socket type will be :" +"py:const:`~socket.SOCK_STREAM`." msgstr "" -"Socket 家族將為 :py:const:`~socket.AF_UNIX`;socket 類型將" -"為 :py:const:`~socket.SOCK_STREAM`。" +"Socket 家族將為 :py:const:`~socket.AF_UNIX`;socket 類型將為 :py:const:" +"`~socket.SOCK_STREAM`。" #: ../../library/asyncio-eventloop.rst:705 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." +"parameter is specified. Abstract Unix sockets, :class:`str`, :class:" +"`bytes`, and :class:`~pathlib.Path` paths are supported." msgstr "" "*path* 是 Unix 域 socket 的名稱,除非指定 *sock* 參數,否則為必填。支援抽象 " "Unix sockets、:class:`str`、:class:`bytes` 和 :class:`~pathlib.Path` 路徑。" @@ -1179,8 +1170,8 @@ msgstr "" #: ../../library/asyncio-eventloop.rst:713 #: ../../library/asyncio-eventloop.rst:869 #: ../../library/asyncio-eventloop.rst:1334 -#: ../../library/asyncio-eventloop.rst:1880 -#: ../../library/asyncio-eventloop.rst:1887 +#: ../../library/asyncio-eventloop.rst:1886 +#: ../../library/asyncio-eventloop.rst:1893 msgid "Availability" msgstr "可用性" @@ -1252,14 +1243,13 @@ msgstr "" #: ../../library/asyncio-eventloop.rst:769 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`)." +"*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 "" "*family* 可以設定為 :const:`socket.AF_INET` 或 :const:`~socket.AF_INET6` 以強" -"制使用 IPv4 或 IPv6。如果未設定,*family* 將從主機名稱決定(預設" -"為 :const:`~socket.AF_UNSPEC`\\ )。" +"制使用 IPv4 或 IPv6。如果未設定,*family* 將從主機名稱決定(預設為 :const:" +"`~socket.AF_UNSPEC`\\ )。" #: ../../library/asyncio-eventloop.rst:774 msgid "*flags* is a bitmask for :meth:`getaddrinfo`." @@ -1283,8 +1273,8 @@ msgstr "" #: ../../library/asyncio-eventloop.rst:785 msgid "" -"*backlog* is the maximum number of queued connections passed " -"to :meth:`~socket.socket.listen` (defaults to 100)." +"*backlog* is the maximum number of queued connections passed to :meth:" +"`~socket.socket.listen` (defaults to 100)." msgstr "" "*backlog* 是傳遞給 :meth:`~socket.socket.listen` 的最大佇列連線數(預設為 " "100)。" @@ -1341,8 +1331,8 @@ msgid "" "to make the server to start accepting connections." msgstr "" "將 *start_serving* 設置為 ``True``\\ (預設)將使建立的伺服器立即開始接受連" -"接。當設置為 ``False`` 時,用戶應該等待 :meth:`Server.start_serving` " -"或 :meth:`Server.serve_forever` 來使伺服器開始接受連線。" +"接。當設置為 ``False`` 時,用戶應該等待 :meth:`Server.start_serving` 或 :" +"meth:`Server.serve_forever` 來使伺服器開始接受連線。" #: ../../library/asyncio-eventloop.rst:828 msgid "The *host* parameter can be a sequence of strings." @@ -1354,8 +1344,8 @@ msgid "" "option :ref:`socket.TCP_NODELAY ` is set by default " "for all TCP connections." msgstr "" -"新增 *ssl_handshake_timeout* 與 *start_serving* 參數。所有 TCP 連線都預設" -"有 :ref:`socket.TCP_NODELAY ` socket 選項。" +"新增 *ssl_handshake_timeout* 與 *start_serving* 參數。所有 TCP 連線都預設有 :" +"ref:`socket.TCP_NODELAY ` socket 選項。" #: ../../library/asyncio-eventloop.rst:842 msgid "" @@ -1363,14 +1353,13 @@ msgid "" "returns a pair of :class:`StreamReader` and :class:`StreamWriter` that can " "be used in an async/await code." msgstr "" -":func:`start_server` 函式是一個更高階的替代 API,它回傳一" -"對 :class:`StreamReader` 和 :class:`StreamWriter`,可以在 async/await 程式碼" -"中使用。" +":func:`start_server` 函式是一個更高階的替代 API,它回傳一對 :class:" +"`StreamReader` 和 :class:`StreamWriter`,可以在 async/await 程式碼中使用。" #: ../../library/asyncio-eventloop.rst:854 msgid "" -"Similar to :meth:`loop.create_server` but works with " -"the :py:const:`~socket.AF_UNIX` socket family." +"Similar to :meth:`loop.create_server` but works with the :py:const:`~socket." +"AF_UNIX` socket family." msgstr "" "類似 :meth:`loop.create_server`,但適用於 :py:const:`~socket.AF_UNIX` socket " "家族。" @@ -1498,8 +1487,8 @@ msgid "" "Raise :exc:`SendfileNotAvailableError` if the system does not support the " "*sendfile* syscall and *fallback* is ``False``." msgstr "" -"如果系統不支援 *sendfile* 系統呼叫且 *fallback* 為 ``False``,則引" -"發 :exc:`SendfileNotAvailableError`。" +"如果系統不支援 *sendfile* 系統呼叫且 *fallback* 為 ``False``,則引發 :exc:" +"`SendfileNotAvailableError`。" #: ../../library/asyncio-eventloop.rst:965 msgid "TLS Upgrade" @@ -1537,11 +1526,11 @@ msgstr "在某些情況下(例如傳入的傳輸已經關閉),此函式可 #: ../../library/asyncio-eventloop.rst:989 msgid "" -"*transport* and *protocol* instances that methods " -"like :meth:`~loop.create_server` and :meth:`~loop.create_connection` return." +"*transport* and *protocol* instances that methods like :meth:`~loop." +"create_server` and :meth:`~loop.create_connection` return." msgstr "" -"*transport* 和 *protocol* 實例,由像 :meth:`~loop.create_server` " -"和 :meth:`~loop.create_connection` 等方法回傳。" +"*transport* 和 *protocol* 實例,由像 :meth:`~loop.create_server` 和 :meth:" +"`~loop.create_connection` 等方法回傳。" #: ../../library/asyncio-eventloop.rst:993 msgid "*sslcontext*: a configured instance of :class:`~ssl.SSLContext`." @@ -1627,20 +1616,20 @@ msgstr "直接使用 socket 物件" #: ../../library/asyncio-eventloop.rst:1058 msgid "" -"In general, protocol implementations that use transport-based APIs such " -"as :meth:`loop.create_connection` and :meth:`loop.create_server` are faster " -"than implementations that work with sockets directly. However, there are " -"some use cases when performance is not critical, and working " -"with :class:`~socket.socket` objects directly is more convenient." +"In general, protocol implementations that use transport-based APIs such as :" +"meth:`loop.create_connection` and :meth:`loop.create_server` are faster than " +"implementations that work with sockets directly. However, there are some use " +"cases when performance is not critical, and working with :class:`~socket." +"socket` objects directly is more convenient." msgstr "" -"一般情況下,使用基於傳輸的 API(如 :meth:`loop.create_connection` " -"和 :meth:`loop.create_server`)的協定實作比直接使用 socket 的實作更快。然而在" -"某些情況下性能不是關鍵,直接使用 :class:`~socket.socket` 物件更方便。" +"一般情況下,使用基於傳輸的 API(如 :meth:`loop.create_connection` 和 :meth:" +"`loop.create_server`)的協定實作比直接使用 socket 的實作更快。然而在某些情況" +"下性能不是關鍵,直接使用 :class:`~socket.socket` 物件更方便。" #: ../../library/asyncio-eventloop.rst:1068 msgid "" -"Receive up to *nbytes* from *sock*. Asynchronous version " -"of :meth:`socket.recv() `." +"Receive up to *nbytes* from *sock*. Asynchronous version of :meth:`socket." +"recv() `." msgstr "" "從 *sock* 接收最多 *nbytes*。:meth:`socket.recv() ` 的非" "同步版本。" @@ -1672,8 +1661,8 @@ msgstr "" #: ../../library/asyncio-eventloop.rst:1083 msgid "" -"Receive data from *sock* into the *buf* buffer. Modeled after the " -"blocking :meth:`socket.recv_into() ` method." +"Receive data from *sock* into the *buf* buffer. Modeled after the blocking :" +"meth:`socket.recv_into() ` method." msgstr "" "從 *sock* 接收資料到 *buf* 緩衝區。仿照阻塞 :meth:`socket.recv_into() " "` 方法。" @@ -1684,8 +1673,8 @@ msgstr "回傳寫入緩衝區位元組的數目。" #: ../../library/asyncio-eventloop.rst:1095 msgid "" -"Receive a datagram of up to *bufsize* from *sock*. Asynchronous version " -"of :meth:`socket.recvfrom() `." +"Receive a datagram of up to *bufsize* from *sock*. Asynchronous version of :" +"meth:`socket.recvfrom() `." msgstr "" "從 *sock* 接收最多 *bufsize* 大小的資料單元。:meth:`socket.recvfrom() " "` 的非同步版本。" @@ -1699,9 +1688,8 @@ msgid "" "Receive a datagram of up to *nbytes* from *sock* into *buf*. Asynchronous " "version of :meth:`socket.recvfrom_into() `." msgstr "" -"從 *sock* 接收最多 *nbytes* 大小的資料單元到 " -"*buf*。:meth:`socket.recvfrom_into() ` 的非同步" -"版本。" +"從 *sock* 接收最多 *nbytes* 大小的資料單元到 *buf*。:meth:`socket." +"recvfrom_into() ` 的非同步版本。" #: ../../library/asyncio-eventloop.rst:1111 msgid "Return a tuple of (number of bytes received, remote address)." @@ -1709,11 +1697,11 @@ msgstr "回傳一個元組 (number of bytes received, remote address)。" #: ../../library/asyncio-eventloop.rst:1120 msgid "" -"Send *data* to the *sock* socket. Asynchronous version " -"of :meth:`socket.sendall() `." +"Send *data* to the *sock* socket. Asynchronous version of :meth:`socket." +"sendall() `." msgstr "" -"將 *data* 發送到 *sock* socket。:meth:`socket.sendall() " -"` 的非同步版本。" +"將 *data* 發送到 *sock* socket。:meth:`socket.sendall() ` 的非同步版本。" #: ../../library/asyncio-eventloop.rst:1123 msgid "" @@ -1739,11 +1727,11 @@ msgstr "" #: ../../library/asyncio-eventloop.rst:1139 msgid "" -"Send a datagram from *sock* to *address*. Asynchronous version " -"of :meth:`socket.sendto() `." +"Send a datagram from *sock* to *address*. Asynchronous version of :meth:" +"`socket.sendto() `." msgstr "" -"從 *sock* 向 *address* 發送一個資料單元。:meth:`socket.sendto() " -"` 的非同步版本。" +"從 *sock* 向 *address* 發送一個資料單元。:meth:`socket.sendto() ` 的非同步版本。" #: ../../library/asyncio-eventloop.rst:1143 msgid "Return the number of bytes sent." @@ -1761,13 +1749,13 @@ msgstr ":meth:`socket.connect() ` 的非同步版本。" #: ../../library/asyncio-eventloop.rst:1158 msgid "" "``address`` no longer needs to be resolved. ``sock_connect`` will try to " -"check if the *address* is already resolved by " -"calling :func:`socket.inet_pton`. If not, :meth:`loop.getaddrinfo` will be " -"used to resolve the *address*." +"check if the *address* is already resolved by calling :func:`socket." +"inet_pton`. If not, :meth:`loop.getaddrinfo` will be used to resolve the " +"*address*." msgstr "" -"不再需要解析 ``address``。``sock_connect`` 將嘗試透過呼" -"叫 :func:`socket.inet_pton` 檢查 *address* 是否已解析。如果沒有,將使" -"用 :meth:`loop.getaddrinfo` 解析 *address*。" +"不再需要解析 ``address``。``sock_connect`` 將嘗試透過呼叫 :func:`socket." +"inet_pton` 檢查 *address* 是否已解析。如果沒有,將使用 :meth:`loop." +"getaddrinfo` 解析 *address*。" #: ../../library/asyncio-eventloop.rst:1167 msgid "" @@ -1814,8 +1802,8 @@ msgstr ":meth:`socket.sendfile() ` 的非同步版本。 #: ../../library/asyncio-eventloop.rst:1203 msgid "" -"*sock* must be a non-" -"blocking :const:`socket.SOCK_STREAM` :class:`~socket.socket`." +"*sock* must be a non-blocking :const:`socket.SOCK_STREAM` :class:`~socket." +"socket`." msgstr "" "*sock* 必須是非阻塞的 :const:`socket.SOCK_STREAM` :class:`~socket.socket`。" @@ -1837,8 +1825,8 @@ msgid "" "Raise :exc:`SendfileNotAvailableError` if the system does not support " "*sendfile* syscall and *fallback* is ``False``." msgstr "" -"如果系統不支援 *sendfile* 系統呼叫且 *fallback* 為 ``False``,引" -"發 :exc:`SendfileNotAvailableError`。" +"如果系統不支援 *sendfile* 系統呼叫且 *fallback* 為 ``False``,引發 :exc:" +"`SendfileNotAvailableError`。" #: ../../library/asyncio-eventloop.rst:1228 msgid "DNS" @@ -1865,9 +1853,9 @@ msgstr "" #: ../../library/asyncio-eventloop.rst:1249 msgid "" "Both *getaddrinfo* and *getnameinfo* methods were always documented to " -"return a coroutine, but prior to Python 3.7 they were, in fact, " -"returning :class:`asyncio.Future` objects. Starting with Python 3.7 both " -"methods are coroutines." +"return a coroutine, but prior to Python 3.7 they were, in fact, returning :" +"class:`asyncio.Future` objects. Starting with Python 3.7 both methods are " +"coroutines." msgstr "" "*getaddrinfo* 和 *getnameinfo* 方法一直被記錄為回傳協程,但在 Python 3.7 之前" "它們實際上回傳 :class:`asyncio.Future` 物件。從 Python 3.7 開始,兩個方法都是" @@ -1887,13 +1875,12 @@ msgstr "*pipe* 是 :term:`類檔案物件 `。" #: ../../library/asyncio-eventloop.rst:1269 msgid "" -"Return pair ``(transport, protocol)``, where *transport* supports " -"the :class:`ReadTransport` interface and *protocol* is an object " -"instantiated by the *protocol_factory*." +"Return pair ``(transport, protocol)``, where *transport* supports the :class:" +"`ReadTransport` interface and *protocol* is an object instantiated by the " +"*protocol_factory*." msgstr "" -"回傳 ``(transport, protocol)`` 對,其中 *transport* 支" -"援 :class:`ReadTransport` 介面,*protocol* 是由 *protocol_factory* 實例化的物" -"件。" +"回傳 ``(transport, protocol)`` 對,其中 *transport* 支援 :class:" +"`ReadTransport` 介面,*protocol* 是由 *protocol_factory* 實例化的物件。" #: ../../library/asyncio-eventloop.rst:1273 #: ../../library/asyncio-eventloop.rst:1290 @@ -1912,21 +1899,20 @@ msgstr "*pipe* 是 :term:`file-like object `。" #: ../../library/asyncio-eventloop.rst:1286 msgid "" -"Return pair ``(transport, protocol)``, where *transport* " -"supports :class:`WriteTransport` interface and *protocol* is an object " -"instantiated by the *protocol_factory*." +"Return pair ``(transport, protocol)``, where *transport* supports :class:" +"`WriteTransport` interface and *protocol* is an object instantiated by the " +"*protocol_factory*." msgstr "" -"回傳 ``(transport, protocol)`` 對,其中 *transport* 支" -"援 :class:`WriteTransport` 介面,*protocol* 是由 *protocol_factory* 實例化的" -"物件。" +"回傳 ``(transport, protocol)`` 對,其中 *transport* 支援 :class:" +"`WriteTransport` 介面,*protocol* 是由 *protocol_factory* 實例化的物件。" #: ../../library/asyncio-eventloop.rst:1295 msgid "" ":class:`SelectorEventLoop` does not support the above methods on Windows. " "Use :class:`ProactorEventLoop` instead for Windows." msgstr "" -":class:`SelectorEventLoop` 在 Windows 上不支援上述方法。對於 Windows 請使" -"用 :class:`ProactorEventLoop`。" +":class:`SelectorEventLoop` 在 Windows 上不支援上述方法。對於 Windows 請使用 :" +"class:`ProactorEventLoop`。" #: ../../library/asyncio-eventloop.rst:1300 msgid "" @@ -2054,10 +2040,10 @@ msgid "" "used by :class:`~concurrent.futures.ProcessPoolExecutor`. See :ref:`Safe " "importing of main module `." msgstr "" -"請注意,由於 :mod:`multiprocessing`\\ " -"(由 :class:`~concurrent.futures.ProcessPoolExecutor` 使用)的特殊性,選項 3 " -"需要進入點保護(\\ ``if __name__ == '__main__'``\\ )。請參閱\\ :ref:`主模組" -"的安全引入 `。" +"請注意,由於 :mod:`multiprocessing`\\ (由 :class:`~concurrent.futures." +"ProcessPoolExecutor` 使用)的特殊性,選項 3 需要進入點保護(\\ ``if __name__ " +"== '__main__'``\\ )。請參閱\\ :ref:`主模組的安全引入 `。" #: ../../library/asyncio-eventloop.rst:1407 msgid "This method returns a :class:`asyncio.Future` object." @@ -2079,24 +2065,24 @@ msgid "" "default." msgstr "" ":meth:`loop.run_in_executor` 不再配置它建立的執行緒池執行器的 " -"``max_workers``,而是讓執行緒池執行器" -"(\\ :class:`~concurrent.futures.ThreadPoolExecutor`)設定預設值。" +"``max_workers``,而是讓執行緒池執行器(\\ :class:`~concurrent.futures." +"ThreadPoolExecutor`)設定預設值。" #: ../../library/asyncio-eventloop.rst:1421 msgid "" "Set *executor* as the default executor used by :meth:`run_in_executor`. " -"*executor* must be an instance " -"of :class:`~concurrent.futures.ThreadPoolExecutor`, which " -"includes :class:`~concurrent.futures.InterpreterPoolExecutor`." +"*executor* must be an instance of :class:`~concurrent.futures." +"ThreadPoolExecutor`, which includes :class:`~concurrent.futures." +"InterpreterPoolExecutor`." msgstr "" "將 *executor* 設置為 :meth:`run_in_executor` 使用的預設執行器。*executor* 必" -"須是 :class:`~concurrent.futures.ThreadPoolExecutor`\\ " -"(也包含 :class:`~concurrent.futures.InterpreterPoolExecutor`)的實例。" +"須是 :class:`~concurrent.futures.ThreadPoolExecutor`\\ (也包含 :class:" +"`~concurrent.futures.InterpreterPoolExecutor`)的實例。" #: ../../library/asyncio-eventloop.rst:1426 msgid "" -"*executor* must be an instance " -"of :class:`~concurrent.futures.ThreadPoolExecutor`." +"*executor* must be an instance of :class:`~concurrent.futures." +"ThreadPoolExecutor`." msgstr "" "*executor* 必須是 :class:`~concurrent.futures.ThreadPoolExecutor` 的實例。" @@ -2127,9 +2113,9 @@ msgstr "" #: ../../library/asyncio-eventloop.rst:1448 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." +"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 "" "如果代表 :class:`~asyncio.Task` 或 :class:`~asyncio.Handle` 呼叫處理程式,它" "將在該任務或回呼處理程式的 :class:`contextvars.Context` 中運行。" @@ -2164,8 +2150,8 @@ msgstr "" #: ../../library/asyncio-eventloop.rst:1472 msgid "" -"*context* parameter has the same meaning as " -"in :meth:`call_exception_handler`." +"*context* parameter has the same meaning as in :meth:" +"`call_exception_handler`." msgstr "*context* 參數與 :meth:`call_exception_handler` 中的意思相同。" #: ../../library/asyncio-eventloop.rst:1477 @@ -2233,8 +2219,8 @@ msgid "" "This method should not be overloaded in subclassed event loops. For custom " "exception handling, use the :meth:`set_exception_handler` method." msgstr "" -"此方法不應在子類別事件迴圈中被覆寫。為了自定義例外處理,請使" -"用 :meth:`set_exception_handler` 方法。" +"此方法不應在子類別事件迴圈中被覆寫。為了自定義例外處理,請使用 :meth:" +"`set_exception_handler` 方法。" #: ../../library/asyncio-eventloop.rst:1502 msgid "Enabling debug mode" @@ -2246,9 +2232,8 @@ msgstr "取得事件迴圈的除錯模式(\\ :class:`bool`\\ )。" #: ../../library/asyncio-eventloop.rst:1508 msgid "" -"The default value is ``True`` if the environment " -"variable :envvar:`PYTHONASYNCIODEBUG` is set to a non-empty string, " -"``False`` otherwise." +"The default value is ``True`` if the environment variable :envvar:" +"`PYTHONASYNCIODEBUG` is set to a non-empty string, ``False`` otherwise." msgstr "" "如果環境變數 :envvar:`PYTHONASYNCIODEBUG` 被設定為非空字串,則預設值為 " "``True``,否則為 ``False``。" @@ -2269,8 +2254,8 @@ msgid "" "that is considered \"slow\". When debug mode is enabled, \"slow\" callbacks " "are logged." msgstr "" -"此屬性可用於設定被視為\"慢\"的最短執行時間(以秒為單位)。啟用偵錯模式後," -"\"慢\"回呼將被記錄。" +"此屬性可用於設定被視為\"慢\"的最短執行時間(以秒為單位)。啟用偵錯模式" +"後,\"慢\"回呼將被記錄。" #: ../../library/asyncio-eventloop.rst:1527 msgid "Default value is 100 milliseconds." @@ -2290,20 +2275,19 @@ msgid "" "code consider using the high-level :func:`asyncio.create_subprocess_shell` " "and :func:`asyncio.create_subprocess_exec` convenience functions instead." msgstr "" -"本小節描述的方法是低階的。在常規的 async/await 程式碼中,請考慮使用高" -"階 :func:`asyncio.create_subprocess_shell` " -"和 :func:`asyncio.create_subprocess_exec` 輔助功能而不是。" +"本小節描述的方法是低階的。在常規的 async/await 程式碼中,請考慮使用高階 :" +"func:`asyncio.create_subprocess_shell` 和 :func:`asyncio." +"create_subprocess_exec` 輔助功能而不是。" #: ../../library/asyncio-eventloop.rst:1544 msgid "" "On Windows, the default event loop :class:`ProactorEventLoop` supports " -"subprocesses, whereas :class:`SelectorEventLoop` does not. " -"See :ref:`Subprocess Support on Windows ` for " -"details." +"subprocesses, whereas :class:`SelectorEventLoop` does not. See :ref:" +"`Subprocess Support on Windows ` for details." msgstr "" -"在 Windows 上,預設事件迴圈 :class:`ProactorEventLoop` 支援子行程," -"而 :class:`SelectorEventLoop` 不支援。詳細資訊請參見 :ref:`Windows 上對於子行" -"程的支援 `。" +"在 Windows 上,預設事件迴圈 :class:`ProactorEventLoop` 支援子行程,而 :class:" +"`SelectorEventLoop` 不支援。詳細資訊請參見 :ref:`Windows 上對於子行程的支援 " +"`。" #: ../../library/asyncio-eventloop.rst:1556 msgid "" @@ -2346,8 +2330,8 @@ msgstr "" #: ../../library/asyncio-eventloop.rst:1575 msgid "" -"The *protocol_factory* must be a callable returning a subclass of " -"the :class:`asyncio.SubprocessProtocol` class." +"The *protocol_factory* must be a callable returning a subclass of the :class:" +"`asyncio.SubprocessProtocol` class." msgstr "" "*protocol_factory* 必須是回傳 :class:`asyncio.SubprocessProtocol` 子類別的可" "呼叫物件。" @@ -2392,8 +2376,8 @@ msgstr "值 ``None`` 將使子行程從此行程繼承檔案描述器" #: ../../library/asyncio-eventloop.rst:1598 #: ../../library/asyncio-eventloop.rst:1608 msgid "" -"the :const:`subprocess.DEVNULL` constant which indicates that the " -"special :data:`os.devnull` file will be used" +"the :const:`subprocess.DEVNULL` constant which indicates that the special :" +"data:`os.devnull` file will be used" msgstr "" ":const:`subprocess.DEVNULL` 常數,表示將使用特殊的 :data:`os.devnull` 檔案" @@ -2434,13 +2418,13 @@ msgstr "" #: ../../library/asyncio-eventloop.rst:1622 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:`~loop.connect_write_pipe` or :meth:`~loop.connect_read_pipe` for " -"use with the event loop." +"pipe, then the other side of this pipe should be registered with :meth:" +"`~loop.connect_write_pipe` or :meth:`~loop.connect_read_pipe` for use with " +"the event loop." msgstr "" "如果傳遞給 *stdin*、*stdout* 或 *stderr* 的類檔案物件表示管道,則該管道的另一" -"端應該使用 :meth:`~loop.connect_write_pipe` " -"或 :meth:`~loop.connect_read_pipe` 註冊到事件迴圈中。" +"端應該使用 :meth:`~loop.connect_write_pipe` 或 :meth:`~loop." +"connect_read_pipe` 註冊到事件迴圈中。" #: ../../library/asyncio-eventloop.rst:1627 msgid "" @@ -2454,20 +2438,27 @@ msgid "" "the :class:`asyncio.SubprocessTransport` base class and *protocol* is an " "object instantiated by the *protocol_factory*." msgstr "" -"回傳 ``(transport, protocol)`` 對,其中 *transport* 符" -"合 :class:`asyncio.SubprocessTransport` 基底類別,*protocol* 是由 " -"*protocol_factory* 實例化的物件。" +"回傳 ``(transport, protocol)`` 對,其中 *transport* 符合 :class:`asyncio." +"SubprocessTransport` 基底類別,*protocol* 是由 *protocol_factory* 實例化的物" +"件。" + +#: ../../library/asyncio-eventloop.rst:1634 +#: ../../library/asyncio-eventloop.rst:1660 +msgid "" +"If the transport is closed or is garbage collected, the child process is " +"killed if it is still running." +msgstr "" -#: ../../library/asyncio-eventloop.rst:1639 +#: ../../library/asyncio-eventloop.rst:1642 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 "" "使用平台的 \"shell\" 語法從 *cmd* 建立子行程,*cmd* 可以是 :class:`str` 或編" "碼為 :ref:`檔案系統編碼 ` 的 :class:`bytes` 字串。" -#: ../../library/asyncio-eventloop.rst:1644 +#: ../../library/asyncio-eventloop.rst:1647 msgid "" "This is similar to the standard library :class:`subprocess.Popen` class " "called with ``shell=True``." @@ -2475,31 +2466,31 @@ msgstr "" "這類似於標準函式庫中的 :class:`subprocess.Popen` 類別,使用 ``shell=True`` 呼" "叫。" -#: ../../library/asyncio-eventloop.rst:1647 +#: ../../library/asyncio-eventloop.rst:1650 msgid "" -"The *protocol_factory* must be a callable returning a subclass of " -"the :class:`SubprocessProtocol` class." +"The *protocol_factory* must be a callable returning a subclass of the :class:" +"`SubprocessProtocol` class." msgstr "" "*protocol_factory* 必須是回傳 :class:`SubprocessProtocol` 子類別的可呼叫物" "件。" -#: ../../library/asyncio-eventloop.rst:1650 +#: ../../library/asyncio-eventloop.rst:1653 msgid "" "See :meth:`~loop.subprocess_exec` for more details about the remaining " "arguments." msgstr "有關其餘引數的更多詳細資訊,請參閱 :meth:`~loop.subprocess_exec`。" -#: ../../library/asyncio-eventloop.rst:1653 +#: ../../library/asyncio-eventloop.rst:1656 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 "" -"回傳一對 ``(transport, protocol)``,其中 *transport* 符" -"合 :class:`SubprocessTransport` 基底類別,而 *protocol* 是由 " -"*protocol_factory* 實例化的物件。" +"回傳一對 ``(transport, protocol)``,其中 *transport* 符合 :class:" +"`SubprocessTransport` 基底類別,而 *protocol* 是由 *protocol_factory* 實例化" +"的物件。" -#: ../../library/asyncio-eventloop.rst:1658 +#: ../../library/asyncio-eventloop.rst:1664 msgid "" "It is the application's responsibility to ensure that all whitespace and " "special characters are quoted appropriately to avoid `shell injection " @@ -2508,77 +2499,76 @@ msgid "" "escape whitespace and special characters in strings that are going to be " "used to construct shell commands." msgstr "" -"由應用程式負責確保適當引用所有空白和特殊字元,以避免 `shell 注入 `_\\ 風險。可以使" -"用 :func:`shlex.quote` 函式來正確跳脫用於構建 shell 命令的字串中的空白和特殊" -"字元。" +"由應用程式負責確保適當引用所有空白和特殊字元,以避免 `shell 注入 `_\\ 風險。可以使用 :func:" +"`shlex.quote` 函式來正確跳脫用於構建 shell 命令的字串中的空白和特殊字元。" -#: ../../library/asyncio-eventloop.rst:1667 +#: ../../library/asyncio-eventloop.rst:1673 msgid "Callback Handles" msgstr "回呼處理" -#: ../../library/asyncio-eventloop.rst:1671 +#: ../../library/asyncio-eventloop.rst:1677 msgid "" -"A callback wrapper object returned " -"by :meth:`loop.call_soon`, :meth:`loop.call_soon_threadsafe`." +"A callback wrapper object returned by :meth:`loop.call_soon`, :meth:`loop." +"call_soon_threadsafe`." msgstr "" "由 :meth:`loop.call_soon` 和 :meth:`loop.call_soon_threadsafe` 回傳的回呼包裝" "器。" -#: ../../library/asyncio-eventloop.rst:1676 +#: ../../library/asyncio-eventloop.rst:1682 msgid "" "Return the :class:`contextvars.Context` object associated with the handle." msgstr "回傳與處理相關聯的 :class:`contextvars.Context` 物件。" -#: ../../library/asyncio-eventloop.rst:1683 +#: ../../library/asyncio-eventloop.rst:1689 msgid "" "Cancel the callback. If the callback has already been canceled or executed, " "this method has no effect." msgstr "取消回呼。如果回呼已被取消或執行,此方法將不起作用。" -#: ../../library/asyncio-eventloop.rst:1688 +#: ../../library/asyncio-eventloop.rst:1694 msgid "Return ``True`` if the callback was cancelled." msgstr "如果回呼已被取消,回傳 ``True``。" -#: ../../library/asyncio-eventloop.rst:1694 +#: ../../library/asyncio-eventloop.rst:1700 msgid "" -"A callback wrapper object returned by :meth:`loop.call_later`, " -"and :meth:`loop.call_at`." +"A callback wrapper object returned by :meth:`loop.call_later`, and :meth:" +"`loop.call_at`." msgstr "由 :meth:`loop.call_later` 和 :meth:`loop.call_at` 回傳的回呼包裝器。" -#: ../../library/asyncio-eventloop.rst:1697 +#: ../../library/asyncio-eventloop.rst:1703 msgid "This class is a subclass of :class:`Handle`." msgstr "這個類別是 :class:`Handle` 的子類別。" -#: ../../library/asyncio-eventloop.rst:1701 +#: ../../library/asyncio-eventloop.rst:1707 msgid "Return a scheduled callback time as :class:`float` seconds." msgstr "回傳預定的回呼時間,以 :class:`float` 秒為單位。" -#: ../../library/asyncio-eventloop.rst:1703 +#: ../../library/asyncio-eventloop.rst:1709 msgid "" -"The time is an absolute timestamp, using the same time reference " -"as :meth:`loop.time`." +"The time is an absolute timestamp, using the same time reference as :meth:" +"`loop.time`." msgstr "時間是一個絕對的時間戳,使用與 :meth:`loop.time` 相同的時間參照。" -#: ../../library/asyncio-eventloop.rst:1710 +#: ../../library/asyncio-eventloop.rst:1716 msgid "Server Objects" msgstr "Server 物件" -#: ../../library/asyncio-eventloop.rst:1712 +#: ../../library/asyncio-eventloop.rst:1718 msgid "" -"Server objects are created " -"by :meth:`loop.create_server`, :meth:`loop.create_unix_server`, :func:`start_server`, " -"and :func:`start_unix_server` functions." +"Server objects are created by :meth:`loop.create_server`, :meth:`loop." +"create_unix_server`, :func:`start_server`, and :func:`start_unix_server` " +"functions." msgstr "" -"Server 物件是" -"由 :meth:`loop.create_server`、:meth:`loop.create_unix_server`、:func:`start_server` " -"和 :func:`start_unix_server` 函式所建立。" +"Server 物件是由 :meth:`loop.create_server`、:meth:`loop." +"create_unix_server`、:func:`start_server` 和 :func:`start_unix_server` 函式所" +"建立。" -#: ../../library/asyncio-eventloop.rst:1716 +#: ../../library/asyncio-eventloop.rst:1722 msgid "Do not instantiate the :class:`Server` class directly." msgstr "請勿直接實例化 :class:`Server` 類別。" -#: ../../library/asyncio-eventloop.rst:1720 +#: ../../library/asyncio-eventloop.rst:1726 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 " @@ -2587,7 +2577,7 @@ msgstr "" "*Server* 物件是非同步情境管理器。當在 ``async with`` 陳述中使用時,可以保證在" "完成 ``async with`` 陳述時,Server 物件將會關閉並停止接受新的連線: ::" -#: ../../library/asyncio-eventloop.rst:1725 +#: ../../library/asyncio-eventloop.rst:1731 msgid "" "srv = await loop.create_server(...)\n" "\n" @@ -2603,30 +2593,30 @@ msgstr "" "\n" "# 此時 srv 已關閉,不再接受新的連線。" -#: ../../library/asyncio-eventloop.rst:1733 +#: ../../library/asyncio-eventloop.rst:1739 msgid "Server object is an asynchronous context manager since Python 3.7." msgstr "自 Python 3.7 起,Server 物件是非同步情境管理器。" -#: ../../library/asyncio-eventloop.rst:1736 +#: ../../library/asyncio-eventloop.rst:1742 msgid "" "This class was exposed publicly as ``asyncio.Server`` in Python 3.9.11, " "3.10.3 and 3.11." msgstr "" "此類別在 Python 3.9.11、3.10.3 和 3.11 中以 ``asyncio.Server`` 的形式被公開。" -#: ../../library/asyncio-eventloop.rst:1741 +#: ../../library/asyncio-eventloop.rst:1747 msgid "" "Stop serving: close listening sockets and set the :attr:`sockets` attribute " "to ``None``." msgstr "停止服務:關閉監聽的 sockets 並將 :attr:`sockets` 屬性設為 ``None``。" -#: ../../library/asyncio-eventloop.rst:1744 +#: ../../library/asyncio-eventloop.rst:1750 msgid "" "The sockets that represent existing incoming client connections are left " "open." msgstr "代表現有傳入用戶端連線的 sockets 仍然保持開啟。" -#: ../../library/asyncio-eventloop.rst:1747 +#: ../../library/asyncio-eventloop.rst:1753 msgid "" "The server is closed asynchronously; use the :meth:`wait_closed` coroutine " "to wait until the server is closed (and no more connections are active)." @@ -2634,53 +2624,53 @@ msgstr "" "伺服器以非同步方式關閉;使用 :meth:`wait_close` 協程等待伺服器關閉(不再有活" "躍連線)。" -#: ../../library/asyncio-eventloop.rst:1753 +#: ../../library/asyncio-eventloop.rst:1759 msgid "Close all existing incoming client connections." msgstr "關閉所有現有的傳入用戶端連線。" -#: ../../library/asyncio-eventloop.rst:1755 +#: ../../library/asyncio-eventloop.rst:1761 msgid "" "Calls :meth:`~asyncio.BaseTransport.close` on all associated transports." msgstr "在所有關聯的傳輸上呼叫 :meth:`~asyncio.BaseTransport.close`。" -#: ../../library/asyncio-eventloop.rst:1758 +#: ../../library/asyncio-eventloop.rst:1764 msgid "" ":meth:`close` should be called before :meth:`close_clients` when closing the " "server to avoid races with new clients connecting." msgstr "" -#: ../../library/asyncio-eventloop.rst:1765 +#: ../../library/asyncio-eventloop.rst:1771 msgid "" "Close all existing incoming client connections immediately, without waiting " "for pending operations to complete." msgstr "立即關閉所有現有的傳入用戶端連線,而不等待待定操作完成。" -#: ../../library/asyncio-eventloop.rst:1768 +#: ../../library/asyncio-eventloop.rst:1774 msgid "" "Calls :meth:`~asyncio.WriteTransport.abort` on all associated transports." msgstr "在所有關聯的傳輸上呼叫 :meth:`~asyncio.BaseTransport.close`。" -#: ../../library/asyncio-eventloop.rst:1771 +#: ../../library/asyncio-eventloop.rst:1777 msgid "" ":meth:`close` should be called before :meth:`abort_clients` when closing the " "server to avoid races with new clients connecting." msgstr "" -#: ../../library/asyncio-eventloop.rst:1778 +#: ../../library/asyncio-eventloop.rst:1784 msgid "Return the event loop associated with the server object." msgstr "回傳與伺服器物件關聯的事件迴圈。" -#: ../../library/asyncio-eventloop.rst:1785 +#: ../../library/asyncio-eventloop.rst:1791 msgid "Start accepting connections." msgstr "開始接受連線。" -#: ../../library/asyncio-eventloop.rst:1787 +#: ../../library/asyncio-eventloop.rst:1793 msgid "" "This method is idempotent, so it can be called when the server is already " "serving." msgstr "此方法是幂等的,因此可以在伺服器已經運行時呼叫。" -#: ../../library/asyncio-eventloop.rst:1790 +#: ../../library/asyncio-eventloop.rst:1796 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 " @@ -2688,19 +2678,19 @@ msgid "" "or :meth:`Server.serve_forever` can be used to make the Server start " "accepting connections." msgstr "" -"*start_serving* 僅限關鍵字參數只能在 :meth:`loop.create_server` " -"和 :meth:`asyncio.start_server` 中使用,允許建立一個最初不接受連線的 Server " -"物件。在這種情況下,可以使用 ``Server.start_serving()`` " -"或 :meth:`Server.serve_forever` 來使 Server 開始接受連線。" +"*start_serving* 僅限關鍵字參數只能在 :meth:`loop.create_server` 和 :meth:" +"`asyncio.start_server` 中使用,允許建立一個最初不接受連線的 Server 物件。在這" +"種情況下,可以使用 ``Server.start_serving()`` 或 :meth:`Server." +"serve_forever` 來使 Server 開始接受連線。" -#: ../../library/asyncio-eventloop.rst:1802 +#: ../../library/asyncio-eventloop.rst:1808 msgid "" "Start accepting connections until the coroutine is cancelled. Cancellation " "of ``serve_forever`` task causes the server to be closed." msgstr "" "開始接受連線,直到協程被取消。取消 ``serve_forever`` 任務會導致伺服器關閉。" -#: ../../library/asyncio-eventloop.rst:1806 +#: ../../library/asyncio-eventloop.rst:1812 msgid "" "This method can be called if the server is already accepting connections. " "Only one ``serve_forever`` task can exist per one *Server* object." @@ -2708,7 +2698,7 @@ msgstr "" "如果伺服器已經接受連線,則可以呼叫此方法。每個 *Server* 物件只能存在一個 " "``serve_forever`` 任務。" -#: ../../library/asyncio-eventloop.rst:1812 +#: ../../library/asyncio-eventloop.rst:1818 msgid "" "async def client_connected(reader, writer):\n" " # Communicate with the client with\n" @@ -2734,24 +2724,24 @@ msgstr "" "\n" "asyncio.run(main('127.0.0.1', 0))" -#: ../../library/asyncio-eventloop.rst:1828 +#: ../../library/asyncio-eventloop.rst:1834 msgid "Return ``True`` if the server is accepting new connections." msgstr "如果伺服器正在接受新連線,則回傳 ``True``。" -#: ../../library/asyncio-eventloop.rst:1835 +#: ../../library/asyncio-eventloop.rst:1841 msgid "" "Wait until the :meth:`close` method completes and all active connections " "have finished." msgstr "等待 :meth:`close` 方法完成且所有活動連線都已結束。" -#: ../../library/asyncio-eventloop.rst:1840 +#: ../../library/asyncio-eventloop.rst:1846 msgid "" "List of socket-like objects, ``asyncio.trsock.TransportSocket``, which the " "server is listening on." msgstr "" "伺服器正在監聽的類似 socket 的物件串列,``asyncio.trsock.TransportSocket``。" -#: ../../library/asyncio-eventloop.rst:1843 +#: ../../library/asyncio-eventloop.rst:1849 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." @@ -2759,29 +2749,29 @@ msgstr "" "在 Python 3.7 之前,``Server.sockets`` 曾經直接回傳內部伺服器 sockets 的串" "列。在 3.7 中回傳了該串列的副本。" -#: ../../library/asyncio-eventloop.rst:1853 +#: ../../library/asyncio-eventloop.rst:1859 msgid "Event Loop Implementations" msgstr "事件迴圈實作" -#: ../../library/asyncio-eventloop.rst:1855 +#: ../../library/asyncio-eventloop.rst:1861 msgid "" -"asyncio ships with two different event loop " -"implementations: :class:`SelectorEventLoop` and :class:`ProactorEventLoop`." +"asyncio ships with two different event loop implementations: :class:" +"`SelectorEventLoop` and :class:`ProactorEventLoop`." msgstr "" -"asyncio 內附兩個不同的事件迴圈實作::class:`SelectorEventLoop` " -"和 :class:`ProactorEventLoop`。" +"asyncio 內附兩個不同的事件迴圈實作::class:`SelectorEventLoop` 和 :class:" +"`ProactorEventLoop`。" -#: ../../library/asyncio-eventloop.rst:1858 +#: ../../library/asyncio-eventloop.rst:1864 msgid "By default asyncio is configured to use :class:`EventLoop`." msgstr "預設情況下,asyncio 被配置為要使用 :class:`EventLoop`。" -#: ../../library/asyncio-eventloop.rst:1863 +#: ../../library/asyncio-eventloop.rst:1869 msgid "" "A subclass of :class:`AbstractEventLoop` based on the :mod:`selectors` " "module." msgstr "基於 :mod:`selectors` 模組的一個 :class:`AbstractEventLoop` 子類別。" -#: ../../library/asyncio-eventloop.rst:1866 +#: ../../library/asyncio-eventloop.rst:1872 msgid "" "Uses the most efficient *selector* available for the given platform. It is " "also possible to manually configure the exact selector implementation to be " @@ -2790,7 +2780,7 @@ msgstr "" "使用特定平台上最有效的 *selector*。也可以手動配置要使用的確切 selector 實" "作: ::" -#: ../../library/asyncio-eventloop.rst:1870 +#: ../../library/asyncio-eventloop.rst:1876 msgid "" "import asyncio\n" "import selectors\n" @@ -2798,12 +2788,12 @@ msgid "" "async def main():\n" " ...\n" "\n" -"loop_factory = lambda: " -"asyncio.SelectorEventLoop(selectors.SelectSelector())\n" +"loop_factory = lambda: asyncio.SelectorEventLoop(selectors." +"SelectSelector())\n" "asyncio.run(main(), loop_factory=loop_factory)" msgstr "" -#: ../../library/asyncio-eventloop.rst:1885 +#: ../../library/asyncio-eventloop.rst:1891 msgid "" "A subclass of :class:`AbstractEventLoop` for Windows that uses \"I/O " "Completion Ports\" (IOCP)." @@ -2811,7 +2801,7 @@ msgstr "" "用於 Windows 的 :class:`AbstractEventLoop` 子類別,使用「I/O 完成埠 (IOCP, I/" "O Completion Ports)」。" -#: ../../library/asyncio-eventloop.rst:1891 +#: ../../library/asyncio-eventloop.rst:1897 msgid "" "`MSDN documentation on I/O Completion Ports `_." @@ -2819,25 +2809,25 @@ msgstr "" "`I/O 完成埠的 MSDN 文件 `_。" -#: ../../library/asyncio-eventloop.rst:1896 +#: ../../library/asyncio-eventloop.rst:1902 msgid "" -"An alias to the most efficient available subclass " -"of :class:`AbstractEventLoop` for the given platform." +"An alias to the most efficient available subclass of :class:" +"`AbstractEventLoop` for the given platform." msgstr "" -#: ../../library/asyncio-eventloop.rst:1899 +#: ../../library/asyncio-eventloop.rst:1905 msgid "" -"It is an alias to :class:`SelectorEventLoop` on Unix " -"and :class:`ProactorEventLoop` on Windows." +"It is an alias to :class:`SelectorEventLoop` on Unix and :class:" +"`ProactorEventLoop` on Windows." msgstr "" -"在 Unix 上是 :class:`SelectorEventLoop` 的別名,在 Windows 上" -"是 :class:`ProactorEventLoop` 的別名。" +"在 Unix 上是 :class:`SelectorEventLoop` 的別名,在 Windows 上是 :class:" +"`ProactorEventLoop` 的別名。" -#: ../../library/asyncio-eventloop.rst:1905 +#: ../../library/asyncio-eventloop.rst:1911 msgid "Abstract base class for asyncio-compliant event loops." msgstr "為符合 asyncio 標準的事件迴圈的抽象基礎類別。" -#: ../../library/asyncio-eventloop.rst:1907 +#: ../../library/asyncio-eventloop.rst:1913 msgid "" "The :ref:`asyncio-event-loop-methods` section lists all methods that an " "alternative implementation of ``AbstractEventLoop`` should have defined." @@ -2845,27 +2835,26 @@ msgstr "" ":ref:`asyncio-event-loop-methods` 部分列出了替代 ``AbstractEventLoop`` 實作應" "該定義的所有方法。" -#: ../../library/asyncio-eventloop.rst:1913 +#: ../../library/asyncio-eventloop.rst:1919 msgid "Examples" msgstr "範例" -#: ../../library/asyncio-eventloop.rst:1915 +#: ../../library/asyncio-eventloop.rst:1921 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.call_soon`. Modern asyncio applications rarely need to be " -"written this way; consider using the high-level functions " -"like :func:`asyncio.run`." +"low-level event loop APIs, such as :meth:`loop.run_forever` and :meth:`loop." +"call_soon`. Modern asyncio applications rarely need to be written this way; " +"consider using the high-level functions like :func:`asyncio.run`." msgstr "" -"請注意,本節中的所有範例都 **故意** 展示如何使用低階事件迴圈 API," -"如 :meth:`loop.run_forever` 和 :meth:`loop.call_soon`。現代 asyncio 應用程式" -"很少需要這種方式撰寫;請考慮使用高階的函式,如 :func:`asyncio.run`。" +"請注意,本節中的所有範例都 **故意** 展示如何使用低階事件迴圈 API,如 :meth:" +"`loop.run_forever` 和 :meth:`loop.call_soon`。現代 asyncio 應用程式很少需要這" +"種方式撰寫;請考慮使用高階的函式,如 :func:`asyncio.run`。" -#: ../../library/asyncio-eventloop.rst:1925 +#: ../../library/asyncio-eventloop.rst:1931 msgid "Hello World with call_soon()" msgstr "使用 call_soon() 的 Hello World 範例" -#: ../../library/asyncio-eventloop.rst:1927 +#: ../../library/asyncio-eventloop.rst:1933 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::" @@ -2873,7 +2862,7 @@ msgstr "" "使用 :meth:`loop.call_soon` 方法排程回呼的範例。回呼會顯示 ``\"Hello " "World\"``,然後停止事件迴圈: ::" -#: ../../library/asyncio-eventloop.rst:1931 +#: ../../library/asyncio-eventloop.rst:1937 msgid "" "import asyncio\n" "\n" @@ -2911,18 +2900,18 @@ msgstr "" "finally:\n" " loop.close()" -#: ../../library/asyncio-eventloop.rst:1951 +#: ../../library/asyncio-eventloop.rst:1957 msgid "" "A similar :ref:`Hello World ` example created with a coroutine " "and the :func:`run` function." msgstr "" "使用協程和 :func:`run` 函式建立的類似 :ref:`Hello World ` 範例。" -#: ../../library/asyncio-eventloop.rst:1958 +#: ../../library/asyncio-eventloop.rst:1964 msgid "Display the current date with call_later()" msgstr "使用 call_later() 顯示目前日期" -#: ../../library/asyncio-eventloop.rst:1960 +#: ../../library/asyncio-eventloop.rst:1966 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 " @@ -2931,7 +2920,7 @@ msgstr "" "一個回呼的範例,每秒顯示目前日期。回呼使用 :meth:`loop.call_later` 方法在 5 " "秒後重新排程自己,然後停止事件迴圈: ::" -#: ../../library/asyncio-eventloop.rst:1964 +#: ../../library/asyncio-eventloop.rst:1970 msgid "" "import asyncio\n" "import datetime\n" @@ -2977,7 +2966,7 @@ msgstr "" "finally:\n" " loop.close()" -#: ../../library/asyncio-eventloop.rst:1988 +#: ../../library/asyncio-eventloop.rst:1994 msgid "" "A similar :ref:`current date ` example created with a " "coroutine and the :func:`run` function." @@ -2985,19 +2974,19 @@ msgstr "" "使用協程和 :func:`run` 函式建立的類似 :ref:`current date " "` 範例。" -#: ../../library/asyncio-eventloop.rst:1995 +#: ../../library/asyncio-eventloop.rst:2001 msgid "Watch a file descriptor for read events" msgstr "監聽檔案描述器以進行讀取事件" -#: ../../library/asyncio-eventloop.rst:1997 +#: ../../library/asyncio-eventloop.rst:2003 msgid "" -"Wait until a file descriptor received some data using " -"the :meth:`loop.add_reader` method and then close the event loop::" +"Wait until a file descriptor received some data using the :meth:`loop." +"add_reader` method and then close the event loop::" msgstr "" "使用 :meth:`loop.add_reader` 方法等待檔案描述器接收到某些資料,然後關閉事件迴" "圈: ::" -#: ../../library/asyncio-eventloop.rst:2000 +#: ../../library/asyncio-eventloop.rst:2006 msgid "" "import asyncio\n" "from socket import socketpair\n" @@ -3065,7 +3054,7 @@ msgstr "" " wsock.close()\n" " loop.close()" -#: ../../library/asyncio-eventloop.rst:2035 +#: ../../library/asyncio-eventloop.rst:2041 msgid "" "A similar :ref:`example ` using " "transports, protocols, and the :meth:`loop.create_connection` method." @@ -3073,7 +3062,7 @@ msgstr "" "使用傳輸、協定和 :meth:`loop.create_connection` 方法的類似 :ref:`範例 " "`。" -#: ../../library/asyncio-eventloop.rst:2039 +#: ../../library/asyncio-eventloop.rst:2045 msgid "" "Another similar :ref:`example ` " "using the high-level :func:`asyncio.open_connection` function and streams." @@ -3081,24 +3070,23 @@ msgstr "" "另一個使用高階 :func:`asyncio.open_connection` 函式和串流的類似 :ref:`範例 " "`。" -#: ../../library/asyncio-eventloop.rst:2047 +#: ../../library/asyncio-eventloop.rst:2053 msgid "Set signal handlers for SIGINT and SIGTERM" msgstr "設定 SIGINT 和 SIGTERM 的訊號處理程式" -#: ../../library/asyncio-eventloop.rst:2049 +#: ../../library/asyncio-eventloop.rst:2055 msgid "(This ``signals`` example only works on Unix.)" msgstr "(此 ``signals`` 範例僅在 Unix 上運作。)" -#: ../../library/asyncio-eventloop.rst:2051 +#: ../../library/asyncio-eventloop.rst:2057 msgid "" -"Register handlers for signals :const:`~signal.SIGINT` " -"and :const:`~signal.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 "" -"使用 :meth:`loop.add_signal_handler` 方法註冊訊號 :py:data:`SIGINT` " -"和 :py:data:`SIGTERM` 的處理程式: ::" +"使用 :meth:`loop.add_signal_handler` 方法註冊訊號 :py:data:`SIGINT` 和 :py:" +"data:`SIGTERM` 的處理程式: ::" -#: ../../library/asyncio-eventloop.rst:2054 +#: ../../library/asyncio-eventloop.rst:2060 msgid "" "import asyncio\n" "import functools\n" diff --git a/library/asyncio-queue.po b/library/asyncio-queue.po index 7f18a47ce5..322f1d87fb 100644 --- a/library/asyncio-queue.po +++ b/library/asyncio-queue.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-10-08 00:15+0000\n" +"POT-Creation-Date: 2025-11-07 00:14+0000\n" "PO-Revision-Date: 2022-02-20 18:34+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -193,24 +193,25 @@ msgstr "" #: ../../library/asyncio-queue.rst:122 msgid "" "If *immediate* is true, the queue is terminated immediately. The queue is " -"drained to be completely empty. All callers of :meth:`~Queue.join` are " -"unblocked regardless of the number of unfinished tasks. Blocked callers of :" -"meth:`~Queue.get` are unblocked and will raise :exc:`QueueShutDown` because " -"the queue is empty." +"drained to be completely empty and the count of unfinished tasks is reduced " +"by the number of tasks drained. If unfinished tasks is zero, callers of :" +"meth:`~Queue.join` are unblocked. Also, blocked callers of :meth:`~Queue." +"get` are unblocked and will raise :exc:`QueueShutDown` because the queue is " +"empty." msgstr "" -#: ../../library/asyncio-queue.rst:129 +#: ../../library/asyncio-queue.rst:130 msgid "" "Use caution when using :meth:`~Queue.join` with *immediate* set to true. " "This unblocks the join even when no work has been done on the tasks, " "violating the usual invariant for joining a queue." msgstr "" -#: ../../library/asyncio-queue.rst:137 +#: ../../library/asyncio-queue.rst:138 msgid "Indicate that a formerly enqueued work item is complete." msgstr "表示前面一個排隊的工作項目已經完成。" -#: ../../library/asyncio-queue.rst:139 +#: ../../library/asyncio-queue.rst:140 msgid "" "Used by queue consumers. For each :meth:`~Queue.get` used to fetch a work " "item, a subsequent call to :meth:`task_done` tells the queue that the " @@ -219,7 +220,7 @@ msgstr "" "由佇列消耗者使用。對於每個用於取得一個工作項目的 :meth:`~Queue.get`,接續的 :" "meth:`task_done` 呼叫會告訴佇列這個工作項目的處理已經完成。" -#: ../../library/asyncio-queue.rst:143 +#: ../../library/asyncio-queue.rst:144 msgid "" "If a :meth:`join` is currently blocking, it will resume when all items have " "been processed (meaning that a :meth:`task_done` call was received for every " @@ -228,47 +229,47 @@ msgstr "" "如果 :meth:`join` 目前正在阻塞,在所有項目都被處理後會解除阻塞(意味著每個" "以 :meth:`~Queue.put` 放進佇列的條目都會收到一個 :meth:`task_done`)。" -#: ../../library/asyncio-queue.rst:148 +#: ../../library/asyncio-queue.rst:149 msgid "" "Raises :exc:`ValueError` if called more times than there were items placed " "in the queue." msgstr "如果被呼叫的次數多於放入佇列中的項目數量,將引發 :exc:`ValueError`。" -#: ../../library/asyncio-queue.rst:153 +#: ../../library/asyncio-queue.rst:154 msgid "Priority Queue" msgstr "Priority Queue(優先佇列)" -#: ../../library/asyncio-queue.rst:157 +#: ../../library/asyncio-queue.rst:158 msgid "" "A variant of :class:`Queue`; retrieves entries in priority order (lowest " "first)." msgstr ":class:`Queue` 的變形;按優先順序取出條目 (最小的先取出)。" -#: ../../library/asyncio-queue.rst:160 +#: ../../library/asyncio-queue.rst:161 msgid "Entries are typically tuples of the form ``(priority_number, data)``." msgstr "條目通常是 ``(priority_number, data)`` 形式的 tuple(元組)。" -#: ../../library/asyncio-queue.rst:165 +#: ../../library/asyncio-queue.rst:166 msgid "LIFO Queue" msgstr "LIFO Queue" -#: ../../library/asyncio-queue.rst:169 +#: ../../library/asyncio-queue.rst:170 msgid "" "A variant of :class:`Queue` that retrieves most recently added entries first " "(last in, first out)." msgstr ":class:`Queue` 的變形,先取出最近新增的條目(後進先出)。" -#: ../../library/asyncio-queue.rst:174 +#: ../../library/asyncio-queue.rst:175 msgid "Exceptions" msgstr "例外" -#: ../../library/asyncio-queue.rst:178 +#: ../../library/asyncio-queue.rst:179 msgid "" "This exception is raised when the :meth:`~Queue.get_nowait` method is called " "on an empty queue." msgstr "當佇列為空的時候,呼叫 :meth:`~Queue.get_nowait` 方法會引發這個例外。" -#: ../../library/asyncio-queue.rst:184 +#: ../../library/asyncio-queue.rst:185 msgid "" "Exception raised when the :meth:`~Queue.put_nowait` method is called on a " "queue that has reached its *maxsize*." @@ -276,22 +277,22 @@ msgstr "" "當佇列中條目數量已經達到它的 *maxsize* 時,呼叫 :meth:`~Queue.put_nowait` 方" "法會引發這個例外。" -#: ../../library/asyncio-queue.rst:190 +#: ../../library/asyncio-queue.rst:191 msgid "" "Exception raised when :meth:`~Queue.put` or :meth:`~Queue.get` is called on " "a queue which has been shut down." msgstr "" -#: ../../library/asyncio-queue.rst:197 +#: ../../library/asyncio-queue.rst:198 msgid "Examples" msgstr "範例" -#: ../../library/asyncio-queue.rst:201 +#: ../../library/asyncio-queue.rst:202 msgid "" "Queues can be used to distribute workload between several concurrent tasks::" msgstr "佇列能被用於多個並行任務的工作分配:" -#: ../../library/asyncio-queue.rst:204 +#: ../../library/asyncio-queue.rst:205 msgid "" "import asyncio\n" "import random\n" diff --git a/library/asyncio-subprocess.po b/library/asyncio-subprocess.po index ff9476760a..aec812b1ee 100644 --- a/library/asyncio-subprocess.po +++ b/library/asyncio-subprocess.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-11-07 00:14+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-" @@ -131,16 +131,16 @@ msgid "Create a subprocess." msgstr "建立一個子行程。" #: ../../library/asyncio-subprocess.rst:70 -#: ../../library/asyncio-subprocess.rst:89 +#: ../../library/asyncio-subprocess.rst:92 msgid "" "The *limit* argument sets the buffer limit for :class:`StreamReader` " -"wrappers for :attr:`~asyncio.subprocess.Process.stdout` " -"and :attr:`~asyncio.subprocess.Process.stderr` (if :const:`subprocess.PIPE` " -"is passed to *stdout* and *stderr* arguments)." +"wrappers for :attr:`~asyncio.subprocess.Process.stdout` and :attr:`~asyncio." +"subprocess.Process.stderr` (if :const:`subprocess.PIPE` is passed to " +"*stdout* and *stderr* arguments)." msgstr "" #: ../../library/asyncio-subprocess.rst:74 -#: ../../library/asyncio-subprocess.rst:93 +#: ../../library/asyncio-subprocess.rst:96 msgid "Return a :class:`~asyncio.subprocess.Process` instance." msgstr "回傳一個 :class:`~asyncio.subprocess.Process` 實例。" @@ -150,20 +150,27 @@ msgid "" msgstr "" #: ../../library/asyncio-subprocess.rst:79 -#: ../../library/asyncio-subprocess.rst:107 +#: ../../library/asyncio-subprocess.rst:101 +msgid "" +"If the process object is garbage collected while the process is still " +"running, the child process will be killed." +msgstr "" + +#: ../../library/asyncio-subprocess.rst:82 +#: ../../library/asyncio-subprocess.rst:113 msgid "Removed the *loop* parameter." msgstr "移除了 *loop* 參數。" -#: ../../library/asyncio-subprocess.rst:87 +#: ../../library/asyncio-subprocess.rst:90 msgid "Run the *cmd* shell command." msgstr "執行 *cmd* shell 命令。" -#: ../../library/asyncio-subprocess.rst:95 +#: ../../library/asyncio-subprocess.rst:98 msgid "" "See the documentation of :meth:`loop.subprocess_shell` for other parameters." msgstr "" -#: ../../library/asyncio-subprocess.rst:100 +#: ../../library/asyncio-subprocess.rst:106 msgid "" "It is the application's responsibility to ensure that all whitespace and " "special characters are quoted appropriately to avoid `shell injection " @@ -173,62 +180,63 @@ msgid "" "be used to construct shell commands." msgstr "" -#: ../../library/asyncio-subprocess.rst:112 +#: ../../library/asyncio-subprocess.rst:118 msgid "" "Subprocesses are available for Windows if a :class:`ProactorEventLoop` is " "used. See :ref:`Subprocess Support on Windows ` " "for details." msgstr "" -#: ../../library/asyncio-subprocess.rst:118 +#: ../../library/asyncio-subprocess.rst:124 msgid "" -"asyncio also has the following *low-level* APIs to work with " -"subprocesses: :meth:`loop.subprocess_exec`, :meth:`loop.subprocess_shell`, :meth:`loop.connect_read_pipe`, :meth:`loop.connect_write_pipe`, " -"as well as the :ref:`Subprocess Transports ` " -"and :ref:`Subprocess Protocols `." +"asyncio also has the following *low-level* APIs to work with subprocesses: :" +"meth:`loop.subprocess_exec`, :meth:`loop.subprocess_shell`, :meth:`loop." +"connect_read_pipe`, :meth:`loop.connect_write_pipe`, as well as the :ref:" +"`Subprocess Transports ` and :ref:`Subprocess " +"Protocols `." msgstr "" -#: ../../library/asyncio-subprocess.rst:126 +#: ../../library/asyncio-subprocess.rst:132 msgid "Constants" msgstr "常數" -#: ../../library/asyncio-subprocess.rst:131 +#: ../../library/asyncio-subprocess.rst:137 msgid "Can be passed to the *stdin*, *stdout* or *stderr* parameters." msgstr "" -#: ../../library/asyncio-subprocess.rst:133 +#: ../../library/asyncio-subprocess.rst:139 msgid "" -"If *PIPE* is passed to *stdin* argument, the :attr:`Process.stdin " -"` attribute will point to " -"a :class:`~asyncio.StreamWriter` instance." +"If *PIPE* is passed to *stdin* argument, the :attr:`Process.stdin ` attribute will point to a :class:`~asyncio." +"StreamWriter` instance." msgstr "" -#: ../../library/asyncio-subprocess.rst:137 +#: ../../library/asyncio-subprocess.rst:143 msgid "" -"If *PIPE* is passed to *stdout* or *stderr* arguments, " -"the :attr:`Process.stdout ` " -"and :attr:`Process.stderr ` attributes " -"will point to :class:`~asyncio.StreamReader` instances." +"If *PIPE* is passed to *stdout* or *stderr* arguments, the :attr:`Process." +"stdout ` and :attr:`Process.stderr " +"` attributes will point to :class:" +"`~asyncio.StreamReader` instances." msgstr "" -#: ../../library/asyncio-subprocess.rst:145 +#: ../../library/asyncio-subprocess.rst:151 msgid "" "Special value that can be used as the *stderr* argument and indicates that " "standard error should be redirected into standard output." msgstr "" -#: ../../library/asyncio-subprocess.rst:151 +#: ../../library/asyncio-subprocess.rst:157 msgid "" "Special value that can be used as the *stdin*, *stdout* or *stderr* argument " -"to process creation functions. It indicates that the special " -"file :data:`os.devnull` will be used for the corresponding subprocess stream." +"to process creation functions. It indicates that the special file :data:`os." +"devnull` will be used for the corresponding subprocess stream." msgstr "" -#: ../../library/asyncio-subprocess.rst:157 +#: ../../library/asyncio-subprocess.rst:163 msgid "Interacting with Subprocesses" msgstr "與子行程互動" -#: ../../library/asyncio-subprocess.rst:159 +#: ../../library/asyncio-subprocess.rst:165 msgid "" "Both :func:`create_subprocess_exec` and :func:`create_subprocess_shell` " "functions return instances of the *Process* class. *Process* is a high-" @@ -236,62 +244,62 @@ msgid "" "their completion." msgstr "" -#: ../../library/asyncio-subprocess.rst:167 +#: ../../library/asyncio-subprocess.rst:173 msgid "" -"An object that wraps OS processes created by " -"the :func:`~asyncio.create_subprocess_exec` " -"and :func:`~asyncio.create_subprocess_shell` functions." +"An object that wraps OS processes created by the :func:`~asyncio." +"create_subprocess_exec` and :func:`~asyncio.create_subprocess_shell` " +"functions." msgstr "" -#: ../../library/asyncio-subprocess.rst:171 +#: ../../library/asyncio-subprocess.rst:177 msgid "" -"This class is designed to have a similar API to " -"the :class:`subprocess.Popen` class, but there are some notable differences:" +"This class is designed to have a similar API to the :class:`subprocess." +"Popen` class, but there are some notable differences:" msgstr "" -#: ../../library/asyncio-subprocess.rst:175 +#: ../../library/asyncio-subprocess.rst:181 msgid "" -"unlike Popen, Process instances do not have an equivalent to " -"the :meth:`~subprocess.Popen.poll` method;" +"unlike Popen, Process instances do not have an equivalent to the :meth:" +"`~subprocess.Popen.poll` method;" msgstr "" -#: ../../library/asyncio-subprocess.rst:178 +#: ../../library/asyncio-subprocess.rst:184 msgid "" -"the :meth:`~asyncio.subprocess.Process.communicate` " -"and :meth:`~asyncio.subprocess.Process.wait` methods don't have a *timeout* " -"parameter: use the :func:`~asyncio.wait_for` function;" +"the :meth:`~asyncio.subprocess.Process.communicate` and :meth:`~asyncio." +"subprocess.Process.wait` methods don't have a *timeout* parameter: use the :" +"func:`~asyncio.wait_for` function;" msgstr "" -#: ../../library/asyncio-subprocess.rst:182 +#: ../../library/asyncio-subprocess.rst:188 msgid "" "the :meth:`Process.wait() ` method is " "asynchronous, whereas :meth:`subprocess.Popen.wait` method is implemented as " "a blocking busy loop;" msgstr "" -#: ../../library/asyncio-subprocess.rst:186 +#: ../../library/asyncio-subprocess.rst:192 msgid "the *universal_newlines* parameter is not supported." msgstr "" -#: ../../library/asyncio-subprocess.rst:188 +#: ../../library/asyncio-subprocess.rst:194 msgid "This class is :ref:`not thread safe `." msgstr "" -#: ../../library/asyncio-subprocess.rst:190 +#: ../../library/asyncio-subprocess.rst:196 msgid "" "See also the :ref:`Subprocess and Threads ` " "section." msgstr "" -#: ../../library/asyncio-subprocess.rst:196 +#: ../../library/asyncio-subprocess.rst:202 msgid "Wait for the child process to terminate." msgstr "" -#: ../../library/asyncio-subprocess.rst:198 +#: ../../library/asyncio-subprocess.rst:204 msgid "Set and return the :attr:`returncode` attribute." msgstr "" -#: ../../library/asyncio-subprocess.rst:202 +#: ../../library/asyncio-subprocess.rst:208 msgid "" "This method can deadlock when using ``stdout=PIPE`` or ``stderr=PIPE`` and " "the child process generates so much output that it blocks waiting for the OS " @@ -299,37 +307,37 @@ msgid "" "using pipes to avoid this condition." msgstr "" -#: ../../library/asyncio-subprocess.rst:211 +#: ../../library/asyncio-subprocess.rst:217 msgid "Interact with process:" msgstr "" -#: ../../library/asyncio-subprocess.rst:213 +#: ../../library/asyncio-subprocess.rst:219 msgid "send data to *stdin* (if *input* is not ``None``);" msgstr "" -#: ../../library/asyncio-subprocess.rst:214 +#: ../../library/asyncio-subprocess.rst:220 msgid "closes *stdin*;" msgstr "關閉 *stdin*;" -#: ../../library/asyncio-subprocess.rst:215 +#: ../../library/asyncio-subprocess.rst:221 msgid "read data from *stdout* and *stderr*, until EOF is reached;" msgstr "從 *stdout* 和 *stderr* 讀取資料,直到 EOF;" -#: ../../library/asyncio-subprocess.rst:216 +#: ../../library/asyncio-subprocess.rst:222 msgid "wait for process to terminate." msgstr "等待行程終止。" -#: ../../library/asyncio-subprocess.rst:218 +#: ../../library/asyncio-subprocess.rst:224 msgid "" "The optional *input* argument is the data (:class:`bytes` object) that will " "be sent to the child process." msgstr "" -#: ../../library/asyncio-subprocess.rst:221 +#: ../../library/asyncio-subprocess.rst:227 msgid "Return a tuple ``(stdout_data, stderr_data)``." msgstr "回傳一個 ``(stdout_data, stderr_data)`` 元組。" -#: ../../library/asyncio-subprocess.rst:223 +#: ../../library/asyncio-subprocess.rst:229 msgid "" "If either :exc:`BrokenPipeError` or :exc:`ConnectionResetError` exception is " "raised when writing *input* into *stdin*, the exception is ignored. This " @@ -337,7 +345,7 @@ msgid "" "*stdin*." msgstr "" -#: ../../library/asyncio-subprocess.rst:228 +#: ../../library/asyncio-subprocess.rst:234 msgid "" "If it is desired to send data to the process' *stdin*, the process needs to " "be created with ``stdin=PIPE``. Similarly, to get anything other than " @@ -345,76 +353,76 @@ msgid "" "``stdout=PIPE`` and/or ``stderr=PIPE`` arguments." msgstr "" -#: ../../library/asyncio-subprocess.rst:234 +#: ../../library/asyncio-subprocess.rst:240 msgid "" "Note, that the data read is buffered in memory, so do not use this method if " "the data size is large or unlimited." msgstr "" -#: ../../library/asyncio-subprocess.rst:239 +#: ../../library/asyncio-subprocess.rst:245 msgid "*stdin* gets closed when ``input=None`` too." msgstr "" -#: ../../library/asyncio-subprocess.rst:243 +#: ../../library/asyncio-subprocess.rst:249 msgid "Sends the signal *signal* to the child process." msgstr "" -#: ../../library/asyncio-subprocess.rst:247 +#: ../../library/asyncio-subprocess.rst:253 msgid "" "On Windows, :py:const:`~signal.SIGTERM` is an alias for :meth:`terminate`. " "``CTRL_C_EVENT`` and ``CTRL_BREAK_EVENT`` can be sent to processes started " "with a *creationflags* parameter which includes ``CREATE_NEW_PROCESS_GROUP``." msgstr "" -#: ../../library/asyncio-subprocess.rst:254 +#: ../../library/asyncio-subprocess.rst:260 msgid "Stop the child process." msgstr "" -#: ../../library/asyncio-subprocess.rst:256 +#: ../../library/asyncio-subprocess.rst:262 msgid "" "On POSIX systems this method sends :py:const:`~signal.SIGTERM` to the child " "process." msgstr "" -#: ../../library/asyncio-subprocess.rst:259 +#: ../../library/asyncio-subprocess.rst:265 msgid "" "On Windows the Win32 API function :c:func:`!TerminateProcess` is called to " "stop the child process." msgstr "" -#: ../../library/asyncio-subprocess.rst:264 +#: ../../library/asyncio-subprocess.rst:270 msgid "Kill the child process." msgstr "" -#: ../../library/asyncio-subprocess.rst:266 +#: ../../library/asyncio-subprocess.rst:272 msgid "" "On POSIX systems this method sends :py:data:`~signal.SIGKILL` to the child " "process." msgstr "" -#: ../../library/asyncio-subprocess.rst:269 +#: ../../library/asyncio-subprocess.rst:275 msgid "On Windows this method is an alias for :meth:`terminate`." msgstr "" -#: ../../library/asyncio-subprocess.rst:273 +#: ../../library/asyncio-subprocess.rst:279 msgid "" "Standard input stream (:class:`~asyncio.StreamWriter`) or ``None`` if the " "process was created with ``stdin=None``." msgstr "" -#: ../../library/asyncio-subprocess.rst:278 +#: ../../library/asyncio-subprocess.rst:284 msgid "" "Standard output stream (:class:`~asyncio.StreamReader`) or ``None`` if the " "process was created with ``stdout=None``." msgstr "" -#: ../../library/asyncio-subprocess.rst:283 +#: ../../library/asyncio-subprocess.rst:289 msgid "" "Standard error stream (:class:`~asyncio.StreamReader`) or ``None`` if the " "process was created with ``stderr=None``." msgstr "" -#: ../../library/asyncio-subprocess.rst:288 +#: ../../library/asyncio-subprocess.rst:294 msgid "" "Use the :meth:`communicate` method rather than :attr:`process.stdin.write() " "`, :attr:`await process.stdout.read() ` or :attr:`await " @@ -422,76 +430,76 @@ msgid "" "pausing reading or writing and blocking the child process." msgstr "" -#: ../../library/asyncio-subprocess.rst:297 +#: ../../library/asyncio-subprocess.rst:303 msgid "Process identification number (PID)." msgstr "" -#: ../../library/asyncio-subprocess.rst:299 +#: ../../library/asyncio-subprocess.rst:305 msgid "" -"Note that for processes created by " -"the :func:`~asyncio.create_subprocess_shell` function, this attribute is the " -"PID of the spawned shell." +"Note that for processes created by the :func:`~asyncio." +"create_subprocess_shell` function, this attribute is the PID of the spawned " +"shell." msgstr "" -#: ../../library/asyncio-subprocess.rst:304 +#: ../../library/asyncio-subprocess.rst:310 msgid "Return code of the process when it exits." msgstr "" -#: ../../library/asyncio-subprocess.rst:306 +#: ../../library/asyncio-subprocess.rst:312 msgid "A ``None`` value indicates that the process has not terminated yet." msgstr "" -#: ../../library/asyncio-subprocess.rst:308 +#: ../../library/asyncio-subprocess.rst:314 msgid "" "A negative value ``-N`` indicates that the child was terminated by signal " "``N`` (POSIX only)." msgstr "" -#: ../../library/asyncio-subprocess.rst:315 +#: ../../library/asyncio-subprocess.rst:321 msgid "Subprocess and Threads" msgstr "子行程與執行緒" -#: ../../library/asyncio-subprocess.rst:317 +#: ../../library/asyncio-subprocess.rst:323 msgid "" "Standard asyncio event loop supports running subprocesses from different " "threads by default." msgstr "" -#: ../../library/asyncio-subprocess.rst:320 +#: ../../library/asyncio-subprocess.rst:326 msgid "" "On Windows subprocesses are provided by :class:`ProactorEventLoop` only " "(default), :class:`SelectorEventLoop` has no subprocess support." msgstr "" -#: ../../library/asyncio-subprocess.rst:323 +#: ../../library/asyncio-subprocess.rst:329 msgid "" "Note that alternative event loop implementations might have own limitations; " "please refer to their documentation." msgstr "" -#: ../../library/asyncio-subprocess.rst:328 +#: ../../library/asyncio-subprocess.rst:334 msgid "" "The :ref:`Concurrency and multithreading in asyncio ` section." msgstr "" -#: ../../library/asyncio-subprocess.rst:333 +#: ../../library/asyncio-subprocess.rst:339 msgid "Examples" msgstr "範例" -#: ../../library/asyncio-subprocess.rst:335 +#: ../../library/asyncio-subprocess.rst:341 msgid "" "An example using the :class:`~asyncio.subprocess.Process` class to control a " "subprocess and the :class:`StreamReader` class to read from its standard " "output." msgstr "" -#: ../../library/asyncio-subprocess.rst:341 +#: ../../library/asyncio-subprocess.rst:347 msgid "" "The subprocess is created by the :func:`create_subprocess_exec` function::" msgstr "" -#: ../../library/asyncio-subprocess.rst:344 +#: ../../library/asyncio-subprocess.rst:350 msgid "" "import asyncio\n" "import sys\n" @@ -517,7 +525,7 @@ msgid "" "print(f\"Current date: {date}\")" msgstr "" -#: ../../library/asyncio-subprocess.rst:368 +#: ../../library/asyncio-subprocess.rst:374 msgid "" "See also the :ref:`same example ` written " "using low-level APIs." diff --git a/library/asyncio.po b/library/asyncio.po index d302ddf643..5018a3d160 100644 --- a/library/asyncio.po +++ b/library/asyncio.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-11-07 00:14+0000\n" "PO-Revision-Date: 2025-07-06 17:13+0800\n" "Last-Translator: Weilin Du\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -21,15 +21,15 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../library/asyncio.rst:96 +#: ../../library/asyncio.rst:100 msgid "High-level APIs" msgstr "高階 API" -#: ../../library/asyncio.rst:109 +#: ../../library/asyncio.rst:113 msgid "Low-level APIs" msgstr "低階 API" -#: ../../library/asyncio.rst:120 +#: ../../library/asyncio.rst:124 msgid "Guides and Tutorials" msgstr "指南與教學" @@ -130,9 +130,9 @@ msgstr "" #: ../../library/asyncio.rst:53 msgid "" "create and manage :ref:`event loops `, which provide " -"asynchronous APIs for :ref:`networking `, " -"running :ref:`subprocesses `, handling :ref:`OS " -"signals `, etc;" +"asynchronous APIs for :ref:`networking `, running :ref:" +"`subprocesses `, handling :ref:`OS signals " +"`, etc;" msgstr "" "建立與管理 :ref:`event loops(事件迴圈) `,它提供了能被" "用於\\ :ref:`網路 `、執行\\ :ref:`子行程 " @@ -173,8 +173,8 @@ msgstr "asyncio REPL" #: ../../library/asyncio.rst:70 msgid "" -"You can experiment with an ``asyncio`` concurrent context in " -"the :term:`REPL`:" +"You can experiment with an ``asyncio`` concurrent context in the :term:" +"`REPL`:" msgstr "" "你能在 :term:`REPL` 中對一個 ``asyncio`` 的並行情境 (context) 進行實驗:" @@ -200,15 +200,22 @@ msgstr "" #: ../../library/asyncio.rst:82 msgid "" +"This REPL provides limited compatibility with :envvar:`PYTHON_BASIC_REPL`. " +"It is recommended that the default REPL is used for full functionality and " +"the latest features." +msgstr "" + +#: ../../library/asyncio.rst:86 +msgid "" "Raises an :ref:`auditing event ` ``cpython.run_stdin`` with no " "arguments." msgstr "產生一個 :ref:`稽核事件 ` ``cpython.run_stdin`` 且沒有引數。" -#: ../../library/asyncio.rst:84 +#: ../../library/asyncio.rst:88 msgid "(also 3.11.10, 3.10.15, 3.9.20, and 3.8.20) Emits audit events." msgstr "(也包括 3.11.10、3.10.15、3.9.20 及 3.8.20)發出稽核事件。" -#: ../../library/asyncio.rst:87 +#: ../../library/asyncio.rst:91 msgid "" "Uses PyREPL if possible, in which case :envvar:`PYTHONSTARTUP` is also " "executed. Emits audit events." @@ -216,10 +223,10 @@ msgstr "" "可能的話使用 PyREPL,在這種情況下 :envvar:`PYTHONSTARTUP` 也會被執行。發出稽" "核事件。" -#: ../../library/asyncio.rst:95 +#: ../../library/asyncio.rst:99 msgid "Reference" msgstr "參閱" -#: ../../library/asyncio.rst:129 +#: ../../library/asyncio.rst:133 msgid "The source code for asyncio can be found in :source:`Lib/asyncio/`." msgstr "asyncio 的原始碼可以在 :source:`Lib/asyncio/` 中找到。" diff --git a/library/atexit.po b/library/atexit.po index 3d2dfc378c..50b7c2cd2f 100644 --- a/library/atexit.po +++ b/library/atexit.po @@ -214,6 +214,14 @@ msgid "" "# or:\n" "atexit.register(goodbye, adjective='nice', name='Donny')" msgstr "" +"def goodbye(name, adjective):\n" +" print('Goodbye %s, it was %s to meet you.' % (name, adjective))\n" +"\n" +"import atexit\n" +"\n" +"atexit.register(goodbye, 'Donny', 'nice')\n" +"# 或是:\n" +"atexit.register(goodbye, adjective='nice', name='Donny')" #: ../../library/atexit.rst:119 msgid "Usage as a :term:`decorator`::" diff --git a/library/collections.po b/library/collections.po index 786f7b046d..5ce6dc2922 100644 --- a/library/collections.po +++ b/library/collections.po @@ -1027,6 +1027,10 @@ msgid "" " with open(filename) as f:\n" " return deque(f, n)" msgstr "" +"def tail(filename, n=10):\n" +" '回傳檔案的最後 n 行'\n" +" with open(filename) as f:\n" +" return deque(f, n)" #: ../../library/collections.rst:663 msgid "" @@ -1078,6 +1082,17 @@ msgid "" " # Remove an exhausted iterator.\n" " iterators.popleft()" msgstr "" +"def roundrobin(*iterables):\n" +" \"roundrobin('ABC', 'D', 'EF') --> A D E B F C\"\n" +" iterators = deque(map(iter, iterables))\n" +" while iterators:\n" +" try:\n" +" while True:\n" +" yield next(iterators[0])\n" +" iterators.rotate(-1)\n" +" except StopIteration:\n" +" # 移除耗盡的疊代器。\n" +" iterators.popleft()" #: ../../library/collections.rst:697 msgid "" diff --git a/library/concurrent.futures.po b/library/concurrent.futures.po index 0db2ac39ec..27a025e3b4 100644 --- a/library/concurrent.futures.po +++ b/library/concurrent.futures.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-12 00:14+0000\n" +"POT-Creation-Date: 2025-10-26 00:15+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-" @@ -210,9 +210,9 @@ msgid "" "shutdown the :class:`Executor` (waiting as if :meth:`Executor.shutdown` were " "called with *wait* set to ``True``)::" msgstr "" -"如果使用 :keyword:`with` 陳述式來將 executor 用作 :term:`context manager`,那你就" -"可以不用明確地呼叫此方法,這將會自己關閉 :class:`Executor`\\(如同呼" -"叫 :meth:`Executor.shutdown` 時 *wait* 被設定為 ``True`` 般等待): ::" +"如果使用 :keyword:`with` 陳述式來將 executor 用作 :term:`context manager`,那" +"你就可以不用明確地呼叫此方法,這將會自己關閉 :class:`Executor`\\(如同呼叫 :" +"meth:`Executor.shutdown` 時 *wait* 被設定為 ``True`` 般等待): ::" #: ../../library/concurrent.futures.rst:109 msgid "" @@ -371,7 +371,7 @@ msgstr "" "thread) 的 :class:`threading.Thread` 名稱,以便於除錯。" #: ../../library/concurrent.futures.rst:188 -#: ../../library/concurrent.futures.rst:391 +#: ../../library/concurrent.futures.rst:393 msgid "Added the *initializer* and *initargs* arguments." msgstr "新增 *initializer* 與 *initargs* 引數。" @@ -440,7 +440,7 @@ msgstr "" msgid "InterpreterPoolExecutor" msgstr "InterpreterPoolExecutor" -#: ../../library/concurrent.futures.rst:242 +#: ../../library/concurrent.futures.rst:244 msgid "" "The :class:`InterpreterPoolExecutor` class uses a pool of interpreters to " "execute calls asynchronously. It is a :class:`ThreadPoolExecutor` subclass, " @@ -449,7 +449,7 @@ msgid "" "interpreter." msgstr "" -#: ../../library/concurrent.futures.rst:248 +#: ../../library/concurrent.futures.rst:250 msgid "" "The biggest benefit to using interpreters instead of only threads is true " "multi-core parallelism. Each interpreter has its own :term:`Global " @@ -458,7 +458,7 @@ msgid "" "unblocked on a different core." msgstr "" -#: ../../library/concurrent.futures.rst:254 +#: ../../library/concurrent.futures.rst:256 msgid "" "The tradeoff is that writing concurrent code for use with multiple " "interpreters can take extra effort. However, this is because it forces you " @@ -471,7 +471,7 @@ msgid "" "conditions." msgstr "" -#: ../../library/concurrent.futures.rst:264 +#: ../../library/concurrent.futures.rst:266 msgid "" "Each worker's interpreter is isolated from all the other interpreters. " "\"Isolated\" means each interpreter has its own runtime state and operates " @@ -485,7 +485,7 @@ msgid "" "``__main__``." msgstr "" -#: ../../library/concurrent.futures.rst:276 +#: ../../library/concurrent.futures.rst:278 msgid "" "Isolation means a mutable object, or other data, cannot be used by more than " "one interpreter at the same time. That effectively means interpreters " @@ -495,7 +495,7 @@ msgid "" "strings, and tuples of immutable objects, don't have these limitations." msgstr "" -#: ../../library/concurrent.futures.rst:284 +#: ../../library/concurrent.futures.rst:286 msgid "" "Communicating and synchronizing between interpreters is most effectively " "done using dedicated tools, like those proposed in :pep:`734`. One less " @@ -503,7 +503,7 @@ msgid "" "bytes over a shared :mod:`socket ` or :func:`pipe `." msgstr "" -#: ../../library/concurrent.futures.rst:292 +#: ../../library/concurrent.futures.rst:294 msgid "" "A :class:`ThreadPoolExecutor` subclass that executes calls asynchronously " "using a pool of at most *max_workers* threads. Each thread runs tasks in " @@ -514,7 +514,7 @@ msgid "" "executor has true multi-core parallelism." msgstr "" -#: ../../library/concurrent.futures.rst:300 +#: ../../library/concurrent.futures.rst:302 msgid "" "The optional *initializer* and *initargs* arguments have the same meaning as " "for :class:`!ThreadPoolExecutor`: the initializer is run when each worker is " @@ -523,17 +523,17 @@ msgid "" "when sending them to the worker's interpreter." msgstr "" -#: ../../library/concurrent.futures.rst:308 +#: ../../library/concurrent.futures.rst:310 msgid "" "The executor may replace uncaught exceptions from *initializer* with :class:" "`~concurrent.futures.interpreter.ExecutionFailed`." msgstr "" -#: ../../library/concurrent.futures.rst:311 +#: ../../library/concurrent.futures.rst:313 msgid "Other caveats from parent :class:`ThreadPoolExecutor` apply here." msgstr "" -#: ../../library/concurrent.futures.rst:313 +#: ../../library/concurrent.futures.rst:315 msgid "" ":meth:`~Executor.submit` and :meth:`~Executor.map` work like normal, except " "the worker serializes the callable and arguments using :mod:`pickle` when " @@ -541,7 +541,7 @@ msgid "" "value when sending it back." msgstr "" -#: ../../library/concurrent.futures.rst:318 +#: ../../library/concurrent.futures.rst:320 msgid "" "When a worker's current task raises an uncaught exception, the worker always " "tries to preserve the exception as-is. If that is successful then it also " @@ -552,11 +552,11 @@ msgid "" "class:`~concurrent.futures.interpreter.ExecutionFailed` instance instead." msgstr "" -#: ../../library/concurrent.futures.rst:330 +#: ../../library/concurrent.futures.rst:332 msgid "ProcessPoolExecutor" msgstr "ProcessPoolExecutor" -#: ../../library/concurrent.futures.rst:332 +#: ../../library/concurrent.futures.rst:334 msgid "" "The :class:`ProcessPoolExecutor` class is an :class:`Executor` subclass that " "uses a pool of processes to execute calls asynchronously. :class:" @@ -571,7 +571,7 @@ msgstr "" "Interpreter Lock) `,但也意味著只能執行和回傳可被 " "pickle 的 (picklable) 物件。" -#: ../../library/concurrent.futures.rst:339 +#: ../../library/concurrent.futures.rst:341 msgid "" "The ``__main__`` module must be importable by worker subprocesses. This " "means that :class:`ProcessPoolExecutor` will not work in the interactive " @@ -581,7 +581,7 @@ msgstr "" "class:`ProcessPoolExecutor` 將無法在交互式直譯器 (interactive interpreter) 中" "工作。" -#: ../../library/concurrent.futures.rst:342 +#: ../../library/concurrent.futures.rst:344 msgid "" "Calling :class:`Executor` or :class:`Future` methods from a callable " "submitted to a :class:`ProcessPoolExecutor` will result in deadlock." @@ -589,7 +589,7 @@ msgstr "" "從提交給 :class:`ProcessPoolExecutor` 的可呼叫物件中呼叫 :class:`Executor` " "或 :class:`Future` 方法將導致死鎖。" -#: ../../library/concurrent.futures.rst:345 +#: ../../library/concurrent.futures.rst:347 msgid "" "Note that the restrictions on functions and arguments needing to picklable " "as per :class:`multiprocessing.Process` apply when using :meth:`~Executor." @@ -597,7 +597,7 @@ msgid "" "function defined in a REPL or a lambda should not be expected to work." msgstr "" -#: ../../library/concurrent.futures.rst:352 +#: ../../library/concurrent.futures.rst:354 msgid "" "An :class:`Executor` subclass that executes calls asynchronously using a " "pool of at most *max_workers* processes. If *max_workers* is ``None`` or " @@ -621,7 +621,7 @@ msgstr "" "或未給定,則使用預設的 :mod:`multiprocessing` 情境。請見 :ref:" "`multiprocessing-start-methods`。" -#: ../../library/concurrent.futures.rst:366 +#: ../../library/concurrent.futures.rst:368 msgid "" "*initializer* is an optional callable that is called at the start of each " "worker process; *initargs* is a tuple of arguments passed to the " @@ -634,7 +634,7 @@ msgstr "" "外,所有目前未定的作業以及任何向池中提交更多作業的嘗試都將引發 :exc:" "`~concurrent.futures.process.BrokenProcessPool`。" -#: ../../library/concurrent.futures.rst:372 +#: ../../library/concurrent.futures.rst:374 msgid "" "*max_tasks_per_child* is an optional argument that specifies the maximum " "number of tasks a single process can execute before it will exit and be " @@ -650,7 +650,7 @@ msgstr "" "數的情況下,將預設使用 \"spawn\" 做為 multiprocessing 啟動方法。此功能與 " "\"fork\" 啟動方法不相容。" -#: ../../library/concurrent.futures.rst:380 +#: ../../library/concurrent.futures.rst:382 msgid "" "When one of the worker processes terminates abruptly, a :exc:`~concurrent." "futures.process.BrokenProcessPool` error is now raised. Previously, " @@ -661,21 +661,21 @@ msgstr "" "BrokenProcessPool` 錯誤。在過去,此行為是未定義的 (undefined),但對 executor " "或其 future 的操作經常會發生凍結或死鎖。" -#: ../../library/concurrent.futures.rst:387 +#: ../../library/concurrent.futures.rst:389 msgid "" "The *mp_context* argument was added to allow users to control the " "start_method for worker processes created by the pool." msgstr "" "新增了 *mp_context* 引數以允許使用者控制由池所建立的工作行程的 start_method。" -#: ../../library/concurrent.futures.rst:393 +#: ../../library/concurrent.futures.rst:395 msgid "" "The *max_tasks_per_child* argument was added to allow users to control the " "lifetime of workers in the pool." msgstr "" "新增了 *max_tasks_per_child* 引數以允許使用者控制池中 worker 的生命週期。" -#: ../../library/concurrent.futures.rst:397 +#: ../../library/concurrent.futures.rst:399 msgid "" "On POSIX systems, if your application has multiple threads and the :mod:" "`multiprocessing` context uses the ``\"fork\"`` start method: The :func:`os." @@ -688,13 +688,13 @@ msgstr "" "能會引發 :exc:`DeprecationWarning`。傳遞一個 *mp_context* 以配置為使用不同的" "啟動方法。更多說明請參閱 :func:`os.fork` 文件。" -#: ../../library/concurrent.futures.rst:405 +#: ../../library/concurrent.futures.rst:407 msgid "" "*max_workers* uses :func:`os.process_cpu_count` by default, instead of :func:" "`os.cpu_count`." msgstr "" -#: ../../library/concurrent.futures.rst:409 +#: ../../library/concurrent.futures.rst:411 msgid "" "The default process start method (see :ref:`multiprocessing-start-methods`) " "changed away from *fork*. If you require the *fork* start method for :class:" @@ -702,7 +702,7 @@ msgid "" "get_context(\"fork\")``." msgstr "" -#: ../../library/concurrent.futures.rst:417 +#: ../../library/concurrent.futures.rst:419 msgid "" "Attempt to terminate all living worker processes immediately by calling :" "meth:`Process.terminate ` on each of " @@ -710,14 +710,14 @@ msgid "" "all other resources associated with the executor are freed." msgstr "" -#: ../../library/concurrent.futures.rst:422 -#: ../../library/concurrent.futures.rst:434 +#: ../../library/concurrent.futures.rst:424 +#: ../../library/concurrent.futures.rst:436 msgid "" "After calling this method the caller should no longer submit tasks to the " "executor." msgstr "" -#: ../../library/concurrent.futures.rst:429 +#: ../../library/concurrent.futures.rst:431 msgid "" "Attempt to kill all living worker processes immediately by calling :meth:" "`Process.kill ` on each of them. Internally, " @@ -725,11 +725,11 @@ msgid "" "resources associated with the executor are freed." msgstr "" -#: ../../library/concurrent.futures.rst:442 +#: ../../library/concurrent.futures.rst:444 msgid "ProcessPoolExecutor Example" msgstr "ProcessPoolExecutor 範例" -#: ../../library/concurrent.futures.rst:445 +#: ../../library/concurrent.futures.rst:447 msgid "" "import concurrent.futures\n" "import math\n" @@ -797,11 +797,11 @@ msgstr "" "if __name__ == '__main__':\n" " main()" -#: ../../library/concurrent.futures.rst:480 +#: ../../library/concurrent.futures.rst:482 msgid "Future Objects" msgstr "Future 物件" -#: ../../library/concurrent.futures.rst:482 +#: ../../library/concurrent.futures.rst:484 msgid "" "The :class:`Future` class encapsulates the asynchronous execution of a " "callable. :class:`Future` instances are created by :meth:`Executor.submit`." @@ -809,7 +809,7 @@ msgstr "" ":class:`Future` 類別封裝了可呼叫物件的非同步執行。:class:`Future` 實例由 :" "meth:`Executor.submit` 建立。" -#: ../../library/concurrent.futures.rst:487 +#: ../../library/concurrent.futures.rst:489 msgid "" "Encapsulates the asynchronous execution of a callable. :class:`Future` " "instances are created by :meth:`Executor.submit` and should not be created " @@ -818,7 +818,7 @@ msgstr "" "封裝可呼叫物件的非同步執行。:class:`Future` 實例由 :meth:`Executor.submit` 建" "立,且除測試外不應直接建立。" -#: ../../library/concurrent.futures.rst:493 +#: ../../library/concurrent.futures.rst:495 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 " @@ -828,22 +828,22 @@ msgstr "" "嘗試取消呼叫。如果呼叫目前正在執行或已完成運行且無法取消,則該方法將回傳 " "``False``,否則呼叫將被取消並且該方法將回傳 ``True``。" -#: ../../library/concurrent.futures.rst:500 +#: ../../library/concurrent.futures.rst:502 msgid "Return ``True`` if the call was successfully cancelled." msgstr "如果該呼叫成功被取消,則回傳 ``True``。" -#: ../../library/concurrent.futures.rst:504 +#: ../../library/concurrent.futures.rst:506 msgid "" "Return ``True`` if the call is currently being executed and cannot be " "cancelled." msgstr "如果呼叫正在執行且無法取消,則回傳 ``True``。" -#: ../../library/concurrent.futures.rst:509 +#: ../../library/concurrent.futures.rst:511 msgid "" "Return ``True`` if the call was successfully cancelled or finished running." msgstr "如果呼叫成功被取消或結束運行,則回傳 ``True``。" -#: ../../library/concurrent.futures.rst:514 +#: ../../library/concurrent.futures.rst:516 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 " @@ -855,19 +855,19 @@ msgstr "" "叫在 *timeout* 秒內未完成,則會引發 :exc:`TimeoutError`。*timeout* 可以是整數" "或浮點數。如果未指定 *timeout* 或為 ``None``,則等待時間就不會有限制。" -#: ../../library/concurrent.futures.rst:521 -#: ../../library/concurrent.futures.rst:535 +#: ../../library/concurrent.futures.rst:523 +#: ../../library/concurrent.futures.rst:537 msgid "" "If the future is cancelled before completing then :exc:`.CancelledError` " "will be raised." msgstr "如果 future 在完成之前被取消,那麼 :exc:`.CancelledError` 將被引發。" -#: ../../library/concurrent.futures.rst:524 +#: ../../library/concurrent.futures.rst:526 msgid "" "If the call raised an exception, this method will raise the same exception." msgstr "如果該呼叫引發了例外,此方法將引發相同的例外。" -#: ../../library/concurrent.futures.rst:528 +#: ../../library/concurrent.futures.rst:530 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 " @@ -879,11 +879,11 @@ msgstr "" "呼叫在 *timeout* 秒內未完成,則會引發 :exc:`TimeoutError`。 *timeout* 可以是" "整數或浮點數。如果未指定 *timeout* 或為 ``None``,則等待時間就不會有限制。" -#: ../../library/concurrent.futures.rst:538 +#: ../../library/concurrent.futures.rst:540 msgid "If the call completed without raising, ``None`` is returned." msgstr "如果呼叫在沒有引發的情況下完成,則回傳 ``None``。" -#: ../../library/concurrent.futures.rst:542 +#: ../../library/concurrent.futures.rst:544 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 " @@ -892,7 +892,7 @@ msgstr "" "將可呼叫的 *fn* 附加到 future 上。當 future 被取消或完成運行時,*fn* 將被以 " "future 作為其唯一引數來呼叫。" -#: ../../library/concurrent.futures.rst:546 +#: ../../library/concurrent.futures.rst:548 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 " @@ -904,19 +904,19 @@ msgstr "" "如果可呼叫物件引發 :exc:`Exception` 子類別,它將被記錄 (log) 並忽略。如果可呼" "叫物件引發 :exc:`BaseException` 子類別,該行為未定義。" -#: ../../library/concurrent.futures.rst:552 +#: ../../library/concurrent.futures.rst:554 msgid "" "If the future has already completed or been cancelled, *fn* will be called " "immediately." msgstr "如果 future 已經完成或被取消,*fn* 將立即被呼叫。" -#: ../../library/concurrent.futures.rst:555 +#: ../../library/concurrent.futures.rst:557 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:560 +#: ../../library/concurrent.futures.rst:562 msgid "" "This method should only be called by :class:`Executor` implementations " "before executing the work associated with the :class:`Future` and by unit " @@ -925,7 +925,7 @@ msgstr "" "此方法只能在與 :class:`Future` 關聯的工作被執行之前於 :class:`Executor` 實作" "中呼叫,或者在單元測試中呼叫。" -#: ../../library/concurrent.futures.rst:564 +#: ../../library/concurrent.futures.rst:566 msgid "" "If the method returns ``False`` then the :class:`Future` was cancelled, i." "e. :meth:`Future.cancel` was called and returned ``True``. Any threads " @@ -936,7 +936,7 @@ msgstr "" "cancel` 被呼叫並回傳 ``True``。任何等待 :class:`Future` 完成的執行緒(即透" "過 :func:`as_completed` 或 :func:`wait`)將被喚醒。" -#: ../../library/concurrent.futures.rst:569 +#: ../../library/concurrent.futures.rst:571 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` " @@ -945,7 +945,7 @@ msgstr "" "如果該方法回傳 ``True`` 則代表 :class:`Future` 未被取消並已進入運行狀態,意即" "呼叫 :meth:`Future.running` 將回傳 ``True``。" -#: ../../library/concurrent.futures.rst:573 +#: ../../library/concurrent.futures.rst:575 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." @@ -953,20 +953,20 @@ msgstr "" "此方法只能呼叫一次,且不能在呼叫 :meth:`Future.set_result` 或 :meth:`Future." "set_exception` 之後呼叫。" -#: ../../library/concurrent.futures.rst:579 +#: ../../library/concurrent.futures.rst:581 msgid "" "Sets the result of the work associated with the :class:`Future` to *result*." msgstr "將與 :class:`Future` 關聯的工作結果設定為 *result*。" -#: ../../library/concurrent.futures.rst:582 -#: ../../library/concurrent.futures.rst:595 +#: ../../library/concurrent.futures.rst:584 +#: ../../library/concurrent.futures.rst:597 msgid "" "This method should only be used by :class:`Executor` implementations and " "unit tests." msgstr "此方法只能在 :class:`Executor` 實作中和單元測試中使用。" -#: ../../library/concurrent.futures.rst:585 -#: ../../library/concurrent.futures.rst:598 +#: ../../library/concurrent.futures.rst:587 +#: ../../library/concurrent.futures.rst:600 msgid "" "This method raises :exc:`concurrent.futures.InvalidStateError` if the :class:" "`Future` is already done." @@ -974,18 +974,18 @@ msgstr "" "如果 :class:`Future` 已經完成,此方法會引發 :exc:`concurrent.futures." "InvalidStateError`。" -#: ../../library/concurrent.futures.rst:592 +#: ../../library/concurrent.futures.rst:594 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:604 +#: ../../library/concurrent.futures.rst:606 msgid "Module Functions" msgstr "模組函式" -#: ../../library/concurrent.futures.rst:608 +#: ../../library/concurrent.futures.rst:610 msgid "" "Wait for the :class:`Future` instances (possibly created by different :class:" "`Executor` instances) given by *fs* to complete. Duplicate futures given to " @@ -1001,7 +1001,7 @@ msgstr "" "完成的 future(已完成或被取消的 future)。第二組名為 ``not_done``,包含未完成" "的 future(未定或運行中的 future)。" -#: ../../library/concurrent.futures.rst:616 +#: ../../library/concurrent.futures.rst:618 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 " @@ -1010,25 +1010,25 @@ msgstr "" "*timeout* 可用於控制回傳前等待的最大秒數。*timeout* 可以是整數或浮點數。如果" "未指定 *timeout* 或為 ``None``,則等待時間就沒有限制。" -#: ../../library/concurrent.futures.rst:620 +#: ../../library/concurrent.futures.rst:622 msgid "" "*return_when* indicates when this function should return. It must be one of " "the following constants:" msgstr "*return_when* 表示此函式應回傳的時間。它必須是以下常數之一:" -#: ../../library/concurrent.futures.rst:626 +#: ../../library/concurrent.futures.rst:628 msgid "Constant" msgstr "常數" -#: ../../library/concurrent.futures.rst:627 +#: ../../library/concurrent.futures.rst:629 msgid "Description" msgstr "描述" -#: ../../library/concurrent.futures.rst:630 +#: ../../library/concurrent.futures.rst:632 msgid "The function will return when any future finishes or is cancelled." msgstr "當任何 future 完成或被取消時,該函式就會回傳。" -#: ../../library/concurrent.futures.rst:633 +#: ../../library/concurrent.futures.rst:635 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:" @@ -1037,11 +1037,11 @@ msgstr "" "該函式會在任何 future 透過引發例外而完結時回傳。如果 future 沒有引發例外,那" "麼它等同於 :const:`ALL_COMPLETED`。" -#: ../../library/concurrent.futures.rst:638 +#: ../../library/concurrent.futures.rst:640 msgid "The function will return when all futures finish or are cancelled." msgstr "當所有 future 都完成或被取消時,該函式才會回傳。" -#: ../../library/concurrent.futures.rst:642 +#: ../../library/concurrent.futures.rst:644 msgid "" "Returns an iterator over the :class:`Future` instances (possibly created by " "different :class:`Executor` instances) given by *fs* that yields futures as " @@ -1061,36 +1061,36 @@ msgstr "" "`TimeoutError`。*timeout* 可以是整數或浮點數。如果未指定 *timeout* 或為 " "``None``,則等待時間就沒有限制。" -#: ../../library/concurrent.futures.rst:655 +#: ../../library/concurrent.futures.rst:657 msgid ":pep:`3148` -- futures - execute computations asynchronously" msgstr ":pep:`3148` -- futures - 非同步地執行運算" -#: ../../library/concurrent.futures.rst:656 +#: ../../library/concurrent.futures.rst:658 msgid "" "The proposal which described this feature for inclusion in the Python " "standard library." msgstr "描述此功能並提出被包含於 Python 標準函式庫中的提案。" -#: ../../library/concurrent.futures.rst:661 +#: ../../library/concurrent.futures.rst:663 msgid "Exception classes" msgstr "例外類別" -#: ../../library/concurrent.futures.rst:667 +#: ../../library/concurrent.futures.rst:669 msgid "Raised when a future is cancelled." msgstr "當 future 被取消時引發。" -#: ../../library/concurrent.futures.rst:671 +#: ../../library/concurrent.futures.rst:673 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:676 +#: ../../library/concurrent.futures.rst:678 msgid "This class was made an alias of :exc:`TimeoutError`." msgstr "這個類別是 :exc:`TimeoutError` 的別名。" -#: ../../library/concurrent.futures.rst:681 +#: ../../library/concurrent.futures.rst:683 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 " @@ -1099,13 +1099,13 @@ msgstr "" "衍生自 :exc:`RuntimeError`,當執行器因某種原因損壞時會引發此例外類別,並且不" "能用於提交或執行新任務。" -#: ../../library/concurrent.futures.rst:689 +#: ../../library/concurrent.futures.rst:691 msgid "" "Raised when an operation is performed on a future that is not allowed in the " "current state." msgstr "目前狀態下不允許的 future 操作被執行時而引發。" -#: ../../library/concurrent.futures.rst:698 +#: ../../library/concurrent.futures.rst:700 msgid "" "Derived from :exc:`~concurrent.futures.BrokenExecutor`, this exception class " "is raised when one of the workers of a :class:`~concurrent.futures." @@ -1114,7 +1114,7 @@ msgstr "" "衍生自 :exc:`~concurrent.futures.BrokenExecutor`,當 :class:`~concurrent." "futures.ThreadPoolExecutor` 的其中一個 worker 初始化失敗時會引發此例外類別。" -#: ../../library/concurrent.futures.rst:709 +#: ../../library/concurrent.futures.rst:711 msgid "" "Derived from :exc:`~concurrent.futures.thread.BrokenThreadPool`, this " "exception class is raised when one of the workers of a :class:`~concurrent." @@ -1124,14 +1124,14 @@ msgstr "" "`~concurrent.futures.InterpreterPoolExecutor` 的其中一個 worker 初始化失敗時" "會引發此例外類別。" -#: ../../library/concurrent.futures.rst:718 +#: ../../library/concurrent.futures.rst:720 msgid "" "Raised from :class:`~concurrent.futures.InterpreterPoolExecutor` when the " "given initializer fails or from :meth:`~concurrent.futures.Executor.submit` " "when there's an uncaught exception from the submitted task." msgstr "" -#: ../../library/concurrent.futures.rst:729 +#: ../../library/concurrent.futures.rst:731 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/concurrent.interpreters.po b/library/concurrent.interpreters.po index d9f5bee41a..cd8cbd637f 100644 --- a/library/concurrent.interpreters.po +++ b/library/concurrent.interpreters.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-11-07 00:14+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -52,7 +52,7 @@ msgid ":class:`~concurrent.futures.InterpreterPoolExecutor`" msgstr ":class:`~concurrent.futures.InterpreterPoolExecutor`" #: ../../library/concurrent.interpreters.rst:32 -msgid "combines threads with interpreters in a familiar interface." +msgid "Combines threads with interpreters in a familiar interface." msgstr "" #: ../../library/concurrent.interpreters.rst:36 @@ -60,7 +60,7 @@ msgid ":ref:`isolating-extensions-howto`" msgstr ":ref:`isolating-extensions-howto`" #: ../../library/concurrent.interpreters.rst:37 -msgid "how to update an extension module to support multiple interpreters" +msgid "How to update an extension module to support multiple interpreters." msgstr "" #: ../../library/concurrent.interpreters.rst:39 @@ -166,9 +166,9 @@ msgstr "" msgid "" "Running in a different interpreter involves switching to it in the current " "thread and then calling some function. The runtime will execute the " -"function using the current interpreter's state. The :mod:`!" -"concurrent.interpreters` module provides a basic API for creating and " -"managing interpreters, as well as the switch-and-call operation." +"function using the current interpreter's state. The :mod:`!concurrent." +"interpreters` module provides a basic API for creating and managing " +"interpreters, as well as the switch-and-call operation." msgstr "" #: ../../library/concurrent.interpreters.rst:113 @@ -251,9 +251,8 @@ msgstr "" #: ../../library/concurrent.interpreters.rst:169 msgid "" -"With this in mind, the :mod:`!concurrent.interpreters` module provides " -"a :class:`queue.Queue` implementation, available " -"through :func:`create_queue`." +"With this in mind, the :mod:`!concurrent.interpreters` module provides a :" +"class:`queue.Queue` implementation, available through :func:`create_queue`." msgstr "" #: ../../library/concurrent.interpreters.rst:176 @@ -367,8 +366,8 @@ msgstr "" #: ../../library/concurrent.interpreters.rst:243 msgid "" -"Generally, :class:`Interpreter` shouldn't be called directly. Instead, " -"use :func:`create` or one of the other module functions." +"Generally, :class:`Interpreter` shouldn't be called directly. Instead, use :" +"func:`create` or one of the other module functions." msgstr "" #: ../../library/concurrent.interpreters.rst:248 @@ -458,9 +457,9 @@ msgstr "在直譯器之間溝通" #: ../../library/concurrent.interpreters.rst:324 msgid "" -"A wrapper around a low-level, cross-interpreter queue, which implements " -"the :class:`queue.Queue` interface. The underlying queue can only be " -"created through :func:`create_queue`." +"A wrapper around a low-level, cross-interpreter queue, which implements the :" +"class:`queue.Queue` interface. The underlying queue can only be created " +"through :func:`create_queue`." msgstr "" #: ../../library/concurrent.interpreters.rst:335 diff --git a/library/contextlib.po b/library/contextlib.po index 3f6522fa01..95c6fea015 100644 --- a/library/contextlib.po +++ b/library/contextlib.po @@ -636,7 +636,7 @@ msgstr "" #: ../../library/contextlib.rst:418 ../../library/contextlib.rst:490 msgid "The class can then be used like this::" -msgstr "" +msgstr "這個類別可以這樣使用: ::" #: ../../library/contextlib.rst:420 msgid "" @@ -675,7 +675,7 @@ msgstr "" #: ../../library/contextlib.rst:436 msgid "" "This change is just syntactic sugar for any construct of the following form::" -msgstr "" +msgstr "這個變更只是以下形式的語法糖: ::" #: ../../library/contextlib.rst:438 msgid "" @@ -683,10 +683,13 @@ msgid "" " with cm():\n" " # Do stuff" msgstr "" +"def f():\n" +" with cm():\n" +" # Do stuff" #: ../../library/contextlib.rst:442 msgid "``ContextDecorator`` lets you instead write::" -msgstr "" +msgstr "``ContextDecorator`` 讓你可以改寫成: ::" #: ../../library/contextlib.rst:444 msgid "" @@ -694,6 +697,9 @@ msgid "" "def f():\n" " # Do stuff" msgstr "" +"@cm()\n" +"def f():\n" +" # Do stuff" #: ../../library/contextlib.rst:448 msgid "" @@ -738,7 +744,7 @@ msgstr "" #: ../../library/contextlib.rst:474 msgid "" "Similar to :class:`ContextDecorator` but only for asynchronous functions." -msgstr "" +msgstr "和 :class:`ContextDecorator` 類似,但僅用於非同步函式。" #: ../../library/contextlib.rst:476 msgid "Example of ``AsyncContextDecorator``::" @@ -1006,15 +1012,15 @@ msgstr "" #: ../../library/contextlib.rst:649 msgid "Similar to :meth:`ExitStack.callback` but expects a coroutine function." -msgstr "" +msgstr "和 :meth:`ExitStack.callback` 類似,但預期接受一個協程函式。" #: ../../library/contextlib.rst:654 msgid "Similar to :meth:`ExitStack.close` but properly handles awaitables." -msgstr "" +msgstr "和 :meth:`ExitStack.close` 類似,但能夠正確處理可等待物件。" #: ../../library/contextlib.rst:656 msgid "Continuing the example for :func:`asynccontextmanager`::" -msgstr "" +msgstr "延續 :func:`asynccontextmanager` 的範例: ::" #: ../../library/contextlib.rst:658 msgid "" diff --git a/library/curses.po b/library/curses.po index 119b139e4d..e50f88eff9 100644 --- a/library/curses.po +++ b/library/curses.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-10-08 00:15+0000\n" +"POT-Creation-Date: 2025-11-06 00:14+0000\n" "PO-Revision-Date: 2018-05-23 14:42+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -292,7 +292,7 @@ msgid "" "const:`BUTTON_ALT`." msgstr "" -#: ../../library/curses.rst:230 ../../library/curses.rst:1799 +#: ../../library/curses.rst:230 ../../library/curses.rst:1798 msgid "" "The ``BUTTON5_*`` constants are now exposed if they are provided by the " "underlying curses library." @@ -912,7 +912,7 @@ msgstr "描述" #: ../../library/curses.rst:821 msgid "Default value" -msgstr "" +msgstr "預設值" #: ../../library/curses.rst:823 msgid "*ls*" @@ -1093,15 +1093,15 @@ msgstr "" #: ../../library/curses.rst:937 msgid "Clear the window." -msgstr "" +msgstr "清除視窗。" #: ../../library/curses.rst:942 msgid "Return a tuple ``(y, x)`` of coordinates of upper-left corner." -msgstr "" +msgstr "回傳左上角的座標 ``(y, x)``。" #: ../../library/curses.rst:947 msgid "Return the given window's current background character/attribute pair." -msgstr "" +msgstr "回傳給定視窗目前的背景字元/屬性對。" #: ../../library/curses.rst:952 msgid "" @@ -1128,7 +1128,7 @@ msgstr "" #: ../../library/curses.rst:977 msgid "Return a tuple ``(y, x)`` of the height and width of the window." -msgstr "" +msgstr "回傳視窗的高度和寬度的元組 ``(y, x)``。" #: ../../library/curses.rst:982 msgid "" @@ -1271,7 +1271,7 @@ msgstr "" #: ../../library/curses.rst:1125 msgid "Move cursor to ``(new_y, new_x)``." -msgstr "" +msgstr "移動游標到 ``(new_y, new_x)``。" #: ../../library/curses.rst:1130 msgid "" @@ -1286,7 +1286,7 @@ msgstr "" #: ../../library/curses.rst:1142 msgid "If *flag* is ``True``, :meth:`getch` will be non-blocking." -msgstr "" +msgstr "如果 *flag* 為 ``True``,則 :meth:`getch` 將為非阻塞的。" #: ../../library/curses.rst:1147 msgid "If *flag* is ``True``, escape sequences will not be timed out." @@ -1501,11 +1501,11 @@ msgid "" "return :const:`OK` upon success." msgstr "" -#: ../../library/curses.rst:1354 +#: ../../library/curses.rst:1353 msgid "A bytes object representing the current version of the module." msgstr "" -#: ../../library/curses.rst:1359 +#: ../../library/curses.rst:1358 msgid "" "A named tuple containing the three components of the ncurses library " "version: *major*, *minor*, and *patch*. All values are integers. The " @@ -1513,536 +1513,536 @@ msgid "" "is equivalent to ``curses.ncurses_version.major`` and so on." msgstr "" -#: ../../library/curses.rst:1364 +#: ../../library/curses.rst:1363 msgid "Availability: if the ncurses library is used." msgstr "" -#: ../../library/curses.rst:1370 +#: ../../library/curses.rst:1369 msgid "" "The maximum number of colors the terminal can support. It is defined only " "after the call to :func:`start_color`." msgstr "" -#: ../../library/curses.rst:1375 +#: ../../library/curses.rst:1374 msgid "" "The maximum number of color pairs the terminal can support. It is defined " "only after the call to :func:`start_color`." msgstr "" -#: ../../library/curses.rst:1380 +#: ../../library/curses.rst:1379 msgid "" "The width of the screen, i.e., the number of columns. It is defined only " "after the call to :func:`initscr`. Updated by :func:`update_lines_cols`, :" "func:`resizeterm` and :func:`resize_term`." msgstr "" -#: ../../library/curses.rst:1387 +#: ../../library/curses.rst:1386 msgid "" "The height of the screen, i.e., the number of lines. It is defined only " "after the call to :func:`initscr`. Updated by :func:`update_lines_cols`, :" "func:`resizeterm` and :func:`resize_term`." msgstr "" -#: ../../library/curses.rst:1393 +#: ../../library/curses.rst:1392 msgid "" "Some constants are available to specify character cell attributes. The exact " "constants available are system dependent." msgstr "" -#: ../../library/curses.rst:1397 +#: ../../library/curses.rst:1396 msgid "Attribute" msgstr "" -#: ../../library/curses.rst:1397 ../../library/curses.rst:1442 -#: ../../library/curses.rst:1688 ../../library/curses.rst:1780 +#: ../../library/curses.rst:1396 ../../library/curses.rst:1441 +#: ../../library/curses.rst:1687 ../../library/curses.rst:1779 msgid "Meaning" msgstr "含義" -#: ../../library/curses.rst:1399 +#: ../../library/curses.rst:1398 msgid "Alternate character set mode" msgstr "" -#: ../../library/curses.rst:1401 +#: ../../library/curses.rst:1400 msgid "Blink mode" msgstr "" -#: ../../library/curses.rst:1403 +#: ../../library/curses.rst:1402 msgid "Bold mode" msgstr "" -#: ../../library/curses.rst:1405 +#: ../../library/curses.rst:1404 msgid "Dim mode" msgstr "" -#: ../../library/curses.rst:1407 +#: ../../library/curses.rst:1406 msgid "Invisible or blank mode" msgstr "" -#: ../../library/curses.rst:1409 +#: ../../library/curses.rst:1408 msgid "Italic mode" msgstr "" -#: ../../library/curses.rst:1411 +#: ../../library/curses.rst:1410 msgid "Normal attribute" msgstr "" -#: ../../library/curses.rst:1413 +#: ../../library/curses.rst:1412 msgid "Protected mode" msgstr "" -#: ../../library/curses.rst:1415 +#: ../../library/curses.rst:1414 msgid "Reverse background and foreground colors" msgstr "" -#: ../../library/curses.rst:1418 +#: ../../library/curses.rst:1417 msgid "Standout mode" msgstr "" -#: ../../library/curses.rst:1420 +#: ../../library/curses.rst:1419 msgid "Underline mode" msgstr "" -#: ../../library/curses.rst:1422 +#: ../../library/curses.rst:1421 msgid "Horizontal highlight" msgstr "" -#: ../../library/curses.rst:1424 +#: ../../library/curses.rst:1423 msgid "Left highlight" msgstr "" -#: ../../library/curses.rst:1426 +#: ../../library/curses.rst:1425 msgid "Low highlight" msgstr "" -#: ../../library/curses.rst:1428 +#: ../../library/curses.rst:1427 msgid "Right highlight" msgstr "" -#: ../../library/curses.rst:1430 +#: ../../library/curses.rst:1429 msgid "Top highlight" msgstr "" -#: ../../library/curses.rst:1432 +#: ../../library/curses.rst:1431 msgid "Vertical highlight" msgstr "" -#: ../../library/curses.rst:1435 +#: ../../library/curses.rst:1434 msgid "``A_ITALIC`` was added." msgstr "新增 ``A_ITALIC``。" -#: ../../library/curses.rst:1438 +#: ../../library/curses.rst:1437 msgid "" "Several constants are available to extract corresponding attributes returned " "by some methods." msgstr "" -#: ../../library/curses.rst:1442 +#: ../../library/curses.rst:1441 msgid "Bit-mask" msgstr "" -#: ../../library/curses.rst:1444 +#: ../../library/curses.rst:1443 msgid "Bit-mask to extract attributes" msgstr "" -#: ../../library/curses.rst:1447 +#: ../../library/curses.rst:1446 msgid "Bit-mask to extract a character" msgstr "" -#: ../../library/curses.rst:1450 +#: ../../library/curses.rst:1449 msgid "Bit-mask to extract color-pair field information" msgstr "" -#: ../../library/curses.rst:1454 +#: ../../library/curses.rst:1453 msgid "" "Keys are referred to by integer constants with names starting with " "``KEY_``. The exact keycaps available are system dependent." msgstr "" -#: ../../library/curses.rst:1460 +#: ../../library/curses.rst:1459 msgid "Key constant" msgstr "" -#: ../../library/curses.rst:1460 +#: ../../library/curses.rst:1459 msgid "Key" msgstr "" -#: ../../library/curses.rst:1462 +#: ../../library/curses.rst:1461 msgid "Minimum key value" msgstr "" -#: ../../library/curses.rst:1464 +#: ../../library/curses.rst:1463 msgid "Break key (unreliable)" msgstr "" -#: ../../library/curses.rst:1466 +#: ../../library/curses.rst:1465 msgid "Down-arrow" msgstr "" -#: ../../library/curses.rst:1468 +#: ../../library/curses.rst:1467 msgid "Up-arrow" msgstr "" -#: ../../library/curses.rst:1470 +#: ../../library/curses.rst:1469 msgid "Left-arrow" msgstr "" -#: ../../library/curses.rst:1472 +#: ../../library/curses.rst:1471 msgid "Right-arrow" msgstr "" -#: ../../library/curses.rst:1474 +#: ../../library/curses.rst:1473 msgid "Home key (upward+left arrow)" msgstr "" -#: ../../library/curses.rst:1476 +#: ../../library/curses.rst:1475 msgid "Backspace (unreliable)" msgstr "" -#: ../../library/curses.rst:1478 +#: ../../library/curses.rst:1477 msgid "Function keys. Up to 64 function keys are supported." msgstr "" -#: ../../library/curses.rst:1481 +#: ../../library/curses.rst:1480 msgid "Value of function key *n*" msgstr "" -#: ../../library/curses.rst:1483 +#: ../../library/curses.rst:1482 msgid "Delete line" msgstr "" -#: ../../library/curses.rst:1485 +#: ../../library/curses.rst:1484 msgid "Insert line" msgstr "" -#: ../../library/curses.rst:1487 +#: ../../library/curses.rst:1486 msgid "Delete character" msgstr "" -#: ../../library/curses.rst:1489 +#: ../../library/curses.rst:1488 msgid "Insert char or enter insert mode" msgstr "" -#: ../../library/curses.rst:1491 +#: ../../library/curses.rst:1490 msgid "Exit insert char mode" msgstr "" -#: ../../library/curses.rst:1493 +#: ../../library/curses.rst:1492 msgid "Clear screen" msgstr "" -#: ../../library/curses.rst:1495 +#: ../../library/curses.rst:1494 msgid "Clear to end of screen" msgstr "" -#: ../../library/curses.rst:1497 +#: ../../library/curses.rst:1496 msgid "Clear to end of line" msgstr "" -#: ../../library/curses.rst:1499 +#: ../../library/curses.rst:1498 msgid "Scroll 1 line forward" msgstr "" -#: ../../library/curses.rst:1501 +#: ../../library/curses.rst:1500 msgid "Scroll 1 line backward (reverse)" msgstr "" -#: ../../library/curses.rst:1503 +#: ../../library/curses.rst:1502 msgid "Next page" msgstr "" -#: ../../library/curses.rst:1505 +#: ../../library/curses.rst:1504 msgid "Previous page" msgstr "" -#: ../../library/curses.rst:1507 +#: ../../library/curses.rst:1506 msgid "Set tab" msgstr "" -#: ../../library/curses.rst:1509 +#: ../../library/curses.rst:1508 msgid "Clear tab" msgstr "" -#: ../../library/curses.rst:1511 +#: ../../library/curses.rst:1510 msgid "Clear all tabs" msgstr "" -#: ../../library/curses.rst:1513 +#: ../../library/curses.rst:1512 msgid "Enter or send (unreliable)" msgstr "" -#: ../../library/curses.rst:1515 +#: ../../library/curses.rst:1514 msgid "Soft (partial) reset (unreliable)" msgstr "" -#: ../../library/curses.rst:1517 +#: ../../library/curses.rst:1516 msgid "Reset or hard reset (unreliable)" msgstr "" -#: ../../library/curses.rst:1519 +#: ../../library/curses.rst:1518 msgid "Print" msgstr "" -#: ../../library/curses.rst:1521 +#: ../../library/curses.rst:1520 msgid "Home down or bottom (lower left)" msgstr "" -#: ../../library/curses.rst:1523 +#: ../../library/curses.rst:1522 msgid "Upper left of keypad" msgstr "" -#: ../../library/curses.rst:1525 +#: ../../library/curses.rst:1524 msgid "Upper right of keypad" msgstr "" -#: ../../library/curses.rst:1527 +#: ../../library/curses.rst:1526 msgid "Center of keypad" msgstr "" -#: ../../library/curses.rst:1529 +#: ../../library/curses.rst:1528 msgid "Lower left of keypad" msgstr "" -#: ../../library/curses.rst:1531 +#: ../../library/curses.rst:1530 msgid "Lower right of keypad" msgstr "" -#: ../../library/curses.rst:1533 +#: ../../library/curses.rst:1532 msgid "Back tab" msgstr "" -#: ../../library/curses.rst:1535 +#: ../../library/curses.rst:1534 msgid "Beg (beginning)" msgstr "" -#: ../../library/curses.rst:1537 +#: ../../library/curses.rst:1536 msgid "Cancel" msgstr "" -#: ../../library/curses.rst:1539 +#: ../../library/curses.rst:1538 msgid "Close" msgstr "" -#: ../../library/curses.rst:1541 +#: ../../library/curses.rst:1540 msgid "Cmd (command)" msgstr "" -#: ../../library/curses.rst:1543 +#: ../../library/curses.rst:1542 msgid "Copy" msgstr "" -#: ../../library/curses.rst:1545 +#: ../../library/curses.rst:1544 msgid "Create" msgstr "" -#: ../../library/curses.rst:1547 +#: ../../library/curses.rst:1546 msgid "End" msgstr "" -#: ../../library/curses.rst:1549 +#: ../../library/curses.rst:1548 msgid "Exit" msgstr "" -#: ../../library/curses.rst:1551 +#: ../../library/curses.rst:1550 msgid "Find" msgstr "" -#: ../../library/curses.rst:1553 +#: ../../library/curses.rst:1552 msgid "Help" msgstr "" -#: ../../library/curses.rst:1555 +#: ../../library/curses.rst:1554 msgid "Mark" msgstr "" -#: ../../library/curses.rst:1557 +#: ../../library/curses.rst:1556 msgid "Message" msgstr "" -#: ../../library/curses.rst:1559 +#: ../../library/curses.rst:1558 msgid "Move" msgstr "" -#: ../../library/curses.rst:1561 +#: ../../library/curses.rst:1560 msgid "Next" msgstr "" -#: ../../library/curses.rst:1563 +#: ../../library/curses.rst:1562 msgid "Open" msgstr "" -#: ../../library/curses.rst:1565 +#: ../../library/curses.rst:1564 msgid "Options" msgstr "" -#: ../../library/curses.rst:1567 +#: ../../library/curses.rst:1566 msgid "Prev (previous)" msgstr "" -#: ../../library/curses.rst:1569 +#: ../../library/curses.rst:1568 msgid "Redo" msgstr "" -#: ../../library/curses.rst:1571 +#: ../../library/curses.rst:1570 msgid "Ref (reference)" msgstr "" -#: ../../library/curses.rst:1573 +#: ../../library/curses.rst:1572 msgid "Refresh" msgstr "" -#: ../../library/curses.rst:1575 +#: ../../library/curses.rst:1574 msgid "Replace" msgstr "" -#: ../../library/curses.rst:1577 +#: ../../library/curses.rst:1576 msgid "Restart" msgstr "" -#: ../../library/curses.rst:1579 +#: ../../library/curses.rst:1578 msgid "Resume" msgstr "" -#: ../../library/curses.rst:1581 +#: ../../library/curses.rst:1580 msgid "Save" msgstr "" -#: ../../library/curses.rst:1583 +#: ../../library/curses.rst:1582 msgid "Shifted Beg (beginning)" msgstr "" -#: ../../library/curses.rst:1585 +#: ../../library/curses.rst:1584 msgid "Shifted Cancel" msgstr "" -#: ../../library/curses.rst:1587 +#: ../../library/curses.rst:1586 msgid "Shifted Command" msgstr "" -#: ../../library/curses.rst:1589 +#: ../../library/curses.rst:1588 msgid "Shifted Copy" msgstr "" -#: ../../library/curses.rst:1591 +#: ../../library/curses.rst:1590 msgid "Shifted Create" msgstr "" -#: ../../library/curses.rst:1593 +#: ../../library/curses.rst:1592 msgid "Shifted Delete char" msgstr "" -#: ../../library/curses.rst:1595 +#: ../../library/curses.rst:1594 msgid "Shifted Delete line" msgstr "" -#: ../../library/curses.rst:1597 +#: ../../library/curses.rst:1596 msgid "Select" msgstr "" -#: ../../library/curses.rst:1599 +#: ../../library/curses.rst:1598 msgid "Shifted End" msgstr "" -#: ../../library/curses.rst:1601 +#: ../../library/curses.rst:1600 msgid "Shifted Clear line" msgstr "" -#: ../../library/curses.rst:1603 +#: ../../library/curses.rst:1602 msgid "Shifted Exit" msgstr "" -#: ../../library/curses.rst:1605 +#: ../../library/curses.rst:1604 msgid "Shifted Find" msgstr "" -#: ../../library/curses.rst:1607 +#: ../../library/curses.rst:1606 msgid "Shifted Help" msgstr "" -#: ../../library/curses.rst:1609 +#: ../../library/curses.rst:1608 msgid "Shifted Home" msgstr "" -#: ../../library/curses.rst:1611 +#: ../../library/curses.rst:1610 msgid "Shifted Input" msgstr "" -#: ../../library/curses.rst:1613 +#: ../../library/curses.rst:1612 msgid "Shifted Left arrow" msgstr "" -#: ../../library/curses.rst:1615 +#: ../../library/curses.rst:1614 msgid "Shifted Message" msgstr "" -#: ../../library/curses.rst:1617 +#: ../../library/curses.rst:1616 msgid "Shifted Move" msgstr "" -#: ../../library/curses.rst:1619 +#: ../../library/curses.rst:1618 msgid "Shifted Next" msgstr "" -#: ../../library/curses.rst:1621 +#: ../../library/curses.rst:1620 msgid "Shifted Options" msgstr "" -#: ../../library/curses.rst:1623 +#: ../../library/curses.rst:1622 msgid "Shifted Prev" msgstr "" -#: ../../library/curses.rst:1625 +#: ../../library/curses.rst:1624 msgid "Shifted Print" msgstr "" -#: ../../library/curses.rst:1627 +#: ../../library/curses.rst:1626 msgid "Shifted Redo" msgstr "" -#: ../../library/curses.rst:1629 +#: ../../library/curses.rst:1628 msgid "Shifted Replace" msgstr "" -#: ../../library/curses.rst:1631 +#: ../../library/curses.rst:1630 msgid "Shifted Right arrow" msgstr "" -#: ../../library/curses.rst:1633 +#: ../../library/curses.rst:1632 msgid "Shifted Resume" msgstr "" -#: ../../library/curses.rst:1635 +#: ../../library/curses.rst:1634 msgid "Shifted Save" msgstr "" -#: ../../library/curses.rst:1637 +#: ../../library/curses.rst:1636 msgid "Shifted Suspend" msgstr "" -#: ../../library/curses.rst:1639 +#: ../../library/curses.rst:1638 msgid "Shifted Undo" msgstr "" -#: ../../library/curses.rst:1641 +#: ../../library/curses.rst:1640 msgid "Suspend" msgstr "" -#: ../../library/curses.rst:1643 +#: ../../library/curses.rst:1642 msgid "Undo" msgstr "" -#: ../../library/curses.rst:1645 +#: ../../library/curses.rst:1644 msgid "Mouse event has occurred" msgstr "" -#: ../../library/curses.rst:1647 +#: ../../library/curses.rst:1646 msgid "Terminal resize event" msgstr "" -#: ../../library/curses.rst:1649 +#: ../../library/curses.rst:1648 msgid "Maximum key value" msgstr "" -#: ../../library/curses.rst:1652 +#: ../../library/curses.rst:1651 msgid "" "On VT100s and their software emulations, such as X terminal emulators, there " "are normally at least four function keys (:const:`KEY_F1 `, :const:" @@ -2054,64 +2054,64 @@ msgid "" "keypad mappings are standard:" msgstr "" -#: ../../library/curses.rst:1661 +#: ../../library/curses.rst:1660 msgid "Keycap" msgstr "" -#: ../../library/curses.rst:1661 ../../library/curses.rst:1806 -#: ../../library/curses.rst:1930 +#: ../../library/curses.rst:1660 ../../library/curses.rst:1805 +#: ../../library/curses.rst:1929 msgid "Constant" msgstr "" -#: ../../library/curses.rst:1663 +#: ../../library/curses.rst:1662 msgid ":kbd:`Insert`" msgstr ":kbd:`Insert`" -#: ../../library/curses.rst:1663 +#: ../../library/curses.rst:1662 msgid "KEY_IC" msgstr "KEY_IC" -#: ../../library/curses.rst:1665 +#: ../../library/curses.rst:1664 msgid ":kbd:`Delete`" msgstr ":kbd:`Delete`" -#: ../../library/curses.rst:1665 +#: ../../library/curses.rst:1664 msgid "KEY_DC" msgstr "KEY_DC" -#: ../../library/curses.rst:1667 +#: ../../library/curses.rst:1666 msgid ":kbd:`Home`" msgstr ":kbd:`Home`" -#: ../../library/curses.rst:1667 +#: ../../library/curses.rst:1666 msgid "KEY_HOME" msgstr "KEY_HOME" -#: ../../library/curses.rst:1669 +#: ../../library/curses.rst:1668 msgid ":kbd:`End`" msgstr ":kbd:`End`" -#: ../../library/curses.rst:1669 +#: ../../library/curses.rst:1668 msgid "KEY_END" msgstr "KEY_END" -#: ../../library/curses.rst:1671 +#: ../../library/curses.rst:1670 msgid ":kbd:`Page Up`" msgstr ":kbd:`Page Up`" -#: ../../library/curses.rst:1671 +#: ../../library/curses.rst:1670 msgid "KEY_PPAGE" msgstr "KEY_PPAGE" -#: ../../library/curses.rst:1673 +#: ../../library/curses.rst:1672 msgid ":kbd:`Page Down`" msgstr ":kbd:`Page Down`" -#: ../../library/curses.rst:1673 +#: ../../library/curses.rst:1672 msgid "KEY_NPAGE" msgstr "KEY_NPAGE" -#: ../../library/curses.rst:1678 +#: ../../library/curses.rst:1677 msgid "" "The following table lists characters from the alternate character set. These " "are inherited from the VT100 terminal, and will generally be available on " @@ -2119,268 +2119,268 @@ msgid "" "available, curses falls back on a crude printable ASCII approximation." msgstr "" -#: ../../library/curses.rst:1685 +#: ../../library/curses.rst:1684 msgid "These are available only after :func:`initscr` has been called." msgstr "" -#: ../../library/curses.rst:1688 +#: ../../library/curses.rst:1687 msgid "ACS code" msgstr "" -#: ../../library/curses.rst:1690 +#: ../../library/curses.rst:1689 msgid "alternate name for upper right corner" msgstr "" -#: ../../library/curses.rst:1692 +#: ../../library/curses.rst:1691 msgid "solid square block" msgstr "" -#: ../../library/curses.rst:1694 +#: ../../library/curses.rst:1693 msgid "board of squares" msgstr "" -#: ../../library/curses.rst:1696 +#: ../../library/curses.rst:1695 msgid "alternate name for horizontal line" msgstr "" -#: ../../library/curses.rst:1698 +#: ../../library/curses.rst:1697 msgid "alternate name for upper left corner" msgstr "" -#: ../../library/curses.rst:1700 +#: ../../library/curses.rst:1699 msgid "alternate name for top tee" msgstr "" -#: ../../library/curses.rst:1702 +#: ../../library/curses.rst:1701 msgid "bottom tee" msgstr "" -#: ../../library/curses.rst:1704 +#: ../../library/curses.rst:1703 msgid "bullet" msgstr "" -#: ../../library/curses.rst:1706 +#: ../../library/curses.rst:1705 msgid "checker board (stipple)" msgstr "" -#: ../../library/curses.rst:1708 +#: ../../library/curses.rst:1707 msgid "arrow pointing down" msgstr "" -#: ../../library/curses.rst:1710 +#: ../../library/curses.rst:1709 msgid "degree symbol" msgstr "" -#: ../../library/curses.rst:1712 +#: ../../library/curses.rst:1711 msgid "diamond" msgstr "" -#: ../../library/curses.rst:1714 +#: ../../library/curses.rst:1713 msgid "greater-than-or-equal-to" msgstr "" -#: ../../library/curses.rst:1716 +#: ../../library/curses.rst:1715 msgid "horizontal line" msgstr "" -#: ../../library/curses.rst:1718 +#: ../../library/curses.rst:1717 msgid "lantern symbol" msgstr "" -#: ../../library/curses.rst:1720 +#: ../../library/curses.rst:1719 msgid "left arrow" msgstr "" -#: ../../library/curses.rst:1722 +#: ../../library/curses.rst:1721 msgid "less-than-or-equal-to" msgstr "" -#: ../../library/curses.rst:1724 +#: ../../library/curses.rst:1723 msgid "lower left-hand corner" msgstr "" -#: ../../library/curses.rst:1726 +#: ../../library/curses.rst:1725 msgid "lower right-hand corner" msgstr "" -#: ../../library/curses.rst:1728 +#: ../../library/curses.rst:1727 msgid "left tee" msgstr "" -#: ../../library/curses.rst:1730 +#: ../../library/curses.rst:1729 msgid "not-equal sign" msgstr "" -#: ../../library/curses.rst:1732 +#: ../../library/curses.rst:1731 msgid "letter pi" msgstr "" -#: ../../library/curses.rst:1734 +#: ../../library/curses.rst:1733 msgid "plus-or-minus sign" msgstr "" -#: ../../library/curses.rst:1736 +#: ../../library/curses.rst:1735 msgid "big plus sign" msgstr "" -#: ../../library/curses.rst:1738 +#: ../../library/curses.rst:1737 msgid "right arrow" msgstr "" -#: ../../library/curses.rst:1740 +#: ../../library/curses.rst:1739 msgid "right tee" msgstr "" -#: ../../library/curses.rst:1742 +#: ../../library/curses.rst:1741 msgid "scan line 1" msgstr "" -#: ../../library/curses.rst:1744 +#: ../../library/curses.rst:1743 msgid "scan line 3" msgstr "" -#: ../../library/curses.rst:1746 +#: ../../library/curses.rst:1745 msgid "scan line 7" msgstr "" -#: ../../library/curses.rst:1748 +#: ../../library/curses.rst:1747 msgid "scan line 9" msgstr "" -#: ../../library/curses.rst:1750 +#: ../../library/curses.rst:1749 msgid "alternate name for lower right corner" msgstr "" -#: ../../library/curses.rst:1752 +#: ../../library/curses.rst:1751 msgid "alternate name for vertical line" msgstr "" -#: ../../library/curses.rst:1754 +#: ../../library/curses.rst:1753 msgid "alternate name for right tee" msgstr "" -#: ../../library/curses.rst:1756 +#: ../../library/curses.rst:1755 msgid "alternate name for lower left corner" msgstr "" -#: ../../library/curses.rst:1758 +#: ../../library/curses.rst:1757 msgid "alternate name for bottom tee" msgstr "" -#: ../../library/curses.rst:1760 +#: ../../library/curses.rst:1759 msgid "alternate name for left tee" msgstr "" -#: ../../library/curses.rst:1762 +#: ../../library/curses.rst:1761 msgid "alternate name for crossover or big plus" msgstr "" -#: ../../library/curses.rst:1764 +#: ../../library/curses.rst:1763 msgid "pound sterling" msgstr "" -#: ../../library/curses.rst:1766 +#: ../../library/curses.rst:1765 msgid "top tee" msgstr "" -#: ../../library/curses.rst:1768 +#: ../../library/curses.rst:1767 msgid "up arrow" msgstr "" -#: ../../library/curses.rst:1770 +#: ../../library/curses.rst:1769 msgid "upper left corner" msgstr "" -#: ../../library/curses.rst:1772 +#: ../../library/curses.rst:1771 msgid "upper right corner" msgstr "" -#: ../../library/curses.rst:1774 +#: ../../library/curses.rst:1773 msgid "vertical line" msgstr "" -#: ../../library/curses.rst:1777 +#: ../../library/curses.rst:1776 msgid "" "The following table lists mouse button constants used by :meth:`getmouse`:" msgstr "" -#: ../../library/curses.rst:1780 +#: ../../library/curses.rst:1779 msgid "Mouse button constant" msgstr "" -#: ../../library/curses.rst:1782 +#: ../../library/curses.rst:1781 msgid "Mouse button *n* pressed" msgstr "" -#: ../../library/curses.rst:1784 +#: ../../library/curses.rst:1783 msgid "Mouse button *n* released" msgstr "" -#: ../../library/curses.rst:1786 +#: ../../library/curses.rst:1785 msgid "Mouse button *n* clicked" msgstr "" -#: ../../library/curses.rst:1788 +#: ../../library/curses.rst:1787 msgid "Mouse button *n* double clicked" msgstr "" -#: ../../library/curses.rst:1790 +#: ../../library/curses.rst:1789 msgid "Mouse button *n* triple clicked" msgstr "" -#: ../../library/curses.rst:1792 +#: ../../library/curses.rst:1791 msgid "Shift was down during button state change" msgstr "" -#: ../../library/curses.rst:1794 ../../library/curses.rst:1796 +#: ../../library/curses.rst:1793 ../../library/curses.rst:1795 msgid "Control was down during button state change" msgstr "" -#: ../../library/curses.rst:1803 +#: ../../library/curses.rst:1802 msgid "The following table lists the predefined colors:" msgstr "" -#: ../../library/curses.rst:1806 +#: ../../library/curses.rst:1805 msgid "Color" msgstr "顏色" -#: ../../library/curses.rst:1808 +#: ../../library/curses.rst:1807 msgid "Black" msgstr "黑" -#: ../../library/curses.rst:1810 +#: ../../library/curses.rst:1809 msgid "Blue" msgstr "藍" -#: ../../library/curses.rst:1812 +#: ../../library/curses.rst:1811 msgid "Cyan (light greenish blue)" msgstr "" -#: ../../library/curses.rst:1814 +#: ../../library/curses.rst:1813 msgid "Green" msgstr "綠" -#: ../../library/curses.rst:1816 +#: ../../library/curses.rst:1815 msgid "Magenta (purplish red)" msgstr "" -#: ../../library/curses.rst:1818 +#: ../../library/curses.rst:1817 msgid "Red" msgstr "紅" -#: ../../library/curses.rst:1820 +#: ../../library/curses.rst:1819 msgid "White" msgstr "白" -#: ../../library/curses.rst:1822 +#: ../../library/curses.rst:1821 msgid "Yellow" msgstr "" -#: ../../library/curses.rst:1827 +#: ../../library/curses.rst:1826 msgid ":mod:`curses.textpad` --- Text input widget for curses programs" msgstr "" -#: ../../library/curses.rst:1835 +#: ../../library/curses.rst:1834 msgid "" "The :mod:`curses.textpad` module provides a :class:`Textbox` class that " "handles elementary text editing in a curses window, supporting a set of " @@ -2390,11 +2390,11 @@ msgid "" "purposes." msgstr "" -#: ../../library/curses.rst:1841 +#: ../../library/curses.rst:1840 msgid "The module :mod:`curses.textpad` defines the following function:" msgstr ":mod:`curses.textpad` 模組定義了以下函式:" -#: ../../library/curses.rst:1846 +#: ../../library/curses.rst:1845 msgid "" "Draw a rectangle. The first argument must be a window object; the remaining " "arguments are coordinates relative to that window. The second and third " @@ -2406,15 +2406,15 @@ msgid "" "will be drawn with ASCII dashes, vertical bars, and plus signs." msgstr "" -#: ../../library/curses.rst:1859 +#: ../../library/curses.rst:1858 msgid "Textbox objects" msgstr "" -#: ../../library/curses.rst:1861 +#: ../../library/curses.rst:1860 msgid "You can instantiate a :class:`Textbox` object as follows:" msgstr "" -#: ../../library/curses.rst:1866 +#: ../../library/curses.rst:1865 msgid "" "Return a textbox widget object. The *win* argument should be a curses :ref:" "`window ` object in which the textbox is to be " @@ -2423,11 +2423,11 @@ msgid "" "instance's :attr:`stripspaces` flag is initially on." msgstr "" -#: ../../library/curses.rst:1872 +#: ../../library/curses.rst:1871 msgid ":class:`Textbox` objects have the following methods:" msgstr "" -#: ../../library/curses.rst:1877 +#: ../../library/curses.rst:1876 msgid "" "This is the entry point you will normally use. It accepts editing " "keystrokes until one of the termination keystrokes is entered. If " @@ -2438,167 +2438,167 @@ msgid "" "`stripspaces` attribute." msgstr "" -#: ../../library/curses.rst:1888 +#: ../../library/curses.rst:1887 msgid "" "Process a single command keystroke. Here are the supported special " "keystrokes:" msgstr "" -#: ../../library/curses.rst:1892 ../../library/curses.rst:1930 +#: ../../library/curses.rst:1891 ../../library/curses.rst:1929 msgid "Keystroke" msgstr "" -#: ../../library/curses.rst:1892 +#: ../../library/curses.rst:1891 msgid "Action" msgstr "" -#: ../../library/curses.rst:1894 +#: ../../library/curses.rst:1893 msgid ":kbd:`Control-A`" msgstr ":kbd:`Control-A`" -#: ../../library/curses.rst:1894 +#: ../../library/curses.rst:1893 msgid "Go to left edge of window." msgstr "" -#: ../../library/curses.rst:1896 ../../library/curses.rst:1932 +#: ../../library/curses.rst:1895 ../../library/curses.rst:1931 msgid ":kbd:`Control-B`" msgstr ":kbd:`Control-B`" -#: ../../library/curses.rst:1896 +#: ../../library/curses.rst:1895 msgid "Cursor left, wrapping to previous line if appropriate." msgstr "" -#: ../../library/curses.rst:1899 +#: ../../library/curses.rst:1898 msgid ":kbd:`Control-D`" msgstr ":kbd:`Control-D`" -#: ../../library/curses.rst:1899 +#: ../../library/curses.rst:1898 msgid "Delete character under cursor." msgstr "" -#: ../../library/curses.rst:1901 +#: ../../library/curses.rst:1900 msgid ":kbd:`Control-E`" msgstr ":kbd:`Control-E`" -#: ../../library/curses.rst:1901 +#: ../../library/curses.rst:1900 msgid "Go to right edge (stripspaces off) or end of line (stripspaces on)." msgstr "" -#: ../../library/curses.rst:1904 ../../library/curses.rst:1934 +#: ../../library/curses.rst:1903 ../../library/curses.rst:1933 msgid ":kbd:`Control-F`" msgstr ":kbd:`Control-F`" -#: ../../library/curses.rst:1904 +#: ../../library/curses.rst:1903 msgid "Cursor right, wrapping to next line when appropriate." msgstr "" -#: ../../library/curses.rst:1907 +#: ../../library/curses.rst:1906 msgid ":kbd:`Control-G`" msgstr ":kbd:`Control-G`" -#: ../../library/curses.rst:1907 +#: ../../library/curses.rst:1906 msgid "Terminate, returning the window contents." msgstr "" -#: ../../library/curses.rst:1909 +#: ../../library/curses.rst:1908 msgid ":kbd:`Control-H`" msgstr ":kbd:`Control-H`" -#: ../../library/curses.rst:1909 +#: ../../library/curses.rst:1908 msgid "Delete character backward." msgstr "" -#: ../../library/curses.rst:1911 +#: ../../library/curses.rst:1910 msgid ":kbd:`Control-J`" msgstr ":kbd:`Control-J`" -#: ../../library/curses.rst:1911 +#: ../../library/curses.rst:1910 msgid "Terminate if the window is 1 line, otherwise insert newline." msgstr "" -#: ../../library/curses.rst:1914 +#: ../../library/curses.rst:1913 msgid ":kbd:`Control-K`" msgstr ":kbd:`Control-K`" -#: ../../library/curses.rst:1914 +#: ../../library/curses.rst:1913 msgid "If line is blank, delete it, otherwise clear to end of line." msgstr "" -#: ../../library/curses.rst:1917 +#: ../../library/curses.rst:1916 msgid ":kbd:`Control-L`" msgstr ":kbd:`Control-L`" -#: ../../library/curses.rst:1917 +#: ../../library/curses.rst:1916 msgid "Refresh screen." msgstr "" -#: ../../library/curses.rst:1919 ../../library/curses.rst:1938 +#: ../../library/curses.rst:1918 ../../library/curses.rst:1937 msgid ":kbd:`Control-N`" msgstr ":kbd:`Control-N`" -#: ../../library/curses.rst:1919 +#: ../../library/curses.rst:1918 msgid "Cursor down; move down one line." msgstr "" -#: ../../library/curses.rst:1921 +#: ../../library/curses.rst:1920 msgid ":kbd:`Control-O`" msgstr ":kbd:`Control-O`" -#: ../../library/curses.rst:1921 +#: ../../library/curses.rst:1920 msgid "Insert a blank line at cursor location." msgstr "" -#: ../../library/curses.rst:1923 ../../library/curses.rst:1936 +#: ../../library/curses.rst:1922 ../../library/curses.rst:1935 msgid ":kbd:`Control-P`" msgstr ":kbd:`Control-P`" -#: ../../library/curses.rst:1923 +#: ../../library/curses.rst:1922 msgid "Cursor up; move up one line." msgstr "" -#: ../../library/curses.rst:1926 +#: ../../library/curses.rst:1925 msgid "" "Move operations do nothing if the cursor is at an edge where the movement is " "not possible. The following synonyms are supported where possible:" msgstr "" -#: ../../library/curses.rst:1932 +#: ../../library/curses.rst:1931 msgid ":const:`~curses.KEY_LEFT`" msgstr ":const:`~curses.KEY_LEFT`" -#: ../../library/curses.rst:1934 +#: ../../library/curses.rst:1933 msgid ":const:`~curses.KEY_RIGHT`" msgstr ":const:`~curses.KEY_RIGHT`" -#: ../../library/curses.rst:1936 +#: ../../library/curses.rst:1935 msgid ":const:`~curses.KEY_UP`" msgstr ":const:`~curses.KEY_UP`" -#: ../../library/curses.rst:1938 +#: ../../library/curses.rst:1937 msgid ":const:`~curses.KEY_DOWN`" msgstr ":const:`~curses.KEY_DOWN`" -#: ../../library/curses.rst:1940 +#: ../../library/curses.rst:1939 msgid ":const:`~curses.KEY_BACKSPACE`" msgstr ":const:`~curses.KEY_BACKSPACE`" -#: ../../library/curses.rst:1940 +#: ../../library/curses.rst:1939 msgid ":kbd:`Control-h`" msgstr ":kbd:`Control-h`" -#: ../../library/curses.rst:1943 +#: ../../library/curses.rst:1942 msgid "" "All other keystrokes are treated as a command to insert the given character " "and move right (with line wrapping)." msgstr "" -#: ../../library/curses.rst:1949 +#: ../../library/curses.rst:1948 msgid "" "Return the window contents as a string; whether blanks in the window are " "included is affected by the :attr:`stripspaces` member." msgstr "" -#: ../../library/curses.rst:1955 +#: ../../library/curses.rst:1954 msgid "" "This attribute is a flag which controls the interpretation of blanks in the " "window. When it is on, trailing blanks on each line are ignored; any cursor " diff --git a/library/dataclasses.po b/library/dataclasses.po index af92b95301..909114c1fc 100644 --- a/library/dataclasses.po +++ b/library/dataclasses.po @@ -991,6 +991,8 @@ msgid "" "def is_dataclass_instance(obj):\n" " return is_dataclass(obj) and not isinstance(obj, type)" msgstr "" +"def is_dataclass_instance(obj):\n" +" return is_dataclass(obj) and not isinstance(obj, type)" #: ../../library/dataclasses.rst:511 #, fuzzy diff --git a/library/devmode.po b/library/devmode.po index 59d251bae1..9fc4d2e6bd 100644 --- a/library/devmode.po +++ b/library/devmode.po @@ -361,6 +361,11 @@ msgid "" " nlines = len(fp.readlines())\n" " print(nlines)" msgstr "" +"def main():\n" +" # 在退出 with 區塊時明確關閉檔案\n" +" with open(sys.argv[1]) as fp:\n" +" nlines = len(fp.readlines())\n" +" print(nlines)" #: ../../library/devmode.rst:168 msgid "" diff --git a/library/dis.po b/library/dis.po index 0f0a086366..03384ac2f9 100644 --- a/library/dis.po +++ b/library/dis.po @@ -115,6 +115,7 @@ msgid "" "the following command can be used to display the disassembly of :func:`!" "myfunc`:" msgstr "" +"可以使用以下指令來顯示 :func:`!myfunc` 的反組譯:" #: ../../library/dis.rst:73 msgid "" diff --git a/library/functools.po b/library/functools.po index 35b6b07dfe..c92f1cdd68 100644 --- a/library/functools.po +++ b/library/functools.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-10-08 00:15+0000\n" +"POT-Creation-Date: 2025-11-06 00:14+0000\n" "PO-Revision-Date: 2024-05-11 16:02+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -71,13 +71,11 @@ msgid "" "def factorial(n):\n" " return n * factorial(n-1) if n else 1\n" "\n" -">>> factorial(10) # no previously cached result, makes 11 recursive " -"calls\n" +">>> factorial(10) # no previously cached result, makes 11 recursive calls\n" "3628800\n" -">>> factorial(5) # just looks up cached value result\n" +">>> factorial(5) # no new calls, just returns the cached result\n" "120\n" -">>> factorial(12) # makes two new recursive calls, the other 10 are " -"cached\n" +">>> factorial(12) # two new recursive calls, factorial(10) is cached\n" "479001600" msgstr "" "@cache\n" @@ -86,9 +84,9 @@ msgstr "" "\n" ">>> factorial(10) # 沒有先前的快取結果,會進行 11 次遞迴呼叫\n" "3628800\n" -">>> factorial(5) # 只查詢快取的結果\n" +">>> factorial(5) # 沒有新的呼叫,直接回傳被快取起來的結果\n" "120\n" -">>> factorial(12) # 進行兩次新的遞迴呼叫,其他 10 次是快取的\n" +">>> factorial(12) # 兩次新的遞迴呼叫,factorial(10) 有被快取起來\n" "479001600" #: ../../library/functools.rst:52 ../../library/functools.rst:158 @@ -1293,8 +1291,8 @@ msgid "" "``Negator`` class with the ``neg`` methods bound to the class, rather than " "an instance of the class::" msgstr "" -"``@singledispatchmethod`` 支援與其他裝飾器巢狀使用 (nesting),例如 :" -"deco:`classmethod`。請注意,為了使 ``dispatcher.register`` 可用," +"``@singledispatchmethod`` 支援與其他裝飾器巢狀使用 (nesting),例如 :deco:" +"`classmethod`。請注意,為了使 ``dispatcher.register`` 可用," "``singledispatchmethod`` 必須是\\ *最外面的*\\ 裝飾器。以下範例是 " "``Negator`` 類別,其 ``neg`` 方法繫結到該類別,而不是該類別的實例: ::" @@ -1337,7 +1335,8 @@ msgid "" "The same pattern can be used for other similar decorators: :deco:" "`staticmethod`, :deco:`~abc.abstractmethod`, and others." msgstr "" -"相同的模式可用於其他類似的裝飾器::deco:`staticmethod`、:deco:`~abc.abstractmethod` 等。" +"相同的模式可用於其他類似的裝飾器::deco:`staticmethod`、:deco:`~abc." +"abstractmethod` 等。" #: ../../library/functools.rst:722 msgid "" diff --git a/library/heapq.po b/library/heapq.po index 9808eef359..5dd4ca0601 100644 --- a/library/heapq.po +++ b/library/heapq.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-11-07 00:14+0000\n" "PO-Revision-Date: 2023-07-01 18:20+0800\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -42,8 +42,8 @@ msgid "" "or equal to any of its children. We refer to this condition as the heap " "invariant." msgstr "" -"最小堆積 (min-heap) 是一顆二元樹,樹上每個父節點的值都小於或等於其子節點的值。" -"我們將這種情況稱為堆積性質不變 (heap invariant)。" +"最小堆積 (min-heap) 是一顆二元樹,樹上每個父節點的值都小於或等於其子節點的" +"值。我們將這種情況稱為堆積性質不變 (heap invariant)。" #: ../../library/heapq.rst:23 msgid "" @@ -53,10 +53,9 @@ msgid "" "property of a min-heap is that its smallest element is always the root, " "``heap[0]``." msgstr "" -"對於最小堆積,此實作使用串列,對於所有存在的被比較元素,*k* 都滿足 " -"``heap[k] <= heap[2*k+1]`` 和 ``heap[k] <= heap[2*k+2]``。" -"元素是從零開始計數。最小堆積有一個有趣的性質:最小的元素永遠在根節點 " -"``heap[0]``。" +"對於最小堆積,此實作使用串列,對於所有存在的被比較元素,*k* 都滿足 ``heap[k] " +"<= heap[2*k+1]`` 和 ``heap[k] <= heap[2*k+2]``。元素是從零開始計數。最小堆積" +"有一個有趣的性質:最小的元素永遠在根節點 ``heap[0]``。" #: ../../library/heapq.rst:29 msgid "" @@ -75,14 +74,14 @@ msgid "" "index for a node and the indexes for its children slightly less obvious, but " "is more suitable since Python uses zero-based indexing. (b) Textbooks often " "focus on max-heaps, due to their suitability for in-place sorting. Our " -"implementation favors min-heaps as they better correspond to " -"Python :class:`lists `." +"implementation favors min-heaps as they better correspond to Python :class:" +"`lists `." msgstr "" -":mod:`!heapq` API 與教科書上的堆積演算法在兩個方面不同:" -"(a) 我們使用從零開始的索引。這使得節點索引和其子節點索引之間的關係變得" -"不那麼明顯,但由於 Python 使用從零開始的索引,所以這樣更適合。" -"(b) 教科書通常專注於最大堆積,因為它們適合原地排序。我們的實作偏向於" -"最小堆積,因為它們更符合 Python :class:`串列 `。" +":mod:`!heapq` API 與教科書上的堆積演算法在兩個方面不同:(a) 我們使用從零開始" +"的索引。這使得節點索引和其子節點索引之間的關係變得不那麼明顯,但由於 Python " +"使用從零開始的索引,所以這樣更適合。(b) 教科書通常專注於最大堆積,因為它們適" +"合原地排序。我們的實作偏向於最小堆積,因為它們更符合 Python :class:`串列 " +"`。" #: ../../library/heapq.rst:43 msgid "" @@ -90,8 +89,8 @@ msgid "" "without surprises: ``heap[0]`` is the smallest item, and ``heap.sort()`` " "maintains the heap invariant!" msgstr "" -"這兩個特性使得可以將堆積視為一個普通的 Python 串列而不會有意外:" -"``heap[0]`` 是最小的元素,而 ``heap.sort()`` 維持堆積性質不變!" +"這兩個特性使得可以將堆積視為一個普通的 Python 串列而不會有意外:``heap[0]`` " +"是最小的元素,而 ``heap.sort()`` 維持堆積性質不變!" #: ../../library/heapq.rst:47 msgid "" @@ -109,31 +108,35 @@ msgstr "" #: ../../library/heapq.rst:54 msgid "" "To create a heap, use a list initialized as ``[]``, or transform an existing " -"list into a min-heap or max-heap using the :func:`heapify` " -"or :func:`heapify_max` functions, respectively." +"list into a min-heap or max-heap using the :func:`heapify` or :func:" +"`heapify_max` functions, respectively." msgstr "" -"要建立一個堆積,使用初始化為 ``[]`` 的串列,或者分別使用 :func:`heapify` " -"或 :func:`heapify_max` 函式將現有的串列轉換為最小堆積或最大堆積。" +"要建立一個堆積,使用初始化為 ``[]`` 的串列,或者分別使用 :func:`heapify` 或 :" +"func:`heapify_max` 函式將現有的串列轉換為最小堆積或最大堆積。" #: ../../library/heapq.rst:58 msgid "The following functions are provided for min-heaps:" msgstr "提供了以下針對最小堆積的函式:" #: ../../library/heapq.rst:63 +msgid "Transform list *x* into a min-heap, in-place, in linear time." +msgstr "在線性時間內將串列 *x* 原地轉換為最小堆積。" + +#: ../../library/heapq.rst:68 msgid "" "Push the value *item* onto the *heap*, maintaining the min-heap invariant." msgstr "將值 *item* 推入 *heap*,並維持最小堆積性質不變。" -#: ../../library/heapq.rst:68 +#: ../../library/heapq.rst:73 msgid "" "Pop and return the smallest item from the *heap*, maintaining the min-heap " "invariant. If the heap is empty, :exc:`IndexError` is raised. To access " "the smallest item without popping it, use ``heap[0]``." msgstr "" -"從 *heap* 取出並回傳最小的元素,維持最小堆積性質不變。如果堆積為空," -"會引發 :exc:`IndexError`。若要在不取出的情況下存取最小元素,請使用 ``heap[0]``。" +"從 *heap* 取出並回傳最小的元素,維持最小堆積性質不變。如果堆積為空,會引發 :" +"exc:`IndexError`。若要在不取出的情況下存取最小元素,請使用 ``heap[0]``。" -#: ../../library/heapq.rst:75 +#: ../../library/heapq.rst:80 msgid "" "Push *item* on the heap, then pop and return the smallest item from the " "*heap*. The combined action runs more efficiently than :func:`heappush` " @@ -142,15 +145,11 @@ msgstr "" "將 *item* 放入 heap ,接著從 *heap* 取出並回傳最小的元素。這個組合函式比呼" "叫 :func:`heappush` 之後呼叫 :func:`heappop` 更有效率。" -#: ../../library/heapq.rst:82 -msgid "Transform list *x* into a min-heap, in-place, in linear time." -msgstr "在線性時間內將串列 *x* 原地轉換為最小堆積。" - #: ../../library/heapq.rst:87 msgid "" "Pop and return the smallest item from the *heap*, and also push the new " -"*item*. The heap size doesn't change. If the heap is " -"empty, :exc:`IndexError` is raised." +"*item*. The heap size doesn't change. If the heap is empty, :exc:" +"`IndexError` is raised." msgstr "" "從 *heap* 取出並回傳最小的元素,接著將新的 *item* 放進heap。heap 的大小不會改" "變。如果 heap 是空的會產生 :exc:`IndexError` 錯誤。" @@ -197,26 +196,27 @@ msgid "" "max-heap invariant. If the max-heap is empty, :exc:`IndexError` is raised. " "To access the largest item without popping it, use ``maxheap[0]``." msgstr "" -"從最大堆積 *heap* 取出並回傳最大的元素,維持最大堆積性質不變。如果最大堆積為空," -"會引發 :exc:`IndexError`。若要在不取出的情況下存取最大元素,請使用 ``maxheap[0]``。" +"從最大堆積 *heap* 取出並回傳最大的元素,維持最大堆積性質不變。如果最大堆積為" +"空,會引發 :exc:`IndexError`。若要在不取出的情況下存取最大元素,請使用 " +"``maxheap[0]``。" #: ../../library/heapq.rst:130 msgid "" "Push *item* on the max-heap *heap*, then pop and return the largest item " -"from *heap*. The combined action runs more efficiently " -"than :func:`heappush_max` followed by a separate call to :func:`heappop_max`." +"from *heap*. The combined action runs more efficiently than :func:" +"`heappush_max` followed by a separate call to :func:`heappop_max`." msgstr "" -"將 *item* 推入 max-heap *heap*,然後取出並回傳 *heap* 中最大的元素。" -"這個組合動作比先呼叫 :func:`heappush_max` 再單獨呼叫 :func:`heappop_max` 更有效率。" +"將 *item* 推入 max-heap *heap*,然後取出並回傳 *heap* 中最大的元素。這個組合" +"動作比先呼叫 :func:`heappush_max` 再單獨呼叫 :func:`heappop_max` 更有效率。" #: ../../library/heapq.rst:140 msgid "" "Pop and return the largest item from the max-heap *heap* and also push the " -"new *item*. The max-heap size doesn't change. If the max-heap is " -"empty, :exc:`IndexError` is raised." +"new *item*. The max-heap size doesn't change. If the max-heap is empty, :exc:" +"`IndexError` is raised." msgstr "" -"從最大堆積 *heap* 取出並回傳最大的元素,同時推入新的 *item*。" -"最大堆積的大小不會改變。如果最大堆積為空,會引發 :exc:`IndexError`。" +"從最大堆積 *heap* 取出並回傳最大的元素,同時推入新的 *item*。最大堆積的大小不" +"會改變。如果最大堆積為空,會引發 :exc:`IndexError`。" #: ../../library/heapq.rst:145 msgid "" @@ -293,26 +293,26 @@ msgid "" "Return a list with the *n* smallest elements from the dataset defined by " "*iterable*. *key*, if provided, specifies a function of one argument that " "is used to extract a comparison key from each element in *iterable* (for " -"example, ``key=str.lower``). Equivalent to: ``sorted(iterable, key=key)" -"[:n]``." +"example, ``key=str.lower``). Equivalent to: ``sorted(iterable, key=key)[:" +"n]``." msgstr "" "回傳一個包含資料 *iterable* 中前 *n* 小元素的 list 。如果有指定 *key* 引數," "*key* 會是只有一個引數的函式,用來從每一個在 *iterable* 中的元素提取一個比較" -"的依據(例如 ``key=str.lower`` )。效果相當於 ``sorted(iterable, key=key)" -"[:n]`` 。" +"的依據(例如 ``key=str.lower`` )。效果相當於 ``sorted(iterable, key=key)[:" +"n]`` 。" #: ../../library/heapq.rst:196 msgid "" "The latter two functions perform best for smaller values of *n*. For larger " "values, it is more efficient to use the :func:`sorted` function. Also, when " -"``n==1``, it is more efficient to use the built-in :func:`min` " -"and :func:`max` functions. If repeated usage of these functions is " -"required, consider turning the iterable into an actual heap." -msgstr "" -"後兩個函式在 *n* 值比較小時有最好的表現。對於較大的 *n* 值,只" -"用 :func:`sorted` 函式會更有效率。同樣地,當 ``n==1`` 時,使用內建函" -"式 :func:`min` 和 :func:`max` 會有更好的效率。如果需要重複使用這些函式,可以" -"考慮將 iterable 轉成真正的 heap 。" +"``n==1``, it is more efficient to use the built-in :func:`min` and :func:" +"`max` functions. If repeated usage of these functions is required, consider " +"turning the iterable into an actual heap." +msgstr "" +"後兩個函式在 *n* 值比較小時有最好的表現。對於較大的 *n* 值,只用 :func:" +"`sorted` 函式會更有效率。同樣地,當 ``n==1`` 時,使用內建函式 :func:`min` " +"和 :func:`max` 會有更好的效率。如果需要重複使用這些函式,可以考慮將 iterable " +"轉成真正的 heap 。" #: ../../library/heapq.rst:204 msgid "Basic Examples" diff --git a/library/html.parser.po b/library/html.parser.po index 999f46dd86..0e2c714153 100644 --- a/library/html.parser.po +++ b/library/html.parser.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-08 00:15+0000\n" +"POT-Creation-Date: 2025-11-01 00:16+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-" @@ -42,25 +42,32 @@ msgstr "建立一個能夠剖析無效標記的剖析器實例。" #: ../../library/html.parser.rst:22 msgid "" -"If *convert_charrefs* is ``True`` (the default), all character references " -"(except the ones in ``script``/``style`` elements) are automatically " -"converted to the corresponding Unicode characters." +"If *convert_charrefs* is true (the default), all character references " +"(except the ones in elements like ``script`` and ``style``) are " +"automatically converted to the corresponding Unicode characters." msgstr "" -"如果 *convert_charrefs* 為 ``True`` (預設值),所有字元參照 (reference)" -"( ``script``/``style`` 元素中的參照除外)將自動轉換為相應的 Unicode 字元。" +"如果 *convert_charrefs* 為 true (預設值),所有字元參照 (reference)" +"(元素中的參照除外,像是 ``script`` 和 ``style`` )將自動轉換為相應的 Unicode 字元。" #: ../../library/html.parser.rst:26 msgid "" +"If *scripting* is false (the default), the content of the ``noscript`` " +"element is parsed normally; if it's true, it's returned as is without being " +"parsed." +msgstr "" + +#: ../../library/html.parser.rst:30 +msgid "" "An :class:`.HTMLParser` instance is fed HTML data and calls handler methods " "when start tags, end tags, text, comments, and other markup elements are " "encountered. The user should subclass :class:`.HTMLParser` and override its " "methods to implement the desired behavior." msgstr "" ":class:`.HTMLParser` 實例被提供 HTML 資料,並在遇到開始標籤、結束標籤、文本、" -"註解和其他標記元素時呼叫處理程式 (handler) 方法。使用者應該繼" -"承 :class:`.HTMLParser` 並覆蓋其方法以實作所需的行為。" +"註解和其他標記元素時呼叫處理程式 (handler) 方法。使用者應該繼承 :class:`." +"HTMLParser` 並覆蓋其方法以實作所需的行為。" -#: ../../library/html.parser.rst:31 +#: ../../library/html.parser.rst:35 msgid "" "This parser does not check that end tags match start tags or call the end-" "tag handler for elements which are closed implicitly by closing an outer " @@ -69,28 +76,32 @@ msgstr "" "此剖析器不檢查結束標籤是否與開始標籤匹配,也不會為透過結束外部元素來隱晦地被" "結束的元素呼叫結束標籤處理程式。" -#: ../../library/html.parser.rst:34 +#: ../../library/html.parser.rst:38 msgid "*convert_charrefs* keyword argument added." msgstr "新增關鍵字引數 *convert_charrefs*。" -#: ../../library/html.parser.rst:37 +#: ../../library/html.parser.rst:41 msgid "The default value for argument *convert_charrefs* is now ``True``." msgstr "引數 *convert_charrefs* 的預設值現在是 ``True``。" -#: ../../library/html.parser.rst:42 +#: ../../library/html.parser.rst:44 +msgid "Added the *scripting* parameter." +msgstr "" + +#: ../../library/html.parser.rst:49 msgid "Example HTML Parser Application" msgstr "HTML 剖析器應用程式範例" -#: ../../library/html.parser.rst:44 +#: ../../library/html.parser.rst:51 msgid "" -"As a basic example, below is a simple HTML parser that uses " -"the :class:`HTMLParser` class to print out start tags, end tags, and data as " -"they are encountered:" +"As a basic example, below is a simple HTML parser that uses the :class:" +"`HTMLParser` class to print out start tags, end tags, and data as they are " +"encountered:" msgstr "" "以下的基礎範例是一個簡單的 HTML 剖析器,它使用 :class:`HTMLParser` 類別,當遇" "到開始標籤、結束標籤和資料時將它們印出:" -#: ../../library/html.parser.rst:48 +#: ../../library/html.parser.rst:55 msgid "" "from html.parser import HTMLParser\n" "\n" @@ -124,11 +135,11 @@ msgstr "" "parser.feed('Test'\n" " '

Parse me!

')" -#: ../../library/html.parser.rst:66 +#: ../../library/html.parser.rst:73 msgid "The output will then be:" msgstr "輸出將是:" -#: ../../library/html.parser.rst:68 +#: ../../library/html.parser.rst:75 msgid "" "Encountered a start tag: html\n" "Encountered a start tag: head\n" @@ -156,24 +167,24 @@ msgstr "" "Encountered an end tag : body\n" "Encountered an end tag : html" -#: ../../library/html.parser.rst:85 +#: ../../library/html.parser.rst:92 msgid ":class:`.HTMLParser` Methods" msgstr ":class:`.HTMLParser` 方法" -#: ../../library/html.parser.rst:87 +#: ../../library/html.parser.rst:94 msgid ":class:`HTMLParser` instances have the following methods:" msgstr ":class:`HTMLParser` 實例具有以下方法:" -#: ../../library/html.parser.rst:92 +#: ../../library/html.parser.rst:99 msgid "" "Feed some text to the parser. It is processed insofar as it consists of " -"complete elements; incomplete data is buffered until more data is fed " -"or :meth:`close` is called. *data* must be :class:`str`." +"complete elements; incomplete data is buffered until more data is fed or :" +"meth:`close` is called. *data* must be :class:`str`." msgstr "" "向剖析器提供一些文本。只要它由完整的元素組成,它就會被處理;不完整的資料會被" "緩衝,直到輸入更多資料或呼叫 :meth:`close`。 *data* 必須是 :class:`str`。" -#: ../../library/html.parser.rst:99 +#: ../../library/html.parser.rst:106 msgid "" "Force processing of all buffered data as if it were followed by an end-of-" "file mark. This method may be redefined by a derived class to define " @@ -181,20 +192,20 @@ msgid "" "should always call the :class:`HTMLParser` base class method :meth:`close`." msgstr "" "強制處理所有緩衝資料,如同它後面跟有文件結束標籤一樣。此方法可能有被衍生類別" -"重新定義,以在輸入末尾定義額外的處理,但重新定義的版本仍應要呼" -"叫 :class:`HTMLParser` 基底類別方法 :meth:`close`。" +"重新定義,以在輸入末尾定義額外的處理,但重新定義的版本仍應要呼叫 :class:" +"`HTMLParser` 基底類別方法 :meth:`close`。" -#: ../../library/html.parser.rst:107 +#: ../../library/html.parser.rst:114 msgid "" "Reset the instance. Loses all unprocessed data. This is called implicitly " "at instantiation time." msgstr "重置實例。丟棄所有未處理的資料。這在實例化時被會隱晦地呼叫。" -#: ../../library/html.parser.rst:113 +#: ../../library/html.parser.rst:120 msgid "Return current line number and offset." msgstr "回傳目前列號 (line number) 和偏移量 (offset)。" -#: ../../library/html.parser.rst:118 +#: ../../library/html.parser.rst:125 msgid "" "Return the text of the most recently opened start tag. This should not " "normally be needed for structured processing, but may be useful in dealing " @@ -205,23 +216,23 @@ msgstr "" "「已部署」的 HTML 或以最少的更改重新生成輸入(可以保留屬性之間的空白等)時可" "能很有用。" -#: ../../library/html.parser.rst:124 +#: ../../library/html.parser.rst:131 msgid "" "The following methods are called when data or markup elements are " "encountered and they are meant to be overridden in a subclass. The base " -"class implementations do nothing (except " -"for :meth:`~HTMLParser.handle_startendtag`):" +"class implementations do nothing (except for :meth:`~HTMLParser." +"handle_startendtag`):" msgstr "" "當遇到資料或標記元素時將呼叫以下方法,並且它們應在子類別中被覆蓋。基底類別實" "作什麼都不做(除了 :meth:`~HTMLParser.handle_startendtag`):" -#: ../../library/html.parser.rst:131 +#: ../../library/html.parser.rst:138 msgid "" "This method is called to handle the start tag of an element (e.g. ``
``)." msgstr "呼叫此方法來處理元素的開始標籤(例如 ``
``)。" -#: ../../library/html.parser.rst:133 +#: ../../library/html.parser.rst:140 msgid "" "The *tag* argument is the name of the tag converted to lower case. The " "*attrs* argument is a list of ``(name, value)`` pairs containing the " @@ -233,81 +244,80 @@ msgstr "" "列表,包含在標籤的 ``<>`` 括號內找到的屬性。 *name* 將被轉成小寫,*value* 中" "的引號會被刪除,字元和實體參照也會被替換。" -#: ../../library/html.parser.rst:139 +#: ../../library/html.parser.rst:146 msgid "" "For instance, for the tag ````, this method " -"would be called as ``handle_starttag('a', [('href', 'https://" -"www.cwi.nl/')])``." +"would be called as ``handle_starttag('a', [('href', 'https://www.cwi." +"nl/')])``." msgstr "" "例如,對於標籤 ````,這個方法會以 " "``handle_starttag('a', [('href', 'https://www.cwi.nl/')])`` 的形式被呼叫。" -#: ../../library/html.parser.rst:142 +#: ../../library/html.parser.rst:149 msgid "" "All entity references from :mod:`html.entities` are replaced in the " "attribute values." msgstr "在屬性值中來自 :mod:`html.entities` 的所有實體參照都會被替換。" -#: ../../library/html.parser.rst:148 +#: ../../library/html.parser.rst:155 msgid "" "This method is called to handle the end tag of an element (e.g. ``
``)." msgstr "呼叫此方法來處理元素的結束標籤(例如 ``
``)。" -#: ../../library/html.parser.rst:150 +#: ../../library/html.parser.rst:157 msgid "The *tag* argument is the name of the tag converted to lower case." msgstr "*tag* 引數是轉換為小寫的標籤名稱。" -#: ../../library/html.parser.rst:155 +#: ../../library/html.parser.rst:162 msgid "" "Similar to :meth:`handle_starttag`, but called when the parser encounters an " "XHTML-style empty tag (````). This method may be overridden by " "subclasses which require this particular lexical information; the default " -"implementation simply calls :meth:`handle_starttag` " -"and :meth:`handle_endtag`." +"implementation simply calls :meth:`handle_starttag` and :meth:" +"`handle_endtag`." msgstr "" "與 :meth:`handle_starttag` 類似,但在剖析器遇到 XHTML 樣式的空標籤 " "(````) 時呼叫。這個方法可能被需要這個特定詞彙資訊 (lexical " -"information) 的子類別覆蓋;預設實作只是呼叫 :meth:`handle_starttag` " -"和 :meth:`handle_endtag`。" +"information) 的子類別覆蓋;預設實作只是呼叫 :meth:`handle_starttag` 和 :meth:" +"`handle_endtag`。" -#: ../../library/html.parser.rst:163 +#: ../../library/html.parser.rst:170 msgid "" "This method is called to process arbitrary data (e.g. text nodes and the " -"content of ```` and ````)." +"content of elements like ``script`` and ``style``)." msgstr "" -"呼叫此方法來處理任意資料(例如文本節點與 ```` 和 " -"```` 的內容)。" +"呼叫此方法來處理任意資料(例如文本節點與像是 ``script`` 和 ``style`` 元素的內容)。" -#: ../../library/html.parser.rst:169 +#: ../../library/html.parser.rst:176 msgid "" "This method is called to process a named character reference of the form " "``&name;`` (e.g. ``>``), where *name* is a general entity reference (e.g. " -"``'gt'``). This method is never called if *convert_charrefs* is ``True``." +"``'gt'``). This method is only called if *convert_charrefs* is false." msgstr "" "呼叫此方法來處理形式為 ``&name;`` (例如 ``>``)的附名字元參照,其中 " -"*name* 是一般實體參照(例如 ``'gt'``)。如果 *convert_charrefs* 為 ``True``," -"則永遠不會呼叫此方法。" +"*name* 是一般實體參照(例如 ``'gt'``)。此方法只有在 *convert_charrefs* 為 " +"false 時才會被呼叫。" -#: ../../library/html.parser.rst:177 +#: ../../library/html.parser.rst:184 msgid "" "This method is called to process decimal and hexadecimal numeric character " "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``." +"``>``; in this case the method will receive ``'62'`` or ``'x3E'``. This " +"method is only called if *convert_charrefs* is false." msgstr "" "呼叫此方法來處理 :samp:`&#{NNN};` 和 :samp:`&#x{NNN};` 形式的十進位和十六進位" -"數字字元參照。例如,``>`` 的十進位等效為 ``>``,而十六進位為 " -"``>``;在這種情況下,該方法將收到 ``'62'`` 或 ``'x3E'``。如果 " -"*convert_charrefs* 為 ``True``,則永遠不會呼叫此方法。" +"數字字元參照。例如,``>`` 的十進位等效為 ``>``,而十六進位為 ``>" +"``;在這種情況下,該方法將收到 ``'62'`` 或 ``'x3E'``。此方法只有在 *convert_charrefs* 為 " +"false 時才會被呼叫。" -#: ../../library/html.parser.rst:186 +#: ../../library/html.parser.rst:193 msgid "" "This method is called when a comment is encountered (e.g. ````)。" -#: ../../library/html.parser.rst:188 +#: ../../library/html.parser.rst:195 msgid "" "For example, the comment ```` will cause this method to be " "called with the argument ``' comment '``." @@ -315,7 +325,7 @@ msgstr "" "舉例來說,註解 ```` 會使得此方法被以引數 ``' comment '`` 來呼" "叫。" -#: ../../library/html.parser.rst:191 +#: ../../library/html.parser.rst:198 msgid "" "The content of Internet Explorer conditional comments (condcoms) will also " "be sent to this method, so, for ```` 為例," "這個方法將會收到 ``'[if IE 9]>IE9-specific content``)." @@ -334,7 +344,7 @@ msgstr "" "呼叫此方法來處理 HTML 文件類型聲明 (doctype declaration)(例如 ````)。" -#: ../../library/html.parser.rst:201 +#: ../../library/html.parser.rst:208 msgid "" "The *decl* parameter will be the entire contents of the declaration inside " "the ```` markup (e.g. ``'DOCTYPE html'``)." @@ -342,7 +352,7 @@ msgstr "" "*decl* 參數將是 ```` 標記內聲明部分的全部內容(例如 ``'DOCTYPE " "html'``)。" -#: ../../library/html.parser.rst:207 +#: ../../library/html.parser.rst:214 msgid "" "Method called when a processing instruction is encountered. The *data* " "parameter will contain the entire processing instruction. For example, for " @@ -355,7 +365,7 @@ msgstr "" "``handle_pi(\"proc color='red'\")`` 形式被呼叫。它旨在被衍生類別覆蓋;基底類" "別實作中什麼都不做。" -#: ../../library/html.parser.rst:215 +#: ../../library/html.parser.rst:222 msgid "" "The :class:`HTMLParser` class uses the SGML syntactic rules for processing " "instructions. An XHTML processing instruction using the trailing ``'?'`` " @@ -364,12 +374,12 @@ msgstr "" ":class:`HTMLParser` 類別使用 SGML 語法規則來處理指示。使用有 ``?`` 跟隨在後面" "的 XHTML 處理指示將導致 ``?`` 被包含在 *data* 中。" -#: ../../library/html.parser.rst:222 +#: ../../library/html.parser.rst:229 msgid "" "This method is called when an unrecognized declaration is read by the parser." msgstr "當剖析器讀取無法識別的聲明時會呼叫此方法。" -#: ../../library/html.parser.rst:224 +#: ../../library/html.parser.rst:231 msgid "" "The *data* parameter will be the entire contents of the declaration inside " "the ```` markup. It is sometimes useful to be overridden by a " @@ -378,17 +388,17 @@ msgstr "" "*data* 參數將是 ```` 標記內聲明的全部內容。有時被衍生類別被覆蓋會是好" "用的。在基底類別實作中什麼都不做。" -#: ../../library/html.parser.rst:232 +#: ../../library/html.parser.rst:239 msgid "Examples" msgstr "範例" -#: ../../library/html.parser.rst:234 +#: ../../library/html.parser.rst:241 msgid "" "The following class implements a parser that will be used to illustrate more " "examples:" msgstr "以下類別實作了一個剖析器,將用於解說更多範例:" -#: ../../library/html.parser.rst:237 +#: ../../library/html.parser.rst:244 msgid "" "from html.parser import HTMLParser\n" "from html.entities import name2codepoint\n" @@ -458,27 +468,27 @@ msgstr "" "\n" "parser = MyHTMLParser()" -#: ../../library/html.parser.rst:273 +#: ../../library/html.parser.rst:280 msgid "Parsing a doctype:" msgstr "剖析文件類型:" -#: ../../library/html.parser.rst:275 +#: ../../library/html.parser.rst:282 msgid "" ">>> parser.feed('')\n" -"Decl : DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://" -"www.w3.org/TR/html4/strict.dtd\"" +"Decl : DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3." +"org/TR/html4/strict.dtd\"" msgstr "" ">>> parser.feed('')\n" -"Decl : DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://" -"www.w3.org/TR/html4/strict.dtd\"" +"Decl : DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3." +"org/TR/html4/strict.dtd\"" -#: ../../library/html.parser.rst:281 +#: ../../library/html.parser.rst:288 msgid "Parsing an element with a few attributes and a title:" msgstr "剖析一個具有一些屬性和標題的元素:" -#: ../../library/html.parser.rst:283 +#: ../../library/html.parser.rst:290 msgid "" ">>> parser.feed('\"The')\n" "Start tag: img\n" @@ -500,13 +510,13 @@ msgstr "" "Data : Python\n" "End tag : h1" -#: ../../library/html.parser.rst:295 +#: ../../library/html.parser.rst:302 msgid "" -"The content of ``script`` and ``style`` elements is returned as is, without " -"further parsing:" -msgstr "``script`` 和 ``style`` 元素的內容按原樣回傳,無需進一步剖析:" +"The content of elements like ``script`` and ``style`` is returned as is, " +"without further parsing:" +msgstr "像是 ``script`` 和 ``style`` 這類元素的內容將按原樣回傳,無需進一步的剖析:" -#: ../../library/html.parser.rst:298 +#: ../../library/html.parser.rst:305 msgid "" ">>> parser.feed('